OSDN Git Service

sync with rev1132
authorkimitake <kimitake@1ca29b6e-896d-4ea0-84a5-967f57386b96>
Wed, 5 Sep 2007 06:21:17 +0000 (06:21 +0000)
committerkimitake <kimitake@1ca29b6e-896d-4ea0-84a5-967f57386b96>
Wed, 5 Sep 2007 06:21:17 +0000 (06:21 +0000)
JustPosted event

git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/nucleus-jp/branches/branch-3-3@313 1ca29b6e-896d-4ea0-84a5-967f57386b96

utf8/nucleus/libs/ITEM.php

index 6a1cec8..1238d51 100755 (executable)
@@ -15,8 +15,8 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: ITEM.php,v 1.7 2007-02-04 06:28:46 kimitake Exp $
- * $NucleusJP: ITEM.php,v 1.6 2006/07/20 08:01:52 kimitake Exp $
+ * @version $Id: ITEM.php,v 1.7.2.1 2007-09-05 06:21:17 kimitake Exp $
+ * $NucleusJP: ITEM.php,v 1.7 2007/02/04 06:28:46 kimitake Exp $
  */
 class ITEM {
 
@@ -141,7 +141,15 @@ class ITEM {
                        $posttime = $i_draft ? 0 : $blog->getCorrectTime();
                }
 
-               $itemid = $blog->additem($i_catid, $i_title,$i_body,$i_more,$i_blogid,$i_author,$posttime,$i_closed,$i_draft);
+               if ($posttime > $blog->getCorrectTime()) {
+                       $posted = 0;
+                       $blog->setFuturePost();
+               }
+               else {
+                       $posted = 1;
+               }
+
+               $itemid = $blog->additem($i_catid, $i_title,$i_body,$i_more,$i_blogid,$i_author,$posttime,$i_closed,$i_draft,$posted);
 
                //Setting the itemOptions
                $aOptions = requestArray('plugoption');
@@ -203,14 +211,20 @@ class ITEM {
                if ( (!$blog->allowPastPosting()) && ($timestamp < $blog->getCorrectTime()))
                                $timestamp = 0;
 
-               if ($wasdraft && $publish) {
-                       $query .= ', idraft=0';
+               if ($timestamp > $blog->getCorrectTime(time())) {
+                       $isFuture = 1;
+                       $query .= ', iposted=0';
+               }
+               else {
+                       $isFuture = 0;
+                       $query .= ', iposted=1';
+               }
 
+               if ($wasdraft && $publish) {
                        // set timestamp to current date only if it's not a future item
                        // draft items have timestamp == 0
                        // don't allow timestamps in the past (unless otherwise defined in blogsettings)
-                       if ($timestamp > $blog->getCorrectTime())
-                               $isFuture = 1;
+                       $query .= ', idraft=0';
 
                        if ($timestamp == 0)
                                $timestamp = $blog->getCorrectTime();