OSDN Git Service

Bug fix: archiveprevexists, archivenextexists
authorkmorimatsu <kmorimatsu@1ca29b6e-896d-4ea0-84a5-967f57386b96>
Wed, 5 Dec 2007 01:28:41 +0000 (01:28 +0000)
committerkmorimatsu <kmorimatsu@1ca29b6e-896d-4ea0-84a5-967f57386b96>
Wed, 5 Dec 2007 01:28:41 +0000 (01:28 +0000)
git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/nucleus-jp/branches/branch-3-3@358 1ca29b6e-896d-4ea0-84a5-967f57386b96

utf8/nucleus/libs/globalfunctions.php

index 39b679e..5dd2bb1 100755 (executable)
@@ -13,8 +13,8 @@
 /**
  * @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
@@ -843,10 +843,10 @@ function selector() {
                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);