Nucleus CMS日本語版用プラグインのうち、日本語版開発者がサポートしているもの
Revision | a43c8ba8a995f8d9914a89ed699bc78343bba0a3 (tree) |
---|---|
Time | 2006-11-29 15:07:03 |
Author | shizuki <shizuki@1ca2...> |
Commiter | shizuki |
fix default arg
git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/plugin@506 1ca29b6e-896d-4ea0-84a5-967f57386b96
@@ -13,16 +13,17 @@ | ||
13 | 13 | * @author Original Author nakahara21 |
14 | 14 | * @copyright 2005-2006 nakahara21 |
15 | 15 | * @license http://www.gnu.org/licenses/gpl.txt GNU GENERAL PUBLIC LICENSE Version 2, June 1991 |
16 | - * @version 2.65 | |
17 | - * @link http://nakahara21.com | |
16 | + * @version 2.66 | |
17 | + * @link http://japan.nucleuscms.org/wiki/plugins:showblogs | |
18 | 18 | * |
19 | + * 2.66 default argument bug fix | |
19 | 20 | * 2.65 add AD code control |
20 | 21 | * add Category mode |
21 | 22 | * fix stickies bug |
22 | 23 | * 2.64 fix page switch URL generate |
23 | 24 | * 2.62 security fix and tag related |
24 | 25 | * 2.61 security fix |
25 | - * 2.6 security fix | |
26 | + * 2.6 security fix | |
26 | 27 | * |
27 | 28 | **************************************************************************** |
28 | 29 | * |
@@ -51,12 +52,12 @@ class NP_ShowBlogs extends NucleusPlugin | ||
51 | 52 | |
52 | 53 | function getURL() |
53 | 54 | { |
54 | - return 'http://nakahara21.com/'; | |
55 | + return 'http://japan.nucleuscms.org/wiki/plugins:showblogs'; | |
55 | 56 | } |
56 | 57 | |
57 | 58 | function getVersion() |
58 | 59 | { |
59 | - return '2.65'; | |
60 | + return '2.66'; | |
60 | 61 | } |
61 | 62 | |
62 | 63 | function getDescription() |
@@ -126,38 +127,55 @@ class NP_ShowBlogs extends NucleusPlugin | ||
126 | 127 | |
127 | 128 | function doSkinVar($skinType, |
128 | 129 | $template = 'default/index', |
129 | - $amount = 10, | |
130 | - $bmode = '', | |
131 | - $type = 1, | |
132 | - $sort = 'DESC', | |
133 | - $sticky = '', | |
130 | + $amount = 10, // amount/page | |
131 | + $bmode = '', // show or hide Blogs | |
132 | + $type = 1, // pagw switch type | |
133 | + $sort = 'DESC', // item sort mode (DESC or ASC) | |
134 | + $sticky = '', // sticky item id | |
134 | 135 | $sticktemplate = '', |
135 | - $catmode = 'all', | |
136 | - $showAdCode = 1, | |
137 | - $catStick = 0 | |
136 | + $catmode = 'all', // show or hide categories | |
137 | + $showAdCode = 1, // AdCode switch | |
138 | + $catStick = 0 // show sticky item when category selected ? | |
138 | 139 | ) |
139 | 140 | { |
140 | 141 | global $manager, $CONF, $blog, $blogid, $catid, $itemid, $archive, $subcatid; |
141 | 142 | |
142 | -//*************************************** | |
143 | -// extra setting | |
144 | -//*************************************** | |
145 | -/* blogid(blogshortname) you want to hide | |
146 | - example: | |
147 | - $hide =array(5) | |
148 | - $hide = array(3,5); | |
149 | - $hide = array('private'); | |
150 | - $hide =array('private','atloss'); | |
151 | -*/ | |
143 | + if (!$template) { | |
144 | + $template = 'default/index'; | |
145 | + } | |
146 | + | |
147 | +// initialize hide blogID | |
152 | 148 | $hide = array(); |
153 | -//show blogID | |
149 | +// initialize show blogID | |
154 | 150 | $show = array(); |
155 | 151 | // limit number of pages(months) |
156 | 152 | $pagelimit = 0; |
157 | 153 | $monthlimit = 0; |
158 | - $catformat = $this->getOption('catformat'); | |
154 | + $catformat = $this->getOption('catformat'); | |
155 | + | |
156 | + $params = func_get_args(); | |
157 | + switch ($amount) { | |
158 | + case '0': | |
159 | + $type = $amount; | |
160 | + break; | |
161 | + case 'all': | |
162 | + $bmode = $amount; | |
163 | + if (is_numeric($params[3]) ||is_float($params[3])) { | |
164 | + $type = $params[3]; | |
165 | + } | |
166 | + break; | |
167 | + } | |
159 | 168 | |
160 | -/**************************************************************************************/ | |
169 | + if (preg_match("/^(<>)?([0-9\/]+)$/", $bmode, $matches)) { | |
170 | + if ($matches[1]) { | |
171 | + $hide = explode("/", $matches[2]); | |
172 | + $show = array(); | |
173 | + } else { | |
174 | + $hide = array(); | |
175 | + $show = explode("/", $matches[2]); | |
176 | + } | |
177 | + $bmode = 'all'; | |
178 | + } | |
161 | 179 | |
162 | 180 | $type = (float) $type; |
163 | 181 | $typeExp = intval(($type - floor($type))*10); //0 or 1 or 9 |
@@ -167,26 +185,21 @@ class NP_ShowBlogs extends NucleusPlugin | ||
167 | 185 | if (!$pageamount) { |
168 | 186 | $pageamount = 10; |
169 | 187 | } |
170 | - if ($sort != 'ASC' && $sort != 'DESC') { | |
188 | + | |
189 | + if ($sort != 'ASC') { | |
190 | + $sort = 'DESC'; | |
191 | + } | |
192 | + | |
193 | +/* if ($sort != 'ASC' && $sort != 'DESC') { | |
171 | 194 | $sticktemplate = $sticky; |
172 | 195 | $sticky = $sort; |
173 | 196 | $sort = 'DESC'; |
174 | - } | |
197 | + }*/ | |
198 | + | |
175 | 199 | if (!empty($sticky) && empty($sticktemplate)) { |
176 | 200 | $sticktemplate = $template; |
177 | 201 | } |
178 | 202 | |
179 | - if (preg_match("/^(<>)?([0-9\/]+)$/", $bmode, $matches)) { | |
180 | - if ($matches[1]) { | |
181 | - $hide = explode("/", $matches[2]); | |
182 | - $show = array(); | |
183 | - } else { | |
184 | - $hide = array(); | |
185 | - $show = explode("/", $matches[2]); | |
186 | - } | |
187 | - $bmode = 'all'; | |
188 | - } | |
189 | - | |
190 | 203 | if (preg_match("/^(<>)?([0-9\/]+)$/", $catmode, $matches)) { |
191 | 204 | if ($matches[1]) { |
192 | 205 | $hideCat = explode("/", $matches[2]); |
@@ -882,4 +895,3 @@ class NP_ShowBlogs extends NucleusPlugin | ||
882 | 895 | |
883 | 896 | } |
884 | 897 | |
885 | -?> | |
\ No newline at end of file |