OSDN Git Service

MERGE: リビジョン1863。Actions::ifCategory()の条件式を結合
authorsakamocchi <o-takashi@sakamocchi.jp>
Sat, 19 May 2012 10:57:36 +0000 (19:57 +0900)
committersakamocchi <o-takashi@sakamocchi.jp>
Sat, 19 May 2012 10:57:36 +0000 (19:57 +0900)
SQLクエリの発行回数を減らすため

Revision 1863:
CHANGE: concatinate if condition in Actions::ifCategory()
For reducing needless SQL querying.
http://nucleuscms.svn.sourceforge.net/viewvc/nucleuscms?view=revision&revision=1863

nucleus/libs/ACTIONS.php

index c6c581f..37cc913 100644 (file)
@@ -15,7 +15,7 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2012 The Nucleus Group
- * @version $Id: ACTIONS.php 1784 2012-04-22 04:28:30Z sakamocchi $
+ * @version $Id: ACTIONS.php 1863 2012-05-19 10:50:27Z sakamocchi $
  */
 
 class Actions extends BaseActions
@@ -425,9 +425,8 @@ class Actions extends BaseActions
                {
                        return $blog->isValidCategory($catid);
                }
-               
                // check category name
-               if ( $name == 'catname' )
+               else if ( $name == 'catname' )
                {
                        $value = $blog->getCategoryIdFromName($value);
                        if ( $value == $catid )
@@ -435,9 +434,8 @@ class Actions extends BaseActions
                                return $blog->isValidCategory($catid);
                        }
                }
-               
                // check category id
-               if ( ($name == 'catid') && ($value == $catid) )
+               else if ( ($name == 'catid') && ($value == $catid) )
                {
                        return $blog->isValidCategory($catid);
                }