Location: PHPKode > scripts > Article Archive Addon > article-archive-addon/article_block.php
<?
/**
  * article_block.php - display monthly article links in block
  * 
  * Include this file in your theme's header or footer to display
  * links to your articles by month/year. Works in conjunction with
  * archive.php
  *
  * @author Edward Ritter <hide@address.com>
  * @version $Id: article_block.php,v 1.1 2002/08/23 18:15:33 esritter Exp $
  * @module archive
  * @modulegroup addons
  * @package phpWebSite
  */

$boxtitle = "Article Archives";
$result = mysql_query ("SELECT DISTINCT SUBSTRING_INDEX(time,'-','2')
	FROM ".$table_prefix."stories ORDER BY time DESC")
	or die ("Can't open stories table");
if ($result) {
	while (list ($time) = mysql_fetch_row ($result)) {
		$tempdate = explode ('-', $time);
		$thedate = date ("F Y", mktime (0,0,0,$tempdate[1]+1,0,$tempdate[0]));
		$content .= "&middot;&nbsp;<a href=\"$phpws_url/archive.php?op=showmonth&amp;date=$time\">$thedate</a><br/>";
	}
}
themesidebox($boxtitle,$content);

?>
Return current item: Article Archive Addon