THE BUNGHOLE - What's new"; else echo "THE BUNGHOLE - What's new for ",convert_date($shownews),""; ?>   New additions  \n"; echo "\n"; echo "
= DATE_SUB(CURDATE(), INTERVAL 14 DAY) AND is_new > 0;"); $num = mysql_num_rows($query); echo "

$num New Links added the last 2 weeks:\n

"; $days_old = 0; $now = getdate(time()); while($days_old <= 14) { $query = mysql_query("SELECT 1 FROM bunghole_links WHERE date_added = DATE_SUB(CURDATE(), INTERVAL $days_old DAY) AND is_new > 0;"); $num = mysql_num_rows($query); if($num) { echo "$num new links for "; echo date("l, j F Y", mktime(0, 0, 0, $now["mon"], $now["mday"]-$days_old, $now["year"])); echo ".\n
"; } else echo "No new links for ",date("l, j F Y", mktime(0, 0, 0, $now["mon"], $now["mday"]-$days_old, $now["year"])),".\n
"; $days_old++; } ?>   What's new for ", convert_date($shownews),"\n"; echo "

\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; $query = mysql_query("SELECT 1 FROM bunghole_links WHERE date_added = '$shownews' AND is_new > 0;"); $totalnumber = mysql_num_rows($query); if(($order == "title") || ($order == "category")) $query = mysql_query("SELECT id, title, category, description, date_added, hits, rating, votes FROM bunghole_links WHERE date_added = '$shownews' AND is_new > 0 ORDER BY $order LIMIT $start, 11;"); else $query = mysql_query("SELECT id, title, category, description, date_added, hits, rating, votes FROM bunghole_links WHERE date_added = '$shownews' AND is_new > 0 ORDER BY $order DESC LIMIT $start, 11;"); $end = mysql_num_rows($query); if(!$end) echo "No results for date ",convert_date($shownews),".\n"; else { echo "Showing records ",$start+1," to "; if($end == 11) echo "".$start+$end-1; else echo "".$start+$end; echo " out of $totalnumber records. Viewing by ",nopavla($order),".
"; if($order != "title") echo "[View by title] "; if($order != "category") echo "[View by category] "; if($order != "date_added") echo "[View by date] "; if($order != "hits") echo "[View by hits] "; if($order != "rating") echo "[View by rating]"; echo "
Back to new additions index\n"; // Show records // We will only show 10 records, the eleventh is to see if more records exist echo "
    \n"; $count = 1; while($count <= $end) { $result = mysql_fetch_array($query); echo "
  • ".ucfirst($result["title"]).""; echo " from ",nopavla($result["category"])," category.\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); ?>