<?php
 
include('./fancyurls.config.php');
include('./config.php');
 
$data = explode('/',serverVar('PATH_INFO'));
if (count($data) >= 3 && preg_match("/^\d{4}$/", $data[2])) {
	$blogid = intval($data[1]);
	$year = intval($data[2]);
	$month = intval($data[3]);
	$day = intval($data[4]);
	if (isset($data[5])) {
		$title = $data[5];
		// 1. get timestamp and blogid for item
		$query  = 'SELECT iblog, inumber FROM '.sql_table('item').' WHERE iurltitle=\'' . $title . '\' ';
		$query .= "AND (YEAR(itime) = $year AND MONTH(itime) = $month AND DAYOFMONTH(itime) = $day)";
 
		$res = sql_query($query);
		$obj = mysql_fetch_object($res);
 
		$itemid = $obj->inumber;
	} else {
		$archive = implode('-', array($year, $month, $day));
	}
} else {
	$blogid = intval($data[1]);
	$archive = $data[2];
}
 
selector();
 
?>
fancierurlarchive.txt · Last modified: 2006/07/05 13:03 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki