Nucleus CMS日本語版用プラグインのうち、日本語版開発者がサポートしているもの
Revision | 1739c69c94c5c2dde2b78584acfe76e70190d097 (tree) |
---|---|
Time | 2006-10-02 12:27:10 |
Author | shizuki <shizuki@1ca2...> |
Commiter | shizuki |
*** empty log message ***
git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/plugin@392 1ca29b6e-896d-4ea0-84a5-967f57386b96
@@ -4,33 +4,27 @@ | ||
4 | 4 | * BreadCrumbsList PLUG-IN FOR NucleusCMS |
5 | 5 | * PHP versions 4 and 5 |
6 | 6 | * |
7 | + * This program is free software; you can redistribute it and/or | |
8 | + * modify it under the terms of the GNU General Public License | |
9 | + * as published by the Free Software Foundation; either version 2 | |
10 | + * of the License, or (at your option) any later version. | |
11 | + * (see nucleus/documentation/index.html#license for more info) | |
12 | + * | |
7 | 13 | * @author Original Author nakahara21 |
8 | 14 | * @copyright 2005-2006 nakahara21 |
9 | 15 | * @license http://www.gnu.org/licenses/gpl.txt GNU GENERAL PUBLIC LICENSE Version 2, June 1991 |
10 | 16 | * @version 0.41 |
11 | 17 | * @link http://nakahara21.com |
12 | 18 | * |
13 | - * 0.41 security fix | |
14 | - * 0.4 fixed bug: numlic only | |
15 | - * 0.3 fixed bug: delete action | |
16 | - * 0.2 supports and/or query | |
19 | + * 0.991 add sub-blog home mode | |
20 | + * 0.99 sec fix | |
17 | 21 | * |
18 | - */ | |
19 | - | |
20 | -/* | |
22 | + ************************************************************************** | |
21 | 23 | * |
22 | 24 | * THESE PLUG-INS ARE DEDICATED TO ALL THOSE NucleusCMS USERS |
23 | 25 | * WHO FIGHT CORRUPTION AND IRRATIONAL IN EVERY DAY OF THEIR LIVES. |
24 | 26 | * |
25 | - */ | |
26 | - | |
27 | -// plugin needs to work on Nucleus versions <=2.0 as well | |
28 | -if (!function_exists('sql_table')){ | |
29 | - function sql_table($name) { | |
30 | - return 'nucleus_' . $name; | |
31 | - } | |
32 | -} | |
33 | - | |
27 | + **************************************************************************/ | |
34 | 28 | |
35 | 29 | class NP_ItemNaviEX extends NucleusPlugin |
36 | 30 | { |
@@ -38,22 +32,27 @@ class NP_ItemNaviEX extends NucleusPlugin | ||
38 | 32 | { |
39 | 33 | return 'Navigation Bar'; |
40 | 34 | } |
35 | + | |
41 | 36 | function getAuthor() |
42 | 37 | { |
43 | 38 | return 'nakahara21'; |
44 | 39 | } |
40 | + | |
45 | 41 | function getURL() |
46 | 42 | { |
47 | 43 | return 'http://nakahara21.com/'; |
48 | 44 | } |
45 | + | |
49 | 46 | function getVersion() |
50 | 47 | { |
51 | - return '0.99'; | |
48 | + return '0.991'; | |
52 | 49 | } |
50 | + | |
53 | 51 | function getDescription() |
54 | 52 | { |
55 | 53 | return 'Add link to prev item and next item. Usage: <%ItemNaviEX()%> or <%ItemNaviEX(0)%>'; |
56 | 54 | } |
55 | + | |
57 | 56 | function supportsFeature($what) |
58 | 57 | { |
59 | 58 | switch($what){ |
@@ -74,9 +73,9 @@ class NP_ItemNaviEX extends NucleusPlugin | ||
74 | 73 | function createNaviLink($unitArray) |
75 | 74 | { |
76 | 75 | if ($unitArray[1]) { |
77 | - $tempLink = '<a href="' . $unitArray[1] . '">' . $unitArray[0] . '</a>'; | |
76 | + $tempLink = '<a href="' . htmlspecialchars($unitArray[1]) . '">' . htmlspecialchars($unitArray[0]) . '</a>'; | |
78 | 77 | } else { |
79 | - $tempLink = $unitArray[0]; | |
78 | + $tempLink = htmlspecialchars($unitArray[0]); | |
80 | 79 | } |
81 | 80 | return $tempLink; |
82 | 81 | } |
@@ -87,9 +86,11 @@ class NP_ItemNaviEX extends NucleusPlugin | ||
87 | 86 | // if ($manager->pluginInstalled('NP_MultipleCategories')) { |
88 | 87 | // $mplugin =& $manager->getPlugin('NP_MultipleCategories'); |
89 | 88 | // if (method_exists($mplugin,"getRequestName")) { |
90 | - $res = sql_query("SHOW FIELDS FROM " . sql_table('plug_multiple_categories_sub') ); | |
89 | + $res = sql_query('SHOW FIELDS FROM ' . sql_table('plug_multiple_categories_sub')); | |
91 | 90 | while ($co = mysql_fetch_assoc($res)) { |
92 | - if($co['Field'] == 'parentid') return TRUE; | |
91 | + if ($co['Field'] == 'parentid') { | |
92 | + return TRUE; | |
93 | + } | |
93 | 94 | } |
94 | 95 | // } |
95 | 96 | // } |
@@ -97,9 +98,11 @@ class NP_ItemNaviEX extends NucleusPlugin | ||
97 | 98 | |
98 | 99 | function doSkinVar($skinType, $showHome = 1) |
99 | 100 | { |
100 | - global $manager, $blog, $CONF, $itemidprev, $itemidnext, $archive, $archiveprev, $archivenext, $catid, $param, $itemid, $subcatid; | |
101 | + global $manager, $CONF, $blog, $itemid, $itemidprev, $itemidnext; | |
102 | + global $catid, $subcatid, $archive, $archiveprev, $archivenext, $param; | |
101 | 103 | |
102 | 104 | // sanitize |
105 | + $y = $m = $d = ''; | |
103 | 106 | $itemid = intval($itemid); |
104 | 107 | $catid = intval($catid); |
105 | 108 | $subcatid = intval($subcatid); |
@@ -107,28 +110,25 @@ class NP_ItemNaviEX extends NucleusPlugin | ||
107 | 110 | $itemidnext = intval($itemidnext); |
108 | 111 | if (isset($archive)) { |
109 | 112 | sscanf($archive,'%d-%d-%d', $y, $m, $d); |
110 | - // directed by shizuki | |
111 | - if ($y && $m && $d) { | |
113 | + if ($y && $m && !empty($d)) { | |
112 | 114 | $archive = sprintf('%04d-%02d-%02d', $y, $m, $d); |
113 | - } elseif ($y && $m && !$d) { | |
115 | + } elseif ($y && $m && empty($d)) { | |
114 | 116 | $archive = sprintf('%04d-%02d', $y, $m); |
115 | 117 | } |
116 | 118 | } |
117 | 119 | if (isset($archiveprev)) { |
118 | 120 | sscanf($archiveprev,'%d-%d-%d', $y, $m, $d); |
119 | - // directed by shizuki | |
120 | - if ($y && $m && $d) { | |
121 | + if ($y && $m && !empty($d)) { | |
121 | 122 | $archiveprev = sprintf('%04d-%02d-%02d', $y, $m, $d); |
122 | - } elseif ($y && $m && !$d) { | |
123 | + } elseif ($y && $m && empty($d)) { | |
123 | 124 | $archiveprev = sprintf('%04d-%02d', $y, $m); |
124 | 125 | } |
125 | 126 | } |
126 | 127 | if (isset($archiveprev)) { |
127 | 128 | sscanf($archiveprev,'%d-%d-%d', $y, $m, $d); |
128 | - // directed by shizuki | |
129 | - if ($y && $m && $d) { | |
129 | + if ($y && $m && !empty($d)) { | |
130 | 130 | $archiveprev = sprintf('%04d-%02d-%02d', $y, $m, $d); |
131 | - } elseif ($y && $m && !$d) { | |
131 | + } elseif ($y && $m && empty($d)) { | |
132 | 132 | $archiveprev = sprintf('%04d-%02d', $y, $m); |
133 | 133 | } |
134 | 134 | } |
@@ -144,19 +144,18 @@ class NP_ItemNaviEX extends NucleusPlugin | ||
144 | 144 | } else { |
145 | 145 | $b =& $manager->getBlog($CONF['DefaultBlog']); |
146 | 146 | } |
147 | - $blogid = $b->getID(); | |
148 | - $blogid = intval($blogid); | |
147 | + $blogid = intval($b->getID()); | |
149 | 148 | |
150 | 149 | $abuf = ''; |
151 | - $mtable = ""; | |
150 | + $mtable = ''; | |
152 | 151 | $where .= ' and i.iblog=' . $blogid; |
153 | 152 | if (!empty($catid)) { |
154 | 153 | if ($manager->pluginInstalled('NP_MultipleCategories')) { |
155 | - $where .= ' and ((i.inumber=p.item_id and (p.categories REGEXP "(^|,)' . $catid . '(,|$)" or i.icat='; | |
156 | - $where .= $catid . ')) or (i.icat=' . $catid . ' and p.item_id IS NULL))'; | |
157 | - $mtable = ' LEFT JOIN ' . sql_table('plug_multiple_categories') . ' as p ON i.inumber=p.item_id'; | |
154 | + $where .= ' and ((i.inumber = p.item_id and (p.categories REGEXP "(^|,)' . $catid . '(,|$)"' . | |
155 | + ' or i.icat = ' . $catid . ')) or (i.icat = ' . $catid . ' and p.item_id IS NULL))'; | |
156 | + $mtable = ' LEFT JOIN ' . sql_table('plug_multiple_categories') . ' as p ON i.inumber = p.item_id'; | |
158 | 157 | $mplugin =& $manager->getPlugin('NP_MultipleCategories'); |
159 | - if ($subcatid && method_exists($mplugin, "getRequestName")) { | |
158 | + if ($subcatid && method_exists($mplugin, 'getRequestName')) { | |
160 | 159 | //family |
161 | 160 | if ($this->checkParent()) { |
162 | 161 | $Children = array(); |
@@ -185,7 +184,7 @@ class NP_ItemNaviEX extends NucleusPlugin | ||
185 | 184 | $this->linkparams = array(); |
186 | 185 | //store Home ===================================== |
187 | 186 | // comment out this block when HOME is sub-blog top |
188 | - if($showHome > 0){ | |
187 | + if ($showHome == 1) { | |
189 | 188 | $naviUnit[] = array( |
190 | 189 | 0 => 'Home', |
191 | 190 | 1 => $CONF['IndexURL'] |
@@ -193,13 +192,16 @@ class NP_ItemNaviEX extends NucleusPlugin | ||
193 | 192 | } |
194 | 193 | |
195 | 194 | //store Blog ===================================== |
196 | - if ($showHome > 0 && ($blogid <> $CONF['DefaultBlog'])) { | |
197 | -// if ($showHome > 0) { | |
195 | + if ($showHome == 1 && ($blogid <> $CONF['DefaultBlog'])) { | |
198 | 196 | $naviUnit[] = array( |
199 | - 0 => htmlspecialchars(getBlogNameFromID($blogid)), | |
200 | -// 0 => 'Home', // when HOME is sub-blog top | |
197 | + 0 => getBlogNameFromID($blogid), | |
201 | 198 | 1 => createBlogidLink($blogid), |
202 | -// 1 => $CONF['BlogURL'] . '/', // when HOME is sub-blog top | |
199 | + 2 => createArchiveListLink($blogid) | |
200 | + ); | |
201 | + } elseif ($showHome >= 2) { | |
202 | + $naviUnit[] = array( | |
203 | + 0 => 'Home', // when HOME is sub-blog top | |
204 | + 1 => $CONF['BlogURL'] . '/', // when HOME is sub-blog top | |
203 | 205 | 2 => createArchiveListLink($blogid) |
204 | 206 | ); |
205 | 207 | } |
@@ -208,7 +210,7 @@ class NP_ItemNaviEX extends NucleusPlugin | ||
208 | 210 | if (!empty($catid)) { |
209 | 211 | $this->linkparams['catid'] = $catid; |
210 | 212 | $naviUnit[] = array( |
211 | - 0 => htmlspecialchars($b->getCategoryName($catid)), | |
213 | + 0 => $b->getCategoryName($catid), | |
212 | 214 | 1 => createCategoryLink($catid), |
213 | 215 | // 1 => createBlogidLink($blogid, $this->linkparams), |
214 | 216 | 2 => createArchiveListLink($blogid, $this->linkparams) |
@@ -217,20 +219,20 @@ class NP_ItemNaviEX extends NucleusPlugin | ||
217 | 219 | |
218 | 220 | //store subCategory ===================================== |
219 | 221 | if (!empty($subcatid)) { |
220 | - $this->linkparams[subcatid] = $subcatid; | |
221 | 222 | if ($manager->pluginInstalled('NP_MultipleCategories')) { |
222 | 223 | $mplugin =& $manager->getPlugin('NP_MultipleCategories'); |
223 | - if (method_exists($mplugin, "getRequestName")) { | |
224 | - $subrequest = $mplugin->getRequestName(); | |
225 | - if($this->checkParent()){ | |
224 | + if (method_exists($mplugin, 'getRequestName')) { | |
225 | + $subrequest = $mplugin->getRequestName(array()); | |
226 | + $this->linkparams[$subrequest] = $subcatid; | |
227 | + if ($this->checkParent()) { | |
226 | 228 | $tog = $this->getParenta($subcatid, $blogid); |
227 | - for($i=0;$i<count($this->r);$i++){ | |
229 | + for ($i=0;$i<count($this->r);$i++) { | |
228 | 230 | $naviUnit[] = $this->r[$i]; |
229 | 231 | } |
230 | 232 | $naviUnit[] = $tog; |
231 | - }else{ | |
233 | + } else { | |
232 | 234 | $naviUnit[] = array( |
233 | - 0 => htmlspecialchars($mplugin->_getScatNameFromID($subcatid)), | |
235 | + 0 => $mplugin->_getScatNameFromID($subcatid), | |
234 | 236 | 1 => createCategoryLink($catid, array($subrequest => $subcatid)), |
235 | 237 | // 1 => createCategoryLink($catid, array('subcatid' => $subcatid)), |
236 | 238 | // 1 => createBlogidLink($blogid, $this->linkparams), |
@@ -241,7 +243,7 @@ class NP_ItemNaviEX extends NucleusPlugin | ||
241 | 243 | } |
242 | 244 | } |
243 | 245 | |
244 | -//store Page ===================================== | |
246 | +//store Page ===================================== todo How to get PageNo. ? ...cookie... | |
245 | 247 | if (requestVar('page')) { |
246 | 248 | $naviUnit[] = array( |
247 | 249 | 0 => 'Page.' . intRequestVar('page'), |
@@ -253,32 +255,34 @@ class NP_ItemNaviEX extends NucleusPlugin | ||
253 | 255 | if ($skinType == 'item') { |
254 | 256 | $item =& $manager->getItem($itemid, 0, 0); |
255 | 257 | $naviUnit[] = array( |
256 | - 0 => htmlspecialchars($item['title']) | |
258 | + 0 => $item['title'] | |
257 | 259 | ); |
258 | 260 | |
259 | 261 | |
260 | 262 | $query = 'SELECT i.ititle, i.inumber' |
261 | - . ' FROM '.sql_table('item') . ' as i' . $mtable | |
262 | - . ' WHERE i.idraft=0' | |
263 | - . " and i.itime< '" . $item['itime'] . "' " . $where; | |
263 | + . ' FROM ' . sql_table('item') . ' as i' . $mtable | |
264 | + . ' WHERE i.idraft = 0' | |
265 | + . " and i.itime < '" . $item['itime'] . "' " . $where; | |
264 | 266 | $query .= ' ORDER BY i.itime DESC'; |
265 | 267 | $res = sql_query($query); |
266 | 268 | if ($ares = mysql_fetch_row($res)) { |
267 | 269 | $alink = createItemLink($ares[1], $this->linkparams); |
268 | - $subNaviUnit[1] = '<a href="' . $alink . '" rel="prev"> « ' . shorten($ares[0], 14, '...') . '</a>'; | |
270 | + $subNaviUnit[1] = '<a href="' . htmlspecialchars($alink) . '" rel="prev"> « ' . | |
271 | + shorten($ares[0], 14, '...') . '</a>'; | |
269 | 272 | } |
270 | 273 | |
271 | 274 | |
272 | 275 | |
273 | 276 | $query = 'SELECT i.ititle, i.inumber' |
274 | 277 | . ' FROM ' . sql_table('item') . ' as i' . $mtable |
275 | - . ' WHERE i.idraft=0' | |
276 | - . " and i.itime> '" . $item['itime'] . "' " . $where; | |
278 | + . ' WHERE i.idraft = 0' | |
279 | + . " and i.itime > '" . $item['itime'] . "' " . $where; | |
277 | 280 | $query .= ' ORDER BY i.itime ASC'; |
278 | 281 | $res = sql_query($query); |
279 | 282 | if ($ares = mysql_fetch_row($res)) { |
280 | 283 | $alink = createItemLink($ares[1], $this->linkparams); |
281 | - $subNaviUnit[2] = '<a href="' . $alink . '" rel="next"> ' . shorten($ares[0], 14, '...') . ' »</a>'; | |
284 | + $subNaviUnit[2] = '<a href="' . htmlspecialchars($alink) . '" rel="next"> ' . | |
285 | + shorten($ares[0], 14, '...') . ' »</a>'; | |
282 | 286 | } |
283 | 287 | |
284 | 288 |
@@ -293,14 +297,14 @@ class NP_ItemNaviEX extends NucleusPlugin | ||
293 | 297 | } |
294 | 298 | |
295 | 299 | if ($skinType == 'archive') { |
296 | - sscanf($archive,'%04s-%02s-%02s', $y, $m, $d); | |
300 | + sscanf($archive,'%04d-%02d-%02d', $y, $m, $d); | |
297 | 301 | //store ArchiveMonth |
298 | 302 | $archiveMonth = $y . '-' . $m; |
299 | 303 | $naviUnit[] = array( |
300 | - 0 => htmlspecialchars($archiveMonth), | |
304 | + 0 => $archiveMonth, | |
301 | 305 | 1 => createArchiveLink($blogid, $archiveMonth, $this->linkparams) |
302 | 306 | ); |
303 | - if (!$d) { | |
307 | + if (empty($d)) { | |
304 | 308 | $timestamp_start = mktime(0, 0, 0, $m, 1, $y); |
305 | 309 | $timestamp_end = mktime(0, 0, 0, $m+1, 1, $y); |
306 | 310 | $date_str = 'SUBSTRING(i.itime, 1, 7)'; |
@@ -310,7 +314,7 @@ class NP_ItemNaviEX extends NucleusPlugin | ||
310 | 314 | $date_str = 'SUBSTRING(i.itime, 1, 10)'; |
311 | 315 | //store ArchiveDay |
312 | 316 | $naviUnit[] = array( |
313 | - 0 => htmlspecialchars($y . '-' . $m . '-' . $d), | |
317 | + 0 => $y . '-' . $m . '-' . $d, | |
314 | 318 | 1 => createArchiveLink($blogid, $archive, $this->linkparams) |
315 | 319 | ); |
316 | 320 | } |
@@ -318,35 +322,39 @@ class NP_ItemNaviEX extends NucleusPlugin | ||
318 | 322 | //============================= |
319 | 323 | $query = 'SELECT ' . $date_str . ' as Date' |
320 | 324 | . ' FROM ' . sql_table('item') . ' as i' . $mtable |
321 | - . ' WHERE i.idraft=0' | |
322 | - . ' and i.itime<' . mysqldate($timestamp_start) . $where; | |
325 | + . ' WHERE i.idraft = 0' | |
326 | + . ' and i.itime < ' . mysqldate($timestamp_start) . $where; | |
323 | 327 | $query .= ' GROUP BY Date'; |
324 | 328 | $query .= ' ORDER BY i.itime DESC'; |
325 | 329 | $res = sql_query($query); |
326 | 330 | if ($ares = mysql_fetch_row($res)) { |
327 | - $prev_date = $ares[0]; | |
328 | - $prev_alink = createArchiveLink($b->getID(), $prev_date, $this->linkparams); | |
329 | - $subNaviUnit[1] = '<a href="' . $prev_alink . '" class="prevlink" rel="prev"> « ' | |
330 | - . htmlspecialchars($prev_date) . '</a>'; | |
331 | +// $prev_date = $ares[0]; | |
332 | + sscanf($ares[0],'%d-%d-%d', $y, $m, $d); | |
333 | + $prev_date = sprintf('%04d-%02d-%02d', $y, $m, $d); | |
334 | + $prev_alink = createArchiveLink($blogid, $prev_date, $this->linkparams); | |
335 | + $subNaviUnit[1] = '<a href="' . htmlspecialchars($prev_alink) . '" class="prevlink" rel="prev">' . | |
336 | + ' « ' . htmlspecialchars($prev_date) . '</a>'; | |
331 | 337 | // $abuf .= '<a href="'.$prev_alink.'" class="prevlink" rel="prev">'.$prev_date.'</a>'; |
332 | 338 | // } else { |
333 | 339 | // $today_link = createBlogidLink($b->getID(), $this->linkparams); |
334 | 340 | // $abuf .= ' ( <a href="'.$today_link.'">Today</a> )'; |
335 | 341 | } |
336 | - $abuf .= ' | <strong>' . $archive . '</strong> '; | |
342 | + $abuf .= ' | <strong>' . htmlspecialchars($archive) . '</strong> '; | |
337 | 343 | //============================= |
338 | 344 | $query = 'SELECT ' . $date_str . ' as Date' |
339 | 345 | . ' FROM ' . sql_table('item') . ' as i' . $mtable |
340 | - . ' WHERE i.idraft=0' | |
341 | - . ' and i.itime<' . mysqldate($b->getCorrectTime()) | |
342 | - . ' and i.itime>=' . mysqldate($timestamp_end) . $where; | |
346 | + . ' WHERE i.idraft = 0' | |
347 | + . ' and i.itime < ' . mysqldate($b->getCorrectTime()) | |
348 | + . ' and i.itime >= ' . mysqldate($timestamp_end) . $where; | |
343 | 349 | $query .= ' GROUP BY Date'; |
344 | 350 | $query .= ' ORDER BY i.itime ASC'; |
345 | 351 | $res = sql_query($query); |
346 | - if($ares = mysql_fetch_row($res)) { | |
347 | - $next_date = $ares[0]; | |
348 | - $next_alink = createArchiveLink($b->getID(), $next_date, $this->linkparams); | |
349 | - $subNaviUnit[2] = '<a href="' . $next_alink . '" class="nextlink" rel="next">' | |
352 | + if ($ares = mysql_fetch_row($res)) { | |
353 | +// $next_date = $ares[0]; | |
354 | + sscanf($ares[0],'%d-%d-%d', $y, $m, $d); | |
355 | + $next_date = sprintf('%04d-%02d-%02d', $y, $m, $d); | |
356 | + $next_alink = createArchiveLink($blogid, $next_date, $this->linkparams); | |
357 | + $subNaviUnit[2] = '<a href="' . htmlspecialchars($next_alink) . '" class="nextlink" rel="next">' | |
350 | 358 | . htmlspecialchars($next_date) . ' »</a>'; |
351 | 359 | // $a2buf = ' | <a href="'.$next_alink.'" class="nextlink" rel="next">'.$next_date.'</a>'; |
352 | 360 | // } else { |
@@ -371,7 +379,7 @@ class NP_ItemNaviEX extends NucleusPlugin | ||
371 | 379 | |
372 | 380 | // Print mainNavi |
373 | 381 | unset($naviUnit[$endKey][1]); |
374 | - $naviVar = array_map(array(&$this, "createNaviLink"), $naviUnit); | |
382 | + $naviVar = array_map(array(&$this, 'createNaviLink'), $naviUnit); | |
375 | 383 | echo '<span class="breadcrumbslist">', @join(' > ', $naviVar); |
376 | 384 | |
377 | 385 | //add Taginfo ===================================== |
@@ -404,31 +412,29 @@ class NP_ItemNaviEX extends NucleusPlugin | ||
404 | 412 | } |
405 | 413 | |
406 | 414 | echo '</span>'; |
407 | -/* | |
408 | -*/ | |
415 | + | |
409 | 416 | } |
410 | 417 | |
411 | 418 | function getParenta($subcat_id, $blogid=0) |
412 | 419 | { |
413 | 420 | $subcat_id = intval($subcat_id); |
414 | - $blogid = intval($blogid) | |
421 | + $blogid = intval($blogid); | |
415 | 422 | $r = array(); |
416 | 423 | $que = 'SELECT scatid, parentid, sname, catid FROM %s WHERE scatid = %d'; |
417 | - $res = sql_query(sprintf($que, sql_table('plug_multiple_categories_subcat'), $subcat_id)) | |
418 | -// $res = sql_query("select scatid, parentid, sname, catid from ".sql_table('plug_multiple_categories_sub')." where scatid = '$subcat_id'"); | |
424 | + $res = sql_query(sprintf($que, sql_table('plug_multiple_categories_subcat'), $subcat_id)); | |
419 | 425 | list ($sid, $parent, $sname, $cat_id) = mysql_fetch_row($res); |
420 | 426 | if (intval($parent) != 0) { |
421 | 427 | $this->r[] = $this->getParenta(intval($parent), $blogid); |
422 | 428 | $this->linkparams[subcatid] = $sid; |
423 | 429 | $r = array( |
424 | - 0 => htmlspecialchars($sname), | |
430 | + 0 => $sname, | |
425 | 431 | 1 => createBlogidLink($blogid, $this->linkparams), |
426 | 432 | 2 => createArchiveListLink($blogid, $this->linkparams) |
427 | 433 | ); |
428 | 434 | }else{ |
429 | 435 | $this->linkparams[subcatid] = $sid; |
430 | 436 | $r = array( |
431 | - 0 => htmlspecialchars($sname), | |
437 | + 0 => $sname, | |
432 | 438 | 1 => createBlogidLink($blogid, $this->linkparams), |
433 | 439 | 2 => createArchiveListLink($blogid, $this->linkparams) |
434 | 440 | ); |
@@ -436,27 +442,25 @@ class NP_ItemNaviEX extends NucleusPlugin | ||
436 | 442 | return $r; |
437 | 443 | } |
438 | 444 | |
439 | - function getParent($subcat_id) | |
445 | +/* function getParent($subcat_id) | |
440 | 446 | { |
441 | 447 | $subcat_id = intval($subcat_id); |
442 | 448 | $que = 'SELECT scatid, parentid, sname FROM %s WHERE scatid = %d'; |
443 | - $res = sql_query(sprintf($que, sql_table('plug_multiple_categories_subcat'), $subcat_id)) | |
444 | -// $res = sql_query("select scatid, parentid, sname from ".sql_table('plug_multiple_categories_sub')." where scatid = '$subcat_id'"); | |
449 | + $res = sql_query(sprintf($que, sql_table('plug_multiple_categories_subcat'), $subcat_id)); | |
445 | 450 | list ($sid, $parent, $sname) = mysql_fetch_row($res); |
446 | 451 | if (intval($parent) != 0) { |
447 | 452 | $r = $this->getParent(intval($parent)) . " -> <a href=$subcat_id>$sname</a>"; |
448 | - } | |
449 | - else { $r = "<a href=$subcat_id>" . htmlspecialchars($sname) . "</a>"; } | |
453 | + } else { | |
454 | + $r = "<a href=$subcat_id>" . htmlspecialchars($sname) . "</a>"; | |
455 | + } | |
450 | 456 | return $r; |
451 | - } | |
452 | - | |
457 | + }*/ | |
453 | 458 | |
454 | 459 | function getChildren($subcat_id) |
455 | 460 | { |
456 | 461 | $subcat_id = intval($subcat_id); |
457 | 462 | $que = 'SELECT scatid, parentid, sname FROM %s WHERE scatid = %d'; |
458 | - $res = sql_query(sprintf($que, sql_table('plug_multiple_categories_subcat'), $subcat_id)) | |
459 | -// $res = sql_query("select scatid, parentid, sname from ".sql_table('plug_multiple_categories_sub')." where parentid = '$subcat_id'"); | |
463 | + $res = sql_query(sprintf($que, sql_table('plug_multiple_categories_subcat'), $subcat_id)); | |
460 | 464 | while ($so = mysql_fetch_object($res)) { |
461 | 465 | $r .= $this->getChildren($so->scatid) . '/' . intval($so->scatid); |
462 | 466 | } |