query_first("SELECT id, partner, mitteltyp FROM werbemittel WHERE active=1 AND width=".intval($_GET['w'])." AND height=".intval($_GET['h'])." ORDER BY RAND() LIMIT 1", __FILE__, __LINE__)) die(); if ($werbemittel['mitteltyp'] == 1) { // BANNER WITH IMAGE $data = $DB_site->query_first("SELECT image, target FROM bannercodes WHERE id=".intval($werbemittel['id']), __FILE__, __LINE__); echo ''; flush(); } elseif ($werbemittel['mitteltyp'] == 2) { // BANNER WITH HTML CODE $data = $DB_site->query_first("SELECT adcode FROM adcodes WHERE id=".intval($werbemittel['id']), __FILE__, __LINE__); echo ''.$data['adcode'].''; flush(); } else { die(); } if (isset($werbemittel['partner']) && $werbemittel['partner'] > 0) { $DB_site->query("UPDATE Partner SET views=views+1 WHERE id=".intval($werbemittel['partner']), __FILE__, __LINE__); $DB_site->query("UPDATE werbemittel SET views=views+1 WHERE id=".intval($werbemittel['id']), __FILE__, __LINE__); $DB_site->query("INSERT INTO Views SET banner = ".intval($werbemittel['id']).", partner = ".intval($werbemittel['partner']).", year = ".intval(date("Y", time())).", month = ".intval(date("m", time())).", day = ".intval(date("d", time())).", hour = ".intval(date("H", time())).", min = ".intval(date("i", time())).", sec = ".intval(date("s", time())).", ip = '".mysql_real_escape_string($_SERVER['REMOTE_ADDR'])."'", __FILE__, __LINE__); } ?>