@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | use Xmf\Request; |
13 | 13 | |
14 | -require_once __DIR__ . '/header.php'; |
|
14 | +require_once __DIR__.'/header.php'; |
|
15 | 15 | |
16 | 16 | global $xoTheme, $xoopsTpl; |
17 | 17 | $GLOBALS['xoopsOption']['template_main'] = 'newbb_moderate.tpl'; |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | $forum_id = Request::getInt('forum', 0); |
22 | 22 | $isAdmin = newbbIsAdmin($forum_id); |
23 | 23 | if (!$isAdmin) { |
24 | - redirect_header(XOOPS_URL . '/index.php', 2, _MD_NEWBB_NORIGHTTOACCESS); |
|
24 | + redirect_header(XOOPS_URL.'/index.php', 2, _MD_NEWBB_NORIGHTTOACCESS); |
|
25 | 25 | } |
26 | 26 | $is_administrator = $GLOBALS['xoopsUserIsAdmin']; |
27 | 27 | ///** @var Newbb\ModerateHandler $moderateHandler */ |
@@ -38,9 +38,9 @@ discard block |
||
38 | 38 | $ipWithMask = ''; |
39 | 39 | } else { |
40 | 40 | $ipWithMask = $ip->asReadable(); |
41 | - $mask = empty($ipParts[1]) ? 0 : (int)$ipParts[1]; |
|
41 | + $mask = empty($ipParts[1]) ? 0 : (int) $ipParts[1]; |
|
42 | 42 | $mask = ($mask > ((4 === $ip->ipVersion()) ? 32 : 128) || $mask < 8) ? '' : $mask; |
43 | - $ipWithMask .= empty($mask) ? '' : '/' . $mask; |
|
43 | + $ipWithMask .= empty($mask) ? '' : '/'.$mask; |
|
44 | 44 | } |
45 | 45 | } |
46 | 46 | |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | |
101 | 101 | $url = 'moderate.php'; |
102 | 102 | if ($forum_id) { |
103 | - $url .= '?forum=' . $forum_id; |
|
103 | + $url .= '?forum='.$forum_id; |
|
104 | 104 | } |
105 | 105 | $xoopsTpl->assign('moderate_url', $url); |
106 | 106 | |
@@ -111,27 +111,27 @@ discard block |
||
111 | 111 | } |
112 | 112 | $users = newbbGetUnameFromIds(array_keys($_users), $GLOBALS['xoopsModuleConfig']['show_realname'], true); |
113 | 113 | |
114 | - $columnHeaders ['uid'] = [ |
|
115 | - 'url' => 'moderate.php?forum=' . $forum_id . '&start=' . $start . '&sort=uid', |
|
114 | + $columnHeaders ['uid'] = [ |
|
115 | + 'url' => 'moderate.php?forum='.$forum_id.'&start='.$start.'&sort=uid', |
|
116 | 116 | 'header' => _MD_NEWBB_SUSPEND_UID, |
117 | 117 | 'title' => _MD_NEWBB_SUSPEND_UID, |
118 | 118 | ]; |
119 | - $columnHeaders ['start'] = [ |
|
120 | - 'url' => 'moderate.php?forum=' . $forum_id . '&start=' . $start . '&sort=start', |
|
119 | + $columnHeaders ['start'] = [ |
|
120 | + 'url' => 'moderate.php?forum='.$forum_id.'&start='.$start.'&sort=start', |
|
121 | 121 | 'header' => _MD_NEWBB_SUSPEND_START, |
122 | 122 | 'title' => _MD_NEWBB_SUSPEND_START, |
123 | 123 | ]; |
124 | - $columnHeaders['expire'] = [ |
|
125 | - 'url' => 'moderate.php?forum=' . $forum_id . '&start=' . $start . '&sort=expire', |
|
124 | + $columnHeaders['expire'] = [ |
|
125 | + 'url' => 'moderate.php?forum='.$forum_id.'&start='.$start.'&sort=expire', |
|
126 | 126 | 'header' => _MD_NEWBB_SUSPEND_EXPIRE, |
127 | 127 | 'title' => _MD_NEWBB_SUSPEND_EXPIRE, |
128 | 128 | ]; |
129 | - $columnHeaders['forum'] = [ |
|
130 | - 'url' => 'moderate.php?forum=' . $forum_id . '&start=' . $start . '&sort=forum', |
|
129 | + $columnHeaders['forum'] = [ |
|
130 | + 'url' => 'moderate.php?forum='.$forum_id.'&start='.$start.'&sort=forum', |
|
131 | 131 | 'header' => _MD_NEWBB_SUSPEND_SCOPE, |
132 | 132 | 'title' => _MD_NEWBB_SUSPEND_SCOPE, |
133 | 133 | ]; |
134 | - $columnHeaders['desc'] = [ |
|
134 | + $columnHeaders['desc'] = [ |
|
135 | 135 | 'url' => false, |
136 | 136 | 'header' => _MD_NEWBB_SUSPEND_DESC, |
137 | 137 | 'title' => _MD_NEWBB_SUSPEND_DESC, |
@@ -156,14 +156,14 @@ discard block |
||
156 | 156 | $row['forum'] = ($moderateObjects[$id]->getVar('forum_id') ? $forum_list[$moderateObjects[$id]->getVar('forum_id')]['forum_name'] : _ALL); |
157 | 157 | $row['desc'] = ($moderateObjects[$id]->getVar('mod_desc') ?: _NONE); |
158 | 158 | $row['options'] = (($is_administrator |
159 | - || $moderateObjects[$id]->getVar('forum_id') == $forum_id) ? '<a href="moderate.php?forum=' . $forum_id . '&del=' . $moderateObjects[$id]->getVar('mod_id') . '">' . _DELETE . '</a>' : ''); |
|
159 | + || $moderateObjects[$id]->getVar('forum_id') == $forum_id) ? '<a href="moderate.php?forum='.$forum_id.'&del='.$moderateObjects[$id]->getVar('mod_id').'">'._DELETE.'</a>' : ''); |
|
160 | 160 | $columnRows[] = $row; |
161 | 161 | } |
162 | 162 | $xoopsTpl->assign('columnRows', $columnRows); |
163 | 163 | |
164 | 164 | if ($moderate_count > $GLOBALS['xoopsModuleConfig']['topics_per_page']) { |
165 | 165 | require_once $GLOBALS['xoops']->path('class/pagenav.php'); |
166 | - $nav = new \XoopsPageNav($moderate_count, $GLOBALS['xoopsModuleConfig']['topics_per_page'], $start, 'start', 'forum=' . $forum_id . '&sort=' . $sortname); |
|
166 | + $nav = new \XoopsPageNav($moderate_count, $GLOBALS['xoopsModuleConfig']['topics_per_page'], $start, 'start', 'forum='.$forum_id.'&sort='.$sortname); |
|
167 | 167 | //if (isset($GLOBALS['xoopsModuleConfig']['do_rewrite'])) { |
168 | 168 | // $nav->url = formatURL(Request::getString('SERVER_NAME', '', 'SERVER')) . ' /' . $nav->url; |
169 | 169 | //} |
@@ -177,14 +177,14 @@ discard block |
||
177 | 177 | $forum_form->addElement(new \XoopsFormText(_MD_NEWBB_SUSPEND_IP, 'ip', 50, 50)); |
178 | 178 | $forum_form->addElement(new \XoopsFormText(_MD_NEWBB_SUSPEND_DURATION, 'expire', 20, 25, '5'), true); |
179 | 179 | $forum_form->addElement(new \XoopsFormText(_MD_NEWBB_SUSPEND_DESC, 'desc', 50, 255)); |
180 | -require_once __DIR__ . '/include/functions.forum.php'; |
|
180 | +require_once __DIR__.'/include/functions.forum.php'; |
|
181 | 181 | if (newbbIsAdmin()) { |
182 | - $forumSel = '<select name="forum">';// if user doesn't select, default is "0" all forums |
|
182 | + $forumSel = '<select name="forum">'; // if user doesn't select, default is "0" all forums |
|
183 | 183 | $forumSel .= '<option value="0"'; |
184 | 184 | if (0 == $forum_id) { |
185 | 185 | $forumSel .= ' selected'; |
186 | 186 | } |
187 | - $forumSel .= '>' . _ALL . '</option>'; |
|
187 | + $forumSel .= '>'._ALL.'</option>'; |
|
188 | 188 | $forumSel .= newbbForumSelectBox($forum_id, 'access', false); //$accessForums, $permission = "access", $delimitorCategory = true |
189 | 189 | $forumSel .= '</select>'; |
190 | 190 | $forumEle = new \XoopsFormLabel(_MD_NEWBB_SELFORUM, $forumSel); |
@@ -196,5 +196,5 @@ discard block |
||
196 | 196 | $forum_form->addElement(new \XoopsFormButton('', 'submit', _SUBMIT, 'submit')); |
197 | 197 | $forum_form->assign($xoopsTpl); |
198 | 198 | |
199 | -require_once __DIR__ . '/footer.php'; |
|
199 | +require_once __DIR__.'/footer.php'; |
|
200 | 200 | require_once $GLOBALS['xoops']->path('footer.php'); |
@@ -21,15 +21,15 @@ discard block |
||
21 | 21 | |
22 | 22 | //require_once dirname(__DIR__) . '/include/functions.ini.php'; |
23 | 23 | //require_once dirname(__DIR__) . '/class/TopicRenderer.php'; |
24 | -require_once dirname(__DIR__) . '/footer.php'; // to include js/style files like validate function |
|
24 | +require_once dirname(__DIR__).'/footer.php'; // to include js/style files like validate function |
|
25 | 25 | |
26 | 26 | xoops_loadLanguage('main', 'newbb'); |
27 | 27 | |
28 | -require_once dirname(__DIR__) . '/include/functions.config.php'; |
|
29 | -require_once dirname(__DIR__) . '/include/functions.time.php'; |
|
30 | -require_once dirname(__DIR__) . '/include/functions.session.php'; |
|
31 | -require_once dirname(__DIR__) . '/include/functions.render.php'; |
|
32 | -require_once dirname(__DIR__) . '/include/functions.user.php'; |
|
28 | +require_once dirname(__DIR__).'/include/functions.config.php'; |
|
29 | +require_once dirname(__DIR__).'/include/functions.time.php'; |
|
30 | +require_once dirname(__DIR__).'/include/functions.session.php'; |
|
31 | +require_once dirname(__DIR__).'/include/functions.render.php'; |
|
32 | +require_once dirname(__DIR__).'/include/functions.user.php'; |
|
33 | 33 | |
34 | 34 | // options[0] - Status in WHERE claus: all(by default), sticky, digest,lock, poll, voted, viewed, replied, read, (UN_) , active, pending, deleted (admin) (It is multi-select) |
35 | 35 | // options[1] - Uid in WHERE claus: uid of the topic poster : -1 - all users (by default) |
@@ -59,12 +59,12 @@ discard block |
||
59 | 59 | $topicRenderer->force = true; // force against static vars for parse |
60 | 60 | |
61 | 61 | $topicRenderer->is_multiple = true; // is it for multiple forums |
62 | - $topicRenderer->config =& $newbbConfig; // get all configs |
|
62 | + $topicRenderer->config = & $newbbConfig; // get all configs |
|
63 | 63 | if (!empty($options[6])) { |
64 | - $topicRenderer->config['topics_per_page'] = (int)$options[6]; // number of topics (items) to display |
|
64 | + $topicRenderer->config['topics_per_page'] = (int) $options[6]; // number of topics (items) to display |
|
65 | 65 | } |
66 | - $topicRenderer->config['topic_title_excerpt'] = (int)$options[10]; // topic title length 0 = dont excerpt |
|
67 | - $topicRenderer->config['post_excerpt'] = (int)$options[11]; // post text excerpt 0 = no post text |
|
66 | + $topicRenderer->config['topic_title_excerpt'] = (int) $options[10]; // topic title length 0 = dont excerpt |
|
67 | + $topicRenderer->config['post_excerpt'] = (int) $options[11]; // post text excerpt 0 = no post text |
|
68 | 68 | |
69 | 69 | $optionsStatus = explode(',', $options[0]); // status in where claus |
70 | 70 | $optionsForum = explode(',', $options[12]); |
@@ -121,16 +121,16 @@ discard block |
||
121 | 121 | $topicPosterRadioEle->addOption(-1, _MD_NEWBB_TOTALUSER); |
122 | 122 | $topicPosterRadioEle->addOption((-1 !== $options[1]) ? $options[1] : 0, _SELECT); // if no user in selection box it select uid=0 anon users |
123 | 123 | $topicPosterRadioEle->setExtra("onchange=\"var el=document.getElementById('options[1]'); el.disabled=(this.id == 'options[1]1'); if (!el.value) {el.value= this.value}\""); // if user dont select any option it select "all" |
124 | - $topicPosterSelectEle = new \XoopsFormSelectUser(_MB_NEWBB_AUTHOR, 'options[1]', true, explode(',', $options[1]), 5, true);// show $limit = 200 users when no user is selected; |
|
125 | - $topicPosterEle = new \XoopsFormLabel(_MB_NEWBB_AUTHOR, $topicPosterRadioEle->render() . $topicPosterSelectEle->render()); |
|
124 | + $topicPosterSelectEle = new \XoopsFormSelectUser(_MB_NEWBB_AUTHOR, 'options[1]', true, explode(',', $options[1]), 5, true); // show $limit = 200 users when no user is selected; |
|
125 | + $topicPosterEle = new \XoopsFormLabel(_MB_NEWBB_AUTHOR, $topicPosterRadioEle->render().$topicPosterSelectEle->render()); |
|
126 | 126 | |
127 | 127 | // lastposter element |
128 | 128 | $lastPosterRadioEle = new \XoopsFormRadio(_MD_NEWBB_POSTER, 'options[2]', $options[2]); |
129 | 129 | $lastPosterRadioEle->addOption(-1, _MD_NEWBB_TOTALUSER); |
130 | 130 | $lastPosterRadioEle->addOption((-1 !== $options[2]) ? $options[2] : 0, _SELECT); // if no user in selection box it select uid=1 |
131 | 131 | $lastPosterRadioEle->setExtra("onchange=\"var el=document.getElementById('options[2]'); el.disabled=(this.id == 'options[2]1'); if (!el.value) {el.value= this.value}\""); // if user dont select any option it select "all" |
132 | - $lastPosterSelectEle = new \XoopsFormSelectUser(_MD_NEWBB_POSTER, 'options[2]', true, explode(',', $options[2]), 5, true);// show $limit = 200 users when no user is selected; |
|
133 | - $lastPosterEle = new \XoopsFormLabel(_MD_NEWBB_POSTER, $lastPosterRadioEle->render() . $lastPosterSelectEle->render()); |
|
132 | + $lastPosterSelectEle = new \XoopsFormSelectUser(_MD_NEWBB_POSTER, 'options[2]', true, explode(',', $options[2]), 5, true); // show $limit = 200 users when no user is selected; |
|
133 | + $lastPosterEle = new \XoopsFormLabel(_MD_NEWBB_POSTER, $lastPosterRadioEle->render().$lastPosterSelectEle->render()); |
|
134 | 134 | |
135 | 135 | // type element |
136 | 136 | $types = $topicRenderer->getTypes(); // get all available types in all forums |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | $orderEle->addOption(1, _ASCENDING); |
155 | 155 | |
156 | 156 | // number of topics to display element |
157 | - $numdispEle = new \XoopsFormText(_MB_NEWBB_DISPLAY, 'options[6]', 10, 255, (int)$options[6]); |
|
157 | + $numdispEle = new \XoopsFormText(_MB_NEWBB_DISPLAY, 'options[6]', 10, 255, (int) $options[6]); |
|
158 | 158 | |
159 | 159 | $timeEle = new \XoopsFormText(_MB_NEWBB_TIME, 'options[7]', 10, 255, $options[7]); |
160 | 160 | $timeEle->setDescription(_MB_NEWBB_TIME_DESC); |
@@ -171,29 +171,29 @@ discard block |
||
171 | 171 | $navEle = new \XoopsFormRadioYN(_MB_NEWBB_INDEXNAV, 'options[9]', !empty($options[9])); |
172 | 172 | |
173 | 173 | // Topic title element |
174 | - $lengthEle = new \XoopsFormText(_MB_NEWBB_TITLE_LENGTH, 'options[10]', 10, 255, (int)$options[10]); |
|
174 | + $lengthEle = new \XoopsFormText(_MB_NEWBB_TITLE_LENGTH, 'options[10]', 10, 255, (int) $options[10]); |
|
175 | 175 | $lengthEle->setDescription(_MB_NEWBB_TITLE_LENGTH_DESC); |
176 | 176 | |
177 | 177 | // Post text element |
178 | - $postExcerptEle = new \XoopsFormText(_MB_NEWBB_POST_EXCERPT, 'options[11]', 10, 255, (int)$options[11]); |
|
178 | + $postExcerptEle = new \XoopsFormText(_MB_NEWBB_POST_EXCERPT, 'options[11]', 10, 255, (int) $options[11]); |
|
179 | 179 | $postExcerptEle->setDescription(_MB_NEWBB_POST_EXCERPT_DESC); |
180 | 180 | |
181 | 181 | // forum element |
182 | 182 | $optionsForum = explode(',', $options[12]); |
183 | - require_once dirname(__DIR__) . '/include/functions.forum.php'; |
|
183 | + require_once dirname(__DIR__).'/include/functions.forum.php'; |
|
184 | 184 | /** @var Newbb\ForumHandler $forumHandler */ |
185 | 185 | $forumHandler = Newbb\Helper::getInstance()->getHandler('Forum'); |
186 | 186 | //get forum Ids by values. parse positive values to forum IDs and negative values to category IDs. value=0 => all valid forums |
187 | 187 | // Get accessible forums |
188 | 188 | $accessForums = $forumHandler->getIdsByValues(array_map('intval', $optionsForum)); |
189 | 189 | $isAll = (0 === count($optionsForum) || empty($optionsForum[0])); |
190 | - $forumSel = "<select name=\"options[12][]\" multiple=\"multiple\" onchange = \"validate('options[12][]','select', true)\">";// if user dont select any it select "0" |
|
191 | - $forumSel .= '<option value="0" '; |
|
190 | + $forumSel = "<select name=\"options[12][]\" multiple=\"multiple\" onchange = \"validate('options[12][]','select', true)\">"; // if user dont select any it select "0" |
|
191 | + $forumSel .= '<option value="0" '; |
|
192 | 192 | if ($isAll) { |
193 | - $forumSel .= ' selected'; |
|
193 | + $forumSel .= ' selected'; |
|
194 | 194 | $accessForums = null; // just select _ALL option |
195 | 195 | } |
196 | - $forumSel .= '>' . _ALL . '</option>'; |
|
196 | + $forumSel .= '>'._ALL.'</option>'; |
|
197 | 197 | $forumSel .= newbbForumSelectBox($accessForums, 'access', false); //$accessForums, $permission = "access", $delimitorCategory = false |
198 | 198 | $forumSel .= '</select>'; |
199 | 199 | $forumEle = new \XoopsFormLabel(_MB_NEWBB_FORUMLIST, $forumSel); |
@@ -56,8 +56,8 @@ discard block |
||
56 | 56 | global $accessForums; |
57 | 57 | global $xoopsLogger; |
58 | 58 | |
59 | - require_once dirname(__DIR__) . '/include/functions.config.php'; |
|
60 | - require_once dirname(__DIR__) . '/include/functions.time.php'; |
|
59 | + require_once dirname(__DIR__).'/include/functions.config.php'; |
|
60 | + require_once dirname(__DIR__).'/include/functions.time.php'; |
|
61 | 61 | |
62 | 62 | $myts = \MyTextSanitizer::getInstance(); |
63 | 63 | $block = []; |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $extraCriteria = ''; |
67 | 67 | if (!empty($options[2])) { |
68 | 68 | //require_once dirname(__DIR__) . '/include/functions.time.php'; |
69 | - $extraCriteria .= ' AND p.post_time>' . (time() - newbbGetSinceTime($options[2])); |
|
69 | + $extraCriteria .= ' AND p.post_time>'.(time() - newbbGetSinceTime($options[2])); |
|
70 | 70 | } |
71 | 71 | switch ($options[0]) { |
72 | 72 | case 'time': |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | return $block; |
93 | 93 | } |
94 | 94 | |
95 | - $forumCriteria = ' AND t.forum_id IN (' . implode(',', $allowedForums) . ')'; |
|
95 | + $forumCriteria = ' AND t.forum_id IN ('.implode(',', $allowedForums).')'; |
|
96 | 96 | $approveCriteria = ' AND t.approved = 1'; |
97 | 97 | |
98 | 98 | $newbbConfig = newbbLoadConfig(); |
@@ -148,13 +148,13 @@ discard block |
||
148 | 148 | return $block; |
149 | 149 | } |
150 | 150 | |
151 | - require_once dirname(__DIR__) . '/include/functions.user.php'; |
|
151 | + require_once dirname(__DIR__).'/include/functions.user.php'; |
|
152 | 152 | $author_name = newbbGetUnameFromIds(array_keys($author), $newbbConfig['show_realname'], true); |
153 | 153 | |
154 | 154 | if (count($types) > 0) { |
155 | 155 | /** @var Newbb\TypeHandler $typeHandler */ |
156 | 156 | $typeHandler = Newbb\Helper::getInstance()->getHandler('Type'); |
157 | - $type_list = $typeHandler->getList(new \Criteria('type_id', '(' . implode(', ', array_keys($types)) . ')', 'IN')); |
|
157 | + $type_list = $typeHandler->getList(new \Criteria('type_id', '('.implode(', ', array_keys($types)).')', 'IN')); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | foreach ($rows as $arr) { |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | xoops_loadLanguage('main', 'newbb'); |
163 | 163 | $topic = []; |
164 | 164 | $topic_page_jump = newbbDisplayImage('lastposticon', _MD_NEWBB_GOTOLASTPOST); |
165 | - $topic['topic_subject'] = empty($type_list[$arr['type_id']]) ? '' : '[' . $type_list[$arr['type_id']] . ']'; |
|
165 | + $topic['topic_subject'] = empty($type_list[$arr['type_id']]) ? '' : '['.$type_list[$arr['type_id']].']'; |
|
166 | 166 | |
167 | 167 | $topic['post_id'] = $arr['post_id']; |
168 | 168 | $topic['topic_status'] = $arr['topic_status']; |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | if (!empty($options[5])) { |
175 | 175 | $title = xoops_substr($title, 0, $options[5]); |
176 | 176 | } |
177 | - $topic['title'] = $topic['topic_subject'] . ' ' . $title; |
|
177 | + $topic['title'] = $topic['topic_subject'].' '.$title; |
|
178 | 178 | $topic['replies'] = $arr['topic_replies']; |
179 | 179 | $topic['views'] = $arr['topic_views']; |
180 | 180 | $topic['time'] = newbbFormatTimestamp($arr['post_time']); |
@@ -186,9 +186,9 @@ discard block |
||
186 | 186 | $topic['topic_poster'] = $topic_poster; |
187 | 187 | $topic['topic_page_jump'] = $topic_page_jump; |
188 | 188 | // START irmtfan remove hardcoded html in URLs - add $seo_topic_url |
189 | - $seo_url = XOOPS_URL . '/' . SEO_MODULE_NAME . '/viewtopic.php?post_id=' . $topic['post_id']; |
|
190 | - $seo_topic_url = XOOPS_URL . '/' . SEO_MODULE_NAME . '/viewtopic.php?topic_id=' . $topic['id']; |
|
191 | - $seo_forum_url = XOOPS_URL . '/' . SEO_MODULE_NAME . '/viewforum.php?forum=' . $topic['forum_id']; |
|
189 | + $seo_url = XOOPS_URL.'/'.SEO_MODULE_NAME.'/viewtopic.php?post_id='.$topic['post_id']; |
|
190 | + $seo_topic_url = XOOPS_URL.'/'.SEO_MODULE_NAME.'/viewtopic.php?topic_id='.$topic['id']; |
|
191 | + $seo_forum_url = XOOPS_URL.'/'.SEO_MODULE_NAME.'/viewforum.php?forum='.$topic['forum_id']; |
|
192 | 192 | if (!empty($newbbConfig['do_rewrite'])) { |
193 | 193 | $topic['seo_url'] = seo_urls($seo_url); |
194 | 194 | $topic['seo_topic_url'] = seo_urls($seo_topic_url); |
@@ -203,14 +203,14 @@ discard block |
||
203 | 203 | unset($topic); |
204 | 204 | } |
205 | 205 | // START irmtfan remove hardcoded html in URLs |
206 | - $seo_top_allforums = XOOPS_URL . '/' . SEO_MODULE_NAME; |
|
206 | + $seo_top_allforums = XOOPS_URL.'/'.SEO_MODULE_NAME; |
|
207 | 207 | $block['seo_top_allforums'] = !empty($newbbConfig['do_rewrite']) ? seo_urls($seo_top_allforums) : $seo_top_allforums; |
208 | - $seo_top_allforums = XOOPS_URL . '/' . SEO_MODULE_NAME . '/list.topic.php'; |
|
208 | + $seo_top_allforums = XOOPS_URL.'/'.SEO_MODULE_NAME.'/list.topic.php'; |
|
209 | 209 | $block['seo_top_alltopics'] = !empty($newbbConfig['do_rewrite']) ? seo_urls($seo_top_allforums) : $seo_top_allforums; |
210 | - $seo_top_allforums = XOOPS_URL . '/' . SEO_MODULE_NAME . '/viewpost.php'; |
|
210 | + $seo_top_allforums = XOOPS_URL.'/'.SEO_MODULE_NAME.'/viewpost.php'; |
|
211 | 211 | $block['seo_top_allposts'] = !empty($newbbConfig['do_rewrite']) ? seo_urls($seo_top_allforums) : $seo_top_allforums; |
212 | 212 | // END irmtfan remove hardcoded html in URLs |
213 | - $block['indexNav'] = (int)$options[4]; |
|
213 | + $block['indexNav'] = (int) $options[4]; |
|
214 | 214 | |
215 | 215 | return $block; |
216 | 216 | } |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | function b_newbb_topic_show($options) |
231 | 231 | { |
232 | 232 | global $accessForums; |
233 | - require_once dirname(__DIR__) . '/include/functions.time.php'; |
|
233 | + require_once dirname(__DIR__).'/include/functions.time.php'; |
|
234 | 234 | $myts = \MyTextSanitizer::getInstance(); |
235 | 235 | $block = []; |
236 | 236 | $i = 0; |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | $time_criteria = null; |
240 | 240 | if (!empty($options[2])) { |
241 | 241 | $time_criteria = time() - newbbGetSinceTime($options[2]); |
242 | - $extraCriteria = ' AND t.topic_time>' . $time_criteria; |
|
242 | + $extraCriteria = ' AND t.topic_time>'.$time_criteria; |
|
243 | 243 | } |
244 | 244 | switch ($options[0]) { |
245 | 245 | case 'views': |
@@ -252,11 +252,11 @@ discard block |
||
252 | 252 | $order = 't.digest_time'; |
253 | 253 | $extraCriteria = ' AND t.topic_digest=1'; |
254 | 254 | if (null !== $time_criteria) { |
255 | - $extraCriteria .= ' AND t.digest_time>' . $time_criteria; |
|
255 | + $extraCriteria .= ' AND t.digest_time>'.$time_criteria; |
|
256 | 256 | } |
257 | 257 | break; |
258 | 258 | case 'sticky': |
259 | - $order = 't.topic_id'; |
|
259 | + $order = 't.topic_id'; |
|
260 | 260 | $extraCriteria .= ' AND t.topic_sticky=1'; |
261 | 261 | break; |
262 | 262 | case 'time': |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | return false; |
293 | 293 | } |
294 | 294 | |
295 | - $forumCriteria = ' AND t.forum_id IN (' . implode(',', $allowedForums) . ')'; |
|
295 | + $forumCriteria = ' AND t.forum_id IN ('.implode(',', $allowedForums).')'; |
|
296 | 296 | $approveCriteria = ' AND t.approved = 1'; |
297 | 297 | |
298 | 298 | $query = 'SELECT' |
@@ -332,19 +332,19 @@ discard block |
||
332 | 332 | if (count($rows) < 1) { |
333 | 333 | return $block; |
334 | 334 | } |
335 | - require_once dirname(__DIR__) . '/include/functions.user.php'; |
|
335 | + require_once dirname(__DIR__).'/include/functions.user.php'; |
|
336 | 336 | $author_name = newbbGetUnameFromIds(array_keys($author), $newbbConfig['show_realname'], true); |
337 | 337 | if (count($types) > 0) { |
338 | 338 | /** @var Newbb\TypeHandler $typeHandler */ |
339 | 339 | $typeHandler = Newbb\Helper::getInstance()->getHandler('Type'); |
340 | - $type_list = $typeHandler->getList(new \Criteria('type_id', '(' . implode(', ', array_keys($types)) . ')', 'IN')); |
|
340 | + $type_list = $typeHandler->getList(new \Criteria('type_id', '('.implode(', ', array_keys($types)).')', 'IN')); |
|
341 | 341 | } |
342 | 342 | |
343 | 343 | foreach ($rows as $arr) { |
344 | 344 | // irmtfan remove $topic_page_jump because there is no last post |
345 | 345 | //$topic_page_jump = ''; |
346 | 346 | $topic = []; |
347 | - $topic['topic_subject'] = empty($type_list[$arr['type_id']]) ? '' : '[' . $type_list[$arr['type_id']] . '] '; |
|
347 | + $topic['topic_subject'] = empty($type_list[$arr['type_id']]) ? '' : '['.$type_list[$arr['type_id']].'] '; |
|
348 | 348 | $topic['forum_id'] = $arr['forum_id']; |
349 | 349 | $topic['forum_name'] = $myts->htmlSpecialChars($arr['forum_name']); |
350 | 350 | $topic['id'] = $arr['topic_id']; |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | if (!empty($options[5])) { |
354 | 354 | $title = xoops_substr($title, 0, $options[5]); |
355 | 355 | } |
356 | - $topic['title'] = $topic['topic_subject'] . $title; |
|
356 | + $topic['title'] = $topic['topic_subject'].$title; |
|
357 | 357 | $topic['replies'] = $arr['topic_replies']; |
358 | 358 | $topic['views'] = $arr['topic_views']; |
359 | 359 | $topic['time'] = newbbFormatTimestamp($arr['topic_time']); |
@@ -366,8 +366,8 @@ discard block |
||
366 | 366 | // irmtfan remove $topic_page_jump because there is no last post |
367 | 367 | //$topic['topic_page_jump'] = $topic_page_jump; |
368 | 368 | // START irmtfan remove hardcoded html in URLs - add $seo_topic_url |
369 | - $seo_topic_url = XOOPS_URL . '/' . SEO_MODULE_NAME . '/viewtopic.php?topic_id=' . $topic['id']; |
|
370 | - $seo_forum_url = XOOPS_URL . '/' . SEO_MODULE_NAME . '/viewforum.php?forum=' . $topic['forum_id']; |
|
369 | + $seo_topic_url = XOOPS_URL.'/'.SEO_MODULE_NAME.'/viewtopic.php?topic_id='.$topic['id']; |
|
370 | + $seo_forum_url = XOOPS_URL.'/'.SEO_MODULE_NAME.'/viewforum.php?forum='.$topic['forum_id']; |
|
371 | 371 | |
372 | 372 | if (!empty($newbbConfig['do_rewrite'])) { |
373 | 373 | $topic['seo_topic_url'] = seo_urls($seo_topic_url); |
@@ -381,14 +381,14 @@ discard block |
||
381 | 381 | unset($topic); |
382 | 382 | } |
383 | 383 | // START irmtfan remove hardcoded html in URLs |
384 | - $seo_top_allforums = XOOPS_URL . '/' . SEO_MODULE_NAME; |
|
384 | + $seo_top_allforums = XOOPS_URL.'/'.SEO_MODULE_NAME; |
|
385 | 385 | $block['seo_top_allforums'] = !empty($newbbConfig['do_rewrite']) ? seo_urls($seo_top_allforums) : $seo_top_allforums; |
386 | - $seo_top_allforums = XOOPS_URL . '/' . SEO_MODULE_NAME . '/list.topic.php'; |
|
386 | + $seo_top_allforums = XOOPS_URL.'/'.SEO_MODULE_NAME.'/list.topic.php'; |
|
387 | 387 | $block['seo_top_alltopics'] = !empty($newbbConfig['do_rewrite']) ? seo_urls($seo_top_allforums) : $seo_top_allforums; |
388 | - $seo_top_allforums = XOOPS_URL . '/' . SEO_MODULE_NAME . '/viewpost.php'; |
|
388 | + $seo_top_allforums = XOOPS_URL.'/'.SEO_MODULE_NAME.'/viewpost.php'; |
|
389 | 389 | $block['seo_top_allposts'] = !empty($newbbConfig['do_rewrite']) ? seo_urls($seo_top_allforums) : $seo_top_allforums; |
390 | 390 | // END irmtfan remove hardcoded html in URLs |
391 | - $block['indexNav'] = (int)$options[4]; |
|
391 | + $block['indexNav'] = (int) $options[4]; |
|
392 | 392 | |
393 | 393 | return $block; |
394 | 394 | } |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | global $accessForums; |
411 | 411 | global $newbbConfig; |
412 | 412 | |
413 | - require_once dirname(__DIR__) . '/include/functions.time.php'; |
|
413 | + require_once dirname(__DIR__).'/include/functions.time.php'; |
|
414 | 414 | $myts = \MyTextSanitizer::getInstance(); |
415 | 415 | $block = []; |
416 | 416 | $i = 0; |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | $time_criteria = null; |
420 | 420 | if (!empty($options[2])) { |
421 | 421 | $time_criteria = time() - newbbGetSinceTime($options[2]); |
422 | - $extraCriteria = ' AND p.post_time>' . $time_criteria; |
|
422 | + $extraCriteria = ' AND p.post_time>'.$time_criteria; |
|
423 | 423 | } |
424 | 424 | |
425 | 425 | switch ($options[0]) { |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | return $block; |
464 | 464 | } |
465 | 465 | |
466 | - $forumCriteria = ' AND p.forum_id IN (' . implode(',', $allowedForums) . ')'; |
|
466 | + $forumCriteria = ' AND p.forum_id IN ('.implode(',', $allowedForums).')'; |
|
467 | 467 | $approveCriteria = ' AND p.approved = 1'; |
468 | 468 | |
469 | 469 | $query = 'SELECT'; |
@@ -471,11 +471,11 @@ discard block |
||
471 | 471 | if ('text' === $options[0]) { |
472 | 472 | $query .= ' pt.dohtml, pt.dosmiley, pt.doxcode, pt.dobr, pt.post_text,'; |
473 | 473 | } |
474 | - $query .= ' f.forum_id, f.forum_name' . ' FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_posts') . ' AS p ' . ' LEFT JOIN ' . $GLOBALS['xoopsDB']->prefix('newbb_forums') . ' AS f ON f.forum_id=p.forum_id'; |
|
474 | + $query .= ' f.forum_id, f.forum_name'.' FROM '.$GLOBALS['xoopsDB']->prefix('newbb_posts').' AS p '.' LEFT JOIN '.$GLOBALS['xoopsDB']->prefix('newbb_forums').' AS f ON f.forum_id=p.forum_id'; |
|
475 | 475 | if ('text' === $options[0]) { |
476 | - $query .= ' LEFT JOIN ' . $GLOBALS['xoopsDB']->prefix('newbb_posts_text') . ' AS pt ON pt.post_id=p.post_id'; |
|
476 | + $query .= ' LEFT JOIN '.$GLOBALS['xoopsDB']->prefix('newbb_posts_text').' AS pt ON pt.post_id=p.post_id'; |
|
477 | 477 | } |
478 | - $query .= ' WHERE 1=1 ' . $forumCriteria . $approveCriteria . $extraCriteria . ' ORDER BY ' . $order . ' DESC'; |
|
478 | + $query .= ' WHERE 1=1 '.$forumCriteria.$approveCriteria.$extraCriteria.' ORDER BY '.$order.' DESC'; |
|
479 | 479 | |
480 | 480 | $result = $GLOBALS['xoopsDB']->query($query, $options[1], 0); |
481 | 481 | if (!$result) { |
@@ -492,15 +492,15 @@ discard block |
||
492 | 492 | if (count($rows) < 1) { |
493 | 493 | return $block; |
494 | 494 | } |
495 | - require_once dirname(__DIR__) . '/include/functions.user.php'; |
|
495 | + require_once dirname(__DIR__).'/include/functions.user.php'; |
|
496 | 496 | $author_name = newbbGetUnameFromIds(array_keys($author), $newbbConfig['show_realname'], true); |
497 | 497 | |
498 | 498 | foreach ($rows as $arr) { |
499 | 499 | //if ($arr['icon'] && is_file($GLOBALS['xoops']->path('images/subject/' . $arr['icon']))) { |
500 | 500 | if (!empty($arr['icon'])) { |
501 | - $last_post_icon = '<img src="' . XOOPS_URL . '/images/subject/' . htmlspecialchars($arr['icon'], ENT_QUOTES | ENT_HTML5) . '" alt="" />'; |
|
501 | + $last_post_icon = '<img src="'.XOOPS_URL.'/images/subject/'.htmlspecialchars($arr['icon'], ENT_QUOTES | ENT_HTML5).'" alt="" />'; |
|
502 | 502 | } else { |
503 | - $last_post_icon = '<img src="' . XOOPS_URL . '/images/subject/icon1.gif" alt="" />'; |
|
503 | + $last_post_icon = '<img src="'.XOOPS_URL.'/images/subject/icon1.gif" alt="" />'; |
|
504 | 504 | } |
505 | 505 | //$topic['jump_post'] = "<a href='" . XOOPS_URL . "/modules/newbb/viewtopic.php?post_id=" . $arr['post_id'] ."#forumpost" . $arr['post_id'] . "'>" . $last_post_icon . '</a>'; |
506 | 506 | $topic = []; |
@@ -530,8 +530,8 @@ discard block |
||
530 | 530 | $topic['post_text'] = $post_text; |
531 | 531 | } |
532 | 532 | // START irmtfan remove hardcoded html in URLs |
533 | - $seo_url = XOOPS_URL . '/' . SEO_MODULE_NAME . '/viewtopic.php?post_id=' . $topic['post_id']; |
|
534 | - $seo_forum_url = XOOPS_URL . '/' . SEO_MODULE_NAME . '/viewforum.php?forum=' . $topic['forum_id']; |
|
533 | + $seo_url = XOOPS_URL.'/'.SEO_MODULE_NAME.'/viewtopic.php?post_id='.$topic['post_id']; |
|
534 | + $seo_forum_url = XOOPS_URL.'/'.SEO_MODULE_NAME.'/viewforum.php?forum='.$topic['forum_id']; |
|
535 | 535 | // END irmtfan remove hardcoded html in URLs |
536 | 536 | if (!empty($newbbConfig['do_rewrite'])) { |
537 | 537 | $topic['seo_url'] = seo_urls($seo_url); |
@@ -545,15 +545,15 @@ discard block |
||
545 | 545 | unset($topic); |
546 | 546 | } |
547 | 547 | // START irmtfan remove hardcoded html in URLs |
548 | - $seo_top_allforums = XOOPS_URL . '/' . SEO_MODULE_NAME; |
|
548 | + $seo_top_allforums = XOOPS_URL.'/'.SEO_MODULE_NAME; |
|
549 | 549 | $block['seo_top_allforums'] = !empty($newbbConfig['do_rewrite']) ? seo_urls($seo_top_allforums) : $seo_top_allforums; |
550 | - $seo_top_allforums = XOOPS_URL . '/' . SEO_MODULE_NAME . '/list.topic.php'; |
|
550 | + $seo_top_allforums = XOOPS_URL.'/'.SEO_MODULE_NAME.'/list.topic.php'; |
|
551 | 551 | $block['seo_top_alltopics'] = !empty($newbbConfig['do_rewrite']) ? seo_urls($seo_top_allforums) : $seo_top_allforums; |
552 | - $seo_top_allforums = XOOPS_URL . '/' . SEO_MODULE_NAME . '/viewpost.php'; |
|
552 | + $seo_top_allforums = XOOPS_URL.'/'.SEO_MODULE_NAME.'/viewpost.php'; |
|
553 | 553 | $block['seo_top_allposts'] = !empty($newbbConfig['do_rewrite']) ? seo_urls($seo_top_allforums) : $seo_top_allforums; |
554 | 554 | // END irmtfan remove hardcoded html in URLs |
555 | 555 | |
556 | - $block['indexNav'] = (int)$options[4]; |
|
556 | + $block['indexNav'] = (int) $options[4]; |
|
557 | 557 | |
558 | 558 | return $block; |
559 | 559 | } |
@@ -582,9 +582,9 @@ discard block |
||
582 | 582 | $extraCriteria = ''; |
583 | 583 | $time_criteria = null; |
584 | 584 | if (!empty($options[2])) { |
585 | - require_once dirname(__DIR__) . '/include/functions.time.php'; |
|
585 | + require_once dirname(__DIR__).'/include/functions.time.php'; |
|
586 | 586 | $time_criteria = time() - newbbGetSinceTime($options[2]); |
587 | - $extraCriteria = ' AND topic_time > ' . $time_criteria; |
|
587 | + $extraCriteria = ' AND topic_time > '.$time_criteria; |
|
588 | 588 | } |
589 | 589 | switch ($options[0]) { |
590 | 590 | case 'topic': |
@@ -592,7 +592,7 @@ discard block |
||
592 | 592 | case 'digest': |
593 | 593 | $extraCriteria = ' AND topic_digest = 1'; |
594 | 594 | if (null !== $time_criteria) { |
595 | - $extraCriteria .= ' AND digest_time > ' . $time_criteria; |
|
595 | + $extraCriteria .= ' AND digest_time > '.$time_criteria; |
|
596 | 596 | } |
597 | 597 | break; |
598 | 598 | case 'sticky': |
@@ -602,7 +602,7 @@ discard block |
||
602 | 602 | default: |
603 | 603 | $type = 'post'; |
604 | 604 | if (null !== $time_criteria) { |
605 | - $extraCriteria = ' AND post_time > ' . $time_criteria; |
|
605 | + $extraCriteria = ' AND post_time > '.$time_criteria; |
|
606 | 606 | } |
607 | 607 | break; |
608 | 608 | } |
@@ -626,17 +626,17 @@ discard block |
||
626 | 626 | } |
627 | 627 | |
628 | 628 | if ('topic' === $type) { |
629 | - $forumCriteria = ' AND forum_id IN (' . implode(',', $allowedForums) . ')'; |
|
629 | + $forumCriteria = ' AND forum_id IN ('.implode(',', $allowedForums).')'; |
|
630 | 630 | $approveCriteria = ' AND approved = 1'; |
631 | 631 | $query = 'SELECT DISTINCT topic_poster AS author, COUNT(*) AS count |
632 | - FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_topics') . ' |
|
633 | - WHERE topic_poster>0 ' . $forumCriteria . $approveCriteria . $extraCriteria . ' GROUP BY topic_poster ORDER BY ' . $order . ' DESC'; |
|
632 | + FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_topics').' |
|
633 | + WHERE topic_poster>0 ' . $forumCriteria.$approveCriteria.$extraCriteria.' GROUP BY topic_poster ORDER BY '.$order.' DESC'; |
|
634 | 634 | } else { |
635 | - $forumCriteria = ' AND forum_id IN (' . implode(',', $allowedForums) . ')'; |
|
635 | + $forumCriteria = ' AND forum_id IN ('.implode(',', $allowedForums).')'; |
|
636 | 636 | $approveCriteria = ' AND approved = 1'; |
637 | 637 | $query = 'SELECT DISTINCT uid AS author, COUNT(*) AS count |
638 | - FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_posts') . ' |
|
639 | - WHERE uid > 0 ' . $forumCriteria . $approveCriteria . $extraCriteria . ' GROUP BY uid ORDER BY ' . $order . ' DESC'; |
|
638 | + FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_posts').' |
|
639 | + WHERE uid > 0 ' . $forumCriteria.$approveCriteria.$extraCriteria.' GROUP BY uid ORDER BY '.$order.' DESC'; |
|
640 | 640 | } |
641 | 641 | |
642 | 642 | $result = $GLOBALS['xoopsDB']->query($query, $options[1], 0); |
@@ -651,14 +651,14 @@ discard block |
||
651 | 651 | if (count($author) < 1) { |
652 | 652 | return $block; |
653 | 653 | } |
654 | - require_once dirname(__DIR__) . '/include/functions.user.php'; |
|
654 | + require_once dirname(__DIR__).'/include/functions.user.php'; |
|
655 | 655 | $author_name = newbbGetUnameFromIds(array_keys($author), $newbbConfig['show_realname']); |
656 | 656 | foreach (array_keys($author) as $uid) { |
657 | 657 | $author[$uid]['name'] = $myts->htmlSpecialChars($author_name[$uid]); |
658 | 658 | } |
659 | - $block['authors'] =& $author; |
|
659 | + $block['authors'] = & $author; |
|
660 | 660 | $block['disp_mode'] = $options[3]; // 0 - full view; 1 - lite view; |
661 | - $block['indexNav'] = (int)$options[4]; |
|
661 | + $block['indexNav'] = (int) $options[4]; |
|
662 | 662 | |
663 | 663 | return $block; |
664 | 664 | } |
@@ -669,45 +669,45 @@ discard block |
||
669 | 669 | */ |
670 | 670 | function b_newbb_edit($options) |
671 | 671 | { |
672 | - require_once dirname(__DIR__) . '/include/functions.forum.php'; |
|
672 | + require_once dirname(__DIR__).'/include/functions.forum.php'; |
|
673 | 673 | |
674 | - $form = _MB_NEWBB_CRITERIA . "<select name='options[0]'>"; |
|
674 | + $form = _MB_NEWBB_CRITERIA."<select name='options[0]'>"; |
|
675 | 675 | $form .= "<option value='time'"; |
676 | 676 | if ('time' === $options[0]) { |
677 | 677 | $form .= " selected='selected' "; |
678 | 678 | } |
679 | - $form .= '>' . _MB_NEWBB_CRITERIA_TIME . '</option>'; |
|
679 | + $form .= '>'._MB_NEWBB_CRITERIA_TIME.'</option>'; |
|
680 | 680 | $form .= '</select>'; |
681 | - $form .= '<br>' . _MB_NEWBB_DISPLAY . "<input type='text' name='options[1]' value='" . $options[1] . "' />"; |
|
682 | - $form .= '<br>' . _MB_NEWBB_TIME . "<input type='text' name='options[2]' value='" . $options[2] . "' />"; |
|
683 | - $form .= '<br> <small>' . _MB_NEWBB_TIME_DESC . '</small>'; |
|
684 | - $form .= '<br>' . _MB_NEWBB_DISPLAYMODE . "<input type='radio' name='options[3]' value='0'"; |
|
681 | + $form .= '<br>'._MB_NEWBB_DISPLAY."<input type='text' name='options[1]' value='".$options[1]."' />"; |
|
682 | + $form .= '<br>'._MB_NEWBB_TIME."<input type='text' name='options[2]' value='".$options[2]."' />"; |
|
683 | + $form .= '<br> <small>'._MB_NEWBB_TIME_DESC.'</small>'; |
|
684 | + $form .= '<br>'._MB_NEWBB_DISPLAYMODE."<input type='radio' name='options[3]' value='0'"; |
|
685 | 685 | if (0 == $options[3]) { |
686 | 686 | $form .= ' checked'; |
687 | 687 | } |
688 | - $form .= ' /> ' . _MB_NEWBB_DISPLAYMODE_FULL . "<input type='radio' name='options[3]' value='1'"; |
|
688 | + $form .= ' /> '._MB_NEWBB_DISPLAYMODE_FULL."<input type='radio' name='options[3]' value='1'"; |
|
689 | 689 | if (1 == $options[3]) { |
690 | 690 | $form .= ' checked'; |
691 | 691 | } |
692 | - $form .= ' /> ' . _MB_NEWBB_DISPLAYMODE_COMPACT . "<input type='radio' name='options[3]' value='2'"; |
|
692 | + $form .= ' /> '._MB_NEWBB_DISPLAYMODE_COMPACT."<input type='radio' name='options[3]' value='2'"; |
|
693 | 693 | if (2 == $options[3]) { |
694 | 694 | $form .= ' checked'; |
695 | 695 | } |
696 | - $form .= ' /> ' . _MB_NEWBB_DISPLAYMODE_LITE; |
|
696 | + $form .= ' /> '._MB_NEWBB_DISPLAYMODE_LITE; |
|
697 | 697 | |
698 | - $form .= '<br>' . _MB_NEWBB_INDEXNAV . '<input type="radio" name="options[4]" value="1"'; |
|
698 | + $form .= '<br>'._MB_NEWBB_INDEXNAV.'<input type="radio" name="options[4]" value="1"'; |
|
699 | 699 | if (1 == $options[4]) { |
700 | 700 | $form .= ' checked'; |
701 | 701 | } |
702 | - $form .= ' />' . _YES . '<input type="radio" name="options[4]" value="0"'; |
|
702 | + $form .= ' />'._YES.'<input type="radio" name="options[4]" value="0"'; |
|
703 | 703 | if (0 == $options[4]) { |
704 | 704 | $form .= ' checked'; |
705 | 705 | } |
706 | - $form .= ' />' . _NO; |
|
706 | + $form .= ' />'._NO; |
|
707 | 707 | |
708 | - $form .= '<br>' . _MB_NEWBB_TITLE_LENGTH . "<input type='text' name='options[5]' value='" . $options[5] . "' />"; |
|
708 | + $form .= '<br>'._MB_NEWBB_TITLE_LENGTH."<input type='text' name='options[5]' value='".$options[5]."' />"; |
|
709 | 709 | |
710 | - $form .= '<br><br>' . _MB_NEWBB_FORUMLIST; |
|
710 | + $form .= '<br><br>'._MB_NEWBB_FORUMLIST; |
|
711 | 711 | |
712 | 712 | $optionsForum = array_filter(array_slice($options, 6), 'b_newbb_array_filter'); // get allowed forums |
713 | 713 | $isAll = (0 === count($optionsForum) || empty($optionsForum[0])); |
@@ -716,7 +716,7 @@ discard block |
||
716 | 716 | if ($isAll) { |
717 | 717 | $form .= ' selected'; |
718 | 718 | } |
719 | - $form .= '>' . _ALL . '</option>'; |
|
719 | + $form .= '>'._ALL.'</option>'; |
|
720 | 720 | $form .= newbbForumSelectBox($optionsForum); |
721 | 721 | $form .= '</select><br>'; |
722 | 722 | |
@@ -729,64 +729,64 @@ discard block |
||
729 | 729 | */ |
730 | 730 | function b_newbb_topic_edit($options) |
731 | 731 | { |
732 | - require_once dirname(__DIR__) . '/include/functions.forum.php'; |
|
733 | - $form = _MB_NEWBB_CRITERIA . "<select name='options[0]'>"; |
|
732 | + require_once dirname(__DIR__).'/include/functions.forum.php'; |
|
733 | + $form = _MB_NEWBB_CRITERIA."<select name='options[0]'>"; |
|
734 | 734 | $form .= "<option value='time'"; |
735 | 735 | if ('time' === $options[0]) { |
736 | 736 | $form .= " selected='selected' "; |
737 | 737 | } |
738 | - $form .= '>' . _MB_NEWBB_CRITERIA_TIME . '</option>'; |
|
738 | + $form .= '>'._MB_NEWBB_CRITERIA_TIME.'</option>'; |
|
739 | 739 | $form .= "<option value='views'"; |
740 | 740 | if ('views' === $options[0]) { |
741 | 741 | $form .= " selected='selected' "; |
742 | 742 | } |
743 | - $form .= '>' . _MB_NEWBB_CRITERIA_VIEWS . '</option>'; |
|
743 | + $form .= '>'._MB_NEWBB_CRITERIA_VIEWS.'</option>'; |
|
744 | 744 | $form .= "<option value='replies'"; |
745 | 745 | if ('replies' === $options[0]) { |
746 | 746 | $form .= " selected='selected' "; |
747 | 747 | } |
748 | - $form .= '>' . _MB_NEWBB_CRITERIA_REPLIES . '</option>'; |
|
748 | + $form .= '>'._MB_NEWBB_CRITERIA_REPLIES.'</option>'; |
|
749 | 749 | $form .= "<option value='digest'"; |
750 | 750 | if ('digest' === $options[0]) { |
751 | 751 | $form .= " selected='selected' "; |
752 | 752 | } |
753 | - $form .= '>' . _MB_NEWBB_CRITERIA_DIGEST . '</option>'; |
|
753 | + $form .= '>'._MB_NEWBB_CRITERIA_DIGEST.'</option>'; |
|
754 | 754 | $form .= "<option value='sticky'"; |
755 | 755 | if ('sticky' === $options[0]) { |
756 | 756 | $form .= " selected='selected' "; |
757 | 757 | } |
758 | - $form .= '>' . _MB_NEWBB_CRITERIA_STICKY . '</option>'; |
|
758 | + $form .= '>'._MB_NEWBB_CRITERIA_STICKY.'</option>'; |
|
759 | 759 | $form .= '</select>'; |
760 | - $form .= '<br>' . _MB_NEWBB_DISPLAY . "<input type='text' name='options[1]' value='" . $options[1] . "' />"; |
|
761 | - $form .= '<br>' . _MB_NEWBB_TIME . "<input type='text' name='options[2]' value='" . $options[2] . "' />"; |
|
762 | - $form .= '<br> <small>' . _MB_NEWBB_TIME_DESC . '</small>'; |
|
763 | - $form .= '<br>' . _MB_NEWBB_DISPLAYMODE . "<input type='radio' name='options[3]' value='0'"; |
|
760 | + $form .= '<br>'._MB_NEWBB_DISPLAY."<input type='text' name='options[1]' value='".$options[1]."' />"; |
|
761 | + $form .= '<br>'._MB_NEWBB_TIME."<input type='text' name='options[2]' value='".$options[2]."' />"; |
|
762 | + $form .= '<br> <small>'._MB_NEWBB_TIME_DESC.'</small>'; |
|
763 | + $form .= '<br>'._MB_NEWBB_DISPLAYMODE."<input type='radio' name='options[3]' value='0'"; |
|
764 | 764 | if (0 == $options[3]) { |
765 | 765 | $form .= ' checked'; |
766 | 766 | } |
767 | - $form .= ' /> ' . _MB_NEWBB_DISPLAYMODE_FULL . "<input type='radio' name='options[3]' value='1'"; |
|
767 | + $form .= ' /> '._MB_NEWBB_DISPLAYMODE_FULL."<input type='radio' name='options[3]' value='1'"; |
|
768 | 768 | if (1 == $options[3]) { |
769 | 769 | $form .= ' checked'; |
770 | 770 | } |
771 | - $form .= ' /> ' . _MB_NEWBB_DISPLAYMODE_COMPACT . "<input type='radio' name='options[3]' value='2'"; |
|
771 | + $form .= ' /> '._MB_NEWBB_DISPLAYMODE_COMPACT."<input type='radio' name='options[3]' value='2'"; |
|
772 | 772 | if (2 == $options[3]) { |
773 | 773 | $form .= ' checked'; |
774 | 774 | } |
775 | - $form .= ' /> ' . _MB_NEWBB_DISPLAYMODE_LITE; |
|
775 | + $form .= ' /> '._MB_NEWBB_DISPLAYMODE_LITE; |
|
776 | 776 | |
777 | - $form .= '<br>' . _MB_NEWBB_INDEXNAV . '<input type="radio" name="options[4]" value="1"'; |
|
777 | + $form .= '<br>'._MB_NEWBB_INDEXNAV.'<input type="radio" name="options[4]" value="1"'; |
|
778 | 778 | if (1 == $options[4]) { |
779 | 779 | $form .= ' checked'; |
780 | 780 | } |
781 | - $form .= ' />' . _YES . '<input type="radio" name="options[4]" value="0"'; |
|
781 | + $form .= ' />'._YES.'<input type="radio" name="options[4]" value="0"'; |
|
782 | 782 | if (0 == $options[4]) { |
783 | 783 | $form .= ' checked'; |
784 | 784 | } |
785 | - $form .= ' />' . _NO; |
|
785 | + $form .= ' />'._NO; |
|
786 | 786 | |
787 | - $form .= '<br>' . _MB_NEWBB_TITLE_LENGTH . "<input type='text' name='options[5]' value='" . $options[5] . "' />"; |
|
787 | + $form .= '<br>'._MB_NEWBB_TITLE_LENGTH."<input type='text' name='options[5]' value='".$options[5]."' />"; |
|
788 | 788 | |
789 | - $form .= '<br><br>' . _MB_NEWBB_FORUMLIST; |
|
789 | + $form .= '<br><br>'._MB_NEWBB_FORUMLIST; |
|
790 | 790 | |
791 | 791 | $optionsForum = array_filter(array_slice($options, 6), 'b_newbb_array_filter'); // get allowed forums |
792 | 792 | |
@@ -796,7 +796,7 @@ discard block |
||
796 | 796 | if ($isAll) { |
797 | 797 | $form .= ' selected="selected"'; |
798 | 798 | } |
799 | - $form .= '>' . _ALL . '</option>'; |
|
799 | + $form .= '>'._ALL.'</option>'; |
|
800 | 800 | $form .= newbbForumSelectBox($optionsForum); |
801 | 801 | $form .= '</select><br>'; |
802 | 802 | |
@@ -809,49 +809,49 @@ discard block |
||
809 | 809 | */ |
810 | 810 | function b_newbb_post_edit($options) |
811 | 811 | { |
812 | - require_once dirname(__DIR__) . '/include/functions.forum.php'; |
|
813 | - $form = _MB_NEWBB_CRITERIA . "<select name='options[0]'>"; |
|
812 | + require_once dirname(__DIR__).'/include/functions.forum.php'; |
|
813 | + $form = _MB_NEWBB_CRITERIA."<select name='options[0]'>"; |
|
814 | 814 | $form .= "<option value='title'"; |
815 | 815 | if ('title' === $options[0]) { |
816 | 816 | $form .= " selected='selected' "; |
817 | 817 | } |
818 | - $form .= '>' . _MB_NEWBB_CRITERIA_TITLE . '</option>'; |
|
818 | + $form .= '>'._MB_NEWBB_CRITERIA_TITLE.'</option>'; |
|
819 | 819 | $form .= "<option value='text'"; |
820 | 820 | if ('text' === $options[0]) { |
821 | 821 | $form .= " selected='selected' "; |
822 | 822 | } |
823 | - $form .= '>' . _MB_NEWBB_CRITERIA_TEXT . '</option>'; |
|
823 | + $form .= '>'._MB_NEWBB_CRITERIA_TEXT.'</option>'; |
|
824 | 824 | $form .= '</select>'; |
825 | - $form .= '<br>' . _MB_NEWBB_DISPLAY . "<input type='text' name='options[1]' value='" . $options[1] . "' />"; |
|
826 | - $form .= '<br>' . _MB_NEWBB_TIME . "<input type='text' name='options[2]' value='" . $options[2] . "' />"; |
|
827 | - $form .= '<br> <small>' . _MB_NEWBB_TIME_DESC . '</small>'; |
|
828 | - $form .= '<br>' . _MB_NEWBB_DISPLAYMODE . "<input type='radio' name='options[3]' value='0'"; |
|
825 | + $form .= '<br>'._MB_NEWBB_DISPLAY."<input type='text' name='options[1]' value='".$options[1]."' />"; |
|
826 | + $form .= '<br>'._MB_NEWBB_TIME."<input type='text' name='options[2]' value='".$options[2]."' />"; |
|
827 | + $form .= '<br> <small>'._MB_NEWBB_TIME_DESC.'</small>'; |
|
828 | + $form .= '<br>'._MB_NEWBB_DISPLAYMODE."<input type='radio' name='options[3]' value='0'"; |
|
829 | 829 | if (0 == $options[3]) { |
830 | 830 | $form .= ' checked'; |
831 | 831 | } |
832 | - $form .= ' /> ' . _MB_NEWBB_DISPLAYMODE_FULL . "<input type='radio' name='options[3]' value='1'"; |
|
832 | + $form .= ' /> '._MB_NEWBB_DISPLAYMODE_FULL."<input type='radio' name='options[3]' value='1'"; |
|
833 | 833 | if (1 == $options[3]) { |
834 | 834 | $form .= ' checked'; |
835 | 835 | } |
836 | - $form .= ' /> ' . _MB_NEWBB_DISPLAYMODE_COMPACT . "<input type='radio' name='options[3]' value='2'"; |
|
836 | + $form .= ' /> '._MB_NEWBB_DISPLAYMODE_COMPACT."<input type='radio' name='options[3]' value='2'"; |
|
837 | 837 | if (2 == $options[3]) { |
838 | 838 | $form .= ' checked'; |
839 | 839 | } |
840 | - $form .= ' /> ' . _MB_NEWBB_DISPLAYMODE_LITE; |
|
840 | + $form .= ' /> '._MB_NEWBB_DISPLAYMODE_LITE; |
|
841 | 841 | |
842 | - $form .= '<br>' . _MB_NEWBB_INDEXNAV . '<input type="radio" name="options[4]" value="1"'; |
|
842 | + $form .= '<br>'._MB_NEWBB_INDEXNAV.'<input type="radio" name="options[4]" value="1"'; |
|
843 | 843 | if (1 == $options[4]) { |
844 | 844 | $form .= ' checked'; |
845 | 845 | } |
846 | - $form .= ' />' . _YES . '<input type="radio" name="options[4]" value="0"'; |
|
846 | + $form .= ' />'._YES.'<input type="radio" name="options[4]" value="0"'; |
|
847 | 847 | if (0 == $options[4]) { |
848 | 848 | $form .= ' checked'; |
849 | 849 | } |
850 | - $form .= ' />' . _NO; |
|
850 | + $form .= ' />'._NO; |
|
851 | 851 | |
852 | - $form .= '<br>' . _MB_NEWBB_TITLE_LENGTH . "<input type='text' name='options[5]' value='" . $options[5] . "' />"; |
|
852 | + $form .= '<br>'._MB_NEWBB_TITLE_LENGTH."<input type='text' name='options[5]' value='".$options[5]."' />"; |
|
853 | 853 | |
854 | - $form .= '<br><br>' . _MB_NEWBB_FORUMLIST; |
|
854 | + $form .= '<br><br>'._MB_NEWBB_FORUMLIST; |
|
855 | 855 | |
856 | 856 | $optionsForum = array_filter(array_slice($options, 6), 'b_newbb_array_filter'); // get allowed forums |
857 | 857 | $isAll = (0 === count($optionsForum) || empty($optionsForum[0])); |
@@ -860,7 +860,7 @@ discard block |
||
860 | 860 | if ($isAll) { |
861 | 861 | $form .= ' selected="selected"'; |
862 | 862 | } |
863 | - $form .= '>' . _ALL . '</option>'; |
|
863 | + $form .= '>'._ALL.'</option>'; |
|
864 | 864 | $form .= newbbForumSelectBox($optionsForum); |
865 | 865 | $form .= '</select><br>'; |
866 | 866 | |
@@ -873,53 +873,53 @@ discard block |
||
873 | 873 | */ |
874 | 874 | function b_newbb_author_edit($options) |
875 | 875 | { |
876 | - require_once dirname(__DIR__) . '/include/functions.forum.php'; |
|
877 | - $form = _MB_NEWBB_CRITERIA . "<select name='options[0]'>"; |
|
876 | + require_once dirname(__DIR__).'/include/functions.forum.php'; |
|
877 | + $form = _MB_NEWBB_CRITERIA."<select name='options[0]'>"; |
|
878 | 878 | $form .= "<option value='post'"; |
879 | 879 | if ('post' === $options[0]) { |
880 | 880 | $form .= " selected='selected' "; |
881 | 881 | } |
882 | - $form .= '>' . _MB_NEWBB_CRITERIA_POST . '</option>'; |
|
882 | + $form .= '>'._MB_NEWBB_CRITERIA_POST.'</option>'; |
|
883 | 883 | $form .= "<option value='topic'"; |
884 | 884 | if ('topic' === $options[0]) { |
885 | 885 | $form .= " selected='selected' "; |
886 | 886 | } |
887 | - $form .= '>' . _MB_NEWBB_CRITERIA_TOPIC . '</option>'; |
|
887 | + $form .= '>'._MB_NEWBB_CRITERIA_TOPIC.'</option>'; |
|
888 | 888 | $form .= "<option value='digest'"; |
889 | 889 | if ('digest' === $options[0]) { |
890 | 890 | $form .= " selected='selected' "; |
891 | 891 | } |
892 | - $form .= '>' . _MB_NEWBB_CRITERIA_DIGESTS . '</option>'; |
|
892 | + $form .= '>'._MB_NEWBB_CRITERIA_DIGESTS.'</option>'; |
|
893 | 893 | $form .= "<option value='sticky'"; |
894 | 894 | if ('sticky' === $options[0]) { |
895 | 895 | $form .= " selected='selected' "; |
896 | 896 | } |
897 | - $form .= '>' . _MB_NEWBB_CRITERIA_STICKYS . '</option>'; |
|
897 | + $form .= '>'._MB_NEWBB_CRITERIA_STICKYS.'</option>'; |
|
898 | 898 | $form .= '</select>'; |
899 | - $form .= '<br>' . _MB_NEWBB_DISPLAY . "<input type='text' name='options[1]' value='" . $options[1] . "' />"; |
|
900 | - $form .= '<br>' . _MB_NEWBB_TIME . "<input type='text' name='options[2]' value='" . $options[2] . "' />"; |
|
901 | - $form .= '<br> <small>' . _MB_NEWBB_TIME_DESC . '</small>'; |
|
902 | - $form .= '<br>' . _MB_NEWBB_DISPLAYMODE . "<input type='radio' name='options[3]' value='0'"; |
|
899 | + $form .= '<br>'._MB_NEWBB_DISPLAY."<input type='text' name='options[1]' value='".$options[1]."' />"; |
|
900 | + $form .= '<br>'._MB_NEWBB_TIME."<input type='text' name='options[2]' value='".$options[2]."' />"; |
|
901 | + $form .= '<br> <small>'._MB_NEWBB_TIME_DESC.'</small>'; |
|
902 | + $form .= '<br>'._MB_NEWBB_DISPLAYMODE."<input type='radio' name='options[3]' value='0'"; |
|
903 | 903 | if (0 == $options[3]) { |
904 | 904 | $form .= ' checked'; |
905 | 905 | } |
906 | - $form .= ' /> ' . _MB_NEWBB_DISPLAYMODE_COMPACT . "<input type='radio' name='options[3]' value='1'"; |
|
906 | + $form .= ' /> '._MB_NEWBB_DISPLAYMODE_COMPACT."<input type='radio' name='options[3]' value='1'"; |
|
907 | 907 | if (1 == $options[3]) { |
908 | 908 | $form .= ' checked'; |
909 | 909 | } |
910 | - $form .= ' /> ' . _MB_NEWBB_DISPLAYMODE_LITE; |
|
910 | + $form .= ' /> '._MB_NEWBB_DISPLAYMODE_LITE; |
|
911 | 911 | |
912 | - $form .= '<br>' . _MB_NEWBB_INDEXNAV . '<input type="radio" name="options[4]" value="1"'; |
|
912 | + $form .= '<br>'._MB_NEWBB_INDEXNAV.'<input type="radio" name="options[4]" value="1"'; |
|
913 | 913 | if (1 == $options[4]) { |
914 | 914 | $form .= ' checked'; |
915 | 915 | } |
916 | - $form .= ' />' . _YES . '<input type="radio" name="options[4]" value="0"'; |
|
916 | + $form .= ' />'._YES.'<input type="radio" name="options[4]" value="0"'; |
|
917 | 917 | if (0 == $options[4]) { |
918 | 918 | $form .= ' checked'; |
919 | 919 | } |
920 | - $form .= ' />' . _NO; |
|
920 | + $form .= ' />'._NO; |
|
921 | 921 | |
922 | - $form .= '<br><br>' . _MB_NEWBB_FORUMLIST; |
|
922 | + $form .= '<br><br>'._MB_NEWBB_FORUMLIST; |
|
923 | 923 | |
924 | 924 | $optionsForum = array_filter(array_slice($options, 5), 'b_newbb_array_filter'); // get allowed forums |
925 | 925 | $isAll = (0 === count($optionsForum) || empty($optionsForum[0])); |
@@ -928,7 +928,7 @@ discard block |
||
928 | 928 | if ($isAll) { |
929 | 929 | $form .= ' selected="selected"'; |
930 | 930 | } |
931 | - $form .= '>' . _ALL . '</option>'; |
|
931 | + $form .= '>'._ALL.'</option>'; |
|
932 | 932 | $form .= newbbForumSelectBox($optionsForum); |
933 | 933 | $form .= '</select><br>'; |
934 | 934 | |
@@ -942,8 +942,8 @@ discard block |
||
942 | 942 | function b_newbb_custom($options) |
943 | 943 | { |
944 | 944 | // if no newbb module block set, we have to include the language file |
945 | - if (is_readable($GLOBALS['xoops']->path('modules/newbb/language/' . $GLOBALS['xoopsConfig']['language'] . '/blocks.php'))) { |
|
946 | - require_once $GLOBALS['xoops']->path('modules/newbb/language/' . $GLOBALS['xoopsConfig']['language'] . '/blocks.php'); |
|
945 | + if (is_readable($GLOBALS['xoops']->path('modules/newbb/language/'.$GLOBALS['xoopsConfig']['language'].'/blocks.php'))) { |
|
946 | + require_once $GLOBALS['xoops']->path('modules/newbb/language/'.$GLOBALS['xoopsConfig']['language'].'/blocks.php'); |
|
947 | 947 | } else { |
948 | 948 | require_once $GLOBALS['xoops']->path('modules/newbb/language/english/blocks.php'); |
949 | 949 | } |
@@ -50,46 +50,46 @@ |
||
50 | 50 | |
51 | 51 | return $item; |
52 | 52 | } |
53 | - $item_id = (int)$item_id; |
|
53 | + $item_id = (int) $item_id; |
|
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 @@ discard block |
||
13 | 13 | |
14 | 14 | // defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
15 | 15 | |
16 | -defined('NEWBB_FUNCTIONS_INI') || require_once __DIR__ . '/functions.ini.php'; |
|
16 | +defined('NEWBB_FUNCTIONS_INI') || require_once __DIR__.'/functions.ini.php'; |
|
17 | 17 | define('NEWBB_FUNCTIONS_SESSION_LOADED', true); |
18 | 18 | |
19 | 19 | if (!defined('NEWBB_FUNCTIONS_SESSION')) { |
@@ -34,11 +34,11 @@ discard block |
||
34 | 34 | if (is_array($string)) { |
35 | 35 | $value = []; |
36 | 36 | foreach ($string as $key => $val) { |
37 | - $value[] = $key . '|' . $val; |
|
37 | + $value[] = $key.'|'.$val; |
|
38 | 38 | } |
39 | 39 | $string = implode(',', $value); |
40 | 40 | } |
41 | - $_SESSION['newbb_' . $name] = $string; |
|
41 | + $_SESSION['newbb_'.$name] = $string; |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | */ |
49 | 49 | function newbbGetSession($name, $isArray = false) |
50 | 50 | { |
51 | - $value = !empty($_SESSION['newbb_' . $name]) ? $_SESSION['newbb_' . $name] : false; |
|
51 | + $value = !empty($_SESSION['newbb_'.$name]) ? $_SESSION['newbb_'.$name] : false; |
|
52 | 52 | if ($isArray) { |
53 | 53 | $_value = $value ? explode(',', $value) : []; |
54 | 54 | $value = []; |
@@ -76,11 +76,11 @@ discard block |
||
76 | 76 | if (is_array($string)) { |
77 | 77 | $value = []; |
78 | 78 | foreach ($string as $key => $val) { |
79 | - $value[] = $key . '|' . $val; |
|
79 | + $value[] = $key.'|'.$val; |
|
80 | 80 | } |
81 | 81 | $string = implode(',', $value); |
82 | 82 | } |
83 | - setcookie($forumCookie['prefix'] . $name, $string, (int)$expire, $forumCookie['path'], $forumCookie['domain'], $forumCookie['secure']); |
|
83 | + setcookie($forumCookie['prefix'].$name, $string, (int) $expire, $forumCookie['path'], $forumCookie['domain'], $forumCookie['secure']); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | /** |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | { |
93 | 93 | global $forumCookie; |
94 | 94 | // $value = !empty($_COOKIE[$forumCookie['prefix'] . $name]) ? $_COOKIE[$forumCookie['prefix'] . $name] : null; |
95 | - $value = Request::getString($forumCookie['prefix'] . $name, null, 'COOKIE'); |
|
95 | + $value = Request::getString($forumCookie['prefix'].$name, null, 'COOKIE'); |
|
96 | 96 | |
97 | 97 | if ($isArray) { |
98 | 98 | $_value = $value ? explode(',', $value) : []; |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $moduleHandler = xoops_getHandler('module'); |
43 | 43 | if ($mod = @$moduleHandler->getByDirname('profile', true)) { |
44 | 44 | $grouppermHandler = xoops_getHandler('groupperm'); |
45 | - $groups = [XOOPS_GROUP_ANONYMOUS, XOOPS_GROUP_USERS]; |
|
45 | + $groups = [XOOPS_GROUP_ANONYMOUS, XOOPS_GROUP_USERS]; |
|
46 | 46 | |
47 | 47 | if (!defined('_PROFILE_MA_ALLABOUT')) { |
48 | 48 | $mod->loadLanguage(); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | if (!empty($avatar) && 'blank.gif' !== $avatar) { |
70 | 70 | $categories[0]['fields'][] = [ |
71 | 71 | 'title' => _MD_NEWBB_AUTO_CREATE_AVATARS, |
72 | - 'value' => "<img src='" . XOOPS_UPLOAD_URL . '/' . $GLOBALS['xoopsUser']->getVar('user_avatar') . "' alt='" . $GLOBALS['xoopsUser']->getVar('uname') . "' />" |
|
72 | + 'value' => "<img src='".XOOPS_UPLOAD_URL.'/'.$GLOBALS['xoopsUser']->getVar('user_avatar')."' alt='".$GLOBALS['xoopsUser']->getVar('uname')."' />" |
|
73 | 73 | ]; |
74 | 74 | $weights[0][] = 0; |
75 | 75 | } |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | continue; |
93 | 93 | } |
94 | 94 | $categories[$catid]['fields'][] = ['title' => $fields[$i]->getVar('field_title'), 'value' => $value]; |
95 | - $weights[$catid][] = isset($fieldcats[$fields[$i]->getVar('fieldid')]) ? (int)$fieldcats[$fields[$i]->getVar('fieldid')]['field_weight'] : 1; |
|
95 | + $weights[$catid][] = isset($fieldcats[$fields[$i]->getVar('fieldid')]) ? (int) $fieldcats[$fields[$i]->getVar('fieldid')]['field_weight'] : 1; |
|
96 | 96 | } |
97 | 97 | } |
98 | 98 | |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | ksort($categories); |
105 | 105 | } |
106 | 106 | |
107 | -$message = sprintf(_MD_NEWBB_WELCOME_MESSAGE, $GLOBALS['xoopsUser']->getVar('uname')) . "\n\n"; |
|
107 | +$message = sprintf(_MD_NEWBB_WELCOME_MESSAGE, $GLOBALS['xoopsUser']->getVar('uname'))."\n\n"; |
|
108 | 108 | //$message .= _PROFILE . ": <a href='" . XOOPS_URL . '/userinfo.php?uid=' . $GLOBALS['xoopsUser']->getVar('uid') . "'><strong>" . $GLOBALS['xoopsUser']->getVar('uname') . '</strong></a> '; |
109 | 109 | //$message .= " | <a target='_blank' href='".XOOPS_URL . '/pmlite.php?send2=1&to_userid=' . $GLOBALS['xoopsUser']->getVar('uid') . "'>" . _MD_NEWBB_PM . "</a>\n"; |
110 | 110 | $message .= sprintf($GLOBALS['xoopsModuleConfig']['welcome_forum_message']); |
@@ -125,9 +125,9 @@ discard block |
||
125 | 125 | if (!empty($GLOBALS['xoopsModuleConfig']['notification_enabled'])) { |
126 | 126 | $tags = []; |
127 | 127 | $tags['THREAD_NAME'] = $subject; |
128 | - $tags['THREAD_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewtopic.php?post_id=' . $post_id . '&topic_id=' . $postObject->getVar('topic_id') . '&forum=' . $forum_id; |
|
129 | - $tags['POST_URL'] = $tags['THREAD_URL'] . '#forumpost' . $post_id; |
|
130 | - require_once __DIR__ . '/notification.inc.php'; |
|
128 | + $tags['THREAD_URL'] = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/viewtopic.php?post_id='.$post_id.'&topic_id='.$postObject->getVar('topic_id').'&forum='.$forum_id; |
|
129 | + $tags['POST_URL'] = $tags['THREAD_URL'].'#forumpost'.$post_id; |
|
130 | + require_once __DIR__.'/notification.inc.php'; |
|
131 | 131 | $forum_info = newbb_notify_iteminfo('forum', $forum_id); |
132 | 132 | $tags['FORUM_NAME'] = $forum_info['name']; |
133 | 133 | $tags['FORUM_URL'] = $forum_info['url']; |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | |
14 | 14 | // defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
15 | 15 | |
16 | -defined('NEWBB_FUNCTIONS_INI') || require_once __DIR__ . '/functions.ini.php'; |
|
16 | +defined('NEWBB_FUNCTIONS_INI') || require_once __DIR__.'/functions.ini.php'; |
|
17 | 17 | define('NEWBB_FUNCTIONS_STATS_LOADED', true); |
18 | 18 | |
19 | 19 | if (!defined('NEWBB_FUNCTIONS_STATS')) { |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $topicHandler = Newbb\Helper::getInstance()->getHandler('Topic'); |
59 | 59 | $criteria = new \CriteriaCompo(new \Criteria('approved', 0, '>')); |
60 | 60 | if ($forum_id) { |
61 | - $criteria->add(new \Criteria('forum_id', (int)$forum_id)); |
|
61 | + $criteria->add(new \Criteria('forum_id', (int) $forum_id)); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | return $topicHandler->getCount($criteria); |
@@ -81,12 +81,12 @@ discard block |
||
81 | 81 | switch ($type) { |
82 | 82 | case 'forum': |
83 | 83 | if ($id > 0) { |
84 | - $criteria->add(new \Criteria('forum_id', (int)$id)); |
|
84 | + $criteria->add(new \Criteria('forum_id', (int) $id)); |
|
85 | 85 | } |
86 | 86 | break; |
87 | 87 | case 'topic': |
88 | 88 | if ($id > 0) { |
89 | - $criteria->add(new \Criteria('topic_id', (int)$id)); |
|
89 | + $criteria->add(new \Criteria('topic_id', (int) $id)); |
|
90 | 90 | } |
91 | 91 | break; |
92 | 92 | case 'all': |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | */ |
103 | 103 | function getTotalViews() |
104 | 104 | { |
105 | - $sql = 'SELECT sum(topic_views) FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_topics') . ' '; |
|
105 | + $sql = 'SELECT sum(topic_views) FROM '.$GLOBALS['xoopsDB']->prefix('newbb_topics').' '; |
|
106 | 106 | if (!$result = $GLOBALS['xoopsDB']->query($sql)) { |
107 | 107 | return null; |
108 | 108 | } |
@@ -39,24 +39,24 @@ discard block |
||
39 | 39 | function newbbAttachmentImage($source) |
40 | 40 | { |
41 | 41 | $img_path = $GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments']); |
42 | - $img_url = XOOPS_URL . '/' . $GLOBALS['xoopsModuleConfig']['dir_attachments']; |
|
43 | - $thumb_path = $img_path . '/thumbs'; |
|
44 | - $thumb_url = $img_url . '/thumbs'; |
|
42 | + $img_url = XOOPS_URL.'/'.$GLOBALS['xoopsModuleConfig']['dir_attachments']; |
|
43 | + $thumb_path = $img_path.'/thumbs'; |
|
44 | + $thumb_url = $img_url.'/thumbs'; |
|
45 | 45 | |
46 | - $thumb = $thumb_path . '/' . $source; |
|
47 | - $image = $img_path . '/' . $source; |
|
48 | - $thumb_url = $thumb_url . '/' . $source; |
|
49 | - $image_url = $img_url . '/' . $source; |
|
46 | + $thumb = $thumb_path.'/'.$source; |
|
47 | + $image = $img_path.'/'.$source; |
|
48 | + $thumb_url = $thumb_url.'/'.$source; |
|
49 | + $image_url = $img_url.'/'.$source; |
|
50 | 50 | |
51 | 51 | $imginfo = @getimagesize($image); |
52 | - $img_info = (count($imginfo) > 0) ? $imginfo[0] . 'X' . $imginfo[1] . ' px' : ''; |
|
52 | + $img_info = (count($imginfo) > 0) ? $imginfo[0].'X'.$imginfo[1].' px' : ''; |
|
53 | 53 | |
54 | 54 | if ($GLOBALS['xoopsModuleConfig']['max_image_width'] > 0 |
55 | 55 | && $GLOBALS['xoopsModuleConfig']['max_image_height'] > 0) { |
56 | 56 | if ($imginfo[0] > $GLOBALS['xoopsModuleConfig']['max_image_width'] |
57 | 57 | || $imginfo[1] > $GLOBALS['xoopsModuleConfig']['max_image_height']) { |
58 | 58 | //if (!file_exists($thumb_path.'/'.$source) && $imginfo[0] > $GLOBALS['xoopsModuleConfig']['max_img_width']) { |
59 | - if (!file_exists($thumb_path . '/' . $source)) { |
|
59 | + if (!file_exists($thumb_path.'/'.$source)) { |
|
60 | 60 | newbbCreateThumbnail($source, $GLOBALS['xoopsModuleConfig']['max_image_width']); |
61 | 61 | } |
62 | 62 | } |
@@ -65,28 +65,28 @@ discard block |
||
65 | 65 | || $imginfo[1] > $GLOBALS['xoopsModuleConfig']['max_image_height']) { |
66 | 66 | $pseudo_width = $GLOBALS['xoopsModuleConfig']['max_image_width']; |
67 | 67 | $pseudo_height = $GLOBALS['xoopsModuleConfig']['max_image_width'] * ($imginfo[1] / $imginfo[0]); |
68 | - $pseudo_size = "width='" . $pseudo_width . "px' height='" . $pseudo_height . "px'"; |
|
68 | + $pseudo_size = "width='".$pseudo_width."px' height='".$pseudo_height."px'"; |
|
69 | 69 | } |
70 | 70 | // irmtfan to fix Undefined variable: pseudo_height |
71 | 71 | if (!empty($pseudo_height) && $GLOBALS['xoopsModuleConfig']['max_image_height'] > 0 |
72 | 72 | && $pseudo_height > $GLOBALS['xoopsModuleConfig']['max_image_height']) { |
73 | 73 | $pseudo_height = $GLOBALS['xoopsModuleConfig']['max_image_height']; |
74 | 74 | $pseudo_width = $GLOBALS['xoopsModuleConfig']['max_image_height'] * ($imginfo[0] / $imginfo[1]); |
75 | - $pseudo_size = "width='" . $pseudo_width . "px' height='" . $pseudo_height . "px'"; |
|
75 | + $pseudo_size = "width='".$pseudo_width."px' height='".$pseudo_height."px'"; |
|
76 | 76 | } |
77 | 77 | } |
78 | 78 | |
79 | 79 | if (file_exists($thumb)) { |
80 | - $attachmentImage = '<a href="' . $image_url . '" title="' . $source . ' ' . $img_info . '" target="_blank">'; |
|
80 | + $attachmentImage = '<a href="'.$image_url.'" title="'.$source.' '.$img_info.'" target="_blank">'; |
|
81 | 81 | // $attachmentImage .= '<img src="' . $thumb_url . '" alt="' . $source . ' ' . $img_info . '" />'; |
82 | - $attachmentImage .= '<img src="' . $image_url . '" ' . $pseudo_size . ' alt="' . $source . ' ' . $img_info . '" />'; |
|
82 | + $attachmentImage .= '<img src="'.$image_url.'" '.$pseudo_size.' alt="'.$source.' '.$img_info.'" />'; |
|
83 | 83 | $attachmentImage .= '</a>'; |
84 | 84 | } elseif (!empty($pseudo_size)) { |
85 | - $attachmentImage = '<a href="' . $image_url . '" title="' . $source . ' ' . $img_info . '" target="_blank">'; |
|
86 | - $attachmentImage .= '<img src="' . $image_url . '" ' . $pseudo_size . ' alt="' . $source . ' ' . $img_info . '" />'; |
|
85 | + $attachmentImage = '<a href="'.$image_url.'" title="'.$source.' '.$img_info.'" target="_blank">'; |
|
86 | + $attachmentImage .= '<img src="'.$image_url.'" '.$pseudo_size.' alt="'.$source.' '.$img_info.'" />'; |
|
87 | 87 | $attachmentImage .= '</a>'; |
88 | 88 | } elseif (file_exists($image)) { |
89 | - $attachmentImage = '<img src="' . $image_url . '" alt="' . $source . ' ' . $img_info . '" />'; |
|
89 | + $attachmentImage = '<img src="'.$image_url.'" alt="'.$source.' '.$img_info.'" />'; |
|
90 | 90 | } else { |
91 | 91 | $attachmentImage = ''; |
92 | 92 | } |
@@ -103,9 +103,9 @@ discard block |
||
103 | 103 | { |
104 | 104 | $cmd = ''; |
105 | 105 | $img_path = $GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments']); |
106 | - $thumb_path = $img_path . '/thumbs'; |
|
107 | - $src_file = $img_path . '/' . $source; |
|
108 | - $new_file = $thumb_path . '/' . $source; |
|
106 | + $thumb_path = $img_path.'/thumbs'; |
|
107 | + $src_file = $img_path.'/'.$source; |
|
108 | + $new_file = $thumb_path.'/'.$source; |
|
109 | 109 | //$imageLibs = newbb_getImageLibs(); |
110 | 110 | |
111 | 111 | if (!filesize($src_file) || !is_readable($src_file)) { |
@@ -125,20 +125,20 @@ discard block |
||
125 | 125 | return false; |
126 | 126 | } |
127 | 127 | |
128 | - $newWidth = (int)min($imginfo[0], $thumb_width); |
|
129 | - $newHeight = (int)($imginfo[1] * $newWidth / $imginfo[0]); |
|
128 | + $newWidth = (int) min($imginfo[0], $thumb_width); |
|
129 | + $newHeight = (int) ($imginfo[1] * $newWidth / $imginfo[0]); |
|
130 | 130 | |
131 | 131 | if (1 == $GLOBALS['xoopsModuleConfig']['image_lib'] || 0 == $GLOBALS['xoopsModuleConfig']['image_lib']) { |
132 | 132 | if (preg_match("#[A-Z]:|\\\\#Ai", __FILE__)) { |
133 | 133 | $cur_dir = __DIR__; |
134 | - $src_file_im = '"' . $cur_dir . '\\' . str_replace('/', '\\', $src_file) . '"'; |
|
135 | - $new_file_im = '"' . $cur_dir . '\\' . str_replace('/', '\\', $new_file) . '"'; |
|
134 | + $src_file_im = '"'.$cur_dir.'\\'.str_replace('/', '\\', $src_file).'"'; |
|
135 | + $new_file_im = '"'.$cur_dir.'\\'.str_replace('/', '\\', $new_file).'"'; |
|
136 | 136 | } else { |
137 | 137 | $src_file_im = @escapeshellarg($src_file); |
138 | 138 | $new_file_im = @escapeshellarg($new_file); |
139 | 139 | } |
140 | - $path = empty($GLOBALS['xoopsModuleConfig']['path_magick']) ? '' : $GLOBALS['xoopsModuleConfig']['path_magick'] . '/'; |
|
141 | - $magick_command = $path . 'convert -quality 85 -antialias -sample ' . $newWidth . 'x' . $newHeight . ' ' . $src_file_im . ' +profile "*" ' . str_replace('\\', '/', $new_file_im) . ''; |
|
140 | + $path = empty($GLOBALS['xoopsModuleConfig']['path_magick']) ? '' : $GLOBALS['xoopsModuleConfig']['path_magick'].'/'; |
|
141 | + $magick_command = $path.'convert -quality 85 -antialias -sample '.$newWidth.'x'.$newHeight.' '.$src_file_im.' +profile "*" '.str_replace('\\', '/', $new_file_im).''; |
|
142 | 142 | |
143 | 143 | @passthru($magick_command); |
144 | 144 | if (file_exists($new_file)) { |
@@ -147,13 +147,13 @@ discard block |
||
147 | 147 | } |
148 | 148 | |
149 | 149 | if (2 == $GLOBALS['xoopsModuleConfig']['image_lib'] || 0 == $GLOBALS['xoopsModuleConfig']['image_lib']) { |
150 | - $path = empty($GLOBALS['xoopsModuleConfig']['path_netpbm']) ? '' : $GLOBALS['xoopsModuleConfig']['path_netpbm'] . '/'; |
|
150 | + $path = empty($GLOBALS['xoopsModuleConfig']['path_netpbm']) ? '' : $GLOBALS['xoopsModuleConfig']['path_netpbm'].'/'; |
|
151 | 151 | if (preg_match("/\.png/", $source)) { |
152 | - $cmd = $path . "pngtopnm $src_file | " . $path . "pnmscale -xysize $newWidth $newHeight | " . $path . "pnmtopng > $new_file"; |
|
152 | + $cmd = $path."pngtopnm $src_file | ".$path."pnmscale -xysize $newWidth $newHeight | ".$path."pnmtopng > $new_file"; |
|
153 | 153 | } elseif (preg_match("/\.(jpg|jpeg)/", $source)) { |
154 | - $cmd = $path . "jpegtopnm $src_file | " . $path . "pnmscale -xysize $newWidth $newHeight | " . $path . "ppmtojpeg -quality=90 > $new_file"; |
|
154 | + $cmd = $path."jpegtopnm $src_file | ".$path."pnmscale -xysize $newWidth $newHeight | ".$path."ppmtojpeg -quality=90 > $new_file"; |
|
155 | 155 | } elseif (preg_match("/\.gif/", $source)) { |
156 | - $cmd = $path . "giftopnm $src_file | " . $path . "pnmscale -xysize $newWidth $newHeight | ppmquant 256 | " . $path . "ppmtogif > $new_file"; |
|
156 | + $cmd = $path."giftopnm $src_file | ".$path."pnmscale -xysize $newWidth $newHeight | ppmquant 256 | ".$path."ppmtogif > $new_file"; |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | @exec($cmd, $output, $retval); |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $criteria->setOrder('DESC'); |
43 | 43 | $mod = $moderateHandler->getObjects($criteria, false, false); |
44 | 44 | $tage = ($mod[0]['mod_end'] - $mod[0]['mod_start']) / 60 / 60 / 24; |
45 | - $msg = $myts->displayTarea(sprintf(_MD_NEWBB_SUSPEND_TEXT, newbbGetUnameFromId($moderated_id), (int)$tage, $mod[0]['mod_desc'], formatTimestamp($mod[0]['mod_end'])), 1); |
|
45 | + $msg = $myts->displayTarea(sprintf(_MD_NEWBB_SUSPEND_TEXT, newbbGetUnameFromId($moderated_id), (int) $tage, $mod[0]['mod_desc'], formatTimestamp($mod[0]['mod_end'])), 1); |
|
46 | 46 | xoops_error($msg, _MD_NEWBB_SUSPEND_NOACCESS); |
47 | 47 | require_once $GLOBALS['xoops']->path('footer.php'); |
48 | 48 | exit(); |
@@ -66,9 +66,9 @@ discard block |
||
66 | 66 | if (empty($postParentObject)) { |
67 | 67 | $postParentObject = $postHandler->get($pid); |
68 | 68 | } |
69 | - $form_title = _MD_NEWBB_REPLY . ': <a href="' . XOOPS_URL . "/modules/newbb/viewtopic.php?topic_id={$topic_id}&post_id={$pid}\" rel=\"external\">" . $postParentObject->getVar('subject') . '</a>'; |
|
69 | + $form_title = _MD_NEWBB_REPLY.': <a href="'.XOOPS_URL."/modules/newbb/viewtopic.php?topic_id={$topic_id}&post_id={$pid}\" rel=\"external\">".$postParentObject->getVar('subject').'</a>'; |
|
70 | 70 | } else { |
71 | - $form_title = _EDIT . ': <a href="' . XOOPS_URL . "/modules/newbb/viewtopic.php?post_id={$post_id}\" rel=\"external\">" . $postObject->getVar('subject') . '</a>'; |
|
71 | + $form_title = _EDIT.': <a href="'.XOOPS_URL."/modules/newbb/viewtopic.php?post_id={$post_id}\" rel=\"external\">".$postObject->getVar('subject').'</a>'; |
|
72 | 72 | $editby = true; |
73 | 73 | } |
74 | 74 | $xoopsTpl->assign('form_title', $form_title); |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | |
102 | 102 | //$filname = XOOPS_URL.$_SERVER['REQUEST_URI']; |
103 | 103 | |
104 | -$forum_form = new \XoopsThemeForm(htmlspecialchars(@$form_title, ENT_QUOTES | ENT_HTML5), 'form_post', XOOPS_URL . '/modules/newbb/post.php', 'post', true); |
|
104 | +$forum_form = new \XoopsThemeForm(htmlspecialchars(@$form_title, ENT_QUOTES | ENT_HTML5), 'form_post', XOOPS_URL.'/modules/newbb/post.php', 'post', true); |
|
105 | 105 | $forum_form->setExtra('enctype="multipart/form-data"'); |
106 | 106 | |
107 | 107 | if ($editby) { |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | $icons_radio = new \XoopsFormRadio(_MD_NEWBB_MESSAGEICON, 'icon', $icon); |
144 | 144 | $subject_icons = \XoopsLists::getSubjectsList(); |
145 | 145 | foreach ($subject_icons as $iconfile) { |
146 | - $icons_radio->addOption($iconfile, '<img src="' . XOOPS_URL . '/images/subject/' . $iconfile . '" alt="" />'); |
|
146 | + $icons_radio->addOption($iconfile, '<img src="'.XOOPS_URL.'/images/subject/'.$iconfile.'" alt="" />'); |
|
147 | 147 | } |
148 | 148 | $forum_form->addElement($icons_radio); |
149 | 149 | |
@@ -251,18 +251,18 @@ discard block |
||
251 | 251 | $upload_tray = new \XoopsFormElementTray(_MD_NEWBB_ATTACHMENT); |
252 | 252 | $upload_tray->addElement(new \XoopsFormFile('', 'userfile', $forumObject->getVar('attach_maxkb') * 1024)); |
253 | 253 | $upload_tray->addElement(new \XoopsFormButton('', 'contents_upload', _MD_NEWBB_UPLOAD, 'submit')); |
254 | - $upload_tray->addElement(new \XoopsFormLabel('<br><br>' . _MD_NEWBB_MAX_FILESIZE . ':', $forumObject->getVar('attach_maxkb') . 'Kb; ')); |
|
254 | + $upload_tray->addElement(new \XoopsFormLabel('<br><br>'._MD_NEWBB_MAX_FILESIZE.':', $forumObject->getVar('attach_maxkb').'Kb; ')); |
|
255 | 255 | $extensions = trim(str_replace('|', ' ', $forumObject->getVar('attach_ext'))); |
256 | 256 | $extensions = (empty($extensions) || '*' === $extensions) ? _ALL : $extensions; |
257 | - $upload_tray->addElement(new \XoopsFormLabel(_MD_NEWBB_ALLOWED_EXTENSIONS . ':', $extensions)); |
|
258 | - $upload_tray->addElement(new \XoopsFormLabel('<br>' . sprintf(_MD_NEWBB_MAXPIC, $GLOBALS['xoopsModuleConfig']['max_img_height'], $GLOBALS['xoopsModuleConfig']['max_img_width']))); |
|
257 | + $upload_tray->addElement(new \XoopsFormLabel(_MD_NEWBB_ALLOWED_EXTENSIONS.':', $extensions)); |
|
258 | + $upload_tray->addElement(new \XoopsFormLabel('<br>'.sprintf(_MD_NEWBB_MAXPIC, $GLOBALS['xoopsModuleConfig']['max_img_height'], $GLOBALS['xoopsModuleConfig']['max_img_width']))); |
|
259 | 259 | $forum_form->addElement($upload_tray); |
260 | 260 | } |
261 | 261 | |
262 | 262 | if (!empty($attachments) && is_array($attachments) && count($attachments)) { |
263 | 263 | $delete_attach_checkbox = new \XoopsFormCheckBox(_MD_NEWBB_THIS_FILE_WAS_ATTACHED_TO_THIS_POST, 'delete_attach[]'); |
264 | 264 | foreach ($attachments as $key => $attachment) { |
265 | - $attach = ' ' . _DELETE . ' <a href=' . XOOPS_URL . '/' . $GLOBALS['xoopsModuleConfig']['dir_attachments'] . '/' . $attachment['name_saved'] . ' rel="external">' . $attachment['nameDisplay'] . '</a><br>'; |
|
265 | + $attach = ' '._DELETE.' <a href='.XOOPS_URL.'/'.$GLOBALS['xoopsModuleConfig']['dir_attachments'].'/'.$attachment['name_saved'].' rel="external">'.$attachment['nameDisplay'].'</a><br>'; |
|
266 | 266 | $delete_attach_checkbox->addOption($key, $attach); |
267 | 267 | } |
268 | 268 | $forum_form->addElement($delete_attach_checkbox); |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | $delete_attach_checkbox = new \XoopsFormCheckBox(_MD_NEWBB_REMOVE, 'delete_tmp[]'); |
274 | 274 | $url_prefix = str_replace(XOOPS_ROOT_PATH, XOOPS_URL, XOOPS_CACHE_PATH); |
275 | 275 | foreach ($attachments_tmp as $key => $attachment) { |
276 | - $attach = ' <a href="' . $url_prefix . '/' . $attachment[0] . '" rel="external">' . $attachment[1] . '</a><br>'; |
|
276 | + $attach = ' <a href="'.$url_prefix.'/'.$attachment[0].'" rel="external">'.$attachment[1].'</a><br>'; |
|
277 | 277 | $delete_attach_checkbox->addOption($key, $attach); |
278 | 278 | } |
279 | 279 | $forum_form->addElement($delete_attach_checkbox); |
@@ -292,11 +292,11 @@ discard block |
||
292 | 292 | $karmas = array_map('trim', explode(',', $GLOBALS['xoopsModuleConfig']['karma_options'])); |
293 | 293 | if (count($karmas) > 1) { |
294 | 294 | foreach ($karmas as $karma) { |
295 | - $karma_array[(string)$karma] = (int)$karma; |
|
295 | + $karma_array[(string) $karma] = (int) $karma; |
|
296 | 296 | } |
297 | 297 | $karma_select = new \XoopsFormSelect('', 'post_karma', $post_karma); |
298 | 298 | $karma_select->addOptionArray($karma_array); |
299 | - $radiobox->addOption('require_karma', _MD_NEWBB_REQUIRE_KARMA . $karma_select->render()); |
|
299 | + $radiobox->addOption('require_karma', _MD_NEWBB_REQUIRE_KARMA.$karma_select->render()); |
|
300 | 300 | } |
301 | 301 | } |
302 | 302 | $radiobox->addOption('require_null', _MD_NEWBB_REQUIRE_NULL); |
@@ -327,11 +327,11 @@ discard block |
||
327 | 327 | |
328 | 328 | $cancel_button = new \XoopsFormButton('', 'cancel', _CANCEL, 'button'); |
329 | 329 | if (!empty($topic_id)) { |
330 | - $extra = XOOPS_URL . '/modules/newbb/viewtopic.php?topic_id=' . (int)$topic_id; |
|
330 | + $extra = XOOPS_URL.'/modules/newbb/viewtopic.php?topic_id='.(int) $topic_id; |
|
331 | 331 | } else { |
332 | - $extra = XOOPS_URL . '/modules/newbb/viewforum.php?forum=' . $forumObject->getVar('forum_id'); |
|
332 | + $extra = XOOPS_URL.'/modules/newbb/viewforum.php?forum='.$forumObject->getVar('forum_id'); |
|
333 | 333 | } |
334 | -$cancel_button->setExtra("onclick='location=\"" . $extra . "\"'"); |
|
334 | +$cancel_button->setExtra("onclick='location=\"".$extra."\"'"); |
|
335 | 335 | $cancel_button->setExtra("tabindex='6'"); |
336 | 336 | |
337 | 337 | if (!empty($isreply) && !empty($hidden)) { |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | |
346 | 346 | $preview_button = new \XoopsFormButton('', 'btn_preview', _PREVIEW, 'button'); |
347 | 347 | $preview_button->setExtra("tabindex='5'"); |
348 | -$preview_button->setExtra('onclick="window.document.forms.' . $forum_form->getName() . '.contents_preview.value=1; window.document.forms.' . $forum_form->getName() . '.submit() ;"'); |
|
348 | +$preview_button->setExtra('onclick="window.document.forms.'.$forum_form->getName().'.contents_preview.value=1; window.document.forms.'.$forum_form->getName().'.submit() ;"'); |
|
349 | 349 | $forum_form->addElement(new \XoopsFormHidden('contents_preview', 0)); |
350 | 350 | |
351 | 351 | $button_tray->addElement($preview_button); |