• R/O
  • HTTP
  • SSH
  • HTTPS

nucleus-plugins: Commit

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


Commit MetaInfo

Revision2be5b06af81696e17b24d75aadaeb8f5f789b73f (tree)
Time2006-11-27 15:49:14
Authorshizuki <shizuki@1ca2...>
Commitershizuki

Log Message

php バージョンチェック部分修正 (4.0.3 -> 4.3.0)

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

Change Summary

Incremental Difference

--- a/trunk/NP_TagEX/NP_TagEX.php
+++ b/trunk/NP_TagEX/NP_TagEX.php
@@ -18,6 +18,8 @@
1818 * @version 0.41
1919 * @link http://nakahara21.com
2020 *
21+ * 0.51 typo fix
22+ * 0.5 TAG sort modified
2123 * 0.43 fix URL generate
2224 * 0.42 add URL selected tag check
2325 * 0.41 security fix and add some trick
@@ -159,7 +161,7 @@ class NP_TagEX extends NucleusPlugin
159161 $value = array_map("stripslashes", $value);
160162 }
161163 if (!array_map("is_numeric",$value)) {
162- if (version_compare(phpversion(),"4.0.3") == "-1") {
164+ if (version_compare(phpversion(),"4.3.0") == "-1") {
163165 $value = array_map("mysql_escape_string", $value);
164166 } else {
165167 $value = array_map("mysql_real_escape_string", $value);
@@ -172,7 +174,7 @@ class NP_TagEX extends NucleusPlugin
172174 $value = stripslashes($value);
173175 }
174176 if (!is_numeric($value)) {
175- if (version_compare(phpversion(), "4.0.3") == "-1") {
177+ if (version_compare(phpversion(), "4.3.0") == "-1") {
176178 $value = "'" . mysql_escape_string($value) . "'";
177179 } else {
178180 $value = "'" . mysql_real_escape_string($value) . "'";
@@ -193,7 +195,7 @@ class NP_TagEX extends NucleusPlugin
193195 $q_query = 'SELECT tddesc as result '
194196 . 'FROM %s '
195197 . 'WHERE tdname = %s';
196- $q_query = sprintf($q_query, $templateDescTable, $currentTemplateName);
198+ $q_query = sprintf($q_query, $templateDescTable, $currentTemplateName);
197199 $currentTemplateDesc = quickQuery($q_query);
198200 if (eregi('<highlightTagsAll>', $currentTemplateDesc)) {
199201 $tags = $this->scanExistTags(0, 99999999);
@@ -406,9 +408,9 @@ class NP_TagEX extends NucleusPlugin
406408 function event_PreUpdateItem($data)
407409 {
408410 // Add tags when it add for Item
409- $itags = trim(requestVar('itags'));
410- $inum = intval($data['itemid']);
411- $query = 'SELECT itags as result FROM %s WHERE inum = %d';
411+ $itags = trim(requestVar('itags'));
412+ $inum = intval($data['itemid']);
413+ $query = 'SELECT itags as result FROM %s WHERE inum = %d';
412414 $oldTags = quickQuery(sprintf($query, _TAGEX_TABLE, $inum));
413415 if ($itags == $oldTags) {
414416 return;
@@ -416,7 +418,7 @@ class NP_TagEX extends NucleusPlugin
416418 $query = 'DELETE FROM %s WHERE inum = %d';
417419 sql_query(sprintf($query, _TAGEX_TABLE, $inum));
418420 if (isset($itags)) {
419- $query = 'INSERT INTO %s (inum, itags) VALUES (%d, %s)';
421+ $query = 'INSERT INTO %s (inum, itags) VALUES (%d, %s)';
420422 $query = sprintf($query, _TAGEX_TABLE, $inum, $this->quote_smart($itags));
421423 sql_query($query);
422424 }
@@ -457,7 +459,7 @@ class NP_TagEX extends NucleusPlugin
457459 function getTags($str)
458460 {
459461 // extract Item's TAG for array
460- $tempArray = preg_split("/[\r\n,]+/", $str);
462+ $tempArray = preg_split("/[\r\n,]+/", $str);
461463 $returnArray = array_map('trim', $tempArray);
462464 return array_unique($returnArray);
463465 }
@@ -473,8 +475,8 @@ class NP_TagEX extends NucleusPlugin
473475 function deleteTags($tag, $inum)
474476 {
475477 // Delete TAGs and TAG's Item
476- $inum = intval($inum);
477- $tag = $this->quote_smart($tag);
478+ $inum = intval($inum);
479+ $tag = $this->quote_smart($tag);
478480 $f_query = "SELECT inums FROM " . _TAGEX_KLIST_TABLE
479481 . " WHERE tag = " . $tag
480482 . ' AND inums REGEXP "(^|,)' . $inum . '(,|$)"'
@@ -490,16 +492,16 @@ class NP_TagEX extends NucleusPlugin
490492 return;
491493 }
492494 $inums_array = explode(',', $temp_inums);
493- $trans = array_flip($inums_array);
495+ $trans = array_flip($inums_array);
494496 unset($trans[$inum]);
495497 $inums_array = array_flip($trans);
496498 $inums_count = count($inums_array);
497- $inums = @join(",", $inums_array);
499+ $inums = @implode(",", $inums_array);
498500 if (!empty($inums)) {
499501 $update_query = 'UPDATE %s '
500- . 'SET inums = %s, '
502+ . 'SET inums = %s, '
501503 . 'inums_count = %d '
502- . 'WHERE tag = %s';
504+ . 'WHERE tag = %s';
503505 $iCount = intval($inums_count);
504506 $quoteInums = $this->quote_smart($inums);
505507 sql_query(sprintf($update_query, _TAGEX_KLIST_TABLE, $quoteInums, $iCount, $tag));
@@ -512,8 +514,8 @@ class NP_TagEX extends NucleusPlugin
512514 if (empty($tag)) {
513515 return;
514516 }
515- $inum = intval($inum);
516- $tag = $this->quote_smart($tag);
517+ $inum = intval($inum);
518+ $tag = $this->quote_smart($tag);
517519 $f_query = 'SELECT inums'
518520 . ' FROM ' . _TAGEX_KLIST_TABLE
519521 . ' WHERE tag = ' . $tag
@@ -527,14 +529,16 @@ class NP_TagEX extends NucleusPlugin
527529 $inums_count = count($inums_array) + 1;
528530 }
529531 } else {
530- $q_query = 'INSERT INTO %s (tag, inums, inums_count) VALUES (%s, %d, 1)';
532+ $q_query = 'INSERT INTO %s '
533+ . '(tag, inums, inums_count) '
534+ . 'VALUES (%s, %d, 1)';
531535 sql_query(sprintf($q_query, _TAGEX_KLIST_TABLE, $tag, intval($inum)));
532536 }
533537
534538 if (isset($inums)) {
535- $q_query = 'UPDATE %s SET inums = %s, inums_count = %d WHERE tag = %s';
536- $iCount = intval($inums_count);
537- $quoteInums = $this->quote_smart($inums);
539+ $q_query = 'UPDATE %s SET inums = %s, inums_count = %d WHERE tag = %s';
540+ $iCount = intval($inums_count);
541+ $quoteInums = $this->quote_smart($inums);
538542 sql_query(sprintf($q_query, _TAGEX_KLIST_TABLE, $quoteInums, $iCount, $tag));
539543 }
540544 }
@@ -616,8 +620,12 @@ class NP_TagEX extends NucleusPlugin
616620 $where .= ' and i.itime <= ' . mysqldate($b->getCorrectTime());
617621 }
618622
619- $iquery = 'SELECT i.inumber FROM %s as i' . $mtable . ' WHERE i.idraft = 0' . $where;
620- $res = sql_query(sprintf($iquery, sql_table('item')));
623+ $iquery = 'SELECT i.inumber '
624+ . 'FROM %s as i'
625+ . $mtable
626+ . ' WHERE i.idraft = 0'
627+ . $where;
628+ $res = sql_query(sprintf($iquery, sql_table('item')));
621629 while ($row = mysql_fetch_row($res)) {
622630 $existInums[] = $row[0];
623631 }
@@ -675,7 +683,7 @@ class NP_TagEX extends NucleusPlugin
675683 case 4:
676684 /// <http://blog.uribou.net/>
677685 srand ((float) microtime() * 10000000);
678- $tmp_key = array_rand($tagCount, count($tagCount));
686+ $tmp_key = array_rand($tagCount, count($tagCount));
679687 unset($tagCount);
680688 $tagCount = array();
681689 foreach ($tmp_key as $k => $v) {
@@ -715,10 +723,11 @@ class NP_TagEX extends NucleusPlugin
715723 $blogid = intval(getBlogIDFromName($blogid));
716724 }
717725 // </mod by shizuki>
718-// $existInumsIn = ($existInums = $this->scanExistItem($narrowMode, $blogid)) ? ' WHERE inum in (' . @join(',', $existInums) . ')' : '';
726+// $existInumsIn = ($existInums = $this->scanExistItem($narrowMode, $blogid)) ?
727+// ' WHERE inum in (' . @implode(',', $existInums) . ')' : '';
719728 $existInumsIn = '';
720729 if ($existInums = $this->scanExistItem($narrowMode, $blogid)) {
721- $existInumsIn = ' WHERE inum in (' . @join(',', $existInums) . ')';
730+ $existInumsIn = ' WHERE inum in (' . @implode(',', $existInums) . ')';
722731 }
723732 $q = 'SELECT * FROM ' . _TAGEX_TABLE . $existInumsIn;
724733 $res = sql_query($q);
@@ -803,7 +812,8 @@ class NP_TagEX extends NucleusPlugin
803812 $urlq = serverVar('QUERY_STRING');
804813 $urlq = str_replace('?', '', $urlq);
805814 $urlq = explode('&', $urlq);
806- for ($i=0;$i<count($urlq);$i++) {
815+ $qCnt = count($urlq);
816+ for ($i=0; $i<$qCnt; $i++) {
807817 $tempq = explode('=', $urlq[$i]);
808818 if ($tempq[0] == $q) {
809819 $str = preg_replace('|[^a-z0-9-~+_.#;,:@%]|i', '', $tempq[1]);
@@ -823,7 +833,8 @@ class NP_TagEX extends NucleusPlugin
823833 }
824834 $res = array('and'=>array(), 'or'=>array());
825835 $tempAnd = explode('+', $q);
826- for ($i=0; $i<count($tempAnd); $i++) {
836+ $andCnt = count($tempAnd);
837+ for ($i=0; $i<$andCnt; $i++) {
827838 $temp = explode(':', $tempAnd[$i]);
828839 $res['and'][] = array_shift($temp);
829840 if ($temp != array()) {
@@ -837,7 +848,7 @@ class NP_TagEX extends NucleusPlugin
837848 {
838849 // type[0]: type ( + amount (int))
839850 // type[1]: $narrowMode (0/1/2)
840- // type[2]: sort
851+ // type[2]: sortMode (1/2/3/4)
841852 // type[3]: Minimum font-sizem(em) 0.5/1/1.5/2...
842853 // type[4]: Maximum font-sizem(em)
843854 // default
@@ -846,19 +857,25 @@ class NP_TagEX extends NucleusPlugin
846857 }
847858 $type = explode('/',$type);
848859 if (eregi('list', $type[0])) {
849- $amount = eregi_replace("list", "", $type[0]);
860+ $amount = eregi_replace("list", "", $type[0]);
850861 $type[0] = 'list';
851862 // < meta keywords="TAG" mod by shizuki>
852863 } elseif (eregi('meta', $type[0])) {
853- $amount = eregi_replace("meta", "", $type[0]);
864+ $amount = eregi_replace("meta", "", $type[0]);
854865 $type[0] = 'meta';
855866 // </mod by shizuki>*/
856867 }
857868 // default amount
858- $amount = ($amount) ? $amount: 99999999;
869+ $amount = ($amount) ? $amount: 99999999;
870+ $amount = intval($amount);
859871
860872 $defaultType = array('list', '1', '0', '1', '4');
861- $type = $type + $defaultType;
873+ $type = $type + $defaultType;
874+ $type[0] = htmlspecialchars($type[0], ENT_QUOTES, _CHARSET);
875+ $type[1] = intval($type[1]);
876+ $type[2] = intval($type[2]);
877+ $type[3] = (float)$type[3];
878+ $type[4] = (float)$type[4];
862879 // <for FancyURL mod by shizuki>
863880 // if (requestVar('tag')) {
864881 $requestT = $this->getNoDecodeQuery('tag');
@@ -881,7 +898,7 @@ class NP_TagEX extends NucleusPlugin
881898 . '" title="' . $val . '">'
882899 . $val . '</a>';
883900 }
884- $reqANDp = @join('" + "', $reqAndLink);
901+ $reqANDp = @implode('" + "', $reqAndLink);
885902 if ($reqOR) {
886903 foreach ($reqOR as $val) {
887904 $reqOrLink[] = '<a href="'
@@ -912,9 +929,10 @@ class NP_TagEX extends NucleusPlugin
912929 $res = sql_query(sprintf($q, _TAGEX_TABLE, $itemid));
913930 while ($o = mysql_fetch_object($res)) {
914931 $temp_tags_array = preg_split("/[\n,]+/", trim($o->itags));
915- for ($i=0; $i < count($temp_tags_array); $i++) {
932+ $temp_tags_count = count($temp_tags_array);
933+ for ($i=0; $i < $temp_tags_count; $i++) {
916934 $tag = trim($temp_tags_array[$i]);
917- $taglist[$i] = htmlspecialchars($tag);
935+ $taglist[$i] = htmlspecialchars($tag, ENT_QUOTES, _CHARSET);
918936 }
919937 }
920938 if ($taglist)
@@ -924,7 +942,7 @@ class NP_TagEX extends NucleusPlugin
924942 $eachTag = array();
925943 $t = 0;
926944 foreach ($tags as $tag => $inums) {
927- $eachTag[$t] = htmlspecialchars($tag);
945+ $eachTag[$t] = htmlspecialchars($tag, ENT_QUOTES, _CHARSET);
928946 $t++;
929947 }
930948 if ($type[3] != 'ad') {
@@ -961,26 +979,34 @@ tagIndexSeparator
961979
962980
963981 /*
964- $template['tagIndex'] = '<h3><a href="<%taglinkurl%>"><%tag%>(<%tagamount%>)</a></h3>';
965- $template['tagItemHeader'] = '<ul>';
966- $template['tagItem'] = '<li><%itemid%></li>';
967- $template['tagItemSeparator'] = '';
968- $template['tagItemFooter'] = '</ul>';
982+ $template['tagIndex'] = '<h3><a href="<%taglinkurl%>"><%tag%>'
983+ . '(<%tagamount%>)</a></h3>';
984+ $template['tagItemHeader'] = '<ul>';
985+ $template['tagItem'] = '<li><%itemid%></li>';
986+ $template['tagItemSeparator'] = '';
987+ $template['tagItemFooter'] = '</ul>';
969988 *//*
970- $template['and'] = '<span style="font-family:tahoma;font-size:smaller;"> <a href="<%andurl%>" title="narrow">&amp;</a>.';
971- $template['or'] = '<a href="<%orurl%>" title="expand">or</a> </span>';
972- $template['tagIndex'] = '<%and%><%or%><span style="font-size:<%fontlevel%>em" title="<%tagamount%> post(s)! <%tagitems%>"><a href="<%taglinkurl%>"><%tag%></a></span>';
973- $template['tagItemHeader'] = '';
974- $template['tagItem'] = "<%itemid%>:<%itemtitle%>";
975- $template['tagItemSeparator'] = ' , ';
976- $template['tagItemFooter'] = '';
989+ $template['and'] = '<span style="font-family:tahoma;font-size:smaller;">'
990+ . ' <a href="<%andurl%>" title="narrow">&amp;</a>.';
991+ $template['or'] = '<a href="<%orurl%>" title="expand">or</a> </span>';
992+ $template['tagIndex'] = '<%and%><%or%>'
993+ . '<span style="font-size:<%fontlevel%>em" '
994+ . 'title="<%tagamount%> post(s)! <%tagitems%>">'
995+ . '<a href="<%taglinkurl%>"><%tag%></a></span>';
996+ $template['tagItemHeader'] = '';
997+ $template['tagItem'] = "<%itemid%>:<%itemtitle%>";
998+ $template['tagItemSeparator'] = ' , ';
999+ $template['tagItemFooter'] = '';
9771000 $template['tagIndexSeparator'] = ' | ';
9781001 *//*
979- $template['tagIndex'] = '<span style="font-size:<%fontlevel%>em" title="<%tagamount%> post(s)!"><a href="<%taglinkurl%>"><%tag%>(<%tagamount%>)</a></span>';
980- $template['tagItemHeader'] = '';
981- $template['tagItem'] = "\n<%itemid%>:<%itemtitle%>";
982- $template['tagItemSeparator'] = ' / ';
983- $template['tagItemFooter'] = '';
1002+ $template['tagIndex'] = '<span style="font-size:<%fontlevel%>em"'
1003+ . ' title="<%tagamount%> post(s)!">'
1004+ . '<a href="<%taglinkurl%>"><%tag%>'
1005+ . '(<%tagamount%>)</a></span>';
1006+ $template['tagItemHeader'] = '';
1007+ $template['tagItem'] = "\n<%itemid%>:<%itemtitle%>";
1008+ $template['tagItemSeparator'] = ' / ';
1009+ $template['tagItemFooter'] = '';
9841010 $template['tagIndexSeparator'] = ' | ';
9851011 */
9861012 // print_r($tags);
@@ -997,11 +1023,11 @@ tagIndexSeparator
9971023 // if($tags = $this->scanExistTags($type[1], $amount, $type[2])){// original mode
9981024 if ($tags = $this->scanExistTags($type[1])) {// <nodisplay selected TAGs mod by shizuki />
9991025 if ($type[3] != $type[4]) {
1000- $minFontSize = min($type[3], $type[4]) - 0.5;
1001- $maxFontSize = max($type[3], $type[4]);
1002- $levelsum = ($maxFontSize - $minFontSize) / 0.5;
1026+ $minFontSize = min($type[3], $type[4]) - 0.5;
1027+ $maxFontSize = max($type[3], $type[4]);
1028+ $levelsum = ($maxFontSize - $minFontSize) / 0.5;
10031029 list($maxCount, $minCount) = $this->scanCount($tags);
1004- $eachCount = ceil(($maxCount - $minCount) / $levelsum);
1030+ $eachCount = ceil(($maxCount - $minCount) / $levelsum);
10051031 }
10061032 // <nodisplay selected TAGs mod by shizuki>
10071033 $select = array();
@@ -1044,7 +1070,7 @@ tagIndexSeparator
10441070 }
10451071 // </mod by shizuki>*/
10461072 $eachTag = array();
1047- $t = 0;
1073+ $t = 0;
10481074 foreach ($tags as $tag => $inums) {
10491075 $tagitems = array();
10501076 $tagAmount = count($inums);
@@ -1057,13 +1083,16 @@ tagIndexSeparator
10571083
10581084 // Item's name had TAGs
10591085 for ($i=0;$i<$tagAmount;$i++) {
1060- $qQuery = 'SELECT ititle as result FROM %s WHERE inumber = %d';
1061- $qQuery = sprintf($qQuery, sql_table('item'), intval($inums[$i]));
1062- $itemtitle = quickQuery($qQuery);
1063- $shortTitle = shorten(strip_tags($itemtitle), 10, '..');
1086+ $qQuery = 'SELECT ititle as result '
1087+ . 'FROM %s WHERE inumber = %d';
1088+ $qQuery = sprintf($qQuery, sql_table('item'), intval($inums[$i]));
1089+ $itemtitle = quickQuery($qQuery);
1090+ $itemtitle = htmlspecialchars($itemtitle, ENT_QUOTES, _CHARSET);
1091+ $shortTitle = shorten(strip_tags($itemtitle), 10, '...');
1092+ $shortTitle = htmlspecialchars($shortTitle, ENT_QUOTES, _CHARSET);
10641093 $printData['tagItem'] = array(
1065- 'itemid' => intval($inums[$i]),
1066- 'itemtitle' => $shortTitle,
1094+ 'itemid' => intval($inums[$i]),
1095+ 'itemtitle' => $shortTitle,
10671096 );
10681097 $tagitems[] = TEMPLATE::fill($template['tagItem'], $printData['tagItem']);
10691098 }
@@ -1090,12 +1119,12 @@ tagIndexSeparator
10901119 $printData['tagIndex'] = array(
10911120 'and' => $and,
10921121 'or' => $or,
1093- 'tag' => htmlspecialchars($tag),
1122+ 'tag' => htmlspecialchars($tag, ENT_QUOTES, _CHARSET),
10941123 'tagamount' => $tagAmount,
10951124 'fontlevel' => $fontlevel,
10961125 'taglinkurl' => $this->creatTagLink($tag, $type[1]),
10971126 'tagitems' => $tagitem
1098- );
1127+ );
10991128 $eachTag[$t] = TEMPLATE::fill($template['tagIndex'], $printData['tagIndex']);
11001129
11011130 // format outputdata and data output
@@ -1145,10 +1174,10 @@ tagIndexSeparator
11451174 while ($o = mysql_fetch_object($res)) {
11461175 $temp_tags_array = preg_split("/[\n,]+/", trim($o->itags));
11471176 for ($i=0; $i < count($temp_tags_array); $i++) {
1148- $tag = trim($temp_tags_array[$i]);
1177+ $tag = trim($temp_tags_array[$i]);
11491178 $taglink = $this->creatTagLink($tag, 0);
11501179 // <highlight selected TAGs mod by shizuki>
1151- $key = array_search($tag, $words);
1180+ $key = array_search($tag, $words);
11521181 if ($key >= 10) {
11531182 $key = $key - 10;
11541183 }
@@ -1156,13 +1185,13 @@ tagIndexSeparator
11561185 $taglist[$i] = '<a href="'
11571186 . $this->creatTagLink($tag, 0)
11581187 . '" class="highlight_0" rel="tag">'
1159- . htmlspecialchars($tag) . '</a>';
1188+ . htmlspecialchars($tag, ENT_QUOTES, _CHARSET) . '</a>';
11601189 } else {
11611190 // </mod by shizuki>*/
11621191 $taglist[$i] = '<a href="'
11631192 . $this->creatTagLink($tag, 0)
11641193 . '" rel="tag">'
1165- . htmlspecialchars($tag) . '</a>';
1194+ . htmlspecialchars($tag, ENT_QUOTES, _CHARSET) . '</a>';
11661195 } // <highlight selected TAGs mod by shizuki />
11671196 }
11681197 }
@@ -1198,11 +1227,21 @@ tagIndexSeparator
11981227 function getChildren($subcat_id)
11991228 {
12001229 $subcat_id = intval($subcat_id); // <mod by shizuki />
1201- $que = 'SELECT scatid, parentid, sname FROM %s WHERE parentid = %d';
1230+ $que = 'SELECT'
1231+ . ' scatid,'
1232+ . ' parentid,'
1233+ . ' sname '
1234+ . 'FROM'
1235+ . ' %s '
1236+ . 'WHERE'
1237+ . ' parentid = %d';
12021238 $mcatTable = sql_table('plug_multiple_categories_sub');
1203- $res = sql_query(sprintf($que, $mcatTable, $subcat_id));
1239+ $que = sprintf($que, $mcatTable, $subcat_id);
1240+ $res = sql_query($que);
12041241 while ($so = mysql_fetch_object($res)) {
1205- $r .= $this->getChildren($so->scatid) . '/' . $so->scatid;
1242+ $r .= $this->getChildren($so->scatid)
1243+ . '/'
1244+ . $so->scatid;
12061245 }
12071246 return $r;
12081247 }
@@ -1219,6 +1258,7 @@ tagIndexSeparator
12191258 if (!$blogid) {
12201259 $blogid = $CONF['DefaultBlog'];
12211260 }
1261+ $b =& $manager->getBlog($blogid);
12221262 if ($narrowMode == 2) {
12231263 // if ($blogid) {
12241264 // $linkparams['blogid'] = intval($blogid);
@@ -1228,7 +1268,7 @@ tagIndexSeparator
12281268 }
12291269 if ($manager->pluginInstalled('NP_MultipleCategories')) {
12301270 $mcategories =& $manager->getPlugin('NP_MultipleCategories');
1231- if (method_exists($mcategories, "getRequestName")) {
1271+ if (method_exists($mcategories, 'getRequestName')) {
12321272 $subrequest = $mcategories->getRequestName();
12331273 } else {
12341274 $subrequest = 'subcatid';
@@ -1266,27 +1306,40 @@ tagIndexSeparator
12661306 $sep = '';
12671307 }
12681308 // <mod by shizuki>
1269- $link = $CONF['BlogURL'];
1270- if (substr($CONF['BlogURL'], -1) != '/') {
1271- if (substr($CONF['BlogURL'], -4) != '.php') {
1309+/// <Original URL Generate code>
1310+// if ($CONF['URLMode'] == 'pathinfo')
1311+// $link = $CONF['IndexURL'] . '/tag/' . $ready . $sep . $this->_rawencode($tag);
1312+// else
1313+// $link = $CONF['IndexURL'] . '?tag=' . $ready . $sep . $this->_rawencode($tag);
1314+ $link = $b->getURL();
1315+ if (substr($link, -1) != '/') {
1316+ if (substr($link, -4) != '.php') {
12721317 $link .= '/';
12731318 }
12741319 }
12751320 if ($CONF['URLMode'] == 'pathinfo') {
1276- $link .= 'tag/' . $ready . $sep . $this->_rawencode($tag);
1321+ $link .= 'tag/' . $ready . $sep . $this->_rawencode($tag);
12771322 } else {
12781323 $link .= '?tag=' . $ready . $sep . $this->_rawencode($tag);
12791324 }
1280-// if ($CONF['URLMode'] == 'pathinfo')
1281-// $link = $CONF['IndexURL'] . '/tag/' . $ready . $sep . $this->_rawencode($tag);
1282-// else
1283-// $link = $CONF['IndexURL'] . '?tag=' . $ready . $sep . $this->_rawencode($tag);
1325+// </ Original URL Generate code> */
1326+
1327+/*// <test code>
1328+ $CONF['BlogURL'] = $b->getURL();
1329+ $linkparams['tag'] = $ready . $sep . $this->_rawencode($tag);
1330+ $uri = createBlogidLink($blogid, $linkparams);
1331+ if (strstr ($uri, '//')) {
1332+ $uri = preg_replace("/([^:])\/\//", "$1/", $uri);
1333+ }
1334+ return $uri;
1335+// </test code>*/
1336+
12841337 // </mod by shizuki>*/
12851338
12861339 // <mod by shizuki>
12871340 if ($manager->pluginInstalled('NP_CustomURL')) {
12881341 $linkparams['tag'] = $ready . $sep . $this->_rawencode($tag);
1289- $uri = createBlogidLink($blogid, $linkparams);
1342+ $uri = createBlogidLink($blogid, $linkparams);
12901343 if (strstr ($uri, '//')) {
12911344 $uri = preg_replace("/([^:])\/\//", "$1/", $uri);
12921345 }
@@ -1317,5 +1370,4 @@ tagIndexSeparator
13171370 }
13181371 }
13191372
1320-}
1321-?>
\ No newline at end of file
1373+}
\ No newline at end of file
Show on old repository browser