/**
* @license http://nucleuscms.org/license.txt GNU General Public License
* @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: globalfunctions.php,v 1.23.2.4 2007-12-02 23:49:30 kmorimatsu Exp $
- * $NucleusJP: globalfunctions.php,v 1.23.2.3 2007/10/30 19:05:20 kmorimatsu Exp $
+ * @version $Id: globalfunctions.php,v 1.23.2.5 2007-12-05 01:28:41 kmorimatsu Exp $
+ * $NucleusJP: globalfunctions.php,v 1.23.2.4 2007/12/02 23:49:30 kmorimatsu Exp $
*/
// needed if we include globalfunctions from install.php
global $archivenext, $archiveprev, $archivetype, $archivenextexists, $archiveprevexists;
// sql queries for the timestamp of the first and the last published item
- $query = "SELECT UNIX_TIMESTAMP(itime) as result FROM ".sql_table('item')." WHERE idraft=0 ORDER BY itime ASC";
- $first_timestamp=quickQuery ($query);
- $query = "SELECT UNIX_TIMESTAMP(itime) as result FROM ".sql_table('item')." WHERE idraft=0 ORDER BY itime DESC";
- $last_timestamp=quickQuery ($query);
+ $query = "SELECT UNIX_TIMESTAMP(itime) as result FROM ".sql_table('item')." WHERE idraft=0 AND iblog=".(int)($blogid ? $blogid : $CONF['DefaultBlog'])." ORDER BY itime ASC";
+ $first_timestamp=quickQuery ($query);
+ $query = "SELECT UNIX_TIMESTAMP(itime) as result FROM ".sql_table('item')." WHERE idraft=0 AND iblog=".(int)($blogid ? $blogid : $CONF['DefaultBlog'])." ORDER BY itime DESC";
+ $last_timestamp=quickQuery ($query);
sscanf($archive, '%d-%d-%d', $y, $m, $d);