@@ -34,22 +34,22 @@ discard block |
||
34 | 34 | // Project: Article Project // |
35 | 35 | // ------------------------------------------------------------------------ // |
36 | 36 | |
37 | -require_once __DIR__ . '/header.php'; |
|
37 | +require_once __DIR__.'/header.php'; |
|
38 | 38 | xoops_loadLanguage('search'); |
39 | 39 | /** @var \XoopsConfigHandler $configHandler */ |
40 | 40 | $configHandler = xoops_getHandler('config'); |
41 | 41 | $xoopsConfigSearch = $configHandler->getConfigsByCat(XOOPS_CONF_SEARCH); |
42 | 42 | if (1 !== $xoopsConfigSearch['enable_search']) { |
43 | - redirect_header(XOOPS_URL . '/modules/newbb/index.php', 2, _MD_NEWBB_SEARCHDISABLED); |
|
43 | + redirect_header(XOOPS_URL.'/modules/newbb/index.php', 2, _MD_NEWBB_SEARCHDISABLED); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | $GLOBALS['xoopsConfig']['module_cache'][$xoopsModule->getVar('mid')] = 0; |
47 | 47 | $xoopsOption['template_main'] = 'newbb_search.tpl'; |
48 | 48 | require_once $GLOBALS['xoops']->path('header.php'); |
49 | 49 | |
50 | -require_once __DIR__ . '/include/functions.render.php'; |
|
51 | -require_once __DIR__ . '/include/functions.forum.php'; |
|
52 | -require_once __DIR__ . '/include/functions.time.php'; |
|
50 | +require_once __DIR__.'/include/functions.render.php'; |
|
51 | +require_once __DIR__.'/include/functions.forum.php'; |
|
52 | +require_once __DIR__.'/include/functions.time.php'; |
|
53 | 53 | |
54 | 54 | require_once $GLOBALS['xoops']->path('modules/newbb/include/search.inc.php'); |
55 | 55 | $limit = $GLOBALS['xoopsModuleConfig']['topics_per_page']; |
@@ -118,8 +118,8 @@ discard block |
||
118 | 118 | if (!empty($search_username)) { |
119 | 119 | $uname_required = true; |
120 | 120 | $search_username = $GLOBALS['xoopsDB']->escape($search_username); |
121 | - if (!$result = $GLOBALS['xoopsDB']->query('SELECT uid FROM ' . $GLOBALS['xoopsDB']->prefix('users') . " WHERE uname LIKE '%$search_username%'")) { |
|
122 | - redirect_header(XOOPS_URL . '/search.php', 1, _MD_NEWBB_ERROROCCURED); |
|
121 | + if (!$result = $GLOBALS['xoopsDB']->query('SELECT uid FROM '.$GLOBALS['xoopsDB']->prefix('users')." WHERE uname LIKE '%$search_username%'")) { |
|
122 | + redirect_header(XOOPS_URL.'/search.php', 1, _MD_NEWBB_ERROROCCURED); |
|
123 | 123 | } |
124 | 124 | $uid = []; |
125 | 125 | while (false !== ($row = $GLOBALS['xoopsDB']->fetchArray($result))) { |
@@ -144,12 +144,12 @@ discard block |
||
144 | 144 | } |
145 | 145 | } |
146 | 146 | if (!$uname_required && 0 === count($queries)) { |
147 | - redirect_header(XOOPS_URL . '/search.php', 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min'])); |
|
147 | + redirect_header(XOOPS_URL.'/search.php', 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min'])); |
|
148 | 148 | } |
149 | 149 | } else { |
150 | 150 | //$query = trim($query); |
151 | 151 | if (!$uname_required && (strlen($query) < $xoopsConfigSearch['keyword_min'])) { |
152 | - redirect_header(XOOPS_URL . '/search.php', 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min'])); |
|
152 | + redirect_header(XOOPS_URL.'/search.php', 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min'])); |
|
153 | 153 | } |
154 | 154 | $queries = [$query]; |
155 | 155 | } |
@@ -212,14 +212,14 @@ discard block |
||
212 | 212 | if (count($next_search) > 0) { |
213 | 213 | $items = []; |
214 | 214 | foreach ($next_search as $para => $val) { |
215 | - $items[] = "{$para}=" . urlencode($val); |
|
215 | + $items[] = "{$para}=".urlencode($val); |
|
216 | 216 | } |
217 | 217 | if (count($items) > 0) { |
218 | 218 | $paras = implode('&', $items); |
219 | 219 | } |
220 | 220 | unset($next_search, $items); |
221 | 221 | } |
222 | - $search_url = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/search.php?' . $paras; |
|
222 | + $search_url = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/search.php?'.$paras; |
|
223 | 223 | // irmtfan remove to have just one query and appropriate next and prev links |
224 | 224 | //$next_results = newbb_search($queries, $andor, 1, $start + $limit, $uid, $forum, $sortby, $searchin, $subquery); |
225 | 225 | //$next_count = count($next_results); |
@@ -231,15 +231,15 @@ discard block |
||
231 | 231 | if ($num_results == $limit) { |
232 | 232 | $next = $start + $limit; |
233 | 233 | $queries = implode(',', $queries); |
234 | - $search_url_next = htmlspecialchars($search_url . "&direction=next&start={$next}"); |
|
235 | - $search_next = '<a href="' . $search_url_next . '">' . _SR_NEXT . '</a>'; |
|
234 | + $search_url_next = htmlspecialchars($search_url."&direction=next&start={$next}"); |
|
235 | + $search_next = '<a href="'.$search_url_next.'">'._SR_NEXT.'</a>'; |
|
236 | 236 | $xoopsTpl->assign('search_next', $search_next); |
237 | 237 | $xoopsTpl->assign('search_next_url', $search_url_next); |
238 | 238 | } |
239 | 239 | if ($start > 0) { |
240 | 240 | $prev = $start - $limit; |
241 | - $search_url_prev = htmlspecialchars($search_url . "&direction=previous&start={$prev}"); |
|
242 | - $search_prev = '<a href="' . $search_url_prev . '">' . _SR_PREVIOUS . '</a>'; |
|
241 | + $search_url_prev = htmlspecialchars($search_url."&direction=previous&start={$prev}"); |
|
242 | + $search_prev = '<a href="'.$search_url_prev.'">'._SR_PREVIOUS.'</a>'; |
|
243 | 243 | $xoopsTpl->assign('search_prev', $search_prev); |
244 | 244 | $xoopsTpl->assign('search_prev_url', $search_url_prev); |
245 | 245 | } |
@@ -250,18 +250,18 @@ discard block |
||
250 | 250 | redirect_header($search_url_redirect, 1, constant(strtoupper("_SR_{$direction}"))); |
251 | 251 | } |
252 | 252 | } |
253 | - $search_info = _SR_KEYWORDS . ': ' . $search_info_keywords; |
|
253 | + $search_info = _SR_KEYWORDS.': '.$search_info_keywords; |
|
254 | 254 | if ($uname_required) { |
255 | 255 | if ($search_info) { |
256 | 256 | $search_info .= '<br>'; |
257 | 257 | } |
258 | - $search_info .= _MD_NEWBB_USERNAME . ': ' . $myts->htmlSpecialChars($search_username); |
|
258 | + $search_info .= _MD_NEWBB_USERNAME.': '.$myts->htmlSpecialChars($search_username); |
|
259 | 259 | } |
260 | 260 | // add num_results |
261 | - $search_info .= '<br>' . sprintf(_SR_SHOWING, $start + 1, $start + $num_results); |
|
261 | + $search_info .= '<br>'.sprintf(_SR_SHOWING, $start + 1, $start + $num_results); |
|
262 | 262 | // if any result skip show the counter |
263 | 263 | if (!empty($skipresults)) { |
264 | - $search_info .= ' - ' . sprintf(_SR_FOUND, $num_results - $skipresults); |
|
264 | + $search_info .= ' - '.sprintf(_SR_FOUND, $num_results - $skipresults); |
|
265 | 265 | } |
266 | 266 | $xoopsTpl->assign('search_info', $search_info); |
267 | 267 | } |
@@ -275,18 +275,18 @@ discard block |
||
275 | 275 | if ('OR' === $andor) { |
276 | 276 | $andor_select .= ' selected="selected"'; |
277 | 277 | } |
278 | -$andor_select .= '>' . _SR_ANY . '</option>'; |
|
278 | +$andor_select .= '>'._SR_ANY.'</option>'; |
|
279 | 279 | $andor_select .= '<option value="AND"'; |
280 | 280 | if ('AND' === $andor || empty($andor)) { |
281 | 281 | $andor_select .= ' selected="selected"'; |
282 | 282 | } |
283 | -$andor_select .= '>' . _SR_ALL . '</option>'; |
|
283 | +$andor_select .= '>'._SR_ALL.'</option>'; |
|
284 | 284 | $andor_select .= '</select>'; |
285 | 285 | $xoopsTpl->assign('andor_selection_box', $andor_select); |
286 | 286 | |
287 | 287 | /* forum */ |
288 | 288 | $select_forum = '<select class="form-control" name="forum[]" id="forum" size="5" multiple="multiple">'; |
289 | -$select_forum .= '<option value="all">' . _MD_NEWBB_SEARCHALLFORUMS . '</option>'; |
|
289 | +$select_forum .= '<option value="all">'._MD_NEWBB_SEARCHALLFORUMS.'</option>'; |
|
290 | 290 | $select_forum .= newbbForumSelectBox($forum); |
291 | 291 | $select_forum .= '</select>'; |
292 | 292 | $xoopsTpl->assign_by_ref('forum_selection_box', $select_forum); |
@@ -297,17 +297,17 @@ discard block |
||
297 | 297 | if ('title' === $searchin) { |
298 | 298 | $searchin_select .= ' checked'; |
299 | 299 | } |
300 | -$searchin_select .= ' />' . _MD_NEWBB_SUBJECT . ' </label>'; |
|
300 | +$searchin_select .= ' />'._MD_NEWBB_SUBJECT.' </label>'; |
|
301 | 301 | $searchin_select .= '<label class="radio-inline"><input type="radio" name="searchin" value="text"'; |
302 | 302 | if ('text' === $searchin) { |
303 | 303 | $searchin_select .= ' checked'; |
304 | 304 | } |
305 | -$searchin_select .= ' />' . _MD_NEWBB_BODY . ' </label>'; |
|
305 | +$searchin_select .= ' />'._MD_NEWBB_BODY.' </label>'; |
|
306 | 306 | $searchin_select .= '<label class="radio-inline"><input type="radio" name="searchin" value="both"'; |
307 | 307 | if ('both' === $searchin || empty($searchin)) { |
308 | 308 | $searchin_select .= ' checked'; |
309 | 309 | } |
310 | -$searchin_select .= ' />' . _MD_NEWBB_SUBJECT . ' & ' . _MD_NEWBB_BODY . ' </label>'; |
|
310 | +$searchin_select .= ' />'._MD_NEWBB_SUBJECT.' & '._MD_NEWBB_BODY.' </label>'; |
|
311 | 311 | $xoopsTpl->assign('searchin_radio', $searchin_select); |
312 | 312 | |
313 | 313 | /* show_search */ |
@@ -316,12 +316,12 @@ discard block |
||
316 | 316 | if ('post' === $show_search) { |
317 | 317 | $show_search_select .= ' checked'; |
318 | 318 | } |
319 | -$show_search_select .= ' />' . _MD_NEWBB_POSTS . ' </label>'; |
|
319 | +$show_search_select .= ' />'._MD_NEWBB_POSTS.' </label>'; |
|
320 | 320 | $show_search_select .= '<label class="radio-inline"><input type="radio" name="show_search" value="post_text"'; |
321 | 321 | if ('post_text' === $show_search || empty($show_search)) { |
322 | 322 | $show_search_select .= ' checked'; |
323 | 323 | } |
324 | -$show_search_select .= ' />' . _MD_NEWBB_SEARCHPOSTTEXT . ' </label>'; |
|
324 | +$show_search_select .= ' />'._MD_NEWBB_SEARCHPOSTTEXT.' </label>'; |
|
325 | 325 | $xoopsTpl->assign('show_search_radio', $show_search_select); |
326 | 326 | |
327 | 327 | /* author */ |
@@ -333,12 +333,12 @@ discard block |
||
333 | 333 | if ('p.post_time' === $sortby || empty($sortby)) { |
334 | 334 | $sortby_select .= ' selected=\'selected\''; |
335 | 335 | } |
336 | -$sortby_select .= '>' . _MD_NEWBB_DATE . '</option>'; |
|
336 | +$sortby_select .= '>'._MD_NEWBB_DATE.'</option>'; |
|
337 | 337 | $sortby_select .= '<option value=\'p.subject\''; |
338 | 338 | if ('p.subject' === $sortby) { |
339 | 339 | $sortby_select .= ' selected="selected"'; |
340 | 340 | } |
341 | -$sortby_select .= '>' . _MD_NEWBB_TOPIC . '</option>'; |
|
341 | +$sortby_select .= '>'._MD_NEWBB_TOPIC.'</option>'; |
|
342 | 342 | $sortby_select .= '</select>'; |
343 | 343 | $xoopsTpl->assign('sortby_selection_box', $sortby_select); |
344 | 344 | |
@@ -354,5 +354,5 @@ discard block |
||
354 | 354 | $xoopsTpl->assign('search_rule', sprintf(_SR_KEYIGNORE, $xoopsConfigSearch['keyword_min'])); |
355 | 355 | } |
356 | 356 | // irmtfan move to footer.php |
357 | -require_once __DIR__ . '/footer.php'; |
|
357 | +require_once __DIR__.'/footer.php'; |
|
358 | 358 | include $GLOBALS['xoops']->path('footer.php'); |
@@ -32,27 +32,27 @@ discard block |
||
32 | 32 | // URL: https://xoops.org // |
33 | 33 | // Project: Article Project // |
34 | 34 | // ------------------------------------------------------------------------ // |
35 | -require_once __DIR__ . '/header.php'; |
|
35 | +require_once __DIR__.'/header.php'; |
|
36 | 36 | |
37 | 37 | if (Request::getString('submit', '', 'POST')) { |
38 | 38 | foreach (['forum', 'newforum', 'newtopic'] as $getint) { |
39 | - ${$getint} = Request::getInt($getint, 0, 'POST');// (int)(@$_POST[$getint]); |
|
39 | + ${$getint} = Request::getInt($getint, 0, 'POST'); // (int)(@$_POST[$getint]); |
|
40 | 40 | } |
41 | 41 | foreach (['topic_id'] as $getint) { |
42 | - ${$getint} = Request::getInt($getint, 0, 'POST');// (int)(@$_POST[$getint]); |
|
42 | + ${$getint} = Request::getInt($getint, 0, 'POST'); // (int)(@$_POST[$getint]); |
|
43 | 43 | } |
44 | 44 | if (!is_array($topic_id)) { |
45 | 45 | $topic_id = [$topic_id]; |
46 | 46 | } |
47 | 47 | } else { |
48 | 48 | foreach (['forum', 'topic_id'] as $getint) { |
49 | - ${$getint} = Request::getInt($getint, 0, 'GET');// (int)(@$_GET[$getint]); |
|
49 | + ${$getint} = Request::getInt($getint, 0, 'GET'); // (int)(@$_GET[$getint]); |
|
50 | 50 | } |
51 | 51 | } |
52 | 52 | |
53 | 53 | if (empty($topic_id)) { |
54 | 54 | $redirect = empty($forum_id) ? 'index.php' : 'viewforum.php?forum={$forum}'; |
55 | - $redirect = XOOPS_URL . '/modules/newbb/' . $redirect; |
|
55 | + $redirect = XOOPS_URL.'/modules/newbb/'.$redirect; |
|
56 | 56 | redirect_header($redirect, 2, _MD_NEWBB_ERRORTOPIC); |
57 | 57 | } |
58 | 58 | |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | if (is_object($topicObject)) { |
68 | 68 | $forum = $topicObject->getVar('forum_id'); |
69 | 69 | } else { |
70 | - $redirect = XOOPS_URL . '/modules/newbb/viewtopic.php?topic_id=' . $topic_id; |
|
70 | + $redirect = XOOPS_URL.'/modules/newbb/viewtopic.php?topic_id='.$topic_id; |
|
71 | 71 | redirect_header($redirect, 2, _MD_NEWBB_FORUMNOEXIST); |
72 | 72 | } |
73 | 73 | unset($topicObject); |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | $action['unlock']['sql'] = 'topic_status = 0'; |
105 | 105 | $action['unsticky']['sql'] = 'topic_sticky = 0'; |
106 | 106 | $action['undigest']['sql'] = 'topic_digest = 0'; |
107 | -$action['digest']['sql'] = 'topic_digest = 1, digest_time = ' . time(); |
|
107 | +$action['digest']['sql'] = 'topic_digest = 1, digest_time = '.time(); |
|
108 | 108 | |
109 | 109 | // Disable cache |
110 | 110 | $GLOBALS['xoopsConfig']['module_cache'][$xoopsModule->getVar('mid')] = 0; |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | require_once $GLOBALS['xoops']->path('header.php'); |
113 | 113 | |
114 | 114 | if (Request::getString('submit', '', 'POST')) { |
115 | - $mode = Request::getString('mode', '', 'POST');// $_POST['mode']; |
|
115 | + $mode = Request::getString('mode', '', 'POST'); // $_POST['mode']; |
|
116 | 116 | |
117 | 117 | if ('delete' === $mode) { |
118 | 118 | foreach ($topic_id as $tid) { |
@@ -126,11 +126,11 @@ discard block |
||
126 | 126 | //xoops_notification_deletebyitem ($xoopsModule->getVar('mid'), 'thread', $topic_id); |
127 | 127 | } |
128 | 128 | // irmtfan full URL |
129 | - echo $action[$mode]['msg'] . "<p><a href='" . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/viewforum.php?forum=$forum'>" . _MD_NEWBB_RETURNTOTHEFORUM . "</a></p><p><a href='index.php'>" . _MD_NEWBB_RETURNFORUMINDEX . '</a></p>'; |
|
129 | + echo $action[$mode]['msg']."<p><a href='".XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/viewforum.php?forum=$forum'>"._MD_NEWBB_RETURNTOTHEFORUM."</a></p><p><a href='index.php'>"._MD_NEWBB_RETURNFORUMINDEX.'</a></p>'; |
|
130 | 130 | } elseif ('restore' === $mode) { |
131 | 131 | //$topicHandler = Newbb\Helper::getInstance()->getHandler('Topic'); |
132 | 132 | $forums = []; |
133 | - $topicsObject = $topicHandler->getAll(new \Criteria('topic_id', '(' . implode(',', $topic_id) . ')', 'IN')); |
|
133 | + $topicsObject = $topicHandler->getAll(new \Criteria('topic_id', '('.implode(',', $topic_id).')', 'IN')); |
|
134 | 134 | foreach (array_keys($topicsObject) as $id) { |
135 | 135 | $topicObject = $topicsObject[$id]; |
136 | 136 | $topicHandler->approve($topicObject); |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | $forums[$topicObject->getVar('forum_id')] = 1; |
139 | 139 | } |
140 | 140 | //irmtfan remove - no need to approve posts manually - see class/post.php approve function |
141 | - $criteria_forum = new \Criteria('forum_id', '(' . implode(',', array_keys($forums)) . ')', 'IN'); |
|
141 | + $criteria_forum = new \Criteria('forum_id', '('.implode(',', array_keys($forums)).')', 'IN'); |
|
142 | 142 | $forumsObject = $forumHandler->getAll($criteria_forum); |
143 | 143 | foreach (array_keys($forumsObject) as $id) { |
144 | 144 | $forumHandler->synchronization($forumsObject[$id]); |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | /* return false if destination topic is not existing */ |
179 | 179 | // irmtfan bug fix: the old topic will be deleted if user input a not exist new topic |
180 | 180 | if (!is_object($newtopicObject)) { |
181 | - $redirect = XOOPS_URL . '/modules/newbb/viewtopic.php?topic_id=' . $tid; |
|
181 | + $redirect = XOOPS_URL.'/modules/newbb/viewtopic.php?topic_id='.$tid; |
|
182 | 182 | redirect_header($redirect, 2, _MD_NEWBB_ERRORTOPIC); |
183 | 183 | } |
184 | 184 | $criteria_topic = new \Criteria('topic_id', $tid); |
@@ -202,9 +202,9 @@ discard block |
||
202 | 202 | if ($poll_id > 0 && (0 == $newtopicObject->getVar('poll_id'))) { |
203 | 203 | $newtopicObject->setVar('topic_haspoll', 1); |
204 | 204 | $newtopicObject->setVar('poll_id', $poll_id); |
205 | - $poll_id = 0;// set to not delete the poll |
|
205 | + $poll_id = 0; // set to not delete the poll |
|
206 | 206 | $topicObject->setVar('topic_haspoll', 0); // set to not delete the poll |
207 | - $topicObject->setVar('poll_id', 0);// set to not delete the poll |
|
207 | + $topicObject->setVar('poll_id', 0); // set to not delete the poll |
|
208 | 208 | } |
209 | 209 | //update and sync newtopic after merge |
210 | 210 | //$topicHandler->insert($newtopicObject, true); |
@@ -286,16 +286,16 @@ discard block |
||
286 | 286 | && !$forumHandler->getPermission($forum_new, 'reply')) // The forum for the topic to be merged to |
287 | 287 | || (!empty($newforum) && !$forumHandler->getPermission($newforum, 'post')) // The forum to be moved to |
288 | 288 | ) { |
289 | - redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?forum=$forum&topic_id=$topic_id", 2, _NOPERM); |
|
289 | + redirect_header(XOOPS_URL."/modules/newbb/viewtopic.php?forum=$forum&topic_id=$topic_id", 2, _NOPERM); |
|
290 | 290 | } |
291 | 291 | |
292 | 292 | if (!empty($action[$mode]['sql'])) { |
293 | - $sql = sprintf('UPDATE `%s` SET ' . $action[$mode]['sql'] . ' WHERE topic_id = %u', $GLOBALS['xoopsDB']->prefix('newbb_topics'), $topic_id); |
|
293 | + $sql = sprintf('UPDATE `%s` SET '.$action[$mode]['sql'].' WHERE topic_id = %u', $GLOBALS['xoopsDB']->prefix('newbb_topics'), $topic_id); |
|
294 | 294 | if (!$r = $GLOBALS['xoopsDB']->query($sql)) { |
295 | - redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?forum=$forum&topic_id=$topic_id&order=$order&viewmode=$viewmode", 2, _MD_NEWBB_ERROR_BACK . '<br>sql: ' . $sql); |
|
295 | + redirect_header(XOOPS_URL."/modules/newbb/viewtopic.php?forum=$forum&topic_id=$topic_id&order=$order&viewmode=$viewmode", 2, _MD_NEWBB_ERROR_BACK.'<br>sql: '.$sql); |
|
296 | 296 | } |
297 | 297 | } else { |
298 | - redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?forum=$forum&topic_id=$topic_id", 2, _MD_NEWBB_ERROR_BACK); |
|
298 | + redirect_header(XOOPS_URL."/modules/newbb/viewtopic.php?forum=$forum&topic_id=$topic_id", 2, _MD_NEWBB_ERROR_BACK); |
|
299 | 299 | } |
300 | 300 | if ('digest' === $mode && $GLOBALS['xoopsDB']->getAffectedRows()) { |
301 | 301 | $topicObject = $topicHandler->get($topic_id); |
@@ -326,15 +326,15 @@ discard block |
||
326 | 326 | } |
327 | 327 | } else { // No submit |
328 | 328 | $mode = Request::getString('mode', '', 'GET'); //$_GET['mode']; |
329 | - echo "<form action='" . Request::getString('PHP_SELF', '', 'SERVER') . "' method='post'>"; |
|
329 | + echo "<form action='".Request::getString('PHP_SELF', '', 'SERVER')."' method='post'>"; |
|
330 | 330 | echo "<table border='0' cellpadding='1' cellspacing='0' align='center' width='95%'>"; |
331 | 331 | echo "<tr><td class='bg2'>"; |
332 | 332 | echo "<table border='0' cellpadding='1' cellspacing='1' width='100%'>"; |
333 | 333 | echo "<tr class='bg3' align='left'>"; |
334 | - echo "<td colspan='2' align='center'>" . $action[$mode]['desc'] . '</td></tr>'; |
|
334 | + echo "<td colspan='2' align='center'>".$action[$mode]['desc'].'</td></tr>'; |
|
335 | 335 | |
336 | 336 | if ('move' === $mode) { |
337 | - echo '<tr><td class="bg3">' . _MD_NEWBB_MOVETOPICTO . '</td><td class="bg1">'; |
|
337 | + echo '<tr><td class="bg3">'._MD_NEWBB_MOVETOPICTO.'</td><td class="bg1">'; |
|
338 | 338 | $box = '<select name="newforum" size="1">'; |
339 | 339 | |
340 | 340 | // /** @var Newbb\CategoryHandler $categoryHandler */ |
@@ -345,19 +345,19 @@ discard block |
||
345 | 345 | if (count($categories) > 0 && count($forums) > 0) { |
346 | 346 | foreach (array_keys($forums) as $key) { |
347 | 347 | /** @var Newbb\Category[] $categories */ |
348 | - $box .= "<option value='-1'>[" . $categories[$key]->getVar('cat_title') . ']</option>'; |
|
348 | + $box .= "<option value='-1'>[".$categories[$key]->getVar('cat_title').']</option>'; |
|
349 | 349 | foreach ($forums[$key] as $forumid => $_forum) { |
350 | - $box .= "<option value='" . $forumid . "'>-- " . $_forum['title'] . '</option>'; |
|
350 | + $box .= "<option value='".$forumid."'>-- ".$_forum['title'].'</option>'; |
|
351 | 351 | if (!isset($_forum['sub'])) { |
352 | 352 | continue; |
353 | 353 | } |
354 | 354 | foreach (array_keys($_forum['sub']) as $fid) { |
355 | - $box .= "<option value='" . $fid . "'>---- " . $_forum['sub'][$fid]['title'] . '</option>'; |
|
355 | + $box .= "<option value='".$fid."'>---- ".$_forum['sub'][$fid]['title'].'</option>'; |
|
356 | 356 | } |
357 | 357 | } |
358 | 358 | } |
359 | 359 | } else { |
360 | - $box .= "<option value='-1'>" . _MD_NEWBB_NOFORUMINDB . '</option>'; |
|
360 | + $box .= "<option value='-1'>"._MD_NEWBB_NOFORUMINDB.'</option>'; |
|
361 | 361 | } |
362 | 362 | unset($forums, $categories); |
363 | 363 | |
@@ -365,17 +365,17 @@ discard block |
||
365 | 365 | echo '</select></td></tr>'; |
366 | 366 | } |
367 | 367 | if ('merge' === $mode) { |
368 | - echo '<tr><td class="bg3">' . _MD_NEWBB_MERGETOPICTO . '</td><td class="bg1">'; |
|
369 | - echo _MD_NEWBB_TOPIC . " ID-$topic_id -> ID: <input name='newtopic' value='' />"; |
|
368 | + echo '<tr><td class="bg3">'._MD_NEWBB_MERGETOPICTO.'</td><td class="bg1">'; |
|
369 | + echo _MD_NEWBB_TOPIC." ID-$topic_id -> ID: <input name='newtopic' value='' />"; |
|
370 | 370 | echo '</td></tr>'; |
371 | 371 | } |
372 | 372 | echo '<tr class="bg3"><td colspan="2" align="center">'; |
373 | - echo "<input type='hidden' name='mode' value='" . $action[$mode]['name'] . "' />"; |
|
374 | - echo "<input type='hidden' name='topic_id' value='" . $topic_id . "' />"; |
|
375 | - echo "<input type='hidden' name='forum' value='" . $forum . "' />"; |
|
376 | - echo "<input type='submit' name='submit' value='" . $action[$mode]['submit'] . "' />"; |
|
373 | + echo "<input type='hidden' name='mode' value='".$action[$mode]['name']."' />"; |
|
374 | + echo "<input type='hidden' name='topic_id' value='".$topic_id."' />"; |
|
375 | + echo "<input type='hidden' name='forum' value='".$forum."' />"; |
|
376 | + echo "<input type='submit' name='submit' value='".$action[$mode]['submit']."' />"; |
|
377 | 377 | echo '</td></tr></form></table></td></tr></table>'; |
378 | 378 | } |
379 | 379 | // irmtfan move to footer.php |
380 | -require_once __DIR__ . '/footer.php'; |
|
380 | +require_once __DIR__.'/footer.php'; |
|
381 | 381 | include $GLOBALS['xoops']->path('footer.php'); |
@@ -34,10 +34,10 @@ discard block |
||
34 | 34 | use XoopsModules\Newbb; |
35 | 35 | use XoopsModules\Xoopspoll; |
36 | 36 | |
37 | -require_once __DIR__ . '/header.php'; |
|
37 | +require_once __DIR__.'/header.php'; |
|
38 | 38 | $xoopsLogger->startTime('newBB_viewtopic'); |
39 | -require_once __DIR__ . '/include/functions.read.php'; |
|
40 | -require_once __DIR__ . '/include/functions.render.php'; |
|
39 | +require_once __DIR__.'/include/functions.read.php'; |
|
40 | +require_once __DIR__.'/include/functions.render.php'; |
|
41 | 41 | xoops_loadLanguage('user'); |
42 | 42 | |
43 | 43 | /*Build the page query*/ |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | $query_array = []; |
46 | 46 | foreach ($query_vars as $var) { |
47 | 47 | if (Request::getString($var, '', 'GET')) { |
48 | - $query_array[$var] = "{$var}=" . Request::getString($var, '', 'GET'); |
|
48 | + $query_array[$var] = "{$var}=".Request::getString($var, '', 'GET'); |
|
49 | 49 | } |
50 | 50 | } |
51 | 51 | $page_query = htmlspecialchars(implode('&', array_values($query_array))); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | } |
74 | 74 | |
75 | 75 | if (!$topic_id && !$post_id) { |
76 | - $redirect = empty($forum_id) ? XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/index.php' : XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/viewforum.php?forum={$forum_id}"; |
|
76 | + $redirect = empty($forum_id) ? XOOPS_URL . '/modules/'.$xoopsModule->getVar('dirname').'/index.php' : XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/viewforum.php?forum={$forum_id}"; |
|
77 | 77 | redirect_header($redirect, 2, _MD_NEWBB_ERRORTOPIC); |
78 | 78 | } |
79 | 79 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | } |
91 | 91 | |
92 | 92 | if (!is_object($topicObject) || !$topic_id = $topicObject->getVar('topic_id')) { |
93 | - $redirect = empty($forum_id) ? XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/index.php' : XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/viewforum.php?forum={$forum_id}"; |
|
93 | + $redirect = empty($forum_id) ? XOOPS_URL . '/modules/'.$xoopsModule->getVar('dirname').'/index.php' : XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/viewforum.php?forum={$forum_id}"; |
|
94 | 94 | redirect_header($redirect, 2, _MD_NEWBB_ERRORTOPIC); |
95 | 95 | } |
96 | 96 | $forum_id = $topicObject->getVar('forum_id'); |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | |
103 | 103 | if ((!$isAdmin && $topicObject->getVar('approved') < 0) || (!$forumHandler->getPermission($forumObject)) |
104 | 104 | || (!$topicHandler->getPermission($forumObject, $topicObject->getVar('topic_status'), 'view'))) { |
105 | - redirect_header(XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewforum.php?forum=' . $forum_id, 2, _MD_NEWBB_NORIGHTTOVIEW); |
|
105 | + redirect_header(XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/viewforum.php?forum='.$forum_id, 2, _MD_NEWBB_NORIGHTTOVIEW); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | // START irmtfan - find if topic is read or unread - for all users (member and anon) |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | // hack jump to last post read if post_id is empty - is there any better way? |
129 | 129 | if (empty($post_id) && $topic_is_unread |
130 | 130 | && !empty($GLOBALS['xoopsModuleConfig']['jump_to_topic_last_post_read_enabled'])) { |
131 | - header('Location: ' . Request::getString('REQUEST_URI', '', 'SERVER') . '&post_id=' . $topic_last_post_time_or_id_read); |
|
131 | + header('Location: '.Request::getString('REQUEST_URI', '', 'SERVER').'&post_id='.$topic_last_post_time_or_id_read); |
|
132 | 132 | } |
133 | 133 | } |
134 | 134 | } |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | // irmtfan new method |
168 | 168 | if (!empty($GLOBALS['xoopsModuleConfig']['rss_enable'])) { |
169 | 169 | $xoopsTpl->assign('xoops_module_header', ' |
170 | - <link rel="alternate" type="application/rss+xml" title="' . $xoopsModule->getVar('name') . '-' . $forumObject->getVar('forum_name') . '" href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/rss.php?f=' . $forumObject->getVar('forum_id') . '" /> |
|
170 | + <link rel="alternate" type="application/rss+xml" title="' . $xoopsModule->getVar('name').'-'.$forumObject->getVar('forum_name').'" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/rss.php?f='.$forumObject->getVar('forum_id').'" /> |
|
171 | 171 | ' . @$xoopsTpl->get_template_vars('xoops_module_header')); |
172 | 172 | } |
173 | 173 | |
@@ -195,11 +195,11 @@ discard block |
||
195 | 195 | 'collapse' => $iconHandler->getImageSource('more') |
196 | 196 | ]; |
197 | 197 | if (1 == $infobox['show']) { |
198 | - $infobox['style'] = 'none'; //irmtfan move semicolon |
|
198 | + $infobox['style'] = 'none'; //irmtfan move semicolon |
|
199 | 199 | $infobox['alt'] = _MD_NEWBB_SEEUSERDATA; |
200 | 200 | $infobox['src'] = 'more'; |
201 | 201 | } else { |
202 | - $infobox['style'] = 'block'; //irmtfan move semicolon |
|
202 | + $infobox['style'] = 'block'; //irmtfan move semicolon |
|
203 | 203 | $infobox['alt'] = _MD_NEWBB_HIDEUSERDATA; |
204 | 204 | $infobox['src'] = 'less'; |
205 | 205 | } |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | // END irmtfan improve infobox |
210 | 210 | |
211 | 211 | $xoopsTpl->assign([ |
212 | - 'topic_title' => '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/viewtopic.php?topic_id=' . $topic_id . '">' . $topicObject->getFullTitle() . '</a>', |
|
212 | + 'topic_title' => '<a href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/viewtopic.php?topic_id='.$topic_id.'">'.$topicObject->getFullTitle().'</a>', |
|
213 | 213 | 'forum_name' => $forumObject->getVar('forum_name'), |
214 | 214 | 'lang_nexttopic' => _MD_NEWBB_NEXTTOPIC, |
215 | 215 | 'lang_prevtopic' => _MD_NEWBB_PREVTOPIC, |
@@ -231,20 +231,20 @@ discard block |
||
231 | 231 | $t_reply = newbbDisplayImage('t_reply', _MD_NEWBB_REPLY); |
232 | 232 | // irmtfan show topic status if show reg is 0 and revise forum_post_or_register |
233 | 233 | if ($topicHandler->getPermission($forumObject, $topicObject->getVar('topic_status'), 'post')) { |
234 | - $xoopsTpl->assign('forum_post', '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/newtopic.php?forum=' . $forum_id . '"> ' . $t_new . '</a>'); |
|
234 | + $xoopsTpl->assign('forum_post', '<a href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/newtopic.php?forum='.$forum_id.'"> '.$t_new.'</a>'); |
|
235 | 235 | } else { |
236 | 236 | if ($topicObject->getVar('topic_status')) { |
237 | 237 | $xoopsTpl->assign('topic_lock', _MD_NEWBB_TOPICLOCKED); |
238 | 238 | } |
239 | 239 | if (!is_object($GLOBALS['xoopsUser']) && !empty($GLOBALS['xoopsModuleConfig']['show_reg'])) { |
240 | - $xoopsTpl->assign('forum_register', '<a href="' . XOOPS_URL . '/user.php?xoops_redirect=' . htmlspecialchars($xoopsRequestUri) . '">' . _MD_NEWBB_REGTOPOST . '</a>'); |
|
240 | + $xoopsTpl->assign('forum_register', '<a href="'.XOOPS_URL.'/user.php?xoops_redirect='.htmlspecialchars($xoopsRequestUri).'">'._MD_NEWBB_REGTOPOST.'</a>'); |
|
241 | 241 | } |
242 | 242 | } |
243 | 243 | // irmtfan for backward compatibility assign forum_post_or_register smarty again. |
244 | -$xoopsTpl->assign('forum_post_or_register', @$xoopsTpl->get_template_vars('forum_post') . @$xoopsTpl->get_template_vars('forum_register') . @$xoopsTpl->get_template_vars('topic_lock')); |
|
244 | +$xoopsTpl->assign('forum_post_or_register', @$xoopsTpl->get_template_vars('forum_post').@$xoopsTpl->get_template_vars('forum_register').@$xoopsTpl->get_template_vars('topic_lock')); |
|
245 | 245 | |
246 | 246 | if ($topicHandler->getPermission($forumObject, $topicObject->getVar('topic_status'), 'reply')) { |
247 | - $xoopsTpl->assign('forum_reply', '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/reply.php?topic_id=' . $topic_id . '"> ' . $t_reply . '</a>'); |
|
247 | + $xoopsTpl->assign('forum_reply', '<a href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/reply.php?topic_id='.$topic_id.'"> '.$t_reply.'</a>'); |
|
248 | 248 | } |
249 | 249 | |
250 | 250 | $poster_array = []; |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | /** @var \XoopsMemberHandler $memberHandler */ |
266 | 266 | $memberHandler = xoops_getHandler('member'); |
267 | 267 | $userid_array = array_keys($poster_array); |
268 | - $user_criteria = '(' . implode(',', $userid_array) . ')'; |
|
268 | + $user_criteria = '('.implode(',', $userid_array).')'; |
|
269 | 269 | $users = $memberHandler->getUsers(new \Criteria('uid', $user_criteria, 'IN'), true); |
270 | 270 | } else { |
271 | 271 | $users = []; |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | |
274 | 274 | $viewtopic_users = []; |
275 | 275 | if (is_array($userid_array) && count($userid_array) > 0) { |
276 | - require $GLOBALS['xoops']->path('modules/' . $xoopsModule->getVar('dirname', 'n') . '/class/user.php'); |
|
276 | + require $GLOBALS['xoops']->path('modules/'.$xoopsModule->getVar('dirname', 'n').'/class/user.php'); |
|
277 | 277 | $userHandler = new Newbb\UserHandler($GLOBALS['xoopsModuleConfig']['groupbar_enabled'], $GLOBALS['xoopsModuleConfig']['wol_enabled']); |
278 | 278 | $userHandler->users = $users; |
279 | 279 | $userHandler->online = $online; |
@@ -283,10 +283,10 @@ discard block |
||
283 | 283 | |
284 | 284 | if ($GLOBALS['xoopsModuleConfig']['allow_require_reply'] && $require_reply) { |
285 | 285 | if (!empty($GLOBALS['xoopsModuleConfig']['cache_enabled'])) { |
286 | - $viewtopic_posters = newbbGetSession('t' . $topic_id, true); |
|
286 | + $viewtopic_posters = newbbGetSession('t'.$topic_id, true); |
|
287 | 287 | if (!is_array($viewtopic_posters) || 0 === count($viewtopic_posters)) { |
288 | 288 | $viewtopic_posters = $topicHandler->getAllPosters($topicObject); |
289 | - newbbSetSession('t' . $topic_id, $viewtopic_posters); |
|
289 | + newbbSetSession('t'.$topic_id, $viewtopic_posters); |
|
290 | 290 | } |
291 | 291 | } else { |
292 | 292 | $viewtopic_posters = $topicHandler->getAllPosters($topicObject); |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | 'post_date' => 0, |
303 | 303 | 'post_image' => '', |
304 | 304 | 'post_title' => '', |
305 | - 'post_text' => '<div style="text-align: center;vertical-align: middle;"><br>' . xoops_getbanner() . '</div>', |
|
305 | + 'post_text' => '<div style="text-align: center;vertical-align: middle;"><br>'.xoops_getbanner().'</div>', |
|
306 | 306 | 'post_attachment' => '', |
307 | 307 | 'post_edit' => 0, |
308 | 308 | 'post_no' => 0, |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | if ($total_posts > $GLOBALS['xoopsModuleConfig']['posts_per_page']) { |
340 | 340 | include $GLOBALS['xoops']->path('class/pagenav.php'); |
341 | 341 | |
342 | - $nav = new \XoopsPageNav($total_posts, $GLOBALS['xoopsModuleConfig']['posts_per_page'], $start, 'start', 'topic_id=' . $topic_id . '&order=' . $order . '&status=' . $status . '&mode=' . $mode); |
|
342 | + $nav = new \XoopsPageNav($total_posts, $GLOBALS['xoopsModuleConfig']['posts_per_page'], $start, 'start', 'topic_id='.$topic_id.'&order='.$order.'&status='.$status.'&mode='.$mode); |
|
343 | 343 | //if (isset($GLOBALS['xoopsModuleConfig']['do_rewrite']) && $GLOBALS['xoopsModuleConfig']['do_rewrite'] === 1) $nav->url = XOOPS_URL . $nav->url; |
344 | 344 | if ('select' === $GLOBALS['xoopsModuleConfig']['pagenav_display']) { |
345 | 345 | $navi = $nav->renderSelect(); |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | } |
360 | 360 | |
361 | 361 | if (!empty($postsArray[$post_id])) { |
362 | - $xoops_pagetitle = $postsArray[$post_id]->getVar('subject') . ' [' . $forumObject->getVar('forum_name') . ']'; |
|
362 | + $xoops_pagetitle = $postsArray[$post_id]->getVar('subject').' ['.$forumObject->getVar('forum_name').']'; |
|
363 | 363 | $xoopsTpl->assign('xoops_pagetitle', $xoops_pagetitle); |
364 | 364 | $xoopsOption['xoops_pagetitle'] = $xoops_pagetitle; |
365 | 365 | $kw = array_unique(explode(' ', strip_tags($postsArray[$post_id]->getVar('post_text')), 150)); |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | $z = 0; |
369 | 369 | foreach ($kw as $k) { |
370 | 370 | if ($z < 30 && strlen(trim($k)) > 5) { |
371 | - $kwort .= trim($k) . ' '; |
|
371 | + $kwort .= trim($k).' '; |
|
372 | 372 | ++$z; |
373 | 373 | } |
374 | 374 | } |
@@ -395,56 +395,56 @@ discard block |
||
395 | 395 | // START irmtfan add restore to viewtopic |
396 | 396 | // if the topic is active |
397 | 397 | if ($topicObject->getVar('approved') > 0) { |
398 | - $admin_actions['merge'] = [ |
|
399 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=merge&topic_id=' . $topic_id, |
|
398 | + $admin_actions['merge'] = [ |
|
399 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/topicmanager.php?mode=merge&topic_id='.$topic_id, |
|
400 | 400 | 'name' => _MD_NEWBB_MERGETOPIC, |
401 | 401 | 'image' => $ad_merge |
402 | 402 | ]; |
403 | - $admin_actions['move'] = [ |
|
404 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=move&topic_id=' . $topic_id, |
|
403 | + $admin_actions['move'] = [ |
|
404 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/topicmanager.php?mode=move&topic_id='.$topic_id, |
|
405 | 405 | 'name' => _MD_NEWBB_MOVETOPIC, |
406 | 406 | 'image' => $ad_move |
407 | 407 | ]; |
408 | 408 | $admin_actions['delete'] = [ |
409 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=delete&topic_id=' . $topic_id, |
|
409 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/topicmanager.php?mode=delete&topic_id='.$topic_id, |
|
410 | 410 | 'name' => _MD_NEWBB_DELETETOPIC, |
411 | 411 | 'image' => $ad_delete |
412 | 412 | ]; |
413 | 413 | if (!$topicObject->getVar('topic_status')) { |
414 | 414 | $admin_actions['lock'] = [ |
415 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=lock&topic_id=' . $topic_id, |
|
415 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/topicmanager.php?mode=lock&topic_id='.$topic_id, |
|
416 | 416 | 'image' => $ad_lock, |
417 | 417 | 'name' => _MD_NEWBB_LOCKTOPIC |
418 | 418 | ]; |
419 | 419 | } else { |
420 | 420 | $admin_actions['unlock'] = [ |
421 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=unlock&topic_id=' . $topic_id, |
|
421 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/topicmanager.php?mode=unlock&topic_id='.$topic_id, |
|
422 | 422 | 'image' => $ad_unlock, |
423 | 423 | 'name' => _MD_NEWBB_UNLOCKTOPIC |
424 | 424 | ]; |
425 | 425 | } |
426 | 426 | if (!$topicObject->getVar('topic_sticky')) { |
427 | 427 | $admin_actions['sticky'] = [ |
428 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=sticky&topic_id=' . $topic_id, |
|
428 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/topicmanager.php?mode=sticky&topic_id='.$topic_id, |
|
429 | 429 | 'image' => $ad_sticky, |
430 | 430 | 'name' => _MD_NEWBB_STICKYTOPIC |
431 | 431 | ]; |
432 | 432 | } else { |
433 | 433 | $admin_actions['unsticky'] = [ |
434 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=unsticky&topic_id=' . $topic_id, |
|
434 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/topicmanager.php?mode=unsticky&topic_id='.$topic_id, |
|
435 | 435 | 'image' => $ad_unsticky, |
436 | 436 | 'name' => _MD_NEWBB_UNSTICKYTOPIC |
437 | 437 | ]; |
438 | 438 | } |
439 | 439 | if (!$topicObject->getVar('topic_digest')) { |
440 | 440 | $admin_actions['digest'] = [ |
441 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=digest&topic_id=' . $topic_id, |
|
441 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/topicmanager.php?mode=digest&topic_id='.$topic_id, |
|
442 | 442 | 'image' => $ad_digest, |
443 | 443 | 'name' => _MD_NEWBB_DIGESTTOPIC |
444 | 444 | ]; |
445 | 445 | } else { |
446 | 446 | $admin_actions['undigest'] = [ |
447 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=undigest&topic_id=' . $topic_id, |
|
447 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/topicmanager.php?mode=undigest&topic_id='.$topic_id, |
|
448 | 448 | 'image' => $ad_undigest, |
449 | 449 | 'name' => _MD_NEWBB_UNDIGESTTOPIC |
450 | 450 | ]; |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | // if the topic is pending/deleted then restore/approve |
453 | 453 | } else { |
454 | 454 | $admin_actions['restore'] = [ |
455 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=restore&topic_id=' . $topic_id, |
|
455 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/topicmanager.php?mode=restore&topic_id='.$topic_id, |
|
456 | 456 | 'name' => _MD_NEWBB_RESTORETOPIC, |
457 | 457 | 'image' => $ad_restore |
458 | 458 | ]; |
@@ -531,11 +531,11 @@ discard block |
||
531 | 531 | 'is_visible' => $isVisible, |
532 | 532 | 'visible_message' => $visibleMsg, |
533 | 533 | 'disp_votes' => $xp_config['disp_vote_nums'], |
534 | - 'lang_vote' => constant('_MD_' . strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']) . '_VOTE'), |
|
535 | - 'lang_results' => constant('_MD_' . strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']) . '_RESULTS'), |
|
534 | + 'lang_vote' => constant('_MD_'.strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']).'_VOTE'), |
|
535 | + 'lang_results' => constant('_MD_'.strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']).'_RESULTS'), |
|
536 | 536 | 'back_link' => '' |
537 | 537 | ]); |
538 | - $classRenderer = ucfirst($GLOBALS['xoopsModuleConfig']['poll_module']) . 'Renderer'; |
|
538 | + $classRenderer = ucfirst($GLOBALS['xoopsModuleConfig']['poll_module']).'Renderer'; |
|
539 | 539 | /** @var Xoopspoll\Renderer $renderer */ |
540 | 540 | $renderer = new $classRenderer($pollObject); |
541 | 541 | // check to see if user has voted, show form if not, otherwise get results for form |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | $myTpl = new \XoopsTpl(); |
548 | 548 | $renderer->assignForm($myTpl); |
549 | 549 | $myTpl->assign('action', $GLOBALS['xoops']->url("modules/newbb/votepolls.php?topic_id={$topic_id}&poll_id={$poll_id}")); |
550 | - $topic_pollform = $myTpl->fetch($GLOBALS['xoops']->path('modules/' . $GLOBALS['xoopsModuleConfig']['poll_module'] . '/templates/' . $GLOBALS['xoopsModuleConfig']['poll_module'] . '_view.tpl')); |
|
550 | + $topic_pollform = $myTpl->fetch($GLOBALS['xoops']->path('modules/'.$GLOBALS['xoopsModuleConfig']['poll_module'].'/templates/'.$GLOBALS['xoopsModuleConfig']['poll_module'].'_view.tpl')); |
|
551 | 551 | $GLOBALS['xoopsTpl']->assign('topic_pollform', $topic_pollform); |
552 | 552 | } else { |
553 | 553 | $GLOBALS['xoopsTpl']->assign('can_vote', false); |
@@ -558,7 +558,7 @@ discard block |
||
558 | 558 | // old xoopspoll or umfrage or any clone from them |
559 | 559 | } else { |
560 | 560 | $pollObject = new $classPoll($poll_id); |
561 | - $classRenderer = $classPoll . 'Renderer'; |
|
561 | + $classRenderer = $classPoll.'Renderer'; |
|
562 | 562 | $renderer = new $classRenderer($pollObject); |
563 | 563 | $xoopsTpl->assign('lang_alreadyvoted2', _PL_ALREADYVOTED2); |
564 | 564 | $xoopsTpl->assign('has_ended', $pollObject->getVar('end_time') < time() ? 1 : 0); |
@@ -579,7 +579,7 @@ discard block |
||
579 | 579 | |
580 | 580 | } |
581 | 581 | } |
582 | - $classLog = $classPoll . 'Log'; |
|
582 | + $classLog = $classPoll.'Log'; |
|
583 | 583 | $hasvoted = 0; |
584 | 584 | if ($GLOBALS['xoopsUser']) { |
585 | 585 | if ($classLog::hasVoted($poll_id, Request::getString('REMOTE_ADDR', '', 'SERVER'), $uid)) { |
@@ -595,12 +595,12 @@ discard block |
||
595 | 595 | if ($hasvoted || $pollObject->hasExpired()) { |
596 | 596 | $renderer->assignResults($xoopsTpl); |
597 | 597 | $xoopsTpl->assign('topic_pollresult', 1); |
598 | - setcookie('newbb_polls[' . $poll_id . ']', 1); |
|
598 | + setcookie('newbb_polls['.$poll_id.']', 1); |
|
599 | 599 | } else { |
600 | 600 | $renderer->assignForm($xoopsTpl); |
601 | 601 | $xoopsTpl->assign('lang_vote', _PL_VOTE); |
602 | 602 | $xoopsTpl->assign('lang_results', _PL_RESULTS); |
603 | - setcookie('newbb_polls[' . $poll_id . ']', 1); |
|
603 | + setcookie('newbb_polls['.$poll_id.']', 1); |
|
604 | 604 | } |
605 | 605 | } |
606 | 606 | } |
@@ -611,7 +611,7 @@ discard block |
||
611 | 611 | if (is_object($GLOBALS['xoopsUser']) |
612 | 612 | && $GLOBALS['xoopsUser']->getVar('uid') == $topicObject->getVar('topic_poster')) { |
613 | 613 | $t_poll = newbbDisplayImage('t_poll', _MD_NEWBB_ADDPOLL); |
614 | - $xoopsTpl->assign('forum_addpoll', '<a href=\'' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/polls.php?op=add&topic_id=' . $topic_id . '\'>' . $t_poll . '</a>'); |
|
614 | + $xoopsTpl->assign('forum_addpoll', '<a href=\''.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/polls.php?op=add&topic_id='.$topic_id.'\'>'.$t_poll.'</a>'); |
|
615 | 615 | } |
616 | 616 | } elseif ($isAdmin |
617 | 617 | || (is_object($pollObject) && is_object($GLOBALS['xoopsUser']) |
@@ -623,22 +623,22 @@ discard block |
||
623 | 623 | |
624 | 624 | $adminpoll_actions = []; |
625 | 625 | $adminpoll_actions['editpoll'] = [ |
626 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/polls.php?op=edit&poll_id=' . $topicObject->getVar('poll_id') . '&topic_id=' . $topic_id, |
|
626 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/polls.php?op=edit&poll_id='.$topicObject->getVar('poll_id').'&topic_id='.$topic_id, |
|
627 | 627 | 'image' => $poll_edit, |
628 | 628 | 'name' => _MD_NEWBB_EDITPOLL |
629 | 629 | ]; |
630 | - $adminpoll_actions['deletepoll'] = [ |
|
631 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/polls.php?op=delete&poll_id=' . $topicObject->getVar('poll_id') . '&topic_id=' . $topic_id, |
|
630 | + $adminpoll_actions['deletepoll'] = [ |
|
631 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/polls.php?op=delete&poll_id='.$topicObject->getVar('poll_id').'&topic_id='.$topic_id, |
|
632 | 632 | 'image' => $poll_delete, |
633 | 633 | 'name' => _MD_NEWBB_DELETEPOLL |
634 | 634 | ]; |
635 | 635 | $adminpoll_actions['restartpoll'] = [ |
636 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/polls.php?op=restart&poll_id=' . $topicObject->getVar('poll_id') . '&topic_id=' . $topic_id . '&forum=' . $forum_id, |
|
636 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/polls.php?op=restart&poll_id='.$topicObject->getVar('poll_id').'&topic_id='.$topic_id.'&forum='.$forum_id, |
|
637 | 637 | 'image' => $poll_restart, |
638 | 638 | 'name' => _MD_NEWBB_RESTARTPOLL |
639 | 639 | ]; |
640 | - $adminpoll_actions['logpoll'] = [ |
|
641 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/polls.php?op=log&poll_id=' . $topicObject->getVar('poll_id') . '&topic_id=' . $topic_id . '&forum=' . $forum_id, |
|
640 | + $adminpoll_actions['logpoll'] = [ |
|
641 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/polls.php?op=log&poll_id='.$topicObject->getVar('poll_id').'&topic_id='.$topic_id.'&forum='.$forum_id, |
|
642 | 642 | 'image' => $poll_log, |
643 | 643 | 'name' => _MD_NEWBB_POLL_VIEWLOG |
644 | 644 | ]; |
@@ -670,7 +670,7 @@ discard block |
||
670 | 670 | $rating_img = newbbDisplayImage('blank'); |
671 | 671 | } else { |
672 | 672 | // irmtfan - add alt key for rating |
673 | - $rating_img = newbbDisplayImage('rate' . $rating, constant('_MD_NEWBB_RATE' . $rating)); |
|
673 | + $rating_img = newbbDisplayImage('rate'.$rating, constant('_MD_NEWBB_RATE'.$rating)); |
|
674 | 674 | } |
675 | 675 | $xoopsTpl->assign('rating_img', $rating_img); |
676 | 676 | $xoopsTpl->assign('rate1', newbbDisplayImage('rate1', _MD_NEWBB_RATE1)); |
@@ -682,7 +682,7 @@ discard block |
||
682 | 682 | |
683 | 683 | // create jump box |
684 | 684 | if (!empty($GLOBALS['xoopsModuleConfig']['show_jump'])) { |
685 | - require_once __DIR__ . '/include/functions.forum.php'; |
|
685 | + require_once __DIR__.'/include/functions.forum.php'; |
|
686 | 686 | $xoopsTpl->assign('forum_jumpbox', newbbMakeJumpbox($forum_id)); |
687 | 687 | } |
688 | 688 | |
@@ -703,25 +703,25 @@ discard block |
||
703 | 703 | $viewmode_options = []; |
704 | 704 | if ('DESC' === $order) { |
705 | 705 | $viewmode_options[] = [ |
706 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/viewtopic.php?order=ASC&status=$status&topic_id=' . $topic_id, |
|
706 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/viewtopic.php?order=ASC&status=$status&topic_id='.$topic_id, |
|
707 | 707 | 'title' => _OLDESTFIRST |
708 | 708 | ]; |
709 | 709 | } else { |
710 | 710 | $viewmode_options[] = [ |
711 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/viewtopic.php?order=DESC&status=$status&topic_id=' . $topic_id, |
|
711 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/viewtopic.php?order=DESC&status=$status&topic_id='.$topic_id, |
|
712 | 712 | 'title' => _NEWESTFIRST |
713 | 713 | ]; |
714 | 714 | } |
715 | 715 | |
716 | 716 | switch ($status) { |
717 | 717 | case 'active': |
718 | - $current_status = '[' . _MD_NEWBB_TYPE_ADMIN . ']'; |
|
718 | + $current_status = '['._MD_NEWBB_TYPE_ADMIN.']'; |
|
719 | 719 | break; |
720 | 720 | case 'pending': |
721 | - $current_status = '[' . _MD_NEWBB_TYPE_PENDING . ']'; |
|
721 | + $current_status = '['._MD_NEWBB_TYPE_PENDING.']'; |
|
722 | 722 | break; |
723 | 723 | case 'deleted': |
724 | - $current_status = '[' . _MD_NEWBB_TYPE_DELETED . ']'; |
|
724 | + $current_status = '['._MD_NEWBB_TYPE_DELETED.']'; |
|
725 | 725 | break; |
726 | 726 | default: |
727 | 727 | $current_status = ''; |
@@ -744,7 +744,7 @@ discard block |
||
744 | 744 | && $topicHandler->getPermission($forumObject, $topicObject->getVar('topic_status'), 'reply') |
745 | 745 | && $moderateHandler->verifyUser(-1, '', $forumObject->getVar('forum_id'))) { |
746 | 746 | // END irmtfan add verifyUser to quick reply |
747 | - $forum_form = new \XoopsThemeForm(_MD_NEWBB_POSTREPLY, 'quick_reply', XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/post.php', 'post', true); |
|
747 | + $forum_form = new \XoopsThemeForm(_MD_NEWBB_POSTREPLY, 'quick_reply', XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/post.php', 'post', true); |
|
748 | 748 | if (!is_object($GLOBALS['xoopsUser'])) { |
749 | 749 | //$configHandler = xoops_getHandler('config'); |
750 | 750 | $user_tray = new \XoopsFormElementTray(_MD_NEWBB_ACCOUNT); |
@@ -779,7 +779,7 @@ discard block |
||
779 | 779 | |
780 | 780 | $forum_form->addElement(new \XoopsFormHidden('isreply', 1)); |
781 | 781 | |
782 | - $forum_form->addElement(new \XoopsFormHidden('subject', _MD_NEWBB_RE . ': ' . $topicObject->getVar('topic_title', 'e'))); |
|
782 | + $forum_form->addElement(new \XoopsFormHidden('subject', _MD_NEWBB_RE.': '.$topicObject->getVar('topic_title', 'e'))); |
|
783 | 783 | $forum_form->addElement(new \XoopsFormHidden('pid', empty($post_id) ? $topicHandler->getTopPostId($topic_id) : $post_id)); |
784 | 784 | $forum_form->addElement(new \XoopsFormHidden('topic_id', $topic_id)); |
785 | 785 | $forum_form->addElement(new \XoopsFormHidden('forum', $forum_id)); |
@@ -791,7 +791,7 @@ discard block |
||
791 | 791 | $forum_form->addElement(new \XoopsFormHidden('contents_submit', 1)); |
792 | 792 | |
793 | 793 | $submit_button = new \XoopsFormButton('', 'quick_submit', _SUBMIT, 'submit'); |
794 | - $submit_button->setExtra('onclick="if (document.forms.quick_reply.message.value === \'RE\' || document.forms.quick_reply.message.value === \'\') { alert(\'' . _MD_NEWBB_QUICKREPLY_EMPTY . '\'); return false;} else { return true;}"'); |
|
794 | + $submit_button->setExtra('onclick="if (document.forms.quick_reply.message.value === \'RE\' || document.forms.quick_reply.message.value === \'\') { alert(\''._MD_NEWBB_QUICKREPLY_EMPTY.'\'); return false;} else { return true;}"'); |
|
795 | 795 | $forum_form->addElement($submit_button); |
796 | 796 | |
797 | 797 | $toggles = newbbGetCookie('G', true); |
@@ -806,13 +806,13 @@ discard block |
||
806 | 806 | $quickreply['show'] = 1; // = !empty($GLOBALS['xoopsModuleConfig']['quickreply_enabled'] |
807 | 807 | $quickreply['expand'] = (count($toggles) > 0) ? (in_array('qr', $toggles, true) ? false : true) : true; |
808 | 808 | if ($quickreply['expand']) { |
809 | - $quickreply['style'] = 'block'; //irmtfan move semicolon |
|
809 | + $quickreply['style'] = 'block'; //irmtfan move semicolon |
|
810 | 810 | $quickreply_icon_display = $qr_expand; |
811 | - $quickreply_alt = _MD_NEWBB_HIDE . ' ' . _MD_NEWBB_QUICKREPLY; |
|
811 | + $quickreply_alt = _MD_NEWBB_HIDE.' '._MD_NEWBB_QUICKREPLY; |
|
812 | 812 | } else { |
813 | - $quickreply['style'] = 'none'; //irmtfan move semicolon |
|
813 | + $quickreply['style'] = 'none'; //irmtfan move semicolon |
|
814 | 814 | $quickreply_icon_display = $qr_collapse; |
815 | - $quickreply_alt = _MD_NEWBB_SEE . ' ' . _MD_NEWBB_QUICKREPLY; |
|
815 | + $quickreply_alt = _MD_NEWBB_SEE.' '._MD_NEWBB_QUICKREPLY; |
|
816 | 816 | } |
817 | 817 | $quickreply['displayImage'] = newbbDisplayImage($quickreply_icon_display, $quickreply_alt); |
818 | 818 | $quickreply['form'] = $forum_form->render(); |
@@ -828,6 +828,6 @@ discard block |
||
828 | 828 | $xoopsTpl->assign('tagbar', tagBar($topicObject->getVar('topic_tags', 'n'))); |
829 | 829 | } |
830 | 830 | // irmtfan move to footer.php |
831 | -require_once __DIR__ . '/footer.php'; |
|
831 | +require_once __DIR__.'/footer.php'; |
|
832 | 832 | include $GLOBALS['xoops']->path('footer.php'); |
833 | 833 | $xoopsLogger->stopTime('newBB_viewtopic'); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | require_once $GLOBALS['xoops']->path('class/xoopsformloader.php'); |
29 | 29 | |
30 | 30 | // The forum instanciation |
31 | -$form_forum = new \XoopsThemeForm(_AM_NEWBB_EDITTHISFORUM . ' ' . $forumObject->getVar('forum_name'), 'form_forum', xoops_getenv('PHP_SELF')); |
|
31 | +$form_forum = new \XoopsThemeForm(_AM_NEWBB_EDITTHISFORUM.' '.$forumObject->getVar('forum_name'), 'form_forum', xoops_getenv('PHP_SELF')); |
|
32 | 32 | |
33 | 33 | // Forum name |
34 | 34 | $form_forum->addElement(new \XoopsFormText(_AM_NEWBB_FORUMNAME, 'forum_name', 50, 80, $forumObject->getVar('forum_name', 'E')), true); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $perm_checkbox = new \XoopsFormCheckBox('', 'perm_template', $forumObject->isNew()); |
66 | 66 | $perm_checkbox->addOption(1, _AM_NEWBB_PERM_TEMPLATEAPP); |
67 | 67 | $perm_tray->addElement($perm_checkbox); |
68 | -$perm_tray->addElement(new \XoopsFormLabel('', '<a href="admin_permissions.php?action=template" rel="external" title="">' . _AM_NEWBB_PERM_TEMPLATE . '</a>')); |
|
68 | +$perm_tray->addElement(new \XoopsFormLabel('', '<a href="admin_permissions.php?action=template" rel="external" title="">'._AM_NEWBB_PERM_TEMPLATE.'</a>')); |
|
69 | 69 | $form_forum->addElement($perm_tray); |
70 | 70 | |
71 | 71 | $form_forum->addElement(new \XoopsFormHidden('forum', $forumObject->getVar('forum_id'))); |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | |
14 | 14 | use XoopsModules\Newbb; |
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_CONFIG_LOADED', true); |
18 | 18 | |
19 | 19 | if (!defined('NEWBB_FUNCTIONS_CONFIG')) { |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | */ |
27 | 27 | function newbbLoadConfig() |
28 | 28 | { |
29 | - require_once dirname(__DIR__) . '/class/Helper.php'; |
|
29 | + require_once dirname(__DIR__).'/class/Helper.php'; |
|
30 | 30 | //$helper = NewBB::getInstance(); |
31 | 31 | $helper = Newbb\Helper::getInstance(); |
32 | 32 | static $configs = null; |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | } |
37 | 37 | |
38 | 38 | $configs = is_object($helper) ? $helper->getConfig() : []; |
39 | - $plugins = include __DIR__ . '/plugin.php'; |
|
39 | + $plugins = include __DIR__.'/plugin.php'; |
|
40 | 40 | if (is_array($configs) && is_array($plugins)) { |
41 | 41 | $configs = array_merge($configs, $plugins); |
42 | 42 | } |
@@ -54,34 +54,34 @@ discard block |
||
54 | 54 | // remove old html template files |
55 | 55 | // create an array with all folders, and then run this once |
56 | 56 | |
57 | - $templateDirectory = $GLOBALS['xoops']->path('modules/' . $module->getVar('dirname', 'n') . '/templates/'); |
|
57 | + $templateDirectory = $GLOBALS['xoops']->path('modules/'.$module->getVar('dirname', 'n').'/templates/'); |
|
58 | 58 | $template_list = array_diff(scandir($templateDirectory, SCANDIR_SORT_NONE), ['..', '.']); |
59 | 59 | foreach ($template_list as $k => $v) { |
60 | - $fileinfo = new \SplFileInfo($templateDirectory . $v); |
|
60 | + $fileinfo = new \SplFileInfo($templateDirectory.$v); |
|
61 | 61 | if ('html' === $fileinfo->getExtension() && 'index.html' !== $fileinfo->getFilename()) { |
62 | - @unlink($templateDirectory . $v); |
|
62 | + @unlink($templateDirectory.$v); |
|
63 | 63 | } |
64 | 64 | } |
65 | - $templateDirectory = $GLOBALS['xoops']->path('modules/' . $module->getVar('dirname', 'n') . '/templates/blocks'); |
|
65 | + $templateDirectory = $GLOBALS['xoops']->path('modules/'.$module->getVar('dirname', 'n').'/templates/blocks'); |
|
66 | 66 | $template_list = array_diff(scandir($templateDirectory, SCANDIR_SORT_NONE), ['..', '.']); |
67 | 67 | foreach ($template_list as $k => $v) { |
68 | - $fileinfo = new \SplFileInfo($templateDirectory . $v); |
|
68 | + $fileinfo = new \SplFileInfo($templateDirectory.$v); |
|
69 | 69 | if ('html' === $fileinfo->getExtension() && 'index.html' !== $fileinfo->getFilename()) { |
70 | - @unlink($templateDirectory . $v); |
|
70 | + @unlink($templateDirectory.$v); |
|
71 | 71 | } |
72 | 72 | } |
73 | 73 | // Load class XoopsFile |
74 | 74 | xoops_load('xoopsfile'); |
75 | 75 | //remove /images directory |
76 | - $imagesDirectory = $GLOBALS['xoops']->path('modules/' . $module->getVar('dirname', 'n') . '/images/'); |
|
76 | + $imagesDirectory = $GLOBALS['xoops']->path('modules/'.$module->getVar('dirname', 'n').'/images/'); |
|
77 | 77 | $folderHandler = \XoopsFile::getHandler('folder', $imagesDirectory); |
78 | 78 | $folderHandler->delete($imagesDirectory); |
79 | 79 | |
80 | 80 | //remove old changelogs |
81 | - array_map('unlink', glob(dirname(__DIR__) . '/docs/changelog-rev*.txt')); |
|
81 | + array_map('unlink', glob(dirname(__DIR__).'/docs/changelog-rev*.txt')); |
|
82 | 82 | |
83 | 83 | if (!empty($newbbConfig['syncOnUpdate'])) { |
84 | - require_once __DIR__ . '/../include/functions.recon.php'; |
|
84 | + require_once __DIR__.'/../include/functions.recon.php'; |
|
85 | 85 | newbbSynchronization(); |
86 | 86 | } |
87 | 87 | |
@@ -107,9 +107,9 @@ discard block |
||
107 | 107 | */ |
108 | 108 | function xoops_module_pre_install_newbb(\XoopsModule $module) |
109 | 109 | { |
110 | - $mod_tables =& $module->getInfo('tables'); |
|
110 | + $mod_tables = & $module->getInfo('tables'); |
|
111 | 111 | foreach ($mod_tables as $table) { |
112 | - $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS ' . $GLOBALS['xoopsDB']->prefix($table) . ';'); |
|
112 | + $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS '.$GLOBALS['xoopsDB']->prefix($table).';'); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | return true; |
@@ -176,12 +176,12 @@ discard block |
||
176 | 176 | } |
177 | 177 | foreach ($groups_post as $group_id) { |
178 | 178 | foreach ($post_items as $item) { |
179 | - $gpermHandler->addRight('forum_' . $item, $forum_id, $group_id, $module_id); |
|
179 | + $gpermHandler->addRight('forum_'.$item, $forum_id, $group_id, $module_id); |
|
180 | 180 | } |
181 | 181 | } |
182 | 182 | |
183 | 183 | /* Create a test post */ |
184 | - require_once __DIR__ . '/functions.user.php'; |
|
184 | + require_once __DIR__.'/functions.user.php'; |
|
185 | 185 | /** @var Newbb\PostHandler $postHandler */ |
186 | 186 | $postHandler = Newbb\Helper::getInstance()->getHandler('Post'); |
187 | 187 | /** @var $forumpost */ |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | if (!empty($avatar) && 'blank.gif' !== $avatar) { |
68 | 68 | $categories[0]['fields'][] = [ |
69 | 69 | 'title' => _MD_NEWBB_AUTO_CREATE_AVATARS, |
70 | - 'value' => "<img src='" . XOOPS_UPLOAD_URL . '/' . $GLOBALS['xoopsUser']->getVar('user_avatar') . "' alt='" . $GLOBALS['xoopsUser']->getVar('uname') . "' />" |
|
70 | + 'value' => "<img src='".XOOPS_UPLOAD_URL.'/'.$GLOBALS['xoopsUser']->getVar('user_avatar')."' alt='".$GLOBALS['xoopsUser']->getVar('uname')."' />" |
|
71 | 71 | ]; |
72 | 72 | $weights[0][] = 0; |
73 | 73 | } |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | ksort($categories); |
103 | 103 | } |
104 | 104 | |
105 | -$message = sprintf(_MD_NEWBB_WELCOME_MESSAGE, $GLOBALS['xoopsUser']->getVar('uname')) . "\n\n"; |
|
105 | +$message = sprintf(_MD_NEWBB_WELCOME_MESSAGE, $GLOBALS['xoopsUser']->getVar('uname'))."\n\n"; |
|
106 | 106 | //$message .= _PROFILE . ": <a href='" . XOOPS_URL . '/userinfo.php?uid=' . $GLOBALS['xoopsUser']->getVar('uid') . "'><strong>" . $GLOBALS['xoopsUser']->getVar('uname') . '</strong></a> '; |
107 | 107 | //$message .= " | <a target='_blank' href='".XOOPS_URL . '/pmlite.php?send2=1&to_userid=' . $GLOBALS['xoopsUser']->getVar('uid') . "'>" . _MD_NEWBB_PM . "</a>\n"; |
108 | 108 | $message .= sprintf($GLOBALS['xoopsModuleConfig']['welcome_forum_message']); |
@@ -123,9 +123,9 @@ discard block |
||
123 | 123 | if (!empty($GLOBALS['xoopsModuleConfig']['notification_enabled'])) { |
124 | 124 | $tags = []; |
125 | 125 | $tags['THREAD_NAME'] = $subject; |
126 | - $tags['THREAD_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewtopic.php?post_id=' . $post_id . '&topic_id=' . $postObject->getVar('topic_id') . '&forum=' . $forum_id; |
|
127 | - $tags['POST_URL'] = $tags['THREAD_URL'] . '#forumpost' . $post_id; |
|
128 | - require_once __DIR__ . '/notification.inc.php'; |
|
126 | + $tags['THREAD_URL'] = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/viewtopic.php?post_id='.$post_id.'&topic_id='.$postObject->getVar('topic_id').'&forum='.$forum_id; |
|
127 | + $tags['POST_URL'] = $tags['THREAD_URL'].'#forumpost'.$post_id; |
|
128 | + require_once __DIR__.'/notification.inc.php'; |
|
129 | 129 | $forum_info = newbb_notify_iteminfo('forum', $forum_id); |
130 | 130 | $tags['FORUM_NAME'] = $forum_info['name']; |
131 | 131 | $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_SESSION_LOADED', true); |
18 | 18 | xoops_load('XoopsRequest'); |
19 | 19 | |
@@ -35,11 +35,11 @@ discard block |
||
35 | 35 | if (is_array($string)) { |
36 | 36 | $value = []; |
37 | 37 | foreach ($string as $key => $val) { |
38 | - $value[] = $key . '|' . $val; |
|
38 | + $value[] = $key.'|'.$val; |
|
39 | 39 | } |
40 | 40 | $string = implode(',', $value); |
41 | 41 | } |
42 | - $_SESSION['newbb_' . $name] = $string; |
|
42 | + $_SESSION['newbb_'.$name] = $string; |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | function newbbGetSession($name, $isArray = false) |
51 | 51 | { |
52 | - $value = !empty($_SESSION['newbb_' . $name]) ? $_SESSION['newbb_' . $name] : false; |
|
52 | + $value = !empty($_SESSION['newbb_'.$name]) ? $_SESSION['newbb_'.$name] : false; |
|
53 | 53 | if ($isArray) { |
54 | 54 | $_value = $value ? explode(',', $value) : []; |
55 | 55 | $value = []; |
@@ -77,11 +77,11 @@ discard block |
||
77 | 77 | if (is_array($string)) { |
78 | 78 | $value = []; |
79 | 79 | foreach ($string as $key => $val) { |
80 | - $value[] = $key . '|' . $val; |
|
80 | + $value[] = $key.'|'.$val; |
|
81 | 81 | } |
82 | 82 | $string = implode(',', $value); |
83 | 83 | } |
84 | - setcookie($forumCookie['prefix'] . $name, $string, (int)$expire, $forumCookie['path'], $forumCookie['domain'], $forumCookie['secure']); |
|
84 | + setcookie($forumCookie['prefix'].$name, $string, (int)$expire, $forumCookie['path'], $forumCookie['domain'], $forumCookie['secure']); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | { |
94 | 94 | global $forumCookie; |
95 | 95 | // $value = !empty($_COOKIE[$forumCookie['prefix'] . $name]) ? $_COOKIE[$forumCookie['prefix'] . $name] : null; |
96 | - $value = Request::getString($forumCookie['prefix'] . $name, null, 'COOKIE'); |
|
96 | + $value = Request::getString($forumCookie['prefix'].$name, null, 'COOKIE'); |
|
97 | 97 | |
98 | 98 | if ($isArray) { |
99 | 99 | $_value = $value ? explode(',', $value) : []; |
@@ -11,16 +11,16 @@ |
||
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_LOADED', true); |
16 | 16 | |
17 | 17 | if (!defined('NEWBB_FUNCTIONS')) { |
18 | 18 | define('NEWBB_FUNCTIONS', 1); |
19 | 19 | |
20 | - require_once __DIR__ . '/functions.image.php'; |
|
21 | - require_once __DIR__ . '/functions.user.php'; |
|
22 | - require_once __DIR__ . '/functions.render.php'; |
|
23 | - require_once __DIR__ . '/functions.forum.php'; |
|
24 | - require_once __DIR__ . '/functions.session.php'; |
|
25 | - require_once __DIR__ . '/functions.stats.php'; |
|
20 | + require_once __DIR__.'/functions.image.php'; |
|
21 | + require_once __DIR__.'/functions.user.php'; |
|
22 | + require_once __DIR__.'/functions.render.php'; |
|
23 | + require_once __DIR__.'/functions.forum.php'; |
|
24 | + require_once __DIR__.'/functions.session.php'; |
|
25 | + require_once __DIR__.'/functions.stats.php'; |
|
26 | 26 | } |