|
02/1999 | 03/1999 |
04/1999 | 05/1999 | 06/1999 |
07/1999 | 08/1999 | 09/1999 |
10/1999 | 11/1999 | 12/1999 |
01/2000 | 02/2000 | 03/2000 |
04/2000 | 05/2000 | 06/2000 |
07/2000 | 08/2000 | 09/2000 |
10/2000 | 11/2000 | // Code by Gregg Buntin @ Realm Laboratories, LLC // scriptguy@realmlabs.com // 1/15/2001 This code reads the news database (makes the assumption that the database started with 12/2000) and just // creates the history select page. // // We preserve the old pages and how they are linked and use the database to show future ones. // include "dbconnect.php"; // This will give us something like 12/2000... I think I can trim down the number of records actually read // by using some command that shows unique records only... have to check into it yet :) $dbquery = "select date_format(daposted,'%m/%Y') from news order by daposted"; $dbresult = mysql_query($dbquery, $mysql_link); $DaCtr = 2; $DaLastMonth = ""; if ($dbresult) { while ($row = mysql_fetch_row($dbresult)) { $DaMonthYear = $row[0]; if (! ($DaLastMonth == $DaMonthYear) and ($DaLastMonth > "")) { if ($DaCtr > 2) { $DaCtr = 0; echo "|
$DaMonthYear | \r\n"; $DaCtr += 1; } $DaLastMonth = $DaMonthYear; } if ($DaCtr < 3) { while ($DaCtr < 3) { echo "\r\n"; $DaCtr += 1; } } } ?> |