0 or adklick>0 or endedatum>='$datums') and startdatum<='$datums' and siteid='$array[$i]' and code='1') and ((endezeit>='$day' and startzeit<='$day') or (endezeit\"werbung\""); exit; } array_pop($array22); $zahlencode= count($array22); $zahlencode--; $trefferidcode= rand(0,$zahlencode); $trefferid= $array22[$trefferidcode]; } elseif($banner!="") { $trefferid=$banner; } else { $treffercodecode=0; $array22= array(1); $query2="SELECT * FROM $sitetable1 WHERE ((ads>0 or adklick>0 or endedatum>='$datums') and startdatum<='$datums' and code='1') and ((endezeit>='$day' and startzeit<='$day') or (endezeit\"werbung\""); exit; } array_pop($array22); $zahlencode= count($array22); $zahlencode--; mt_srand(); $trefferidcode= mt_rand(0,$zahlencode); $trefferid= $array22[$trefferidcode]; } if($trefferid=="") { echo("\"werbung\""); exit; } $listenid="b$trefferid"; $sitetablecode="$sitetablepre$listenid"; $query="DELETE FROM $sitetable21 WHERE zeit < ".time().""; mysql_db_query($dbname,$query,$conn) or die(mysql_error()); $ip= getenv ("REMOTE_ADDR"); $schreibencode=0; $query2="SELECT * FROM $sitetable21 WHERE ipnummer='$ip' and code='b' and nummer='$trefferid'"; $result2=mysql_db_query($dbname,$query2,$conn) or die(mysql_error()); while($date=mysql_fetch_row($result2)) { $schreibencode=1; } if($schreibencode=="0") { $b = $_SERVER[HTTP_USER_AGENT]; $vers = 0.0; if (eregi('Opera[ \/]([0-9\.]+)' , $b, $a)) { $type = 'Opera';} elseif (eregi('Netscape[[:alnum:]]*[ \/]([0-9\.]+)', $b, $a)) { $type = 'Netscape';} elseif (eregi('MSIE[ \/]([0-9\.]+)', $b, $a)) { $type = 'Explorer';} elseif (eregi('Mozilla[ \/]([0-9\.]+)' , $b, $a)) { if (eregi('compatible' , $b)) { $type = 'Unknown';} else { $type = 'Netscape';}} elseif (eregi('([[:alnum:]]+)[ \/v]*([0-9\.]+)' , $b, $a)) { $type = $a[1]; $vers = $a[2];} else { $type = 'Unknown';} if (!$vers) $vers = $a[1]; $browser['type'] = $type; $browser['version'] = $vers; if (eregi('Win',$b)) $browser['platform'] = 'Windows'; elseif (eregi('Mac',$b)) $browser['platform'] = 'Mac'; else $browser['platform'] = 'Other'; $btype= $browser['type']; $vers =$browser['version']; $platf =$browser['platform']; $uhrzeit= date("H:i:s"); $datumcode= date("jmY"); $datum= date("d.m.Y"); $stunde= date("H"); $query="INSERT INTO $sitetablecode (siteid,ip,btype,vers,platf,stunde,uhrzeit,datumcode,datum,art,vcode,code,zeit,gruppe) VALUES ('','$ip','$btype','$vers','$platf','$stunde','$uhrzeit','$datumcode','$datum','vieve','','0',' ".(time()+$termteimcods)." ','$gruppe')"; mysql_db_query($dbname,$query,$conn) or die(mysql_error()); $query="INSERT INTO $sitetable21 (siteid,ipnummer,zeit,code,nummer) VALUES ('','$ip',' ".(time()+$termteimcods)." ','b','$trefferid')"; mysql_db_query($dbname,$query,$conn) or die(mysql_error()); $query="UPDATE $sitetable1 SET ads=ads-1 WHERE siteid='$trefferid' and ads>'0'"; mysql_db_query($dbname,$query,$conn) or die (mysql_error()); } $vcode= date("U"); $query2="SELECT * FROM $sitetable1 WHERE siteid='$trefferid' and code='1'"; $result2=mysql_db_query($dbname,$query2,$conn) or die (mysql_error()); while($date=mysql_fetch_array($result2)) { if($date[sart]=="grafik") { $bannercode="\"$date[alttext]\""; } elseif($date[sart]=="flash") { $flashswf=$date[flashbanner]; $flashwidth=$date[flashbanner1]; $flashheight=$date[flashbanner2]; $bannercode = str_replace("{flashswf}",$flashswf,$flashvor); $bannercode = str_replace("{flashwidth}",$flashwidth,$bannercode); $bannercode = str_replace("{flashheight}",$flashheight,$bannercode); } elseif($date[sart]=="html") { $bannercode="$date[htmlbanner]"; } } echo($bannercode); ?>