• R/O
  • HTTP
  • SSH
  • HTTPS

nucleus-plugins: Commit

Nucleus CMS日本語版用プラグインのうち、日本語版開発者がサポートしているもの


Commit MetaInfo

Revision635bdd2a3a1b2f6ccff1958eb1fed8109c884340 (tree)
Time2006-10-05 22:22:12
Authorshizuki <shizuki@1ca2...>
Commitershizuki

Log Message

bug fix

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

Change Summary

Incremental Difference

--- a/trunk/NP_ShowBlogs/NP_ShowBlogs.php
+++ b/trunk/NP_ShowBlogs/NP_ShowBlogs.php
@@ -27,12 +27,12 @@
2727 *
2828 ****************************************************************************/
2929
30-class NP_ShowBlogsEX extends NucleusPlugin
30+class NP_ShowBlogs extends NucleusPlugin
3131 {
3232
3333 function getName()
3434 {
35- return 'Show BlogsEX';
35+ return 'Show Blogs';
3636 }
3737
3838 function getMinNucleusVersion()
@@ -222,7 +222,7 @@ $monthlimit = 0;
222222 }
223223 }
224224
225- $hidden = '';
225+// $hidden = '';
226226 $temp = $y = $m = $d = '';
227227 if ($archive) {
228228 sscanf($archive, '%d-%d-%d', $y, $m, $d);
@@ -288,20 +288,21 @@ $monthlimit = 0;
288288 $sh_query .= ' AND b.bnumber = c.cblog';
289289 }
290290
291- if ($page_switch['startpos'] == 0 && !$catid && $sticky != '' && $skinType != 'item') {
291+ if ($page_switch['startpos'] == 0 && !$catid && $sticky != '' && $skinType != 'item' && !$this->tagSelected) {
292292 $ads = 1;
293+ $sticky_query = $sh_query;
293294 foreach ($stickys as $stickynumber) {
294295 $tempblogid = getBlogIDFromItemID($stickynumber);
295296 if ($bmode != 'all') {
296- $sh_query .= ' AND i.iblog = ' . $nowbid;
297+ $sticky_query .= ' AND i.iblog = ' . $nowbid;
297298 }
298- $sh_query .= ' AND i.inumber = ' . intval($stickynumber);
299- $sh_query .= ' AND i.itime <= ' . mysqldate($b->getCorrectTime());
300- $sh_query .= ' AND i.idraft = 0';
299+ $sticky_query .= ' AND i.inumber = ' . intval($stickynumber);
300+ $sticky_query .= ' AND i.itime <= ' . mysqldate($b->getCorrectTime());
301+ $sticky_query .= ' AND i.idraft = 0';
301302 if ($this->getOption('stickmode') == 1 && intval($nowbid) == $tempblogid) {
302- $b->showUsingQuery($sticktemplate, $sh_query, 0, 1, 0);
303+ $b->showUsingQuery($sticktemplate, $sticky_query, 0, 1, 0);
303304 } elseif (!$this->getOption('stickmode')) {
304- $b->showUsingQuery($sticktemplate, $sh_query, 0, 1, 0);
305+ $b->showUsingQuery($sticktemplate, $sticky_query, 0, 1, 0);
305306 }
306307 if ($ads == 1) {
307308 echo $this->getOption('ads');
@@ -362,7 +363,7 @@ $monthlimit = 0;
362363
363364 function event_InitSkinParse($data)
364365 {
365- global $CONF;
366+ global $CONF, $manager;
366367 $usePathInfo = ($CONF['URLMode'] == 'pathinfo');
367368 if (serverVar('REQUEST_URI') == '') {
368369 $uri = (serverVar('QUERY_STRING')) ?
@@ -370,10 +371,14 @@ $monthlimit = 0;
370371 } else {
371372 $uri = serverVar('REQUEST_URI');
372373 }
373- $this->pagestr = ($usePathInfo) ? 'page/' : 'page=';
374- list($org_uri, $currentpage) = explode($this->pagestr, $uri, 2);
375- $_GET['page'] = intval($currentpage);
376- $this->currentpage = intval($currentpage);
374+ $page_str = ($usePathInfo) ? 'page/' : 'page=';
375+ if ($manager->pluginInstalled('NP_CustomURL')) {
376+ $page_str = 'page_';
377+ }
378+ list($org_uri, $currPage) = explode($page_str, $uri, 2);
379+ $_GET['page'] = intval($currPage);
380+ $this->currPage = intval($currPage);
381+ $this->pagestr = $page_str;
377382 }
378383
379384 function PageSwitch($type, $pageamount, $offset, $where, $sort, $mtable = '')
@@ -398,7 +403,7 @@ $monthlimit = 0;
398403 }
399404
400405 $page_str = $this->pagestr;
401- $currentpage = $this->currentpage;
406+ $currentpage = $this->currPage;
402407
403408 // createBaseURL
404409 if (!empty($catid)) {
@@ -429,9 +434,25 @@ $monthlimit = 0;
429434 $tplugin =& $manager->getPlugin('NP_TagEX');
430435 $requestTag = $tplugin->getNoDecodeQuery('tag');
431436 if (!empty($requestTag)) {
432- $pagelink = $tplugin->creatTagLink($requestTag, $this->getOption('tagMode'));
437+ $requestTarray = $tplugin->splitRequestTags($requestTag);
438+ $tag = array_shift($requestTarray['and']);
439+ $tag = $tplugin->_rawdecode($tag);
440+ if (!empty($requestTarray['and'])) {
441+ $requestT = implode('+', $requestTarray['and']);
442+ }
443+ if (!empty($requestTarray['or'])) {
444+ $requestTor = implode(':', $requestTarray['or']);
445+ }
446+ if (!empty($requestT) && !empty($requestTor)) {
447+ $pagelink = $tplugin->creatTagLink($tag, $this->getOption('tagMode'), $requestT . ':' . $requestTor, '+');
448+ } elseif (empty($requestT) && !empty($requestTor)) {
449+ $pagelink = $tplugin->creatTagLink($tag, $this->getOption('tagMode'), $requestTor, ':');
450+ } else {
451+ $pagelink = $tplugin->creatTagLink($tag, $this->getOption('tagMode'));
452+ }
433453 }
434454 }
455+
435456 $uri = parse_url($pagelink);
436457 if (!$usePathInfo) {
437458 if ($pagelink == $CONF['BlogURL']) { // add
@@ -492,16 +513,22 @@ $monthlimit = 0;
492513 $prevpage = ($currentpage > 1) ? $currentpage - 1 : 0;
493514 $nextpage = $currentpage + 1;
494515 $firstpagelink = $pagelink . $page_str . '1';
495-// $firstpagelink .= '.html';
516+ if ($manager->pluginInstalled('NP_CustomURL')) {
517+ $firstpagelink .= '.html';
518+ }
496519 $lastpagelink = $pagelink . $page_str . $totalpages;
497-// $lastpagelink .= '.html';
520+ if ($manager->pluginInstalled('NP_CustomURL')) {
521+ $lastpagelink .= '.html';
522+ }
498523
499524 if ($type >= 1) {
500525 $buf .= '<div class="pageswitch">' . "\n";
501526 // $buf .= "<a rel=\"first\" title=\"first page\" href=\"{$firstpagelink}\">&lt;TOP&gt;</a> |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n";
502527 if (!empty($prevpage)) {
503528 $prevpagelink = $pagelink . $page_str . $prevpage;
504-// $prevpagelink .= '.html';
529+ if ($manager->pluginInstalled('NP_CustomURL')) {
530+ $prevpagelink .= '.html';
531+ }
505532 $buf .= "\n<a href=\"{$prevpagelink}\" title=\"Previous page\" rel=\"Prev\">&laquo;Prev</a> |";
506533 } elseif ($type >= 2) {
507534 $buf .= "\n&laquo;Prev |";
@@ -511,9 +538,11 @@ $monthlimit = 0;
511538 $buf .= "|";
512539 for ($i=1; $i<=$totalpages; $i++) {
513540 $i_pagelink = $pagelink . $page_str . $i;
514-// $i_pagelink .= '.html';
541+ if ($manager->pluginInstalled('NP_CustomURL')) {
542+ $i_pagelink .= '.html';
543+ }
515544 if ($i == $currentpage) {
516- $buf .= " <strong>{$currentpage}</strong> |\n";
545+ $buf .= " <strong>{$i}</strong> |\n";
517546 } elseif ($totalpages<10 || $i<4 || $i>$totalpages-3) {
518547 $buf .= " <a href=\"{$i_pagelink}\" title=\"Page No.{$i}\">{$i}</a> |\n";
519548 } else {
@@ -534,10 +563,12 @@ $monthlimit = 0;
534563 $sepstr = '&middot;';
535564 for ($i=1; $i<=$totalpages; $i++) {
536565 $i_pagelink = $pagelink . $page_str . $i;
537-// $i_pagelink .= '.html';
566+ if ($manager->pluginInstalled('NP_CustomURL')) {
567+ $i_pagelink .= '.html';
568+ }
538569 $paging = 5;
539570 if ($i == $currentpage) {
540- $buf .= " <strong>{$currentpage}</strong> {$sepstr}\n";
571+ $buf .= " <strong>{$i}</strong> {$sepstr}\n";
541572 } elseif ($totalpages < 10 || (($i < ($currentpage + $paging)) && (($currentpage - $paging) < $i))) {
542573 $buf .= " <a href=\"{$i_pagelink}\" title=\"Page No.{$i}\">{$i}</a> {$sepstr}\n";
543574 } elseif ($currentpage - $paging == $i) {
@@ -552,7 +583,9 @@ $monthlimit = 0;
552583 }
553584 if ($totalpages >= $nextpage) {
554585 $nextpagelink = $pagelink . $page_str . $nextpage;
555-// $nextpagelink .= '.html';
586+ if ($manager->pluginInstalled('NP_CustomURL')) {
587+ $nextpagelink .= '.html';
588+ }
556589 $buf .= "| <a href=\"{$nextpagelink}\" title=\"Next page\" rel=\"Next\">Next&raquo;</a>\n";
557590 } elseif ($type >= 2) {
558591 $buf .= "| Next&raquo;\n";
@@ -631,6 +664,7 @@ $monthlimit = 0;
631664 $tplugin =& $manager->getPlugin('NP_TagEX');
632665 $requestTag = $tplugin->getNoDecodeQuery('tag');
633666 if (!empty($requestTag) || $skin_type == 'item') {
667+ $this->tagSelected = TRUE;
634668 $allTags = ($bmode=='all') ? $tplugin->scanExistTags(0) : $tplugin->scanExistTags(2);
635669 $arr = $tplugin->splitRequestTags($requestTag);
636670 if ($skin_type == 'item') {
--- a/trunk/NP_TagEX/NP_TagEX.php
+++ b/trunk/NP_TagEX/NP_TagEX.php
@@ -703,7 +703,7 @@ function resetOlder(old){
703703 for ($i=0;$i<count($urlq);$i++) {
704704 $tempq = explode('=', $urlq[$i]);
705705 if ($tempq[0] == $q) {
706- $str = preg_replace('|[^a-z0-9-~+_.#;,:@%]|i', '', rawurlencode($tempq[1]));
706+ $str = preg_replace('|[^a-z0-9-~+_.#;,:@%]|i', '', $tempq[1]);
707707 return $str;
708708 }
709709 }
@@ -1085,32 +1085,31 @@ tagIndexSeparator
10851085 $linkparams['catid'] = intval($catid);
10861086 }
10871087 if ($subcatid) {
1088- $linkparams['subcatid'] = intval($subcatid);
1088+ $subrequest = $mplugin->getRequestName(array());
1089+ $linkparams[$subrequest] = intval($subcatid);
10891090 }
10901091 }
10911092
10921093 // <mod by shizuki>
10931094 if (!empty($ready)) {
1094- $ready = preg_replace('|[^a-z0-9-~+_.?#=&;,/:@%]|i', '', $ready);
1095- $reqReadyAND = explode('+', $ready);
1096- foreach ($reqReadyAND as $ANDkey => $ANDval) {
1097- if (strpos(':', $ANDval)) {
1098- $reqReadyOR = explode(':', $ANDval);
1099- foreach ($reqReadyOR as $ORkey => $ORval) {
1100- if (!$this->_isValidTag($ORval)) {
1101- $trush = array_splice($reqReadyOR, $ORkey, 1);
1102- }
1103- }
1104- $ANDval = implode(':', $reqReadyOR);
1105- } else {
1106- if (!$this->_isValidTag($ANDval)) {
1107- $trush = array_splice($reqReadyAND, $ANDkey, 1);
1095+ $requestTagArray = $this->splitRequestTags($ready);
1096+ foreach ($requestTagArray['and'] as $key => $val) {
1097+ if (!$this->_isValidTag($val)) {
1098+ $trush = array_splice($requestTagArray['and'], $key, 1);
1099+ }
1100+ }
1101+ $reqAnd = implode('+', $requestTagArray['and']);
1102+ if (!empty($requestTagArray['or'])) {
1103+ foreach ($requestTagArray['or'] as $key => $val) {
1104+ if (!$this->_isValidTag($val)) {
1105+ $trush = array_splice($requestTagArray['and'], $key, 1);
11081106 }
11091107 }
1108+ $reqOr = ':' . implode(':', $requestTagArray['or']);
11101109 }
1111- $ready = implode('+', $reqReadyAND);
1110+ $ready = $reqAnd . $reqOr;
11121111 }
1113-// </mod by shizuki>
1112+// </mod by shizuki>*/
11141113
11151114 if (!$ready) $sep = '';
11161115 if ($CONF['URLMode'] == 'pathinfo')
@@ -1118,7 +1117,7 @@ tagIndexSeparator
11181117 else
11191118 $link = $CONF['BlogURL'] . '?tag=' . $ready . $sep . $this->_rawencode($tag);
11201119
1121-/* <add for NP_CustomURL mod by shizuki>
1120+// <add for NP_CustomURL mod by shizuki>
11221121 if ($manager->pluginInstalled('NP_CustomURL')) {
11231122 $urlplugin = $manager->getPlugin('NP_CustomURL');
11241123 $link = 'tag/' . $ready . $sep . $this->_rawencode($tag);
Show on old repository browser