@@ -55,11 +55,11 @@ discard block |
||
| 55 | 55 | $criteriaPost = new \CriteriaCompo(); |
| 56 | 56 | $criteriaPost->add(new \Criteria('p.approved', 1), 'AND'); // only active posts |
| 57 | 57 | |
| 58 | - $forum_list = [];// get forum lists just for forum names |
|
| 58 | + $forum_list = []; // get forum lists just for forum names |
|
| 59 | 59 | if (count($validForums) > 0) { |
| 60 | 60 | $criteriaPermissions = new \CriteriaCompo(); |
| 61 | - $criteriaPermissions->add(new \Criteria('p.forum_id', '(' . implode(',', $validForums) . ')', 'IN'), 'AND'); |
|
| 62 | - $forum_list = $forumHandler->getAll(new \Criteria('forum_id', '(' . implode(', ', $validForums) . ')', 'IN'), 'forum_name', false); |
|
| 61 | + $criteriaPermissions->add(new \Criteria('p.forum_id', '('.implode(',', $validForums).')', 'IN'), 'AND'); |
|
| 62 | + $forum_list = $forumHandler->getAll(new \Criteria('forum_id', '('.implode(', ', $validForums).')', 'IN'), 'forum_name', false); |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | if (is_numeric($userid) && 0 !== $userid) { |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | } elseif (is_array($userid) && count($userid) > 0) { |
| 69 | 69 | $userid = array_map('intval', $userid); |
| 70 | 70 | $criteriaUser = new \CriteriaCompo(); |
| 71 | - $criteriaUser->add(new \Criteria('p.uid', '(' . implode(',', $userid) . ')', 'IN'), 'OR'); |
|
| 71 | + $criteriaUser->add(new \Criteria('p.uid', '('.implode(',', $userid).')', 'IN'), 'OR'); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | $count = 0; |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | $criteriaKeywords = new \CriteriaCompo(); |
| 81 | 81 | foreach ($queryarray as $queryTerm) { |
| 82 | 82 | $termCriteria = new \CriteriaCompo(); |
| 83 | - $queryTermLike = '%' . $xoopsDB->escape($queryTerm) . '%'; |
|
| 83 | + $queryTermLike = '%'.$xoopsDB->escape($queryTerm).'%'; |
|
| 84 | 84 | if ('title' === $searchin || 'both' === $searchin) { |
| 85 | 85 | $termCriteria->add(new \Criteria('p.subject', $queryTermLike, 'LIKE'), 'OR'); |
| 86 | 86 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | $criteriaKeywords->add($termCriteria, $andor); |
| 91 | 91 | } |
| 92 | 92 | // add highlight keywords to post links |
| 93 | - $highlightKey = '&keywords=' . implode(' ', $queryarray); |
|
| 93 | + $highlightKey = '&keywords='.implode(' ', $queryarray); |
|
| 94 | 94 | $highlightKey = str_replace(' ', '+', $highlightKey); |
| 95 | 95 | } |
| 96 | 96 | $criteria = new \CriteriaCompo(); |
@@ -131,14 +131,14 @@ discard block |
||
| 131 | 131 | $post = $posts[$id]; |
| 132 | 132 | $post_data = $post->getPostBody(); |
| 133 | 133 | $ret[$i]['topic_id'] = $post->getVar('topic_id'); |
| 134 | - $ret[$i]['link'] = XOOPS_URL . '/modules/newbb/viewtopic.php?post_id=' . $post->getVar('post_id') . $highlightKey; // add highlight key |
|
| 134 | + $ret[$i]['link'] = XOOPS_URL.'/modules/newbb/viewtopic.php?post_id='.$post->getVar('post_id').$highlightKey; // add highlight key |
|
| 135 | 135 | $ret[$i]['title'] = $post_data['subject']; |
| 136 | 136 | $ret[$i]['time'] = $post_data['date']; |
| 137 | 137 | $ret[$i]['forum_name'] = $myts->htmlSpecialChars($forum_list[$post->getVar('forum_id')]['forum_name']); |
| 138 | - $ret[$i]['forum_link'] = XOOPS_URL . '/modules/newbb/viewforum.php?forum=' . $post->getVar('forum_id'); |
|
| 138 | + $ret[$i]['forum_link'] = XOOPS_URL.'/modules/newbb/viewforum.php?forum='.$post->getVar('forum_id'); |
|
| 139 | 139 | $ret[$i]['post_text'] = $post_data['text']; |
| 140 | 140 | $ret[$i]['uid'] = $post->getVar('uid'); |
| 141 | - $ret[$i]['poster'] = $post->getVar('uid') ? '<a href="' . XOOPS_URL . '/userinfo.php?uid=' . $ret[$i]['uid'] . '">' . $post_data['author'] . '</a>' : $post_data['author']; |
|
| 141 | + $ret[$i]['poster'] = $post->getVar('uid') ? '<a href="'.XOOPS_URL.'/userinfo.php?uid='.$ret[$i]['uid'].'">'.$post_data['author'].'</a>' : $post_data['author']; |
|
| 142 | 142 | ++$i; |
| 143 | 143 | } |
| 144 | 144 | |
@@ -54,42 +54,42 @@ |
||
| 54 | 54 | |
| 55 | 55 | if ('forum' === $category) { |
| 56 | 56 | // Assume we have a valid forum id |
| 57 | - $sql = 'SELECT forum_name FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_forums') . ' WHERE forum_id = ' . $item_id; |
|
| 57 | + $sql = 'SELECT forum_name FROM '.$GLOBALS['xoopsDB']->prefix('newbb_forums').' WHERE forum_id = '.$item_id; |
|
| 58 | 58 | if (!$result = $GLOBALS['xoopsDB']->query($sql)) { |
| 59 | 59 | // irmtfan full URL |
| 60 | - redirect_header(XOOPS_URL . '/modules/' . $module->getVar('dirname') . 'index.php', 2, _MD_NEWBB_ERRORFORUM); |
|
| 60 | + redirect_header(XOOPS_URL.'/modules/'.$module->getVar('dirname').'index.php', 2, _MD_NEWBB_ERRORFORUM); |
|
| 61 | 61 | } |
| 62 | 62 | $result_array = $GLOBALS['xoopsDB']->fetchArray($result); |
| 63 | 63 | $item['name'] = $result_array['forum_name']; |
| 64 | - $item['url'] = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/viewforum.php?forum=' . $item_id; |
|
| 64 | + $item['url'] = XOOPS_URL.'/modules/'.$module->getVar('dirname').'/viewforum.php?forum='.$item_id; |
|
| 65 | 65 | |
| 66 | 66 | return $item; |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | if ('thread' === $category) { |
| 70 | 70 | // Assume we have a valid topid id |
| 71 | - $sql = 'SELECT t.topic_title,f.forum_id,f.forum_name FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_topics') . ' t, ' . $GLOBALS['xoopsDB']->prefix('newbb_forums') . ' f WHERE t.forum_id = f.forum_id AND t.topic_id = ' . $item_id . ' LIMIT 1'; |
|
| 71 | + $sql = 'SELECT t.topic_title,f.forum_id,f.forum_name FROM '.$GLOBALS['xoopsDB']->prefix('newbb_topics').' t, '.$GLOBALS['xoopsDB']->prefix('newbb_forums').' f WHERE t.forum_id = f.forum_id AND t.topic_id = '.$item_id.' LIMIT 1'; |
|
| 72 | 72 | if (!$result = $GLOBALS['xoopsDB']->query($sql)) { |
| 73 | 73 | // irmtfan full URL |
| 74 | - redirect_header(XOOPS_URL . '/modules/' . $module->getVar('dirname') . 'index.php', 2, _MD_NEWBB_ERROROCCURED); |
|
| 74 | + redirect_header(XOOPS_URL.'/modules/'.$module->getVar('dirname').'index.php', 2, _MD_NEWBB_ERROROCCURED); |
|
| 75 | 75 | } |
| 76 | 76 | $result_array = $GLOBALS['xoopsDB']->fetchArray($result); |
| 77 | 77 | $item['name'] = $result_array['topic_title']; |
| 78 | - $item['url'] = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/viewtopic.php?forum=' . $result_array['forum_id'] . '&topic_id=' . $item_id; |
|
| 78 | + $item['url'] = XOOPS_URL.'/modules/'.$module->getVar('dirname').'/viewtopic.php?forum='.$result_array['forum_id'].'&topic_id='.$item_id; |
|
| 79 | 79 | |
| 80 | 80 | return $item; |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | if ('post' === $category) { |
| 84 | 84 | // Assume we have a valid post id |
| 85 | - $sql = 'SELECT subject,topic_id,forum_id FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_posts') . ' WHERE post_id = ' . $item_id . ' LIMIT 1'; |
|
| 85 | + $sql = 'SELECT subject,topic_id,forum_id FROM '.$GLOBALS['xoopsDB']->prefix('newbb_posts').' WHERE post_id = '.$item_id.' LIMIT 1'; |
|
| 86 | 86 | if (!$result = $GLOBALS['xoopsDB']->query($sql)) { |
| 87 | 87 | // irmtfan full URL |
| 88 | - redirect_header(XOOPS_URL . '/modules/' . $module->getVar('dirname') . 'index.php', 2, _MD_NEWBB_ERROROCCURED); |
|
| 88 | + redirect_header(XOOPS_URL.'/modules/'.$module->getVar('dirname').'index.php', 2, _MD_NEWBB_ERROROCCURED); |
|
| 89 | 89 | } |
| 90 | 90 | $result_array = $GLOBALS['xoopsDB']->fetchArray($result); |
| 91 | 91 | $item['name'] = $result_array['subject']; |
| 92 | - $item['url'] = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/viewtopic.php?forum= ' . $result_array['forum_id'] . '&topic_id=' . $result_array['topic_id'] . '#forumpost' . $item_id; |
|
| 92 | + $item['url'] = XOOPS_URL.'/modules/'.$module->getVar('dirname').'/viewtopic.php?forum= '.$result_array['forum_id'].'&topic_id='.$result_array['topic_id'].'#forumpost'.$item_id; |
|
| 93 | 93 | |
| 94 | 94 | return $item; |
| 95 | 95 | } |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | |
| 14 | 14 | // defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
| 15 | 15 | |
| 16 | -defined('NEWBB_FUNCTIONS_INI') || include __DIR__ . '/functions.ini.php'; |
|
| 16 | +defined('NEWBB_FUNCTIONS_INI') || include __DIR__.'/functions.ini.php'; |
|
| 17 | 17 | define('NEWBB_FUNCTIONS_READ_LOADED', true); |
| 18 | 18 | |
| 19 | 19 | if (!defined('NEWBB_FUNCTIONS_READ')) { |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | |
| 12 | 12 | // defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
| 13 | 13 | |
| 14 | -defined('NEWBB_FUNCTIONS_INI') || include __DIR__ . '/functions.ini.php'; |
|
| 14 | +defined('NEWBB_FUNCTIONS_INI') || include __DIR__.'/functions.ini.php'; |
|
| 15 | 15 | define('NEWBB_FUNCTIONS_RECON_LOADED', true); |
| 16 | 16 | |
| 17 | 17 | if (!defined('NEWBB_FUNCTIONS_RECON')) { |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | |
| 12 | 12 | // defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
| 13 | 13 | |
| 14 | -defined('NEWBB_FUNCTIONS_INI') || include __DIR__ . '/functions.ini.php'; |
|
| 14 | +defined('NEWBB_FUNCTIONS_INI') || include __DIR__.'/functions.ini.php'; |
|
| 15 | 15 | define('NEWBB_FUNCTIONS_RPC_LOADED', true); |
| 16 | 16 | |
| 17 | 17 | if (!defined('NEWBB_FUNCTIONS_RPC')) { |
@@ -32,16 +32,16 @@ discard block |
||
| 32 | 32 | } else { |
| 33 | 33 | $charset = _CHARSET; |
| 34 | 34 | } |
| 35 | - header('Content-Type: text/xml; charset="' . $charset . '"'); |
|
| 35 | + header('Content-Type: text/xml; charset="'.$charset.'"'); |
|
| 36 | 36 | if ($error) { |
| 37 | - echo '<?xml version="1.0" encoding="' . $charset . '"?' . ">\n"; |
|
| 37 | + echo '<?xml version="1.0" encoding="'.$charset.'"?'.">\n"; |
|
| 38 | 38 | echo '<response>\n'; |
| 39 | 39 | echo '<error>1</error>\n'; |
| 40 | 40 | echo '<message>$error_message</message>\n'; |
| 41 | 41 | echo '</response>'; |
| 42 | 42 | exit(); |
| 43 | 43 | } else { |
| 44 | - echo '<?xml version="1.0" encoding="' . $charset . '"?' . ">\n"; |
|
| 44 | + echo '<?xml version="1.0" encoding="'.$charset.'"?'.">\n"; |
|
| 45 | 45 | echo '<response>\n'; |
| 46 | 46 | echo '<error>0</error>\n'; |
| 47 | 47 | echo '</response>'; |
@@ -74,7 +74,7 @@ |
||
| 74 | 74 | // MENU handler |
| 75 | 75 | /* You could remove anyone by commenting out in order to disable it */ |
| 76 | 76 | $customConfig['valid_menumodes'] = [ |
| 77 | - 0 => _MD_NEWBB_MENU_SELECT, // for selectbox |
|
| 77 | + 0 => _MD_NEWBB_MENU_SELECT, // for selectbox |
|
| 78 | 78 | //1 => _MD_NEWBB_MENU_CLICK, // for "click to expand" |
| 79 | 79 | //2 => _MD_NEWBB_MENU_HOVER // for "mouse hover to expand" |
| 80 | 80 | ]; |
@@ -72,8 +72,8 @@ |
||
| 72 | 72 | // MENU handler |
| 73 | 73 | /* You could remove anyone by commenting out in order to disable it */ |
| 74 | 74 | $valid_menumodes = [ |
| 75 | - 0 => _MD_NEWBB_MENU_SELECT, // for selectbox |
|
| 76 | - 1 => _MD_NEWBB_MENU_CLICK, // for 'click to expand' |
|
| 75 | + 0 => _MD_NEWBB_MENU_SELECT, // for selectbox |
|
| 76 | + 1 => _MD_NEWBB_MENU_CLICK, // for 'click to expand' |
|
| 77 | 77 | 2 => _MD_NEWBB_MENU_HOVER // for 'mouse hover to expand' |
| 78 | 78 | ]; |
| 79 | 79 | |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | // defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
| 15 | 15 | |
| 16 | -defined('NEWBB_FUNCTIONS_INI') || include __DIR__ . '/functions.ini.php'; |
|
| 16 | +defined('NEWBB_FUNCTIONS_INI') || include __DIR__.'/functions.ini.php'; |
|
| 17 | 17 | define('NEWBB_FUNCTIONS_FORUM_LOADED', true); |
| 18 | 18 | |
| 19 | 19 | if (!defined('NEWBB_FUNCTIONS_FORUM')) { |
@@ -40,8 +40,8 @@ discard block |
||
| 40 | 40 | $groups = $xoopsUser->getGroups(); |
| 41 | 41 | } |
| 42 | 42 | sort($groups); |
| 43 | - $groupKey = 'forumselect_' . $permission . '_' . md5(implode(',', $groups)); |
|
| 44 | - $forums = $cacheHelper->cacheRead($groupKey, function () use ($categories, $permission) { |
|
| 43 | + $groupKey = 'forumselect_'.$permission.'_'.md5(implode(',', $groups)); |
|
| 44 | + $forums = $cacheHelper->cacheRead($groupKey, function() use ($categories, $permission) { |
|
| 45 | 45 | /** @var Newbb\CategoryHandler $categoryHandler */ |
| 46 | 46 | $categoryHandler = Newbb\Helper::getInstance()->getHandler('Category'); |
| 47 | 47 | $categories = $categoryHandler->getByPermission($permission, ['cat_id', 'cat_order', 'cat_title'], false); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | if ($categoryDelimiter) { |
| 62 | 62 | $box .= "<option value=0> </option>\n"; |
| 63 | 63 | } |
| 64 | - $box .= "<option value='" . (-1 * $key) . "'>[" . $categories[$key]['cat_title'] . "]</option>\n"; |
|
| 64 | + $box .= "<option value='".(-1 * $key)."'>[".$categories[$key]['cat_title']."]</option>\n"; |
|
| 65 | 65 | if (empty($forums[$key])) { |
| 66 | 66 | continue; |
| 67 | 67 | } |
@@ -69,11 +69,11 @@ discard block |
||
| 69 | 69 | if ($see && in_array($f, $value)) { |
| 70 | 70 | continue; |
| 71 | 71 | } |
| 72 | - $box .= "<option value='{$f}' " . (in_array($f, $value) ? ' selected' : '') . '>' . $forum['prefix'] . $forum['forum_name'] . "</option>\n"; |
|
| 72 | + $box .= "<option value='{$f}' ".(in_array($f, $value) ? ' selected' : '').'>'.$forum['prefix'].$forum['forum_name']."</option>\n"; |
|
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | 75 | } else { |
| 76 | - $box .= '<option value=0>' . _MD_NEWBB_NOFORUMINDB . "</option>\n"; |
|
| 76 | + $box .= '<option value=0>'._MD_NEWBB_NOFORUMINDB."</option>\n"; |
|
| 77 | 77 | } |
| 78 | 78 | unset($forums, $categories); |
| 79 | 79 | |
@@ -86,11 +86,11 @@ discard block |
||
| 86 | 86 | */ |
| 87 | 87 | function newbbMakeJumpbox($forum_id = 0) |
| 88 | 88 | { |
| 89 | - $box = '<form name="forum_jumpbox" method="get" action="' . XOOPS_URL . '/modules/newbb/viewforum.php" onsubmit="javascript: if (document.forum_jumpbox.forum.value < 1) {return false;}">'; |
|
| 89 | + $box = '<form name="forum_jumpbox" method="get" action="'.XOOPS_URL.'/modules/newbb/viewforum.php" onsubmit="javascript: if (document.forum_jumpbox.forum.value < 1) {return false;}">'; |
|
| 90 | 90 | $box .= '<select class="select" name="forum" onchange="if (this.options[this.selectedIndex].value >0) { document.forms.forum_jumpbox.submit();}">'; |
| 91 | - $box .= '<option value=0>-- ' . _MD_NEWBB_SELFORUM . ' --</option>'; |
|
| 91 | + $box .= '<option value=0>-- '._MD_NEWBB_SELFORUM.' --</option>'; |
|
| 92 | 92 | $box .= newbbForumSelectBox($forum_id); |
| 93 | - $box .= "</select> <input type='submit' class='button' value='" . _GO . "' /></form>"; |
|
| 93 | + $box .= "</select> <input type='submit' class='button' value='"._GO."' /></form>"; |
|
| 94 | 94 | unset($forums, $categories); |
| 95 | 95 | |
| 96 | 96 | return $box; |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | |
| 12 | 12 | // defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
| 13 | 13 | |
| 14 | -defined('NEWBB_FUNCTIONS_INI') || include __DIR__ . '/functions.ini.php'; |
|
| 14 | +defined('NEWBB_FUNCTIONS_INI') || include __DIR__.'/functions.ini.php'; |
|
| 15 | 15 | define('NEWBB_FUNCTIONS_TOPIC_LOADED', true); |
| 16 | 16 | |
| 17 | 17 | if (!defined('NEWBB_FUNCTIONS_TOPIC')) { |
@@ -42,8 +42,8 @@ discard block |
||
| 42 | 42 | if (empty($prefixName)) { |
| 43 | 43 | return $topicTitle; |
| 44 | 44 | } |
| 45 | - $topicPrefix = $prefixColor ? '<em style="font-style: normal; color: ' . $prefixColor . ';">[' . $prefixName . ']</em> ' : '[' . $prefixName . '] '; |
|
| 45 | + $topicPrefix = $prefixColor ? '<em style="font-style: normal; color: '.$prefixColor.';">['.$prefixName.']</em> ' : '['.$prefixName.'] '; |
|
| 46 | 46 | |
| 47 | - return $topicPrefix . $topicTitle; |
|
| 47 | + return $topicPrefix.$topicTitle; |
|
| 48 | 48 | } |
| 49 | 49 | } |