"; if ($list_name) { echo""; if ($show_randomlink) { echo" \"$lang[random]\""; } echo"
$list_name
"; } echo""; echo"
$lang[rank]
"; echo"
$lang[site] [$fromsite - $tosite]
"; echo"
$lang[votes]
"; echo"
$lang[hits]
"; if ($show_rating) { echo"
$lang[rate]
"; } echo"\n"; } # Status ################################################################################################# if($status == "NOK") { echo $lang[anti_cheat_msg]; } elseif($status == "OK") { echo $lang[vote_log_msg]; } elseif($status == "NF") { echo $lang[not_found_msg]; } elseif($status == "TILT") { echo $lang[tilt_msg]; } elseif($status == "NOC") { echo $lang[nocookie_msg]; } elseif($status == "BAN") { echo $lang[ban_msg]; } # Start mySQL ################################################################################################# mysql_connect($server, $db_user, $db_pass) or die ("Database Connect Error"); $timestamp=time(); if (empty($perpage) && $breaks_perpage>0) {$perpage = $breaks_perpage*$break_time;} else {$perpage = $max_listsize;} if (empty($offset)) {$offset = 0;} $sql = "SELECT id FROM sites WHERE 1=1"; if ($cat) {$sql.=" AND cat='$cat'";} if ($search) {$sql.=" AND (site_name LIKE '%".$search."%' OR site_desc LIKE '%".$search."%')";} $query = mysql_db_query($database, $sql) or die(geterrdesc($sql)); $listcountall=mysql_num_rows($query); $sql = "SELECT * FROM sites WHERE inactive='0'"; if ($webmasterapproval) {$sql.=" AND approved='1'";} if ($emailapproval) {$sql.=" AND emailapproved='1'";} if ($tilt_insp) {$sql.=" AND tilt_time<'$timestamp'";} if ($min_votes_require>0) {$sql.=" AND votes>='$min_votes_require'";} if ($cat) {$sql.=" AND cat='$cat'";} if ($search) {$sql.=" AND (site_name LIKE '%".$search."%' OR site_desc LIKE '%".$search."%')";} $psql = $sql." ORDER BY $listsorting DESC, $listsorting2 DESC LIMIT 0, $max_listsize"; $sql .= " ORDER BY $listsorting DESC, $listsorting2 DESC LIMIT $offset, $perpage"; $pquery = mysql_db_query($database, $psql) or die(geterrdesc($psql)); $query = mysql_db_query($database, $sql) or die(geterrdesc($sql)); $pagecount=mysql_num_rows($pquery); $listcount=mysql_num_rows($query); # PageNumbers ################################################################################################# $pagesstr.="\n"; if ($show_categories) { $pagesstr.=""; } if ($show_languages) { $pagesstr.="\n"; } if ($show_search) { $pagesstr.=""; } $pagesstr.="
"; echo" "; $pagesstr.="
\n"; $pagesstr.="
\n"; $raw_list_url=rawurlencode($list_url); echo" "; $pagesstr.="
\n"; $pagesstr.="
\n"; $pagesstr.=" \n"; $pagesstr.="\n"; $pagesstr.="
\n"; $pages = ceil($pagecount / $perpage);$actpage = ($offset+$perpage)/$perpage;if ($pages>1) { // print only when pages > 0 $pagesstr.="
$lang[pages]\n"; for($i = 0; $i < $pages; $i++) { $noffset = $i * $perpage; $actual = $i + 1; if ($actual==$actpage) { $pagesstr.="($actual) "; } else { $pagesstr.="[$actual] "; } } } $pagesstr.="
\n"; # The List-Section ################################################################################################# include($menu); echo $pagesstr; if (is_file("break_0.inc")) { include("break_0.inc");} if ($break_afterbanners && $max_banners>0 && $max_banners<$break_time && $offset==0) { $tosite=$max_banners; } else { $tosite=$break_time+$offset; } starttable($offset+1,$tosite,$list_name); $break_timecount=$break_time+$offset; $breakcount=1; $i=$offset+1; while (($list = mysql_fetch_array($query)) && ($i <= $max_listsize)) { if(!empty($list[banner_height]) && !empty($list[banner_width]) && !empty($list[banner_addr]) && ($max_banners >= $i)){ $show_banner = "\n"; $show_banner .= "
\n"; } else { $show_banner = ""; } if ($show_newicon && $list[id]>($timestamp-24*3600*$show_newicon)) { $show_newiconstr = "
"; } else { $show_newiconstr = ""; } echo "
".($i)."$show_newiconstr
\n"; echo "$show_banner\n"; echo "".stripslashes($list[site_name])."
\n"; echo "
".stripslashes($list[site_desc])."
\n"; echo "
$list[votes]
\n"; echo "
$list[hits]
\n"; if ($show_rating) { echo "
".round($list[rating]*10)/10; if($show_ratingbar) { $bar_in_width = $list[rating]*10; $bar_in_height = $ratingbar_height-1; if($bar_in_width >= $ratingbar_high) { $ratingbarin="ratingbarinhigh"; } else { $ratingbarin="ratingbarin"; } echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo "
\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
\n"; echo "
 
\n"; // Netscape Patch !!! shit upgrade to IE echo "
\n"; echo "
\n"; } echo "
\n"; } // Break's if($break_afterbanners && $max_banners == $i && $listcount+$offset!=$i) { echo "\n"; if (is_file("break_".$breakcount.".inc")) { include("break_".$breakcount.".inc");} else {echo("

");} if ($max_banners>=$break_time) { $break_timecount+=$break_time; $breakcount++; if ($i<$max_listsize) { starttable($max_banners+1,$break_timecount);} } else { $breakcount++; if ($i<$max_listsize) { starttable($max_banners+1,$break_time);} } } elseif($break_timecount == $i && $listcount+$offset!=$i) { echo "\n"; if (is_file("break_".$breakcount.".inc")) { include("break_".$breakcount.".inc");} else {echo("

");} $break_timecount+=$break_time; $breakcount++; if ($i<$max_listsize) { starttable($i+1,$break_timecount); } } // End Break's $i++; } //end while echo "

"; # The Footer-Section ################################################################################################# echo $pagesstr; include($menu); // Variables Routine $sql = "SELECT * FROM variables"; $query = mysql_db_query($database, $sql) or die(geterrdesc($sql)); $listvar = mysql_fetch_array($query); $listvar[counter]++; $sql = "UPDATE variables SET counter='$listvar[counter]'"; mysql_db_query($database, $sql) or die(geterrdesc($sql)); if ($listvar[resettimestamp]<$timestamp && $days_to_reset) { //time to reset the list ? if ($setinactive_on_reset) { $sql = "UPDATE sites SET inactive='1' WHERE votes=0"; mysql_db_query($database, $sql) or die(geterrdesc($sql)); } if ($setactive_on_reset) { $sql = "UPDATE sites SET inactive='0' WHERE votes>0"; mysql_db_query($database, $sql) or die(geterrdesc($sql)); } // reset list $sql = "UPDATE sites SET votes='0',hits='0',rating='5.0'"; mysql_db_query($database, $sql) or die(geterrdesc($sql)); // set new resettimestamp $newtimestamp=$timestamp+($days_to_reset*24*3600); $sql = "UPDATE variables SET resettimestamp='$newtimestamp'"; mysql_db_query($database, $sql) or die(geterrdesc($sql)); } // End Variables echo "
\n"; if ($show_useronline) { $timeout=time()-300; // value in seconds $result=mysql_db_query($database, "INSERT INTO useronline VALUES ('$timestamp','$REMOTE_ADDR')"); $result=mysql_db_query($database, "DELETE FROM useronline WHERE timestamp<$timeout"); $result=mysql_db_query($database, "SELECT DISTINCT ip FROM useronline") or die("Useronline Error"); $user =mysql_num_rows($result); if ($user==1) { $useronline=", $user $lang[useronline]"; } else { $useronline=", $user $lang[usersonline]"; } } if ($show_counter) { $usercounter=", $listvar[counter] $lang[userssatisfied]"; } echo" $listcountall $lang[sitesindb]$useronline$usercounter
"; if ($days_to_reset) { echo "$lang[inoutresets] $days_to_reset $lang[days],"; echo "$lang[next]: ".date("M/j/Y h:i a T", $listvar[resettimestamp])."

\n"; } if ($firsttimeuser && $show_favwinfirsttime) { echo ""; } include($footer); # End mySQL ################################################################################################# mysql_close(); ?>