OSDN Git Service

bug fix
authorshizuki <shizuki@1ca29b6e-896d-4ea0-84a5-967f57386b96>
Thu, 5 Oct 2006 14:30:35 +0000 (14:30 +0000)
committershizuki <shizuki@1ca29b6e-896d-4ea0-84a5-967f57386b96>
Thu, 5 Oct 2006 14:30:35 +0000 (14:30 +0000)
コピペミス orz

git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/plugin@422 1ca29b6e-896d-4ea0-84a5-967f57386b96

trunk/NP_ItemNaviEX/NP_ItemNaviEX.php
trunk/NP_TagEX/NP_TagEX.php

index 4474c6f..de45f9a 100644 (file)
@@ -40,7 +40,7 @@ class NP_ItemNaviEX extends NucleusPlugin
 
        function getURL()
        {
-               return 'http://nakahara21.com'; 
+               return 'http://nakahara21.com/'; 
        }
 
        function getVersion()
@@ -297,7 +297,7 @@ class NP_ItemNaviEX extends NucleusPlugin
                }
 
                if ($skinType == 'archive') {
-                       sscanf($archive,'%04d-%02d-%02d', $y, $m, $d);
+                       sscanf($archive,'%d-%d-%d', $y, $m, $d);
 //store ArchiveMonth
                        $archiveMonth = $y . '-' . $m;
                                $naviUnit[] = array(
@@ -329,8 +329,12 @@ class NP_ItemNaviEX extends NucleusPlugin
                        $res = sql_query($query);
                        if ($ares = mysql_fetch_row($res)) {
 //                             $prev_date = $ares[0];
-                               sscanf($ares[0],'%d-%d-%d', $y, $m, $d);
-                               $prev_date = sprintf('%04d-%02d-%02d', $y, $m, $d);
+                               sscanf($ares[0], '%d-%d-%d', $y, $m, $d);
+                               if (empty($d)) {
+                                       $prev_date = sprintf('%04d-%02d', $y, $m);
+                               } else {
+                                       $prev_date = sprintf('%04d-%02d-%02d', $y, $m, $d);
+                               }
                                $prev_alink = createArchiveLink($blogid, $prev_date, $this->linkparams);
                                $subNaviUnit[1] = '<a href="' . htmlspecialchars($prev_alink) . '" class="prevlink" rel="prev">' .
                                                ' &laquo; ' . htmlspecialchars($prev_date) . '</a>';
@@ -352,7 +356,11 @@ class NP_ItemNaviEX extends NucleusPlugin
                        if ($ares = mysql_fetch_row($res)) {
 //                             $next_date = $ares[0];
                                sscanf($ares[0],'%d-%d-%d', $y, $m, $d);
-                               $next_date = sprintf('%04d-%02d-%02d', $y, $m, $d);
+                               if (empty($d)) {
+                                       $next_date = sprintf('%04d-%02d', $y, $m);
+                               } else {
+                                       $next_date = sprintf('%04d-%02d-%02d', $y, $m, $d);
+                               }
                                $next_alink = createArchiveLink($blogid, $next_date, $this->linkparams);
                                $subNaviUnit[2] = '<a href="' . htmlspecialchars($next_alink) . '" class="nextlink" rel="next">'
                                                                . htmlspecialchars($next_date) . ' &raquo;</a>';
@@ -401,12 +409,8 @@ class NP_ItemNaviEX extends NucleusPlugin
                                }
                                for ($i=0;$i<count($reqTags);$i++) {
                                        $tag = trim($reqTags[$i]);
-                                       $taglist[$i] = '<a href="' .
-                                                                       $tagPlugin->creatTagLink($tag, 0) .
-                                                                       '" title="' . htmlspecialchars($tag) .
-                                                                       '">' .
-                                                                       htmlspecialchars($tag) .
-                                                                       '</a>';
+                                       $taglist[$i] = '<a href="' . $tagPlugin->creatTagLink($tag, 0) . '">'
+                                                               . htmlspecialchars($tag) . '</a>';
                                }
                                echo ' <small style="font-family:Tahoma;">';
 //                             echo ' (Tag for "'.$tagPlugin->_rawdecode(requestVar('tag')).'")';
@@ -419,27 +423,24 @@ class NP_ItemNaviEX extends NucleusPlugin
 
        }
 
-    function getParenta($subcat_id, $blogid = 0)
+    function getParenta($subcat_id, $blogid=0)
     {
-       global $manager;
        $subcat_id = intval($subcat_id);
        $blogid = intval($blogid);
        $r = array();
-               $mplugin =& $manager->getPlugin('NP_MultipleCategories');
-               $subrequest = $mplugin->getRequestName(array());
        $que = 'SELECT scatid, parentid, sname, catid FROM %s WHERE scatid = %d';
        $res = sql_query(sprintf($que, sql_table('plug_multiple_categories_sub'), $subcat_id));
         list ($sid, $parent, $sname, $cat_id) = mysql_fetch_row($res);
                if (intval($parent) != 0) {
                        $this->r[] =  $this->getParenta(intval($parent), $blogid);
-                       $this->linkparams[$subrequest] = $sid;
+                       $this->linkparams[subcatid] = $sid;
                        $r =  array(
                                0 => $sname,
                                1 => createBlogidLink($blogid, $this->linkparams),
                                2 => createArchiveListLink($blogid, $this->linkparams)
                                );
                }else{
-                       $this->linkparams[$subrequest] = $sid;
+                       $this->linkparams[subcatid] = $sid;
                        $r =  array(
                                0 => $sname,
                                1 => createBlogidLink($blogid, $this->linkparams),
@@ -449,7 +450,7 @@ class NP_ItemNaviEX extends NucleusPlugin
         return $r;
     }
 
-/*     function getParent($subcat_id)
+       function getParent($subcat_id)
     {
        $subcat_id = intval($subcat_id);
        $que = 'SELECT scatid, parentid, sname FROM %s WHERE scatid = %d';
@@ -461,12 +462,12 @@ class NP_ItemNaviEX extends NucleusPlugin
                $r = "<a href=$subcat_id>" . htmlspecialchars($sname) . "</a>";
        }
         return $r;
-    }*/
+    }
 
     function getChildren($subcat_id)
     {
        $subcat_id = intval($subcat_id);
-       $que = 'SELECT scatid, parentid, sname FROM %s WHERE scatid = %d';
+       $que = 'SELECT scatid, parentid, sname FROM %s WHERE parentid = %d';
        $res = sql_query(sprintf($que, sql_table('plug_multiple_categories_sub'), $subcat_id));
                while ($so =  mysql_fetch_object($res)) {
                        $r .= $this->getChildren($so->scatid) . '/' . intval($so->scatid);
@@ -475,4 +476,4 @@ class NP_ItemNaviEX extends NucleusPlugin
     }
 
 }
-?>
\ No newline at end of file
+?>
index b836718..e5576ed 100644 (file)
@@ -1085,6 +1085,7 @@ tagIndexSeparator
                                $linkparams['catid'] = intval($catid);
                        }
                        if ($subcatid) {
+                               $mplugin = $manager->getPlugin('NP_MultipleCategories');
                                $subrequest = $mplugin->getRequestName(array());
                                $linkparams[$subrequest] = intval($subcatid);
                        }