<?PHP

#####################################################################
##                                                                 ##
##                       Easy Banner Free                          ##
##                 http://www.phpwebscripts.com/                   ##
##                 e-mail: info@phpwebscripts.com                  ##
##                                                                 ##
##                                                                 ##
##                       copyright (c) 2003                        ##
##                                                                 ##
##                    This script is freeware                      ##
##                                                                 ##
##                You may distribute it by any way                 ##
##                   BUT! You may not modify it!                   ##
## Removing the link to PHPWebScripts.com is a copyright violation.##
##   Altering or removing any of the code that is responsible, in  ##
##   any way, for generating that link is strictly forbidden.      ##
##   Anyone violating the above policy will have their license     ##
##   terminated on the spot.  Do not remove that link - ever.      ##
##                                                                 ##
#####################################################################

include("./data/data.php"); include("./common.php");
$q = mysql_query("select userid from ebfmembers where userid = '$HTTP_GET_VARS[ID]'"); $ex = mysql_fetch_row($q);if ($ex[0]) mysql_query("update ebfmembers set meshows = meshows+1,earned = (meshows*$s[ratio]),notused = (notused+$s[ratio]) where userid = '$HTTP_GET_VARS[ID]'"); $q = mysql_query("select max(number) from ebfmembers"); $data = mysql_fetch_row($q);
list($usec, $sec) = explode(' ', microtime()); srand((float) ($sec+($usec * 100000))); $i=rand(0,$data[0]);
$q = mysql_query("select * from ebfmembers where number > '$i' AND approved=1 AND notused >= 1 AND NOT(userid like '$HTTP_GET_VARS[ID]') ORDER BY number LIMIT 1"); $data1 = mysql_fetch_array($q); 
if (!($data1[userid])) { $i=0; $q = mysql_query("select * from ebfmembers where number > '$i' AND approved=1 AND notused >= 1 AND NOT(userid like '$HTTP_GET_VARS[ID]') ORDER BY number LIMIT 1"); $data1 = mysql_fetch_array($q); }

if ($data1[userid])
{ echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n<HTML><HEAD>
  <META http-equiv=Content-Type content=\"text/html;\"></HEAD>
  <BODY><table border=0 cellpadding=0 cellspacing=0 width=$s[bwidth]><tr>
  <td width=$s[bwidth] valign=\"top\" align=\"left\"><a target=\"_top\" href=\"$data1[siteurl]\"><img border=0 src=\"$data1[urlbanner]\" width=$s[bwidth] height=$s[bheight]></a>
  </td></tr></table></BODY>";
  $vysledek = mysql_query("update ebfmembers set notused = notused-1,weshow = weshow+1 where userid = '$data1[userid]'");
}
else
{ echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n<HTML><HEAD>
  <META http-equiv=Content-Type content=\"text/html;\"></HEAD>
  <BODY><table border=0 cellpadding=0 cellspacing=0 width=$s[bwidth]><tr>
  <td width=$s[bwidth] valign=\"top\" align=\"left\"><a target=\"_top\" href=\"$s[defaulturl]\"><img border=0 src=\"$s[defaultbanner]\" width=$s[bwidth] height=$s[bheight]></a>
  </td></tr></table></BODY>";
}

?>