<% 'Chache ausschalten (abgeschwächt) Response.Expires = 1 regionid = request("Regionid") if isnull(regionid) or regionid="" or regionid="3" then regionid="3" reg_where_k = "" reg_where_c = "" reg_from = "" else reg_where_k = " GRZ.KGewinn_ID=Kunden_Gewinnspiel.ID and GRZ.Region_ID=" & regionid & " and" reg_where_c = " GRZ.CCOGewinn_ID=CCO_Gewinnspiel.ID and GRZ.Region_ID=" & regionid & " and" reg_from = ", Gew_Reg_Zuord GRZ" end if akt_pg = request("Page") if isnull(akt_pg) or akt_pg="" then akt_pg = 1 else akt_pg = int(akt_pg) end if 'init Vars and Constants 'heute = date 'heute_2 = left(cstr(heute),6) & right(year(heute),2) 'heute_4 = left(cstr(heute),6) & year(heute) Const pg_size = 20 Const mpid = 2 set admin = Server.CreateObject("ADODB.Connection") set markt = Server.CreateObject("ADODB.Connection") set rs_a = Server.CreateObject("ADODB.RecordSet") set rs_m = Server.CreateObject("ADODB.RecordSet") sql_reg = "Select Region, R_Text_Neu, R_Titel from Region where ID=" & regionid sql_gew_k = "Select Kopf.ID, Kopf.KSeiten_ID, Kopf.CCOSeiten_ID, Kunden_Gewinnspiel.User_ID, Seitennummer, Rubrik_ID, Rubrik, ABS(Beginndatum>Date()-7), Homepage_Img, Kopftext, Title, Beginndatum, Endedatum, Format.Breite, Format.Hoehe from Kopf, Kunden_Gewinnspiel" & reg_from & ", Rubrik, Internet, Format where" & reg_where_k & " Kopf.KSeiten_ID=Kunden_Gewinnspiel.ID and Rubrik_ID=Rubrik.ID and User_ID=Internet.ID and Bann=0 and Date() between Beginndatum and Endedatum and Kunden_Gewinnspiel.Format_ID=Format.ID and Aktiv=-1 and Vorschau=0 " sql_gew_c = "Select Kopf.ID, Kopf.KSeiten_ID, Kopf.CCOSeiten_ID, CCO_Gewinnspiel.User_ID, 0 as Seitennummer, Rubrik_ID, Rubrik, ABS(Beginndatum>Date()-7), Homepage_Img, Kopftext, Title, Beginndatum, Endedatum, Format.Breite, Format.Hoehe from Kopf, CCO_Gewinnspiel" & reg_from & ", Rubrik, Internet, Format where" & reg_where_c & " Kopf.CCOSeiten_ID=CCO_Gewinnspiel.ID and Rubrik_ID=Rubrik.ID and User_ID=Internet.ID and Bann=0 and Date() between Beginndatum and Endedatum and CCO_Gewinnspiel.Format_ID=Format.ID and Aktiv=-1 and Vorschau=0 " sql_gew_all = sql_gew_k & "Union " & sql_gew_c & "order by Beginndatum desc, Kopftext" sql_rub_all = "Select Rubrik.ID, Rubrik, 0 as Anzahl from Rubrik where Rubrik.ID>0 order by Rubrik" 'response.write sql_gew_all & "
" 'response.write sql_rub_all & "
" admin.open("admin") markt.open("gewinnspiel") rs_a.open sql_reg, admin, 3 if not rs_a.EOF then region = rs_a("Region") r_text = rs_a("R_Text_Neu") r_titel = rs_a("R_Titel") end if rs_a.close admin.close rs_m.open sql_gew_all, markt, 3 if not rs_m.EOF then ang_anz = rs_m.RecordCount rs_m.move (akt_pg-1)*pg_size bookm = rs_m.Bookmark ang_array = rs_m.getRows(pg_size,bookm) pg_anz = get_Pageanz(ang_anz,pg_size) list_anz = ubound(ang_array,2) 'create Day-Tipp from All-Selection dtip = get_RND_Index(0,ang_anz) dtip_kopfid = ang_array(0,dtip) else ang_anz = 0 pg_anz = 0 list_anz = -1 dtip = -1 dtip_kopfid = 0 end if rs_m.close rs_m.open sql_rub_all, markt, 3 if not rs_m.EOF then rub_anz = rs_m.RecordCount-1 rub_array = rs_m.getRows() else rub_anz = -1 end if rs_m.close 'avoid reading the Day-Tip again sql_rub_k = "Select Rubrik.ID, Rubrik, count(*) from Rubrik, Kunden_Gewinnspiel, Gew_Reg_Zuord GRZ, Kopf, Internet where Rubrik.ID=Kunden_Gewinnspiel.Rubrik_ID and Kunden_Gewinnspiel.ID=GRZ.KGewinn_ID and GRZ.KGewinn_ID=Kopf.KSeiten_ID and Kunden_Gewinnspiel.User_ID=Internet.ID and GRZ.Region_ID=" & regionid & " and Homepage=-1 and Bann=0 and Date() between Beginndatum and Endedatum and not Kopf.ID=" & dtip_kopfid & " and Aktiv=-1 and Vorschau=0 group by Rubrik.ID, Rubrik " sql_rub_c = "Select Rubrik.ID, Rubrik, count(*) from Rubrik, CCO_Gewinnspiel, Gew_Reg_Zuord GRZ, Kopf, Internet where Rubrik.ID=CCO_Gewinnspiel.Rubrik_ID and CCO_Gewinnspiel.ID=GRZ.CCOGewinn_ID and GRZ.CCOGewinn_ID=Kopf.CCOSeiten_ID and CCO_Gewinnspiel.User_ID=Internet.ID and GRZ.Region_ID=" & regionid & " and Homepage=-1 and Bann=0 and Date() between Beginndatum and Endedatum and not Kopf.ID=" & dtip_kopfid & " and Aktiv=-1 and Vorschau=0 group by Rubrik.ID, Rubrik " sql_rub_gr = sql_rub_k & "Union " & sql_rub_c & "order by Rubrik" sql_hp_k = "Select Kopf.ID, Kopf.KSeiten_ID, Kopf.CCOSeiten_ID, Kunden_Gewinnspiel.User_ID, Seitennummer, Rubrik_ID, Rubrik, Homepage_Img, Kopftext, Title, Beginndatum, Endedatum, Format.Breite, Format.Hoehe from Kopf, Kunden_Gewinnspiel, Gew_Reg_Zuord GRZ, Rubrik, Internet, Format where Kopf.KSeiten_ID=Kunden_Gewinnspiel.ID and Kunden_Gewinnspiel.ID=GRZ.KGewinn_ID and Rubrik_ID=Rubrik.ID and User_ID=Internet.ID and GRZ.Region_ID=" & regionid & " and Homepage=-1 and Bann=0 and Date() between Beginndatum and Endedatum and not Kopf.ID=" & dtip_kopfid & " and Kunden_Gewinnspiel.Format_ID=Format.ID and Aktiv=-1 and Vorschau=0 " sql_hp_c = "Select Kopf.ID, Kopf.KSeiten_ID, Kopf.CCOSeiten_ID, CCO_Gewinnspiel.User_ID, 0 as Seitennummer, Rubrik_ID, Rubrik, Homepage_Img, Kopftext, Title, Beginndatum, Endedatum, Format.Breite, Format.Hoehe from Kopf, CCO_Gewinnspiel, Gew_Reg_Zuord GRZ, Rubrik, Internet, Format where Kopf.CCOSeiten_ID=CCO_Gewinnspiel.ID and CCO_Gewinnspiel.ID=GRZ.CCOGewinn_ID and Rubrik_ID=Rubrik.ID and User_ID=Internet.ID and GRZ.Region_ID=" & regionid & " and Homepage=-1 and Bann=0 and Date() between Beginndatum and Endedatum and not Kopf.ID=" & dtip_kopfid & " and CCO_Gewinnspiel.Format_ID=Format.ID and Aktiv=-1 and Vorschau=0 " sql_gew_hp = sql_hp_k & "Union " & sql_hp_c & "order by Rubrik" 'response.write sql_rub_gr & "
" 'response.write sql_gew_hp & "
" rs_m.open sql_rub_gr, markt, 3 if not rs_m.EOF then rubgr_anz = rs_m.Recordcount-1 rubgr_array = rs_m.getRows() else rubgr_anz = -1 end if rs_m.close rs_m.open sql_gew_hp, markt, 3 if not rs_m.EOF then hp_anz = rs_m.RecordCount hp_array = rs_m.getRows() else hp_anz = -1 end if rs_m.close markt.close set rs_a = nothing set rs_m = nothing set admin = nothing set markt = nothing 'Union-Count-rubgr_array zusammenfassen, Werte in rub_array übertragen for g=0 to rubgr_anz gr_rubid = rubgr_array(0,g) rub_idx = get_ArrayIndex(gr_rubid) rub_array(2,rub_idx) = rub_array(2,rub_idx) + rubgr_array(2,g) next %> cco.de - Ihr regionaler Marktplatz
Marktplatzwechsel <%=r_titel%>
  go!
  Branchenfinder
  Regiofinder
  Schnäppchen
  Highlights
  Profi-Tipps
  Online-Shopping
  Autobörse
  Reisewelt
  Kostenlos
  Branchen-News
  XXL-Power-Anfrage
  Profisuche
  Newsletter Abo
  cco.de and more
  Profi Homepages
  Promotion in cco.de
  Company
  Karriere bei cco.de
  Kontakt
  Gewinnspiel des Tages (<%=r_text%>)
  <% if not dtip = -1 then response.write "" & chr(13) hp_bild = not(ang_array(8,dtip) = "" or isnull(ang_array(8,dtip)) or ang_array(8,dtip)="blind.gif") len_txt = 150 if hp_bild then response.write "" response.write "" & chr(13) len_txt = 100 end if response.write "" & chr(13) response.write "" & chr(13) response.write "" & chr(13) response.write "" & chr(13) else response.write "" & chr(13) response.write "" response.write "" & chr(13) response.write "" & chr(13) response.write "" & chr(13) response.write "" & chr(13) end if %>
" & ang_array(10,dtip) & " präsentiert:
" & konv_Text(ang_array(9,dtip),"Titel",40,false) & "
" & ang_array(11,dtip) & " bis " & ang_array(12,dtip) & "
" & ang_array(6,dtip) & "
Hier könnte Ihre Werbung stehen!

Nehmen Sie mit uns Kontakt auf!
weiter...
  Gewinnspiele-Navigator (<%=r_text%>)
  <% for i=0 to 0 response.write "" & chr(13) for j=0 to 2 rub_index = j response.write "" & chr(13) next response.write "" & chr(13) response.write "" & chr(13) next %>
A L L E     G E W I N N S P I E L E
" & rub_array(1,rub_index) & "
  <%=r_text%> > Alle Gewinnspiele (<%=ang_anz%>)
  Gewinnspiele: <% str_page = "einstieg.asp?Regionid=" & regionid & "&Page=" for page=1 to pg_anz pg_first = (page-1) * pg_size + 1 pg_last = pg_first + pg_size - 1 if pg_last > ang_anz then pg_last = ang_anz strout = "[" & pg_first & "-" & pg_last & "]" if page=akt_pg then response.write " " & strout & " " else response.write " " & strout & " " end if next %>
  <% for i=0 to list_anz response.write "" & chr(13) response.write "" & chr(13) response.write "" & chr(13) response.write "" & chr(13) response.write "" & chr(13) next %>
Kategorie: Gewinnspiel:
" & ang_array(6,i) & "" & konv_Text(ang_array(9,i),"Titel",30,false) & "
<% start = 0 for i=0 to rub_anz hp_anz = rub_array(2,i) if hp_anz>0 then response.write "" & chr(13) response.write "" & chr(13) response.write "" & chr(13) ang_idx = get_RND_Index(start,hp_anz) response.write "" & chr(13) response.write "" response.write "" & chr(13) response.write "" & chr(13) hp_bild = not(hp_array(7,ang_idx) = "" or isnull(hp_array(7,ang_idx)) or hp_array(7,ang_idx)="blind.gif") if hp_bild then response.write "" & chr(13) end if response.write "" & chr(13) end if start = start + hp_anz next %>
 " & rub_array(1,i) & "
" & konv_Text(hp_array(8,ang_idx),"Titel",35,false) & "
 " & hp_array(10,angidx) & " bis " & hp_array(11,ang_idx) & "
 
<% function get_RND_Index(byVal min,byVal margin) randomize(time) get_RND_Index = min + int(margin*rnd()) end function function get_Pageanz(byVal records,byVal div) rest = records mod div get_Pageanz = int(records/div)+abs(rest>0) end function function get_ArrayIndex(byVal rubid) retidx = -1 for i=0 to rub_anz if rub_array(0,i)=rubid then retidx = i exit for end if next get_ArrayIndex = retidx end function function konv_Text(newstext,feld,length,leer) if len(newstext)>0 then newstext = replace(newstext,"
"," ") newstext = replace(newstext,"&squot;","'") newstext = trim(newstext) end if newstext = eliminate_all_HTML(newstext) if len(newstext) > length then newstext = left(newstext,instrrev(newstext," ",length+1)) & "..." end if if not leer and (newstext = "..." or newstext = "" or len(newstext)=0) then newstext = "Kein " & feld konv_Text = newstext end function function eliminate_all_HTML(byVal parastr) nlength = len(parastr) out_buffer = "" for chridx=1 to nlength zeichen = mid(parastr,chridx,1) if not zeichen = "<" then 'append to result-String out_buffer = out_buffer & zeichen else 'jump to the end of html-Tag or to the end of String chridx = instr(chridx+1,parastr,">") if chridx = 0 then chridx = nlength end if next eliminate_all_HTML = out_buffer end function %>