@@ -66,8 +66,8 @@ discard block |
||
| 66 | 66 | global $accessForums; |
| 67 | 67 | global $xoopsLogger; |
| 68 | 68 | |
| 69 | - require_once __DIR__ . '/../include/functions.config.php'; |
|
| 70 | - require_once __DIR__ . '/../include/functions.time.php'; |
|
| 69 | + require_once __DIR__.'/../include/functions.config.php'; |
|
| 70 | + require_once __DIR__.'/../include/functions.time.php'; |
|
| 71 | 71 | |
| 72 | 72 | $myts = \MyTextSanitizer::getInstance(); |
| 73 | 73 | $block = []; |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | $extraCriteria = ''; |
| 77 | 77 | if (!empty($options[2])) { |
| 78 | 78 | //require_once __DIR__ . '/../include/functions.time.php'; |
| 79 | - $extraCriteria .= ' AND p.post_time>' . (time() - newbbGetSinceTime($options[2])); |
|
| 79 | + $extraCriteria .= ' AND p.post_time>'.(time() - newbbGetSinceTime($options[2])); |
|
| 80 | 80 | } |
| 81 | 81 | switch ($options[0]) { |
| 82 | 82 | case 'time': |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | return $block; |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | - $forumCriteria = ' AND t.forum_id IN (' . implode(',', $allowedForums) . ')'; |
|
| 105 | + $forumCriteria = ' AND t.forum_id IN ('.implode(',', $allowedForums).')'; |
|
| 106 | 106 | $approveCriteria = ' AND t.approved = 1'; |
| 107 | 107 | |
| 108 | 108 | $newbbConfig = newbbLoadConfig(); |
@@ -158,13 +158,13 @@ discard block |
||
| 158 | 158 | return $block; |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | - require_once __DIR__ . '/../include/functions.user.php'; |
|
| 161 | + require_once __DIR__.'/../include/functions.user.php'; |
|
| 162 | 162 | $author_name = newbbGetUnameFromIds(array_keys($author), $newbbConfig['show_realname'], true); |
| 163 | 163 | |
| 164 | 164 | if (count($types) > 0) { |
| 165 | 165 | /** @var Newbb\TypeHandler $typeHandler */ |
| 166 | 166 | $typeHandler = Newbb\Helper::getInstance()->getHandler('Type'); |
| 167 | - $type_list = $typeHandler->getList(new \Criteria('type_id', '(' . implode(', ', array_keys($types)) . ')', 'IN')); |
|
| 167 | + $type_list = $typeHandler->getList(new \Criteria('type_id', '('.implode(', ', array_keys($types)).')', 'IN')); |
|
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | foreach ($rows as $arr) { |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | xoops_loadLanguage('main', 'newbb'); |
| 173 | 173 | $topic = []; |
| 174 | 174 | $topic_page_jump = newbbDisplayImage('lastposticon', _MD_NEWBB_GOTOLASTPOST); |
| 175 | - $topic['topic_subject'] = empty($type_list[$arr['type_id']]) ? '' : '[' . $type_list[$arr['type_id']] . ']'; |
|
| 175 | + $topic['topic_subject'] = empty($type_list[$arr['type_id']]) ? '' : '['.$type_list[$arr['type_id']].']'; |
|
| 176 | 176 | |
| 177 | 177 | $topic['post_id'] = $arr['post_id']; |
| 178 | 178 | $topic['topic_status'] = $arr['topic_status']; |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | if (!empty($options[5])) { |
| 185 | 185 | $title = xoops_substr($title, 0, $options[5]); |
| 186 | 186 | } |
| 187 | - $topic['title'] = $topic['topic_subject'] . ' ' . $title; |
|
| 187 | + $topic['title'] = $topic['topic_subject'].' '.$title; |
|
| 188 | 188 | $topic['replies'] = $arr['topic_replies']; |
| 189 | 189 | $topic['views'] = $arr['topic_views']; |
| 190 | 190 | $topic['time'] = newbbFormatTimestamp($arr['post_time']); |
@@ -196,9 +196,9 @@ discard block |
||
| 196 | 196 | $topic['topic_poster'] = $topic_poster; |
| 197 | 197 | $topic['topic_page_jump'] = $topic_page_jump; |
| 198 | 198 | // START irmtfan remove hardcoded html in URLs - add $seo_topic_url |
| 199 | - $seo_url = XOOPS_URL . '/' . SEO_MODULE_NAME . '/viewtopic.php?post_id=' . $topic['post_id']; |
|
| 200 | - $seo_topic_url = XOOPS_URL . '/' . SEO_MODULE_NAME . '/viewtopic.php?topic_id=' . $topic['id']; |
|
| 201 | - $seo_forum_url = XOOPS_URL . '/' . SEO_MODULE_NAME . '/viewforum.php?forum=' . $topic['forum_id']; |
|
| 199 | + $seo_url = XOOPS_URL.'/'.SEO_MODULE_NAME.'/viewtopic.php?post_id='.$topic['post_id']; |
|
| 200 | + $seo_topic_url = XOOPS_URL.'/'.SEO_MODULE_NAME.'/viewtopic.php?topic_id='.$topic['id']; |
|
| 201 | + $seo_forum_url = XOOPS_URL.'/'.SEO_MODULE_NAME.'/viewforum.php?forum='.$topic['forum_id']; |
|
| 202 | 202 | if (!empty($newbbConfig['do_rewrite'])) { |
| 203 | 203 | $topic['seo_url'] = seo_urls($seo_url); |
| 204 | 204 | $topic['seo_topic_url'] = seo_urls($seo_topic_url); |
@@ -213,11 +213,11 @@ discard block |
||
| 213 | 213 | unset($topic); |
| 214 | 214 | } |
| 215 | 215 | // START irmtfan remove hardcoded html in URLs |
| 216 | - $seo_top_allforums = XOOPS_URL . '/' . SEO_MODULE_NAME; |
|
| 216 | + $seo_top_allforums = XOOPS_URL.'/'.SEO_MODULE_NAME; |
|
| 217 | 217 | $block['seo_top_allforums'] = !empty($newbbConfig['do_rewrite']) ? seo_urls($seo_top_allforums) : $seo_top_allforums; |
| 218 | - $seo_top_allforums = XOOPS_URL . '/' . SEO_MODULE_NAME . '/list.topic.php'; |
|
| 218 | + $seo_top_allforums = XOOPS_URL.'/'.SEO_MODULE_NAME.'/list.topic.php'; |
|
| 219 | 219 | $block['seo_top_alltopics'] = !empty($newbbConfig['do_rewrite']) ? seo_urls($seo_top_allforums) : $seo_top_allforums; |
| 220 | - $seo_top_allforums = XOOPS_URL . '/' . SEO_MODULE_NAME . '/viewpost.php'; |
|
| 220 | + $seo_top_allforums = XOOPS_URL.'/'.SEO_MODULE_NAME.'/viewpost.php'; |
|
| 221 | 221 | $block['seo_top_allposts'] = !empty($newbbConfig['do_rewrite']) ? seo_urls($seo_top_allforums) : $seo_top_allforums; |
| 222 | 222 | // END irmtfan remove hardcoded html in URLs |
| 223 | 223 | $block['indexNav'] = (int)$options[4]; |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | function b_newbb_topic_show($options) |
| 241 | 241 | { |
| 242 | 242 | global $accessForums; |
| 243 | - require_once __DIR__ . '/../include/functions.time.php'; |
|
| 243 | + require_once __DIR__.'/../include/functions.time.php'; |
|
| 244 | 244 | $myts = \MyTextSanitizer::getInstance(); |
| 245 | 245 | $block = []; |
| 246 | 246 | $i = 0; |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | $time_criteria = null; |
| 250 | 250 | if (!empty($options[2])) { |
| 251 | 251 | $time_criteria = time() - newbbGetSinceTime($options[2]); |
| 252 | - $extraCriteria = ' AND t.topic_time>' . $time_criteria; |
|
| 252 | + $extraCriteria = ' AND t.topic_time>'.$time_criteria; |
|
| 253 | 253 | } |
| 254 | 254 | switch ($options[0]) { |
| 255 | 255 | case 'views': |
@@ -262,11 +262,11 @@ discard block |
||
| 262 | 262 | $order = 't.digest_time'; |
| 263 | 263 | $extraCriteria = ' AND t.topic_digest=1'; |
| 264 | 264 | if (null !== $time_criteria) { |
| 265 | - $extraCriteria .= ' AND t.digest_time>' . $time_criteria; |
|
| 265 | + $extraCriteria .= ' AND t.digest_time>'.$time_criteria; |
|
| 266 | 266 | } |
| 267 | 267 | break; |
| 268 | 268 | case 'sticky': |
| 269 | - $order = 't.topic_id'; |
|
| 269 | + $order = 't.topic_id'; |
|
| 270 | 270 | $extraCriteria .= ' AND t.topic_sticky=1'; |
| 271 | 271 | break; |
| 272 | 272 | case 'time': |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | return false; |
| 303 | 303 | } |
| 304 | 304 | |
| 305 | - $forumCriteria = ' AND t.forum_id IN (' . implode(',', $allowedForums) . ')'; |
|
| 305 | + $forumCriteria = ' AND t.forum_id IN ('.implode(',', $allowedForums).')'; |
|
| 306 | 306 | $approveCriteria = ' AND t.approved = 1'; |
| 307 | 307 | |
| 308 | 308 | $query = 'SELECT' |
@@ -342,19 +342,19 @@ discard block |
||
| 342 | 342 | if (count($rows) < 1) { |
| 343 | 343 | return $block; |
| 344 | 344 | } |
| 345 | - require_once __DIR__ . '/../include/functions.user.php'; |
|
| 345 | + require_once __DIR__.'/../include/functions.user.php'; |
|
| 346 | 346 | $author_name = newbbGetUnameFromIds(array_keys($author), $newbbConfig['show_realname'], true); |
| 347 | 347 | if (count($types) > 0) { |
| 348 | 348 | /** @var Newbb\TypeHandler $typeHandler */ |
| 349 | 349 | $typeHandler = Newbb\Helper::getInstance()->getHandler('Type'); |
| 350 | - $type_list = $typeHandler->getList(new \Criteria('type_id', '(' . implode(', ', array_keys($types)) . ')', 'IN')); |
|
| 350 | + $type_list = $typeHandler->getList(new \Criteria('type_id', '('.implode(', ', array_keys($types)).')', 'IN')); |
|
| 351 | 351 | } |
| 352 | 352 | |
| 353 | 353 | foreach ($rows as $arr) { |
| 354 | 354 | // irmtfan remove $topic_page_jump because there is no last post |
| 355 | 355 | //$topic_page_jump = ''; |
| 356 | 356 | $topic = []; |
| 357 | - $topic['topic_subject'] = empty($type_list[$arr['type_id']]) ? '' : '[' . $type_list[$arr['type_id']] . '] '; |
|
| 357 | + $topic['topic_subject'] = empty($type_list[$arr['type_id']]) ? '' : '['.$type_list[$arr['type_id']].'] '; |
|
| 358 | 358 | $topic['forum_id'] = $arr['forum_id']; |
| 359 | 359 | $topic['forum_name'] = $myts->htmlSpecialChars($arr['forum_name']); |
| 360 | 360 | $topic['id'] = $arr['topic_id']; |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | if (!empty($options[5])) { |
| 364 | 364 | $title = xoops_substr($title, 0, $options[5]); |
| 365 | 365 | } |
| 366 | - $topic['title'] = $topic['topic_subject'] . $title; |
|
| 366 | + $topic['title'] = $topic['topic_subject'].$title; |
|
| 367 | 367 | $topic['replies'] = $arr['topic_replies']; |
| 368 | 368 | $topic['views'] = $arr['topic_views']; |
| 369 | 369 | $topic['time'] = newbbFormatTimestamp($arr['topic_time']); |
@@ -376,8 +376,8 @@ discard block |
||
| 376 | 376 | // irmtfan remove $topic_page_jump because there is no last post |
| 377 | 377 | //$topic['topic_page_jump'] = $topic_page_jump; |
| 378 | 378 | // START irmtfan remove hardcoded html in URLs - add $seo_topic_url |
| 379 | - $seo_topic_url = XOOPS_URL . '/' . SEO_MODULE_NAME . '/viewtopic.php?topic_id=' . $topic['id']; |
|
| 380 | - $seo_forum_url = XOOPS_URL . '/' . SEO_MODULE_NAME . '/viewforum.php?forum=' . $topic['forum_id']; |
|
| 379 | + $seo_topic_url = XOOPS_URL.'/'.SEO_MODULE_NAME.'/viewtopic.php?topic_id='.$topic['id']; |
|
| 380 | + $seo_forum_url = XOOPS_URL.'/'.SEO_MODULE_NAME.'/viewforum.php?forum='.$topic['forum_id']; |
|
| 381 | 381 | |
| 382 | 382 | if (!empty($newbbConfig['do_rewrite'])) { |
| 383 | 383 | $topic['seo_topic_url'] = seo_urls($seo_topic_url); |
@@ -391,11 +391,11 @@ discard block |
||
| 391 | 391 | unset($topic); |
| 392 | 392 | } |
| 393 | 393 | // START irmtfan remove hardcoded html in URLs |
| 394 | - $seo_top_allforums = XOOPS_URL . '/' . SEO_MODULE_NAME; |
|
| 394 | + $seo_top_allforums = XOOPS_URL.'/'.SEO_MODULE_NAME; |
|
| 395 | 395 | $block['seo_top_allforums'] = !empty($newbbConfig['do_rewrite']) ? seo_urls($seo_top_allforums) : $seo_top_allforums; |
| 396 | - $seo_top_allforums = XOOPS_URL . '/' . SEO_MODULE_NAME . '/list.topic.php'; |
|
| 396 | + $seo_top_allforums = XOOPS_URL.'/'.SEO_MODULE_NAME.'/list.topic.php'; |
|
| 397 | 397 | $block['seo_top_alltopics'] = !empty($newbbConfig['do_rewrite']) ? seo_urls($seo_top_allforums) : $seo_top_allforums; |
| 398 | - $seo_top_allforums = XOOPS_URL . '/' . SEO_MODULE_NAME . '/viewpost.php'; |
|
| 398 | + $seo_top_allforums = XOOPS_URL.'/'.SEO_MODULE_NAME.'/viewpost.php'; |
|
| 399 | 399 | $block['seo_top_allposts'] = !empty($newbbConfig['do_rewrite']) ? seo_urls($seo_top_allforums) : $seo_top_allforums; |
| 400 | 400 | // END irmtfan remove hardcoded html in URLs |
| 401 | 401 | $block['indexNav'] = (int)$options[4]; |
@@ -420,7 +420,7 @@ discard block |
||
| 420 | 420 | global $accessForums; |
| 421 | 421 | global $newbbConfig; |
| 422 | 422 | |
| 423 | - require_once __DIR__ . '/../include/functions.time.php'; |
|
| 423 | + require_once __DIR__.'/../include/functions.time.php'; |
|
| 424 | 424 | $myts = \MyTextSanitizer::getInstance(); |
| 425 | 425 | $block = []; |
| 426 | 426 | $i = 0; |
@@ -429,7 +429,7 @@ discard block |
||
| 429 | 429 | $time_criteria = null; |
| 430 | 430 | if (!empty($options[2])) { |
| 431 | 431 | $time_criteria = time() - newbbGetSinceTime($options[2]); |
| 432 | - $extraCriteria = ' AND p.post_time>' . $time_criteria; |
|
| 432 | + $extraCriteria = ' AND p.post_time>'.$time_criteria; |
|
| 433 | 433 | } |
| 434 | 434 | |
| 435 | 435 | switch ($options[0]) { |
@@ -473,7 +473,7 @@ discard block |
||
| 473 | 473 | return $block; |
| 474 | 474 | } |
| 475 | 475 | |
| 476 | - $forumCriteria = ' AND p.forum_id IN (' . implode(',', $allowedForums) . ')'; |
|
| 476 | + $forumCriteria = ' AND p.forum_id IN ('.implode(',', $allowedForums).')'; |
|
| 477 | 477 | $approveCriteria = ' AND p.approved = 1'; |
| 478 | 478 | |
| 479 | 479 | $query = 'SELECT'; |
@@ -481,11 +481,11 @@ discard block |
||
| 481 | 481 | if ('text' === $options[0]) { |
| 482 | 482 | $query .= ' pt.dohtml, pt.dosmiley, pt.doxcode, pt.dobr, pt.post_text,'; |
| 483 | 483 | } |
| 484 | - $query .= ' f.forum_id, f.forum_name' . ' FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_posts') . ' AS p ' . ' LEFT JOIN ' . $GLOBALS['xoopsDB']->prefix('newbb_forums') . ' AS f ON f.forum_id=p.forum_id'; |
|
| 484 | + $query .= ' f.forum_id, f.forum_name'.' FROM '.$GLOBALS['xoopsDB']->prefix('newbb_posts').' AS p '.' LEFT JOIN '.$GLOBALS['xoopsDB']->prefix('newbb_forums').' AS f ON f.forum_id=p.forum_id'; |
|
| 485 | 485 | if ('text' === $options[0]) { |
| 486 | - $query .= ' LEFT JOIN ' . $GLOBALS['xoopsDB']->prefix('newbb_posts_text') . ' AS pt ON pt.post_id=p.post_id'; |
|
| 486 | + $query .= ' LEFT JOIN '.$GLOBALS['xoopsDB']->prefix('newbb_posts_text').' AS pt ON pt.post_id=p.post_id'; |
|
| 487 | 487 | } |
| 488 | - $query .= ' WHERE 1=1 ' . $forumCriteria . $approveCriteria . $extraCriteria . ' ORDER BY ' . $order . ' DESC'; |
|
| 488 | + $query .= ' WHERE 1=1 '.$forumCriteria.$approveCriteria.$extraCriteria.' ORDER BY '.$order.' DESC'; |
|
| 489 | 489 | |
| 490 | 490 | $result = $GLOBALS['xoopsDB']->query($query, $options[1], 0); |
| 491 | 491 | if (!$result) { |
@@ -502,15 +502,15 @@ discard block |
||
| 502 | 502 | if (count($rows) < 1) { |
| 503 | 503 | return $block; |
| 504 | 504 | } |
| 505 | - require_once __DIR__ . '/../include/functions.user.php'; |
|
| 505 | + require_once __DIR__.'/../include/functions.user.php'; |
|
| 506 | 506 | $author_name = newbbGetUnameFromIds(array_keys($author), $newbbConfig['show_realname'], true); |
| 507 | 507 | |
| 508 | 508 | foreach ($rows as $arr) { |
| 509 | 509 | //if ($arr['icon'] && is_file($GLOBALS['xoops']->path('images/subject/' . $arr['icon']))) { |
| 510 | 510 | if (!empty($arr['icon'])) { |
| 511 | - $last_post_icon = '<img src="' . XOOPS_URL . '/images/subject/' . htmlspecialchars($arr['icon']) . '" alt="" />'; |
|
| 511 | + $last_post_icon = '<img src="'.XOOPS_URL.'/images/subject/'.htmlspecialchars($arr['icon']).'" alt="" />'; |
|
| 512 | 512 | } else { |
| 513 | - $last_post_icon = '<img src="' . XOOPS_URL . '/images/subject/icon1.gif" alt="" />'; |
|
| 513 | + $last_post_icon = '<img src="'.XOOPS_URL.'/images/subject/icon1.gif" alt="" />'; |
|
| 514 | 514 | } |
| 515 | 515 | //$topic['jump_post'] = "<a href='" . XOOPS_URL . "/modules/newbb/viewtopic.php?post_id=" . $arr['post_id'] ."#forumpost" . $arr['post_id'] . "'>" . $last_post_icon . '</a>'; |
| 516 | 516 | $topic = []; |
@@ -540,8 +540,8 @@ discard block |
||
| 540 | 540 | $topic['post_text'] = $post_text; |
| 541 | 541 | } |
| 542 | 542 | // START irmtfan remove hardcoded html in URLs |
| 543 | - $seo_url = XOOPS_URL . '/' . SEO_MODULE_NAME . '/viewtopic.php?post_id=' . $topic['post_id']; |
|
| 544 | - $seo_forum_url = XOOPS_URL . '/' . SEO_MODULE_NAME . '/viewforum.php?forum=' . $topic['forum_id']; |
|
| 543 | + $seo_url = XOOPS_URL.'/'.SEO_MODULE_NAME.'/viewtopic.php?post_id='.$topic['post_id']; |
|
| 544 | + $seo_forum_url = XOOPS_URL.'/'.SEO_MODULE_NAME.'/viewforum.php?forum='.$topic['forum_id']; |
|
| 545 | 545 | // END irmtfan remove hardcoded html in URLs |
| 546 | 546 | if (!empty($newbbConfig['do_rewrite'])) { |
| 547 | 547 | $topic['seo_url'] = seo_urls($seo_url); |
@@ -555,11 +555,11 @@ discard block |
||
| 555 | 555 | unset($topic); |
| 556 | 556 | } |
| 557 | 557 | // START irmtfan remove hardcoded html in URLs |
| 558 | - $seo_top_allforums = XOOPS_URL . '/' . SEO_MODULE_NAME; |
|
| 558 | + $seo_top_allforums = XOOPS_URL.'/'.SEO_MODULE_NAME; |
|
| 559 | 559 | $block['seo_top_allforums'] = !empty($newbbConfig['do_rewrite']) ? seo_urls($seo_top_allforums) : $seo_top_allforums; |
| 560 | - $seo_top_allforums = XOOPS_URL . '/' . SEO_MODULE_NAME . '/list.topic.php'; |
|
| 560 | + $seo_top_allforums = XOOPS_URL.'/'.SEO_MODULE_NAME.'/list.topic.php'; |
|
| 561 | 561 | $block['seo_top_alltopics'] = !empty($newbbConfig['do_rewrite']) ? seo_urls($seo_top_allforums) : $seo_top_allforums; |
| 562 | - $seo_top_allforums = XOOPS_URL . '/' . SEO_MODULE_NAME . '/viewpost.php'; |
|
| 562 | + $seo_top_allforums = XOOPS_URL.'/'.SEO_MODULE_NAME.'/viewpost.php'; |
|
| 563 | 563 | $block['seo_top_allposts'] = !empty($newbbConfig['do_rewrite']) ? seo_urls($seo_top_allforums) : $seo_top_allforums; |
| 564 | 564 | // END irmtfan remove hardcoded html in URLs |
| 565 | 565 | |
@@ -592,9 +592,9 @@ discard block |
||
| 592 | 592 | $extraCriteria = ''; |
| 593 | 593 | $time_criteria = null; |
| 594 | 594 | if (!empty($options[2])) { |
| 595 | - require_once __DIR__ . '/../include/functions.time.php'; |
|
| 595 | + require_once __DIR__.'/../include/functions.time.php'; |
|
| 596 | 596 | $time_criteria = time() - newbbGetSinceTime($options[2]); |
| 597 | - $extraCriteria = ' AND topic_time > ' . $time_criteria; |
|
| 597 | + $extraCriteria = ' AND topic_time > '.$time_criteria; |
|
| 598 | 598 | } |
| 599 | 599 | switch ($options[0]) { |
| 600 | 600 | case 'topic': |
@@ -602,7 +602,7 @@ discard block |
||
| 602 | 602 | case 'digest': |
| 603 | 603 | $extraCriteria = ' AND topic_digest = 1'; |
| 604 | 604 | if (null !== $time_criteria) { |
| 605 | - $extraCriteria .= ' AND digest_time > ' . $time_criteria; |
|
| 605 | + $extraCriteria .= ' AND digest_time > '.$time_criteria; |
|
| 606 | 606 | } |
| 607 | 607 | break; |
| 608 | 608 | case 'sticky': |
@@ -612,7 +612,7 @@ discard block |
||
| 612 | 612 | default: |
| 613 | 613 | $type = 'post'; |
| 614 | 614 | if (null !== $time_criteria) { |
| 615 | - $extraCriteria = ' AND post_time > ' . $time_criteria; |
|
| 615 | + $extraCriteria = ' AND post_time > '.$time_criteria; |
|
| 616 | 616 | } |
| 617 | 617 | break; |
| 618 | 618 | } |
@@ -636,17 +636,17 @@ discard block |
||
| 636 | 636 | } |
| 637 | 637 | |
| 638 | 638 | if ('topic' === $type) { |
| 639 | - $forumCriteria = ' AND forum_id IN (' . implode(',', $allowedForums) . ')'; |
|
| 639 | + $forumCriteria = ' AND forum_id IN ('.implode(',', $allowedForums).')'; |
|
| 640 | 640 | $approveCriteria = ' AND approved = 1'; |
| 641 | 641 | $query = 'SELECT DISTINCT topic_poster AS author, COUNT(*) AS count |
| 642 | - FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_topics') . ' |
|
| 643 | - WHERE topic_poster>0 ' . $forumCriteria . $approveCriteria . $extraCriteria . ' GROUP BY topic_poster ORDER BY ' . $order . ' DESC'; |
|
| 642 | + FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_topics').' |
|
| 643 | + WHERE topic_poster>0 ' . $forumCriteria.$approveCriteria.$extraCriteria.' GROUP BY topic_poster ORDER BY '.$order.' DESC'; |
|
| 644 | 644 | } else { |
| 645 | - $forumCriteria = ' AND forum_id IN (' . implode(',', $allowedForums) . ')'; |
|
| 645 | + $forumCriteria = ' AND forum_id IN ('.implode(',', $allowedForums).')'; |
|
| 646 | 646 | $approveCriteria = ' AND approved = 1'; |
| 647 | 647 | $query = 'SELECT DISTINCT uid AS author, COUNT(*) AS count |
| 648 | - FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_posts') . ' |
|
| 649 | - WHERE uid > 0 ' . $forumCriteria . $approveCriteria . $extraCriteria . ' GROUP BY uid ORDER BY ' . $order . ' DESC'; |
|
| 648 | + FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_posts').' |
|
| 649 | + WHERE uid > 0 ' . $forumCriteria.$approveCriteria.$extraCriteria.' GROUP BY uid ORDER BY '.$order.' DESC'; |
|
| 650 | 650 | } |
| 651 | 651 | |
| 652 | 652 | $result = $GLOBALS['xoopsDB']->query($query, $options[1], 0); |
@@ -661,12 +661,12 @@ discard block |
||
| 661 | 661 | if (count($author) < 1) { |
| 662 | 662 | return $block; |
| 663 | 663 | } |
| 664 | - require_once __DIR__ . '/../include/functions.user.php'; |
|
| 664 | + require_once __DIR__.'/../include/functions.user.php'; |
|
| 665 | 665 | $author_name = newbbGetUnameFromIds(array_keys($author), $newbbConfig['show_realname']); |
| 666 | 666 | foreach (array_keys($author) as $uid) { |
| 667 | 667 | $author[$uid]['name'] = $myts->htmlSpecialChars($author_name[$uid]); |
| 668 | 668 | } |
| 669 | - $block['authors'] =& $author; |
|
| 669 | + $block['authors'] = & $author; |
|
| 670 | 670 | $block['disp_mode'] = $options[3]; // 0 - full view; 1 - lite view; |
| 671 | 671 | $block['indexNav'] = (int)$options[4]; |
| 672 | 672 | |
@@ -679,45 +679,45 @@ discard block |
||
| 679 | 679 | */ |
| 680 | 680 | function b_newbb_edit($options) |
| 681 | 681 | { |
| 682 | - require_once __DIR__ . '/../include/functions.forum.php'; |
|
| 682 | + require_once __DIR__.'/../include/functions.forum.php'; |
|
| 683 | 683 | |
| 684 | - $form = _MB_NEWBB_CRITERIA . "<select name='options[0]'>"; |
|
| 684 | + $form = _MB_NEWBB_CRITERIA."<select name='options[0]'>"; |
|
| 685 | 685 | $form .= "<option value='time'"; |
| 686 | 686 | if ('time' === $options[0]) { |
| 687 | 687 | $form .= " selected='selected' "; |
| 688 | 688 | } |
| 689 | - $form .= '>' . _MB_NEWBB_CRITERIA_TIME . '</option>'; |
|
| 689 | + $form .= '>'._MB_NEWBB_CRITERIA_TIME.'</option>'; |
|
| 690 | 690 | $form .= '</select>'; |
| 691 | - $form .= '<br>' . _MB_NEWBB_DISPLAY . "<input type='text' name='options[1]' value='" . $options[1] . "' />"; |
|
| 692 | - $form .= '<br>' . _MB_NEWBB_TIME . "<input type='text' name='options[2]' value='" . $options[2] . "' />"; |
|
| 693 | - $form .= '<br> <small>' . _MB_NEWBB_TIME_DESC . '</small>'; |
|
| 694 | - $form .= '<br>' . _MB_NEWBB_DISPLAYMODE . "<input type='radio' name='options[3]' value='0'"; |
|
| 691 | + $form .= '<br>'._MB_NEWBB_DISPLAY."<input type='text' name='options[1]' value='".$options[1]."' />"; |
|
| 692 | + $form .= '<br>'._MB_NEWBB_TIME."<input type='text' name='options[2]' value='".$options[2]."' />"; |
|
| 693 | + $form .= '<br> <small>'._MB_NEWBB_TIME_DESC.'</small>'; |
|
| 694 | + $form .= '<br>'._MB_NEWBB_DISPLAYMODE."<input type='radio' name='options[3]' value='0'"; |
|
| 695 | 695 | if (0 == $options[3]) { |
| 696 | 696 | $form .= ' checked'; |
| 697 | 697 | } |
| 698 | - $form .= ' /> ' . _MB_NEWBB_DISPLAYMODE_FULL . "<input type='radio' name='options[3]' value='1'"; |
|
| 698 | + $form .= ' /> '._MB_NEWBB_DISPLAYMODE_FULL."<input type='radio' name='options[3]' value='1'"; |
|
| 699 | 699 | if (1 == $options[3]) { |
| 700 | 700 | $form .= ' checked'; |
| 701 | 701 | } |
| 702 | - $form .= ' /> ' . _MB_NEWBB_DISPLAYMODE_COMPACT . "<input type='radio' name='options[3]' value='2'"; |
|
| 702 | + $form .= ' /> '._MB_NEWBB_DISPLAYMODE_COMPACT."<input type='radio' name='options[3]' value='2'"; |
|
| 703 | 703 | if (2 == $options[3]) { |
| 704 | 704 | $form .= ' checked'; |
| 705 | 705 | } |
| 706 | - $form .= ' /> ' . _MB_NEWBB_DISPLAYMODE_LITE; |
|
| 706 | + $form .= ' /> '._MB_NEWBB_DISPLAYMODE_LITE; |
|
| 707 | 707 | |
| 708 | - $form .= '<br>' . _MB_NEWBB_INDEXNAV . '<input type="radio" name="options[4]" value="1"'; |
|
| 708 | + $form .= '<br>'._MB_NEWBB_INDEXNAV.'<input type="radio" name="options[4]" value="1"'; |
|
| 709 | 709 | if (1 == $options[4]) { |
| 710 | 710 | $form .= ' checked'; |
| 711 | 711 | } |
| 712 | - $form .= ' />' . _YES . '<input type="radio" name="options[4]" value="0"'; |
|
| 712 | + $form .= ' />'._YES.'<input type="radio" name="options[4]" value="0"'; |
|
| 713 | 713 | if (0 == $options[4]) { |
| 714 | 714 | $form .= ' checked'; |
| 715 | 715 | } |
| 716 | - $form .= ' />' . _NO; |
|
| 716 | + $form .= ' />'._NO; |
|
| 717 | 717 | |
| 718 | - $form .= '<br>' . _MB_NEWBB_TITLE_LENGTH . "<input type='text' name='options[5]' value='" . $options[5] . "' />"; |
|
| 718 | + $form .= '<br>'._MB_NEWBB_TITLE_LENGTH."<input type='text' name='options[5]' value='".$options[5]."' />"; |
|
| 719 | 719 | |
| 720 | - $form .= '<br><br>' . _MB_NEWBB_FORUMLIST; |
|
| 720 | + $form .= '<br><br>'._MB_NEWBB_FORUMLIST; |
|
| 721 | 721 | |
| 722 | 722 | $optionsForum = array_filter(array_slice($options, 6), 'b_newbb_array_filter'); // get allowed forums |
| 723 | 723 | $isAll = (0 === count($optionsForum) || empty($optionsForum[0])); |
@@ -726,7 +726,7 @@ discard block |
||
| 726 | 726 | if ($isAll) { |
| 727 | 727 | $form .= ' selected'; |
| 728 | 728 | } |
| 729 | - $form .= '>' . _ALL . '</option>'; |
|
| 729 | + $form .= '>'._ALL.'</option>'; |
|
| 730 | 730 | $form .= newbbForumSelectBox($optionsForum); |
| 731 | 731 | $form .= '</select><br>'; |
| 732 | 732 | |
@@ -739,64 +739,64 @@ discard block |
||
| 739 | 739 | */ |
| 740 | 740 | function b_newbb_topic_edit($options) |
| 741 | 741 | { |
| 742 | - require_once __DIR__ . '/../include/functions.forum.php'; |
|
| 743 | - $form = _MB_NEWBB_CRITERIA . "<select name='options[0]'>"; |
|
| 742 | + require_once __DIR__.'/../include/functions.forum.php'; |
|
| 743 | + $form = _MB_NEWBB_CRITERIA."<select name='options[0]'>"; |
|
| 744 | 744 | $form .= "<option value='time'"; |
| 745 | 745 | if ('time' === $options[0]) { |
| 746 | 746 | $form .= " selected='selected' "; |
| 747 | 747 | } |
| 748 | - $form .= '>' . _MB_NEWBB_CRITERIA_TIME . '</option>'; |
|
| 748 | + $form .= '>'._MB_NEWBB_CRITERIA_TIME.'</option>'; |
|
| 749 | 749 | $form .= "<option value='views'"; |
| 750 | 750 | if ('views' === $options[0]) { |
| 751 | 751 | $form .= " selected='selected' "; |
| 752 | 752 | } |
| 753 | - $form .= '>' . _MB_NEWBB_CRITERIA_VIEWS . '</option>'; |
|
| 753 | + $form .= '>'._MB_NEWBB_CRITERIA_VIEWS.'</option>'; |
|
| 754 | 754 | $form .= "<option value='replies'"; |
| 755 | 755 | if ('replies' === $options[0]) { |
| 756 | 756 | $form .= " selected='selected' "; |
| 757 | 757 | } |
| 758 | - $form .= '>' . _MB_NEWBB_CRITERIA_REPLIES . '</option>'; |
|
| 758 | + $form .= '>'._MB_NEWBB_CRITERIA_REPLIES.'</option>'; |
|
| 759 | 759 | $form .= "<option value='digest'"; |
| 760 | 760 | if ('digest' === $options[0]) { |
| 761 | 761 | $form .= " selected='selected' "; |
| 762 | 762 | } |
| 763 | - $form .= '>' . _MB_NEWBB_CRITERIA_DIGEST . '</option>'; |
|
| 763 | + $form .= '>'._MB_NEWBB_CRITERIA_DIGEST.'</option>'; |
|
| 764 | 764 | $form .= "<option value='sticky'"; |
| 765 | 765 | if ('sticky' === $options[0]) { |
| 766 | 766 | $form .= " selected='selected' "; |
| 767 | 767 | } |
| 768 | - $form .= '>' . _MB_NEWBB_CRITERIA_STICKY . '</option>'; |
|
| 768 | + $form .= '>'._MB_NEWBB_CRITERIA_STICKY.'</option>'; |
|
| 769 | 769 | $form .= '</select>'; |
| 770 | - $form .= '<br>' . _MB_NEWBB_DISPLAY . "<input type='text' name='options[1]' value='" . $options[1] . "' />"; |
|
| 771 | - $form .= '<br>' . _MB_NEWBB_TIME . "<input type='text' name='options[2]' value='" . $options[2] . "' />"; |
|
| 772 | - $form .= '<br> <small>' . _MB_NEWBB_TIME_DESC . '</small>'; |
|
| 773 | - $form .= '<br>' . _MB_NEWBB_DISPLAYMODE . "<input type='radio' name='options[3]' value='0'"; |
|
| 770 | + $form .= '<br>'._MB_NEWBB_DISPLAY."<input type='text' name='options[1]' value='".$options[1]."' />"; |
|
| 771 | + $form .= '<br>'._MB_NEWBB_TIME."<input type='text' name='options[2]' value='".$options[2]."' />"; |
|
| 772 | + $form .= '<br> <small>'._MB_NEWBB_TIME_DESC.'</small>'; |
|
| 773 | + $form .= '<br>'._MB_NEWBB_DISPLAYMODE."<input type='radio' name='options[3]' value='0'"; |
|
| 774 | 774 | if (0 == $options[3]) { |
| 775 | 775 | $form .= ' checked'; |
| 776 | 776 | } |
| 777 | - $form .= ' /> ' . _MB_NEWBB_DISPLAYMODE_FULL . "<input type='radio' name='options[3]' value='1'"; |
|
| 777 | + $form .= ' /> '._MB_NEWBB_DISPLAYMODE_FULL."<input type='radio' name='options[3]' value='1'"; |
|
| 778 | 778 | if (1 == $options[3]) { |
| 779 | 779 | $form .= ' checked'; |
| 780 | 780 | } |
| 781 | - $form .= ' /> ' . _MB_NEWBB_DISPLAYMODE_COMPACT . "<input type='radio' name='options[3]' value='2'"; |
|
| 781 | + $form .= ' /> '._MB_NEWBB_DISPLAYMODE_COMPACT."<input type='radio' name='options[3]' value='2'"; |
|
| 782 | 782 | if (2 == $options[3]) { |
| 783 | 783 | $form .= ' checked'; |
| 784 | 784 | } |
| 785 | - $form .= ' /> ' . _MB_NEWBB_DISPLAYMODE_LITE; |
|
| 785 | + $form .= ' /> '._MB_NEWBB_DISPLAYMODE_LITE; |
|
| 786 | 786 | |
| 787 | - $form .= '<br>' . _MB_NEWBB_INDEXNAV . '<input type="radio" name="options[4]" value="1"'; |
|
| 787 | + $form .= '<br>'._MB_NEWBB_INDEXNAV.'<input type="radio" name="options[4]" value="1"'; |
|
| 788 | 788 | if (1 == $options[4]) { |
| 789 | 789 | $form .= ' checked'; |
| 790 | 790 | } |
| 791 | - $form .= ' />' . _YES . '<input type="radio" name="options[4]" value="0"'; |
|
| 791 | + $form .= ' />'._YES.'<input type="radio" name="options[4]" value="0"'; |
|
| 792 | 792 | if (0 == $options[4]) { |
| 793 | 793 | $form .= ' checked'; |
| 794 | 794 | } |
| 795 | - $form .= ' />' . _NO; |
|
| 795 | + $form .= ' />'._NO; |
|
| 796 | 796 | |
| 797 | - $form .= '<br>' . _MB_NEWBB_TITLE_LENGTH . "<input type='text' name='options[5]' value='" . $options[5] . "' />"; |
|
| 797 | + $form .= '<br>'._MB_NEWBB_TITLE_LENGTH."<input type='text' name='options[5]' value='".$options[5]."' />"; |
|
| 798 | 798 | |
| 799 | - $form .= '<br><br>' . _MB_NEWBB_FORUMLIST; |
|
| 799 | + $form .= '<br><br>'._MB_NEWBB_FORUMLIST; |
|
| 800 | 800 | |
| 801 | 801 | $optionsForum = array_filter(array_slice($options, 6), 'b_newbb_array_filter'); // get allowed forums |
| 802 | 802 | |
@@ -806,7 +806,7 @@ discard block |
||
| 806 | 806 | if ($isAll) { |
| 807 | 807 | $form .= ' selected="selected"'; |
| 808 | 808 | } |
| 809 | - $form .= '>' . _ALL . '</option>'; |
|
| 809 | + $form .= '>'._ALL.'</option>'; |
|
| 810 | 810 | $form .= newbbForumSelectBox($optionsForum); |
| 811 | 811 | $form .= '</select><br>'; |
| 812 | 812 | |
@@ -819,49 +819,49 @@ discard block |
||
| 819 | 819 | */ |
| 820 | 820 | function b_newbb_post_edit($options) |
| 821 | 821 | { |
| 822 | - require_once __DIR__ . '/../include/functions.forum.php'; |
|
| 823 | - $form = _MB_NEWBB_CRITERIA . "<select name='options[0]'>"; |
|
| 822 | + require_once __DIR__.'/../include/functions.forum.php'; |
|
| 823 | + $form = _MB_NEWBB_CRITERIA."<select name='options[0]'>"; |
|
| 824 | 824 | $form .= "<option value='title'"; |
| 825 | 825 | if ('title' === $options[0]) { |
| 826 | 826 | $form .= " selected='selected' "; |
| 827 | 827 | } |
| 828 | - $form .= '>' . _MB_NEWBB_CRITERIA_TITLE . '</option>'; |
|
| 828 | + $form .= '>'._MB_NEWBB_CRITERIA_TITLE.'</option>'; |
|
| 829 | 829 | $form .= "<option value='text'"; |
| 830 | 830 | if ('text' === $options[0]) { |
| 831 | 831 | $form .= " selected='selected' "; |
| 832 | 832 | } |
| 833 | - $form .= '>' . _MB_NEWBB_CRITERIA_TEXT . '</option>'; |
|
| 833 | + $form .= '>'._MB_NEWBB_CRITERIA_TEXT.'</option>'; |
|
| 834 | 834 | $form .= '</select>'; |
| 835 | - $form .= '<br>' . _MB_NEWBB_DISPLAY . "<input type='text' name='options[1]' value='" . $options[1] . "' />"; |
|
| 836 | - $form .= '<br>' . _MB_NEWBB_TIME . "<input type='text' name='options[2]' value='" . $options[2] . "' />"; |
|
| 837 | - $form .= '<br> <small>' . _MB_NEWBB_TIME_DESC . '</small>'; |
|
| 838 | - $form .= '<br>' . _MB_NEWBB_DISPLAYMODE . "<input type='radio' name='options[3]' value='0'"; |
|
| 835 | + $form .= '<br>'._MB_NEWBB_DISPLAY."<input type='text' name='options[1]' value='".$options[1]."' />"; |
|
| 836 | + $form .= '<br>'._MB_NEWBB_TIME."<input type='text' name='options[2]' value='".$options[2]."' />"; |
|
| 837 | + $form .= '<br> <small>'._MB_NEWBB_TIME_DESC.'</small>'; |
|
| 838 | + $form .= '<br>'._MB_NEWBB_DISPLAYMODE."<input type='radio' name='options[3]' value='0'"; |
|
| 839 | 839 | if (0 == $options[3]) { |
| 840 | 840 | $form .= ' checked'; |
| 841 | 841 | } |
| 842 | - $form .= ' /> ' . _MB_NEWBB_DISPLAYMODE_FULL . "<input type='radio' name='options[3]' value='1'"; |
|
| 842 | + $form .= ' /> '._MB_NEWBB_DISPLAYMODE_FULL."<input type='radio' name='options[3]' value='1'"; |
|
| 843 | 843 | if (1 == $options[3]) { |
| 844 | 844 | $form .= ' checked'; |
| 845 | 845 | } |
| 846 | - $form .= ' /> ' . _MB_NEWBB_DISPLAYMODE_COMPACT . "<input type='radio' name='options[3]' value='2'"; |
|
| 846 | + $form .= ' /> '._MB_NEWBB_DISPLAYMODE_COMPACT."<input type='radio' name='options[3]' value='2'"; |
|
| 847 | 847 | if (2 == $options[3]) { |
| 848 | 848 | $form .= ' checked'; |
| 849 | 849 | } |
| 850 | - $form .= ' /> ' . _MB_NEWBB_DISPLAYMODE_LITE; |
|
| 850 | + $form .= ' /> '._MB_NEWBB_DISPLAYMODE_LITE; |
|
| 851 | 851 | |
| 852 | - $form .= '<br>' . _MB_NEWBB_INDEXNAV . '<input type="radio" name="options[4]" value="1"'; |
|
| 852 | + $form .= '<br>'._MB_NEWBB_INDEXNAV.'<input type="radio" name="options[4]" value="1"'; |
|
| 853 | 853 | if (1 == $options[4]) { |
| 854 | 854 | $form .= ' checked'; |
| 855 | 855 | } |
| 856 | - $form .= ' />' . _YES . '<input type="radio" name="options[4]" value="0"'; |
|
| 856 | + $form .= ' />'._YES.'<input type="radio" name="options[4]" value="0"'; |
|
| 857 | 857 | if (0 == $options[4]) { |
| 858 | 858 | $form .= ' checked'; |
| 859 | 859 | } |
| 860 | - $form .= ' />' . _NO; |
|
| 860 | + $form .= ' />'._NO; |
|
| 861 | 861 | |
| 862 | - $form .= '<br>' . _MB_NEWBB_TITLE_LENGTH . "<input type='text' name='options[5]' value='" . $options[5] . "' />"; |
|
| 862 | + $form .= '<br>'._MB_NEWBB_TITLE_LENGTH."<input type='text' name='options[5]' value='".$options[5]."' />"; |
|
| 863 | 863 | |
| 864 | - $form .= '<br><br>' . _MB_NEWBB_FORUMLIST; |
|
| 864 | + $form .= '<br><br>'._MB_NEWBB_FORUMLIST; |
|
| 865 | 865 | |
| 866 | 866 | $optionsForum = array_filter(array_slice($options, 6), 'b_newbb_array_filter'); // get allowed forums |
| 867 | 867 | $isAll = (0 === count($optionsForum) || empty($optionsForum[0])); |
@@ -870,7 +870,7 @@ discard block |
||
| 870 | 870 | if ($isAll) { |
| 871 | 871 | $form .= ' selected="selected"'; |
| 872 | 872 | } |
| 873 | - $form .= '>' . _ALL . '</option>'; |
|
| 873 | + $form .= '>'._ALL.'</option>'; |
|
| 874 | 874 | $form .= newbbForumSelectBox($optionsForum); |
| 875 | 875 | $form .= '</select><br>'; |
| 876 | 876 | |
@@ -883,53 +883,53 @@ discard block |
||
| 883 | 883 | */ |
| 884 | 884 | function b_newbb_author_edit($options) |
| 885 | 885 | { |
| 886 | - require_once __DIR__ . '/../include/functions.forum.php'; |
|
| 887 | - $form = _MB_NEWBB_CRITERIA . "<select name='options[0]'>"; |
|
| 886 | + require_once __DIR__.'/../include/functions.forum.php'; |
|
| 887 | + $form = _MB_NEWBB_CRITERIA."<select name='options[0]'>"; |
|
| 888 | 888 | $form .= "<option value='post'"; |
| 889 | 889 | if ('post' === $options[0]) { |
| 890 | 890 | $form .= " selected='selected' "; |
| 891 | 891 | } |
| 892 | - $form .= '>' . _MB_NEWBB_CRITERIA_POST . '</option>'; |
|
| 892 | + $form .= '>'._MB_NEWBB_CRITERIA_POST.'</option>'; |
|
| 893 | 893 | $form .= "<option value='topic'"; |
| 894 | 894 | if ('topic' === $options[0]) { |
| 895 | 895 | $form .= " selected='selected' "; |
| 896 | 896 | } |
| 897 | - $form .= '>' . _MB_NEWBB_CRITERIA_TOPIC . '</option>'; |
|
| 897 | + $form .= '>'._MB_NEWBB_CRITERIA_TOPIC.'</option>'; |
|
| 898 | 898 | $form .= "<option value='digest'"; |
| 899 | 899 | if ('digest' === $options[0]) { |
| 900 | 900 | $form .= " selected='selected' "; |
| 901 | 901 | } |
| 902 | - $form .= '>' . _MB_NEWBB_CRITERIA_DIGESTS . '</option>'; |
|
| 902 | + $form .= '>'._MB_NEWBB_CRITERIA_DIGESTS.'</option>'; |
|
| 903 | 903 | $form .= "<option value='sticky'"; |
| 904 | 904 | if ('sticky' === $options[0]) { |
| 905 | 905 | $form .= " selected='selected' "; |
| 906 | 906 | } |
| 907 | - $form .= '>' . _MB_NEWBB_CRITERIA_STICKYS . '</option>'; |
|
| 907 | + $form .= '>'._MB_NEWBB_CRITERIA_STICKYS.'</option>'; |
|
| 908 | 908 | $form .= '</select>'; |
| 909 | - $form .= '<br>' . _MB_NEWBB_DISPLAY . "<input type='text' name='options[1]' value='" . $options[1] . "' />"; |
|
| 910 | - $form .= '<br>' . _MB_NEWBB_TIME . "<input type='text' name='options[2]' value='" . $options[2] . "' />"; |
|
| 911 | - $form .= '<br> <small>' . _MB_NEWBB_TIME_DESC . '</small>'; |
|
| 912 | - $form .= '<br>' . _MB_NEWBB_DISPLAYMODE . "<input type='radio' name='options[3]' value='0'"; |
|
| 909 | + $form .= '<br>'._MB_NEWBB_DISPLAY."<input type='text' name='options[1]' value='".$options[1]."' />"; |
|
| 910 | + $form .= '<br>'._MB_NEWBB_TIME."<input type='text' name='options[2]' value='".$options[2]."' />"; |
|
| 911 | + $form .= '<br> <small>'._MB_NEWBB_TIME_DESC.'</small>'; |
|
| 912 | + $form .= '<br>'._MB_NEWBB_DISPLAYMODE."<input type='radio' name='options[3]' value='0'"; |
|
| 913 | 913 | if (0 == $options[3]) { |
| 914 | 914 | $form .= ' checked'; |
| 915 | 915 | } |
| 916 | - $form .= ' /> ' . _MB_NEWBB_DISPLAYMODE_COMPACT . "<input type='radio' name='options[3]' value='1'"; |
|
| 916 | + $form .= ' /> '._MB_NEWBB_DISPLAYMODE_COMPACT."<input type='radio' name='options[3]' value='1'"; |
|
| 917 | 917 | if (1 == $options[3]) { |
| 918 | 918 | $form .= ' checked'; |
| 919 | 919 | } |
| 920 | - $form .= ' /> ' . _MB_NEWBB_DISPLAYMODE_LITE; |
|
| 920 | + $form .= ' /> '._MB_NEWBB_DISPLAYMODE_LITE; |
|
| 921 | 921 | |
| 922 | - $form .= '<br>' . _MB_NEWBB_INDEXNAV . '<input type="radio" name="options[4]" value="1"'; |
|
| 922 | + $form .= '<br>'._MB_NEWBB_INDEXNAV.'<input type="radio" name="options[4]" value="1"'; |
|
| 923 | 923 | if (1 == $options[4]) { |
| 924 | 924 | $form .= ' checked'; |
| 925 | 925 | } |
| 926 | - $form .= ' />' . _YES . '<input type="radio" name="options[4]" value="0"'; |
|
| 926 | + $form .= ' />'._YES.'<input type="radio" name="options[4]" value="0"'; |
|
| 927 | 927 | if (0 == $options[4]) { |
| 928 | 928 | $form .= ' checked'; |
| 929 | 929 | } |
| 930 | - $form .= ' />' . _NO; |
|
| 930 | + $form .= ' />'._NO; |
|
| 931 | 931 | |
| 932 | - $form .= '<br><br>' . _MB_NEWBB_FORUMLIST; |
|
| 932 | + $form .= '<br><br>'._MB_NEWBB_FORUMLIST; |
|
| 933 | 933 | |
| 934 | 934 | $optionsForum = array_filter(array_slice($options, 5), 'b_newbb_array_filter'); // get allowed forums |
| 935 | 935 | $isAll = (0 === count($optionsForum) || empty($optionsForum[0])); |
@@ -938,7 +938,7 @@ discard block |
||
| 938 | 938 | if ($isAll) { |
| 939 | 939 | $form .= ' selected="selected"'; |
| 940 | 940 | } |
| 941 | - $form .= '>' . _ALL . '</option>'; |
|
| 941 | + $form .= '>'._ALL.'</option>'; |
|
| 942 | 942 | $form .= newbbForumSelectBox($optionsForum); |
| 943 | 943 | $form .= '</select><br>'; |
| 944 | 944 | |
@@ -952,8 +952,8 @@ discard block |
||
| 952 | 952 | function b_newbb_custom($options) |
| 953 | 953 | { |
| 954 | 954 | // if no newbb module block set, we have to include the language file |
| 955 | - if (is_readable($GLOBALS['xoops']->path('modules/newbb/language/' . $GLOBALS['xoopsConfig']['language'] . '/blocks.php'))) { |
|
| 956 | - require_once $GLOBALS['xoops']->path('modules/newbb/language/' . $GLOBALS['xoopsConfig']['language'] . '/blocks.php'); |
|
| 955 | + if (is_readable($GLOBALS['xoops']->path('modules/newbb/language/'.$GLOBALS['xoopsConfig']['language'].'/blocks.php'))) { |
|
| 956 | + require_once $GLOBALS['xoops']->path('modules/newbb/language/'.$GLOBALS['xoopsConfig']['language'].'/blocks.php'); |
|
| 957 | 957 | } else { |
| 958 | 958 | require_once $GLOBALS['xoops']->path('modules/newbb/language/english/blocks.php'); |
| 959 | 959 | } |
@@ -977,8 +977,8 @@ discard block |
||
| 977 | 977 | { |
| 978 | 978 | |
| 979 | 979 | // if no newbb module block set, we have to include the language file |
| 980 | - if (is_readable($GLOBALS['xoops']->path('modules/newbb/language/' . $GLOBALS['xoopsConfig']['language'] . '/blocks.php'))) { |
|
| 981 | - require_once $GLOBALS['xoops']->path('modules/newbb/language/' . $GLOBALS['xoopsConfig']['language'] . '/blocks.php'); |
|
| 980 | + if (is_readable($GLOBALS['xoops']->path('modules/newbb/language/'.$GLOBALS['xoopsConfig']['language'].'/blocks.php'))) { |
|
| 981 | + require_once $GLOBALS['xoops']->path('modules/newbb/language/'.$GLOBALS['xoopsConfig']['language'].'/blocks.php'); |
|
| 982 | 982 | } else { |
| 983 | 983 | require_once $GLOBALS['xoops']->path('modules/newbb/language/english/blocks.php'); |
| 984 | 984 | } |
@@ -1002,8 +1002,8 @@ discard block |
||
| 1002 | 1002 | { |
| 1003 | 1003 | |
| 1004 | 1004 | // if no newbb module block set, we have to include the language file |
| 1005 | - if (is_readable($GLOBALS['xoops']->path('modules/newbb/language/' . $GLOBALS['xoopsConfig']['language'] . '/blocks.php'))) { |
|
| 1006 | - require_once $GLOBALS['xoops']->path('modules/newbb/language/' . $GLOBALS['xoopsConfig']['language'] . '/blocks.php'); |
|
| 1005 | + if (is_readable($GLOBALS['xoops']->path('modules/newbb/language/'.$GLOBALS['xoopsConfig']['language'].'/blocks.php'))) { |
|
| 1006 | + require_once $GLOBALS['xoops']->path('modules/newbb/language/'.$GLOBALS['xoopsConfig']['language'].'/blocks.php'); |
|
| 1007 | 1007 | } else { |
| 1008 | 1008 | require_once $GLOBALS['xoops']->path('modules/newbb/language/english/blocks.php'); |
| 1009 | 1009 | } |
@@ -1026,8 +1026,8 @@ discard block |
||
| 1026 | 1026 | function b_newbb_custom_author($options) |
| 1027 | 1027 | { |
| 1028 | 1028 | // if no newbb module block set, we have to include the language file |
| 1029 | - if (is_readable($GLOBALS['xoops']->path('modules/newbb/language/' . $GLOBALS['xoopsConfig']['language'] . '/blocks.php'))) { |
|
| 1030 | - require_once $GLOBALS['xoops']->path('modules/newbb/language/' . $GLOBALS['xoopsConfig']['language'] . '/blocks.php'); |
|
| 1029 | + if (is_readable($GLOBALS['xoops']->path('modules/newbb/language/'.$GLOBALS['xoopsConfig']['language'].'/blocks.php'))) { |
|
| 1030 | + require_once $GLOBALS['xoops']->path('modules/newbb/language/'.$GLOBALS['xoopsConfig']['language'].'/blocks.php'); |
|
| 1031 | 1031 | } else { |
| 1032 | 1032 | require_once $GLOBALS['xoops']->path('modules/newbb/language/english/blocks.php'); |
| 1033 | 1033 | } |
@@ -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 | $topic_id = Request::getInt('topic_id', 0, 'POST'); |
| 18 | 18 | $post_id = Request::getArray('post_id', Request::getArray('post_id', [], 'POST'), 'GET'); |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | $isAdmin = newbbIsAdmin($forumObject); |
| 43 | 43 | |
| 44 | 44 | if (!$isAdmin) { |
| 45 | - redirect_header(XOOPS_URL . '/index.php', 2, _MD_NEWBB_NORIGHTTOACCESS); |
|
| 45 | + redirect_header(XOOPS_URL.'/index.php', 2, _MD_NEWBB_NORIGHTTOACCESS); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | switch ($op) { |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | sort($post_id); |
| 75 | 75 | $topics = []; |
| 76 | 76 | $forums = []; |
| 77 | - $criteria = new \Criteria('post_id', '(' . implode(',', $post_id) . ')', 'IN'); |
|
| 77 | + $criteria = new \Criteria('post_id', '('.implode(',', $post_id).')', 'IN'); |
|
| 78 | 78 | $postsObject = $postHandler->getObjects($criteria, true); |
| 79 | 79 | foreach ($post_id as $post) { |
| 80 | 80 | /** @var Newbb\Post $postObject */ |
@@ -97,23 +97,23 @@ discard block |
||
| 97 | 97 | break; |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | - $criteria_topic = new \Criteria('topic_id', '(' . implode(',', array_keys($topics)) . ')', 'IN'); |
|
| 100 | + $criteria_topic = new \Criteria('topic_id', '('.implode(',', array_keys($topics)).')', 'IN'); |
|
| 101 | 101 | $topic_list = $topicHandler->getList($criteria_topic, true); |
| 102 | 102 | |
| 103 | - $criteria_forum = new \Criteria('forum_id', '(' . implode(',', array_keys($forums)) . ')', 'IN'); |
|
| 103 | + $criteria_forum = new \Criteria('forum_id', '('.implode(',', array_keys($forums)).')', 'IN'); |
|
| 104 | 104 | $forum_list = $forumHandler->getList($criteria_forum); |
| 105 | 105 | |
| 106 | - require_once __DIR__ . '/include/notification.inc.php'; |
|
| 106 | + require_once __DIR__.'/include/notification.inc.php'; |
|
| 107 | 107 | /** @var \XoopsNotificationHandler $notificationHandler */ |
| 108 | 108 | $notificationHandler = xoops_getHandler('notification'); |
| 109 | 109 | foreach ($post_id as $post) { |
| 110 | 110 | $tags = []; |
| 111 | 111 | /** @var Newbb\Post[] $postsObject [$post] */ |
| 112 | 112 | $tags['THREAD_NAME'] = $topic_list[$postsObject[$post]->getVar('topic_id')]; |
| 113 | - $tags['THREAD_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewtopic.php?topic_id=' . $postsObject[$post]->getVar('topic_id') . '&forum=' . $postsObject[$post]->getVar('forum_id'); |
|
| 113 | + $tags['THREAD_URL'] = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/viewtopic.php?topic_id='.$postsObject[$post]->getVar('topic_id').'&forum='.$postsObject[$post]->getVar('forum_id'); |
|
| 114 | 114 | $tags['FORUM_NAME'] = $forum_list[$postsObject[$post]->getVar('forum_id')]; |
| 115 | - $tags['FORUM_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewforum.php?forum=' . $postsObject[$post]->getVar('forum_id'); |
|
| 116 | - $tags['POST_URL'] = $tags['THREAD_URL'] . '#forumpost' . $post; |
|
| 115 | + $tags['FORUM_URL'] = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/viewforum.php?forum='.$postsObject[$post]->getVar('forum_id'); |
|
| 116 | + $tags['POST_URL'] = $tags['THREAD_URL'].'#forumpost'.$post; |
|
| 117 | 117 | $notificationHandler->triggerEvent('thread', $postsObject[$post]->getVar('topic_id'), 'new_post', $tags); |
| 118 | 118 | $notificationHandler->triggerEvent('forum', $postsObject[$post]->getVar('forum_id'), 'new_post', $tags); |
| 119 | 119 | $notificationHandler->triggerEvent('global', 0, 'new_post', $tags); |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | $mytree = new \XoopsTree($GLOBALS['xoopsDB']->prefix('newbb_posts'), 'post_id', 'pid'); |
| 181 | 181 | $posts = $mytree->getAllChildId($post_id); |
| 182 | 182 | if (count($posts) > 0) { |
| 183 | - $criteria = new \Criteria('post_id', '(' . implode(',', $posts) . ')', 'IN'); |
|
| 183 | + $criteria = new \Criteria('post_id', '('.implode(',', $posts).')', 'IN'); |
|
| 184 | 184 | $postHandler->updateAll('topic_id', $new_topic_id, $criteria, true); |
| 185 | 185 | } |
| 186 | 186 | /* split a post and all posts coming after */ |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | } |
| 208 | 208 | } |
| 209 | 209 | if (count($post_update)) { |
| 210 | - $criteria = new \Criteria('post_id', '(' . implode(',', $post_update) . ')', 'IN'); |
|
| 210 | + $criteria = new \Criteria('post_id', '('.implode(',', $post_update).')', 'IN'); |
|
| 211 | 211 | $postHandler->updateAll('pid', $post_id, $criteria, true); |
| 212 | 212 | } |
| 213 | 213 | } |
@@ -221,12 +221,12 @@ discard block |
||
| 221 | 221 | break; |
| 222 | 222 | } |
| 223 | 223 | if (!empty($topic_id)) { |
| 224 | - redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?topic_id=$topic_id", 2, _MD_NEWBB_DBUPDATED); |
|
| 224 | + redirect_header(XOOPS_URL."/modules/newbb/viewtopic.php?topic_id=$topic_id", 2, _MD_NEWBB_DBUPDATED); |
|
| 225 | 225 | } elseif (!empty($forum_id)) { |
| 226 | - redirect_header(XOOPS_URL . "/modules/newbb/viewforum.php?forum=$forum_id", 2, _MD_NEWBB_DBUPDATED); |
|
| 226 | + redirect_header(XOOPS_URL."/modules/newbb/viewforum.php?forum=$forum_id", 2, _MD_NEWBB_DBUPDATED); |
|
| 227 | 227 | } else { |
| 228 | - redirect_header(XOOPS_URL . "/modules/newbb/viewpost.php?uid=$uid", 2, _MD_NEWBB_DBUPDATED); |
|
| 228 | + redirect_header(XOOPS_URL."/modules/newbb/viewpost.php?uid=$uid", 2, _MD_NEWBB_DBUPDATED); |
|
| 229 | 229 | } |
| 230 | 230 | // irmtfan move to footer.php |
| 231 | -require_once __DIR__ . '/footer.php'; |
|
| 231 | +require_once __DIR__.'/footer.php'; |
|
| 232 | 232 | include $GLOBALS['xoops']->path('footer.php'); |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | use Xmf\Request; |
| 33 | 33 | |
| 34 | -require_once __DIR__ . '/header.php'; |
|
| 34 | +require_once __DIR__.'/header.php'; |
|
| 35 | 35 | |
| 36 | 36 | $ratinguser = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('uid') : 0; |
| 37 | 37 | $anonwaitdays = 1; |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | if (empty($rate)) { |
| 54 | - redirect_header('viewtopic.php?topic_id=' . $topic_id . '&forum=' . $forum . '', 4, _MD_NEWBB_NOVOTERATE); |
|
| 54 | + redirect_header('viewtopic.php?topic_id='.$topic_id.'&forum='.$forum.'', 4, _MD_NEWBB_NOVOTERATE); |
|
| 55 | 55 | } |
| 56 | 56 | ///** @var Newbb\RateHandler $rateHandler */ |
| 57 | 57 | //$rateHandler = Newbb\Helper::getInstance()->getHandler('Rate'); |
@@ -62,13 +62,13 @@ discard block |
||
| 62 | 62 | // /** @var Newbb\PostHandler $postHandler */ |
| 63 | 63 | // $postHandler = Newbb\Helper::getInstance()->getHandler('Post'); |
| 64 | 64 | if ($postHandler->getCount($crit_post)) { |
| 65 | - redirect_header('viewtopic.php?topic_id=' . $topic_id . '&forum=' . $forum . '', 4, _MD_NEWBB_CANTVOTEOWN); |
|
| 65 | + redirect_header('viewtopic.php?topic_id='.$topic_id.'&forum='.$forum.'', 4, _MD_NEWBB_CANTVOTEOWN); |
|
| 66 | 66 | } |
| 67 | 67 | // Check if REG user is trying to vote twice. |
| 68 | 68 | $crit_rate = new \CriteriaCompo(new \Criteria('topic_id', $topic_id)); |
| 69 | 69 | $crit_rate->add(new \Criteria('ratinguser', $ratinguser)); |
| 70 | 70 | if ($rateHandler->getCount($crit_rate)) { |
| 71 | - redirect_header('viewtopic.php?topic_id=' . $topic_id . '&forum=' . $forum . '', 4, _MD_NEWBB_VOTEONCE); |
|
| 71 | + redirect_header('viewtopic.php?topic_id='.$topic_id.'&forum='.$forum.'', 4, _MD_NEWBB_VOTEONCE); |
|
| 72 | 72 | } |
| 73 | 73 | } else { |
| 74 | 74 | // Check if ANONYMOUS user is trying to vote more than once per day. |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $crit_rate->add(new \Criteria('ratinghostname', $ip)); |
| 78 | 78 | $crit_rate->add(new \Criteria('ratingtimestamp', time() - (86400 * $anonwaitdays), '>')); |
| 79 | 79 | if ($rateHandler->getCount($crit_rate)) { |
| 80 | - redirect_header('viewtopic.php?topic_id=' . $topic_id . '&forum=' . $forum . '', 4, _MD_NEWBB_VOTEONCE); |
|
| 80 | + redirect_header('viewtopic.php?topic_id='.$topic_id.'&forum='.$forum.'', 4, _MD_NEWBB_VOTEONCE); |
|
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | 83 | $rateObject = $rateHandler->create(); |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | $ratingid = $rateHandler->insert($rateObject); |
| 91 | 91 | |
| 92 | -$query = 'SELECT rating FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_votedata') . ' WHERE topic_id = ' . $topic_id . ' '; |
|
| 92 | +$query = 'SELECT rating FROM '.$GLOBALS['xoopsDB']->prefix('newbb_votedata').' WHERE topic_id = '.$topic_id.' '; |
|
| 93 | 93 | $voteresult = $GLOBALS['xoopsDB']->query($query); |
| 94 | 94 | $votesDB = $GLOBALS['xoopsDB']->getRowsNum($voteresult); |
| 95 | 95 | $totalrating = 0; |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | $sql = sprintf('UPDATE "%s" SET rating = "%u", votes = "%u" WHERE topic_id = "%u"', $GLOBALS['xoopsDB']->prefix('newbb_topics'), $finalrating, $votesDB, $topic_id); |
| 102 | 102 | $GLOBALS['xoopsDB']->queryF($sql); |
| 103 | 103 | |
| 104 | -$ratemessage = _MD_NEWBB_VOTEAPPRE . '<br>' . sprintf(_MD_NEWBB_THANKYOU, $GLOBALS['xoopsConfig']['sitename']); |
|
| 105 | -redirect_header('viewtopic.php?topic_id=' . $topic_id . '&forum=' . $forum . '', 2, $ratemessage); |
|
| 104 | +$ratemessage = _MD_NEWBB_VOTEAPPRE.'<br>'.sprintf(_MD_NEWBB_THANKYOU, $GLOBALS['xoopsConfig']['sitename']); |
|
| 105 | +redirect_header('viewtopic.php?topic_id='.$topic_id.'&forum='.$forum.'', 2, $ratemessage); |
|
| 106 | 106 | // irmtfan enhance include footer.php |
| 107 | 107 | 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 | $forum_id = Request::getInt('forum_id', 0, 'POST'); |
| 18 | 18 | $topic_id = Request::getArray('topic_id', null, 'POST'); |
@@ -34,12 +34,12 @@ discard block |
||
| 34 | 34 | $isAdmin = newbbIsAdmin($forum_id); |
| 35 | 35 | |
| 36 | 36 | if (!$isAdmin) { |
| 37 | - redirect_header(XOOPS_URL . '/index.php', 2, _MD_NEWBB_NORIGHTTOACCESS); |
|
| 37 | + redirect_header(XOOPS_URL.'/index.php', 2, _MD_NEWBB_NORIGHTTOACCESS); |
|
| 38 | 38 | } |
| 39 | 39 | switch ($op) { |
| 40 | 40 | case 'restore': |
| 41 | 41 | $forums = []; |
| 42 | - $topicsObject = $topicHandler->getAll(new \Criteria('topic_id', '(' . implode(',', $topic_id) . ')', 'IN')); |
|
| 42 | + $topicsObject = $topicHandler->getAll(new \Criteria('topic_id', '('.implode(',', $topic_id).')', 'IN')); |
|
| 43 | 43 | foreach (array_keys($topicsObject) as $id) { |
| 44 | 44 | /** @var Newbb\Topic $topicObject */ |
| 45 | 45 | $topicObject = $topicsObject[$id]; |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | $topicHandler->synchronization($topicObject); |
| 48 | 48 | $forums[$topicObject->getVar('forum_id')] = 1; |
| 49 | 49 | } |
| 50 | - $criteria_forum = new \Criteria('forum_id', '(' . implode(',', array_keys($forums)) . ')', 'IN'); |
|
| 50 | + $criteria_forum = new \Criteria('forum_id', '('.implode(',', array_keys($forums)).')', 'IN'); |
|
| 51 | 51 | $forumsObject = $forumHandler->getAll($criteria_forum); |
| 52 | 52 | foreach (array_keys($forumsObject) as $id) { |
| 53 | 53 | $forumHandler->synchronization($forumsObject[$id]); |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | break; |
| 57 | 57 | case 'approve': |
| 58 | 58 | $forums = []; |
| 59 | - $topicsObject = $topicHandler->getAll(new \Criteria('topic_id', '(' . implode(',', $topic_id) . ')', 'IN')); |
|
| 59 | + $topicsObject = $topicHandler->getAll(new \Criteria('topic_id', '('.implode(',', $topic_id).')', 'IN')); |
|
| 60 | 60 | foreach (array_keys($topicsObject) as $id) { |
| 61 | 61 | /** @var Newbb\Topic $topicObject */ |
| 62 | 62 | $topicObject = $topicsObject[$id]; |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | $forums[$topicObject->getVar('forum_id')] = 1; |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | - $criteria_forum = new \Criteria('forum_id', '(' . implode(',', array_keys($forums)) . ')', 'IN'); |
|
| 68 | + $criteria_forum = new \Criteria('forum_id', '('.implode(',', array_keys($forums)).')', 'IN'); |
|
| 69 | 69 | $forumsObject = $forumHandler->getAll($criteria_forum); |
| 70 | 70 | foreach (array_keys($forumsObject) as $id) { |
| 71 | 71 | $forumHandler->synchronization($forumsObject[$id]); |
@@ -75,21 +75,21 @@ discard block |
||
| 75 | 75 | break; |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - require_once __DIR__ . '/include/notification.inc.php'; |
|
| 78 | + require_once __DIR__.'/include/notification.inc.php'; |
|
| 79 | 79 | /** @var \XoopsNotificationHandler $notificationHandler */ |
| 80 | 80 | $notificationHandler = xoops_getHandler('notification'); |
| 81 | 81 | foreach (array_keys($topicsObject) as $id) { |
| 82 | 82 | $topicObject = $topicsObject[$id]; |
| 83 | 83 | $tags = []; |
| 84 | 84 | $tags['THREAD_NAME'] = $topicObject->getVar('topic_title'); |
| 85 | - $tags['THREAD_URL'] = XOOPS_URL . '/modules/' . $moduleDirName . '/viewtopic.php?topic_id=' . $id . '&forum=' . $topicObject->getVar('forum_id'); |
|
| 85 | + $tags['THREAD_URL'] = XOOPS_URL.'/modules/'.$moduleDirName.'/viewtopic.php?topic_id='.$id.'&forum='.$topicObject->getVar('forum_id'); |
|
| 86 | 86 | /** @var Newbb\Forum[] $forumsObject */ |
| 87 | 87 | $tags['FORUM_NAME'] = $forumsObject[$topicObject->getVar('forum_id')]->getVar('forum_name'); |
| 88 | - $tags['FORUM_URL'] = XOOPS_URL . '/modules/' . $moduleDirName . '/viewforum.php?forum=' . $topicObject->getVar('forum_id'); |
|
| 88 | + $tags['FORUM_URL'] = XOOPS_URL.'/modules/'.$moduleDirName.'/viewforum.php?forum='.$topicObject->getVar('forum_id'); |
|
| 89 | 89 | $notificationHandler->triggerEvent('global', 0, 'new_thread', $tags); |
| 90 | 90 | $notificationHandler->triggerEvent('forum', $topicObject->getVar('forum_id'), 'new_thread', $tags); |
| 91 | 91 | $postObject = $topicHandler->getTopPost($id); |
| 92 | - $tags['POST_URL'] = $tags['THREAD_URL'] . '#forumpost' . $postObject->getVar('post_id'); |
|
| 92 | + $tags['POST_URL'] = $tags['THREAD_URL'].'#forumpost'.$postObject->getVar('post_id'); |
|
| 93 | 93 | $notificationHandler->triggerEvent('thread', $id, 'new_post', $tags); |
| 94 | 94 | $notificationHandler->triggerEvent('forum', $topicObject->getVar('forum_id'), 'new_post', $tags); |
| 95 | 95 | $notificationHandler->triggerEvent('global', 0, 'new_post', $tags); |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | case 'delete': |
| 105 | 105 | $forums = []; |
| 106 | 106 | /** @var Newbb\TopicHandler|\XoopsPersistableObjectHandler $topicHandler */ |
| 107 | - $topicsObject = $topicHandler->getAll(new \Criteria('topic_id', '(' . implode(',', $topic_id) . ')', 'IN')); |
|
| 107 | + $topicsObject = $topicHandler->getAll(new \Criteria('topic_id', '('.implode(',', $topic_id).')', 'IN')); |
|
| 108 | 108 | foreach (array_keys($topicsObject) as $id) { |
| 109 | 109 | /** @var Newbb\Topic $topicObject */ |
| 110 | 110 | $topicObject = $topicsObject[$id]; |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | $forums[$topicObject->getVar('forum_id')] = 1; |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | - $criteria_forum = new \Criteria('forum_id', '(' . implode(',', array_keys($forums)) . ')', 'IN'); |
|
| 117 | + $criteria_forum = new \Criteria('forum_id', '('.implode(',', array_keys($forums)).')', 'IN'); |
|
| 118 | 118 | $forumsObject = $forumHandler->getAll($criteria_forum); |
| 119 | 119 | foreach (array_keys($forumsObject) as $id) { |
| 120 | 120 | $forumHandler->synchronization($forumsObject[$id]); |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | if (Request::getInt('newforum', 0, 'POST') |
| 126 | 126 | && Request::getInt('newforum', 0, 'POST') !== $forum_id |
| 127 | 127 | && $forumHandler->getPermission(Request::getInt('newforum', 0, 'POST'), 'post')) { |
| 128 | - $criteria = new \Criteria('topic_id', '(' . implode(',', $topic_id) . ')', 'IN'); |
|
| 128 | + $criteria = new \Criteria('topic_id', '('.implode(',', $topic_id).')', 'IN'); |
|
| 129 | 129 | // /** @var Newbb\PostHandler $postHandler */ |
| 130 | 130 | // $postHandler = Newbb\Helper::getInstance()->getHandler('Post'); |
| 131 | 131 | $postHandler->updateAll('forum_id', Request::getInt('newforum', 0, 'POST'), $criteria, true); |
@@ -144,37 +144,37 @@ discard block |
||
| 144 | 144 | foreach (array_keys($forums) as $key) { |
| 145 | 145 | |
| 146 | 146 | /** @var Newbb\Category[] $categories */ |
| 147 | - $box .= "<option value='-1'>[" . $categories[$key]->getVar('cat_title') . ']</option>'; |
|
| 147 | + $box .= "<option value='-1'>[".$categories[$key]->getVar('cat_title').']</option>'; |
|
| 148 | 148 | foreach ($forums[$key] as $forumid => $_forum) { |
| 149 | - $box .= "<option value='" . $forumid . "'>-- " . $_forum['title'] . '</option>'; |
|
| 149 | + $box .= "<option value='".$forumid."'>-- ".$_forum['title'].'</option>'; |
|
| 150 | 150 | if (!isset($_forum['sub'])) { |
| 151 | 151 | continue; |
| 152 | 152 | } |
| 153 | 153 | foreach (array_keys($_forum['sub']) as $fid) { |
| 154 | - $box .= "<option value='" . $fid . "'>---- " . $_forum['sub'][$fid]['title'] . '</option>'; |
|
| 154 | + $box .= "<option value='".$fid."'>---- ".$_forum['sub'][$fid]['title'].'</option>'; |
|
| 155 | 155 | } |
| 156 | 156 | } |
| 157 | 157 | } |
| 158 | 158 | } else { |
| 159 | - $box .= "<option value='-1'>" . _MD_NEWBB_NOFORUMINDB . '</option>'; |
|
| 159 | + $box .= "<option value='-1'>"._MD_NEWBB_NOFORUMINDB.'</option>'; |
|
| 160 | 160 | } |
| 161 | 161 | $box .= '</select>'; |
| 162 | 162 | unset($forums, $categories); |
| 163 | 163 | |
| 164 | - echo "<form action='" . Request::getString('PHP_SELF', '', 'SERVER') . "' method='post'>"; |
|
| 164 | + echo "<form action='".Request::getString('PHP_SELF', '', 'SERVER')."' method='post'>"; |
|
| 165 | 165 | echo "<table border='0' cellpadding='1' cellspacing='0' align='center' width='95%'>"; |
| 166 | 166 | echo "<tr><td class='bg2'>"; |
| 167 | 167 | echo "<table border='0' cellpadding='1' cellspacing='1' width='100%'>"; |
| 168 | - echo '<tr><td class="bg3">' . _MD_NEWBB_MOVETOPICTO . '</td><td class="bg1">'; |
|
| 168 | + echo '<tr><td class="bg3">'._MD_NEWBB_MOVETOPICTO.'</td><td class="bg1">'; |
|
| 169 | 169 | echo $box; |
| 170 | 170 | echo '</td></tr>'; |
| 171 | 171 | echo '<tr class="bg3"><td colspan="2" align="center">'; |
| 172 | 172 | echo "<input type='hidden' name='op' value='move' />"; |
| 173 | 173 | echo "<input type='hidden' name='forum_id' value='{$forum_id}' />"; |
| 174 | 174 | foreach ($topic_id as $id) { |
| 175 | - echo "<input type='hidden' name='topic_id[]' value='" . $id . "' />"; |
|
| 175 | + echo "<input type='hidden' name='topic_id[]' value='".$id."' />"; |
|
| 176 | 176 | } |
| 177 | - echo "<input type='submit' name='submit' value='" . _SUBMIT . "' />"; |
|
| 177 | + echo "<input type='submit' name='submit' value='"._SUBMIT."' />"; |
|
| 178 | 178 | echo '</td></tr></table></td></tr></table>'; |
| 179 | 179 | echo '</form>'; |
| 180 | 180 | include $GLOBALS['xoops']->path('footer.php'); |
@@ -186,10 +186,10 @@ discard block |
||
| 186 | 186 | //$statsHandler = Newbb\Helper::getInstance()->getHandler('Stats'); |
| 187 | 187 | $statsHandler->reset(); |
| 188 | 188 | if (empty($forum_id)) { |
| 189 | - redirect_header(XOOPS_URL . '/modules/newbb/list.topic.php', 2, _MD_NEWBB_DBUPDATED); |
|
| 189 | + redirect_header(XOOPS_URL.'/modules/newbb/list.topic.php', 2, _MD_NEWBB_DBUPDATED); |
|
| 190 | 190 | } else { |
| 191 | - redirect_header(XOOPS_URL . "/modules/newbb/viewforum.php?forum={$forum_id}", 2, _MD_NEWBB_DBUPDATED); |
|
| 191 | + redirect_header(XOOPS_URL."/modules/newbb/viewforum.php?forum={$forum_id}", 2, _MD_NEWBB_DBUPDATED); |
|
| 192 | 192 | } |
| 193 | 193 | // irmtfan move to footer.php |
| 194 | -require_once __DIR__ . '/footer.php'; |
|
| 194 | +require_once __DIR__.'/footer.php'; |
|
| 195 | 195 | include $GLOBALS['xoops']->path('footer.php'); |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | use Xmf\Request; |
| 20 | 20 | use XoopsModules\Newbb; |
| 21 | 21 | |
| 22 | -require_once __DIR__ . '/header.php'; |
|
| 22 | +require_once __DIR__.'/header.php'; |
|
| 23 | 23 | |
| 24 | 24 | foreach ([ |
| 25 | 25 | 'forum', |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | || ($postObject->checkTimelimit('edit_timelimit') |
| 148 | 148 | && $postObject->checkIdentity()))) { |
| 149 | 149 | } else { |
| 150 | - redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?forum={$forum_id}&topic_id={$topic_id}&post_id={$post_id}&order={$order}&viewmode={$viewmode}", 2, _MD_NEWBB_NORIGHTTOEDIT); |
|
| 150 | + redirect_header(XOOPS_URL."/modules/newbb/viewtopic.php?forum={$forum_id}&topic_id={$topic_id}&post_id={$post_id}&order={$order}&viewmode={$viewmode}", 2, _MD_NEWBB_NORIGHTTOEDIT); |
|
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | $delete_attach = Request::getArray('delete_attach', [], 'POST'); |
@@ -158,12 +158,12 @@ discard block |
||
| 158 | 158 | if ($topic_id) { |
| 159 | 159 | $topic_status = $topicObject->getVar('topic_status'); |
| 160 | 160 | if (!$topicHandler->getPermission($forumObject, $topic_status, 'reply')) { |
| 161 | - redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?forum={$forum_id}&topic_id={$topic_id}&post_id={$post_id}&order={$order}&viewmode={$viewmode}", 2, _MD_NEWBB_NORIGHTTOREPLY); |
|
| 161 | + redirect_header(XOOPS_URL."/modules/newbb/viewtopic.php?forum={$forum_id}&topic_id={$topic_id}&post_id={$post_id}&order={$order}&viewmode={$viewmode}", 2, _MD_NEWBB_NORIGHTTOREPLY); |
|
| 162 | 162 | } |
| 163 | 163 | } else { |
| 164 | 164 | $topic_status = 0; |
| 165 | 165 | if (!$topicHandler->getPermission($forumObject, $topic_status, 'post')) { |
| 166 | - redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?forum={$forum_id}", 2, _MD_NEWBB_NORIGHTTOPOST); |
|
| 166 | + redirect_header(XOOPS_URL."/modules/newbb/viewtopic.php?forum={$forum_id}", 2, _MD_NEWBB_NORIGHTTOPOST); |
|
| 167 | 167 | } |
| 168 | 168 | } |
| 169 | 169 | |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | $doxcode = Request::getInt('doxcode', 0, 'POST') ? 1 : 0; |
| 203 | 203 | $dobr = Request::getInt('dobr', 0, 'POST') ? 1 : 0; |
| 204 | 204 | $icon = (Request::getString('icon', '', 'POST') |
| 205 | - && is_file($GLOBALS['xoops']->path('images/subject/' . Request::getString('icon', '', 'POST'))) ? Request::getString('icon', '', 'POST') : ''); |
|
| 205 | + && is_file($GLOBALS['xoops']->path('images/subject/'.Request::getString('icon', '', 'POST'))) ? Request::getString('icon', '', 'POST') : ''); |
|
| 206 | 206 | $attachsig = Request::getBool('attachsig', false, 'POST') |
| 207 | 207 | && $topicHandler->getPermission($forumObject, $topic_status, 'signature'); |
| 208 | 208 | $view_require = Request::getString('view_require', '', 'POST'); |
@@ -235,14 +235,14 @@ discard block |
||
| 235 | 235 | $attachments_tmp = unserialize(base64_decode(Request::getString('attachments_tmp', '', 'POST'))); |
| 236 | 236 | if (Request::getArray('delete_tmp', null, 'POST') && count(Request::getArray('delete_tmp', null, 'POST')) > 1) { |
| 237 | 237 | foreach (Request::getArray('delete_tmp', null, 'POST') as $key) { |
| 238 | - unlink($GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'] . '/' . $attachments_tmp[$key][0])); |
|
| 238 | + unlink($GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'].'/'.$attachments_tmp[$key][0])); |
|
| 239 | 239 | unset($attachments_tmp[$key]); |
| 240 | 240 | } |
| 241 | 241 | } |
| 242 | 242 | } |
| 243 | 243 | if (isset($attachments_tmp) && count($attachments_tmp)) { |
| 244 | 244 | foreach ($attachments_tmp as $key => $attach) { |
| 245 | - if (rename(XOOPS_CACHE_PATH . '/' . $attachments_tmp[$key][0], $GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'] . '/' . $attachments_tmp[$key][0]))) { |
|
| 245 | + if (rename(XOOPS_CACHE_PATH.'/'.$attachments_tmp[$key][0], $GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'].'/'.$attachments_tmp[$key][0]))) { |
|
| 246 | 246 | $postObject->setAttachment($attach[0], $attach[1], $attach[2]); |
| 247 | 247 | } |
| 248 | 248 | } |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | |
| 252 | 252 | if (isset($_FILES['userfile']['name']) && '' !== $_FILES['userfile']['name'] |
| 253 | 253 | && $topicHandler->getPermission($forumObject, $topic_status, 'attach')) { |
| 254 | - require_once $GLOBALS['xoops']->path('modules/' . $xoopsModule->getVar('dirname', 'n') . '/class/uploader.php'); |
|
| 254 | + require_once $GLOBALS['xoops']->path('modules/'.$xoopsModule->getVar('dirname', 'n').'/class/uploader.php'); |
|
| 255 | 255 | $maxfilesize = $forumObject->getVar('attach_maxkb') * 1024; |
| 256 | 256 | $uploaddir = XOOPS_CACHE_PATH; |
| 257 | 257 | |
@@ -273,13 +273,13 @@ discard block |
||
| 273 | 273 | $uploader->setCheckMediaTypeByExt(); |
| 274 | 274 | $temp = Request::getArray('xoops_upload_file', [], 'POST'); |
| 275 | 275 | if ($uploader->fetchMedia($temp[0])) { |
| 276 | - $prefix = is_object($GLOBALS['xoopsUser']) ? (string)$GLOBALS['xoopsUser']->uid() . '_' : 'newbb_'; |
|
| 276 | + $prefix = is_object($GLOBALS['xoopsUser']) ? (string)$GLOBALS['xoopsUser']->uid().'_' : 'newbb_'; |
|
| 277 | 277 | $uploader->setPrefix($prefix); |
| 278 | 278 | if (!$uploader->upload()) { |
| 279 | 279 | $error_message[] = $error_upload = $uploader->getErrors(); |
| 280 | 280 | } else { |
| 281 | 281 | if (is_file($uploader->getSavedDestination())) { |
| 282 | - if (rename(XOOPS_CACHE_PATH . '/' . $uploader->getSavedFileName(), $GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'] . '/' . $uploader->getSavedFileName()))) { |
|
| 282 | + if (rename(XOOPS_CACHE_PATH.'/'.$uploader->getSavedFileName(), $GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'].'/'.$uploader->getSavedFileName()))) { |
|
| 283 | 283 | $postObject->setAttachment($uploader->getSavedFileName(), $uploader->getMediaName(), $uploader->getMediaType()); |
| 284 | 284 | } |
| 285 | 285 | } |
@@ -327,9 +327,9 @@ discard block |
||
| 327 | 327 | if (!empty($isnew) && $approved && !empty($GLOBALS['xoopsModuleConfig']['notification_enabled'])) { |
| 328 | 328 | $tags = []; |
| 329 | 329 | $tags['THREAD_NAME'] = Request::getString('subject', '', 'POST'); |
| 330 | - $tags['THREAD_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/viewtopic.php?post_id=' . $postid; |
|
| 330 | + $tags['THREAD_URL'] = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/viewtopic.php?post_id='.$postid; |
|
| 331 | 331 | $tags['POST_URL'] = $tags['THREAD_URL']; // . '#forumpost' . $postid; |
| 332 | - require_once __DIR__ . '/include/notification.inc.php'; |
|
| 332 | + require_once __DIR__.'/include/notification.inc.php'; |
|
| 333 | 333 | $forum_info = newbb_notify_iteminfo('forum', $forumObject->getVar('forum_id')); |
| 334 | 334 | $tags['FORUM_NAME'] = $forum_info['name']; |
| 335 | 335 | $tags['FORUM_URL'] = $forum_info['url']; |
@@ -368,34 +368,34 @@ discard block |
||
| 368 | 368 | |
| 369 | 369 | if ($approved) { |
| 370 | 370 | if (!empty($GLOBALS['xoopsModuleConfig']['cache_enabled'])) { |
| 371 | - newbbSetSession('t' . $postObject->getVar('topic_id'), null); |
|
| 371 | + newbbSetSession('t'.$postObject->getVar('topic_id'), null); |
|
| 372 | 372 | } |
| 373 | 373 | // Update user |
| 374 | 374 | if ($uid > 0) { |
| 375 | - $sql = 'SELECT count(*)' . ' FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_topics') . ' WHERE approved=1 AND topic_poster =' . $uid; |
|
| 375 | + $sql = 'SELECT count(*)'.' FROM '.$GLOBALS['xoopsDB']->prefix('newbb_topics').' WHERE approved=1 AND topic_poster ='.$uid; |
|
| 376 | 376 | $ret = $GLOBALS['xoopsDB']->query($sql); |
| 377 | 377 | list($topics) = $GLOBALS['xoopsDB']->fetchRow($ret); |
| 378 | 378 | |
| 379 | - $sql = ' SELECT count(*)' . ' FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_topics') . ' WHERE approved=1 AND topic_digest > 0 AND topic_poster =' . $uid; |
|
| 379 | + $sql = ' SELECT count(*)'.' FROM '.$GLOBALS['xoopsDB']->prefix('newbb_topics').' WHERE approved=1 AND topic_digest > 0 AND topic_poster ='.$uid; |
|
| 380 | 380 | $ret = $GLOBALS['xoopsDB']->query($sql); |
| 381 | 381 | list($digests) = $GLOBALS['xoopsDB']->fetchRow($ret); |
| 382 | 382 | |
| 383 | - $sql = ' SELECT count(*), MAX(post_time)' . ' FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_posts') . ' WHERE approved=1 AND uid =' . $uid; |
|
| 383 | + $sql = ' SELECT count(*), MAX(post_time)'.' FROM '.$GLOBALS['xoopsDB']->prefix('newbb_posts').' WHERE approved=1 AND uid ='.$uid; |
|
| 384 | 384 | $ret = $GLOBALS['xoopsDB']->query($sql); |
| 385 | 385 | list($posts, $lastpost) = $GLOBALS['xoopsDB']->fetchRow($ret); |
| 386 | 386 | |
| 387 | - $GLOBALS['xoopsDB']->queryF(' REPLACE INTO ' . $GLOBALS['xoopsDB']->prefix('newbb_user_stats') . " SET uid = '{$uid}', user_topics = '{$topics}', user_posts = '{$posts}', user_digests = '{$digests}', user_lastpost = '{$lastpost}'"); |
|
| 387 | + $GLOBALS['xoopsDB']->queryF(' REPLACE INTO '.$GLOBALS['xoopsDB']->prefix('newbb_user_stats')." SET uid = '{$uid}', user_topics = '{$topics}', user_posts = '{$posts}', user_digests = '{$digests}', user_lastpost = '{$lastpost}'"); |
|
| 388 | 388 | } |
| 389 | 389 | |
| 390 | - $redirect = XOOPS_URL . '/modules/newbb/viewtopic.php?post_id=' . $postid; |
|
| 391 | - $message = _MD_NEWBB_THANKSSUBMIT . '<br>' . $error_upload; |
|
| 390 | + $redirect = XOOPS_URL.'/modules/newbb/viewtopic.php?post_id='.$postid; |
|
| 391 | + $message = _MD_NEWBB_THANKSSUBMIT.'<br>'.$error_upload; |
|
| 392 | 392 | } else { |
| 393 | - $redirect = XOOPS_URL . '/modules/newbb/viewforum.php?forum=' . $postObject->getVar('forum_id'); |
|
| 394 | - $message = _MD_NEWBB_THANKSSUBMIT . '<br>' . _MD_NEWBB_WAITFORAPPROVAL . '<br>' . $error_upload; |
|
| 393 | + $redirect = XOOPS_URL.'/modules/newbb/viewforum.php?forum='.$postObject->getVar('forum_id'); |
|
| 394 | + $message = _MD_NEWBB_THANKSSUBMIT.'<br>'._MD_NEWBB_WAITFORAPPROVAL.'<br>'.$error_upload; |
|
| 395 | 395 | } |
| 396 | 396 | |
| 397 | 397 | if ('add' === $op) { |
| 398 | - redirect_header(XOOPS_URL . '/modules/newbb/polls.php?op=add&forum=' . $postObject->getVar('forum_id') . '&topic_id=' . $postObject->getVar('topic_id'), 1, _MD_NEWBB_ADDPOLL); |
|
| 398 | + redirect_header(XOOPS_URL.'/modules/newbb/polls.php?op=add&forum='.$postObject->getVar('forum_id').'&topic_id='.$postObject->getVar('topic_id'), 1, _MD_NEWBB_ADDPOLL); |
|
| 399 | 399 | } else { |
| 400 | 400 | redirect_header($redirect, 2, $message); |
| 401 | 401 | } |
@@ -415,7 +415,7 @@ discard block |
||
| 415 | 415 | $attachments_tmp = unserialize(base64_decode(Request::getArray('attachments_tmp', [], 'POST'))); |
| 416 | 416 | if (Request::getArray('delete_tmp', null, 'POST') && count(Request::getArray('delete_tmp', null, 'POST'))) { |
| 417 | 417 | foreach (Request::getArray('delete_tmp', '', 'POST') as $key) { |
| 418 | - unlink($uploaddir = $GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'] . '/' . $attachments_tmp[$key][0])); |
|
| 418 | + unlink($uploaddir = $GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'].'/'.$attachments_tmp[$key][0])); |
|
| 419 | 419 | unset($attachments_tmp[$key]); |
| 420 | 420 | } |
| 421 | 421 | } |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | |
| 424 | 424 | $error_upload = ''; |
| 425 | 425 | if (isset($_FILES['userfile']['name']) && '' !== $_FILES['userfile']['name']) { |
| 426 | - require_once $GLOBALS['xoops']->path('modules/' . $xoopsModule->getVar('dirname', 'n') . '/class/uploader.php'); |
|
| 426 | + require_once $GLOBALS['xoops']->path('modules/'.$xoopsModule->getVar('dirname', 'n').'/class/uploader.php'); |
|
| 427 | 427 | $maxfilesize = $forumObject->getVar('attach_maxkb') * 1024; |
| 428 | 428 | $uploaddir = XOOPS_CACHE_PATH; |
| 429 | 429 | |
@@ -444,7 +444,7 @@ discard block |
||
| 444 | 444 | $uploader->setCheckMediaTypeByExt(); |
| 445 | 445 | $temp = Request::getArray('xoops_upload_file', [], 'POST'); |
| 446 | 446 | if ($uploader->fetchMedia($temp[0])) { |
| 447 | - $prefix = is_object($GLOBALS['xoopsUser']) ? (string)$GLOBALS['xoopsUser']->uid() . '_' : 'newbb_'; |
|
| 447 | + $prefix = is_object($GLOBALS['xoopsUser']) ? (string)$GLOBALS['xoopsUser']->uid().'_' : 'newbb_'; |
|
| 448 | 448 | $uploader->setPrefix($prefix); |
| 449 | 449 | if (!$uploader->upload()) { |
| 450 | 450 | $error_message[] = $error_upload = $uploader->getErrors(); |
@@ -493,7 +493,7 @@ discard block |
||
| 493 | 493 | |
| 494 | 494 | $post_preview = [ |
| 495 | 495 | 'subject' => $p_subject, |
| 496 | - 'meta' => _MD_NEWBB_BY . ' ' . $p_name . ' ' . _MD_NEWBB_ON . ' ' . $p_date, |
|
| 496 | + 'meta' => _MD_NEWBB_BY.' '.$p_name.' '._MD_NEWBB_ON.' '.$p_date, |
|
| 497 | 497 | 'content' => $p_message |
| 498 | 498 | ]; |
| 499 | 499 | $xoopsTpl->assign_by_ref('post_preview', $post_preview); |
@@ -512,11 +512,11 @@ discard block |
||
| 512 | 512 | $poster_name = Request::getString('poster_name', '', 'POST'); |
| 513 | 513 | $hidden = Request::getString('hidden', '', 'POST'); |
| 514 | 514 | $notify = Request::getInt('notify', 0, 'POST'); |
| 515 | - $attachsig = Request::getInt('attachsig', 0, 'POST');//!empty($_POST['attachsig']) ? 1 : 0; |
|
| 515 | + $attachsig = Request::getInt('attachsig', 0, 'POST'); //!empty($_POST['attachsig']) ? 1 : 0; |
|
| 516 | 516 | $isreply = Request::getInt('isreply', 0, 'POST'); //!empty($_POST['isreply']) ? 1 : 0; |
| 517 | 517 | $isedit = Request::getInt('isedit', 0, 'POST'); //!empty($_POST['isedit']) ? 1 : 0; |
| 518 | 518 | $icon = (Request::getString('icon', '', 'POST') |
| 519 | - && is_file($GLOBALS['xoops']->path('images/subject/' . Request::getString('icon', '', 'POST'))) ? Request::getString('icon', '', 'POST') : ''); |
|
| 519 | + && is_file($GLOBALS['xoops']->path('images/subject/'.Request::getString('icon', '', 'POST'))) ? Request::getString('icon', '', 'POST') : ''); |
|
| 520 | 520 | $view_require = Request::getString('view_require', '', 'POST'); |
| 521 | 521 | $post_karma = (('require_karma' === $view_require) |
| 522 | 522 | && !Request::getInt('post_karma', 0, 'POST')) ? Request::getInt('post_karma', 0, 'POST') : 0; |
@@ -528,8 +528,8 @@ discard block |
||
| 528 | 528 | $attachments = $postObject->getAttachment(); |
| 529 | 529 | $xoopsTpl->assign('error_message', implode('<br>', $error_message)); |
| 530 | 530 | |
| 531 | - include __DIR__ . '/include/form.post.php'; |
|
| 531 | + include __DIR__.'/include/form.post.php'; |
|
| 532 | 532 | } |
| 533 | 533 | // irmtfan move to footer.php |
| 534 | -require_once __DIR__ . '/footer.php'; |
|
| 534 | +require_once __DIR__.'/footer.php'; |
|
| 535 | 535 | include $GLOBALS['xoops']->path('footer.php'); |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | * @since 4.00 |
| 9 | 9 | * @package module::newbb |
| 10 | 10 | */ |
| 11 | -require_once __DIR__ . '/header.php'; |
|
| 11 | +require_once __DIR__.'/header.php'; |
|
| 12 | 12 | |
| 13 | 13 | if (!is_object($GLOBALS['xoopsUser']) || !$GLOBALS['xoopsUser']->isAdmin()) { |
| 14 | 14 | exit(_NOPERM); |
@@ -22,11 +22,11 @@ discard block |
||
| 22 | 22 | exit('No need for update'); |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | -$GLOBALS['xoopsDB']->queryF('DROP TABLE ' . $GLOBALS['xoopsDB']->prefix('newbb_type_tmp')); |
|
| 26 | -$GLOBALS['xoopsDB']->queryF('DROP TABLE ' . $GLOBALS['xoopsDB']->prefix('newbb_type_forum_tmp')); |
|
| 25 | +$GLOBALS['xoopsDB']->queryF('DROP TABLE '.$GLOBALS['xoopsDB']->prefix('newbb_type_tmp')); |
|
| 26 | +$GLOBALS['xoopsDB']->queryF('DROP TABLE '.$GLOBALS['xoopsDB']->prefix('newbb_type_forum_tmp')); |
|
| 27 | 27 | |
| 28 | 28 | if (!$GLOBALS['xoopsDB']->queryF(' |
| 29 | - CREATE TABLE ' . $GLOBALS['xoopsDB']->prefix('newbb_type_tmp') . " ( |
|
| 29 | + CREATE TABLE ' . $GLOBALS['xoopsDB']->prefix('newbb_type_tmp')." ( |
|
| 30 | 30 | `type_id` SMALLINT(4) UNSIGNED NOT NULL AUTO_INCREMENT, |
| 31 | 31 | `type_name` VARCHAR(64) NOT NULL DEFAULT '', |
| 32 | 32 | `type_color` VARCHAR(10) NOT NULL DEFAULT '', |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | if (!$GLOBALS['xoopsDB']->queryF(' |
| 42 | - CREATE TABLE ' . $GLOBALS['xoopsDB']->prefix('newbb_type_forum_tmp') . " ( |
|
| 42 | + CREATE TABLE ' . $GLOBALS['xoopsDB']->prefix('newbb_type_forum_tmp')." ( |
|
| 43 | 43 | `tf_id` MEDIUMINT(4) UNSIGNED NOT NULL AUTO_INCREMENT, |
| 44 | 44 | `type_id` SMALLINT(4) UNSIGNED NOT NULL DEFAULT '0', |
| 45 | 45 | `forum_id` SMALLINT(4) UNSIGNED NOT NULL DEFAULT '0', |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | KEY `type_order` (`type_order`) |
| 51 | 51 | ) ENGINE=MyISAM; |
| 52 | 52 | ")) { |
| 53 | - $GLOBALS['xoopsDB']->queryF('DROP TABLE ' . $GLOBALS['xoopsDB']->prefix('newbb_type_tmp')); |
|
| 53 | + $GLOBALS['xoopsDB']->queryF('DROP TABLE '.$GLOBALS['xoopsDB']->prefix('newbb_type_tmp')); |
|
| 54 | 54 | exit('Can not create tmp table for `bb_type_forum_tmp`'); |
| 55 | 55 | } |
| 56 | 56 | |
@@ -61,10 +61,10 @@ discard block |
||
| 61 | 61 | foreach ($subjectpres as $subjectpre) { |
| 62 | 62 | if (preg_match("/<[^#]*color=[\"'](#[^'\"\s]*)[^>]>[\[]?([^<\]]*)[\]]?/is", $subjectpre, $matches)) { |
| 63 | 63 | if (!$GLOBALS['xoopsDB']->queryF(' |
| 64 | - INSERT INTO ' . $GLOBALS['xoopsDB']->prefix('newbb_type_tmp') . ' |
|
| 64 | + INSERT INTO ' . $GLOBALS['xoopsDB']->prefix('newbb_type_tmp').' |
|
| 65 | 65 | (`type_name`, `type_color`) |
| 66 | 66 | VALUES |
| 67 | - (' . $GLOBALS['xoopsDB']->quoteString($matches[2]) . ', ' . $GLOBALS['xoopsDB']->quoteString($matches[1]) . ') |
|
| 67 | + (' . $GLOBALS['xoopsDB']->quoteString($matches[2]).', '.$GLOBALS['xoopsDB']->quoteString($matches[1]).') |
|
| 68 | 68 | ')) { |
| 69 | 69 | xoops_error("Can not add type of `{$matches[2]}`"); |
| 70 | 70 | continue; |
@@ -73,8 +73,8 @@ discard block |
||
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | 75 | if (0 === count($types)) { |
| 76 | - $GLOBALS['xoopsDB']->queryF('DROP TABLE ' . $GLOBALS['xoopsDB']->prefix('newbb_type_tmp')); |
|
| 77 | - $GLOBALS['xoopsDB']->queryF('DROP TABLE ' . $GLOBALS['xoopsDB']->prefix('newbb_type_forum_tmp')); |
|
| 76 | + $GLOBALS['xoopsDB']->queryF('DROP TABLE '.$GLOBALS['xoopsDB']->prefix('newbb_type_tmp')); |
|
| 77 | + $GLOBALS['xoopsDB']->queryF('DROP TABLE '.$GLOBALS['xoopsDB']->prefix('newbb_type_forum_tmp')); |
|
| 78 | 78 | exit('No type item created'); |
| 79 | 79 | } |
| 80 | 80 | |
@@ -87,14 +87,14 @@ discard block |
||
| 87 | 87 | $type_query[] = "({$key}, {$forum_id}, {$order})"; |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - $sql = 'INSERT INTO ' . $GLOBALS['xoopsDB']->prefix('newbb_type_forum_tmp') . ' (type_id, forum_id, type_order) ' . ' VALUES ' . implode(', ', $type_query); |
|
| 90 | + $sql = 'INSERT INTO '.$GLOBALS['xoopsDB']->prefix('newbb_type_forum_tmp').' (type_id, forum_id, type_order) '.' VALUES '.implode(', ', $type_query); |
|
| 91 | 91 | if (false === ($result = $GLOBALS['xoopsDB']->queryF($sql))) { |
| 92 | 92 | xoops_error($GLOBALS['xoopsDB']->error()); |
| 93 | 93 | } |
| 94 | 94 | } |
| 95 | 95 | } else { |
| 96 | - $GLOBALS['xoopsDB']->queryF('DROP TABLE ' . $GLOBALS['xoopsDB']->prefix('newbb_type_tmp')); |
|
| 97 | - $GLOBALS['xoopsDB']->queryF('DROP TABLE ' . $GLOBALS['xoopsDB']->prefix('newbb_type_forum_tmp')); |
|
| 96 | + $GLOBALS['xoopsDB']->queryF('DROP TABLE '.$GLOBALS['xoopsDB']->prefix('newbb_type_tmp')); |
|
| 97 | + $GLOBALS['xoopsDB']->queryF('DROP TABLE '.$GLOBALS['xoopsDB']->prefix('newbb_type_forum_tmp')); |
|
| 98 | 98 | exit('No type item to update'); |
| 99 | 99 | } |
| 100 | 100 | |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | use Xmf\Request; |
| 29 | 29 | use XoopsModules\Xoopspoll; |
| 30 | 30 | |
| 31 | -require_once __DIR__ . '/header.php'; |
|
| 31 | +require_once __DIR__.'/header.php'; |
|
| 32 | 32 | $poll_id = Request::getInt('poll_id', Request::getInt('poll_id', 0, 'POST'), 'GET'); |
| 33 | 33 | $topic_id = Request::getInt('topic_id', Request::getInt('topic_id', 0, 'POST'), 'GET'); |
| 34 | 34 | $forum = Request::getInt('forum', Request::getInt('forum', 0, 'POST'), 'GET'); |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | if (!Request::getInt('option_id', 0, 'POST')) { |
| 44 | 44 | // irmtfan - add error message - simple url |
| 45 | - redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?topic_id={$topic_id}", 1, _MD_NEWBB_POLL_NOOPTION); |
|
| 45 | + redirect_header(XOOPS_URL."/modules/newbb/viewtopic.php?topic_id={$topic_id}", 1, _MD_NEWBB_POLL_NOOPTION); |
|
| 46 | 46 | } |
| 47 | 47 | // poll module |
| 48 | 48 | $pollModuleHandler = $moduleHandler->getByDirname($GLOBALS['xoopsModuleConfig']['poll_module']); |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | $pollObject = $xpPollHandler->get($poll_id); // will create poll if poll_id = 0 exist |
| 61 | 61 | // old xoopspoll or umfrage or any clone from them |
| 62 | 62 | } else { |
| 63 | - include $GLOBALS['xoops']->path('modules/' . $GLOBALS['xoopsModuleConfig']['poll_module'] . '/include/constants.php'); |
|
| 63 | + include $GLOBALS['xoops']->path('modules/'.$GLOBALS['xoopsModuleConfig']['poll_module'].'/include/constants.php'); |
|
| 64 | 64 | $classPoll = $topicObject->loadOldPoll(); |
| 65 | 65 | $pollObject = new $classPoll($poll_id); // will create poll if poll_id = 0 exist |
| 66 | 66 | } |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | $optionId = Request::getInt('option_id', 0, 'POST'); |
| 82 | 82 | } |
| 83 | 83 | if (!$pollObject->hasExpired()) { |
| 84 | - $msg = constant('_MD_' . strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']) . '_MUSTLOGIN'); |
|
| 84 | + $msg = constant('_MD_'.strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']).'_MUSTLOGIN'); |
|
| 85 | 85 | //@todo:: add $url to all redirects |
| 86 | 86 | // $url = $GLOBALS['xoops']->buildUrl("index.php", array('poll_id' => $poll_id)); |
| 87 | 87 | if ($pollObject->isAllowedToVote()) { |
@@ -95,13 +95,13 @@ discard block |
||
| 95 | 95 | echo $pollObject->getHtmlErrors(); |
| 96 | 96 | exit(); |
| 97 | 97 | } |
| 98 | - $msg = constant('_MD_' . strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']) . '_THANKSFORVOTE'); |
|
| 98 | + $msg = constant('_MD_'.strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']).'_THANKSFORVOTE'); |
|
| 99 | 99 | } else { |
| 100 | 100 | /* there was a problem registering the vote */ |
| 101 | - redirect_header($GLOBALS['xoops']->buildUrl('index.php', ['poll_id' => $poll_id]), $classConstants::REDIRECT_DELAY_MEDIUM, constant('_MD_' . strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']) . '_VOTE_ERROR')); |
|
| 101 | + redirect_header($GLOBALS['xoops']->buildUrl('index.php', ['poll_id' => $poll_id]), $classConstants::REDIRECT_DELAY_MEDIUM, constant('_MD_'.strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']).'_VOTE_ERROR')); |
|
| 102 | 102 | } |
| 103 | 103 | } else { |
| 104 | - $msg = constant('_MD_' . strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']) . '_ALREADYVOTED'); |
|
| 104 | + $msg = constant('_MD_'.strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']).'_ALREADYVOTED'); |
|
| 105 | 105 | } |
| 106 | 106 | /* set anon user vote (and the time they voted) */ |
| 107 | 107 | if (!is_object($GLOBALS['xoopsUser'])) { |
@@ -111,14 +111,14 @@ discard block |
||
| 111 | 111 | $classPollUtility::setVoteCookie($poll_id, $voteTime, 0); |
| 112 | 112 | } |
| 113 | 113 | } else { |
| 114 | - $msg = constant('_MD_' . strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']) . '_CANNOTVOTE'); |
|
| 114 | + $msg = constant('_MD_'.strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']).'_CANNOTVOTE'); |
|
| 115 | 115 | } |
| 116 | 116 | } else { |
| 117 | 117 | /* poll has expired so just show the results */ |
| 118 | - $msg = constant('_MD_' . strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']) . 'SORRYEXPIRED'); |
|
| 118 | + $msg = constant('_MD_'.strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']).'SORRYEXPIRED'); |
|
| 119 | 119 | } |
| 120 | 120 | } else { |
| 121 | - $msg = constant('_MD_' . strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']) . '_ERROR_INVALID_POLLID'); |
|
| 121 | + $msg = constant('_MD_'.strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']).'_ERROR_INVALID_POLLID'); |
|
| 122 | 122 | } |
| 123 | 123 | if (null !== $url) { |
| 124 | 124 | redirect_header($url, $classConstants::REDIRECT_DELAY_MEDIUM, $msg); |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | } |
| 128 | 128 | // old xoopspoll or umfrage or any clone from them |
| 129 | 129 | } else { |
| 130 | - $classLog = $classPoll . 'Log'; |
|
| 130 | + $classLog = $classPoll.'Log'; |
|
| 131 | 131 | if (is_object($GLOBALS['xoopsUser'])) { |
| 132 | 132 | if ($classLog::hasVoted($poll_id, Request::getString('REMOTE_ADDR', '', 'SERVER'), $GLOBALS['xoopsUser']->getVar('uid'))) { |
| 133 | 133 | $msg = _PL_ALREADYVOTED; |
@@ -25,23 +25,23 @@ |
||
| 25 | 25 | require_once $GLOBALS['xoops']->path('modules/newbb/include/functions.render.php'); |
| 26 | 26 | $iconHandler = newbbGetIconHandler(); |
| 27 | 27 | // get css rel path from setted language |
| 28 | -$css_rel_path = $iconHandler->getPath('language/' . $GLOBALS['xoopsConfig']['language'], 'newbb', 'language/english', 'css'); |
|
| 28 | +$css_rel_path = $iconHandler->getPath('language/'.$GLOBALS['xoopsConfig']['language'], 'newbb', 'language/english', 'css'); |
|
| 29 | 29 | // add local stylesheet |
| 30 | 30 | /** @var xos_opal_Theme $xoTheme */ |
| 31 | -$xoTheme->addStylesheet($css_rel_path . '/style.css'); |
|
| 31 | +$xoTheme->addStylesheet($css_rel_path.'/style.css'); |
|
| 32 | 32 | |
| 33 | 33 | // get js rel path from setted language |
| 34 | -$js_rel_path = $iconHandler->getPath('language/' . $GLOBALS['xoopsConfig']['language'], 'newbb', 'language/english', 'js'); |
|
| 34 | +$js_rel_path = $iconHandler->getPath('language/'.$GLOBALS['xoopsConfig']['language'], 'newbb', 'language/english', 'js'); |
|
| 35 | 35 | // add all local js files inside js directory |
| 36 | 36 | xoops_load('XoopsLists'); |
| 37 | 37 | $allfiles = \XoopsLists::getFileListAsArray($GLOBALS['xoops']->path($js_rel_path)); |
| 38 | 38 | foreach ($allfiles as $jsfile) { |
| 39 | 39 | if ('js' === strtolower(pathinfo($jsfile, PATHINFO_EXTENSION))) { |
| 40 | - $xoTheme->addScript($js_rel_path . '/' . $jsfile); |
|
| 40 | + $xoTheme->addScript($js_rel_path.'/'.$jsfile); |
|
| 41 | 41 | } |
| 42 | 42 | } |
| 43 | -global $forumCookie; // for $forumCookie["prefix"] revert last change - use global instead of include_once |
|
| 43 | +global $forumCookie; // for $forumCookie["prefix"] revert last change - use global instead of include_once |
|
| 44 | 44 | // add toggle script |
| 45 | 45 | //$toggle_script = "var toggle_cookie=\"" . $forumCookie['prefix'] . 'G' . '\';'; |
| 46 | -$toggle_script = 'var toggle_cookie="' . $forumCookie['prefix'] . 'G";'; |
|
| 46 | +$toggle_script = 'var toggle_cookie="'.$forumCookie['prefix'].'G";'; |
|
| 47 | 47 | $xoTheme->addScript(null, ['type' => 'text/javascript'], $toggle_script); |
@@ -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)); |
|
| 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)); |
|
| 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'); |