@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | // defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
| 15 | 15 | |
| 16 | -defined('NEWBB_FUNCTIONS_INI') || require_once __DIR__ . '/functions.ini.php'; |
|
| 16 | +defined('NEWBB_FUNCTIONS_INI') || require_once __DIR__.'/functions.ini.php'; |
|
| 17 | 17 | define('NEWBB_FUNCTIONS_WELCOME_LOADED', true); |
| 18 | 18 | |
| 19 | 19 | if (!defined('NEWBB_FUNCTIONS_WELCOME')) { |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | return false; |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - include __DIR__ . '/functions.welcome.inc.php'; |
|
| 43 | + include __DIR__.'/functions.welcome.inc.php'; |
|
| 44 | 44 | unset($forumObject); |
| 45 | 45 | |
| 46 | 46 | return $ret; |
@@ -31,12 +31,12 @@ 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 | require_once $GLOBALS['xoops']->path('class/template.php'); |
| 36 | 36 | require_once $GLOBALS['xoops']->path('modules/newbb/include/functions.rpc.php'); |
| 37 | 37 | |
| 38 | 38 | if (!empty($GLOBALS['xoopsModuleConfig']['do_rewrite'])) { |
| 39 | - require_once __DIR__ . '/seo_url.php'; |
|
| 39 | + require_once __DIR__.'/seo_url.php'; |
|
| 40 | 40 | } |
| 41 | 41 | /* for seo */ |
| 42 | 42 | |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | $validForums = array_intersect($forums, $validForums); |
| 60 | 60 | } elseif ($category > 0) { |
| 61 | 61 | $crit_top = new \CriteriaCompo(new \Criteria('cat_id', $category)); |
| 62 | - $crit_top->add(new \Criteria('forum_id', '(' . implode(', ', $validForums) . ')', 'IN')); |
|
| 62 | + $crit_top->add(new \Criteria('forum_id', '('.implode(', ', $validForums).')', 'IN')); |
|
| 63 | 63 | $forums_top = $forumHandler->getIds($crit_top); |
| 64 | 64 | $validForums = array_intersect($forums_top, $validForums); |
| 65 | 65 | } |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | $forumSet = implode(',', $validForums); |
| 72 | 72 | |
| 73 | 73 | $charset = 'UTF-8'; |
| 74 | -header('Content-Type:text/xml; charset=' . $charset); |
|
| 74 | +header('Content-Type:text/xml; charset='.$charset); |
|
| 75 | 75 | |
| 76 | 76 | $tpl = new \XoopsTpl(); |
| 77 | 77 | $tpl->caching = 2; |
@@ -84,25 +84,25 @@ discard block |
||
| 84 | 84 | $xoopsCachedTemplateId = "newbbb_rss_$forumSet"; |
| 85 | 85 | $compile_id = null; |
| 86 | 86 | if (!$tpl->is_cached('db:newbb_rss.tpl', $xoopsCachedTemplateId, $compile_id)) { |
| 87 | - require_once __DIR__ . '/include/functions.time.php'; |
|
| 87 | + require_once __DIR__.'/include/functions.time.php'; |
|
| 88 | 88 | |
| 89 | 89 | // /** @var Newbb\XmlrssHandler $xmlrssHandler */ |
| 90 | 90 | // $xmlrssHandler = Newbb\Helper::getInstance()->getHandler('Xmlrss'); |
| 91 | 91 | $rss = $xmlrssHandler->create(); |
| 92 | 92 | |
| 93 | - $rss->setVarRss('channel_title', $GLOBALS['xoopsConfig']['sitename'] . ' :: ' . _MD_NEWBB_FORUM); |
|
| 94 | - $rss->channel_link = XOOPS_URL . '/'; |
|
| 95 | - $rss->setVarRss('channel_desc', $GLOBALS['xoopsConfig']['slogan'] . ' :: ' . $xoopsModule->getInfo('description')); |
|
| 93 | + $rss->setVarRss('channel_title', $GLOBALS['xoopsConfig']['sitename'].' :: '._MD_NEWBB_FORUM); |
|
| 94 | + $rss->channel_link = XOOPS_URL.'/'; |
|
| 95 | + $rss->setVarRss('channel_desc', $GLOBALS['xoopsConfig']['slogan'].' :: '.$xoopsModule->getInfo('description')); |
|
| 96 | 96 | $rss->setVarRss('channel_lastbuild', formatTimestamp(time(), 'rss')); |
| 97 | 97 | $rss->channel_webmaster = $GLOBALS['xoopsConfig']['adminmail']; |
| 98 | 98 | $rss->channel_editor = $GLOBALS['xoopsConfig']['adminmail']; |
| 99 | 99 | $rss->setVarRss('channel_category', $xoopsModule->getVar('name')); |
| 100 | - $rss->channel_generator = 'NewBB ' . $xoopsModule->getInfo('version'); |
|
| 100 | + $rss->channel_generator = 'NewBB '.$xoopsModule->getInfo('version'); |
|
| 101 | 101 | $rss->channel_language = _LANGCODE; |
| 102 | 102 | $rss->xml_encoding = $charset; |
| 103 | - $rss->image_url = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/' . $xoopsModule->getInfo('image'); |
|
| 103 | + $rss->image_url = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/'.$xoopsModule->getInfo('image'); |
|
| 104 | 104 | |
| 105 | - $dimension = @getimagesize($GLOBALS['xoops']->path('modules/' . $xoopsModule->getVar('dirname') . '/' . $xoopsModule->getInfo('image'))); |
|
| 105 | + $dimension = @getimagesize($GLOBALS['xoops']->path('modules/'.$xoopsModule->getVar('dirname').'/'.$xoopsModule->getInfo('image'))); |
|
| 106 | 106 | if (empty($dimension[0])) { |
| 107 | 107 | $width = 88; |
| 108 | 108 | } else { |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | $rss->max_items = $GLOBALS['xoopsModuleConfig']['rss_maxitems']; |
| 120 | 120 | $rss->max_item_description = $GLOBALS['xoopsModuleConfig']['rss_maxdescription']; |
| 121 | 121 | |
| 122 | - $forumCriteria = ' AND t.forum_id IN (' . implode(',', $validForums) . ')'; |
|
| 122 | + $forumCriteria = ' AND t.forum_id IN ('.implode(',', $validForums).')'; |
|
| 123 | 123 | unset($validForums); |
| 124 | 124 | $approveCriteria = ' AND t.approved = 1 AND p.approved = 1'; |
| 125 | 125 | |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | if (count($types) > 0) { |
| 170 | 170 | // /** @var Newbb\TypeHandler $typeHandler */ |
| 171 | 171 | // $typeHandler = Newbb\Helper::getInstance()->getHandler('Type'); |
| 172 | - $type_list = $typeHandler->getList(new \Criteria('type_id', '(' . implode(', ', array_keys($types)) . ')', 'IN')); |
|
| 172 | + $type_list = $typeHandler->getList(new \Criteria('type_id', '('.implode(', ', array_keys($types)).')', 'IN')); |
|
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | foreach ($rows as $topic) { |
@@ -184,16 +184,16 @@ discard block |
||
| 184 | 184 | } else { |
| 185 | 185 | $topic['uname'] = $topic['poster_name'] ? $myts->htmlSpecialChars($topic['poster_name']) : $myts->htmlSpecialChars($GLOBALS['xoopsConfig']['anonymous']); |
| 186 | 186 | } |
| 187 | - $description = $topic['forum_name'] . '::'; |
|
| 188 | - $topic['topic_subject'] = empty($type_list[$topic['type_id']]) ? '' : '[' . $type_list[$topic['type_id']] . '] '; |
|
| 189 | - $description .= $topic['topic_subject'] . $topic['topic_title'] . "<br>\n"; |
|
| 187 | + $description = $topic['forum_name'].'::'; |
|
| 188 | + $topic['topic_subject'] = empty($type_list[$topic['type_id']]) ? '' : '['.$type_list[$topic['type_id']].'] '; |
|
| 189 | + $description .= $topic['topic_subject'].$topic['topic_title']."<br>\n"; |
|
| 190 | 190 | $description .= $myts->displayTarea($topic['post_text'], $topic['dohtml'], $topic['dosmiley'], $topic['doxcode'], $topic['dobr']); |
| 191 | - $label = _MD_NEWBB_BY . ' ' . $topic['uname']; |
|
| 191 | + $label = _MD_NEWBB_BY.' '.$topic['uname']; |
|
| 192 | 192 | $time = formatTimestamp($topic['post_time'], 'rss'); |
| 193 | - $link = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewtopic.php?post_id=' . $topic['post_id'] . ''; |
|
| 193 | + $link = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/viewtopic.php?post_id='.$topic['post_id'].''; |
|
| 194 | 194 | if (!empty($GLOBALS['xoopsModuleConfig']['do_rewrite'])) { |
| 195 | - $link = XOOPS_URL . '/' . REAL_MODULE_NAME . '/viewtopic.php?post_id=' . $topic['post_id'] . ''; |
|
| 196 | - $oldurl = '<a href=\'' . $link . '\'>'; |
|
| 195 | + $link = XOOPS_URL.'/'.REAL_MODULE_NAME.'/viewtopic.php?post_id='.$topic['post_id'].''; |
|
| 196 | + $oldurl = '<a href=\''.$link.'\'>'; |
|
| 197 | 197 | $newurl = seo_urls($oldurl); |
| 198 | 198 | $newurl = str_replace('<a href=\'', '', $newurl); |
| 199 | 199 | $newurl = str_replace('\'>', '', $newurl); |
@@ -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 | $GPC = '_GET'; |
| 37 | 37 | if (Request::getString('submit', '', 'POST')) { |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | $viewmode = (isset(${$GPC}['viewmode']) && 'flat' !== ${$GPC}['viewmode']) ? 'thread' : 'flat'; |
| 45 | 45 | |
| 46 | 46 | if (empty($post_id)) { |
| 47 | - redirect_header(XOOPS_URL . '/index.php', 2, _MD_NEWBB_ERRORPOST); |
|
| 47 | + redirect_header(XOOPS_URL.'/index.php', 2, _MD_NEWBB_ERRORPOST); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | if ($GLOBALS['xoopsModuleConfig']['wol_enabled']) { |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | $submit_button = new \XoopsFormButton('', 'submit', _SUBMIT, 'submit'); |
| 140 | 140 | $cancel_button = new \XoopsFormButton('', 'cancel', _MD_NEWBB_CANCELPOST, 'button'); |
| 141 | 141 | $extra = "viewtopic.php?forum=$forum&topic_id=$topic_id&post_id=$post_id&order=$order&viewmode=$viewmode"; |
| 142 | -$cancel_button->setExtra("onclick='location=\"" . $extra . "\"'"); |
|
| 142 | +$cancel_button->setExtra("onclick='location=\"".$extra."\"'"); |
|
| 143 | 143 | $button_tray->addElement($submit_button); |
| 144 | 144 | $button_tray->addElement($cancel_button); |
| 145 | 145 | $report_form->addElement($button_tray); |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | |
| 148 | 148 | $r_subject = $postObject->getVar('subject', 'E'); |
| 149 | 149 | if ($GLOBALS['xoopsModuleConfig']['enable_karma'] && $postObject->getVar('post_karma') > 0) { |
| 150 | - $r_message = sprintf(_MD_NEWBB_KARMA_REQUIREMENT, '***', $postObject->getVar('post_karma')) . '</div>'; |
|
| 150 | + $r_message = sprintf(_MD_NEWBB_KARMA_REQUIREMENT, '***', $postObject->getVar('post_karma')).'</div>'; |
|
| 151 | 151 | } elseif ($GLOBALS['xoopsModuleConfig']['allow_require_reply'] && $postObject->getVar('require_reply')) { |
| 152 | 152 | $r_message = _MD_NEWBB_REPLY_REQUIREMENT; |
| 153 | 153 | } else { |
@@ -161,11 +161,11 @@ discard block |
||
| 161 | 161 | $poster_name = $postObject->getVar('poster_name'); |
| 162 | 162 | $r_name = empty($poster_name) ? $GLOBALS['xoopsConfig']['anonymous'] : $myts->htmlSpecialChars($poster_name); |
| 163 | 163 | } |
| 164 | -$r_content = _MD_NEWBB_SUBJECTC . ' ' . $r_subject . '<br>'; |
|
| 165 | -$r_content .= _MD_NEWBB_BY . ' ' . $r_name . ' ' . _MD_NEWBB_ON . ' ' . $r_date . '<br><br>'; |
|
| 164 | +$r_content = _MD_NEWBB_SUBJECTC.' '.$r_subject.'<br>'; |
|
| 165 | +$r_content .= _MD_NEWBB_BY.' '.$r_name.' '._MD_NEWBB_ON.' '.$r_date.'<br><br>'; |
|
| 166 | 166 | $r_content .= $r_message; |
| 167 | 167 | |
| 168 | -echo "<br><table cellpadding='4' cellspacing='1' width='98%' class='outer'><tr><td class='head'>" . $r_subject . '</td></tr>'; |
|
| 169 | -echo '<tr><td><br>' . $r_content . '<br></td></tr></table>'; |
|
| 168 | +echo "<br><table cellpadding='4' cellspacing='1' width='98%' class='outer'><tr><td class='head'>".$r_subject.'</td></tr>'; |
|
| 169 | +echo '<tr><td><br>'.$r_content.'<br></td></tr></table>'; |
|
| 170 | 170 | |
| 171 | 171 | include $GLOBALS['xoops']->path('footer.php'); |
@@ -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'); |
@@ -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); |
@@ -81,13 +81,13 @@ discard block |
||
| 81 | 81 | $level = []; |
| 82 | 82 | $level['level'] = $showlevel; |
| 83 | 83 | $level['exp'] = $ep; |
| 84 | - $level['exp_width'] = $ep . '%'; |
|
| 84 | + $level['exp_width'] = $ep.'%'; |
|
| 85 | 85 | $level['hp'] = $hp; |
| 86 | 86 | $level['hp_max'] = $maxhp; |
| 87 | - $level['hp_width'] = $hpf . '%'; |
|
| 87 | + $level['hp_width'] = $hpf.'%'; |
|
| 88 | 88 | $level['mp'] = $mp; |
| 89 | 89 | $level['mp_max'] = $maxmp; |
| 90 | - $level['mp_width'] = $mpf . '%'; |
|
| 90 | + $level['mp_width'] = $mpf.'%'; |
|
| 91 | 91 | |
| 92 | 92 | return $level; |
| 93 | 93 | } |
@@ -117,49 +117,49 @@ discard block |
||
| 117 | 117 | |
| 118 | 118 | $user = $this->user; |
| 119 | 119 | $userbar['profile'] = [ |
| 120 | - 'link' => XOOPS_URL . '/userinfo.php?uid=' . $user->getVar('uid'), |
|
| 120 | + 'link' => XOOPS_URL.'/userinfo.php?uid='.$user->getVar('uid'), |
|
| 121 | 121 | 'name' => _PROFILE |
| 122 | 122 | ]; |
| 123 | 123 | |
| 124 | 124 | if (is_object($GLOBALS['xoopsUser'])) { |
| 125 | 125 | $userbar['pm'] = [ |
| 126 | - 'link' => "javascript:void openWithSelfMain('" . XOOPS_URL . '/pmlite.php?send2=1&to_userid=' . $user->getVar('uid') . "', 'pmlite', 450, 380);", |
|
| 126 | + 'link' => "javascript:void openWithSelfMain('".XOOPS_URL.'/pmlite.php?send2=1&to_userid='.$user->getVar('uid')."', 'pmlite', 450, 380);", |
|
| 127 | 127 | 'name' => _MD_NEWBB_PM |
| 128 | 128 | ]; |
| 129 | 129 | } |
| 130 | 130 | if ($user->getVar('user_viewemail') || $isAdmin) { |
| 131 | 131 | $userbar['email'] = [ |
| 132 | - 'link' => "javascript:void window.open('mailto:" . $user->getVar('email') . "', 'new');", |
|
| 132 | + 'link' => "javascript:void window.open('mailto:".$user->getVar('email')."', 'new');", |
|
| 133 | 133 | 'name' => _MD_NEWBB_EMAIL |
| 134 | 134 | ]; |
| 135 | 135 | } |
| 136 | 136 | if ($url = $user->getVar('url')) { |
| 137 | 137 | $userbar['url'] = [ |
| 138 | - 'link' => "javascript:void window.open('" . $url . "', 'new');", |
|
| 138 | + 'link' => "javascript:void window.open('".$url."', 'new');", |
|
| 139 | 139 | 'name' => _MD_NEWBB_WWW |
| 140 | 140 | ]; |
| 141 | 141 | } |
| 142 | 142 | if ($icq = $user->getVar('user_icq')) { |
| 143 | 143 | $userbar['icq'] = [ |
| 144 | - 'link' => "javascript:void window.open('http://wwp.icq.com/scripts/search.dll?to=" . $icq . "', 'new');", |
|
| 144 | + 'link' => "javascript:void window.open('http://wwp.icq.com/scripts/search.dll?to=".$icq."', 'new');", |
|
| 145 | 145 | 'name' => _MD_NEWBB_ICQ |
| 146 | 146 | ]; |
| 147 | 147 | } |
| 148 | 148 | if ($aim = $user->getVar('user_aim')) { |
| 149 | 149 | $userbar['aim'] = [ |
| 150 | - 'link' => "javascript:void window.open('aim:goim?screenname=" . $aim . '&message=Hi+' . $aim . '+Are+you+there?' . "', 'new');", |
|
| 150 | + 'link' => "javascript:void window.open('aim:goim?screenname=".$aim.'&message=Hi+'.$aim.'+Are+you+there?'."', 'new');", |
|
| 151 | 151 | 'name' => _MD_NEWBB_AIM |
| 152 | 152 | ]; |
| 153 | 153 | } |
| 154 | 154 | if ($yim = $user->getVar('user_yim')) { |
| 155 | 155 | $userbar['yim'] = [ |
| 156 | - 'link' => "javascript:void window.open('http://edit.yahoo.com/config/send_webmesg?.target=" . $yim . '&.src=pg' . "', 'new');", |
|
| 156 | + 'link' => "javascript:void window.open('http://edit.yahoo.com/config/send_webmesg?.target=".$yim.'&.src=pg'."', 'new');", |
|
| 157 | 157 | 'name' => _MD_NEWBB_YIM |
| 158 | 158 | ]; |
| 159 | 159 | } |
| 160 | 160 | if ($msn = $user->getVar('user_msnm')) { |
| 161 | 161 | $userbar['msnm'] = [ |
| 162 | - 'link' => "javascript:void window.open('http://members.msn.com?mem=" . $msn . "', 'new');", |
|
| 162 | + 'link' => "javascript:void window.open('http://members.msn.com?mem=".$msn."', 'new');", |
|
| 163 | 163 | 'name' => _MD_NEWBB_MSNM |
| 164 | 164 | ]; |
| 165 | 165 | } |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | $rpg_path = $iconHandler->getPath('rpg'); |
| 184 | 184 | foreach (['img_left', 'img_backing', 'img_right', 'blue', 'green', 'orange'] as $img) { |
| 185 | 185 | // irmtfan fix: double "/" removed |
| 186 | - $rpg_images[$img] = XOOPS_URL . $rpg_path . '/' . $img . '.gif'; |
|
| 186 | + $rpg_images[$img] = XOOPS_URL.$rpg_path.'/'.$img.'.gif'; |
|
| 187 | 187 | } |
| 188 | 188 | } |
| 189 | 189 | // irmtfan hardcore removed align="left" |
@@ -195,13 +195,13 @@ discard block |
||
| 195 | 195 | . $rpg_images['img_right'] |
| 196 | 196 | . "' alt='' /></td></tr></table>"; |
| 197 | 197 | |
| 198 | - $info = _MD_NEWBB_LEVEL . ' ' . $level['level'] . '<br><span title="' . _MD_NEWBB_HP_DESC . '">' . _MD_NEWBB_HP . ' ' . $level['hp'] . ' / ' . $level['hp_max'] . '</span><br>' . sprintf($table, $rpg_images['orange'], $level['hp_width']); |
|
| 199 | - $info .= '<span title="' . _MD_NEWBB_MP_DESC . '">' . _MD_NEWBB_MP . ' ' . $level['mp'] . ' / ' . $level['mp_max'] . '</span><br>' . sprintf($table, $rpg_images['green'], $level['mp_width']); |
|
| 200 | - $info .= '<span title="' . _MD_NEWBB_EXP_DESC . '">' . _MD_NEWBB_EXP . ' ' . $level['exp'] . '</span><br>' . sprintf($table, $rpg_images['blue'], $level['exp_width']); |
|
| 198 | + $info = _MD_NEWBB_LEVEL.' '.$level['level'].'<br><span title="'._MD_NEWBB_HP_DESC.'">'._MD_NEWBB_HP.' '.$level['hp'].' / '.$level['hp_max'].'</span><br>'.sprintf($table, $rpg_images['orange'], $level['hp_width']); |
|
| 199 | + $info .= '<span title="'._MD_NEWBB_MP_DESC.'">'._MD_NEWBB_MP.' '.$level['mp'].' / '.$level['mp_max'].'</span><br>'.sprintf($table, $rpg_images['green'], $level['mp_width']); |
|
| 200 | + $info .= '<span title="'._MD_NEWBB_EXP_DESC.'">'._MD_NEWBB_EXP.' '.$level['exp'].'</span><br>'.sprintf($table, $rpg_images['blue'], $level['exp_width']); |
|
| 201 | 201 | } else { |
| 202 | - $info = _MD_NEWBB_LEVEL . ' ' . $level['level'] . '; <span title="' . _MD_NEWBB_EXP_DESC . '">' . _MD_NEWBB_EXP . ' ' . $level['exp'] . '</span><br>'; |
|
| 203 | - $info .= '<span title="' . _MD_NEWBB_HP_DESC . '">' . _MD_NEWBB_HP . ' ' . $level['hp'] . ' / ' . $level['hp_max'] . '</span><br>'; |
|
| 204 | - $info .= '<span title="' . _MD_NEWBB_MP_DESC . '">' . _MD_NEWBB_MP . ' ' . $level['mp'] . ' / ' . $level['mp_max'] . '</span>'; |
|
| 202 | + $info = _MD_NEWBB_LEVEL.' '.$level['level'].'; <span title="'._MD_NEWBB_EXP_DESC.'">'._MD_NEWBB_EXP.' '.$level['exp'].'</span><br>'; |
|
| 203 | + $info .= '<span title="'._MD_NEWBB_HP_DESC.'">'._MD_NEWBB_HP.' '.$level['hp'].' / '.$level['hp_max'].'</span><br>'; |
|
| 204 | + $info .= '<span title="'._MD_NEWBB_MP_DESC.'">'._MD_NEWBB_MP.' '.$level['mp'].' / '.$level['mp_max'].'</span>'; |
|
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | return $info; |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | $name = empty($GLOBALS['xoopsModuleConfig']['show_realname']) ? $user->getVar('uname') : $user->getVar('name'); |
| 232 | 232 | $userinfo['name'] = $name ?: $user->getVar('uname'); |
| 233 | 233 | |
| 234 | - $userinfo['link'] = '<a href=\'' . XOOPS_URL . '/userinfo.php?uid=' . $user->getVar('uid') . '\'>' . $userinfo['name'] . '</a>'; |
|
| 234 | + $userinfo['link'] = '<a href=\''.XOOPS_URL.'/userinfo.php?uid='.$user->getVar('uid').'\'>'.$userinfo['name'].'</a>'; |
|
| 235 | 235 | |
| 236 | 236 | $userinfo['avatar'] = $user->getVar('user_avatar'); |
| 237 | 237 | // START hacked by irmtfan - easier rank getting - consistency with previous version back rank.title and rank.image |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | // END hacked by irmtfan - easier groups getting - can we use $_SESSION['xoopsUserGroups']??? |
| 255 | 255 | $userinfo['from'] = $user->getVar('user_from'); |
| 256 | 256 | |
| 257 | - require_once __DIR__ . '/../include/functions.time.php'; |
|
| 257 | + require_once __DIR__.'/../include/functions.time.php'; |
|
| 258 | 258 | $userinfo['regdate'] = newbbFormatTimestamp($user->getVar('user_regdate'), 'reg'); |
| 259 | 259 | $userinfo['last_login'] = newbbFormatTimestamp($user->getVar('last_login')); // irmtfan add last_login |
| 260 | 260 | |