@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | use Xmf\Request; |
33 | 33 | use XoopsModules\Newbb; |
34 | 34 | |
35 | -require_once __DIR__ . '/header.php'; |
|
35 | +require_once __DIR__.'/header.php'; |
|
36 | 36 | |
37 | 37 | $start = Request::getInt('start', 0, 'GET'); |
38 | 38 | $forum_id = Request::getInt('forum', 0, 'GET'); |
@@ -72,8 +72,8 @@ discard block |
||
72 | 72 | //echo $mode.' - '.$status; |
73 | 73 | $post_perpage = $GLOBALS['xoopsModuleConfig']['posts_per_page']; |
74 | 74 | |
75 | -$criteria_count = new \CriteriaCompo(new \Criteria('forum_id', '(' . implode(',', $accessForums) . ')', 'IN')); |
|
76 | -$criteria_post = new \CriteriaCompo(new \Criteria('p.forum_id', '(' . implode(',', $accessForums) . ')', 'IN')); |
|
75 | +$criteria_count = new \CriteriaCompo(new \Criteria('forum_id', '('.implode(',', $accessForums).')', 'IN')); |
|
76 | +$criteria_post = new \CriteriaCompo(new \Criteria('p.forum_id', '('.implode(',', $accessForums).')', 'IN')); |
|
77 | 77 | $criteria_post->setSort('p.post_id'); |
78 | 78 | $criteria_post->setOrder($order); |
79 | 79 | |
@@ -106,12 +106,12 @@ discard block |
||
106 | 106 | // START irmtfan use read_uid to find the unread posts when the user is logged in |
107 | 107 | $read_uid = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('uid') : 0; |
108 | 108 | if (!empty($read_uid)) { |
109 | - $join = ' LEFT JOIN ' . $GLOBALS['xoopsDB']->prefix('newbb_reads_topic') . ' AS r ON r.read_item = p.topic_id AND r.uid = ' . $read_uid . ' '; // irmtfan corrected add AS |
|
110 | - $criteria_status_post = new \CriteriaCompo();// irmtfan new \Criteria |
|
109 | + $join = ' LEFT JOIN '.$GLOBALS['xoopsDB']->prefix('newbb_reads_topic').' AS r ON r.read_item = p.topic_id AND r.uid = '.$read_uid.' '; // irmtfan corrected add AS |
|
110 | + $criteria_status_post = new \CriteriaCompo(); // irmtfan new \Criteria |
|
111 | 111 | $criteria_status_post->add(new \Criteria('p.post_id', 'r.`post_id`', '>')); // irmtfan corrected - should use $value='r.``' to render in XOOPS/class/criteria.php |
112 | - $criteria_status_post->add(new \Criteria('r.read_id', null, 'IS NULL'), 'OR');// irmtfan corrected - should use "IS NULL" to render in XOOPS/class/criteria.php |
|
112 | + $criteria_status_post->add(new \Criteria('r.read_id', null, 'IS NULL'), 'OR'); // irmtfan corrected - should use "IS NULL" to render in XOOPS/class/criteria.php |
|
113 | 113 | $criteria_post->add($criteria_status_post); // irmtfan add the status criteria to post criteria - move here |
114 | - $criteria_count = $criteria_post;// irmtfan criteria count is equal to criteria post - move here |
|
114 | + $criteria_count = $criteria_post; // irmtfan criteria count is equal to criteria post - move here |
|
115 | 115 | } else { |
116 | 116 | } |
117 | 117 | // END irmtfan use read_uid to find the unread posts when the user is logged in |
@@ -131,8 +131,8 @@ discard block |
||
131 | 131 | } |
132 | 132 | } |
133 | 133 | if (count($topics) > 0) { |
134 | - $criteria_count->add(new \Criteria('topic_id', '(' . implode(',', $topics) . ')', 'NOT IN')); |
|
135 | - $criteria_post->add(new \Criteria('p.topic_id', '(' . implode(',', $topics) . ')', 'NOT IN')); |
|
134 | + $criteria_count->add(new \Criteria('topic_id', '('.implode(',', $topics).')', 'NOT IN')); |
|
135 | + $criteria_post->add(new \Criteria('p.topic_id', '('.implode(',', $topics).')', 'NOT IN')); |
|
136 | 136 | } |
137 | 137 | // END irmtfan fix read_mode = 1 bugs - for all users (member and anon) |
138 | 138 | //$criteria_status_count->add(new \Criteria("approved", 1));// irmtfan commented and removed |
@@ -161,8 +161,8 @@ discard block |
||
161 | 161 | $viewmode = Request::getString('viewmode', (!empty($viewmode_cookie) ? $viewmode_cookie : (@$valid_modes[$GLOBALS['xoopsModuleConfig']['view_mode'] - 1])), 'GET'); |
162 | 162 | $viewmode = in_array($viewmode, $valid_modes) ? $viewmode : $valid_modes[0]; |
163 | 163 | |
164 | -$postCount = $postHandler->getPostCount($criteria_count, $join);// irmtfan add join for read_mode = 2 |
|
165 | -$posts = $postHandler->getPostsByLimit($criteria_post, $post_perpage, $start, $join);// irmtfan add join for read_mode = 2 |
|
164 | +$postCount = $postHandler->getPostCount($criteria_count, $join); // irmtfan add join for read_mode = 2 |
|
165 | +$posts = $postHandler->getPostsByLimit($criteria_post, $post_perpage, $start, $join); // irmtfan add join for read_mode = 2 |
|
166 | 166 | |
167 | 167 | $poster_array = []; |
168 | 168 | if (count($posts) > 0) { |
@@ -172,20 +172,20 @@ discard block |
||
172 | 172 | } |
173 | 173 | } |
174 | 174 | |
175 | -$xoops_pagetitle = $xoopsModule->getVar('name') . ' - ' . _MD_NEWBB_VIEWALLPOSTS; |
|
175 | +$xoops_pagetitle = $xoopsModule->getVar('name').' - '._MD_NEWBB_VIEWALLPOSTS; |
|
176 | 176 | $xoopsOption['xoops_pagetitle'] = $xoops_pagetitle; |
177 | 177 | $xoopsOption['template_main'] = 'newbb_viewpost.tpl'; |
178 | 178 | |
179 | 179 | require_once $GLOBALS['xoops']->path('header.php'); |
180 | -require_once __DIR__ . '/include/functions.time.php'; |
|
181 | -require_once __DIR__ . '/include/functions.render.php'; |
|
180 | +require_once __DIR__.'/include/functions.time.php'; |
|
181 | +require_once __DIR__.'/include/functions.render.php'; |
|
182 | 182 | |
183 | 183 | //global $xoTheme; |
184 | 184 | //$xoTheme->addScript('/Frameworks/textsanitizer/xoops.js'); |
185 | 185 | |
186 | 186 | if (!empty($forum_id)) { |
187 | 187 | if (!$forumHandler->getPermission($forumObject, 'view')) { |
188 | - redirect_header(XOOPS_URL . '/index.php', 2, _MD_NEWBB_NORIGHTTOACCESS); |
|
188 | + redirect_header(XOOPS_URL.'/index.php', 2, _MD_NEWBB_NORIGHTTOACCESS); |
|
189 | 189 | } |
190 | 190 | if ($forumObject->getVar('parent_forum')) { |
191 | 191 | $parent_forumObject = $forumHandler->get($forumObject->getVar('parent_forum'), ['forum_name']); |
@@ -199,17 +199,17 @@ discard block |
||
199 | 199 | $xoopsTpl->assign('forum_name', $forumObject->getVar('forum_name')); |
200 | 200 | $xoopsTpl->assign('forum_moderators', $forumObject->dispForumModerators()); |
201 | 201 | |
202 | - $xoops_pagetitle = $forumObject->getVar('forum_name') . ' - ' . _MD_NEWBB_VIEWALLPOSTS . ' [' . $xoopsModule->getVar('name') . ']'; |
|
202 | + $xoops_pagetitle = $forumObject->getVar('forum_name').' - '._MD_NEWBB_VIEWALLPOSTS.' ['.$xoopsModule->getVar('name').']'; |
|
203 | 203 | $xoopsTpl->assign('forum_id', $forumObject->getVar('forum_id')); |
204 | 204 | // irmtfan new method |
205 | 205 | if (!empty($GLOBALS['xoopsModuleConfig']['rss_enable'])) { |
206 | 206 | $xoopsTpl->assign('xoops_module_header', ' |
207 | - <link rel="alternate" type="application/xml+rss" title="' . $xoopsModule->getVar('name') . '-' . $forumObject->getVar('forum_name') . '" href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/rss.php?f=' . $forum_id . '" /> |
|
207 | + <link rel="alternate" type="application/xml+rss" title="' . $xoopsModule->getVar('name').'-'.$forumObject->getVar('forum_name').'" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/rss.php?f='.$forum_id.'" /> |
|
208 | 208 | ' . @$xoopsTpl->get_template_vars('xoops_module_header')); |
209 | 209 | } |
210 | 210 | } elseif (!empty($GLOBALS['xoopsModuleConfig']['rss_enable'])) { |
211 | 211 | $xoopsTpl->assign('xoops_module_header', ' |
212 | - <link rel="alternate" type="application/xml+rss" title="' . $xoopsModule->getVar('name') . '" href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/rss.php" /> |
|
212 | + <link rel="alternate" type="application/xml+rss" title="' . $xoopsModule->getVar('name').'" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/rss.php" /> |
|
213 | 213 | ' . @$xoopsTpl->get_template_vars('xoops_module_header')); |
214 | 214 | } |
215 | 215 | // irmtfan remove and move to footer.php |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | /** @var \XoopsMembershipHandler $memberHandler */ |
223 | 223 | $memberHandler = xoops_getHandler('member'); |
224 | 224 | $userid_array = array_keys($poster_array); |
225 | - $user_criteria = '(' . implode(',', $userid_array) . ')'; |
|
225 | + $user_criteria = '('.implode(',', $userid_array).')'; |
|
226 | 226 | $users = $memberHandler->getUsers(new \Criteria('uid', $user_criteria, 'IN'), true); |
227 | 227 | } else { |
228 | 228 | $user_criteria = ''; |
@@ -260,9 +260,9 @@ discard block |
||
260 | 260 | $post_title = $post->getVar('subject'); |
261 | 261 | |
262 | 262 | if ($posticon = $post->getVar('icon')) { |
263 | - $post_image = '<a name="' . $post->getVar('post_id') . '"><img src="' . XOOPS_URL . '/images/subject/' . htmlspecialchars($posticon, ENT_QUOTES | ENT_HTML5) . '" alt="" /></a>'; |
|
263 | + $post_image = '<a name="'.$post->getVar('post_id').'"><img src="'.XOOPS_URL.'/images/subject/'.htmlspecialchars($posticon, ENT_QUOTES | ENT_HTML5).'" alt="" /></a>'; |
|
264 | 264 | } else { |
265 | - $post_image = '<a name="' . $post->getVar('post_id') . '"><img src="' . XOOPS_URL . '/images/icons/no_posticon.gif" alt="" /></a>'; |
|
265 | + $post_image = '<a name="'.$post->getVar('post_id').'"><img src="'.XOOPS_URL.'/images/icons/no_posticon.gif" alt="" /></a>'; |
|
266 | 266 | } |
267 | 267 | $poster = [ |
268 | 268 | 'uid' => 0, |
@@ -276,10 +276,10 @@ discard block |
||
276 | 276 | $post_text = $post->getVar('post_text'); |
277 | 277 | $post_attachment = $post->displayAttachment(); |
278 | 278 | } elseif ($GLOBALS['xoopsModuleConfig']['enable_karma'] && $post->getVar('post_karma') > $user_karma) { |
279 | - $post_text = "<div class='karma'>" . sprintf(_MD_NEWBB_KARMA_REQUIREMENT, $user_karma, $post->getVar('post_karma')) . '</div>'; |
|
279 | + $post_text = "<div class='karma'>".sprintf(_MD_NEWBB_KARMA_REQUIREMENT, $user_karma, $post->getVar('post_karma')).'</div>'; |
|
280 | 280 | $post_attachment = ''; |
281 | 281 | } elseif ($GLOBALS['xoopsModuleConfig']['allow_require_reply'] && $post->getVar('require_reply')) { |
282 | - $post_text = "<div class='karma'>" . _MD_NEWBB_REPLY_REQUIREMENT . '</div>'; |
|
282 | + $post_text = "<div class='karma'>"._MD_NEWBB_REPLY_REQUIREMENT.'</div>'; |
|
283 | 283 | $post_attachment = ''; |
284 | 284 | } else { |
285 | 285 | $post_text = $post->getVar('post_text'); |
@@ -299,40 +299,40 @@ discard block |
||
299 | 299 | || (!$suspension[$post->getVar('forum_id')] && $post->checkIdentity() |
300 | 300 | && $post->checkTimelimit('delete_timelimit'))) { |
301 | 301 | $thread_buttons['delete']['image'] = newbbDisplayImage('p_delete', _DELETE); |
302 | - $thread_buttons['delete']['link'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/delete.php?forum=' . $post->getVar('forum_id') . '&topic_id=' . $post->getVar('topic_id'); |
|
302 | + $thread_buttons['delete']['link'] = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/delete.php?forum='.$post->getVar('forum_id').'&topic_id='.$post->getVar('topic_id'); |
|
303 | 303 | $thread_buttons['delete']['name'] = _DELETE; |
304 | 304 | } |
305 | 305 | if ($isAdmin |
306 | 306 | || !$suspension[$post->getVar('forum_id')] && $post->checkIdentity() |
307 | 307 | && $post->checkTimelimit('edit_timelimit')) { |
308 | 308 | $thread_buttons['edit']['image'] = newbbDisplayImage('p_edit', _EDIT); |
309 | - $thread_buttons['edit']['link'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/edit.php?forum=' . $post->getVar('forum_id') . '&topic_id=' . $post->getVar('topic_id'); |
|
309 | + $thread_buttons['edit']['link'] = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/edit.php?forum='.$post->getVar('forum_id').'&topic_id='.$post->getVar('topic_id'); |
|
310 | 310 | $thread_buttons['edit']['name'] = _EDIT; |
311 | 311 | } |
312 | 312 | if (is_object($GLOBALS['xoopsUser']) && !$suspension[$post->getVar('forum_id')]) { |
313 | 313 | $thread_buttons['reply']['image'] = newbbDisplayImage('p_reply', _MD_NEWBB_REPLY); |
314 | - $thread_buttons['reply']['link'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/reply.php?forum=' . $post->getVar('forum_id') . '&topic_id=' . $post->getVar('topic_id'); |
|
314 | + $thread_buttons['reply']['link'] = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/reply.php?forum='.$post->getVar('forum_id').'&topic_id='.$post->getVar('topic_id'); |
|
315 | 315 | $thread_buttons['reply']['name'] = _MD_NEWBB_REPLY; |
316 | 316 | |
317 | 317 | $thread_buttons['quote']['image'] = newbbDisplayImage('p_quote', _MD_NEWBB_QUOTE); |
318 | - $thread_buttons['quote']['link'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/reply.php?forum=' . $post->getVar('forum_id') . '&topic_id=' . $post->getVar('topic_id') . '&quotedac=1'; |
|
318 | + $thread_buttons['quote']['link'] = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/reply.php?forum='.$post->getVar('forum_id').'&topic_id='.$post->getVar('topic_id').'&quotedac=1'; |
|
319 | 319 | $thread_buttons['quote']['name'] = _MD_NEWBB_QUOTE; |
320 | 320 | } |
321 | 321 | } else { |
322 | 322 | $thread_buttons['delete']['image'] = newbbDisplayImage('p_delete', _DELETE); |
323 | - $thread_buttons['delete']['link'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/delete.php?forum=' . $post->getVar('forum_id') . '&topic_id=' . $post->getVar('topic_id'); |
|
323 | + $thread_buttons['delete']['link'] = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/delete.php?forum='.$post->getVar('forum_id').'&topic_id='.$post->getVar('topic_id'); |
|
324 | 324 | $thread_buttons['delete']['name'] = _DELETE; |
325 | 325 | $thread_buttons['edit']['image'] = newbbDisplayImage('p_edit', _EDIT); |
326 | - $thread_buttons['edit']['link'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/edit.php?forum=' . $post->getVar('forum_id') . '&topic_id=' . $post->getVar('topic_id'); |
|
326 | + $thread_buttons['edit']['link'] = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/edit.php?forum='.$post->getVar('forum_id').'&topic_id='.$post->getVar('topic_id'); |
|
327 | 327 | $thread_buttons['edit']['name'] = _EDIT; |
328 | 328 | $thread_buttons['reply']['image'] = newbbDisplayImage('p_reply', _MD_NEWBB_REPLY); |
329 | - $thread_buttons['reply']['link'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/reply.php?forum=' . $post->getVar('forum_id') . '&topic_id=' . $post->getVar('topic_id'); |
|
329 | + $thread_buttons['reply']['link'] = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/reply.php?forum='.$post->getVar('forum_id').'&topic_id='.$post->getVar('topic_id'); |
|
330 | 330 | $thread_buttons['reply']['name'] = _MD_NEWBB_REPLY; |
331 | 331 | } |
332 | 332 | |
333 | 333 | if (!$isAdmin && $GLOBALS['xoopsModuleConfig']['reportmod_enabled']) { |
334 | 334 | $thread_buttons['report']['image'] = newbbDisplayImage('p_report', _MD_NEWBB_REPORT); |
335 | - $thread_buttons['report']['link'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/report.php?forum=' . $post->getVar('forum_id') . '&topic_id=' . $post->getVar('topic_id'); |
|
335 | + $thread_buttons['report']['link'] = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/report.php?forum='.$post->getVar('forum_id').'&topic_id='.$post->getVar('topic_id'); |
|
336 | 336 | $thread_buttons['report']['name'] = _MD_NEWBB_REPORT; |
337 | 337 | } |
338 | 338 | $thread_action = []; |
@@ -361,13 +361,13 @@ discard block |
||
361 | 361 | unset($viewtopic_users, $forums); |
362 | 362 | |
363 | 363 | if (!empty($GLOBALS['xoopsModuleConfig']['show_jump'])) { |
364 | - require_once __DIR__ . '/include/functions.forum.php'; |
|
364 | + require_once __DIR__.'/include/functions.forum.php'; |
|
365 | 365 | $xoopsTpl->assign('forum_jumpbox', newbbMakeJumpbox($forum_id)); |
366 | 366 | } |
367 | 367 | |
368 | 368 | if ($postCount > $post_perpage) { |
369 | 369 | include $GLOBALS['xoops']->path('class/pagenav.php'); |
370 | - $nav = new \XoopsPageNav($postCount, $post_perpage, $start, 'start', 'forum=' . $forum_id . '&viewmode=' . $viewmode . '&status=' . $status . '&uid=' . $uid . '&order=' . $order . '&mode=' . $mode); |
|
370 | + $nav = new \XoopsPageNav($postCount, $post_perpage, $start, 'start', 'forum='.$forum_id.'&viewmode='.$viewmode.'&status='.$status.'&uid='.$uid.'&order='.$order.'&mode='.$mode); |
|
371 | 371 | //if (isset($GLOBALS['xoopsModuleConfig']['do_rewrite'])) $nav->url = formatURL(Request::getString('SERVER_NAME', '', 'SERVER')) . $nav->url; |
372 | 372 | if ('select' === $GLOBALS['xoopsModuleConfig']['pagenav_display']) { |
373 | 373 | $navi = $nav->renderSelect(); |
@@ -386,13 +386,13 @@ discard block |
||
386 | 386 | |
387 | 387 | switch ($status) { |
388 | 388 | case 'active': |
389 | - $lang_title = _MD_NEWBB_VIEWALLPOSTS . ' [' . _MD_NEWBB_TYPE_ADMIN . ']'; |
|
389 | + $lang_title = _MD_NEWBB_VIEWALLPOSTS.' ['._MD_NEWBB_TYPE_ADMIN.']'; |
|
390 | 390 | break; |
391 | 391 | case 'pending': |
392 | - $lang_title = _MD_NEWBB_VIEWALLPOSTS . ' [' . _MD_NEWBB_TYPE_PENDING . ']'; |
|
392 | + $lang_title = _MD_NEWBB_VIEWALLPOSTS.' ['._MD_NEWBB_TYPE_PENDING.']'; |
|
393 | 393 | break; |
394 | 394 | case 'deleted': |
395 | - $lang_title = _MD_NEWBB_VIEWALLPOSTS . ' [' . _MD_NEWBB_TYPE_DELETED . ']'; |
|
395 | + $lang_title = _MD_NEWBB_VIEWALLPOSTS.' ['._MD_NEWBB_TYPE_DELETED.']'; |
|
396 | 396 | break; |
397 | 397 | case 'new': |
398 | 398 | $lang_title = _MD_NEWBB_NEWPOSTS; |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | break; |
403 | 403 | } |
404 | 404 | if ($uid > 0) { |
405 | - $lang_title .= ' (' . XoopsUser::getUnameFromId($uid) . ')'; |
|
405 | + $lang_title .= ' ('.XoopsUser::getUnameFromId($uid).')'; |
|
406 | 406 | } |
407 | 407 | $xoopsTpl->assign('lang_title', $lang_title); |
408 | 408 | // irmtfan up to p_up |
@@ -411,12 +411,12 @@ discard block |
||
411 | 411 | $xoopsTpl->assign('anonymous_prefix', $GLOBALS['xoopsModuleConfig']['anonymous_prefix']); |
412 | 412 | $xoopsTpl->assign('down', newbbDisplayImage('down', _MD_NEWBB_BOTTOM)); |
413 | 413 | |
414 | -$all_link = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewpost.php?forum=' . $forum_id . "&start=$start"; |
|
415 | -$post_link = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewpost.php?forum=' . $forum_id; |
|
416 | -$newpost_link = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewpost.php?forum=' . $forum_id . '&status=new'; |
|
417 | -$digest_link = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewpost.php?forum=' . $forum_id . "&start=$start&status=digest"; |
|
418 | -$unreplied_link = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewpost.php?forum=' . $forum_id . "&start=$start&status=unreplied"; |
|
419 | -$unread_link = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewpost.php?forum=' . $forum_id . "&start=$start&status=unread"; |
|
414 | +$all_link = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/viewpost.php?forum='.$forum_id."&start=$start"; |
|
415 | +$post_link = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/viewpost.php?forum='.$forum_id; |
|
416 | +$newpost_link = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/viewpost.php?forum='.$forum_id.'&status=new'; |
|
417 | +$digest_link = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/viewpost.php?forum='.$forum_id."&start=$start&status=digest"; |
|
418 | +$unreplied_link = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/viewpost.php?forum='.$forum_id."&start=$start&status=unreplied"; |
|
419 | +$unread_link = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/viewpost.php?forum='.$forum_id."&start=$start&status=unread"; |
|
420 | 420 | |
421 | 421 | $xoopsTpl->assign('all_link', $all_link); |
422 | 422 | $xoopsTpl->assign('post_link', $post_link); |
@@ -428,12 +428,12 @@ discard block |
||
428 | 428 | $viewmode_options = []; |
429 | 429 | if ('DESC' === $order) { |
430 | 430 | $viewmode_options[] = [ |
431 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewpost.php?viewmode=flat&order=ASC&forum=' . $forum_id, |
|
431 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/viewpost.php?viewmode=flat&order=ASC&forum='.$forum_id, |
|
432 | 432 | 'title' => _OLDESTFIRST |
433 | 433 | ]; |
434 | 434 | } else { |
435 | 435 | $viewmode_options[] = [ |
436 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewpost.php?viewmode=flat&order=DESC&forum=' . $forum_id, |
|
436 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/viewpost.php?viewmode=flat&order=DESC&forum='.$forum_id, |
|
437 | 437 | 'title' => _NEWESTFIRST |
438 | 438 | ]; |
439 | 439 | } |
@@ -448,5 +448,5 @@ discard block |
||
448 | 448 | $xoopsTpl->assign('mode', $mode); |
449 | 449 | $xoopsTpl->assign('status', $status); |
450 | 450 | // irmtfan move to footer.php |
451 | -require_once __DIR__ . '/footer.php'; |
|
451 | +require_once __DIR__.'/footer.php'; |
|
452 | 452 | include $GLOBALS['xoops']->path('footer.php'); |
@@ -11,12 +11,12 @@ 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 | if (!Request::getInt('forum', 0, 'GET')) { |
17 | - redirect_header(XOOPS_URL . '/index.php', 2, _MD_NEWBB_ERRORFORUM); |
|
17 | + redirect_header(XOOPS_URL.'/index.php', 2, _MD_NEWBB_ERRORFORUM); |
|
18 | 18 | } |
19 | -require_once __DIR__ . '/include/functions.read.php'; |
|
19 | +require_once __DIR__.'/include/functions.read.php'; |
|
20 | 20 | |
21 | 21 | /* |
22 | 22 | * Build the page query |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | $query_array = []; |
26 | 26 | foreach ($query_vars as $var) { |
27 | 27 | if (Request::getString($var, '', 'GET')) { |
28 | - $query_array[$var] = "{$var}=" . Request::getString($var, '', 'GET'); |
|
28 | + $query_array[$var] = "{$var}=".Request::getString($var, '', 'GET'); |
|
29 | 29 | } |
30 | 30 | } |
31 | 31 | $page_query = implode('&', array_values($query_array)); |
@@ -39,8 +39,8 @@ discard block |
||
39 | 39 | $markresult = _MD_NEWBB_MARK_UNREAD; |
40 | 40 | } |
41 | 41 | newbbSetReadTopic($markvalue, Request::getInt('forum', 0, 'GET')); |
42 | - $url = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewforum.php?' . $page_query; |
|
43 | - redirect_header($url, 2, _MD_NEWBB_ALL_TOPIC_MARKED . ' ' . $markresult); |
|
42 | + $url = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/viewforum.php?'.$page_query; |
|
43 | + redirect_header($url, 2, _MD_NEWBB_ALL_TOPIC_MARKED.' '.$markresult); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | $forum_id = Request::getInt('forum', 0, 'GET'); |
@@ -67,25 +67,25 @@ discard block |
||
67 | 67 | $forumObject = $forumHandler->get($forum_id); |
68 | 68 | |
69 | 69 | if (!$forumObject) { |
70 | - redirect_header(XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/index.php', 2, _MD_NEWBB_ERRORFORUM); |
|
70 | + redirect_header(XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/index.php', 2, _MD_NEWBB_ERRORFORUM); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | if (!$forumHandler->getPermission($forumObject)) { |
74 | - redirect_header(XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/index.php', 2, _NOPERM); |
|
74 | + redirect_header(XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/index.php', 2, _NOPERM); |
|
75 | 75 | } |
76 | 76 | newbbSetRead('forum', $forum_id, $forumObject->getVar('forum_last_post_id')); |
77 | 77 | |
78 | -$xoops_pagetitle = $forumObject->getVar('forum_name') . ' [' . $xoopsModule->getVar('name') . ']'; |
|
78 | +$xoops_pagetitle = $forumObject->getVar('forum_name').' ['.$xoopsModule->getVar('name').']'; |
|
79 | 79 | |
80 | 80 | $xoopsOption['template_main'] = 'newbb_viewforum.tpl'; |
81 | 81 | $xoopsOption['xoops_pagetitle'] = $xoops_pagetitle; |
82 | 82 | |
83 | 83 | require_once $GLOBALS['xoops']->path('header.php'); |
84 | -require_once __DIR__ . '/include/functions.render.php'; |
|
84 | +require_once __DIR__.'/include/functions.render.php'; |
|
85 | 85 | |
86 | 86 | if (!empty($GLOBALS['xoopsModuleConfig']['rss_enable'])) { |
87 | 87 | $xoopsTpl->assign('xoops_module_header', ' |
88 | - <link rel="alternate" type="application/xml+rss" title="' . $xoopsModule->getVar('name') . '-' . $forumObject->getVar('forum_name') . '" href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/rss.php?f=' . $forum_id . '" /> |
|
88 | + <link rel="alternate" type="application/xml+rss" title="' . $xoopsModule->getVar('name').'-'.$forumObject->getVar('forum_name').'" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/rss.php?f='.$forum_id.'" /> |
|
89 | 89 | ' . @$xoopsTpl->get_template_vars('xoops_module_header')); |
90 | 90 | } |
91 | 91 | $forumDescription = $forumObject->getVar('forum_desc'); |
@@ -119,16 +119,16 @@ discard block |
||
119 | 119 | |
120 | 120 | if ($forumHandler->getPermission($forumObject, 'post')) { |
121 | 121 | $xoopsTpl->assign('viewer_level', $isAdmin ? 2 : 1); |
122 | - $xoopsTpl->assign('forum_post_or_register', '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/newtopic.php?forum={$forum_id}\">" . newbbDisplayImage('t_new', _MD_NEWBB_POSTNEW) . '</a>'); |
|
122 | + $xoopsTpl->assign('forum_post_or_register', '<a href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/newtopic.php?forum={$forum_id}\">".newbbDisplayImage('t_new', _MD_NEWBB_POSTNEW).'</a>'); |
|
123 | 123 | if ($pollmodules && $forumHandler->getPermission($forumObject, 'addpoll')) { |
124 | 124 | $t_poll = newbbDisplayImage('t_poll', _MD_NEWBB_ADDPOLL); |
125 | - $xoopsTpl->assign('forum_addpoll', '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/polls.php?op=add&forum={$forum_id}\">{$t_poll}</a>"); |
|
125 | + $xoopsTpl->assign('forum_addpoll', '<a href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/polls.php?op=add&forum={$forum_id}\">{$t_poll}</a>"); |
|
126 | 126 | } |
127 | 127 | } else { |
128 | 128 | $xoopsTpl->assign('viewer_level', 0); |
129 | 129 | if (!is_object($GLOBALS['xoopsUser']) && !empty($GLOBALS['xoopsModuleConfig']['show_reg'])) { |
130 | - $redirect = preg_replace("|(.*)\/modules\/Newbb\/(.*)|", "\\1/modules/newbb/newtopic.php?forum=" . $forum_id, htmlspecialchars($xoopsRequestUri, ENT_QUOTES | ENT_HTML5)); |
|
131 | - $xoopsTpl->assign('forum_post_or_register', "<a href='" . XOOPS_URL . "/user.php?xoops_redirect={$redirect}'>" . _MD_NEWBB_REGTOPOST . '</a>'); |
|
130 | + $redirect = preg_replace("|(.*)\/modules\/Newbb\/(.*)|", "\\1/modules/newbb/newtopic.php?forum=".$forum_id, htmlspecialchars($xoopsRequestUri, ENT_QUOTES | ENT_HTML5)); |
|
131 | + $xoopsTpl->assign('forum_post_or_register', "<a href='".XOOPS_URL."/user.php?xoops_redirect={$redirect}'>"._MD_NEWBB_REGTOPOST.'</a>'); |
|
132 | 132 | $xoopsTpl->assign('forum_addpoll', ''); |
133 | 133 | } else { |
134 | 134 | $xoopsTpl->assign('forum_post_or_register', ''); |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | $xoopsTpl->assign_by_ref('parentforum', $parentforum); |
140 | 140 | |
141 | 141 | $criteria = new \CriteriaCompo(new \Criteria('parent_forum', $forum_id)); |
142 | -$criteria->add(new \Criteria('forum_id', '(' . implode(', ', $forumHandler->getIdsByPermission('access')) . ')', 'IN')); |
|
142 | +$criteria->add(new \Criteria('forum_id', '('.implode(', ', $forumHandler->getIdsByPermission('access')).')', 'IN')); |
|
143 | 143 | $criteria->setSort('forum_order'); |
144 | 144 | |
145 | 145 | if ($forums = $forumHandler->getAll($criteria, null, false)) { |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | |
176 | 176 | $forum_selection_sort = '<select name="sort">'; |
177 | 177 | foreach ($sel_sort_array as $sort_k => $sort_v) { |
178 | - $forum_selection_sort .= '<option value="' . $sort_k . '"' . (($sort == $sort_k) ? ' selected="selected"' : '') . '>' . $sort_v . '</option>'; |
|
178 | + $forum_selection_sort .= '<option value="'.$sort_k.'"'.(($sort == $sort_k) ? ' selected="selected"' : '').'>'.$sort_v.'</option>'; |
|
179 | 179 | } |
180 | 180 | $forum_selection_sort .= '</select>'; |
181 | 181 | |
@@ -184,14 +184,14 @@ discard block |
||
184 | 184 | $order = (!Request::getString('order', '', 'GET') |
185 | 185 | || 'ASC' !== Request::getString('order', '', 'GET')) ? 'DESC' : 'ASC'; |
186 | 186 | $forum_selection_order = '<select name="order">'; |
187 | -$forum_selection_order .= '<option value="ASC"' . (('ASC' === $order) ? ' selected' : '') . '>' . _MD_NEWBB_ASCENDING . '</option>'; |
|
188 | -$forum_selection_order .= '<option value="DESC"' . (('DESC' === $order) ? ' selected' : '') . '>' . _MD_NEWBB_DESCENDING . '</option>'; |
|
187 | +$forum_selection_order .= '<option value="ASC"'.(('ASC' === $order) ? ' selected' : '').'>'._MD_NEWBB_ASCENDING.'</option>'; |
|
188 | +$forum_selection_order .= '<option value="DESC"'.(('DESC' === $order) ? ' selected' : '').'>'._MD_NEWBB_DESCENDING.'</option>'; |
|
189 | 189 | $forum_selection_order .= '</select>'; |
190 | 190 | |
191 | 191 | $xoopsTpl->assign_by_ref('forum_selection_order', $forum_selection_order); |
192 | 192 | |
193 | 193 | $since = Request::getInt('since', $GLOBALS['xoopsModuleConfig']['since_default'], 'GET'); |
194 | -require_once __DIR__ . '/include/functions.time.php'; |
|
194 | +require_once __DIR__.'/include/functions.time.php'; |
|
195 | 195 | $forum_selection_since = newbbSinceSelectBox($since); |
196 | 196 | $xoopsTpl->assign_by_ref('forum_selection_since', $forum_selection_since); |
197 | 197 | |
@@ -200,14 +200,14 @@ discard block |
||
200 | 200 | $page_query_sort = implode('&', array_values($query_sort)); |
201 | 201 | unset($query_sort); |
202 | 202 | // irmtfan - edit: u.uname => t.topic_poster | t.topic_time => t.topic_id | p.post_time => t.topic_last_post_id |
203 | -$xoopsTpl->assign('h_topic_link', XOOPS_URL . "/modules/newbb/viewforum.php?{$page_query_sort}&sort=t.topic_title&order=" . (('t.topic_title' === $sort && 'DESC' === $order) ? 'ASC' : 'DESC')); |
|
204 | -$xoopsTpl->assign('h_reply_link', XOOPS_URL . "/modules/newbb/viewforum.php?{$page_query_sort}&sort=t.topic_replies&order=" . (('t.topic_replies' === $sort && 'DESC' === $order) ? 'ASC' : 'DESC')); |
|
205 | -$xoopsTpl->assign('h_poster_link', XOOPS_URL . "/modules/newbb/viewforum.php?{$page_query_sort}&sort=t.topic_poster&order=" . (('t.topic_poster' === $sort && 'DESC' === $order) ? 'ASC' : 'DESC')); |
|
206 | -$xoopsTpl->assign('h_views_link', XOOPS_URL . "/modules/newbb/viewforum.php?{$page_query_sort}&sort=t.topic_views&order=" . (('t.topic_views' === $sort && 'DESC' === $order) ? 'ASC' : 'DESC')); |
|
207 | -$xoopsTpl->assign('h_rating_link', XOOPS_URL . "/modules/newbb/viewforum.php?{$page_query_sort}&sort=t.rating&order=" . (('t.rating' === $sort |
|
203 | +$xoopsTpl->assign('h_topic_link', XOOPS_URL."/modules/newbb/viewforum.php?{$page_query_sort}&sort=t.topic_title&order=".(('t.topic_title' === $sort && 'DESC' === $order) ? 'ASC' : 'DESC')); |
|
204 | +$xoopsTpl->assign('h_reply_link', XOOPS_URL."/modules/newbb/viewforum.php?{$page_query_sort}&sort=t.topic_replies&order=".(('t.topic_replies' === $sort && 'DESC' === $order) ? 'ASC' : 'DESC')); |
|
205 | +$xoopsTpl->assign('h_poster_link', XOOPS_URL."/modules/newbb/viewforum.php?{$page_query_sort}&sort=t.topic_poster&order=".(('t.topic_poster' === $sort && 'DESC' === $order) ? 'ASC' : 'DESC')); |
|
206 | +$xoopsTpl->assign('h_views_link', XOOPS_URL."/modules/newbb/viewforum.php?{$page_query_sort}&sort=t.topic_views&order=".(('t.topic_views' === $sort && 'DESC' === $order) ? 'ASC' : 'DESC')); |
|
207 | +$xoopsTpl->assign('h_rating_link', XOOPS_URL."/modules/newbb/viewforum.php?{$page_query_sort}&sort=t.rating&order=".(('t.rating' === $sort |
|
208 | 208 | && 'DESC' === $order) ? 'ASC' : 'DESC')); // irmtfan t.topic_ratings to t.rating |
209 | -$xoopsTpl->assign('h_date_link', XOOPS_URL . "/modules/newbb/viewforum.php?{$page_query_sort}&sort=t.topic_last_post_id&order=" . (('t.topic_last_post_id' === $sort && 'DESC' === $order) ? 'ASC' : 'DESC')); |
|
210 | -$xoopsTpl->assign('h_publish_link', XOOPS_URL . "/modules/newbb/viewforum.php?{$page_query_sort}&sort=t.topic_id&order=" . (('t.topic_id' === $sort |
|
209 | +$xoopsTpl->assign('h_date_link', XOOPS_URL."/modules/newbb/viewforum.php?{$page_query_sort}&sort=t.topic_last_post_id&order=".(('t.topic_last_post_id' === $sort && 'DESC' === $order) ? 'ASC' : 'DESC')); |
|
210 | +$xoopsTpl->assign('h_publish_link', XOOPS_URL."/modules/newbb/viewforum.php?{$page_query_sort}&sort=t.topic_id&order=".(('t.topic_id' === $sort |
|
211 | 211 | && 'DESC' === $order) ? 'ASC' : 'DESC')); |
212 | 212 | $xoopsTpl->assign('forum_since', $since); // For $since in search.php |
213 | 213 | |
@@ -237,11 +237,11 @@ discard block |
||
237 | 237 | $xoopsTpl->assign('img_digest', newbbDisplayImage('topic_digest', _MD_NEWBB_TOPICDIGEST)); |
238 | 238 | $xoopsTpl->assign('img_poll', newbbDisplayImage('poll', _MD_NEWBB_TOPICHASPOLL)); |
239 | 239 | |
240 | -$xoopsTpl->assign('mark_read', XOOPS_URL . "/modules/newbb/viewforum.php?mark=1&{$page_query}"); |
|
241 | -$xoopsTpl->assign('mark_unread', XOOPS_URL . "/modules/newbb/viewforum.php?mark=2&{$page_query}"); |
|
240 | +$xoopsTpl->assign('mark_read', XOOPS_URL."/modules/newbb/viewforum.php?mark=1&{$page_query}"); |
|
241 | +$xoopsTpl->assign('mark_unread', XOOPS_URL."/modules/newbb/viewforum.php?mark=2&{$page_query}"); |
|
242 | 242 | |
243 | -$xoopsTpl->assign('post_link', XOOPS_URL . '/modules/newbb/viewpost.php?forum=' . $forum_id); |
|
244 | -$xoopsTpl->assign('newpost_link', XOOPS_URL . '/modules/newbb/viewpost.php?status=new&forum=' . $forum_id); |
|
243 | +$xoopsTpl->assign('post_link', XOOPS_URL.'/modules/newbb/viewpost.php?forum='.$forum_id); |
|
244 | +$xoopsTpl->assign('newpost_link', XOOPS_URL.'/modules/newbb/viewpost.php?status=new&forum='.$forum_id); |
|
245 | 245 | |
246 | 246 | $query_type = $query_array; |
247 | 247 | unset($query_type['type']); |
@@ -252,16 +252,16 @@ discard block |
||
252 | 252 | $typeOptions = null; |
253 | 253 | $types = []; |
254 | 254 | if ($types = $typeHandler->getByForum($forum_id)) { |
255 | - $typeOptions[] = ['title' => _ALL, 'link' => XOOPS_URL . "/modules/newbb/viewforum.php?{$page_query_type}"]; |
|
255 | + $typeOptions[] = ['title' => _ALL, 'link' => XOOPS_URL."/modules/newbb/viewforum.php?{$page_query_type}"]; |
|
256 | 256 | foreach ($types as $key => $item) { |
257 | 257 | $typeOptions[] = [ |
258 | 258 | 'title' => $item['type_name'], |
259 | - 'link' => XOOPS_URL . "/modules/newbb/viewforum.php?{$page_query_type}&type={$key}" |
|
259 | + 'link' => XOOPS_URL."/modules/newbb/viewforum.php?{$page_query_type}&type={$key}" |
|
260 | 260 | ]; |
261 | 261 | } |
262 | 262 | } |
263 | 263 | if ($type > 0) { |
264 | - require_once __DIR__ . '/include/functions.topic.php'; |
|
264 | + require_once __DIR__.'/include/functions.topic.php'; |
|
265 | 265 | $xoopsTpl->assign('forum_topictype', getTopicTitle('', $types[$type]['type_name'], $types[$type]['type_color'])); |
266 | 266 | } |
267 | 267 | $xoopsTpl->assign_by_ref('typeOptions', $typeOptions); |
@@ -270,11 +270,11 @@ discard block |
||
270 | 270 | unset($query_status['status']); |
271 | 271 | $page_query_status = implode('&', array_values($query_status)); |
272 | 272 | unset($query_status); |
273 | -$xoopsTpl->assign('newpost_link', XOOPS_URL . '/modules/newbb/viewpost.php?status=new&forum=' . $forumObject->getVar('forum_id')); |
|
274 | -$xoopsTpl->assign('all_link', XOOPS_URL . "/modules/newbb/viewforum.php?{$page_query_status}"); |
|
275 | -$xoopsTpl->assign('digest_link', XOOPS_URL . "/modules/newbb/viewforum.php?{$page_query_status}&status=digest"); |
|
276 | -$xoopsTpl->assign('unreplied_link', XOOPS_URL . "/modules/newbb/viewforum.php?{$page_query_status}&status=unreplied"); |
|
277 | -$xoopsTpl->assign('unread_link', XOOPS_URL . "/modules/newbb/viewforum.php?{$page_query_status}&status=unread"); |
|
273 | +$xoopsTpl->assign('newpost_link', XOOPS_URL.'/modules/newbb/viewpost.php?status=new&forum='.$forumObject->getVar('forum_id')); |
|
274 | +$xoopsTpl->assign('all_link', XOOPS_URL."/modules/newbb/viewforum.php?{$page_query_status}"); |
|
275 | +$xoopsTpl->assign('digest_link', XOOPS_URL."/modules/newbb/viewforum.php?{$page_query_status}&status=digest"); |
|
276 | +$xoopsTpl->assign('unreplied_link', XOOPS_URL."/modules/newbb/viewforum.php?{$page_query_status}&status=unreplied"); |
|
277 | +$xoopsTpl->assign('unread_link', XOOPS_URL."/modules/newbb/viewforum.php?{$page_query_status}&status=unread"); |
|
278 | 278 | switch ($status) { |
279 | 279 | case 'digest': |
280 | 280 | $current_status = _MD_NEWBB_DIGEST; |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | } |
323 | 323 | |
324 | 324 | if (!empty($GLOBALS['xoopsModuleConfig']['show_jump'])) { |
325 | - require_once __DIR__ . '/include/functions.forum.php'; |
|
325 | + require_once __DIR__.'/include/functions.forum.php'; |
|
326 | 326 | $xoopsTpl->assign('forum_jumpbox', newbbMakeJumpbox($forum_id)); |
327 | 327 | } |
328 | 328 | |
@@ -335,8 +335,8 @@ discard block |
||
335 | 335 | } |
336 | 336 | |
337 | 337 | if (1 == $GLOBALS['xoopsModuleConfig']['rss_enable']) { |
338 | - $xoopsTpl->assign('rss_button', "<div align='right'><a href='" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/rss.php?f=' . $forum_id . "' title='RSS feed' target='_blank'>" . newbbDisplayImage('rss', 'RSS feed') . '</a></div>'); |
|
338 | + $xoopsTpl->assign('rss_button', "<div align='right'><a href='".XOOPS_URL.'/modules/'.$xoopsModule->dirname().'/rss.php?f='.$forum_id."' title='RSS feed' target='_blank'>".newbbDisplayImage('rss', 'RSS feed').'</a></div>'); |
|
339 | 339 | } |
340 | 340 | // irmtfan move to footer.php |
341 | -require_once __DIR__ . '/footer.php'; |
|
341 | +require_once __DIR__.'/footer.php'; |
|
342 | 342 | include $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 __DIR__ . '/../include/functions.config.php'; |
|
29 | -require_once __DIR__ . '/../include/functions.time.php'; |
|
30 | -require_once __DIR__ . '/../include/functions.session.php'; |
|
31 | -require_once __DIR__ . '/../include/functions.render.php'; |
|
32 | -require_once __DIR__ . '/../include/functions.user.php'; |
|
28 | +require_once __DIR__.'/../include/functions.config.php'; |
|
29 | +require_once __DIR__.'/../include/functions.time.php'; |
|
30 | +require_once __DIR__.'/../include/functions.session.php'; |
|
31 | +require_once __DIR__.'/../include/functions.render.php'; |
|
32 | +require_once __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,7 +59,7 @@ 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 | 64 | $topicRenderer->config['topics_per_page'] = (int)$options[6]; // number of topics (items) to display |
65 | 65 | } |
@@ -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 |
@@ -180,20 +180,20 @@ discard block |
||
180 | 180 | |
181 | 181 | // forum element |
182 | 182 | $optionsForum = explode(',', $options[12]); |
183 | - require_once __DIR__ . '/../include/functions.forum.php'; |
|
183 | + require_once __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); |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | use Xmf\Request; |
13 | 13 | use XoopsModules\Newbb; |
14 | 14 | |
15 | -require_once __DIR__ . '/header.php'; |
|
15 | +require_once __DIR__.'/header.php'; |
|
16 | 16 | |
17 | 17 | //$xoopsOption['xoops_module_header']= $xoops_module_header; |
18 | 18 | $GLOBALS['xoopsOption']['template_main'] = 'newbb_viewall.tpl'; |
@@ -21,13 +21,13 @@ discard block |
||
21 | 21 | // irmtfan new method |
22 | 22 | if (!empty($GLOBALS['xoopsModuleConfig']['rss_enable'])) { |
23 | 23 | $xoopsTpl->assign('xoops_module_header', ' |
24 | - <link rel="alternate" type="application/xml+rss" title="' . $xoopsModule->getVar('name') . '" href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/rss.php" /> |
|
24 | + <link rel="alternate" type="application/xml+rss" title="' . $xoopsModule->getVar('name').'" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/rss.php" /> |
|
25 | 25 | ' . @$xoopsTpl->get_template_vars('xoops_module_header')); |
26 | 26 | } |
27 | 27 | //$xoopsTpl->assign('xoops_module_header', $xoops_module_header); |
28 | 28 | |
29 | -require_once __DIR__ . '/include/functions.time.php'; |
|
30 | -require_once __DIR__ . '/include/functions.render.php'; |
|
29 | +require_once __DIR__.'/include/functions.time.php'; |
|
30 | +require_once __DIR__.'/include/functions.render.php'; |
|
31 | 31 | |
32 | 32 | // irmtfan use require_once because it will redeclared in newbb/blocks/list_topic.php |
33 | 33 | //require_once __DIR__ . '/./class/TopicRenderer.php'; |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $xoopsTpl->assign('newpost_link', 'viewpost.php?status=new'); |
88 | 88 | |
89 | 89 | if (!empty($GLOBALS['xoopsModuleConfig']['show_jump'])) { |
90 | - require_once __DIR__ . '/include/functions.forum.php'; |
|
90 | + require_once __DIR__.'/include/functions.forum.php'; |
|
91 | 91 | $xoopsTpl->assign('forum_jumpbox', newbbMakeJumpbox()); |
92 | 92 | } |
93 | 93 | $xoopsTpl->assign('menumode', $menumode); |
@@ -95,12 +95,12 @@ discard block |
||
95 | 95 | |
96 | 96 | $xoopsTpl->assign('mode', $mode); |
97 | 97 | $xoopsTpl->assign('status', $status); |
98 | -$xoopsTpl->assign('viewer_level', $topic_renderer->userlevel);// irmtfan use userlevel |
|
98 | +$xoopsTpl->assign('viewer_level', $topic_renderer->userlevel); // irmtfan use userlevel |
|
99 | 99 | |
100 | 100 | $pagetitle = sprintf(_MD_NEWBB_FORUMINDEX, htmlspecialchars($GLOBALS['xoopsConfig']['sitename'], ENT_QUOTES)); |
101 | 101 | $xoopsTpl->assign('forum_index_title', $pagetitle); |
102 | 102 | $xoopsTpl->assign('xoops_pagetitle', $pagetitle); |
103 | 103 | |
104 | 104 | // irmtfan move to footer.php |
105 | -require_once __DIR__ . '/footer.php'; |
|
105 | +require_once __DIR__.'/footer.php'; |
|
106 | 106 | include $GLOBALS['xoops']->path('footer.php'); |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | use Xmf\Request; |
13 | 13 | use XoopsModules\Newbb; |
14 | 14 | |
15 | -require_once __DIR__ . '/header.php'; |
|
15 | +require_once __DIR__.'/header.php'; |
|
16 | 16 | |
17 | 17 | foreach (['forum', 'topic_id', 'post_id', 'order'] as $getint) { |
18 | 18 | ${$getint} = Request::getInt($getint, 0, 'GET'); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $query_array = []; |
65 | 65 | foreach ($query_vars as $var) { |
66 | 66 | if (Request::getString($var, '', 'GET')) { |
67 | - $query_array[$var] = "{$var}=" . Request::getString($var, '', 'GET'); |
|
67 | + $query_array[$var] = "{$var}=".Request::getString($var, '', 'GET'); |
|
68 | 68 | } |
69 | 69 | } |
70 | 70 | $page_query = htmlspecialchars(implode('&', array_values($query_array)), ENT_QUOTES | ENT_HTML5); |
@@ -115,8 +115,8 @@ discard block |
||
115 | 115 | $post_karma = $postObject->getVar('post_karma'); |
116 | 116 | $require_reply = $postObject->getVar('require_reply'); |
117 | 117 | |
118 | -$xoopsTpl->assign('error_message', _MD_NEWBB_EDITEDBY . ' ' . $GLOBALS['xoopsUser']->uname()); |
|
119 | -include __DIR__ . '/include/form.post.php'; |
|
118 | +$xoopsTpl->assign('error_message', _MD_NEWBB_EDITEDBY.' '.$GLOBALS['xoopsUser']->uname()); |
|
119 | +include __DIR__.'/include/form.post.php'; |
|
120 | 120 | |
121 | 121 | ///** @var Newbb\KarmaHandler $karmaHandler */ |
122 | 122 | //$karmaHandler = Newbb\Helper::getInstance()->getHandler('Karma'); |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | $posts_contextObject = $istopic ? [] : [$postHandler->get($postObject->getVar('pid'))]; |
127 | 127 | foreach ($posts_contextObject as $post_contextObject) { |
128 | 128 | if ($GLOBALS['xoopsModuleConfig']['enable_karma'] && $post_contextObject->getVar('post_karma') > 0) { |
129 | - $p_message = sprintf(_MD_NEWBB_KARMA_REQUIREMENT, '***', $post_contextObject->getVar('post_karma')) . '</div>'; |
|
129 | + $p_message = sprintf(_MD_NEWBB_KARMA_REQUIREMENT, '***', $post_contextObject->getVar('post_karma')).'</div>'; |
|
130 | 130 | } elseif ($GLOBALS['xoopsModuleConfig']['allow_require_reply'] && $post_contextObject->getVar('require_reply')) { |
131 | 131 | $p_message = _MD_NEWBB_REPLY_REQUIREMENT; |
132 | 132 | } else { |
@@ -144,11 +144,11 @@ discard block |
||
144 | 144 | |
145 | 145 | $posts_context[] = [ |
146 | 146 | 'subject' => $p_subject, |
147 | - 'meta' => _MD_NEWBB_BY . ' ' . $p_name . ' ' . _MD_NEWBB_ON . ' ' . $p_date, |
|
147 | + 'meta' => _MD_NEWBB_BY.' '.$p_name.' '._MD_NEWBB_ON.' '.$p_date, |
|
148 | 148 | 'content' => $p_message |
149 | 149 | ]; |
150 | 150 | } |
151 | 151 | $xoopsTpl->assign_by_ref('posts_context', $posts_context); |
152 | 152 | // irmtfan move to footer.php |
153 | -require_once __DIR__ . '/footer.php'; |
|
153 | +require_once __DIR__.'/footer.php'; |
|
154 | 154 | include $GLOBALS['xoops']->path('footer.php'); |
@@ -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}", ENT_QUOTES | ENT_HTML5); |
|
235 | - $search_next = '<a href="' . $search_url_next . '">' . _SR_NEXT . '</a>'; |
|
234 | + $search_url_next = htmlspecialchars($search_url."&direction=next&start={$next}", ENT_QUOTES | ENT_HTML5); |
|
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}", ENT_QUOTES | ENT_HTML5); |
|
242 | - $search_prev = '<a href="' . $search_url_prev . '">' . _SR_PREVIOUS . '</a>'; |
|
241 | + $search_url_prev = htmlspecialchars($search_url."&direction=previous&start={$prev}", ENT_QUOTES | ENT_HTML5); |
|
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'); |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | |
22 | 22 | if ((!defined('XOOPS_ROOT_PATH')) || !($GLOBALS['xoopsUser'] instanceof \XoopsUser) |
23 | 23 | || !$GLOBALS['xoopsUser']->IsAdmin()) { |
24 | - exit('Restricted access' . PHP_EOL); |
|
24 | + exit('Restricted access'.PHP_EOL); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | /** |
@@ -88,21 +88,21 @@ discard block |
||
88 | 88 | if ($tables->useTable($table)) { |
89 | 89 | $tables->alterColumn($table, $column, $attributes, $newName); |
90 | 90 | if (!$tables->executeQueue()) { |
91 | - echo '<br>' . _AM_NEWBB_UPGRADEFAILED0 . ' ' . $migrate->getLastError(); |
|
91 | + echo '<br>'._AM_NEWBB_UPGRADEFAILED0.' '.$migrate->getLastError(); |
|
92 | 92 | } |
93 | 93 | } |
94 | 94 | |
95 | 95 | //delete old HTML templates |
96 | 96 | if (count($configurator->templateFolders) > 0) { |
97 | 97 | foreach ($configurator->templateFolders as $folder) { |
98 | - $templateFolder = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $folder); |
|
98 | + $templateFolder = $GLOBALS['xoops']->path('modules/'.$moduleDirName.$folder); |
|
99 | 99 | if (is_dir($templateFolder)) { |
100 | 100 | $templateList = array_diff(scandir($templateFolder, SCANDIR_SORT_NONE), ['..', '.']); |
101 | 101 | foreach ($templateList as $k => $v) { |
102 | - $fileInfo = new \SplFileInfo($templateFolder . $v); |
|
102 | + $fileInfo = new \SplFileInfo($templateFolder.$v); |
|
103 | 103 | if ('html' === $fileInfo->getExtension() && 'index.html' !== $fileInfo->getFilename()) { |
104 | - if (file_exists($templateFolder . $v)) { |
|
105 | - unlink($templateFolder . $v); |
|
104 | + if (file_exists($templateFolder.$v)) { |
|
105 | + unlink($templateFolder.$v); |
|
106 | 106 | } |
107 | 107 | } |
108 | 108 | } |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | if (count($configurator->oldFiles) > 0) { |
115 | 115 | // foreach (array_keys($GLOBALS['uploadFolders']) as $i) { |
116 | 116 | foreach (array_keys($configurator->oldFiles) as $i) { |
117 | - $tempFile = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $configurator->oldFiles[$i]); |
|
117 | + $tempFile = $GLOBALS['xoops']->path('modules/'.$moduleDirName.$configurator->oldFiles[$i]); |
|
118 | 118 | if (is_file($tempFile)) { |
119 | 119 | unlink($tempFile); |
120 | 120 | } |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | if (count($configurator->oldFolders) > 0) { |
127 | 127 | // foreach (array_keys($GLOBALS['uploadFolders']) as $i) { |
128 | 128 | foreach (array_keys($configurator->oldFolders) as $i) { |
129 | - $tempFolder = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $configurator->oldFolders[$i]); |
|
129 | + $tempFolder = $GLOBALS['xoops']->path('modules/'.$moduleDirName.$configurator->oldFolders[$i]); |
|
130 | 130 | /* @var $folderHandler XoopsObjectHandler */ |
131 | 131 | $folderHandler = \XoopsFile::getHandler('folder', $tempFolder); |
132 | 132 | $folderHandler->delete($tempFolder); |
@@ -143,15 +143,15 @@ discard block |
||
143 | 143 | |
144 | 144 | // --- COPY blank.png FILES --------------- |
145 | 145 | if (count($configurator->copyBlankFiles) > 0) { |
146 | - $file = __DIR__ . '/../assets/images/blank.png'; |
|
146 | + $file = __DIR__.'/../assets/images/blank.png'; |
|
147 | 147 | foreach (array_keys($configurator->copyBlankFiles) as $i) { |
148 | - $dest = $configurator->copyBlankFiles[$i] . '/blank.png'; |
|
148 | + $dest = $configurator->copyBlankFiles[$i].'/blank.png'; |
|
149 | 149 | $utilityClass::copyFile($file, $dest); |
150 | 150 | } |
151 | 151 | } |
152 | 152 | |
153 | 153 | //delete .html entries from the tpl table |
154 | - $sql = 'DELETE FROM ' . $GLOBALS['xoopsDB']->prefix('tplfile') . " WHERE `tpl_module` = '" . $module->getVar('dirname', 'n') . '\' AND `tpl_file` LIKE \'%.html%\''; |
|
154 | + $sql = 'DELETE FROM '.$GLOBALS['xoopsDB']->prefix('tplfile')." WHERE `tpl_module` = '".$module->getVar('dirname', 'n').'\' AND `tpl_file` LIKE \'%.html%\''; |
|
155 | 155 | $GLOBALS['xoopsDB']->queryF($sql); |
156 | 156 | |
157 | 157 | /** @var XoopsGroupPermHandler $gpermHandler */ |
@@ -20,12 +20,12 @@ discard block |
||
20 | 20 | */ |
21 | 21 | |
22 | 22 | // defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
23 | -require_once __DIR__ . '/common.php'; |
|
23 | +require_once __DIR__.'/common.php'; |
|
24 | 24 | |
25 | 25 | $moduleDirName = basename(dirname(__DIR__)); |
26 | 26 | $uploadFolders = [ |
27 | 27 | NEWBB_UPLOAD_PATH, |
28 | - NEWBB_UPLOAD_PATH . '/thumbs' |
|
28 | + NEWBB_UPLOAD_PATH.'/thumbs' |
|
29 | 29 | ]; |
30 | 30 | |
31 | 31 | /** |
@@ -36,24 +36,24 @@ discard block |
||
36 | 36 | $moduleDirName = basename(dirname(__DIR__)); |
37 | 37 | $moduleDirNameUpper = strtoupper($moduleDirName); |
38 | 38 | return (object)[ |
39 | - 'name' => strtoupper($moduleDirName) . ' Module Configurator', |
|
39 | + 'name' => strtoupper($moduleDirName).' Module Configurator', |
|
40 | 40 | 'paths' => [ |
41 | 41 | 'dirname' => $moduleDirName, |
42 | - 'admin' => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/admin', |
|
43 | - 'modPath' => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName, |
|
44 | - 'modUrl' => XOOPS_URL . '/modules/' . $moduleDirName, |
|
45 | - 'uploadPath' => XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
46 | - 'uploadUrl' => XOOPS_UPLOAD_URL . '/' . $moduleDirName, |
|
42 | + 'admin' => XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/admin', |
|
43 | + 'modPath' => XOOPS_ROOT_PATH.'/modules/'.$moduleDirName, |
|
44 | + 'modUrl' => XOOPS_URL.'/modules/'.$moduleDirName, |
|
45 | + 'uploadPath' => XOOPS_UPLOAD_PATH.'/'.$moduleDirName, |
|
46 | + 'uploadUrl' => XOOPS_UPLOAD_URL.'/'.$moduleDirName, |
|
47 | 47 | ], |
48 | 48 | 'uploadFolders' => [ |
49 | - constant($moduleDirNameUpper . '_UPLOAD_PATH'), |
|
50 | - constant($moduleDirNameUpper . '_UPLOAD_PATH') . '/thumbs', |
|
49 | + constant($moduleDirNameUpper.'_UPLOAD_PATH'), |
|
50 | + constant($moduleDirNameUpper.'_UPLOAD_PATH').'/thumbs', |
|
51 | 51 | |
52 | 52 | //XOOPS_UPLOAD_PATH . '/flags' |
53 | 53 | ], |
54 | 54 | 'copyBlankFiles' => [ |
55 | - constant($moduleDirNameUpper . '_UPLOAD_PATH'), |
|
56 | - constant($moduleDirNameUpper . '_UPLOAD_PATH') . '/thumbs', |
|
55 | + constant($moduleDirNameUpper.'_UPLOAD_PATH'), |
|
56 | + constant($moduleDirNameUpper.'_UPLOAD_PATH').'/thumbs', |
|
57 | 57 | //XOOPS_UPLOAD_PATH . '/flags' |
58 | 58 | ], |
59 | 59 | |
@@ -88,6 +88,6 @@ discard block |
||
88 | 88 | '/images', |
89 | 89 | ], |
90 | 90 | 'modCopyright' => "<a href='https://xoops.org' title='XOOPS Project' target='_blank'> |
91 | - <img src='" . constant($moduleDirNameUpper . '_AUTHOR_LOGOIMG') . '\' alt=\'XOOPS Project\' /></a>', |
|
91 | + <img src='" . constant($moduleDirNameUpper.'_AUTHOR_LOGOIMG').'\' alt=\'XOOPS Project\' /></a>', |
|
92 | 92 | ]; |
93 | 93 | } |
@@ -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')) { |
@@ -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 | } |