<% set objConn = Server.CreateObject("ADODB.Connection") objConn.open "DSN=banner_system" Select Case request("action") Case "" '-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Portal = "11" Select Case request("side") Case "startside" category = "1" Case "erhverv" category = "3" Case "brancher" category = "3" Case "uddannelse" category = "7" Case "nyheder" category = "9" Case "turisme" category = "9" Case "kalender" category = "13" Case "kultur-fritid" category = "13" Case "shopping" category = "7" Case "offentlig-info" category = "9" Case "godtblandet" category = "7" Case "support" category = "25" Case "sydfyn-info" category = "25" Case "soeg" category = "3" Case Else category = "1" End Select MyDate = datepart("yyyy",date) & "-" & datepart("m",date) & "-" & datepart("d",date) SQL = "SELECT distinct i.banner_data_id as i_id " SQL = SQL & "from banner_data as i left join banner_xref_portals as x on(i.banner_data_id = x.banner_data_id) " SQL = SQL & "WHERE i.active = 'true' AND i.startdate <= '" & MyDate & "' AND i.enddate >= '" & MyDate & "' " SQL = SQL & "AND x.portal_id = '" & Portal & "' AND x.category_id = '" & Category & "' " SQL = SQL & "order by rand() limit 0,2" set rs = objConn.execute(SQL) ' Banner 1 if not rs.eof then banner_1 = rs("i_id") end if rs.movenext ' Banner 2 if not rs.eof then banner_2 = rs("i_id") else banner_2 = banner_1 end if rs.close %> Sydfyn-info.dk - banner
<% ID = banner_1 sql = "SELECT * FROM banner_data WHERE banner_data_id='" & ID & "'" set rs = objConn.execute(sql) Response.write "" & vbCrLf set rs = objConn.execute("UPDATE banner_data SET u_expo=u_expo+1 WHERE banner_data_id = " & int(ID)) strSQL_GET = "SELECT * FROM banner_expo WHERE date = '" & DatePart("yyyy",now) & "-" & DatePart("m",now) & "-" & DatePart("d",now) & "' "_ & "AND hour = '" & Hour(now) & "' AND banner_id = '" & ID & "'" Set GetPrev = objConn.execute(strSQL_GET) If Not GetPrev.eof Then strSQL_Update = "UPDATE banner_expo SET expo='" & Int(GetPrev("expo")) + 1 & "' WHERE banner_id = '" & Int(ID) & "' "_ & "AND date = '" & DatePart("yyyy",now) & "-" & DatePart("m",now) & "-" & DatePart("d",now) & "' "_ & "AND hour = '" & Hour(now) & "'" Else strSQL_Update = "INSERT INTO banner_expo(banner_id,date,hour,expo) VALUES('" & Int(ID) & "','" & DatePart("yyyy",now) & "-" & DatePart("m",now) & "-" & DatePart("d",now) & "',"_ & "'" & Hour(now) & "','" & 1 & "')" End If objConn.execute(strSQL_Update) Set GetPrev = nothing %>

Fynkunst ... Bed & Breakfast ... Daic.dk ... Opslagstavlen ... Postkort ... Havne Sydfyn ... Brugtbil-basen

<% '-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Case "redirect" '-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= if request("id") <> "" then ID = int(request("id")) BannerSQL = "SELECT * FROM banner_data WHERE banner_data_id = '" & ID & "'" set banner = objConn.execute(BannerSQL) UpdateSQL = "UPDATE banner_data SET u_hits = '" & int(banner("u_hits")) + 1 & "' WHERE banner_data_id = '" & ID & "'" objConn.execute(UpdateSQL) strSQL_GET = "SELECT * FROM banner_hits WHERE date = '" & DatePart("yyyy",now) & "-" & DatePart("m",now) & "-" & DatePart("d",now) & "' "_ & "AND hour = '" & Hour(now) & "' AND banner_id = '" & ID & "'" Set GetPrev = objConn.execute(strSQL_GET) If Not GetPrev.eof Then strSQL_Update = "UPDATE banner_hits SET hits='" & Int(GetPrev("hits")) + 1 & "' WHERE banner_id = '" & ID & "' "_ & "AND date = '" & DatePart("yyyy",now) & "-" & DatePart("m",now) & "-" & DatePart("d",now) & "' "_ & "AND hour = '" & Hour(now) & "'" Else strSQL_Update = "INSERT INTO banner_hits(banner_id,date,hour,hits) VALUES('" & Int(ID) & "','" & DatePart("yyyy",now) & "-" & DatePart("m",now) & "-" & DatePart("d",now) & "',"_ & "'" & Hour(now) & "','" & 1 & "')" End If objConn.execute(strSQL_Update) Set GetPrev = nothing response.redirect(banner("url")) end if '-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= End Select set rs = nothing objConn.close: set conn = nothing %>