OSDN Git Service

fixed page swith issue
authorkimitake <kimitake@1ca29b6e-896d-4ea0-84a5-967f57386b96>
Sat, 28 Apr 2007 02:34:56 +0000 (02:34 +0000)
committerkimitake <kimitake@1ca29b6e-896d-4ea0-84a5-967f57386b96>
Sat, 28 Apr 2007 02:34:56 +0000 (02:34 +0000)
- changed from BloggetOption to getBlogOption
- reversed "next" and "prev" string

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

trunk/NP_ShowBlogs/NP_ShowBlogs.php

index c39eb04..db0928b 100644 (file)
@@ -110,7 +110,7 @@ class NP_ShowBlogs extends NucleusPlugin
                $this->createOption('ads2',          _ADCODE_2,   'textarea', '' . "\n");
                $this->createOption('tagMode',       _TAG_MODE,   'select',   '2', _TAG_SELECT);
                $this->createBlogOption('prevLabel', _SB_NEXTL,   'text',     '&laquo;Prev');
-               $this->createBlogOption('nextLabel', _SB_PREVL,   'text',     'Next&raquo;');
+               $this->createBlogOption('nextLabe', _SB_PREVL,   'text',     'Next&raquo;');
 /* todo can't install ? only warning ?
  * douyatte 'desc' ni keikoku wo daseba iinoka wakaranai desu
                $ver_min = (getNucleusVersion() < $this->getMinNucleusVersion());
@@ -675,6 +675,8 @@ class NP_ShowBlogs extends NucleusPlugin
                }
                $prevpage      = ($currentpage > 1) ? $currentpage - 1 : 0;
                $nextpage      = $currentpage + 1;
+               //$nextpage      = ($currentpage > 1) ? $currentpage - 1 : 0;
+               //$pregpage      = $currentpage + 1;
                $firstpagelink = $pagelink . $page_str . '1';
                if ($page_str == 'page_') {
                        $firstpagelink .= '.html';
@@ -689,15 +691,15 @@ class NP_ShowBlogs extends NucleusPlugin
                if ($type >= 1) {
                        $buf .= '<div class="pageswitch">' . "\n";
 //                     $buf .= "<a rel=\"first\" title=\"first page\" href=\"{$firstpagelink}\">&lt;TOP&gt;</a> | \n";
-                       if ($totalpages >= $nextpage) {
-                               $nextpagelink = $pagelink . $page_str . $nextpage;
+                       if (!empty($prevpage)) {
+                               $prevpagelink = $pagelink . $page_str . $prevpage;
                                if ($page_str == 'page_') {
-                                       $nextpagelink .= '.html';
+                                       $prevpagelink .= '.html';
                                }
-                               $buf .= '<a href="' . $nextpagelink . '" title="Next page" rel="Next">'
-                                         . '<span class="npsb_nextlink">' . $nextLinkLabel . '</span></a> |';
+                               $buf .= '<a href="' . $prevpagelink . '" title="Previous page" rel="Prev">'
+                                         . '<span class="npsb_prevlink">' . $prevLinkLabel . '</span></a> |';
                        } elseif ($type >= 2) {
-                               $buf .= "{$nextLinkLabel} |";
+                               $buf .= "{$prevLinkLabel} |";
                        }
                        if (intval($type) == 1) {
                                $buf .= "\n";
@@ -753,15 +755,15 @@ class NP_ShowBlogs extends NucleusPlugin
                                        }
                                }
                        }
-                       if (!empty($prevpage)) {
-                               $prevpagelink = $pagelink . $page_str . $prevpage;
+                       if ($totalpages >= $nextpage) {
+                               $nextpagelink = $pagelink . $page_str . $nextpage;
                                if ($page_str == 'page_') {
-                                       $prevpagelink .= '.html';
+                                       $nextpagelink .= '.html';
                                }
-                               $buf .= '| <a href="' . $prevpagelink . '" title="Previous page" rel="Prev">'
-                                         . '<span class="npsb_prevlink">' . $prevLinkLabel . '</span></a>' . "\n";
+                               $buf .= '| <a href="' . $nextpagelink . '" title="Next page" rel="Next">'
+                                         . '<span class="npsb_nextlink">' . $nextLinkLabel . '</span></a>' . "\n";
                        } elseif ($type >= 2) {
-                               $buf .= "| {$prevLinkLabel}\n";
+                               $buf .= "| {$nextLinkLabel}\n";
                        }
 //                     $buf .= " | <a rel=\"last\" title=\"Last page\" href=\"{$lastpagelink}\">&lt;LAST&gt;</a>\n";
                        $buf .= "</div>\n";