THE BUNGHOLE - What's cool"; ?>   What's Cool\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; $query = mysql_query("SELECT 1 FROM bunghole_links WHERE is_cool > 0;"); $totalnumber = mysql_num_rows($query); $category = ""; $query = mysql_query("SELECT id, title, category, description, date_added, hits, is_new, rating, votes FROM bunghole_links WHERE is_cool > 0 ORDER BY category, title LIMIT $start, 11;"); $end = mysql_num_rows($query); if(!$end) echo "No results for what's cool section.\n"; else { echo "Showing records ",$start+1," to "; if($end == 11) echo "".$start+$end-1; else echo "".$start+$end; echo " out of $totalnumber records. Sorted by category and title.
"; // Show records // We will only show 10 records, the eleventh is to see if more records exist $count = 1; while($count <= $end) { $result = mysql_fetch_array($query); if($category != $result["category"]) { if($category != "") echo "\n"; $category = $result["category"]; echo "

From $category category:

\n"; echo "
    \n"; } echo "
  • ".ucfirst($result["title"])."\n"; echo "
    ".$result["description"]."\n"; echo "
    (Added: ".convert_date($result["date_added"]).", ".$result["hits"]." hits)\n"; echo "
    Rating: ", $result["rating"]/100,"/10 from ".$result["votes"]." votes. [Rate It]\n"; echo "
     "; $count++; if($count == 11) break; } // Page menu $numofpages = $totalnumber / 10; settype($numofpages, "integer"); if(($totalnumber % 10)) $numofpages++; $curpage = $start/10; settype($numofpages, "integer"); // if(($start % 10)) $curpage++; $curpage++; echo "

    $numofpages pages:\n"; for($count=1;$count<=$numofpages;$count++) { if($count == $curpage) echo " $count "; else echo " $count "; } // Previous - Next menu echo ".   "; if($start >= 10) echo "<< Previous"; if(($start >= 10) && ($end == 11)) echo " - "; if($end == 11) echo "Next >>\n"; } mysql_close($db); echo "

\n"; echo "
\n"; ?>