no_strict(); $tpl->define( array( t_md => "media.html", t_me => "metatags.html", t_bt => "banner1.html", t_btop => "banner_main.html", t_bt2 => "banner1b.html", t_bb => "banner2.html", // t_b3 => "banner3.html", t_a1 => "anleitung.html", t_a2 => "anleitung2.html", t_a3 => "anleitung3.html", t_i => "impressum.html", t_i2 => "impressum2.html", t_i3 => "impressum3.html", t_l => "ltd.html", t_m => "main_christmas.html", t_e => "empfehlung.html", t_e1 => "empfehlung1.html", t_s => "spielen.html", t_t1 => "teilname.html", t_t2 => "teilname2.html", t_t3 => "teilname3.html" ) ); } function setup() { global $pathinfo, $dbconn, $rootid, $PATH_INFO, $SCRIPT_NAME, $i_script; InitializeTemplates(); $dbconn = db_connect(); $i_script = $SCRIPT_NAME; } function ParseBanners() { global $tpl; $tpl->parse(METATAGS, ".t_me"); //$tpl->assign(BANNERT, banner_display(8)); $tpl->parse(BANNERT, ".t_btop"); $tpl->assign(BANNERT2, ""); // $tpl->parse(BANNERT, ".t_bt"); // $tpl->parse(BANNERT2, ".t_bt2"); // $tpl->parse(BANNER3, ".t_b3"); // $tpl->parse(BANNERB, ".t_bb"); $tpl->assign(BANNERB, banner_display(1)); //$tpl->assign(BANNER3, banner_display(2)); $tpl->assign(BANNER3, ''); } function CheckSession() { global $db, $dbconn; global $s; $session = explode(":", base64_decode($s)); // echo $session[1]; // session ok? if (count($session) != 2) { return 0; } // session too old? if (time() - $session[0] > 3600) { return 0; } // code ok? $query = "select id from usedgames where code='$session[1]'"; $result = @mysql_query($query, $dbconn); $m = @mysql_num_rows($result); if ($m == 0) { return 0; } return $session[1]; } function ParseTitle() { global $tpl; global $db, $dbconn; global $i_script, $code; $query = "select kunden.name as kundename from usedgames,kunden where kunden.id=usedgames.kunde and usedgames.code='$code'"; $result = @mysql_query($query, $dbconn); $tpl->assign(TITLE, "Dieses Gewinnspiel wird präsentiert von " . @mysql_result($result, 0, "kundename")); } function page($url, $session) { global $tpl; ParseBanners(); $tpl->assign(SESSION, $session); if ($session == '') { $tpl->assign(CODE, 'c=999999999'); $tpl->assign(TITLE, 'play and win'); } else { ParseTitle(); $tpl->assign(CODE, $session); } $tpl->parse(FINAL, $url); $tpl->FastPrint(FINAL); } //------------------ setup(); if (isset($s)) { $code = CheckSession(); $session = "s=$s&"; } else { $session = ''; } if (isset($p)) { $page = $p; } else { $page = 't_m'; } page($page, $session);