@@ -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 | |
@@ -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 | ]; |
@@ -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'); |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | use Xmf\Request; |
| 14 | 14 | |
| 15 | -require_once __DIR__ . '/admin_header.php'; |
|
| 15 | +require_once __DIR__.'/admin_header.php'; |
|
| 16 | 16 | xoops_cp_header(); |
| 17 | 17 | echo '<br>'; |
| 18 | 18 | require_once $GLOBALS['xoops']->path('class/xoopsformloader.php'); |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | } |
| 86 | 86 | } |
| 87 | 87 | if (count($type_del) > 0) { |
| 88 | - $type_list = $typeHandler->getList(new \Criteria('type_id', '(' . implode(', ', $type_del) . ')', 'IN')); |
|
| 88 | + $type_list = $typeHandler->getList(new \Criteria('type_id', '('.implode(', ', $type_del).')', 'IN')); |
|
| 89 | 89 | xoops_confirm(['op' => 'delete', 'type_del' => serialize($type_del)], xoops_getenv('PHP_SELF'), sprintf(_AM_NEWBB_TODEL_TYPE, implode(', ', array_values($type_list))), '', false); |
| 90 | 90 | } else { |
| 91 | 91 | redirect_header(xoops_getenv('PHP_SELF'), 2, _MD_NEWBB_DBUPDATED); |
@@ -115,14 +115,14 @@ discard block |
||
| 115 | 115 | $adminObject->addItemButton(_AM_NEWBB_TYPE_TEMPLATE_APPLY, 'admin_type_manager.php?op=apply', $icon = 'add'); |
| 116 | 116 | $adminObject->addItemButton(_AM_NEWBB_TYPE_FORUM, 'admin_type_manager.php?op=forum', $icon = 'add'); |
| 117 | 117 | $adminObject->displayButton('left'); |
| 118 | - echo '<legend style="font-weight: bold; color: #900;">' . _AM_NEWBB_TYPE_ORDER_DESC . '</legend>'; |
|
| 119 | - echo "<table width='100%' border='0' cellspacing='1' class='outer'>" . "<tr><td class='odd'>"; |
|
| 120 | - echo "<form name='template' method='post' action='" . xoops_getenv('PHP_SELF') . "'>"; |
|
| 118 | + echo '<legend style="font-weight: bold; color: #900;">'._AM_NEWBB_TYPE_ORDER_DESC.'</legend>'; |
|
| 119 | + echo "<table width='100%' border='0' cellspacing='1' class='outer'>"."<tr><td class='odd'>"; |
|
| 120 | + echo "<form name='template' method='post' action='".xoops_getenv('PHP_SELF')."'>"; |
|
| 121 | 121 | echo "<table border='0' cellpadding='4' cellspacing='1' width='100%' class='outer'>"; |
| 122 | 122 | echo "<tr align='center'>"; |
| 123 | - echo "<th class='bg3' width='20%'>" . _AM_NEWBB_TYPE_ORDER . '</th>'; |
|
| 124 | - echo "<th class='bg3' width='20%'>" . _AM_NEWBB_TYPE_NAME . '</th>'; |
|
| 125 | - echo "<th class='bg3'>" . _AM_NEWBB_TYPE_DESCRIPTION . '</th>'; |
|
| 123 | + echo "<th class='bg3' width='20%'>"._AM_NEWBB_TYPE_ORDER.'</th>'; |
|
| 124 | + echo "<th class='bg3' width='20%'>"._AM_NEWBB_TYPE_NAME.'</th>'; |
|
| 125 | + echo "<th class='bg3'>"._AM_NEWBB_TYPE_DESCRIPTION.'</th>'; |
|
| 126 | 126 | echo '</tr>'; |
| 127 | 127 | |
| 128 | 128 | if ($templates = $cacheHelper->read('type_template')) { |
@@ -133,9 +133,9 @@ discard block |
||
| 133 | 133 | } |
| 134 | 134 | $typeObject = $typesObject[$key]; |
| 135 | 135 | echo "<tr class='even' align='left'>"; |
| 136 | - echo "<td><input type='text' name='type_order[{$key}]' value='" . $order . "' size='10' /></td>"; |
|
| 137 | - echo "<td><em style='color:" . $typeObject->getVar('type_color') . ";'>" . $typeObject->getVar('type_name') . '</em></td>'; |
|
| 138 | - echo '<td>' . $typeObject->getVar('type_description') . '</td>'; |
|
| 136 | + echo "<td><input type='text' name='type_order[{$key}]' value='".$order."' size='10' /></td>"; |
|
| 137 | + echo "<td><em style='color:".$typeObject->getVar('type_color').";'>".$typeObject->getVar('type_name').'</em></td>'; |
|
| 138 | + echo '<td>'.$typeObject->getVar('type_description').'</td>'; |
|
| 139 | 139 | echo '</tr>'; |
| 140 | 140 | unset($typesObject[$key]); |
| 141 | 141 | } |
@@ -144,15 +144,15 @@ discard block |
||
| 144 | 144 | foreach ($typesObject as $key => $typeObject) { |
| 145 | 145 | echo "<tr class='odd' align='left'>"; |
| 146 | 146 | echo "<td><input type='text' name='type_order[{$key}]' value='0' size='10' /></td>"; |
| 147 | - echo "<td><em style='color:" . $typeObject->getVar('type_color') . ";'>" . $typeObject->getVar('type_name') . '</em></td>'; |
|
| 148 | - echo '<td>' . $typeObject->getVar('type_description') . '</td>'; |
|
| 147 | + echo "<td><em style='color:".$typeObject->getVar('type_color').";'>".$typeObject->getVar('type_name').'</em></td>'; |
|
| 148 | + echo '<td>'.$typeObject->getVar('type_description').'</td>'; |
|
| 149 | 149 | echo '</tr>'; |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | echo "<tr><td colspan='3' style='text-align:center;'>"; |
| 153 | 153 | echo "<input type='hidden' name='op' value='save_template' />"; |
| 154 | - echo "<input type='submit' name='submit' value='" . _SUBMIT . "' /> "; |
|
| 155 | - echo "<input type='reset' value='" . _CANCEL . "' />"; |
|
| 154 | + echo "<input type='submit' name='submit' value='"._SUBMIT."' /> "; |
|
| 155 | + echo "<input type='reset' value='"._CANCEL."' />"; |
|
| 156 | 156 | echo '</td></tr></table>'; |
| 157 | 157 | echo '</form>'; |
| 158 | 158 | echo '</td></tr></table>'; |
@@ -161,12 +161,12 @@ discard block |
||
| 161 | 161 | case 'save_template': |
| 162 | 162 | $templates = array_flip(array_filter(Request::getArray('type_order', [], 'POST'))); |
| 163 | 163 | $cacheHelper->write('type_template', $templates); |
| 164 | - redirect_header(xoops_getenv('PHP_SELF') . '?op=template', 2, _MD_NEWBB_DBUPDATED); |
|
| 164 | + redirect_header(xoops_getenv('PHP_SELF').'?op=template', 2, _MD_NEWBB_DBUPDATED); |
|
| 165 | 165 | break; |
| 166 | 166 | |
| 167 | 167 | case 'apply': |
| 168 | 168 | if (!$templates = $cacheHelper->read('type_template')) { |
| 169 | - redirect_header(xoops_getenv('PHP_SELF') . '?op=template', 2, _AM_NEWBB_TYPE_TEMPLATE_ERR); |
|
| 169 | + redirect_header(xoops_getenv('PHP_SELF').'?op=template', 2, _AM_NEWBB_TYPE_TEMPLATE_ERR); |
|
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | // $categoryHandler = Newbb\Helper::getInstance()->getHandler('Category'); |
@@ -176,9 +176,9 @@ discard block |
||
| 176 | 176 | // $forumHandler = Newbb\Helper::getInstance()->getHandler('Forum'); |
| 177 | 177 | $forums = $forumHandler->getTree(array_keys($categories), 0, 'all'); |
| 178 | 178 | foreach (array_keys($forums) as $c) { |
| 179 | - $fm_options[-1 * $c] = '[' . $categories[$c] . ']'; |
|
| 179 | + $fm_options[-1 * $c] = '['.$categories[$c].']'; |
|
| 180 | 180 | foreach (array_keys($forums[$c]) as $f) { |
| 181 | - $fm_options[$f] = $forums[$c][$f]['prefix'] . $forums[$c][$f]['forum_name']; |
|
| 181 | + $fm_options[$f] = $forums[$c][$f]['prefix'].$forums[$c][$f]['forum_name']; |
|
| 182 | 182 | } |
| 183 | 183 | } |
| 184 | 184 | unset($forums, $categories); |
@@ -199,15 +199,15 @@ discard block |
||
| 199 | 199 | $adminObject->addItemButton(_AM_NEWBB_TYPE_FORUM, 'admin_type_manager.php?op=forum', $icon = 'add'); |
| 200 | 200 | $adminObject->displayButton('left'); |
| 201 | 201 | |
| 202 | - echo "<table width='100%' border='0' cellspacing='1' class='outer'>" . "<tr><td class='odd'>"; |
|
| 202 | + echo "<table width='100%' border='0' cellspacing='1' class='outer'>"."<tr><td class='odd'>"; |
|
| 203 | 203 | echo "<table border='0' cellpadding='4' cellspacing='1' width='100%' class='outer'>"; |
| 204 | 204 | echo "<tr align='center'>"; |
| 205 | - echo "<th class='bg3' width='20%'>" . _AM_NEWBB_TYPE_NAME . '</th>'; |
|
| 206 | - echo "<th class='bg3' width='20%'>" . _AM_NEWBB_TYPE_ORDER . '</th>'; |
|
| 207 | - echo "<th class='bg3'>" . _AM_NEWBB_TYPE_DESCRIPTION . '</th>'; |
|
| 205 | + echo "<th class='bg3' width='20%'>"._AM_NEWBB_TYPE_NAME.'</th>'; |
|
| 206 | + echo "<th class='bg3' width='20%'>"._AM_NEWBB_TYPE_ORDER.'</th>'; |
|
| 207 | + echo "<th class='bg3'>"._AM_NEWBB_TYPE_DESCRIPTION.'</th>'; |
|
| 208 | 208 | echo '</tr>'; |
| 209 | 209 | |
| 210 | - $typesObject = $typeHandler->getAll(new \Criteria('type_id', '(' . implode(', ', array_values($templates)) . ')', 'IN')); |
|
| 210 | + $typesObject = $typeHandler->getAll(new \Criteria('type_id', '('.implode(', ', array_values($templates)).')', 'IN')); |
|
| 211 | 211 | arsort($templates); |
| 212 | 212 | foreach ($templates as $order => $key) { |
| 213 | 213 | if (!isset($typesObject[$key])) { |
@@ -215,9 +215,9 @@ discard block |
||
| 215 | 215 | } |
| 216 | 216 | $typeObject = $typesObject[$key]; |
| 217 | 217 | echo "<tr class='even' align='left'>"; |
| 218 | - echo "<td><em style='color:" . $typeObject->getVar('type_color') . ";'>" . $typeObject->getVar('type_name') . '</em></td>'; |
|
| 219 | - echo '<td>' . $order . '</td>'; |
|
| 220 | - echo '<td>' . $typeObject->getVar('type_description') . '</td>'; |
|
| 218 | + echo "<td><em style='color:".$typeObject->getVar('type_color').";'>".$typeObject->getVar('type_name').'</em></td>'; |
|
| 219 | + echo '<td>'.$order.'</td>'; |
|
| 220 | + echo '<td>'.$typeObject->getVar('type_description').'</td>'; |
|
| 221 | 221 | echo '</tr>'; |
| 222 | 222 | unset($typesObject[$key]); |
| 223 | 223 | } |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | |
| 230 | 230 | case 'save_apply': |
| 231 | 231 | if (!$templates = $cacheHelper->read('type_template')) { |
| 232 | - redirect_header(xoops_getenv('PHP_SELF') . '?op=template', 2, _AM_NEWBB_TYPE_TEMPLATE); |
|
| 232 | + redirect_header(xoops_getenv('PHP_SELF').'?op=template', 2, _AM_NEWBB_TYPE_TEMPLATE); |
|
| 233 | 233 | } |
| 234 | 234 | foreach (Request::getArray('forums', [], 'POST') as $forum) { |
| 235 | 235 | if ($forum < 1) { |
@@ -255,9 +255,9 @@ discard block |
||
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | foreach (array_keys($forums) as $c) { |
| 258 | - $fm_options[-1 * $c] = '[' . $categories[$c] . ']'; |
|
| 258 | + $fm_options[-1 * $c] = '['.$categories[$c].']'; |
|
| 259 | 259 | foreach (array_keys($forums[$c]) as $f) { |
| 260 | - $fm_options[$f] = $forums[$c][$f]['prefix'] . $forums[$c][$f]['forum_name']; |
|
| 260 | + $fm_options[$f] = $forums[$c][$f]['prefix'].$forums[$c][$f]['forum_name']; |
|
| 261 | 261 | } |
| 262 | 262 | } |
| 263 | 263 | unset($forums, $categories); |
@@ -282,12 +282,12 @@ discard block |
||
| 282 | 282 | |
| 283 | 283 | case 'edit_forum': |
| 284 | 284 | if (!Request::getInt('forum', 0, 'POST') || Request::getInt('forum', 0, 'POST') < 1) { |
| 285 | - redirect_header(xoops_getenv('PHP_SELF') . '?op=forum', 2, _AM_NEWBB_TYPE_FORUM_ERR); |
|
| 285 | + redirect_header(xoops_getenv('PHP_SELF').'?op=forum', 2, _AM_NEWBB_TYPE_FORUM_ERR); |
|
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | // $forumHandler = Newbb\Helper::getInstance()->getHandler('Forum'); |
| 289 | 289 | if (!$forumObject = $forumHandler->get(Request::getInt('forum', 0, 'POST'))) { |
| 290 | - redirect_header(xoops_getenv('PHP_SELF') . '?op=forum', 2, _AM_NEWBB_TYPE_FORUM_ERR); |
|
| 290 | + redirect_header(xoops_getenv('PHP_SELF').'?op=forum', 2, _AM_NEWBB_TYPE_FORUM_ERR); |
|
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | $typesObject = $typeHandler->getAll(); |
@@ -299,14 +299,14 @@ discard block |
||
| 299 | 299 | $adminObject->addItemButton(_AM_NEWBB_TYPE_TEMPLATE, 'admin_type_manager.php?op=template', $icon = 'add'); |
| 300 | 300 | $adminObject->addItemButton(_AM_NEWBB_TYPE_FORUM, 'admin_type_manager.php?op=forum', $icon = 'add'); |
| 301 | 301 | $adminObject->displayButton('left'); |
| 302 | - echo '<legend style="font-weight: bold; color: #900;">' . _AM_NEWBB_TYPE_ORDER_DESC . '</legend>'; |
|
| 303 | - echo "<table width='100%' border='0' cellspacing='1' class='outer'>" . "<tr><td class='odd'>"; |
|
| 304 | - echo "<form name='template' method='post' action='" . xoops_getenv('PHP_SELF') . "'>"; |
|
| 302 | + echo '<legend style="font-weight: bold; color: #900;">'._AM_NEWBB_TYPE_ORDER_DESC.'</legend>'; |
|
| 303 | + echo "<table width='100%' border='0' cellspacing='1' class='outer'>"."<tr><td class='odd'>"; |
|
| 304 | + echo "<form name='template' method='post' action='".xoops_getenv('PHP_SELF')."'>"; |
|
| 305 | 305 | echo "<table border='0' cellpadding='4' cellspacing='1' width='100%' class='outer'>"; |
| 306 | 306 | echo "<tr align='center'>"; |
| 307 | - echo "<th class='bg3' width='20%'>" . _AM_NEWBB_TYPE_ORDER . '</th>'; |
|
| 308 | - echo "<th class='bg3' width='20%'>" . _AM_NEWBB_TYPE_NAME . '</th>'; |
|
| 309 | - echo "<th class='bg3'>" . _AM_NEWBB_TYPE_DESCRIPTION . '</th>'; |
|
| 307 | + echo "<th class='bg3' width='20%'>"._AM_NEWBB_TYPE_ORDER.'</th>'; |
|
| 308 | + echo "<th class='bg3' width='20%'>"._AM_NEWBB_TYPE_NAME.'</th>'; |
|
| 309 | + echo "<th class='bg3'>"._AM_NEWBB_TYPE_DESCRIPTION.'</th>'; |
|
| 310 | 310 | echo '</tr>'; |
| 311 | 311 | |
| 312 | 312 | $types = $typeHandler->getByForum(Request::getInt('forum', 0, 'POST')); |
@@ -321,9 +321,9 @@ discard block |
||
| 321 | 321 | } |
| 322 | 322 | $typeObject = $typesObject[$type['type_id']]; |
| 323 | 323 | echo "<tr class='even' align='left'>"; |
| 324 | - echo "<td><input type='text' name='type_order[" . $type['type_id'] . "]' value='" . $type['type_order'] . "' size='10' /></td>"; |
|
| 325 | - echo "<td><em style='color:" . $typeObject->getVar('type_color') . ";'>" . $typeObject->getVar('type_name') . '</em></td>'; |
|
| 326 | - echo '<td>' . $typeObject->getVar('type_description') . '</td>'; |
|
| 324 | + echo "<td><input type='text' name='type_order[".$type['type_id']."]' value='".$type['type_order']."' size='10' /></td>"; |
|
| 325 | + echo "<td><em style='color:".$typeObject->getVar('type_color').";'>".$typeObject->getVar('type_name').'</em></td>'; |
|
| 326 | + echo '<td>'.$typeObject->getVar('type_description').'</td>'; |
|
| 327 | 327 | echo '</tr>'; |
| 328 | 328 | unset($typesObject[$type['type_id']]); |
| 329 | 329 | } |
@@ -331,17 +331,17 @@ discard block |
||
| 331 | 331 | foreach ($typesObject as $key => $typeObject) { |
| 332 | 332 | echo "<tr class='odd' align='left'>"; |
| 333 | 333 | echo "<td><input type='text' name='type_order[{$key}]' value='0' size='10' /></td>"; |
| 334 | - echo "<td><em style='color:" . $typeObject->getVar('type_color') . ";'>" . $typeObject->getVar('type_name') . '</em></td>'; |
|
| 335 | - echo '<td>' . $typeObject->getVar('type_description') . '</td>'; |
|
| 334 | + echo "<td><em style='color:".$typeObject->getVar('type_color').";'>".$typeObject->getVar('type_name').'</em></td>'; |
|
| 335 | + echo '<td>'.$typeObject->getVar('type_description').'</td>'; |
|
| 336 | 336 | echo '</tr>'; |
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | echo "<tr><td colspan='3' style='text-align:center;'>"; |
| 340 | - echo '<legend style="font-weight: bold; color: #900;">' . _AM_NEWBB_TYPE_EDITFORUM_DESC . '</legend>'; |
|
| 341 | - echo "<input type='hidden' name='forum' value='" . Request::getInt('forum', 0, 'POST') . "' />"; |
|
| 340 | + echo '<legend style="font-weight: bold; color: #900;">'._AM_NEWBB_TYPE_EDITFORUM_DESC.'</legend>'; |
|
| 341 | + echo "<input type='hidden' name='forum' value='".Request::getInt('forum', 0, 'POST')."' />"; |
|
| 342 | 342 | echo "<input type='hidden' name='op' value='save_forum' />"; |
| 343 | - echo "<input type='submit' name='submit' value='" . _SUBMIT . "' /> "; |
|
| 344 | - echo "<input type='reset' value='" . _CANCEL . "' />"; |
|
| 343 | + echo "<input type='submit' name='submit' value='"._SUBMIT."' /> "; |
|
| 344 | + echo "<input type='reset' value='"._CANCEL."' />"; |
|
| 345 | 345 | echo '</td></tr></table>'; |
| 346 | 346 | echo '</form>'; |
| 347 | 347 | echo '</td></tr></table>'; |
@@ -349,10 +349,10 @@ discard block |
||
| 349 | 349 | |
| 350 | 350 | case 'save_forum': |
| 351 | 351 | if (!Request::getInt('forum', 0, 'POST') || Request::getInt('forum', 0, 'POST') < 1) { |
| 352 | - redirect_header(xoops_getenv('PHP_SELF') . '?op=forum', 2, _AM_NEWBB_TYPE_FORUM); |
|
| 352 | + redirect_header(xoops_getenv('PHP_SELF').'?op=forum', 2, _AM_NEWBB_TYPE_FORUM); |
|
| 353 | 353 | } |
| 354 | 354 | $typeHandler->updateByForum(Request::getInt('forum', 0, 'POST'), Request::getArray('type_order', null, 'POST')); |
| 355 | - redirect_header(xoops_getenv('PHP_SELF') . '?op=forum', 2, _MD_NEWBB_DBUPDATED); |
|
| 355 | + redirect_header(xoops_getenv('PHP_SELF').'?op=forum', 2, _MD_NEWBB_DBUPDATED); |
|
| 356 | 356 | break; |
| 357 | 357 | |
| 358 | 358 | case 'add': |
@@ -372,16 +372,16 @@ discard block |
||
| 372 | 372 | $adminObject->displayButton('left'); |
| 373 | 373 | } |
| 374 | 374 | echo _AM_NEWBB_TYPE_HELP; |
| 375 | - echo "<table width='100%' border='0' cellspacing='1' class='outer'>" . "<tr><td class='odd'>"; |
|
| 376 | - echo "<form name='list' method='post' action='" . xoops_getenv('PHP_SELF') . "'>"; |
|
| 375 | + echo "<table width='100%' border='0' cellspacing='1' class='outer'>"."<tr><td class='odd'>"; |
|
| 376 | + echo "<form name='list' method='post' action='".xoops_getenv('PHP_SELF')."'>"; |
|
| 377 | 377 | echo "<table border='0' cellpadding='4' cellspacing='1' width='100%' class='outer'>"; |
| 378 | 378 | echo "<tr align='center'>"; |
| 379 | 379 | if ('add' !== $op) { |
| 380 | - echo "<th class='bg3' width='5%'>" . _DELETE . '</th>'; |
|
| 380 | + echo "<th class='bg3' width='5%'>"._DELETE.'</th>'; |
|
| 381 | 381 | } |
| 382 | - echo "<th align='left' class='bg3' width='20%'>" . _AM_NEWBB_TYPE_NAME . '</th>'; |
|
| 383 | - echo "<th class='bg3' width='15%'>" . _AM_NEWBB_TYPE_COLOR . '</th>'; |
|
| 384 | - echo "<th align='left' class='bg3'>" . _AM_NEWBB_TYPE_DESCRIPTION . '</th>'; |
|
| 382 | + echo "<th align='left' class='bg3' width='20%'>"._AM_NEWBB_TYPE_NAME.'</th>'; |
|
| 383 | + echo "<th class='bg3' width='15%'>"._AM_NEWBB_TYPE_COLOR.'</th>'; |
|
| 384 | + echo "<th align='left' class='bg3'>"._AM_NEWBB_TYPE_DESCRIPTION.'</th>'; |
|
| 385 | 385 | echo '</tr>'; |
| 386 | 386 | |
| 387 | 387 | // $isColorpicker = require_once $GLOBALS['xoops']->path('class/xoopsform/formcolorpicker.php'); |
@@ -391,14 +391,14 @@ discard block |
||
| 391 | 391 | foreach ($typesObject as $key => $typeObject) { |
| 392 | 392 | echo "<tr class='odd' align='left'>"; |
| 393 | 393 | echo "<td><input type='checkbox' name='type_del[{$key}]' /></td>"; |
| 394 | - echo "<td><input type='text' name='type_name[{$key}]' value='" . $typeObject->getVar('type_name') . "' size='10' /></td>"; |
|
| 394 | + echo "<td><input type='text' name='type_name[{$key}]' value='".$typeObject->getVar('type_name')."' size='10' /></td>"; |
|
| 395 | 395 | if ($isColorpicker) { |
| 396 | 396 | $form_colorpicker = new \XoopsFormColorPicker('', "type_color[{$key}]", $typeObject->getVar('type_color')); |
| 397 | - echo '<td>' . $form_colorpicker->render() . '</td>'; |
|
| 397 | + echo '<td>'.$form_colorpicker->render().'</td>'; |
|
| 398 | 398 | } else { |
| 399 | - echo "<td><input type='text' name='type_color[{$key}]' value='" . $typeObject->getVar('type_color') . "' size='10' /></td>"; |
|
| 399 | + echo "<td><input type='text' name='type_color[{$key}]' value='".$typeObject->getVar('type_color')."' size='10' /></td>"; |
|
| 400 | 400 | } |
| 401 | - echo "<td><input type='text' name='type_description[{$key}]' value='" . $typeObject->getVar('type_description') . "' size='30' /></td>"; |
|
| 401 | + echo "<td><input type='text' name='type_description[{$key}]' value='".$typeObject->getVar('type_description')."' size='30' /></td>"; |
|
| 402 | 402 | echo '</tr>'; |
| 403 | 403 | } |
| 404 | 404 | echo "<tr><td colspan='4' style='text-align:center;'>"; |
@@ -411,7 +411,7 @@ discard block |
||
| 411 | 411 | echo "<td><input type='text' name='type_name[{$i}]' value='' size='10' /></td>"; |
| 412 | 412 | if ($isColorpicker) { |
| 413 | 413 | $form_colorpicker = new \XoopsFormColorPicker('', "type_color[{$i}]", ''); |
| 414 | - echo '<td>' . $form_colorpicker->render() . '</td>'; |
|
| 414 | + echo '<td>'.$form_colorpicker->render().'</td>'; |
|
| 415 | 415 | } else { |
| 416 | 416 | echo "<td><input type='text' name='type_color[{$i}]' value='' size='10' /></td>"; |
| 417 | 417 | } |
@@ -422,16 +422,16 @@ discard block |
||
| 422 | 422 | echo "<input type='hidden' name='isnew' value='1' />"; |
| 423 | 423 | } |
| 424 | 424 | echo "<input type='hidden' name='op' value='save_type' />"; |
| 425 | - echo "<input type='submit' name='submit' value='" . _SUBMIT . "' /> "; |
|
| 426 | - echo "<input type='reset' value='" . _CANCEL . "' />"; |
|
| 425 | + echo "<input type='submit' name='submit' value='"._SUBMIT."' /> "; |
|
| 426 | + echo "<input type='reset' value='"._CANCEL."' />"; |
|
| 427 | 427 | echo '</td></tr></table>'; |
| 428 | 428 | echo '</form>'; |
| 429 | 429 | echo '</td></tr></table>'; |
| 430 | 430 | echo '<fieldset>'; |
| 431 | - echo '<legend> ' . _MI_NEWBB_ADMENU_TYPE . ' </legend>'; |
|
| 431 | + echo '<legend> '._MI_NEWBB_ADMENU_TYPE.' </legend>'; |
|
| 432 | 432 | echo _AM_NEWBB_HELP_TYPE_TAB; |
| 433 | 433 | echo '</fieldset>'; |
| 434 | 434 | break; |
| 435 | 435 | } |
| 436 | 436 | |
| 437 | -require_once __DIR__ . '/admin_footer.php'; |
|
| 437 | +require_once __DIR__.'/admin_footer.php'; |
|
@@ -41,82 +41,82 @@ |
||
| 41 | 41 | $adminmenu[] = [ |
| 42 | 42 | 'title' => _MI_NEWBB_ADMENU_INDEX, |
| 43 | 43 | 'link' => 'admin/index.php', |
| 44 | - 'icon' => $pathIcon32 . 'home.png' |
|
| 44 | + 'icon' => $pathIcon32.'home.png' |
|
| 45 | 45 | ]; |
| 46 | 46 | |
| 47 | 47 | $adminmenu[] = [ |
| 48 | 48 | 'title' => _MI_NEWBB_ADMENU_CATEGORY, |
| 49 | 49 | 'link' => 'admin/admin_cat_manager.php', |
| 50 | - 'icon' => $pathIcon32 . 'category.png' |
|
| 50 | + 'icon' => $pathIcon32.'category.png' |
|
| 51 | 51 | ]; |
| 52 | 52 | |
| 53 | 53 | $adminmenu[] = [ |
| 54 | 54 | 'title' => _MI_NEWBB_ADMENU_FORUM, |
| 55 | 55 | 'link' => 'admin/admin_forum_manager.php', |
| 56 | - 'icon' => $pathIcon32 . 'forums.png' |
|
| 56 | + 'icon' => $pathIcon32.'forums.png' |
|
| 57 | 57 | ]; |
| 58 | 58 | |
| 59 | 59 | $adminmenu[] = [ |
| 60 | 60 | 'title' => _MI_NEWBB_ADMENU_PERMISSION, |
| 61 | 61 | 'link' => 'admin/admin_permissions.php', |
| 62 | - 'icon' => $pathIcon32 . 'permissions.png' |
|
| 62 | + 'icon' => $pathIcon32.'permissions.png' |
|
| 63 | 63 | ]; |
| 64 | 64 | |
| 65 | 65 | $adminmenu[] = [ |
| 66 | 66 | 'title' => _MI_NEWBB_ADMENU_ORDER, |
| 67 | 67 | 'link' => 'admin/admin_forum_reorder.php', |
| 68 | - 'icon' => $pathIcon32 . 'compfile.png' |
|
| 68 | + 'icon' => $pathIcon32.'compfile.png' |
|
| 69 | 69 | ]; |
| 70 | 70 | |
| 71 | 71 | $adminmenu[] = [ |
| 72 | 72 | 'title' => _MI_NEWBB_ADMENU_PRUNE, |
| 73 | 73 | 'link' => 'admin/admin_forum_prune.php', |
| 74 | - 'icon' => $pathIcon32 . 'update.png' |
|
| 74 | + 'icon' => $pathIcon32.'update.png' |
|
| 75 | 75 | ]; |
| 76 | 76 | |
| 77 | 77 | $adminmenu[] = [ |
| 78 | 78 | 'title' => _MI_NEWBB_ADMENU_REPORT, |
| 79 | 79 | 'link' => 'admin/admin_report.php', |
| 80 | - 'icon' => $pathIcon32 . 'content.png' |
|
| 80 | + 'icon' => $pathIcon32.'content.png' |
|
| 81 | 81 | ]; |
| 82 | 82 | |
| 83 | 83 | $adminmenu[] = [ |
| 84 | 84 | 'title' => _MI_NEWBB_ADMENU_DIGEST, |
| 85 | 85 | 'link' => 'admin/admin_digest.php', |
| 86 | - 'icon' => $pathIcon32 . 'digest.png' |
|
| 86 | + 'icon' => $pathIcon32.'digest.png' |
|
| 87 | 87 | ]; |
| 88 | 88 | |
| 89 | 89 | $adminmenu[] = [ |
| 90 | 90 | 'title' => _MI_NEWBB_ADMENU_VOTE, |
| 91 | 91 | 'link' => 'admin/admin_votedata.php', |
| 92 | - 'icon' => $pathIcon32 . 'button_ok.png' |
|
| 92 | + 'icon' => $pathIcon32.'button_ok.png' |
|
| 93 | 93 | ]; |
| 94 | 94 | |
| 95 | 95 | $adminmenu[] = [ |
| 96 | 96 | 'title' => _MI_NEWBB_ADMENU_TYPE, |
| 97 | 97 | 'link' => 'admin/admin_type_manager.php', |
| 98 | - 'icon' => $pathIcon32 . 'type.png' |
|
| 98 | + 'icon' => $pathIcon32.'type.png' |
|
| 99 | 99 | ]; |
| 100 | 100 | |
| 101 | 101 | $adminmenu[] = [ |
| 102 | 102 | 'title' => _MI_NEWBB_ADMENU_GROUPMOD, |
| 103 | 103 | 'link' => 'admin/admin_groupmod.php', |
| 104 | - 'icon' => $pathIcon32 . 'groupmod.png' |
|
| 104 | + 'icon' => $pathIcon32.'groupmod.png' |
|
| 105 | 105 | ]; |
| 106 | 106 | |
| 107 | 107 | $adminmenu[] = [ |
| 108 | 108 | 'title' => _MI_NEWBB_ADMENU_SYNC, |
| 109 | 109 | 'link' => 'admin/admin_synchronization.php', |
| 110 | - 'icon' => $pathIcon32 . 'synchronized.png' |
|
| 110 | + 'icon' => $pathIcon32.'synchronized.png' |
|
| 111 | 111 | ]; |
| 112 | 112 | |
| 113 | 113 | $adminmenu[] = [ |
| 114 | 114 | 'title' => _MI_NEWBB_ADMENU_MIGRATE, |
| 115 | 115 | 'link' => 'admin/migrate.php', |
| 116 | - 'icon' => $pathIcon32 . 'database_go.png' |
|
| 116 | + 'icon' => $pathIcon32.'database_go.png' |
|
| 117 | 117 | ]; |
| 118 | 118 | $adminmenu[] = [ |
| 119 | 119 | 'title' => _MI_NEWBB_ADMENU_ABOUT, |
| 120 | 120 | 'link' => 'admin/about.php', |
| 121 | - 'icon' => $pathIcon32 . 'about.png' |
|
| 121 | + 'icon' => $pathIcon32.'about.png' |
|
| 122 | 122 | ]; |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | $moduleDirName = basename(dirname(dirname(__DIR__))); |
| 46 | 46 | $capsDirName = strtoupper($moduleDirName); |
| 47 | 47 | |
| 48 | - require_once dirname(dirname(__DIR__)) . '/include/config.php'; |
|
| 48 | + require_once dirname(dirname(__DIR__)).'/include/config.php'; |
|
| 49 | 49 | $config = getConfig(); |
| 50 | 50 | |
| 51 | 51 | $this->name = $config->name; |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | public static function checkVerXoops(\XoopsModule $module = null, $requiredVer = null) |
| 30 | 30 | { |
| 31 | 31 | $moduleDirName = basename(dirname(dirname(__DIR__))); |
| 32 | - $moduleDirNameUpper = strtoupper($moduleDirName); |
|
| 32 | + $moduleDirNameUpper = strtoupper($moduleDirName); |
|
| 33 | 33 | if (null === $module) { |
| 34 | 34 | $module = \XoopsModule::getByDirname($moduleDirName); |
| 35 | 35 | } |
@@ -38,13 +38,13 @@ discard block |
||
| 38 | 38 | //check for minimum XOOPS version |
| 39 | 39 | $currentVer = substr(XOOPS_VERSION, 6); // get the numeric part of string |
| 40 | 40 | if (null === $requiredVer) { |
| 41 | - $requiredVer = '' . $module->getInfo('min_xoops'); //making sure it's a string |
|
| 41 | + $requiredVer = ''.$module->getInfo('min_xoops'); //making sure it's a string |
|
| 42 | 42 | } |
| 43 | 43 | $success = true; |
| 44 | 44 | |
| 45 | 45 | if (version_compare($currentVer, $requiredVer, '<')) { |
| 46 | 46 | $success = false; |
| 47 | - $module->setErrors(sprintf(constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_XOOPS'), $requiredVer, $currentVer)); |
|
| 47 | + $module->setErrors(sprintf(constant('CO_'.$moduleDirNameUpper.'_ERROR_BAD_XOOPS'), $requiredVer, $currentVer)); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | return $success; |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | public static function checkVerPhp(\XoopsModule $module) |
| 62 | 62 | { |
| 63 | 63 | $moduleDirName = basename(dirname(dirname(__DIR__))); |
| 64 | - $moduleDirNameUpper = strtoupper($moduleDirName); |
|
| 64 | + $moduleDirNameUpper = strtoupper($moduleDirName); |
|
| 65 | 65 | xoops_loadLanguage('admin', $module->dirname()); |
| 66 | 66 | // check for minimum PHP version |
| 67 | 67 | $success = true; |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | $reqVer = $module->getInfo('min_php'); |
| 70 | 70 | if (false !== $reqVer && '' !== $reqVer) { |
| 71 | 71 | if (version_compare($verNum, $reqVer, '<')) { |
| 72 | - $module->setErrors(sprintf(constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_PHP'), $reqVer, $verNum)); |
|
| 72 | + $module->setErrors(sprintf(constant('CO_'.$moduleDirNameUpper.'_ERROR_BAD_PHP'), $reqVer, $verNum)); |
|
| 73 | 73 | $success = false; |
| 74 | 74 | } |
| 75 | 75 | } |
@@ -30,9 +30,9 @@ discard block |
||
| 30 | 30 | * @throws \InvalidArgumentException |
| 31 | 31 | */ |
| 32 | 32 | public function __construct() |
| 33 | - { require_once dirname(dirname(__DIR__)) . '/include/config.php'; |
|
| 33 | + { require_once dirname(dirname(__DIR__)).'/include/config.php'; |
|
| 34 | 34 | $config = getConfig(); |
| 35 | - $this->renameTables = $config->renameTables; |
|
| 35 | + $this->renameTables = $config->renameTables; |
|
| 36 | 36 | |
| 37 | 37 | $moduleDirName = basename(dirname(dirname(__DIR__))); |
| 38 | 38 | parent::__construct($moduleDirName); |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | $this->synchronizeTable($tableName); |
| 90 | 90 | $updateTable = $GLOBALS['xoopsDB']->prefix($tableName); |
| 91 | 91 | $joinTable = $GLOBALS['xoopsDB']->prefix($srcTableName); |
| 92 | - $sql = "UPDATE `$updateTable` t1 INNER JOIN `$joinTable` t2 ON t1.post_id = t2.post_id \n" . "SET t1.dohtml = t2.dohtml, t1.dosmiley = t2.dosmiley, t1.doxcode = t2.doxcode\n" . ' , t1.doimage = t2.doimage, t1.dobr = t2.dobr'; |
|
| 92 | + $sql = "UPDATE `$updateTable` t1 INNER JOIN `$joinTable` t2 ON t1.post_id = t2.post_id \n"."SET t1.dohtml = t2.dohtml, t1.dosmiley = t2.dosmiley, t1.doxcode = t2.doxcode\n".' , t1.doimage = t2.doimage, t1.dobr = t2.dobr'; |
|
| 93 | 93 | $this->tableHandler->addToQueue($sql); |
| 94 | 94 | } |
| 95 | 95 | } |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | { |
| 59 | 59 | $id = (int)$id; |
| 60 | 60 | $post = null; |
| 61 | - $sql = 'SELECT p.*, t.* FROM ' . $this->db->prefix('newbb_posts') . ' p LEFT JOIN ' . $this->db->prefix('newbb_posts_text') . ' t ON p.post_id=t.post_id WHERE p.post_id=' . $id; |
|
| 61 | + $sql = 'SELECT p.*, t.* FROM '.$this->db->prefix('newbb_posts').' p LEFT JOIN '.$this->db->prefix('newbb_posts_text').' t ON p.post_id=t.post_id WHERE p.post_id='.$id; |
|
| 62 | 62 | if ($array = $this->db->fetchArray($this->db->query($sql))) { |
| 63 | 63 | $post = $this->create(false); |
| 64 | 64 | $post->assignVars($array); |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | $topic_id = 0, |
| 88 | 88 | $approved = 1 |
| 89 | 89 | ) { |
| 90 | - $sql = 'SELECT p.*, t.*, tp.topic_status FROM ' |
|
| 90 | + $sql = 'SELECT p.*, t.*, tp.topic_status FROM ' |
|
| 91 | 91 | . $this->db->prefix('newbb_posts') |
| 92 | 92 | . ' p LEFT JOIN ' |
| 93 | 93 | . $this->db->prefix('newbb_posts_text') |
@@ -379,14 +379,14 @@ discard block |
||
| 379 | 379 | |
| 380 | 380 | /* Set active post as deleted */ |
| 381 | 381 | if ($post->getVar('approved') > 0 && empty($force)) { |
| 382 | - $sql = 'UPDATE ' . $this->db->prefix('newbb_posts') . ' SET approved = -1 WHERE post_id = ' . $post->getVar('post_id'); |
|
| 382 | + $sql = 'UPDATE '.$this->db->prefix('newbb_posts').' SET approved = -1 WHERE post_id = '.$post->getVar('post_id'); |
|
| 383 | 383 | if (!$result = $this->db->queryF($sql)) { |
| 384 | 384 | } |
| 385 | 385 | /* delete pending post directly */ |
| 386 | 386 | } else { |
| 387 | 387 | $sql = sprintf('DELETE FROM `%s` WHERE post_id = %u', $this->db->prefix('newbb_posts'), $post->getVar('post_id')); |
| 388 | 388 | if (!$result = $this->db->queryF($sql)) { |
| 389 | - $post->setErrors('delete post error: ' . $sql); |
|
| 389 | + $post->setErrors('delete post error: '.$sql); |
|
| 390 | 390 | |
| 391 | 391 | return false; |
| 392 | 392 | } |
@@ -394,7 +394,7 @@ discard block |
||
| 394 | 394 | |
| 395 | 395 | $sql = sprintf('DELETE FROM `%s` WHERE post_id = %u', $this->db->prefix('newbb_posts_text'), $post->getVar('post_id')); |
| 396 | 396 | if (!$result = $this->db->queryF($sql)) { |
| 397 | - $post->setErrors('Could not remove post text: ' . $sql); |
|
| 397 | + $post->setErrors('Could not remove post text: '.$sql); |
|
| 398 | 398 | |
| 399 | 399 | return false; |
| 400 | 400 | } |
@@ -431,11 +431,11 @@ discard block |
||
| 431 | 431 | } |
| 432 | 432 | } |
| 433 | 433 | } else { |
| 434 | - $sql = 'UPDATE ' . $this->db->prefix('newbb_topics') . ' t |
|
| 435 | - LEFT JOIN ' . $this->db->prefix('newbb_posts') . ' p ON p.topic_id = t.topic_id |
|
| 434 | + $sql = 'UPDATE '.$this->db->prefix('newbb_topics').' t |
|
| 435 | + LEFT JOIN ' . $this->db->prefix('newbb_posts').' p ON p.topic_id = t.topic_id |
|
| 436 | 436 | SET t.topic_last_post_id = p.post_id |
| 437 | - WHERE t.topic_last_post_id = ' . $post->getVar('post_id') . ' |
|
| 438 | - AND p.post_id = (SELECT MAX(post_id) FROM ' . $this->db->prefix('newbb_posts') . ' WHERE topic_id=t.topic_id)'; |
|
| 437 | + WHERE t.topic_last_post_id = ' . $post->getVar('post_id').' |
|
| 438 | + AND p.post_id = (SELECT MAX(post_id) FROM ' . $this->db->prefix('newbb_posts').' WHERE topic_id=t.topic_id)'; |
|
| 439 | 439 | if (!$result = $this->db->queryF($sql)) { |
| 440 | 440 | } |
| 441 | 441 | } |
@@ -457,7 +457,7 @@ discard block |
||
| 457 | 457 | } |
| 458 | 458 | // irmtfan - just update the pid for approved posts when the post is not topic (pid=0) |
| 459 | 459 | if (!$post->isTopic()) { |
| 460 | - $sql = 'UPDATE ' . $this->db->prefix('newbb_posts') . ' SET pid = ' . $post->getVar('pid') . ' WHERE approved=1 AND pid=' . $post->getVar('post_id'); |
|
| 460 | + $sql = 'UPDATE '.$this->db->prefix('newbb_posts').' SET pid = '.$post->getVar('pid').' WHERE approved=1 AND pid='.$post->getVar('post_id'); |
|
| 461 | 461 | if (!$result = $this->db->queryF($sql)) { |
| 462 | 462 | //xoops_error($this->db->error()); |
| 463 | 463 | } |
@@ -481,12 +481,12 @@ discard block |
||
| 481 | 481 | return parent::getCount($criteria); |
| 482 | 482 | } |
| 483 | 483 | |
| 484 | - $sql = 'SELECT COUNT(*) as count' . ' FROM ' . $this->db->prefix('newbb_posts') . ' AS p' . ' LEFT JOIN ' . $this->db->prefix('newbb_posts_text') . ' AS t ON t.post_id = p.post_id'; |
|
| 484 | + $sql = 'SELECT COUNT(*) as count'.' FROM '.$this->db->prefix('newbb_posts').' AS p'.' LEFT JOIN '.$this->db->prefix('newbb_posts_text').' AS t ON t.post_id = p.post_id'; |
|
| 485 | 485 | // LEFT JOIN |
| 486 | 486 | $sql .= $join; |
| 487 | 487 | // WHERE |
| 488 | 488 | if (null !== $criteria && is_subclass_of($criteria, 'CriteriaElement')) { |
| 489 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 489 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 490 | 490 | } |
| 491 | 491 | if (!$result = $this->db->query($sql)) { |
| 492 | 492 | //xoops_error($this->db->error().'<br>'.$sql); |
@@ -511,14 +511,14 @@ discard block |
||
| 511 | 511 | public function getPostsByLimit($criteria = null, $limit = 1, $start = 0, $join = null) |
| 512 | 512 | { |
| 513 | 513 | $ret = []; |
| 514 | - $sql = 'SELECT p.*, t.* ' . ' FROM ' . $this->db->prefix('newbb_posts') . ' AS p' . ' LEFT JOIN ' . $this->db->prefix('newbb_posts_text') . ' AS t ON t.post_id = p.post_id'; |
|
| 514 | + $sql = 'SELECT p.*, t.* '.' FROM '.$this->db->prefix('newbb_posts').' AS p'.' LEFT JOIN '.$this->db->prefix('newbb_posts_text').' AS t ON t.post_id = p.post_id'; |
|
| 515 | 515 | if (!empty($join)) { |
| 516 | 516 | $sql .= $join; |
| 517 | 517 | } |
| 518 | 518 | if (null !== $criteria && is_subclass_of($criteria, 'CriteriaElement')) { |
| 519 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 519 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 520 | 520 | if ('' !== $criteria->getSort()) { |
| 521 | - $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
| 521 | + $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder(); |
|
| 522 | 522 | } |
| 523 | 523 | } |
| 524 | 524 | $result = $this->db->query($sql, (int)$limit, (int)$start); |
@@ -559,7 +559,7 @@ discard block |
||
| 559 | 559 | parent::cleanOrphan($this->db->prefix('newbb_topics'), 'topic_id'); |
| 560 | 560 | parent::cleanOrphan($this->db->prefix('newbb_posts_text'), 'post_id'); |
| 561 | 561 | |
| 562 | - $sql = 'DELETE FROM ' . $this->db->prefix('newbb_posts_text') . ' WHERE (post_id NOT IN ( SELECT DISTINCT post_id FROM ' . $this->table . ') )'; |
|
| 562 | + $sql = 'DELETE FROM '.$this->db->prefix('newbb_posts_text').' WHERE (post_id NOT IN ( SELECT DISTINCT post_id FROM '.$this->table.') )'; |
|
| 563 | 563 | if (!$result = $this->db->queryF($sql)) { |
| 564 | 564 | //xoops_error($this->db->error()); |
| 565 | 565 | return false; |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | use XoopsModules\Newbb; |
| 15 | 15 | |
| 16 | -defined('NEWBB_FUNCTIONS_INI') || require __DIR__ . '/functions.ini.php'; |
|
| 16 | +defined('NEWBB_FUNCTIONS_INI') || require __DIR__.'/functions.ini.php'; |
|
| 17 | 17 | define('NEWBB_FUNCTIONS_CONFIG_LOADED', true); |
| 18 | 18 | |
| 19 | 19 | if (!defined('NEWBB_FUNCTIONS_CONFIG')) { |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | $configs = is_object($helper) ? $helper->getConfig() : []; |
| 40 | - $plugins = require __DIR__ . '/plugin.php'; |
|
| 40 | + $plugins = require __DIR__.'/plugin.php'; |
|
| 41 | 41 | if (is_array($configs) && is_array($plugins)) { |
| 42 | 42 | $configs = array_merge($configs, $plugins); |
| 43 | 43 | } |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | $moduleDirName = basename(dirname(__DIR__)); |
| 23 | 23 | $uploadFolders = [ |
| 24 | 24 | NEWBB_UPLOAD_PATH, |
| 25 | - NEWBB_UPLOAD_PATH . '/thumbs' |
|
| 25 | + NEWBB_UPLOAD_PATH.'/thumbs' |
|
| 26 | 26 | ]; |
| 27 | 27 | |
| 28 | 28 | /** |
@@ -33,24 +33,24 @@ discard block |
||
| 33 | 33 | $moduleDirName = basename(dirname(__DIR__)); |
| 34 | 34 | $moduleDirNameUpper = strtoupper($moduleDirName); |
| 35 | 35 | return (object)[ |
| 36 | - 'name' => strtoupper($moduleDirName) . ' Module Configurator', |
|
| 36 | + 'name' => strtoupper($moduleDirName).' Module Configurator', |
|
| 37 | 37 | 'paths' => [ |
| 38 | 38 | 'dirname' => $moduleDirName, |
| 39 | - 'admin' => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/admin', |
|
| 40 | - 'modPath' => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName, |
|
| 41 | - 'modUrl' => XOOPS_URL . '/modules/' . $moduleDirName, |
|
| 42 | - 'uploadPath' => XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
| 43 | - 'uploadUrl' => XOOPS_UPLOAD_URL . '/' . $moduleDirName, |
|
| 39 | + 'admin' => XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/admin', |
|
| 40 | + 'modPath' => XOOPS_ROOT_PATH.'/modules/'.$moduleDirName, |
|
| 41 | + 'modUrl' => XOOPS_URL.'/modules/'.$moduleDirName, |
|
| 42 | + 'uploadPath' => XOOPS_UPLOAD_PATH.'/'.$moduleDirName, |
|
| 43 | + 'uploadUrl' => XOOPS_UPLOAD_URL.'/'.$moduleDirName, |
|
| 44 | 44 | ], |
| 45 | 45 | 'uploadFolders' => [ |
| 46 | - constant($moduleDirNameUpper . '_UPLOAD_PATH'), |
|
| 47 | - constant($moduleDirNameUpper . '_UPLOAD_PATH') . '/thumbs', |
|
| 46 | + constant($moduleDirNameUpper.'_UPLOAD_PATH'), |
|
| 47 | + constant($moduleDirNameUpper.'_UPLOAD_PATH').'/thumbs', |
|
| 48 | 48 | |
| 49 | 49 | //XOOPS_UPLOAD_PATH . '/flags' |
| 50 | 50 | ], |
| 51 | 51 | 'copyBlankFiles' => [ |
| 52 | - constant($moduleDirNameUpper . '_UPLOAD_PATH'), |
|
| 53 | - constant($moduleDirNameUpper . '_UPLOAD_PATH') . '/thumbs', |
|
| 52 | + constant($moduleDirNameUpper.'_UPLOAD_PATH'), |
|
| 53 | + constant($moduleDirNameUpper.'_UPLOAD_PATH').'/thumbs', |
|
| 54 | 54 | //XOOPS_UPLOAD_PATH . '/flags' |
| 55 | 55 | ], |
| 56 | 56 | |
@@ -107,6 +107,6 @@ discard block |
||
| 107 | 107 | ], |
| 108 | 108 | |
| 109 | 109 | 'modCopyright' => "<a href='https://xoops.org' title='XOOPS Project' target='_blank'> |
| 110 | - <img src='" . constant($moduleDirNameUpper . '_AUTHOR_LOGOIMG') . '\' alt=\'XOOPS Project\' /></a>', |
|
| 110 | + <img src='" . constant($moduleDirNameUpper.'_AUTHOR_LOGOIMG').'\' alt=\'XOOPS Project\' /></a>', |
|
| 111 | 111 | ]; |
| 112 | 112 | } |