1 | <?php |
---|
2 | # -- BEGIN LICENSE BLOCK ---------------------------------- |
---|
3 | # |
---|
4 | # This file is part of agora, a plugin for Dotclear 2. |
---|
5 | # |
---|
6 | # Copyright (c) 2009-2010 Osku ,Tomtom and contributors |
---|
7 | # |
---|
8 | # Licensed under the GPL version 2.0 license. |
---|
9 | # A copy of this license is available in LICENSE file or at |
---|
10 | # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
---|
11 | # |
---|
12 | # -- END LICENSE BLOCK ------------------------------------ |
---|
13 | |
---|
14 | class agoraTemplate |
---|
15 | { |
---|
16 | public static function agoraAnnounce($attr) |
---|
17 | { |
---|
18 | return '<?php echo $core->blog->settings->agora_announce; ?>'; |
---|
19 | } |
---|
20 | |
---|
21 | public static function agoraURL($attr) |
---|
22 | { |
---|
23 | global $core, $_ctx; |
---|
24 | |
---|
25 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
26 | return '<?php echo '.sprintf($f,'$core->blog->url.$core->url->getBase("agora")').'; ?>'; |
---|
27 | } |
---|
28 | |
---|
29 | public static function registerURL($attr) |
---|
30 | { |
---|
31 | global $core, $_ctx; |
---|
32 | |
---|
33 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
34 | return '<?php echo '.sprintf($f,'$core->blog->url.$core->url->getBase("register")').'; ?>'; |
---|
35 | } |
---|
36 | |
---|
37 | public static function loginURL($attr) |
---|
38 | { |
---|
39 | global $core, $_ctx; |
---|
40 | |
---|
41 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
42 | return '<?php echo '.sprintf($f,'$core->blog->url.$core->url->getBase("login")').'; ?>'; |
---|
43 | } |
---|
44 | |
---|
45 | public static function profileURL($attr) |
---|
46 | { |
---|
47 | global $core, $_ctx; |
---|
48 | |
---|
49 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
50 | return '<?php echo '.sprintf($f,'$core->blog->url.$core->url->getBase("profile")').'; ?>'; |
---|
51 | } |
---|
52 | |
---|
53 | public static function logoutURL($attr) |
---|
54 | { |
---|
55 | global $core, $_ctx; |
---|
56 | |
---|
57 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
58 | return '<?php echo '.sprintf($f,'$core->blog->url.$core->url->getBase("logout")').'; ?>'; |
---|
59 | } |
---|
60 | |
---|
61 | public static function AgoraFeedURL($attr) |
---|
62 | { |
---|
63 | $type = !empty($attr['type']) ? $attr['type'] : 'atom'; |
---|
64 | |
---|
65 | if (!preg_match('#^(rss2|atom)$#',$type)) { |
---|
66 | $type = 'atom'; |
---|
67 | } |
---|
68 | |
---|
69 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
70 | return '<?php echo '.sprintf($f,'$core->blog->url.$core->url->getBase("agora_feed")."/'.$type.'"').'; ?>'; |
---|
71 | } |
---|
72 | |
---|
73 | |
---|
74 | public static function IfRegisterPreview($attr,$content) |
---|
75 | { |
---|
76 | global $_ctx; |
---|
77 | |
---|
78 | return |
---|
79 | '<?php if ($_ctx->agora_register !== null && $_ctx->agora_register["preview"]) : ?>'. |
---|
80 | $content. |
---|
81 | '<?php endif; ?>'; |
---|
82 | } |
---|
83 | |
---|
84 | public static function RegisterPreviewLogin($attr) |
---|
85 | { |
---|
86 | global $_ctx; |
---|
87 | |
---|
88 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
89 | return '<?php echo '.sprintf($f,'$_ctx->agora_register["login"]').'; ?>'; |
---|
90 | } |
---|
91 | |
---|
92 | public static function RegisterPreviewEmail($attr) |
---|
93 | { |
---|
94 | global $_ctx; |
---|
95 | |
---|
96 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
97 | return '<?php echo '.sprintf($f,'$_ctx->agora_register["email"]').'; ?>'; |
---|
98 | } |
---|
99 | |
---|
100 | public static function placeURL($attr) |
---|
101 | { |
---|
102 | global $core, $_ctx; |
---|
103 | |
---|
104 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
105 | return '<?php echo '.sprintf($f,'$core->blog->url.$core->url->getBase("place")."/".$_ctx->categories->cat_url').'; ?>'; |
---|
106 | } |
---|
107 | |
---|
108 | public static function placeFeedURL($attr) |
---|
109 | { |
---|
110 | $type = !empty($attr['type']) ? $attr['type'] : 'atom'; |
---|
111 | |
---|
112 | if (!preg_match('#^(rss2|atom)$#',$type)) { |
---|
113 | $type = 'atom'; |
---|
114 | } |
---|
115 | |
---|
116 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
117 | return '<?php echo '.sprintf($f,'$core->blog->url.$core->url->getBase("agora_feed")."/place/".'. |
---|
118 | '$_ctx->categories->cat_url."/'.$type.'"').'; ?>'; |
---|
119 | } |
---|
120 | |
---|
121 | public static function authForm($attr,$content) |
---|
122 | { |
---|
123 | global $core; |
---|
124 | |
---|
125 | return |
---|
126 | '<?php if ($core->auth->userID() != false && isset($_SESSION[\'sess_user_id\'])) : ?>'. |
---|
127 | $content. |
---|
128 | '<?php endif; ?>'; |
---|
129 | } |
---|
130 | |
---|
131 | public static function notauthForm($attr,$content) |
---|
132 | { |
---|
133 | global $core; |
---|
134 | |
---|
135 | return |
---|
136 | '<?php if ($core->auth->userID() == false) : ?>'. |
---|
137 | $content. |
---|
138 | '<?php endif; ?>'; |
---|
139 | } |
---|
140 | |
---|
141 | public static function placeNewThreadLink($attr) |
---|
142 | { |
---|
143 | global $core, $_ctx; |
---|
144 | |
---|
145 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
146 | |
---|
147 | return |
---|
148 | '<?php if ($_ctx->categories->isEmpty()) {'. |
---|
149 | ' echo '.sprintf($f,'$core->blog->url.$core->url->getBase("newthread")').';'. |
---|
150 | '} else {'. |
---|
151 | ' echo '.sprintf($f,'$core->blog->url.$core->url->getBase("newthread")."/".$_ctx->categories->cat_url').';'. |
---|
152 | '} ?>'; |
---|
153 | } |
---|
154 | |
---|
155 | public static function placeThreadsNumber($attr) |
---|
156 | { |
---|
157 | global $core, $_ctx; |
---|
158 | |
---|
159 | $none = __('no thread'); |
---|
160 | $one = __('one thread'); |
---|
161 | $more = __('%d threads'); |
---|
162 | |
---|
163 | if (isset($attr['none'])) { |
---|
164 | $none = addslashes($attr['none']); |
---|
165 | } |
---|
166 | if (isset($attr['one'])) { |
---|
167 | $one = addslashes($attr['one']); |
---|
168 | } |
---|
169 | if (isset($attr['more'])) { |
---|
170 | $more = addslashes($attr['more']); |
---|
171 | } |
---|
172 | if (!empty($attr['full'])) { |
---|
173 | $operation = '$_ctx->categories->nb_total'; |
---|
174 | } else { |
---|
175 | $operation = '$_ctx->categories->nb_post'; |
---|
176 | } |
---|
177 | |
---|
178 | return |
---|
179 | "<?php if (".$operation." == 0) {\n". |
---|
180 | " printf('".$none."',".$operation.");\n". |
---|
181 | "} elseif (".$operation." == 1) {\n". |
---|
182 | " printf('".$one."',".$operation.");\n". |
---|
183 | "} else {\n". |
---|
184 | " printf('".$more."',".$operation.");\n". |
---|
185 | "} ?>"; |
---|
186 | } |
---|
187 | |
---|
188 | public static function placeAnswersNumber($attr) |
---|
189 | { |
---|
190 | global $core, $_ctx; |
---|
191 | |
---|
192 | $none = __('no answer'); |
---|
193 | $one = __('one answer'); |
---|
194 | $more = __('%d answers'); |
---|
195 | |
---|
196 | if (isset($attr['none'])) { |
---|
197 | $none = addslashes($attr['none']); |
---|
198 | } |
---|
199 | if (isset($attr['one'])) { |
---|
200 | $one = addslashes($attr['one']); |
---|
201 | } |
---|
202 | if (isset($attr['more'])) { |
---|
203 | $more = addslashes($attr['more']); |
---|
204 | } |
---|
205 | |
---|
206 | if (!empty($attr['full'])) { |
---|
207 | $operation = '$_ctx->categories->nb_total2'; |
---|
208 | } else { |
---|
209 | $operation = '$_ctx->categories->nb_answer'; |
---|
210 | } |
---|
211 | |
---|
212 | return |
---|
213 | "<?php if (".$operation." == 0) {\n". |
---|
214 | " printf('".$none."',".$operation.");\n". |
---|
215 | "} elseif (".$operation." == 1) {\n". |
---|
216 | " printf('".$one."',".$operation.");\n". |
---|
217 | "} else {\n". |
---|
218 | " printf('".$more."',".$operation.");\n". |
---|
219 | "} ?>"; |
---|
220 | } |
---|
221 | |
---|
222 | public static function PublicUserID($attr) |
---|
223 | { |
---|
224 | global $core, $_ctx; |
---|
225 | |
---|
226 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
227 | return '<?php echo '.sprintf($f,'$core->auth->userID()').'; ?>'; |
---|
228 | } |
---|
229 | |
---|
230 | public static function PublicUserDisplayName($attr) |
---|
231 | { |
---|
232 | global $core, $_ctx; |
---|
233 | |
---|
234 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
235 | return '<?php echo '.sprintf($f,'$core->auth->getInfo(\'user_displayname\')').'; ?>'; |
---|
236 | } |
---|
237 | |
---|
238 | public static function IfThreadPreview($attr,$content) |
---|
239 | { |
---|
240 | global $_ctx; |
---|
241 | |
---|
242 | return |
---|
243 | '<?php if ($_ctx->thread_preview !== null && $_ctx->thread_preview["preview"]) : ?>'. |
---|
244 | $content. |
---|
245 | '<?php endif; ?>'; |
---|
246 | } |
---|
247 | |
---|
248 | public static function ThreadPreviewTitle($attr) |
---|
249 | { |
---|
250 | global $_ctx; |
---|
251 | |
---|
252 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
253 | return '<?php echo '.sprintf($f,'$_ctx->thread_preview["title"]').'; ?>'; |
---|
254 | } |
---|
255 | |
---|
256 | |
---|
257 | public static function ThreadPreviewContent($attr) |
---|
258 | { |
---|
259 | global $_ctx; |
---|
260 | |
---|
261 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
262 | |
---|
263 | if (!empty($attr['raw'])) { |
---|
264 | $co = '$_ctx->thread_preview["rawcontent"]'; |
---|
265 | } else { |
---|
266 | $co = '$_ctx->thread_preview["content"]'; |
---|
267 | } |
---|
268 | |
---|
269 | return '<?php echo '.sprintf($f,$co).'; ?>'; |
---|
270 | } |
---|
271 | |
---|
272 | public static function IfAnswerPreview($attr,$content) |
---|
273 | { |
---|
274 | global $_ctx; |
---|
275 | |
---|
276 | return |
---|
277 | '<?php if ($_ctx->message_preview !== null && $_ctx->message_preview["preview"]) : ?>'. |
---|
278 | $content. |
---|
279 | '<?php endif; ?>'; |
---|
280 | } |
---|
281 | |
---|
282 | public static function AnswerPreviewContent($attr) |
---|
283 | { |
---|
284 | global $_ctx; |
---|
285 | |
---|
286 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
287 | |
---|
288 | if (!empty($attr['raw'])) { |
---|
289 | $co = '$_ctx->message_preview["rawcontent"]'; |
---|
290 | } else { |
---|
291 | $co = '$_ctx->message_preview["content"]'; |
---|
292 | } |
---|
293 | |
---|
294 | return '<?php echo '.sprintf($f,$co).'; ?>'; |
---|
295 | } |
---|
296 | |
---|
297 | public static function ThreadProfileUserID($attr) |
---|
298 | { |
---|
299 | global $core, $_ctx; |
---|
300 | |
---|
301 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
302 | return '<?php echo '.sprintf($f,'$core->blog->url.$core->url->getBase("profile")."/".$_ctx->posts->user_id').'; ?>'; |
---|
303 | } |
---|
304 | |
---|
305 | public static function ThreadURL($attr) |
---|
306 | { |
---|
307 | global $core, $_ctx; |
---|
308 | |
---|
309 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
310 | return '<?php echo '.sprintf($f,'$core->blog->url.$core->url->getBase("thread")."/".$_ctx->posts->post_url').'; ?>'; |
---|
311 | } |
---|
312 | |
---|
313 | public static function ThreadCategoryURL($attr) |
---|
314 | { |
---|
315 | global $core, $_ctx; |
---|
316 | |
---|
317 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
318 | return '<?php echo '.sprintf($f,'$core->blog->url.$core->url->getBase("place")."/".$_ctx->posts->cat_url').'; ?>'; |
---|
319 | } |
---|
320 | |
---|
321 | public static function MessageThreadURL($attr) |
---|
322 | { |
---|
323 | global $core, $_ctx; |
---|
324 | |
---|
325 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
326 | return '<?php echo '.sprintf($f,'$_ctx->messages->getThreadURL()').'; ?>'; |
---|
327 | } |
---|
328 | |
---|
329 | public static function EntryIfClosed($attr) |
---|
330 | { |
---|
331 | global $core, $_ctx; |
---|
332 | |
---|
333 | $ret = isset($attr['return']) ? $attr['return'] : 'closed'; |
---|
334 | $ret = html::escapeHTML($ret); |
---|
335 | |
---|
336 | return |
---|
337 | '<?php if (!$_ctx->posts->post_open_comment) { '. |
---|
338 | "echo '".addslashes($ret)."'; } ?>"; |
---|
339 | } |
---|
340 | |
---|
341 | public static function EntryMessageCount($attr) |
---|
342 | { |
---|
343 | global $core, $_ctx; |
---|
344 | |
---|
345 | $none = 'no message'; |
---|
346 | $one = 'one message'; |
---|
347 | $more = '%d messages'; |
---|
348 | |
---|
349 | if (isset($attr['none'])) { |
---|
350 | $none = addslashes($attr['none']); |
---|
351 | } |
---|
352 | if (isset($attr['one'])) { |
---|
353 | $one = addslashes($attr['one']); |
---|
354 | } |
---|
355 | if (isset($attr['more'])) { |
---|
356 | $more = addslashes($attr['more']); |
---|
357 | } |
---|
358 | |
---|
359 | if (empty($attr['count_all'])) { |
---|
360 | $operation = '$_ctx->posts->nb_comment'; |
---|
361 | } else { |
---|
362 | $operation = '($_ctx->posts->nb_comment + $_ctx->posts->nb_trackback)'; |
---|
363 | } |
---|
364 | |
---|
365 | return |
---|
366 | "<?php if (".$operation." == 0) {\n". |
---|
367 | " printf(__('".$none."'),".$operation.");\n". |
---|
368 | "} elseif (".$operation." == 1) {\n". |
---|
369 | " printf(__('".$one."'),".$operation.");\n". |
---|
370 | "} else {\n". |
---|
371 | " printf(__('".$more."'),".$operation.");\n". |
---|
372 | "} ?>"; |
---|
373 | } |
---|
374 | |
---|
375 | public static function PaginationPlus($attr,$content) |
---|
376 | { |
---|
377 | global $core, $_ctx; |
---|
378 | |
---|
379 | $p = "<?php\n"; |
---|
380 | $p .= '$params = $_ctx->post_params;'."\n"; |
---|
381 | $p .= '$_ctx->pagination = $_ctx->agora->getPostsPlus($params,true); unset($params);'."\n"; |
---|
382 | $p .= "?>\n"; |
---|
383 | |
---|
384 | if (isset($attr['no_context'])) { |
---|
385 | return $p.$content; |
---|
386 | } |
---|
387 | |
---|
388 | return |
---|
389 | $p. |
---|
390 | '<?php if ($_ctx->pagination->f(0) > $_ctx->posts->count()) : ?>'. |
---|
391 | $content. |
---|
392 | '<?php endif; ?>'; |
---|
393 | } |
---|
394 | |
---|
395 | public static function IfEditPreview($attr,$content) |
---|
396 | { |
---|
397 | global $_ctx; |
---|
398 | |
---|
399 | return |
---|
400 | '<?php if ($_ctx->thread_preview !== null && $_ctx->thread_preview["preview"]) : ?>'. |
---|
401 | $content. |
---|
402 | '<?php endif; ?>'; |
---|
403 | } |
---|
404 | |
---|
405 | public static function IfIsThread($attr,$content) |
---|
406 | { |
---|
407 | global $_ctx; |
---|
408 | |
---|
409 | return |
---|
410 | '<?php if ($_ctx->message_preview !== null && $_ctx->thread_preview["isThread"]) : ?>'. |
---|
411 | $content. |
---|
412 | '<?php endif; ?>'; |
---|
413 | } |
---|
414 | |
---|
415 | public static function PostEditTitle($attr) |
---|
416 | { |
---|
417 | global $_ctx; |
---|
418 | |
---|
419 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
420 | //$f = $attr; |
---|
421 | |
---|
422 | $res = "<?php\n"; |
---|
423 | $res .= '$v = isset($_POST["ed_title"]) ? $_POST["ed_title"] : $_ctx->posts->post_title; '."\n"; |
---|
424 | $res .= 'echo '.sprintf($f,'$v').';'."\n"; |
---|
425 | $res .= "?>"; |
---|
426 | |
---|
427 | return $res; |
---|
428 | } |
---|
429 | |
---|
430 | public static function PostEditContent($attr) |
---|
431 | { |
---|
432 | global $_ctx; |
---|
433 | |
---|
434 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
435 | |
---|
436 | if (!empty($attr['raw'])) { |
---|
437 | $res = "<?php\n"; |
---|
438 | $res .= '$v = isset($_POST["ed_content"]) ? $_POST["ed_content"] : $_ctx->thread_preview["rawcontent"]; '."\n"; |
---|
439 | $res .= 'echo '.sprintf($f,'$v').';'."\n"; |
---|
440 | $res .= "?>"; |
---|
441 | } else { |
---|
442 | $res = "<?php\n"; |
---|
443 | $res .= '$v = $_ctx->thread_preview["content"]; '."\n"; |
---|
444 | $res .= 'echo '.sprintf($f,'$v').';'."\n"; |
---|
445 | $res .= "?>"; |
---|
446 | } |
---|
447 | |
---|
448 | return $res; |
---|
449 | } |
---|
450 | |
---|
451 | public static function ModerationDeleteThread($attr) |
---|
452 | { |
---|
453 | global $core, $_ctx; |
---|
454 | |
---|
455 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
456 | |
---|
457 | return '<?php echo '.sprintf($f,'$core->blog->url.$core->url->getBase("removethread")."/".$_ctx->posts->post_id').'; ?>'; |
---|
458 | } |
---|
459 | |
---|
460 | public static function ModerationEditThread($attr) |
---|
461 | { |
---|
462 | global $core, $_ctx; |
---|
463 | |
---|
464 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
465 | |
---|
466 | return '<?php echo '.sprintf($f,'$core->blog->url.$core->url->getBase("editthread")."/".$_ctx->posts->post_id').'; ?>'; |
---|
467 | } |
---|
468 | |
---|
469 | public static function ModerationDeleteMessage($attr) |
---|
470 | { |
---|
471 | global $core, $_ctx; |
---|
472 | |
---|
473 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
474 | |
---|
475 | return '<?php echo '.sprintf($f,'$core->blog->url.$core->url->getBase("removemessage")."/".$_ctx->messages->message_id').'; ?>'; |
---|
476 | } |
---|
477 | |
---|
478 | public static function ModerationEditMessage($attr) |
---|
479 | { |
---|
480 | global $core, $_ctx; |
---|
481 | |
---|
482 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
483 | |
---|
484 | return '<?php echo '.sprintf($f,'$core->blog->url.$core->url->getBase("editmessage")."/".$_ctx->messages->message_id').'; ?>'; |
---|
485 | } |
---|
486 | |
---|
487 | public static function ModerationPin($attr) |
---|
488 | { |
---|
489 | global $core, $_ctx; |
---|
490 | |
---|
491 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
492 | |
---|
493 | $res = "<?php\n"; |
---|
494 | $res .= '$li = strpos($core->blog->url,\'?\') !== false ? \'&\' : \'?\'; '."\n"; |
---|
495 | $res .= '$li = $li."action=pin" ; '."\n"; |
---|
496 | $res .= 'echo '.sprintf($f,'$li').';'."\n"; |
---|
497 | $res .= "?>"; |
---|
498 | |
---|
499 | return $res; |
---|
500 | } |
---|
501 | |
---|
502 | public static function ModerationUnpin($attr) |
---|
503 | { |
---|
504 | global $core, $_ctx; |
---|
505 | |
---|
506 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
507 | |
---|
508 | $res = "<?php\n"; |
---|
509 | $res .= '$li = strpos($core->blog->url,\'?\') !== false ? \'&\' : \'?\'; '."\n"; |
---|
510 | $res .= '$li = $li."action=unpin" ; '."\n"; |
---|
511 | $res .= 'echo '.sprintf($f,'$li').';'."\n"; |
---|
512 | $res .= "?>"; |
---|
513 | |
---|
514 | return $res; |
---|
515 | } |
---|
516 | |
---|
517 | public static function ModerationClose($attr) |
---|
518 | { |
---|
519 | global $core, $_ctx; |
---|
520 | |
---|
521 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
522 | |
---|
523 | $res = "<?php\n"; |
---|
524 | $res .= '$li = strpos($core->blog->url,\'?\') !== false ? \'&\' : \'?\'; '."\n"; |
---|
525 | $res .= '$li = $li."action=close" ; '."\n"; |
---|
526 | $res .= 'echo '.sprintf($f,'$li').';'."\n"; |
---|
527 | $res .= "?>"; |
---|
528 | |
---|
529 | return $res; |
---|
530 | } |
---|
531 | |
---|
532 | public static function ModerationOpen($attr) |
---|
533 | { |
---|
534 | global $core, $_ctx; |
---|
535 | |
---|
536 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
537 | |
---|
538 | $res = "<?php\n"; |
---|
539 | $res .= '$li = strpos($core->blog->url,\'?\') !== false ? \'&\' : \'?\'; '."\n"; |
---|
540 | $res .= '$li = $li."action=open" ; '."\n"; |
---|
541 | $res .= 'echo '.sprintf($f,'$li').';'."\n"; |
---|
542 | $res .= "?>"; |
---|
543 | |
---|
544 | return $res; |
---|
545 | } |
---|
546 | |
---|
547 | public static function AnswerOrderNumber($attr) |
---|
548 | { |
---|
549 | return '<?php echo $_ctx->posts->index()+1; ?>'; |
---|
550 | } |
---|
551 | |
---|
552 | public static function SysIfThreadUpdated($attr,$content) |
---|
553 | { |
---|
554 | return |
---|
555 | '<?php if (!empty($_GET[\'pin\'])) : ?>'. |
---|
556 | $content. |
---|
557 | '<?php endif; ?>'; |
---|
558 | } |
---|
559 | |
---|
560 | public static function EntryCreaDate($attr) |
---|
561 | { |
---|
562 | global $core; |
---|
563 | |
---|
564 | $format = (!empty($attr['format'])) ? $attr['format'] : |
---|
565 | $core->blog->settings->date_format.', '.$core->blog->settings->time_format; |
---|
566 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
567 | |
---|
568 | return('<?php echo '.'dt::dt2str(\''.$format.'\','.sprintf($f,'$_ctx->posts->post_creadt'). |
---|
569 | ',\''.$core->blog->settings->blog_timezone.'\'); ?>'); |
---|
570 | } |
---|
571 | |
---|
572 | public static function EntryUpdDate($attr) |
---|
573 | { |
---|
574 | global $core; |
---|
575 | |
---|
576 | $format = (!empty($attr['format'])) ? $attr['format'] : |
---|
577 | $core->blog->settings->date_format.', '.$core->blog->settings->time_format; |
---|
578 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
579 | |
---|
580 | return('<?php echo '.'dt::dt2str(\''.$format.'\','.sprintf($f,'$_ctx->posts->post_upddt'). |
---|
581 | ',\''.$core->blog->settings->blog_timezone.'\'); ?>'); |
---|
582 | } |
---|
583 | |
---|
584 | public static function userIsModo($attr,$content) |
---|
585 | { |
---|
586 | global $core, $_ctx; |
---|
587 | |
---|
588 | return |
---|
589 | '<?php if (($core->auth->userID() != false) && $_ctx->agora->isModerator($core->auth->userID()) === true) : ?>'. |
---|
590 | $content. |
---|
591 | '<?php endif; ?>'; |
---|
592 | } |
---|
593 | |
---|
594 | public static function ProfileUserID($attr) |
---|
595 | { |
---|
596 | global $_ctx; |
---|
597 | |
---|
598 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
599 | return '<?php echo '.sprintf($f,'$_ctx->users->user_id').'; ?>'; |
---|
600 | } |
---|
601 | |
---|
602 | public static function ProfileUserDisplayName($attr) |
---|
603 | { |
---|
604 | global $_ctx; |
---|
605 | |
---|
606 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
607 | return '<?php echo '.sprintf($f,'$_ctx->users->user_displayname').'; ?>'; |
---|
608 | } |
---|
609 | |
---|
610 | public static function ProfileUserURL($attr) |
---|
611 | { |
---|
612 | global $_ctx; |
---|
613 | |
---|
614 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
615 | return '<?php echo '.sprintf($f,'$_ctx->users->user_url').'; ?>'; |
---|
616 | } |
---|
617 | |
---|
618 | public static function ProfileUserEmail($attr) |
---|
619 | { |
---|
620 | global $_ctx; |
---|
621 | |
---|
622 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
623 | return '<?php echo '.sprintf($f,'$_ctx->users->user_email').'; ?>'; |
---|
624 | } |
---|
625 | |
---|
626 | public static function ProfileUserCreaDate($attr) |
---|
627 | { |
---|
628 | global $core, $_ctx; |
---|
629 | |
---|
630 | $format = ''; |
---|
631 | if (!empty($attr['format'])) { |
---|
632 | $format = addslashes($attr['format']); |
---|
633 | } else { |
---|
634 | $format = '%Y-%m-%d %H:%M:%S'; |
---|
635 | } |
---|
636 | |
---|
637 | //$_ctx->users->user_creadt = strtotime($_ctx->users->user_creadt); |
---|
638 | $iso8601 = !empty($attr['iso8601']); |
---|
639 | $rfc822 = !empty($attr['rfc822']); |
---|
640 | |
---|
641 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
642 | |
---|
643 | if ($rfc822) { |
---|
644 | return '<?php echo '.sprintf($f,"dt::rfc822(\$_ctx->users->user_creadt,\$core->blog->settings->blog_timezone)").'; ?>'; |
---|
645 | } elseif ($iso8601) { |
---|
646 | return '<?php echo '.sprintf($f,"dt::iso8601(\$_ctx->users->user_creadt,\$core->blog->settings->blog_timezone)").'; ?>'; |
---|
647 | } else { |
---|
648 | return '<?php echo '.sprintf($f,"dt::str('".$format."',\$_ctx->users->user_creadt)").'; ?>'; |
---|
649 | } |
---|
650 | } |
---|
651 | |
---|
652 | public static function ProfileUserUpdDate($attr) |
---|
653 | { |
---|
654 | global $core, $_ctx; |
---|
655 | |
---|
656 | $format = ''; |
---|
657 | if (!empty($attr['format'])) { |
---|
658 | $format = addslashes($attr['format']); |
---|
659 | } else { |
---|
660 | $format = '%Y-%m-%d %H:%M:%S'; |
---|
661 | } |
---|
662 | |
---|
663 | //$_ctx->users->user_upddt = strtotime($_ctx->users->user_upddt); |
---|
664 | $iso8601 = !empty($attr['iso8601']); |
---|
665 | $rfc822 = !empty($attr['rfc822']); |
---|
666 | |
---|
667 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
668 | |
---|
669 | if ($rfc822) { |
---|
670 | return '<?php echo '.sprintf($f,"dt::rfc822(\$_ctx->users->user_upddt,\$core->blog->settings->blog_timezone)").'; ?>'; |
---|
671 | } elseif ($iso8601) { |
---|
672 | return '<?php echo '.sprintf($f,"dt::iso8601(\$_ctx->users->user_upddt,\$core->blog->settings->blog_timezone)").'; ?>'; |
---|
673 | } else { |
---|
674 | return '<?php echo '.sprintf($f,"dt::str('".$format."',\$_ctx->users->user_upddt)").'; ?>'; |
---|
675 | } |
---|
676 | } |
---|
677 | |
---|
678 | public static function Messages($attr,$content) |
---|
679 | { |
---|
680 | global $core, $_ctx; |
---|
681 | |
---|
682 | $p = |
---|
683 | "if (\$_ctx->posts !== null) { ". |
---|
684 | "\$params['post_id'] = \$_ctx->posts->post_id; ". |
---|
685 | "}\n"; |
---|
686 | |
---|
687 | $lastn = 0; |
---|
688 | if (isset($attr['lastn'])) { |
---|
689 | $lastn = abs((integer) $attr['lastn'])+0; |
---|
690 | } |
---|
691 | |
---|
692 | //$p .= 'if (!isset($_page_number)) { $_page_number = 1; }'."\n"; |
---|
693 | |
---|
694 | //if ($lastn != 0) { |
---|
695 | if ($lastn > 0) { |
---|
696 | $p .= "\$params['limit'] = ".$lastn.";\n"; |
---|
697 | } else { |
---|
698 | //$p .= "\$params['limit'] = \$_ctx->nb_message_per_page;\n"; |
---|
699 | $p .= "if (\$_ctx->nb_message_per_page !== null) { \$params['limit'] = \$_ctx->nb_message_per_page; }\n"; |
---|
700 | } |
---|
701 | |
---|
702 | /*if (!isset($attr['ignore_pagination']) || $attr['ignore_pagination'] == "0") { |
---|
703 | $p .= "\$params['limit'] = array(((\$_page_number-1)*\$params['limit']),\$params['limit']);\n"; |
---|
704 | } else { |
---|
705 | $p .= "\$params['limit'] = array(0, \$params['limit']);\n"; |
---|
706 | }*/ |
---|
707 | //} |
---|
708 | |
---|
709 | if (isset($attr['author'])) { |
---|
710 | $p .= "\$params['user_id'] = '".addslashes($attr['author'])."';\n"; |
---|
711 | } |
---|
712 | |
---|
713 | if (empty($attr['no_context'])) |
---|
714 | { |
---|
715 | $p .= |
---|
716 | 'if ($_ctx->exists("users")) { '. |
---|
717 | "\$params['user_id'] = \$_ctx->users->user_id; ". |
---|
718 | "}\n"; |
---|
719 | |
---|
720 | $p .= |
---|
721 | 'if ($_ctx->exists("categories")) { '. |
---|
722 | "\$params['cat_id'] = \$_ctx->categories->cat_id; ". |
---|
723 | "}\n"; |
---|
724 | |
---|
725 | $p .= |
---|
726 | 'if ($_ctx->exists("archives")) { '. |
---|
727 | "\$params['post_year'] = \$_ctx->archives->year(); ". |
---|
728 | "\$params['post_month'] = \$_ctx->archives->month(); ". |
---|
729 | "unset(\$params['limit']); ". |
---|
730 | "}\n"; |
---|
731 | |
---|
732 | $p .= |
---|
733 | 'if ($_ctx->exists("langs")) { '. |
---|
734 | "\$params['post_lang'] = \$_ctx->langs->post_lang; ". |
---|
735 | "}\n"; |
---|
736 | |
---|
737 | $p .= |
---|
738 | 'if (isset($_search)) { '. |
---|
739 | "\$params['search'] = \$_search; ". |
---|
740 | "}\n"; |
---|
741 | } |
---|
742 | |
---|
743 | $sortby = 'message_dt'; |
---|
744 | $order = 'asc'; |
---|
745 | if (isset($attr['sortby'])) { |
---|
746 | switch ($attr['sortby']) { |
---|
747 | case 'author' : $sortby = 'user_id'; break; |
---|
748 | case 'date' : $sortby = 'message_dt'; break; |
---|
749 | case 'id' : $sortby = 'message_id'; break; |
---|
750 | case 'post_id' : $sortby = 'post_id'; break; |
---|
751 | } |
---|
752 | } |
---|
753 | if (isset($attr['order']) && preg_match('/^(desc|asc)$/i',$attr['order'])) { |
---|
754 | $order = $attr['order']; |
---|
755 | } |
---|
756 | |
---|
757 | $p .= "\$params['order'] = '".$sortby." ".$order."';\n"; |
---|
758 | |
---|
759 | if (isset($attr['no_content']) && $attr['no_content']) { |
---|
760 | $p .= "\$params['no_content'] = true;\n"; |
---|
761 | } |
---|
762 | |
---|
763 | $res = "<?php\n"; |
---|
764 | $res .= $p; |
---|
765 | $res .= '$_ctx->message_params = $params;'."\n"; |
---|
766 | $res .= '$_ctx->messages = $_ctx->agora->getMessages($params); unset($params);'."\n"; |
---|
767 | $res .= "?>\n"; |
---|
768 | |
---|
769 | $res .= |
---|
770 | '<?php while ($_ctx->messages->fetch()) : ?>'.$content.'<?php endwhile; '. |
---|
771 | '$_ctx->messages = null; $_ctx->message_params = null; ?>'; |
---|
772 | |
---|
773 | return $res; |
---|
774 | } |
---|
775 | |
---|
776 | public static function MessageIfFirst($attr) |
---|
777 | { |
---|
778 | global $core, $_ctx; |
---|
779 | |
---|
780 | $ret = isset($attr['return']) ? $attr['return'] : 'first'; |
---|
781 | $ret = html::escapeHTML($ret); |
---|
782 | |
---|
783 | return |
---|
784 | '<?php if ($_ctx->messages->index() == 0) { '. |
---|
785 | "echo '".addslashes($ret)."'; } ?>"; |
---|
786 | } |
---|
787 | |
---|
788 | public static function MessageIfOdd($attr) |
---|
789 | { |
---|
790 | global $core, $_ctx; |
---|
791 | |
---|
792 | $ret = isset($attr['return']) ? $attr['return'] : 'odd'; |
---|
793 | $ret = html::escapeHTML($ret); |
---|
794 | |
---|
795 | return |
---|
796 | '<?php if (($_ctx->messages->index()+1)%2 == 1) { '. |
---|
797 | "echo '".addslashes($ret)."'; } ?>"; |
---|
798 | } |
---|
799 | |
---|
800 | public static function MessageContent($attr) |
---|
801 | { |
---|
802 | global $core, $_ctx; |
---|
803 | |
---|
804 | $urls = '0'; |
---|
805 | if (!empty($attr['absolute_urls'])) { |
---|
806 | $urls = '1'; |
---|
807 | } |
---|
808 | |
---|
809 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
810 | |
---|
811 | return '<?php echo '.sprintf($f,'$_ctx->messages->getContent('.$urls.')').'; ?>'; |
---|
812 | } |
---|
813 | |
---|
814 | public static function MessageAuthorID($attr) |
---|
815 | { |
---|
816 | global $core, $_ctx; |
---|
817 | |
---|
818 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
819 | |
---|
820 | return '<?php echo '.sprintf($f,'$_ctx->messages->user_id').'; ?>'; |
---|
821 | } |
---|
822 | |
---|
823 | public static function MessageAuthorCommonName($attr) |
---|
824 | { |
---|
825 | global $core, $_ctx; |
---|
826 | |
---|
827 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
828 | |
---|
829 | return '<?php echo '.sprintf($f,'$_ctx->messages->getAuthorCN()').'; ?>'; |
---|
830 | } |
---|
831 | |
---|
832 | public static function MessageID($attr) |
---|
833 | { |
---|
834 | global $core, $_ctx; |
---|
835 | |
---|
836 | return '<?php echo $_ctx->messages->message_id; ?>'; |
---|
837 | } |
---|
838 | |
---|
839 | public static function MessageOrderNumber($attr) |
---|
840 | { |
---|
841 | global $core, $_ctx; |
---|
842 | |
---|
843 | return '<?php echo $_ctx->messages->index()+1; ?>'; |
---|
844 | } |
---|
845 | |
---|
846 | public static function MessagesHeader($attr,$content) |
---|
847 | { |
---|
848 | global $core, $_ctx; |
---|
849 | |
---|
850 | return |
---|
851 | "<?php if (\$_ctx->messages->isStart()) : ?>". |
---|
852 | $content. |
---|
853 | "<?php endif; ?>"; |
---|
854 | } |
---|
855 | |
---|
856 | public static function MessagesFooter($attr,$content) |
---|
857 | { |
---|
858 | global $core, $_ctx; |
---|
859 | |
---|
860 | return |
---|
861 | "<?php if (\$_ctx->messages->isEnd()) : ?>". |
---|
862 | $content. |
---|
863 | "<?php endif; ?>"; |
---|
864 | } |
---|
865 | |
---|
866 | public static function MessageDate($attr) |
---|
867 | { |
---|
868 | global $core, $_ctx; |
---|
869 | |
---|
870 | $format = ''; |
---|
871 | if (!empty($attr['format'])) { |
---|
872 | $format = addslashes($attr['format']); |
---|
873 | } |
---|
874 | |
---|
875 | $iso8601 = !empty($attr['iso8601']); |
---|
876 | $rfc822 = !empty($attr['rfc822']); |
---|
877 | |
---|
878 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
879 | |
---|
880 | if ($rfc822) { |
---|
881 | return '<?php echo '.sprintf($f,"\$_ctx->messages->getRFC822Date()").'; ?>'; |
---|
882 | } elseif ($iso8601) { |
---|
883 | return '<?php echo '.sprintf($f,"\$_ctx->messages->getISO8601Date()").'; ?>'; |
---|
884 | /*return '<?php echo "plop" ; ?>';*/ |
---|
885 | } else { |
---|
886 | return '<?php echo '.sprintf($f,"\$_ctx->messages->getDate('".$format."')").'; ?>'; |
---|
887 | } |
---|
888 | } |
---|
889 | |
---|
890 | public static function MessageTime($attr) |
---|
891 | { |
---|
892 | global $core, $_ctx; |
---|
893 | |
---|
894 | $format = ''; |
---|
895 | if (!empty($attr['format'])) { |
---|
896 | $format = addslashes($attr['format']); |
---|
897 | } |
---|
898 | |
---|
899 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
900 | |
---|
901 | return '<?php echo '.sprintf($f,"\$_ctx->messages->getTime('".$format."')").'; ?>'; |
---|
902 | } |
---|
903 | |
---|
904 | public static function IfMessagePreview($attr,$content) |
---|
905 | { |
---|
906 | global $core, $_ctx; |
---|
907 | |
---|
908 | return |
---|
909 | '<?php if ($_ctx->message_preview !== null && $_ctx->message_preview["preview"]) : ?>'. |
---|
910 | $content. |
---|
911 | '<?php endif; ?>'; |
---|
912 | } |
---|
913 | |
---|
914 | public static function MessagePreviewContent($attr) |
---|
915 | { |
---|
916 | global $core, $_ctx; |
---|
917 | |
---|
918 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
919 | |
---|
920 | if (!empty($attr['raw'])) { |
---|
921 | $co = '$_ctx->message_preview["rawcontent"]'; |
---|
922 | } else { |
---|
923 | $co = '$_ctx->message_preview["content"]'; |
---|
924 | } |
---|
925 | |
---|
926 | return '<?php echo '.sprintf($f,$co).'; ?>'; |
---|
927 | } |
---|
928 | |
---|
929 | public static function MessageEditContent($attr) |
---|
930 | { |
---|
931 | global $_ctx; |
---|
932 | |
---|
933 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
934 | |
---|
935 | if (!empty($attr['raw'])) { |
---|
936 | $res = "<?php\n"; |
---|
937 | $res .= '$v = isset($_POST["ed_content_m"]) ? $_POST["ed_content_m"] : $_ctx->message_preview["rawcontent"]; '."\n"; |
---|
938 | $res .= 'echo '.sprintf($f,'$v').';'."\n"; |
---|
939 | $res .= "?>"; |
---|
940 | } else { |
---|
941 | $res = "<?php\n"; |
---|
942 | $res .= '$v = $_ctx->message_preview["content"]; '."\n"; |
---|
943 | $res .= 'echo '.sprintf($f,'$v').';'."\n"; |
---|
944 | $res .= "?>"; |
---|
945 | } |
---|
946 | |
---|
947 | return $res; |
---|
948 | } |
---|
949 | |
---|
950 | public static function MessageProfileUserID($attr) |
---|
951 | { |
---|
952 | global $core, $_ctx; |
---|
953 | |
---|
954 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
955 | return '<?php echo '.sprintf($f,'$core->blog->url.$core->url->getBase("profile")."/".$_ctx->messages->user_id').'; ?>'; |
---|
956 | } |
---|
957 | |
---|
958 | public static function MessageEntryTitle($attr) |
---|
959 | { |
---|
960 | global $core, $_ctx; |
---|
961 | |
---|
962 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
963 | return '<?php echo '.sprintf($f,'$_ctx->messages->post_title').'; ?>'; |
---|
964 | } |
---|
965 | |
---|
966 | public static function MessageFeedID($attr) |
---|
967 | { |
---|
968 | global $core, $_ctx; |
---|
969 | |
---|
970 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
971 | return '<?php echo '.sprintf($f,'$_ctx->messages->getFeedID()').'; ?>'; |
---|
972 | } |
---|
973 | |
---|
974 | public static function agoPagination($attr,$content) |
---|
975 | { |
---|
976 | global $core, $_ctx; |
---|
977 | |
---|
978 | $p = "<?php\n"; |
---|
979 | $p .= '$params = $_ctx->message_params;'."\n"; |
---|
980 | $p .= '$_ctx->pagination = $_ctx->agora->getMessages($params,true); unset($params);'."\n"; |
---|
981 | $p .= "?>\n"; |
---|
982 | |
---|
983 | if (isset($attr['no_context'])) { |
---|
984 | return $p.$content; |
---|
985 | } |
---|
986 | |
---|
987 | return |
---|
988 | $p. |
---|
989 | '<?php if ($_ctx->pagination->f(0) > $_ctx->messages->count()) : ?>'. |
---|
990 | $content. |
---|
991 | '<?php endif; ?>'; |
---|
992 | } |
---|
993 | |
---|
994 | public static function agoPaginationURL($attr) |
---|
995 | { |
---|
996 | global $core, $_ctx; |
---|
997 | |
---|
998 | $offset = 0; |
---|
999 | if (isset($attr['offset'])) { |
---|
1000 | $offset = (integer) $attr['offset']; |
---|
1001 | } |
---|
1002 | |
---|
1003 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
1004 | |
---|
1005 | return '<?php echo '.sprintf($f,"agoraTools::PaginationURL(".$offset.")").'; ?>'; |
---|
1006 | } |
---|
1007 | |
---|
1008 | public static function agoPaginationCounter($attr) |
---|
1009 | { |
---|
1010 | global $core, $_ctx; |
---|
1011 | |
---|
1012 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
1013 | |
---|
1014 | return '<?php echo '.sprintf($f,"agoraTools::PaginationNbPages()").'; ?>'; |
---|
1015 | } |
---|
1016 | |
---|
1017 | public static function agoPaginationCurrent($attr) |
---|
1018 | { |
---|
1019 | global $core, $_ctx; |
---|
1020 | $offset = 0; |
---|
1021 | if (isset($attr['offset'])) { |
---|
1022 | $offset = (integer) $attr['offset']; |
---|
1023 | } |
---|
1024 | |
---|
1025 | $f = $GLOBALS['core']->tpl->getFilters($attr); |
---|
1026 | |
---|
1027 | return '<?php echo '.sprintf($f,"agoraTools::PaginationPosition(".$offset.")").'; ?>'; |
---|
1028 | } |
---|
1029 | |
---|
1030 | public static function agoPaginationIf($attr,$content) |
---|
1031 | { |
---|
1032 | $if = array(); |
---|
1033 | |
---|
1034 | if (isset($attr['start'])) { |
---|
1035 | $sign = (boolean) $attr['start'] ? '' : '!'; |
---|
1036 | $if[] = $sign.'agoraTools::PaginationStart()'; |
---|
1037 | } |
---|
1038 | |
---|
1039 | if (isset($attr['end'])) { |
---|
1040 | $sign = (boolean) $attr['end'] ? '' : '!'; |
---|
1041 | $if[] = $sign.'agoraTools::PaginationEnd()'; |
---|
1042 | } |
---|
1043 | |
---|
1044 | if (!empty($if)) { |
---|
1045 | return '<?php if('.implode(' && ',$if).') : ?>'.$content.'<?php endif; ?>'; |
---|
1046 | } else { |
---|
1047 | return $content; |
---|
1048 | } |
---|
1049 | } |
---|
1050 | |
---|
1051 | public static function placeID($attr) |
---|
1052 | { |
---|
1053 | global $core, $_ctx; |
---|
1054 | return '<?php echo($_ctx->categories->cat_id); ?>'; |
---|
1055 | } |
---|
1056 | |
---|
1057 | public static function placeSpacer($attr) |
---|
1058 | { |
---|
1059 | global $core, $_ctx; |
---|
1060 | $string = ' '; |
---|
1061 | |
---|
1062 | if (isset($attr['string'])) {$string = $attr['string'];} |
---|
1063 | |
---|
1064 | return('<?php echo(str_repeat(\''.$string.'\','. |
---|
1065 | '$_ctx->categories->level-1)); ?>'); |
---|
1066 | } |
---|
1067 | |
---|
1068 | public static function placeComboSelected($attr,$content) |
---|
1069 | { |
---|
1070 | global $core, $_ctx; |
---|
1071 | |
---|
1072 | return |
---|
1073 | '<?php if (($_ctx->categories->cat_id == $_ctx->thread_preview["cat"]) && ($_ctx->thread_preview["not_empty"])) : ?>'. |
---|
1074 | $content. |
---|
1075 | '<?php endif; ?>'; |
---|
1076 | |
---|
1077 | } |
---|
1078 | |
---|
1079 | public static function ThreadComboSelected($attr,$content) |
---|
1080 | { |
---|
1081 | global $core, $_ctx; |
---|
1082 | |
---|
1083 | return |
---|
1084 | '<?php if ($_ctx->categories->cat_id == $_ctx->thread_preview["cat"] ) : ?>'. |
---|
1085 | $content. |
---|
1086 | '<?php endif; ?>'; |
---|
1087 | |
---|
1088 | } |
---|
1089 | } |
---|
1090 | ?> |
---|