@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | $attachmentSave = base64_encode(serialize($this->attachmentArray)); |
| 123 | 123 | } |
| 124 | 124 | $this->setVar('attachment', $attachmentSave); |
| 125 | - $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('newbb_posts') . ' SET attachment=' . $GLOBALS['xoopsDB']->quoteString($attachmentSave) . ' WHERE post_id = ' . $this->getVar('post_id'); |
|
| 125 | + $sql = 'UPDATE '.$GLOBALS['xoopsDB']->prefix('newbb_posts').' SET attachment='.$GLOBALS['xoopsDB']->quoteString($attachmentSave).' WHERE post_id = '.$this->getVar('post_id'); |
|
| 126 | 126 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { |
| 127 | 127 | //xoops_error($GLOBALS['xoopsDB']->error()); |
| 128 | 128 | return false; |
@@ -152,8 +152,8 @@ discard block |
||
| 152 | 152 | |
| 153 | 153 | foreach ($attachOld as $key => $attach) { |
| 154 | 154 | if (in_array($key, $attachArray)) { |
| 155 | - @unlink($GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'] . '/' . $attach['name_saved'])); |
|
| 156 | - @unlink($GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'] . '/thumbs/' . $attach['name_saved'])); // delete thumbnails |
|
| 155 | + @unlink($GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'].'/'.$attach['name_saved'])); |
|
| 156 | + @unlink($GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'].'/thumbs/'.$attach['name_saved'])); // delete thumbnails |
|
| 157 | 157 | continue; |
| 158 | 158 | } |
| 159 | 159 | $this->attachmentArray[$key] = $attach; |
@@ -210,25 +210,25 @@ discard block |
||
| 210 | 210 | if (is_array($attachments) && count($attachments) > 0) { |
| 211 | 211 | $iconHandler = newbbGetIconHandler(); |
| 212 | 212 | $mime_path = $iconHandler->getPath('mime'); |
| 213 | - require_once dirname(__DIR__) . '/include/functions.image.php'; |
|
| 213 | + require_once dirname(__DIR__).'/include/functions.image.php'; |
|
| 214 | 214 | $image_extensions = ['jpg', 'jpeg', 'gif', 'png', 'bmp']; // need improve !!! |
| 215 | - $post_attachment .= '<br><strong>' . _MD_NEWBB_ATTACHMENT . '</strong>:'; |
|
| 215 | + $post_attachment .= '<br><strong>'._MD_NEWBB_ATTACHMENT.'</strong>:'; |
|
| 216 | 216 | $post_attachment .= '<br><hr size="1" noshade="noshade" /><br>'; |
| 217 | 217 | foreach ($attachments as $key => $att) { |
| 218 | 218 | $file_extension = ltrim(strrchr($att['name_saved'], '.'), '.'); |
| 219 | 219 | $filetype = $file_extension; |
| 220 | - if (file_exists($GLOBALS['xoops']->path($mime_path . '/' . $filetype . '.gif'))) { |
|
| 221 | - $icon_filetype = XOOPS_URL . '/' . $mime_path . '/' . $filetype . '.gif'; |
|
| 220 | + if (file_exists($GLOBALS['xoops']->path($mime_path.'/'.$filetype.'.gif'))) { |
|
| 221 | + $icon_filetype = XOOPS_URL.'/'.$mime_path.'/'.$filetype.'.gif'; |
|
| 222 | 222 | } else { |
| 223 | - $icon_filetype = XOOPS_URL . '/' . $mime_path . '/unknown.gif'; |
|
| 223 | + $icon_filetype = XOOPS_URL.'/'.$mime_path.'/unknown.gif'; |
|
| 224 | 224 | } |
| 225 | - $file_size = @filesize($GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'] . '/' . $att['name_saved'])); |
|
| 226 | - $file_size = number_format($file_size / 1024, 2) . ' KB'; |
|
| 225 | + $file_size = @filesize($GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'].'/'.$att['name_saved'])); |
|
| 226 | + $file_size = number_format($file_size / 1024, 2).' KB'; |
|
| 227 | 227 | if (in_array(strtolower($file_extension), $image_extensions) |
| 228 | 228 | && $GLOBALS['xoopsModuleConfig']['media_allowed']) { |
| 229 | - $post_attachment .= '<br><img src="' . $icon_filetype . '" alt="' . $filetype . '" /><strong> ' . $att['nameDisplay'] . '</strong> <small>(' . $file_size . ')</small>'; |
|
| 230 | - $post_attachment .= '<br>' . newbbAttachmentImage($att['name_saved']); |
|
| 231 | - $isDisplayed = true; |
|
| 229 | + $post_attachment .= '<br><img src="'.$icon_filetype.'" alt="'.$filetype.'" /><strong> '.$att['nameDisplay'].'</strong> <small>('.$file_size.')</small>'; |
|
| 230 | + $post_attachment .= '<br>'.newbbAttachmentImage($att['name_saved']); |
|
| 231 | + $isDisplayed = true; |
|
| 232 | 232 | } else { |
| 233 | 233 | if (empty($GLOBALS['xoopsModuleConfig']['show_userattach'])) { |
| 234 | 234 | $post_attachment .= '<a href="' |
@@ -362,10 +362,10 @@ discard block |
||
| 362 | 362 | // End irmtfan add option to do only the latest edit when do_latestedit=0 (Alfred) |
| 363 | 363 | // START hacked by irmtfan |
| 364 | 364 | // display/save all edit records. |
| 365 | - $post_edit .= _MD_NEWBB_EDITEDBY . ' ' . $edit_user . ' ' . _MD_NEWBB_ON . ' ' . formatTimestamp($edit_time) . '<br>'; |
|
| 365 | + $post_edit .= _MD_NEWBB_EDITEDBY.' '.$edit_user.' '._MD_NEWBB_ON.' '.formatTimestamp($edit_time).'<br>'; |
|
| 366 | 366 | // if reason is not empty |
| 367 | 367 | if ('' !== $edit_msg) { |
| 368 | - $post_edit .= _MD_NEWBB_EDITEDMSG . ' ' . $edit_msg . '<br>'; |
|
| 368 | + $post_edit .= _MD_NEWBB_EDITEDMSG.' '.$edit_msg.'<br>'; |
|
| 369 | 369 | } |
| 370 | 370 | // START hacked by irmtfan |
| 371 | 371 | } |
@@ -381,8 +381,8 @@ discard block |
||
| 381 | 381 | { |
| 382 | 382 | global $viewtopic_users; |
| 383 | 383 | $newbbConfig = newbbLoadConfig(); |
| 384 | - require_once __DIR__ . '/../include/functions.user.php'; |
|
| 385 | - require_once __DIR__ . '/../include/functions.render.php'; |
|
| 384 | + require_once __DIR__.'/../include/functions.user.php'; |
|
| 385 | + require_once __DIR__.'/../include/functions.render.php'; |
|
| 386 | 386 | |
| 387 | 387 | $uid = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('uid') : 0; |
| 388 | 388 | /** @var KarmaHandler $karmaHandler */ |
@@ -393,14 +393,14 @@ discard block |
||
| 393 | 393 | $post['attachment'] = false; |
| 394 | 394 | $post_text = newbbDisplayTarea($this->vars['post_text']['value'], $this->getVar('dohtml'), $this->getVar('dosmiley'), $this->getVar('doxcode'), $this->getVar('doimage'), $this->getVar('dobr')); |
| 395 | 395 | if (newbbIsAdmin($this->getVar('forum_id')) || $this->checkIdentity()) { |
| 396 | - $post['text'] = $post_text . '<br>' . $this->displayAttachment(); |
|
| 396 | + $post['text'] = $post_text.'<br>'.$this->displayAttachment(); |
|
| 397 | 397 | } elseif ($newbbConfig['enable_karma'] && $this->getVar('post_karma') > $user_karma) { |
| 398 | 398 | $post['text'] = sprintf(_MD_NEWBB_KARMA_REQUIREMENT, $user_karma, $this->getVar('post_karma')); |
| 399 | 399 | } elseif ($newbbConfig['allow_require_reply'] && $this->getVar('require_reply') |
| 400 | 400 | && (!$uid || !isset($viewtopic_users[$uid]))) { |
| 401 | 401 | $post['text'] = _MD_NEWBB_REPLY_REQUIREMENT; |
| 402 | 402 | } else { |
| 403 | - $post['text'] = $post_text . '<br>' . $this->displayAttachment(); |
|
| 403 | + $post['text'] = $post_text.'<br>'.$this->displayAttachment(); |
|
| 404 | 404 | } |
| 405 | 405 | /** @var \XoopsMemberHandler $memberHandler */ |
| 406 | 406 | $memberHandler = xoops_getHandler('member'); |
@@ -485,8 +485,8 @@ discard block |
||
| 485 | 485 | $name_anonymous = $myts->htmlSpecialChars($GLOBALS['xoopsConfig']['anonymous']); |
| 486 | 486 | } |
| 487 | 487 | |
| 488 | - require_once __DIR__ . '/../include/functions.time.php'; |
|
| 489 | - require_once __DIR__ . '/../include/functions.render.php'; |
|
| 488 | + require_once __DIR__.'/../include/functions.time.php'; |
|
| 489 | + require_once __DIR__.'/../include/functions.render.php'; |
|
| 490 | 490 | |
| 491 | 491 | $post_id = $this->getVar('post_id'); |
| 492 | 492 | $topic_id = $this->getVar('topic_id'); |
@@ -497,7 +497,7 @@ discard block |
||
| 497 | 497 | $query_array['topic_id'] = "topic_id={$topic_id}"; |
| 498 | 498 | foreach ($query_vars as $var) { |
| 499 | 499 | if (Request::getString($var, '', 'GET')) { |
| 500 | - $query_array[$var] = "{$var}=" . Request::getString($var, '', 'GET'); |
|
| 500 | + $query_array[$var] = "{$var}=".Request::getString($var, '', 'GET'); |
|
| 501 | 501 | } |
| 502 | 502 | } |
| 503 | 503 | $page_query = htmlspecialchars(implode('&', array_values($query_array))); |
@@ -515,11 +515,11 @@ discard block |
||
| 515 | 515 | $post_text = $this->getVar('post_text'); |
| 516 | 516 | $post_attachment = $this->displayAttachment(); |
| 517 | 517 | } elseif ($GLOBALS['xoopsModuleConfig']['enable_karma'] && $this->getVar('post_karma') > $user_karma) { |
| 518 | - $post_text = "<div class='karma'>" . sprintf(_MD_NEWBB_KARMA_REQUIREMENT, $user_karma, $this->getVar('post_karma')) . '</div>'; |
|
| 518 | + $post_text = "<div class='karma'>".sprintf(_MD_NEWBB_KARMA_REQUIREMENT, $user_karma, $this->getVar('post_karma')).'</div>'; |
|
| 519 | 519 | $post_attachment = ''; |
| 520 | 520 | } elseif ($GLOBALS['xoopsModuleConfig']['allow_require_reply'] && $this->getVar('require_reply') |
| 521 | 521 | && (!$uid || !in_array($uid, $viewtopic_posters))) { |
| 522 | - $post_text = "<div class='karma'>" . _MD_NEWBB_REPLY_REQUIREMENT . '</div>'; |
|
| 522 | + $post_text = "<div class='karma'>"._MD_NEWBB_REPLY_REQUIREMENT.'</div>'; |
|
| 523 | 523 | $post_attachment = ''; |
| 524 | 524 | } else { |
| 525 | 525 | $post_text = $this->getVar('post_text'); |
@@ -546,9 +546,9 @@ discard block |
||
| 546 | 546 | } |
| 547 | 547 | |
| 548 | 548 | if ($posticon = $this->getVar('icon')) { |
| 549 | - $post_image = '<a name="' . $post_id . '"><img src="' . XOOPS_URL . '/images/subject/' . $posticon . '" alt="" /></a>'; |
|
| 549 | + $post_image = '<a name="'.$post_id.'"><img src="'.XOOPS_URL.'/images/subject/'.$posticon.'" alt="" /></a>'; |
|
| 550 | 550 | } else { |
| 551 | - $post_image = '<a name="' . $post_id . '"><img src="' . XOOPS_URL . '/images/icons/posticon.gif" alt="" /></a>'; |
|
| 551 | + $post_image = '<a name="'.$post_id.'"><img src="'.XOOPS_URL.'/images/icons/posticon.gif" alt="" /></a>'; |
|
| 552 | 552 | } |
| 553 | 553 | |
| 554 | 554 | $thread_buttons = []; |
@@ -557,10 +557,10 @@ discard block |
||
| 557 | 557 | if ($isAdmin && ($GLOBALS['xoopsUser'] && $GLOBALS['xoopsUser']->getVar('uid') !== $this->getVar('uid')) |
| 558 | 558 | && $this->getVar('uid') > 0) { |
| 559 | 559 | $mod_buttons['bann']['image'] = newbbDisplayImage('p_bann', _MD_NEWBB_SUSPEND_MANAGEMENT); |
| 560 | - $mod_buttons['bann']['link'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/moderate.php?forum=' . $forum_id . '&uid=' . $this->getVar('uid'); |
|
| 560 | + $mod_buttons['bann']['link'] = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/moderate.php?forum='.$forum_id.'&uid='.$this->getVar('uid'); |
|
| 561 | 561 | $mod_buttons['bann']['name'] = _MD_NEWBB_SUSPEND_MANAGEMENT; |
| 562 | 562 | $thread_buttons['bann']['image'] = newbbDisplayImage('p_bann', _MD_NEWBB_SUSPEND_MANAGEMENT); |
| 563 | - $thread_buttons['bann']['link'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/moderate.php?forum=' . $forum_id . '&uid=' . $this->getVar('uid'); |
|
| 563 | + $thread_buttons['bann']['link'] = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/moderate.php?forum='.$forum_id.'&uid='.$this->getVar('uid'); |
|
| 564 | 564 | $thread_buttons['bann']['name'] = _MD_NEWBB_SUSPEND_MANAGEMENT; |
| 565 | 565 | } |
| 566 | 566 | |
@@ -573,10 +573,10 @@ discard block |
||
| 573 | 573 | |
| 574 | 574 | if ($edit_ok) { |
| 575 | 575 | $thread_buttons['edit']['image'] = newbbDisplayImage('p_edit', _EDIT); |
| 576 | - $thread_buttons['edit']['link'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/edit.php?{$page_query}"; |
|
| 576 | + $thread_buttons['edit']['link'] = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/edit.php?{$page_query}"; |
|
| 577 | 577 | $thread_buttons['edit']['name'] = _EDIT; |
| 578 | 578 | $mod_buttons['edit']['image'] = newbbDisplayImage('p_edit', _EDIT); |
| 579 | - $mod_buttons['edit']['link'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/edit.php?{$page_query}"; |
|
| 579 | + $mod_buttons['edit']['link'] = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/edit.php?{$page_query}"; |
|
| 580 | 580 | $mod_buttons['edit']['name'] = _EDIT; |
| 581 | 581 | } |
| 582 | 582 | } |
@@ -586,55 +586,55 @@ discard block |
||
| 586 | 586 | |
| 587 | 587 | if ($delete_ok) { |
| 588 | 588 | $thread_buttons['delete']['image'] = newbbDisplayImage('p_delete', _DELETE); |
| 589 | - $thread_buttons['delete']['link'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/delete.php?{$page_query}"; |
|
| 589 | + $thread_buttons['delete']['link'] = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/delete.php?{$page_query}"; |
|
| 590 | 590 | $thread_buttons['delete']['name'] = _DELETE; |
| 591 | 591 | $mod_buttons['delete']['image'] = newbbDisplayImage('p_delete', _DELETE); |
| 592 | - $mod_buttons['delete']['link'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/delete.php?{$page_query}"; |
|
| 592 | + $mod_buttons['delete']['link'] = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/delete.php?{$page_query}"; |
|
| 593 | 593 | $mod_buttons['delete']['name'] = _DELETE; |
| 594 | 594 | } |
| 595 | 595 | } |
| 596 | 596 | if ($topicHandler->getPermission($forum_id, $topic_status, 'reply')) { |
| 597 | 597 | $thread_buttons['reply']['image'] = newbbDisplayImage('p_reply', _MD_NEWBB_REPLY); |
| 598 | - $thread_buttons['reply']['link'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/reply.php?{$page_query}"; |
|
| 598 | + $thread_buttons['reply']['link'] = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/reply.php?{$page_query}"; |
|
| 599 | 599 | $thread_buttons['reply']['name'] = _MD_NEWBB_REPLY; |
| 600 | 600 | |
| 601 | 601 | $thread_buttons['quote']['image'] = newbbDisplayImage('p_quote', _MD_NEWBB_QUOTE); |
| 602 | - $thread_buttons['quote']['link'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/reply.php?{$page_query}&quotedac=1"; |
|
| 602 | + $thread_buttons['quote']['link'] = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/reply.php?{$page_query}&quotedac=1"; |
|
| 603 | 603 | $thread_buttons['quote']['name'] = _MD_NEWBB_QUOTE; |
| 604 | 604 | } |
| 605 | 605 | } else { |
| 606 | 606 | $mod_buttons['edit']['image'] = newbbDisplayImage('p_edit', _EDIT); |
| 607 | - $mod_buttons['edit']['link'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/edit.php?{$page_query}"; |
|
| 607 | + $mod_buttons['edit']['link'] = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/edit.php?{$page_query}"; |
|
| 608 | 608 | $mod_buttons['edit']['name'] = _EDIT; |
| 609 | 609 | |
| 610 | 610 | $mod_buttons['delete']['image'] = newbbDisplayImage('p_delete', _DELETE); |
| 611 | - $mod_buttons['delete']['link'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/delete.php?{$page_query}"; |
|
| 611 | + $mod_buttons['delete']['link'] = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/delete.php?{$page_query}"; |
|
| 612 | 612 | $mod_buttons['delete']['name'] = _DELETE; |
| 613 | 613 | |
| 614 | 614 | $thread_buttons['reply']['image'] = newbbDisplayImage('p_reply', _MD_NEWBB_REPLY); |
| 615 | - $thread_buttons['reply']['link'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/reply.php?{$page_query}"; |
|
| 615 | + $thread_buttons['reply']['link'] = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/reply.php?{$page_query}"; |
|
| 616 | 616 | $thread_buttons['reply']['name'] = _MD_NEWBB_REPLY; |
| 617 | 617 | } |
| 618 | 618 | |
| 619 | 619 | if (!$isAdmin && $GLOBALS['xoopsModuleConfig']['reportmod_enabled']) { |
| 620 | 620 | $thread_buttons['report']['image'] = newbbDisplayImage('p_report', _MD_NEWBB_REPORT); |
| 621 | - $thread_buttons['report']['link'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/report.php?{$page_query}"; |
|
| 621 | + $thread_buttons['report']['link'] = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/report.php?{$page_query}"; |
|
| 622 | 622 | $thread_buttons['report']['name'] = _MD_NEWBB_REPORT; |
| 623 | 623 | } |
| 624 | 624 | |
| 625 | 625 | $thread_action = []; |
| 626 | 626 | // irmtfan add pdf permission |
| 627 | - if (file_exists(XOOPS_ROOT_PATH . '/class/libraries/vendor/tecnickcom/tcpdf/tcpdf.php') |
|
| 627 | + if (file_exists(XOOPS_ROOT_PATH.'/class/libraries/vendor/tecnickcom/tcpdf/tcpdf.php') |
|
| 628 | 628 | && $topicHandler->getPermission($forum_id, $topic_status, 'pdf')) { |
| 629 | 629 | $thread_action['pdf']['image'] = newbbDisplayImage('pdf', _MD_NEWBB_PDF); |
| 630 | - $thread_action['pdf']['link'] = XOOPS_URL . '/modules/newbb/makepdf.php?type=post&pageid=0'; |
|
| 630 | + $thread_action['pdf']['link'] = XOOPS_URL.'/modules/newbb/makepdf.php?type=post&pageid=0'; |
|
| 631 | 631 | $thread_action['pdf']['name'] = _MD_NEWBB_PDF; |
| 632 | 632 | $thread_action['pdf']['target'] = '_blank'; |
| 633 | 633 | } |
| 634 | 634 | // irmtfan add print permission |
| 635 | 635 | if ($topicHandler->getPermission($forum_id, $topic_status, 'print')) { |
| 636 | 636 | $thread_action['print']['image'] = newbbDisplayImage('printer', _MD_NEWBB_PRINT); |
| 637 | - $thread_action['print']['link'] = XOOPS_URL . '/modules/newbb/print.php?form=2&forum=' . $forum_id . '&topic_id=' . $topic_id; |
|
| 637 | + $thread_action['print']['link'] = XOOPS_URL.'/modules/newbb/print.php?form=2&forum='.$forum_id.'&topic_id='.$topic_id; |
|
| 638 | 638 | $thread_action['print']['name'] = _MD_NEWBB_PRINT; |
| 639 | 639 | $thread_action['print']['target'] = '_blank'; |
| 640 | 640 | } |
@@ -642,45 +642,45 @@ discard block |
||
| 642 | 642 | if ($GLOBALS['xoopsModuleConfig']['show_sociallinks']) { |
| 643 | 643 | $full_title = $this->getVar('subject'); |
| 644 | 644 | $clean_title = preg_replace('/[^A-Za-z0-9-]+/', '+', $this->getVar('subject')); |
| 645 | - $full_link = XOOPS_URL . '/modules/newbb/viewtopic.php?post_id=' . $post_id; |
|
| 645 | + $full_link = XOOPS_URL.'/modules/newbb/viewtopic.php?post_id='.$post_id; |
|
| 646 | 646 | |
| 647 | 647 | $thread_action['social_twitter']['image'] = newbbDisplayImage('twitter', _MD_NEWBB_SHARE_TWITTER); |
| 648 | - $thread_action['social_twitter']['link'] = 'http://twitter.com/share?text=' . $clean_title . '&url=' . $full_link; |
|
| 648 | + $thread_action['social_twitter']['link'] = 'http://twitter.com/share?text='.$clean_title.'&url='.$full_link; |
|
| 649 | 649 | $thread_action['social_twitter']['name'] = _MD_NEWBB_SHARE_TWITTER; |
| 650 | 650 | $thread_action['social_twitter']['target'] = '_blank'; |
| 651 | 651 | |
| 652 | 652 | $thread_action['social_facebook']['image'] = newbbDisplayImage('facebook', _MD_NEWBB_SHARE_FACEBOOK); |
| 653 | - $thread_action['social_facebook']['link'] = 'http://www.facebook.com/sharer.php?u=' . $full_link; |
|
| 653 | + $thread_action['social_facebook']['link'] = 'http://www.facebook.com/sharer.php?u='.$full_link; |
|
| 654 | 654 | $thread_action['social_facebook']['name'] = _MD_NEWBB_SHARE_FACEBOOK; |
| 655 | 655 | $thread_action['social_facebook']['target'] = '_blank'; |
| 656 | 656 | |
| 657 | 657 | $thread_action['social_gplus']['image'] = newbbDisplayImage('googleplus', _MD_NEWBB_SHARE_GOOGLEPLUS); |
| 658 | - $thread_action['social_gplus']['link'] = 'https://plusone.google.com/_/+1/confirm?hl=en&url=' . $full_link; |
|
| 658 | + $thread_action['social_gplus']['link'] = 'https://plusone.google.com/_/+1/confirm?hl=en&url='.$full_link; |
|
| 659 | 659 | $thread_action['social_gplus']['name'] = _MD_NEWBB_SHARE_GOOGLEPLUS; |
| 660 | 660 | $thread_action['social_gplus']['target'] = '_blank'; |
| 661 | 661 | |
| 662 | 662 | $thread_action['social_linkedin']['image'] = newbbDisplayImage('linkedin', _MD_NEWBB_SHARE_LINKEDIN); |
| 663 | - $thread_action['social_linkedin']['link'] = 'http://www.linkedin.com/shareArticle?mini=true&title=' . $full_title . '&url=' . $full_link; |
|
| 663 | + $thread_action['social_linkedin']['link'] = 'http://www.linkedin.com/shareArticle?mini=true&title='.$full_title.'&url='.$full_link; |
|
| 664 | 664 | $thread_action['social_linkedin']['name'] = _MD_NEWBB_SHARE_LINKEDIN; |
| 665 | 665 | $thread_action['social_linkedin']['target'] = '_blank'; |
| 666 | 666 | |
| 667 | 667 | $thread_action['social_delicious']['image'] = newbbDisplayImage('delicious', _MD_NEWBB_SHARE_DELICIOUS); |
| 668 | - $thread_action['social_delicious']['link'] = 'http://del.icio.us/post?title=' . $full_title . '&url=' . $full_link; |
|
| 668 | + $thread_action['social_delicious']['link'] = 'http://del.icio.us/post?title='.$full_title.'&url='.$full_link; |
|
| 669 | 669 | $thread_action['social_delicious']['name'] = _MD_NEWBB_SHARE_DELICIOUS; |
| 670 | 670 | $thread_action['social_delicious']['target'] = '_blank'; |
| 671 | 671 | |
| 672 | 672 | $thread_action['social_digg']['image'] = newbbDisplayImage('digg', _MD_NEWBB_SHARE_DIGG); |
| 673 | - $thread_action['social_digg']['link'] = 'http://digg.com/submit?phase=2&title=' . $full_title . '&url=' . $full_link; |
|
| 673 | + $thread_action['social_digg']['link'] = 'http://digg.com/submit?phase=2&title='.$full_title.'&url='.$full_link; |
|
| 674 | 674 | $thread_action['social_digg']['name'] = _MD_NEWBB_SHARE_DIGG; |
| 675 | 675 | $thread_action['social_digg']['target'] = '_blank'; |
| 676 | 676 | |
| 677 | 677 | $thread_action['social_reddit']['image'] = newbbDisplayImage('reddit', _MD_NEWBB_SHARE_REDDIT); |
| 678 | - $thread_action['social_reddit']['link'] = 'http://reddit.com/submit?title=' . $full_title . '&url=' . $full_link; |
|
| 678 | + $thread_action['social_reddit']['link'] = 'http://reddit.com/submit?title='.$full_title.'&url='.$full_link; |
|
| 679 | 679 | $thread_action['social_reddit']['name'] = _MD_NEWBB_SHARE_REDDIT; |
| 680 | 680 | $thread_action['social_reddit']['target'] = '_blank'; |
| 681 | 681 | |
| 682 | 682 | $thread_action['social_wong']['image'] = newbbDisplayImage('wong', _MD_NEWBB_SHARE_MRWONG); |
| 683 | - $thread_action['social_wong']['link'] = 'http://www.mister-wong.de/index.php?action=addurl&bm_url=' . $full_link; |
|
| 683 | + $thread_action['social_wong']['link'] = 'http://www.mister-wong.de/index.php?action=addurl&bm_url='.$full_link; |
|
| 684 | 684 | $thread_action['social_wong']['name'] = _MD_NEWBB_SHARE_MRWONG; |
| 685 | 685 | $thread_action['social_wong']['target'] = '_blank'; |
| 686 | 686 | } |
@@ -704,7 +704,7 @@ discard block |
||
| 704 | 704 | 'thread_buttons' => $thread_buttons, |
| 705 | 705 | 'mod_buttons' => $mod_buttons, |
| 706 | 706 | 'poster' => $poster, |
| 707 | - 'post_permalink' => '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewtopic.php?post_id=' . $post_id . '"></a>' |
|
| 707 | + 'post_permalink' => '<a href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/viewtopic.php?post_id='.$post_id.'"></a>' |
|
| 708 | 708 | ]; |
| 709 | 709 | |
| 710 | 710 | unset($thread_buttons, $mod_buttons, $eachposter); |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | // URL: https://xoops.org // |
| 30 | 30 | // Project: Article Project // |
| 31 | 31 | // ------------------------------------------------------------------------ // |
| 32 | -require_once __DIR__ . '/read.php'; |
|
| 32 | +require_once __DIR__.'/read.php'; |
|
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | 35 | * A handler for read/unread handling |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | use XoopsModules\Newbb; |
| 34 | 34 | |
| 35 | -require_once __DIR__ . '/read.php'; |
|
| 35 | +require_once __DIR__.'/read.php'; |
|
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | 38 | * A handler for read/unread handling |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | $sticky_id = $itemHandler->getIds($criteria_sticky); |
| 177 | 177 | $items = $items_id + $sticky_id; |
| 178 | 178 | $criteria = new \CriteriaCompo(new \Criteria('uid', $uid)); |
| 179 | - $criteria->add(new \Criteria('read_item', '(' . implode(', ', $items) . ')', 'IN')); |
|
| 179 | + $criteria->add(new \Criteria('read_item', '('.implode(', ', $items).')', 'IN')); |
|
| 180 | 180 | $this->deleteAll($criteria, true); |
| 181 | 181 | |
| 182 | 182 | return true; |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | |
| 185 | 185 | $itemsObject = $itemHandler->getAll($criteria_topic, ['topic_last_post_id']); |
| 186 | 186 | $stickyObject = $itemHandler->getAll($criteria_sticky, ['topic_last_post_id']); |
| 187 | - $itemsObject += $stickyObject; |
|
| 187 | + $itemsObject += $stickyObject; |
|
| 188 | 188 | $items = []; |
| 189 | 189 | foreach (array_keys($itemsObject) as $key) { |
| 190 | 190 | $items[$key] = $itemsObject[$key]->getVar('topic_last_post_id'); |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | // URL: https://xoops.org // |
| 30 | 30 | // Project: Article Project // |
| 31 | 31 | // ------------------------------------------------------------------------ // |
| 32 | -require_once __DIR__ . '/read.php'; |
|
| 32 | +require_once __DIR__.'/read.php'; |
|
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | 35 | * A handler for read/unread handling |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | if (empty($this->users) || !$this->enableOnline) { |
| 59 | 59 | return; |
| 60 | 60 | } |
| 61 | - require_once __DIR__ . '/../include/functions.render.php'; |
|
| 61 | + require_once __DIR__.'/../include/functions.render.php'; |
|
| 62 | 62 | $image_online = newbbDisplayImage('online', _MD_NEWBB_ONLINE); |
| 63 | 63 | $image_offline = newbbDisplayImage('offline', _MD_NEWBB_OFFLINE); |
| 64 | 64 | |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | return; |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | - $sql = 'SELECT user_digests, uid FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_user_stats') . ' WHERE uid IN( ' . implode(', ', array_keys($this->users)) . ')'; |
|
| 86 | + $sql = 'SELECT user_digests, uid FROM '.$GLOBALS['xoopsDB']->prefix('newbb_user_stats').' WHERE uid IN( '.implode(', ', array_keys($this->users)).')'; |
|
| 87 | 87 | $result = $GLOBALS['xoopsDB']->query($sql); |
| 88 | 88 | while (false !== ($myrow = $GLOBALS['xoopsDB']->fetchArray($result))) { |
| 89 | 89 | $this->userlist[$myrow['uid']]['digests'] = (int)$myrow['user_digests']; |
@@ -95,23 +95,23 @@ discard block |
||
| 95 | 95 | public function getPath($type, $dirname = 'newbb', $default = '', $endDir = 'images') |
| 96 | 96 | { |
| 97 | 97 | static $paths; |
| 98 | - if (isset($paths[$endDir . '/' . $type])) { |
|
| 99 | - return $paths[$endDir . '/' . $type]; |
|
| 98 | + if (isset($paths[$endDir.'/'.$type])) { |
|
| 99 | + return $paths[$endDir.'/'.$type]; |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | $theme_path = $this->template->currentTheme->path; |
| 103 | 103 | $rel_dir = "modules/{$dirname}/{$endDir}"; |
| 104 | 104 | // START irmtfan add default for all pathes |
| 105 | 105 | if (empty($default)) { |
| 106 | - $path = is_dir($theme_path . "/{$rel_dir}/{$type}/") ? $theme_path . "/{$rel_dir}/{$type}" |
|
| 107 | - : (is_dir(XOOPS_THEME_PATH . "/default/{$rel_dir}/{$type}/") ? XOOPS_THEME_PATH . "/default/{$rel_dir}/{$type}" |
|
| 106 | + $path = is_dir($theme_path."/{$rel_dir}/{$type}/") ? $theme_path."/{$rel_dir}/{$type}" |
|
| 107 | + : (is_dir(XOOPS_THEME_PATH."/default/{$rel_dir}/{$type}/") ? XOOPS_THEME_PATH . "/default/{$rel_dir}/{$type}" |
|
| 108 | 108 | : $GLOBALS['xoops']->path("modules/{$dirname}/templates/{$endDir}/{$type}")); |
| 109 | 109 | } else { |
| 110 | - $path = is_dir($theme_path . "/{$rel_dir}/{$type}/") ? $theme_path . "/{$rel_dir}/{$type}" : ( |
|
| 111 | - is_dir($theme_path . "/{$rel_dir}/{$default}/") ? $theme_path . "/{$rel_dir}/{$default}" : ( |
|
| 112 | - is_dir(XOOPS_THEME_PATH . "/default/{$rel_dir}/{$type}/") ? XOOPS_THEME_PATH |
|
| 110 | + $path = is_dir($theme_path."/{$rel_dir}/{$type}/") ? $theme_path."/{$rel_dir}/{$type}" : ( |
|
| 111 | + is_dir($theme_path."/{$rel_dir}/{$default}/") ? $theme_path."/{$rel_dir}/{$default}" : ( |
|
| 112 | + is_dir(XOOPS_THEME_PATH."/default/{$rel_dir}/{$type}/") ? XOOPS_THEME_PATH |
|
| 113 | 113 | . "/default/{$rel_dir}/{$type}" : ( |
| 114 | - is_dir(XOOPS_THEME_PATH . "/default/{$rel_dir}/{$default}/") ? XOOPS_THEME_PATH . "/default/{$rel_dir}/{$default}" |
|
| 114 | + is_dir(XOOPS_THEME_PATH."/default/{$rel_dir}/{$default}/") ? XOOPS_THEME_PATH . "/default/{$rel_dir}/{$default}" |
|
| 115 | 115 | : (is_dir($GLOBALS['xoops']->path("modules/{$dirname}/templates/{$endDir}/{$type}/")) ? $GLOBALS['xoops']->path("modules/{$dirname}/templates/{$endDir}/{$type}") |
| 116 | 116 | : $GLOBALS['xoops']->path("modules/{$dirname}/templates/{$endDir}/{$default}")) // XOOPS_ROOT_PATH |
| 117 | 117 | ) // XOOPS_THEME_PATH {$default} |
@@ -119,9 +119,9 @@ discard block |
||
| 119 | 119 | ); // $theme_path {$default} |
| 120 | 120 | } |
| 121 | 121 | // END irmtfan add default for all pathes |
| 122 | - $paths[$endDir . '/' . $type] = str_replace(XOOPS_ROOT_PATH, '', str_replace('\\', '/', $path)); |
|
| 122 | + $paths[$endDir.'/'.$type] = str_replace(XOOPS_ROOT_PATH, '', str_replace('\\', '/', $path)); |
|
| 123 | 123 | |
| 124 | - return $paths[$endDir . '/' . $type]; |
|
| 124 | + return $paths[$endDir.'/'.$type]; |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | // END irmtfan - improve to get other "end dirnames" like "css" and "js" - change images with $endDir |
@@ -136,8 +136,8 @@ discard block |
||
| 136 | 136 | ) { |
| 137 | 137 | $this->forumImage = include $GLOBALS['xoops']->path("modules/{$dirname}/include/images.php"); |
| 138 | 138 | |
| 139 | - $this->forumImage['icon'] = XOOPS_URL . $this->getPath('icon', $dirname) . '/'; |
|
| 140 | - $this->forumImage['language'] = XOOPS_URL . $this->getPath("language/{$language}", $dirname, 'language/english') . '/'; |
|
| 139 | + $this->forumImage['icon'] = XOOPS_URL.$this->getPath('icon', $dirname).'/'; |
|
| 140 | + $this->forumImage['language'] = XOOPS_URL.$this->getPath("language/{$language}", $dirname, 'language/english').'/'; |
|
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | /** |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | */ |
| 162 | 162 | public function getImageSource($image) |
| 163 | 163 | { |
| 164 | - return $this->forumImage[$this->forumImage[$image]] . $this->prefix . $image . $this->postfix; |
|
| 164 | + return $this->forumImage[$this->forumImage[$image]].$this->prefix.$image.$this->postfix; |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | /** |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | { |
| 38 | 38 | // $this->PermissionHandler($db); |
| 39 | 39 | parent::__construct($db); |
| 40 | - $this->templateFilename = XOOPS_VAR_PATH . '/configs/newbb_permission_template.php'; |
|
| 40 | + $this->templateFilename = XOOPS_VAR_PATH.'/configs/newbb_permission_template.php'; |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | /** |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | $items = array_filter(array_map('trim', explode(',', FORUM_PERM_ITEMS))); |
| 54 | 54 | if (!empty($fullname)) { |
| 55 | 55 | foreach (array_keys($items) as $key) { |
| 56 | - $items[$key] = 'forum_' . $items[$key]; |
|
| 56 | + $items[$key] = 'forum_'.$items[$key]; |
|
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | 59 | $validPerms[(int)$fullname] = $items; |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | return $full_items; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - require_once __DIR__ . '/../include/functions.user.php'; |
|
| 77 | + require_once __DIR__.'/../include/functions.user.php'; |
|
| 78 | 78 | $uid = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('uid') : 0; |
| 79 | 79 | $ip = \Xmf\IPAddress::fromRequest()->asReadable(); |
| 80 | 80 | if (!empty($GLOBALS['xoopsModuleConfig']['enable_usermoderate']) && !isset($suspension[$uid][$id]) |
@@ -133,10 +133,10 @@ discard block |
||
| 133 | 133 | } |
| 134 | 134 | // Create criteria for getting only the permissions regarding this module and this user's groups |
| 135 | 135 | $criteria = new \CriteriaCompo(new \Criteria('gperm_modid', $modid)); |
| 136 | - $criteria->add(new \Criteria('gperm_groupid', '(' . implode(',', $groups) . ')', 'IN')); |
|
| 136 | + $criteria->add(new \Criteria('gperm_groupid', '('.implode(',', $groups).')', 'IN')); |
|
| 137 | 137 | if ($id) { |
| 138 | 138 | if (is_array($id)) { |
| 139 | - $criteria->add(new \Criteria('gperm_itemid', '(' . implode(',', $id) . ')', 'IN')); |
|
| 139 | + $criteria->add(new \Criteria('gperm_itemid', '('.implode(',', $id).')', 'IN')); |
|
| 140 | 140 | } else { |
| 141 | 141 | $criteria->add(new \Criteria('gperm_itemid', (int)$id)); |
| 142 | 142 | } |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | $gperm_names = implode(', ', $this->getValidItems($modid, $id)); |
| 145 | 145 | |
| 146 | 146 | // Add criteria for gpermnames |
| 147 | - $criteria->add(new \Criteria('gperm_name', '(' . $gperm_names . ')', 'IN')); |
|
| 147 | + $criteria->add(new \Criteria('gperm_name', '('.$gperm_names.')', 'IN')); |
|
| 148 | 148 | // Get all permission objects in this module and for this user's groups |
| 149 | 149 | $userpermissions = $this->getObjects($criteria, true); |
| 150 | 150 | |
@@ -182,12 +182,12 @@ discard block |
||
| 182 | 182 | continue; |
| 183 | 183 | } |
| 184 | 184 | if ($isAdmin |
| 185 | - || (isset($permission_set[$forumId]['forum_' . $item]) |
|
| 185 | + || (isset($permission_set[$forumId]['forum_'.$item]) |
|
| 186 | 186 | && (!$topic_locked |
| 187 | 187 | || 'view' === $item))) { |
| 188 | - $perm[] = constant('_MD_NEWBB_CAN_' . strtoupper($item)); |
|
| 188 | + $perm[] = constant('_MD_NEWBB_CAN_'.strtoupper($item)); |
|
| 189 | 189 | } else { |
| 190 | - $perm[] = constant('_MD_NEWBB_CANNOT_' . strtoupper($item)); |
|
| 190 | + $perm[] = constant('_MD_NEWBB_CANNOT_'.strtoupper($item)); |
|
| 191 | 191 | } |
| 192 | 192 | } |
| 193 | 193 | |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | $gpermHandler = xoops_getHandler('groupperm'); |
| 208 | 208 | $criteria = new \CriteriaCompo(new \Criteria('gperm_modid', $GLOBALS['xoopsModule']->getVar('mid'))); |
| 209 | 209 | $items = $this->getValidPerms(true); |
| 210 | - $criteria->add(new \Criteria('gperm_name', "('" . implode("', '", $items) . "')", 'IN')); |
|
| 210 | + $criteria->add(new \Criteria('gperm_name', "('".implode("', '", $items)."')", 'IN')); |
|
| 211 | 211 | $criteria->add(new \Criteria('gperm_itemid', $forum_id)); |
| 212 | 212 | |
| 213 | 213 | return $gpermHandler->deleteAll($criteria); |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | protected function __construct($debug = false) |
| 36 | 36 | { |
| 37 | - $this->debug = $debug; |
|
| 37 | + $this->debug = $debug; |
|
| 38 | 38 | parent::__construct(basename(dirname(__DIR__))); |
| 39 | 39 | } |
| 40 | 40 | |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | $this->initConfig(); |
| 66 | 66 | } |
| 67 | 67 | $this->configs[$name] = $value; |
| 68 | - $this->addLog("Setting config '{$name}' : " . $this->configs[$name]); |
|
| 68 | + $this->addLog("Setting config '{$name}' : ".$this->configs[$name]); |
|
| 69 | 69 | |
| 70 | 70 | return $this->configs[$name]; |
| 71 | 71 | } |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | { |
| 90 | 90 | $ret = false; |
| 91 | 91 | $db = \XoopsDatabaseFactory::getDatabaseConnection(); |
| 92 | - $class = '\\XoopsModules\\' . ucfirst(strtolower(basename(dirname(__DIR__)))) . '\\' . $name . 'Handler'; |
|
| 92 | + $class = '\\XoopsModules\\'.ucfirst(strtolower(basename(dirname(__DIR__)))).'\\'.$name.'Handler'; |
|
| 93 | 93 | $ret = new $class($db); |
| 94 | 94 | return $ret; |
| 95 | 95 | } |
@@ -88,9 +88,9 @@ discard block |
||
| 88 | 88 | { |
| 89 | 89 | $topic_id = $object->getVar('topic_id'); |
| 90 | 90 | if ($force) { |
| 91 | - $sql = 'UPDATE ' . $this->db->prefix('newbb_topics') . " SET approved = -1 WHERE topic_id = {$topic_id}"; |
|
| 91 | + $sql = 'UPDATE '.$this->db->prefix('newbb_topics')." SET approved = -1 WHERE topic_id = {$topic_id}"; |
|
| 92 | 92 | } else { |
| 93 | - $sql = 'UPDATE ' . $this->db->prefix('newbb_topics') . " SET approved = 1 WHERE topic_id = {$topic_id}"; |
|
| 93 | + $sql = 'UPDATE '.$this->db->prefix('newbb_topics')." SET approved = 1 WHERE topic_id = {$topic_id}"; |
|
| 94 | 94 | } |
| 95 | 95 | if (!$result = $this->db->queryF($sql)) { |
| 96 | 96 | //xoops_error($this->db->error()); |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | { |
| 131 | 131 | $topic = null; |
| 132 | 132 | if (!empty($action)) { |
| 133 | - $sql = 'SELECT * FROM ' . $this->table . ' WHERE 1=1' . (($forum_id > 0) ? ' AND forum_id=' . (int)$forum_id : '') . ' AND topic_id ' . (($action > 0) ? '>' : '<') . (int)$topic_id . ' ORDER BY topic_id ' . (($action > 0) ? 'ASC' : 'DESC') . ' LIMIT 1'; |
|
| 133 | + $sql = 'SELECT * FROM '.$this->table.' WHERE 1=1'.(($forum_id > 0) ? ' AND forum_id='.(int)$forum_id : '').' AND topic_id '.(($action > 0) ? '>' : '<').(int)$topic_id.' ORDER BY topic_id '.(($action > 0) ? 'ASC' : 'DESC').' LIMIT 1'; |
|
| 134 | 134 | if ($result = $this->db->query($sql)) { |
| 135 | 135 | if ($row = $this->db->fetchArray($result)) { |
| 136 | 136 | $topic = $this->create(false); |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | public function &getByPost($post_id) |
| 153 | 153 | { |
| 154 | 154 | $topic = null; |
| 155 | - $sql = 'SELECT t.* FROM ' . $this->db->prefix('newbb_topics') . ' t, ' . $this->db->prefix('newbb_posts') . ' p |
|
| 155 | + $sql = 'SELECT t.* FROM '.$this->db->prefix('newbb_topics').' t, '.$this->db->prefix('newbb_posts').' p |
|
| 156 | 156 | WHERE t.topic_id = p.topic_id AND p.post_id = ' . (int)$post_id; |
| 157 | 157 | $result = $this->db->query($sql); |
| 158 | 158 | if (!$result) { |
@@ -200,10 +200,10 @@ discard block |
||
| 200 | 200 | public function &getTopPost($topic_id) |
| 201 | 201 | { |
| 202 | 202 | $post = null; |
| 203 | - $sql = 'SELECT p.*, t.* FROM ' . $this->db->prefix('newbb_posts') . ' p, |
|
| 204 | - ' . $this->db->prefix('newbb_posts_text') . ' t |
|
| 203 | + $sql = 'SELECT p.*, t.* FROM '.$this->db->prefix('newbb_posts').' p, |
|
| 204 | + ' . $this->db->prefix('newbb_posts_text').' t |
|
| 205 | 205 | WHERE |
| 206 | - p.topic_id = ' . $topic_id . ' AND p.pid = 0 |
|
| 206 | + p.topic_id = ' . $topic_id.' AND p.pid = 0 |
|
| 207 | 207 | AND t.post_id = p.post_id'; |
| 208 | 208 | |
| 209 | 209 | $result = $this->db->query($sql); |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | */ |
| 228 | 228 | public function getTopPostId($topic_id) |
| 229 | 229 | { |
| 230 | - $sql = 'SELECT MIN(post_id) AS post_id FROM ' . $this->db->prefix('newbb_posts') . ' WHERE topic_id = ' . $topic_id . ' AND pid = 0'; |
|
| 230 | + $sql = 'SELECT MIN(post_id) AS post_id FROM '.$this->db->prefix('newbb_posts').' WHERE topic_id = '.$topic_id.' AND pid = 0'; |
|
| 231 | 231 | $result = $this->db->query($sql); |
| 232 | 232 | if (!$result) { |
| 233 | 233 | //xoops_error($this->db->error()); |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | $operator_for_position = '<'; |
| 273 | 273 | } |
| 274 | 274 | //$approveCriteria = ' AND approved = 1'; // any others? |
| 275 | - $sql = 'SELECT COUNT(*) FROM ' . $this->db->prefix('newbb_posts') . ' AS p WHERE p.topic_id=' . (int)$topic->getVar('topic_id') . $approveCriteria . " AND p.post_id $operator_for_position $post_id"; |
|
| 275 | + $sql = 'SELECT COUNT(*) FROM '.$this->db->prefix('newbb_posts').' AS p WHERE p.topic_id='.(int)$topic->getVar('topic_id').$approveCriteria." AND p.post_id $operator_for_position $post_id"; |
|
| 276 | 276 | $result = $this->db->query($sql); |
| 277 | 277 | if (!$result) { |
| 278 | 278 | //xoops_error($this->db->error()); |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | $start = (int)($position / $perpage) * $perpage; |
| 283 | 283 | } |
| 284 | 284 | |
| 285 | - $sql = 'SELECT p.*, t.* FROM ' . $this->db->prefix('newbb_posts') . ' p, ' . $this->db->prefix('newbb_posts_text') . ' t WHERE p.topic_id=' . $topic->getVar('topic_id') . ' AND p.post_id = t.post_id' . $approveCriteria . " ORDER BY p.post_id $order"; |
|
| 285 | + $sql = 'SELECT p.*, t.* FROM '.$this->db->prefix('newbb_posts').' p, '.$this->db->prefix('newbb_posts_text').' t WHERE p.topic_id='.$topic->getVar('topic_id').' AND p.post_id = t.post_id'.$approveCriteria." ORDER BY p.post_id $order"; |
|
| 286 | 286 | $result = $this->db->query($sql, $perpage, $start); |
| 287 | 287 | if (!$result) { |
| 288 | 288 | //xoops_error($this->db->error()); |
@@ -327,18 +327,18 @@ discard block |
||
| 327 | 327 | $postArray['post_time'] = newbbFormatTimestamp($postArray['post_time']); |
| 328 | 328 | |
| 329 | 329 | if (!empty($postArray['icon'])) { |
| 330 | - $postArray['icon'] = '<img src="' . XOOPS_URL . '/images/subject/' . htmlspecialchars($postArray['icon']) . '" alt="" />'; |
|
| 330 | + $postArray['icon'] = '<img src="'.XOOPS_URL.'/images/subject/'.htmlspecialchars($postArray['icon']).'" alt="" />'; |
|
| 331 | 331 | } else { |
| 332 | - $postArray['icon'] = '<a name="' . $postArray['post_id'] . '"><img src="' . XOOPS_URL . '/images/icons/no_posticon.gif" alt="" /></a>'; |
|
| 332 | + $postArray['icon'] = '<a name="'.$postArray['post_id'].'"><img src="'.XOOPS_URL.'/images/icons/no_posticon.gif" alt="" /></a>'; |
|
| 333 | 333 | } |
| 334 | 334 | |
| 335 | - $postArray['subject'] = '<a href="viewtopic.php?viewmode=thread&topic_id=' . $topic->getVar('topic_id') . '&forum=' . $postArray['forum_id'] . '&post_id=' . $postArray['post_id'] . '">' . $postArray['subject'] . '</a>'; |
|
| 335 | + $postArray['subject'] = '<a href="viewtopic.php?viewmode=thread&topic_id='.$topic->getVar('topic_id').'&forum='.$postArray['forum_id'].'&post_id='.$postArray['post_id'].'">'.$postArray['subject'].'</a>'; |
|
| 336 | 336 | |
| 337 | 337 | $isActiveUser = false; |
| 338 | 338 | if (isset($viewtopic_users[$postArray['uid']]['name'])) { |
| 339 | 339 | $postArray['poster'] = $viewtopic_users[$postArray['uid']]['name']; |
| 340 | 340 | if ($postArray['uid'] > 0) { |
| 341 | - $postArray['poster'] = '<a href="' . XOOPS_URL . '/userinfo.php?uid=' . $postArray['uid'] . '">' . $viewtopic_users[$postArray['uid']]['name'] . '</a>'; |
|
| 341 | + $postArray['poster'] = '<a href="'.XOOPS_URL.'/userinfo.php?uid='.$postArray['uid'].'">'.$viewtopic_users[$postArray['uid']]['name'].'</a>'; |
|
| 342 | 342 | } |
| 343 | 343 | } else { |
| 344 | 344 | $postArray['poster'] = empty($postArray['poster_name']) ? $myts->htmlSpecialChars($GLOBALS['xoopsConfig']['anonymous']) : $postArray['poster_name']; |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | */ |
| 355 | 355 | public function &getAllPosters(&$topic, $isApproved = true) |
| 356 | 356 | { |
| 357 | - $sql = 'SELECT DISTINCT uid FROM ' . $this->db->prefix('newbb_posts') . ' WHERE topic_id=' . $topic->getVar('topic_id') . ' AND uid>0'; |
|
| 357 | + $sql = 'SELECT DISTINCT uid FROM '.$this->db->prefix('newbb_posts').' WHERE topic_id='.$topic->getVar('topic_id').' AND uid>0'; |
|
| 358 | 358 | if ($isApproved) { |
| 359 | 359 | $sql .= ' AND approved = 1'; |
| 360 | 360 | } |
@@ -408,7 +408,7 @@ discard block |
||
| 408 | 408 | public function getPermission($forum, $topic_locked = 0, $type = 'view') |
| 409 | 409 | { |
| 410 | 410 | static $_cachedTopicPerms; |
| 411 | - require_once __DIR__ . '/../include/functions.user.php'; |
|
| 411 | + require_once __DIR__.'/../include/functions.user.php'; |
|
| 412 | 412 | if (newbbIsAdmin($forum)) { |
| 413 | 413 | return true; |
| 414 | 414 | } |
@@ -505,7 +505,7 @@ discard block |
||
| 505 | 505 | } |
| 506 | 506 | $b1 = $this->insert($object, $force); |
| 507 | 507 | $criteria->add(new \Criteria('post_id', $top_post, '<>'), 'AND'); |
| 508 | - $criteria->add(new \Criteria('pid', '(' . implode(', ', $post_ids) . ')', 'NOT IN'), 'AND'); |
|
| 508 | + $criteria->add(new \Criteria('pid', '('.implode(', ', $post_ids).')', 'NOT IN'), 'AND'); |
|
| 509 | 509 | $b2 = $postHandler->updateAll('pid', $top_post, $criteria, $force); |
| 510 | 510 | $criteria = new \CriteriaCompo(); |
| 511 | 511 | $criteria->add(new \Criteria('post_id', $top_post, '='), 'AND'); |
@@ -526,7 +526,7 @@ discard block |
||
| 526 | 526 | $allDirs = xoops_getActiveModules(); |
| 527 | 527 | foreach ($allDirs as $dirname) { |
| 528 | 528 | // pollresults.php file is exist in all xoopspoll versions and umfrage versions |
| 529 | - if (file_exists($GLOBALS['xoops']->path('modules/' . $dirname . '/pollresults.php'))) { |
|
| 529 | + if (file_exists($GLOBALS['xoops']->path('modules/'.$dirname.'/pollresults.php'))) { |
|
| 530 | 530 | $pollDirs[$dirname] = $dirname; |
| 531 | 531 | } |
| 532 | 532 | } |