@@ -34,10 +34,10 @@ discard block |
||
34 | 34 | use XoopsModules\Newbb; |
35 | 35 | use XoopsModules\Xoopspoll; |
36 | 36 | |
37 | -require_once __DIR__ . '/header.php'; |
|
37 | +require_once __DIR__.'/header.php'; |
|
38 | 38 | $xoopsLogger->startTime('newBB_viewtopic'); |
39 | -require_once __DIR__ . '/include/functions.read.php'; |
|
40 | -require_once __DIR__ . '/include/functions.render.php'; |
|
39 | +require_once __DIR__.'/include/functions.read.php'; |
|
40 | +require_once __DIR__.'/include/functions.render.php'; |
|
41 | 41 | xoops_loadLanguage('user'); |
42 | 42 | |
43 | 43 | /*Build the page query*/ |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | $query_array = []; |
46 | 46 | foreach ($query_vars as $var) { |
47 | 47 | if (Request::getString($var, '', 'GET')) { |
48 | - $query_array[$var] = "{$var}=" . Request::getString($var, '', 'GET'); |
|
48 | + $query_array[$var] = "{$var}=".Request::getString($var, '', 'GET'); |
|
49 | 49 | } |
50 | 50 | } |
51 | 51 | $page_query = htmlspecialchars(implode('&', array_values($query_array)), ENT_QUOTES | ENT_HTML5); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | } |
74 | 74 | |
75 | 75 | if (!$topic_id && !$post_id) { |
76 | - $redirect = empty($forum_id) ? XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/index.php' : XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/viewforum.php?forum={$forum_id}"; |
|
76 | + $redirect = empty($forum_id) ? XOOPS_URL . '/modules/'.$xoopsModule->getVar('dirname').'/index.php' : XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/viewforum.php?forum={$forum_id}"; |
|
77 | 77 | redirect_header($redirect, 2, _MD_NEWBB_ERRORTOPIC); |
78 | 78 | } |
79 | 79 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | } |
91 | 91 | |
92 | 92 | if (!is_object($topicObject) || !$topic_id = $topicObject->getVar('topic_id')) { |
93 | - $redirect = empty($forum_id) ? XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/index.php' : XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/viewforum.php?forum={$forum_id}"; |
|
93 | + $redirect = empty($forum_id) ? XOOPS_URL . '/modules/'.$xoopsModule->getVar('dirname').'/index.php' : XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/viewforum.php?forum={$forum_id}"; |
|
94 | 94 | redirect_header($redirect, 2, _MD_NEWBB_ERRORTOPIC); |
95 | 95 | } |
96 | 96 | $forum_id = $topicObject->getVar('forum_id'); |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | |
103 | 103 | if ((!$isAdmin && $topicObject->getVar('approved') < 0) || (!$forumHandler->getPermission($forumObject)) |
104 | 104 | || (!$topicHandler->getPermission($forumObject, $topicObject->getVar('topic_status'), 'view'))) { |
105 | - redirect_header(XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewforum.php?forum=' . $forum_id, 2, _MD_NEWBB_NORIGHTTOVIEW); |
|
105 | + redirect_header(XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/viewforum.php?forum='.$forum_id, 2, _MD_NEWBB_NORIGHTTOVIEW); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | // START irmtfan - find if topic is read or unread - for all users (member and anon) |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | // hack jump to last post read if post_id is empty - is there any better way? |
129 | 129 | if (empty($post_id) && $topic_is_unread |
130 | 130 | && !empty($GLOBALS['xoopsModuleConfig']['jump_to_topic_last_post_read_enabled'])) { |
131 | - header('Location: ' . Request::getString('REQUEST_URI', '', 'SERVER') . '&post_id=' . $topic_last_post_time_or_id_read); |
|
131 | + header('Location: '.Request::getString('REQUEST_URI', '', 'SERVER').'&post_id='.$topic_last_post_time_or_id_read); |
|
132 | 132 | } |
133 | 133 | } |
134 | 134 | } |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | // irmtfan new method |
168 | 168 | if (!empty($GLOBALS['xoopsModuleConfig']['rss_enable'])) { |
169 | 169 | $xoopsTpl->assign('xoops_module_header', ' |
170 | - <link rel="alternate" type="application/rss+xml" title="' . $xoopsModule->getVar('name') . '-' . $forumObject->getVar('forum_name') . '" href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/rss.php?f=' . $forumObject->getVar('forum_id') . '" /> |
|
170 | + <link rel="alternate" type="application/rss+xml" title="' . $xoopsModule->getVar('name').'-'.$forumObject->getVar('forum_name').'" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/rss.php?f='.$forumObject->getVar('forum_id').'" /> |
|
171 | 171 | ' . @$xoopsTpl->get_template_vars('xoops_module_header')); |
172 | 172 | } |
173 | 173 | |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | |
184 | 184 | // START irmtfan improve infobox |
185 | 185 | $infobox = []; |
186 | -$infobox['show'] = (int)$GLOBALS['xoopsModuleConfig']['show_infobox']; //4.05 |
|
186 | +$infobox['show'] = (int) $GLOBALS['xoopsModuleConfig']['show_infobox']; //4.05 |
|
187 | 187 | // irmtfan removed then define after array |
188 | 188 | //$xoopsTpl->assign('infobox', $infobox); //4.05 |
189 | 189 | $iconHandler = newbbGetIconHandler(); // can be use in the follwing codes in this file |
@@ -195,11 +195,11 @@ discard block |
||
195 | 195 | 'collapse' => $iconHandler->getImageSource('more') |
196 | 196 | ]; |
197 | 197 | if (1 == $infobox['show']) { |
198 | - $infobox['style'] = 'none'; //irmtfan move semicolon |
|
198 | + $infobox['style'] = 'none'; //irmtfan move semicolon |
|
199 | 199 | $infobox['alt'] = _MD_NEWBB_SEEUSERDATA; |
200 | 200 | $infobox['src'] = 'more'; |
201 | 201 | } else { |
202 | - $infobox['style'] = 'block'; //irmtfan move semicolon |
|
202 | + $infobox['style'] = 'block'; //irmtfan move semicolon |
|
203 | 203 | $infobox['alt'] = _MD_NEWBB_HIDEUSERDATA; |
204 | 204 | $infobox['src'] = 'less'; |
205 | 205 | } |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | // END irmtfan improve infobox |
210 | 210 | |
211 | 211 | $xoopsTpl->assign([ |
212 | - 'topic_title' => '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/viewtopic.php?topic_id=' . $topic_id . '">' . $topicObject->getFullTitle() . '</a>', |
|
212 | + 'topic_title' => '<a href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/viewtopic.php?topic_id='.$topic_id.'">'.$topicObject->getFullTitle().'</a>', |
|
213 | 213 | 'forum_name' => $forumObject->getVar('forum_name'), |
214 | 214 | 'lang_nexttopic' => _MD_NEWBB_NEXTTOPIC, |
215 | 215 | 'lang_prevtopic' => _MD_NEWBB_PREVTOPIC, |
@@ -231,20 +231,20 @@ discard block |
||
231 | 231 | $t_reply = newbbDisplayImage('t_reply', _MD_NEWBB_REPLY); |
232 | 232 | // irmtfan show topic status if show reg is 0 and revise forum_post_or_register |
233 | 233 | if ($topicHandler->getPermission($forumObject, $topicObject->getVar('topic_status'), 'post')) { |
234 | - $xoopsTpl->assign('forum_post', '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/newtopic.php?forum=' . $forum_id . '"> ' . $t_new . '</a>'); |
|
234 | + $xoopsTpl->assign('forum_post', '<a href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/newtopic.php?forum='.$forum_id.'"> '.$t_new.'</a>'); |
|
235 | 235 | } else { |
236 | 236 | if ($topicObject->getVar('topic_status')) { |
237 | 237 | $xoopsTpl->assign('topic_lock', _MD_NEWBB_TOPICLOCKED); |
238 | 238 | } |
239 | 239 | if (!is_object($GLOBALS['xoopsUser']) && !empty($GLOBALS['xoopsModuleConfig']['show_reg'])) { |
240 | - $xoopsTpl->assign('forum_register', '<a href="' . XOOPS_URL . '/user.php?xoops_redirect=' . htmlspecialchars($xoopsRequestUri, ENT_QUOTES | ENT_HTML5) . '">' . _MD_NEWBB_REGTOPOST . '</a>'); |
|
240 | + $xoopsTpl->assign('forum_register', '<a href="'.XOOPS_URL.'/user.php?xoops_redirect='.htmlspecialchars($xoopsRequestUri, ENT_QUOTES | ENT_HTML5).'">'._MD_NEWBB_REGTOPOST.'</a>'); |
|
241 | 241 | } |
242 | 242 | } |
243 | 243 | // irmtfan for backward compatibility assign forum_post_or_register smarty again. |
244 | -$xoopsTpl->assign('forum_post_or_register', @$xoopsTpl->get_template_vars('forum_post') . @$xoopsTpl->get_template_vars('forum_register') . @$xoopsTpl->get_template_vars('topic_lock')); |
|
244 | +$xoopsTpl->assign('forum_post_or_register', @$xoopsTpl->get_template_vars('forum_post').@$xoopsTpl->get_template_vars('forum_register').@$xoopsTpl->get_template_vars('topic_lock')); |
|
245 | 245 | |
246 | 246 | if ($topicHandler->getPermission($forumObject, $topicObject->getVar('topic_status'), 'reply')) { |
247 | - $xoopsTpl->assign('forum_reply', '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/reply.php?topic_id=' . $topic_id . '"> ' . $t_reply . '</a>'); |
|
247 | + $xoopsTpl->assign('forum_reply', '<a href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/reply.php?topic_id='.$topic_id.'"> '.$t_reply.'</a>'); |
|
248 | 248 | } |
249 | 249 | |
250 | 250 | $poster_array = []; |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | /** @var \XoopsMemberHandler $memberHandler */ |
266 | 266 | $memberHandler = xoops_getHandler('member'); |
267 | 267 | $userid_array = array_keys($poster_array); |
268 | - $user_criteria = '(' . implode(',', $userid_array) . ')'; |
|
268 | + $user_criteria = '('.implode(',', $userid_array).')'; |
|
269 | 269 | $users = $memberHandler->getUsers(new \Criteria('uid', $user_criteria, 'IN'), true); |
270 | 270 | } else { |
271 | 271 | $users = []; |
@@ -283,10 +283,10 @@ discard block |
||
283 | 283 | |
284 | 284 | if ($GLOBALS['xoopsModuleConfig']['allow_require_reply'] && $require_reply) { |
285 | 285 | if (!empty($GLOBALS['xoopsModuleConfig']['cache_enabled'])) { |
286 | - $viewtopic_posters = newbbGetSession('t' . $topic_id, true); |
|
286 | + $viewtopic_posters = newbbGetSession('t'.$topic_id, true); |
|
287 | 287 | if (!is_array($viewtopic_posters) || 0 === count($viewtopic_posters)) { |
288 | 288 | $viewtopic_posters = $topicHandler->getAllPosters($topicObject); |
289 | - newbbSetSession('t' . $topic_id, $viewtopic_posters); |
|
289 | + newbbSetSession('t'.$topic_id, $viewtopic_posters); |
|
290 | 290 | } |
291 | 291 | } else { |
292 | 292 | $viewtopic_posters = $topicHandler->getAllPosters($topicObject); |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | 'post_date' => 0, |
303 | 303 | 'post_image' => '', |
304 | 304 | 'post_title' => '', |
305 | - 'post_text' => '<div style="text-align: center;vertical-align: middle;"><br>' . xoops_getbanner() . '</div>', |
|
305 | + 'post_text' => '<div style="text-align: center;vertical-align: middle;"><br>'.xoops_getbanner().'</div>', |
|
306 | 306 | 'post_attachment' => '', |
307 | 307 | 'post_edit' => 0, |
308 | 308 | 'post_no' => 0, |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | if ($total_posts > $GLOBALS['xoopsModuleConfig']['posts_per_page']) { |
340 | 340 | require_once $GLOBALS['xoops']->path('class/pagenav.php'); |
341 | 341 | |
342 | - $nav = new \XoopsPageNav($total_posts, $GLOBALS['xoopsModuleConfig']['posts_per_page'], $start, 'start', 'topic_id=' . $topic_id . '&order=' . $order . '&status=' . $status . '&mode=' . $mode); |
|
342 | + $nav = new \XoopsPageNav($total_posts, $GLOBALS['xoopsModuleConfig']['posts_per_page'], $start, 'start', 'topic_id='.$topic_id.'&order='.$order.'&status='.$status.'&mode='.$mode); |
|
343 | 343 | //if (isset($GLOBALS['xoopsModuleConfig']['do_rewrite']) && $GLOBALS['xoopsModuleConfig']['do_rewrite'] === 1) $nav->url = XOOPS_URL . $nav->url; |
344 | 344 | if ('select' === $GLOBALS['xoopsModuleConfig']['pagenav_display']) { |
345 | 345 | $navi = $nav->renderSelect(); |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | } |
360 | 360 | |
361 | 361 | if (!empty($postsArray[$post_id])) { |
362 | - $xoops_pagetitle = $postsArray[$post_id]->getVar('subject') . ' [' . $forumObject->getVar('forum_name') . ']'; |
|
362 | + $xoops_pagetitle = $postsArray[$post_id]->getVar('subject').' ['.$forumObject->getVar('forum_name').']'; |
|
363 | 363 | $xoopsTpl->assign('xoops_pagetitle', $xoops_pagetitle); |
364 | 364 | $xoopsOption['xoops_pagetitle'] = $xoops_pagetitle; |
365 | 365 | $kw = array_unique(explode(' ', strip_tags($postsArray[$post_id]->getVar('post_text')), 150)); |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | $z = 0; |
369 | 369 | foreach ($kw as $k) { |
370 | 370 | if ($z < 30 && strlen(trim($k)) > 5) { |
371 | - $kwort .= trim($k) . ' '; |
|
371 | + $kwort .= trim($k).' '; |
|
372 | 372 | ++$z; |
373 | 373 | } |
374 | 374 | } |
@@ -395,56 +395,56 @@ discard block |
||
395 | 395 | // START irmtfan add restore to viewtopic |
396 | 396 | // if the topic is active |
397 | 397 | if ($topicObject->getVar('approved') > 0) { |
398 | - $admin_actions['merge'] = [ |
|
399 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=merge&topic_id=' . $topic_id, |
|
398 | + $admin_actions['merge'] = [ |
|
399 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/topicmanager.php?mode=merge&topic_id='.$topic_id, |
|
400 | 400 | 'name' => _MD_NEWBB_MERGETOPIC, |
401 | 401 | 'image' => $ad_merge |
402 | 402 | ]; |
403 | - $admin_actions['move'] = [ |
|
404 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=move&topic_id=' . $topic_id, |
|
403 | + $admin_actions['move'] = [ |
|
404 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/topicmanager.php?mode=move&topic_id='.$topic_id, |
|
405 | 405 | 'name' => _MD_NEWBB_MOVETOPIC, |
406 | 406 | 'image' => $ad_move |
407 | 407 | ]; |
408 | 408 | $admin_actions['delete'] = [ |
409 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=delete&topic_id=' . $topic_id, |
|
409 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/topicmanager.php?mode=delete&topic_id='.$topic_id, |
|
410 | 410 | 'name' => _MD_NEWBB_DELETETOPIC, |
411 | 411 | 'image' => $ad_delete |
412 | 412 | ]; |
413 | 413 | if (!$topicObject->getVar('topic_status')) { |
414 | 414 | $admin_actions['lock'] = [ |
415 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=lock&topic_id=' . $topic_id, |
|
415 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/topicmanager.php?mode=lock&topic_id='.$topic_id, |
|
416 | 416 | 'image' => $ad_lock, |
417 | 417 | 'name' => _MD_NEWBB_LOCKTOPIC |
418 | 418 | ]; |
419 | 419 | } else { |
420 | 420 | $admin_actions['unlock'] = [ |
421 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=unlock&topic_id=' . $topic_id, |
|
421 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/topicmanager.php?mode=unlock&topic_id='.$topic_id, |
|
422 | 422 | 'image' => $ad_unlock, |
423 | 423 | 'name' => _MD_NEWBB_UNLOCKTOPIC |
424 | 424 | ]; |
425 | 425 | } |
426 | 426 | if (!$topicObject->getVar('topic_sticky')) { |
427 | 427 | $admin_actions['sticky'] = [ |
428 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=sticky&topic_id=' . $topic_id, |
|
428 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/topicmanager.php?mode=sticky&topic_id='.$topic_id, |
|
429 | 429 | 'image' => $ad_sticky, |
430 | 430 | 'name' => _MD_NEWBB_STICKYTOPIC |
431 | 431 | ]; |
432 | 432 | } else { |
433 | 433 | $admin_actions['unsticky'] = [ |
434 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=unsticky&topic_id=' . $topic_id, |
|
434 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/topicmanager.php?mode=unsticky&topic_id='.$topic_id, |
|
435 | 435 | 'image' => $ad_unsticky, |
436 | 436 | 'name' => _MD_NEWBB_UNSTICKYTOPIC |
437 | 437 | ]; |
438 | 438 | } |
439 | 439 | if (!$topicObject->getVar('topic_digest')) { |
440 | 440 | $admin_actions['digest'] = [ |
441 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=digest&topic_id=' . $topic_id, |
|
441 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/topicmanager.php?mode=digest&topic_id='.$topic_id, |
|
442 | 442 | 'image' => $ad_digest, |
443 | 443 | 'name' => _MD_NEWBB_DIGESTTOPIC |
444 | 444 | ]; |
445 | 445 | } else { |
446 | 446 | $admin_actions['undigest'] = [ |
447 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=undigest&topic_id=' . $topic_id, |
|
447 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/topicmanager.php?mode=undigest&topic_id='.$topic_id, |
|
448 | 448 | 'image' => $ad_undigest, |
449 | 449 | 'name' => _MD_NEWBB_UNDIGESTTOPIC |
450 | 450 | ]; |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | // if the topic is pending/deleted then restore/approve |
453 | 453 | } else { |
454 | 454 | $admin_actions['restore'] = [ |
455 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=restore&topic_id=' . $topic_id, |
|
455 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/topicmanager.php?mode=restore&topic_id='.$topic_id, |
|
456 | 456 | 'name' => _MD_NEWBB_RESTORETOPIC, |
457 | 457 | 'image' => $ad_restore |
458 | 458 | ]; |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | // END irmtfan add restore to viewtopic |
461 | 461 | |
462 | 462 | $xoopsTpl->assign_by_ref('admin_actions', $admin_actions); |
463 | -$xoopsTpl->assign('viewer_level', (int)($isAdmin ? 2 : is_object($GLOBALS['xoopsUser']))); |
|
463 | +$xoopsTpl->assign('viewer_level', (int) ($isAdmin ? 2 : is_object($GLOBALS['xoopsUser']))); |
|
464 | 464 | |
465 | 465 | if ($GLOBALS['xoopsModuleConfig']['show_permissiontable']) { |
466 | 466 | // /** var Newbb\PermissionHandler $permHandler */ |
@@ -531,11 +531,11 @@ discard block |
||
531 | 531 | 'is_visible' => $isVisible, |
532 | 532 | 'visible_message' => $visibleMsg, |
533 | 533 | 'disp_votes' => $xp_config['disp_vote_nums'], |
534 | - 'lang_vote' => constant('_MD_' . strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']) . '_VOTE'), |
|
535 | - 'lang_results' => constant('_MD_' . strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']) . '_RESULTS'), |
|
534 | + 'lang_vote' => constant('_MD_'.strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']).'_VOTE'), |
|
535 | + 'lang_results' => constant('_MD_'.strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']).'_RESULTS'), |
|
536 | 536 | 'back_link' => '' |
537 | 537 | ]); |
538 | - $classRenderer = ucfirst($GLOBALS['xoopsModuleConfig']['poll_module']) . 'Renderer'; |
|
538 | + $classRenderer = ucfirst($GLOBALS['xoopsModuleConfig']['poll_module']).'Renderer'; |
|
539 | 539 | /** @var \XoopsModules\Xoopspoll\Renderer $renderer */ |
540 | 540 | $renderer = new $classRenderer($pollObject); |
541 | 541 | // check to see if user has voted, show form if not, otherwise get results for form |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | $myTpl = new \XoopsTpl(); |
548 | 548 | $renderer->assignForm($myTpl); |
549 | 549 | $myTpl->assign('action', $GLOBALS['xoops']->url("modules/newbb/votepolls.php?topic_id={$topic_id}&poll_id={$poll_id}")); |
550 | - $topic_pollform = $myTpl->fetch($GLOBALS['xoops']->path('modules/' . $GLOBALS['xoopsModuleConfig']['poll_module'] . '/templates/' . $GLOBALS['xoopsModuleConfig']['poll_module'] . '_view.tpl')); |
|
550 | + $topic_pollform = $myTpl->fetch($GLOBALS['xoops']->path('modules/'.$GLOBALS['xoopsModuleConfig']['poll_module'].'/templates/'.$GLOBALS['xoopsModuleConfig']['poll_module'].'_view.tpl')); |
|
551 | 551 | $GLOBALS['xoopsTpl']->assign('topic_pollform', $topic_pollform); |
552 | 552 | } else { |
553 | 553 | $GLOBALS['xoopsTpl']->assign('can_vote', false); |
@@ -558,7 +558,7 @@ discard block |
||
558 | 558 | // old xoopspoll or umfrage or any clone from them |
559 | 559 | } else { |
560 | 560 | $pollObject = new $classPoll($poll_id); |
561 | - $classRenderer = $classPoll . 'Renderer'; |
|
561 | + $classRenderer = $classPoll.'Renderer'; |
|
562 | 562 | $renderer = new $classRenderer($pollObject); |
563 | 563 | $xoopsTpl->assign('lang_alreadyvoted2', _PL_ALREADYVOTED2); |
564 | 564 | $xoopsTpl->assign('has_ended', $pollObject->getVar('end_time') < time() ? 1 : 0); |
@@ -579,7 +579,7 @@ discard block |
||
579 | 579 | |
580 | 580 | } |
581 | 581 | } |
582 | - $classLog = $classPoll . 'Log'; |
|
582 | + $classLog = $classPoll.'Log'; |
|
583 | 583 | $hasvoted = 0; |
584 | 584 | if ($GLOBALS['xoopsUser']) { |
585 | 585 | if ($classLog::hasVoted($poll_id, Request::getString('REMOTE_ADDR', '', 'SERVER'), $uid)) { |
@@ -595,12 +595,12 @@ discard block |
||
595 | 595 | if ($hasvoted || $pollObject->hasExpired()) { |
596 | 596 | $renderer->assignResults($xoopsTpl); |
597 | 597 | $xoopsTpl->assign('topic_pollresult', 1); |
598 | - setcookie('newbb_polls[' . $poll_id . ']', 1); |
|
598 | + setcookie('newbb_polls['.$poll_id.']', 1); |
|
599 | 599 | } else { |
600 | 600 | $renderer->assignForm($xoopsTpl); |
601 | 601 | $xoopsTpl->assign('lang_vote', _PL_VOTE); |
602 | 602 | $xoopsTpl->assign('lang_results', _PL_RESULTS); |
603 | - setcookie('newbb_polls[' . $poll_id . ']', 1); |
|
603 | + setcookie('newbb_polls['.$poll_id.']', 1); |
|
604 | 604 | } |
605 | 605 | } |
606 | 606 | } |
@@ -611,7 +611,7 @@ discard block |
||
611 | 611 | if (is_object($GLOBALS['xoopsUser']) |
612 | 612 | && $GLOBALS['xoopsUser']->getVar('uid') == $topicObject->getVar('topic_poster')) { |
613 | 613 | $t_poll = newbbDisplayImage('t_poll', _MD_NEWBB_ADDPOLL); |
614 | - $xoopsTpl->assign('forum_addpoll', '<a href=\'' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/polls.php?op=add&topic_id=' . $topic_id . '\'>' . $t_poll . '</a>'); |
|
614 | + $xoopsTpl->assign('forum_addpoll', '<a href=\''.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/polls.php?op=add&topic_id='.$topic_id.'\'>'.$t_poll.'</a>'); |
|
615 | 615 | } |
616 | 616 | } elseif ($isAdmin |
617 | 617 | || (is_object($pollObject) && is_object($GLOBALS['xoopsUser']) |
@@ -623,22 +623,22 @@ discard block |
||
623 | 623 | |
624 | 624 | $adminpoll_actions = []; |
625 | 625 | $adminpoll_actions['editpoll'] = [ |
626 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/polls.php?op=edit&poll_id=' . $topicObject->getVar('poll_id') . '&topic_id=' . $topic_id, |
|
626 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/polls.php?op=edit&poll_id='.$topicObject->getVar('poll_id').'&topic_id='.$topic_id, |
|
627 | 627 | 'image' => $poll_edit, |
628 | 628 | 'name' => _MD_NEWBB_EDITPOLL |
629 | 629 | ]; |
630 | - $adminpoll_actions['deletepoll'] = [ |
|
631 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/polls.php?op=delete&poll_id=' . $topicObject->getVar('poll_id') . '&topic_id=' . $topic_id, |
|
630 | + $adminpoll_actions['deletepoll'] = [ |
|
631 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/polls.php?op=delete&poll_id='.$topicObject->getVar('poll_id').'&topic_id='.$topic_id, |
|
632 | 632 | 'image' => $poll_delete, |
633 | 633 | 'name' => _MD_NEWBB_DELETEPOLL |
634 | 634 | ]; |
635 | 635 | $adminpoll_actions['restartpoll'] = [ |
636 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/polls.php?op=restart&poll_id=' . $topicObject->getVar('poll_id') . '&topic_id=' . $topic_id . '&forum=' . $forum_id, |
|
636 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/polls.php?op=restart&poll_id='.$topicObject->getVar('poll_id').'&topic_id='.$topic_id.'&forum='.$forum_id, |
|
637 | 637 | 'image' => $poll_restart, |
638 | 638 | 'name' => _MD_NEWBB_RESTARTPOLL |
639 | 639 | ]; |
640 | - $adminpoll_actions['logpoll'] = [ |
|
641 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/polls.php?op=log&poll_id=' . $topicObject->getVar('poll_id') . '&topic_id=' . $topic_id . '&forum=' . $forum_id, |
|
640 | + $adminpoll_actions['logpoll'] = [ |
|
641 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/polls.php?op=log&poll_id='.$topicObject->getVar('poll_id').'&topic_id='.$topic_id.'&forum='.$forum_id, |
|
642 | 642 | 'image' => $poll_log, |
643 | 643 | 'name' => _MD_NEWBB_POLL_VIEWLOG |
644 | 644 | ]; |
@@ -670,7 +670,7 @@ discard block |
||
670 | 670 | $rating_img = newbbDisplayImage('blank'); |
671 | 671 | } else { |
672 | 672 | // irmtfan - add alt key for rating |
673 | - $rating_img = newbbDisplayImage('rate' . $rating, constant('_MD_NEWBB_RATE' . $rating)); |
|
673 | + $rating_img = newbbDisplayImage('rate'.$rating, constant('_MD_NEWBB_RATE'.$rating)); |
|
674 | 674 | } |
675 | 675 | $xoopsTpl->assign('rating_img', $rating_img); |
676 | 676 | $xoopsTpl->assign('rate1', newbbDisplayImage('rate1', _MD_NEWBB_RATE1)); |
@@ -682,7 +682,7 @@ discard block |
||
682 | 682 | |
683 | 683 | // create jump box |
684 | 684 | if (!empty($GLOBALS['xoopsModuleConfig']['show_jump'])) { |
685 | - require_once __DIR__ . '/include/functions.forum.php'; |
|
685 | + require_once __DIR__.'/include/functions.forum.php'; |
|
686 | 686 | $xoopsTpl->assign('forum_jumpbox', newbbMakeJumpbox($forum_id)); |
687 | 687 | } |
688 | 688 | |
@@ -703,25 +703,25 @@ discard block |
||
703 | 703 | $viewmode_options = []; |
704 | 704 | if ('DESC' === $order) { |
705 | 705 | $viewmode_options[] = [ |
706 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/viewtopic.php?order=ASC&status=$status&topic_id=' . $topic_id, |
|
706 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/viewtopic.php?order=ASC&status=$status&topic_id='.$topic_id, |
|
707 | 707 | 'title' => _OLDESTFIRST |
708 | 708 | ]; |
709 | 709 | } else { |
710 | 710 | $viewmode_options[] = [ |
711 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/viewtopic.php?order=DESC&status=$status&topic_id=' . $topic_id, |
|
711 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/viewtopic.php?order=DESC&status=$status&topic_id='.$topic_id, |
|
712 | 712 | 'title' => _NEWESTFIRST |
713 | 713 | ]; |
714 | 714 | } |
715 | 715 | |
716 | 716 | switch ($status) { |
717 | 717 | case 'active': |
718 | - $current_status = '[' . _MD_NEWBB_TYPE_ADMIN . ']'; |
|
718 | + $current_status = '['._MD_NEWBB_TYPE_ADMIN.']'; |
|
719 | 719 | break; |
720 | 720 | case 'pending': |
721 | - $current_status = '[' . _MD_NEWBB_TYPE_PENDING . ']'; |
|
721 | + $current_status = '['._MD_NEWBB_TYPE_PENDING.']'; |
|
722 | 722 | break; |
723 | 723 | case 'deleted': |
724 | - $current_status = '[' . _MD_NEWBB_TYPE_DELETED . ']'; |
|
724 | + $current_status = '['._MD_NEWBB_TYPE_DELETED.']'; |
|
725 | 725 | break; |
726 | 726 | default: |
727 | 727 | $current_status = ''; |
@@ -744,7 +744,7 @@ discard block |
||
744 | 744 | && $topicHandler->getPermission($forumObject, $topicObject->getVar('topic_status'), 'reply') |
745 | 745 | && $moderateHandler->verifyUser(-1, '', $forumObject->getVar('forum_id'))) { |
746 | 746 | // END irmtfan add verifyUser to quick reply |
747 | - $forum_form = new \XoopsThemeForm(_MD_NEWBB_POSTREPLY, 'quick_reply', XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/post.php', 'post', true); |
|
747 | + $forum_form = new \XoopsThemeForm(_MD_NEWBB_POSTREPLY, 'quick_reply', XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/post.php', 'post', true); |
|
748 | 748 | if (!is_object($GLOBALS['xoopsUser'])) { |
749 | 749 | //$configHandler = xoops_getHandler('config'); |
750 | 750 | $user_tray = new \XoopsFormElementTray(_MD_NEWBB_ACCOUNT); |
@@ -779,7 +779,7 @@ discard block |
||
779 | 779 | |
780 | 780 | $forum_form->addElement(new \XoopsFormHidden('isreply', 1)); |
781 | 781 | |
782 | - $forum_form->addElement(new \XoopsFormHidden('subject', _MD_NEWBB_RE . ': ' . $topicObject->getVar('topic_title', 'e'))); |
|
782 | + $forum_form->addElement(new \XoopsFormHidden('subject', _MD_NEWBB_RE.': '.$topicObject->getVar('topic_title', 'e'))); |
|
783 | 783 | $forum_form->addElement(new \XoopsFormHidden('pid', empty($post_id) ? $topicHandler->getTopPostId($topic_id) : $post_id)); |
784 | 784 | $forum_form->addElement(new \XoopsFormHidden('topic_id', $topic_id)); |
785 | 785 | $forum_form->addElement(new \XoopsFormHidden('forum', $forum_id)); |
@@ -791,7 +791,7 @@ discard block |
||
791 | 791 | $forum_form->addElement(new \XoopsFormHidden('contents_submit', 1)); |
792 | 792 | |
793 | 793 | $submit_button = new \XoopsFormButton('', 'quick_submit', _SUBMIT, 'submit'); |
794 | - $submit_button->setExtra('onclick="if (document.forms.quick_reply.message.value === \'RE\' || document.forms.quick_reply.message.value === \'\') { alert(\'' . _MD_NEWBB_QUICKREPLY_EMPTY . '\'); return false;} else { return true;}"'); |
|
794 | + $submit_button->setExtra('onclick="if (document.forms.quick_reply.message.value === \'RE\' || document.forms.quick_reply.message.value === \'\') { alert(\''._MD_NEWBB_QUICKREPLY_EMPTY.'\'); return false;} else { return true;}"'); |
|
795 | 795 | $forum_form->addElement($submit_button); |
796 | 796 | |
797 | 797 | $toggles = newbbGetCookie('G', true); |
@@ -806,13 +806,13 @@ discard block |
||
806 | 806 | $quickreply['show'] = 1; // = !empty($GLOBALS['xoopsModuleConfig']['quickreply_enabled'] |
807 | 807 | $quickreply['expand'] = (count($toggles) > 0) ? (in_array('qr', $toggles, true) ? false : true) : true; |
808 | 808 | if ($quickreply['expand']) { |
809 | - $quickreply['style'] = 'block'; //irmtfan move semicolon |
|
809 | + $quickreply['style'] = 'block'; //irmtfan move semicolon |
|
810 | 810 | $quickreply_icon_display = $qr_expand; |
811 | - $quickreply_alt = _MD_NEWBB_HIDE . ' ' . _MD_NEWBB_QUICKREPLY; |
|
811 | + $quickreply_alt = _MD_NEWBB_HIDE.' '._MD_NEWBB_QUICKREPLY; |
|
812 | 812 | } else { |
813 | - $quickreply['style'] = 'none'; //irmtfan move semicolon |
|
813 | + $quickreply['style'] = 'none'; //irmtfan move semicolon |
|
814 | 814 | $quickreply_icon_display = $qr_collapse; |
815 | - $quickreply_alt = _MD_NEWBB_SEE . ' ' . _MD_NEWBB_QUICKREPLY; |
|
815 | + $quickreply_alt = _MD_NEWBB_SEE.' '._MD_NEWBB_QUICKREPLY; |
|
816 | 816 | } |
817 | 817 | $quickreply['displayImage'] = newbbDisplayImage($quickreply_icon_display, $quickreply_alt); |
818 | 818 | $quickreply['form'] = $forum_form->render(); |
@@ -828,6 +828,6 @@ discard block |
||
828 | 828 | $xoopsTpl->assign('tagbar', tagBar($topicObject->getVar('topic_tags', 'n'))); |
829 | 829 | } |
830 | 830 | // irmtfan move to footer.php |
831 | -require_once __DIR__ . '/footer.php'; |
|
831 | +require_once __DIR__.'/footer.php'; |
|
832 | 832 | require_once $GLOBALS['xoops']->path('footer.php'); |
833 | 833 | $xoopsLogger->stopTime('newBB_viewtopic'); |