@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | * |
| 21 | 21 | */ |
| 22 | 22 | |
| 23 | -require_once __DIR__ . '/../../include/common.php'; |
|
| 23 | +require_once __DIR__.'/../../include/common.php'; |
|
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | 26 | * Class Configurator |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | $moduleDirName = basename(dirname(__DIR__)); |
| 46 | 46 | $capsDirName = strtoupper($moduleDirName); |
| 47 | 47 | |
| 48 | - require_once __DIR__ . '/../../include/config.php'; |
|
| 48 | + require_once __DIR__.'/../../include/config.php'; |
|
| 49 | 49 | $config = getConfig(); |
| 50 | 50 | |
| 51 | 51 | $this->name = $config->name; |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | // defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
| 14 | 14 | |
| 15 | -defined('NEWBB_FUNCTIONS_INI') || require_once __DIR__ . '/functions.ini.php'; |
|
| 15 | +defined('NEWBB_FUNCTIONS_INI') || require_once __DIR__.'/functions.ini.php'; |
|
| 16 | 16 | |
| 17 | 17 | define('NEWBB_STATS_TYPE_TOPIC', 1); |
| 18 | 18 | define('NEWBB_STATS_TYPE_POST', 2); |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | return false; |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | - $sql = " UPDATE {$this->table}" |
|
| 81 | + $sql = " UPDATE {$this->table}" |
|
| 82 | 82 | . ' SET stats_value = CASE ' |
| 83 | 83 | . " WHEN time_format = '' OR DATE_FORMAT(time_update, time_format) = DATE_FORMAT(NOW(), time_format) THEN stats_value + '{$increment}' " |
| 84 | 84 | . " ELSE '{$increment}' " |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | $result = $this->db->queryF($sql); |
| 91 | 91 | $rows = $this->db->getAffectedRows(); |
| 92 | 92 | if (0 == $rows) { |
| 93 | - $sql = " INSERT INTO {$this->table}" |
|
| 93 | + $sql = " INSERT INTO {$this->table}" |
|
| 94 | 94 | . ' (`stats_id`, `stats_value`, `stats_type`, `stats_period`, `time_update`, `time_format`) ' |
| 95 | 95 | . ' VALUES ' |
| 96 | 96 | . " ('0', '{$increment}', '{$type}', '" |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | foreach ($periods as $period) { |
| 148 | 148 | $_periods[] = array_search($period, $this->param['period']); |
| 149 | 149 | } |
| 150 | - $sql = ' SELECT stats_id, stats_value, stats_type, stats_period ' |
|
| 150 | + $sql = ' SELECT stats_id, stats_value, stats_type, stats_period ' |
|
| 151 | 151 | . " FROM {$this->table} " |
| 152 | 152 | . ' WHERE ' |
| 153 | 153 | . " ( time_format = '' OR DATE_FORMAT(time_update, time_format) = DATE_FORMAT(NOW(), time_format) ) " |
@@ -156,9 +156,9 @@ discard block |
||
| 156 | 156 | . implode(', ', array_map('intval', $ids)) |
| 157 | 157 | . ')') |
| 158 | 158 | . ' ' |
| 159 | - . (empty($_types) ? '' : 'AND stats_type IN (' . implode(', ', $_types) . ')') |
|
| 159 | + . (empty($_types) ? '' : 'AND stats_type IN ('.implode(', ', $_types).')') |
|
| 160 | 160 | . ' ' |
| 161 | - . (empty($_periods) ? '' : 'AND stats_period IN (' . implode(', ', $_periods) . ')'); |
|
| 161 | + . (empty($_periods) ? '' : 'AND stats_period IN ('.implode(', ', $_periods).')'); |
|
| 162 | 162 | $result = $this->db->query($sql); |
| 163 | 163 | |
| 164 | 164 | while (false !== ($row = $this->db->fetchArray($result))) { |
@@ -170,36 +170,36 @@ discard block |
||
| 170 | 170 | |
| 171 | 171 | public function reset() |
| 172 | 172 | { |
| 173 | - $this->db->queryF('TRUNCATE TABLE ' . $this->table); |
|
| 173 | + $this->db->queryF('TRUNCATE TABLE '.$this->table); |
|
| 174 | 174 | $now = time(); |
| 175 | 175 | $time_start = [ |
| 176 | 176 | 'day' => '%Y%j', |
| 177 | 177 | 'week' => '%Y%u', |
| 178 | 178 | 'month' => '%Y%m' |
| 179 | 179 | ]; |
| 180 | - $counts = []; |
|
| 180 | + $counts = []; |
|
| 181 | 181 | |
| 182 | - $sql = ' SELECT forum_id' . ' FROM ' . $this->db->prefix('newbb_forums'); |
|
| 182 | + $sql = ' SELECT forum_id'.' FROM '.$this->db->prefix('newbb_forums'); |
|
| 183 | 183 | $ret = $this->db->query($sql); |
| 184 | 184 | while (false !== (list($forum_id) = $this->db->fetchRow($ret))) { |
| 185 | - $sql = ' SELECT COUNT(*), SUM(topic_views)' . ' FROM ' . $this->db->prefix('newbb_topics') . " WHERE approved=1 AND forum_id = {$forum_id}"; |
|
| 185 | + $sql = ' SELECT COUNT(*), SUM(topic_views)'.' FROM '.$this->db->prefix('newbb_topics')." WHERE approved=1 AND forum_id = {$forum_id}"; |
|
| 186 | 186 | $result = $this->db->query($sql); |
| 187 | 187 | list($topics, $views) = $this->db->fetchRow($result); |
| 188 | 188 | $this->update($forum_id, 'topic', $topics); |
| 189 | 189 | $this->update($forum_id, 'view', $views); |
| 190 | 190 | |
| 191 | - $sql = ' SELECT COUNT(*)' . ' FROM ' . $this->db->prefix('newbb_topics') . " WHERE approved=1 AND topic_digest >0 AND forum_id = {$forum_id}"; |
|
| 191 | + $sql = ' SELECT COUNT(*)'.' FROM '.$this->db->prefix('newbb_topics')." WHERE approved=1 AND topic_digest >0 AND forum_id = {$forum_id}"; |
|
| 192 | 192 | $result = $this->db->query($sql); |
| 193 | 193 | list($digests) = $this->db->fetchRow($result); |
| 194 | 194 | $this->update($forum_id, 'digest', $digests); |
| 195 | 195 | |
| 196 | - $sql = ' SELECT COUNT(*)' . ' FROM ' . $this->db->prefix('newbb_posts') . " WHERE approved=1 AND forum_id = {$forum_id}"; |
|
| 196 | + $sql = ' SELECT COUNT(*)'.' FROM '.$this->db->prefix('newbb_posts')." WHERE approved=1 AND forum_id = {$forum_id}"; |
|
| 197 | 197 | $result = $this->db->query($sql); |
| 198 | 198 | list($posts) = $this->db->fetchRow($result); |
| 199 | 199 | $this->update($forum_id, 'post', $posts); |
| 200 | 200 | |
| 201 | 201 | foreach ($time_start as $period => $format) { |
| 202 | - $sql = ' SELECT COUNT(*), SUM(topic_views)' . ' FROM ' . $this->db->prefix('newbb_topics') . " WHERE approved=1 AND forum_id = {$forum_id}" . " AND FROM_UNIXTIME(topic_time, '{$format}') >= FROM_UNIXTIME({$now}, '{$format}')"; |
|
| 202 | + $sql = ' SELECT COUNT(*), SUM(topic_views)'.' FROM '.$this->db->prefix('newbb_topics')." WHERE approved=1 AND forum_id = {$forum_id}"." AND FROM_UNIXTIME(topic_time, '{$format}') >= FROM_UNIXTIME({$now}, '{$format}')"; |
|
| 203 | 203 | $result = $this->db->query($sql); |
| 204 | 204 | list($topics, $views) = $this->db->fetchRow($result); |
| 205 | 205 | $views = empty($views) ? 0 : $views; // null check |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | @$counts['topic'][$period] += $topics; |
| 223 | 223 | @$counts['view'][$period] += $views; |
| 224 | 224 | |
| 225 | - $sql = ' SELECT COUNT(*)' . ' FROM ' . $this->db->prefix('newbb_topics') . " WHERE approved=1 AND topic_digest >0 AND forum_id = {$forum_id}" . " AND FROM_UNIXTIME(digest_time, '{$format}') >= FROM_UNIXTIME({$now}, '{$format}')"; |
|
| 225 | + $sql = ' SELECT COUNT(*)'.' FROM '.$this->db->prefix('newbb_topics')." WHERE approved=1 AND topic_digest >0 AND forum_id = {$forum_id}"." AND FROM_UNIXTIME(digest_time, '{$format}') >= FROM_UNIXTIME({$now}, '{$format}')"; |
|
| 226 | 226 | $result = $this->db->query($sql); |
| 227 | 227 | list($digests) = $this->db->fetchRow($result); |
| 228 | 228 | $this->db->queryF(" INSERT INTO {$this->table}" |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | . "', NOW(), '{$format}')"); |
| 236 | 236 | @$counts['digest'][$period] += $digests; |
| 237 | 237 | |
| 238 | - $sql = ' SELECT COUNT(*)' . ' FROM ' . $this->db->prefix('newbb_posts') . " WHERE approved=1 AND forum_id = {$forum_id}" . " AND FROM_UNIXTIME(post_time, '{$format}') >= FROM_UNIXTIME({$now}, '{$format}')"; |
|
| 238 | + $sql = ' SELECT COUNT(*)'.' FROM '.$this->db->prefix('newbb_posts')." WHERE approved=1 AND forum_id = {$forum_id}"." AND FROM_UNIXTIME(post_time, '{$format}') >= FROM_UNIXTIME({$now}, '{$format}')"; |
|
| 239 | 239 | $result = $this->db->query($sql); |
| 240 | 240 | list($posts) = $this->db->fetchRow($result); |
| 241 | 241 | $this->db->queryF(" INSERT INTO {$this->table}" |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | } |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | - $this->db->queryF(" DELETE FROM {$this->table}" . " WHERE stats_id = '0' AND stats_period <> " . array_search('total', $this->param['period'], true)); |
|
| 253 | + $this->db->queryF(" DELETE FROM {$this->table}"." WHERE stats_id = '0' AND stats_period <> ".array_search('total', $this->param['period'], true)); |
|
| 254 | 254 | foreach ($time_start as $period => $format) { |
| 255 | 255 | foreach (array_keys($counts) as $type) { |
| 256 | 256 | $this->db->queryF(" INSERT INTO {$this->table}" |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | // irmtfan add LAST_INSERT_ID to enhance the mysql performances |
| 54 | 54 | public function incrementCounter() |
| 55 | 55 | { |
| 56 | - $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('newbb_topics') . ' SET topic_views = LAST_INSERT_ID(topic_views + 1) WHERE topic_id =' . $this->getVar('topic_id'); |
|
| 56 | + $sql = 'UPDATE '.$GLOBALS['xoopsDB']->prefix('newbb_topics').' SET topic_views = LAST_INSERT_ID(topic_views + 1) WHERE topic_id ='.$this->getVar('topic_id'); |
|
| 57 | 57 | $GLOBALS['xoopsDB']->queryF($sql); |
| 58 | 58 | } |
| 59 | 59 | |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | return $topic_title; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - require_once __DIR__ . '/../include/functions.topic.php'; |
|
| 77 | + require_once __DIR__.'/../include/functions.topic.php'; |
|
| 78 | 78 | |
| 79 | 79 | return getTopicTitle($topic_title, $typeObject->getVar('type_name'), $typeObject->getVar('type_color')); |
| 80 | 80 | } |
@@ -154,9 +154,9 @@ discard block |
||
| 154 | 154 | /** @var \XoopsPoll $poll */ |
| 155 | 155 | $poll = new $classPoll($poll_id); |
| 156 | 156 | if (false !== $poll->delete()) { |
| 157 | - $classOption = $classPoll . 'Option'; |
|
| 157 | + $classOption = $classPoll.'Option'; |
|
| 158 | 158 | $classOption::deleteByPollId($poll->getVar('poll_id')); |
| 159 | - $classLog = $classPoll . 'Log'; |
|
| 159 | + $classLog = $classPoll.'Log'; |
|
| 160 | 160 | $classLog::deleteByPollId($poll->getVar('poll_id')); |
| 161 | 161 | xoops_comment_delete($GLOBALS['xoopsModule']->getVar('mid'), $poll->getVar('poll_id')); |
| 162 | 162 | } |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | // defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
| 17 | 17 | |
| 18 | -require_once __DIR__ . '/../include/functions.config.php'; |
|
| 18 | +require_once __DIR__.'/../include/functions.config.php'; |
|
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | 21 | * Class OnlineHandler |
@@ -96,8 +96,8 @@ discard block |
||
| 96 | 96 | */ |
| 97 | 97 | public function render(\Smarty $xoopsTpl) |
| 98 | 98 | { |
| 99 | - require_once __DIR__ . '/../include/functions.render.php'; |
|
| 100 | - require_once __DIR__ . '/../include/functions.user.php'; |
|
| 99 | + require_once __DIR__.'/../include/functions.render.php'; |
|
| 100 | + require_once __DIR__.'/../include/functions.user.php'; |
|
| 101 | 101 | $criteria = null; |
| 102 | 102 | if ($this->topic_id) { |
| 103 | 103 | $criteria = new \Criteria('online_topic', $this->topic_id); |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | } |
| 117 | 117 | $users_id[] = $users[$i]['online_uid']; |
| 118 | 118 | $users_online[$users[$i]['online_uid']] = [ |
| 119 | - 'link' => XOOPS_URL . '/userinfo.php?uid=' . $users[$i]['online_uid'], |
|
| 119 | + 'link' => XOOPS_URL.'/userinfo.php?uid='.$users[$i]['online_uid'], |
|
| 120 | 120 | 'uname' => $users[$i]['online_uname'] |
| 121 | 121 | ]; |
| 122 | 122 | ++$num_user; |
@@ -155,8 +155,8 @@ discard block |
||
| 155 | 155 | */ |
| 156 | 156 | public function showOnline() |
| 157 | 157 | { |
| 158 | - require_once __DIR__ . '/../include/functions.render.php'; |
|
| 159 | - require_once __DIR__ . '/../include/functions.user.php'; |
|
| 158 | + require_once __DIR__.'/../include/functions.render.php'; |
|
| 159 | + require_once __DIR__.'/../include/functions.user.php'; |
|
| 160 | 160 | $criteria = null; |
| 161 | 161 | if ($this->topic_id) { |
| 162 | 162 | $criteria = new \Criteria('online_topic', $this->topic_id); |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | } |
| 176 | 176 | $users_id[] = $users[$i]['online_uid']; |
| 177 | 177 | $users_online[$users[$i]['online_uid']] = [ |
| 178 | - 'link' => XOOPS_URL . '/userinfo.php?uid=' . $users[$i]['online_uid'], |
|
| 178 | + 'link' => XOOPS_URL.'/userinfo.php?uid='.$users[$i]['online_uid'], |
|
| 179 | 179 | 'uname' => $users[$i]['online_uname'] |
| 180 | 180 | ]; |
| 181 | 181 | ++$num_user; |
@@ -229,15 +229,15 @@ discard block |
||
| 229 | 229 | |
| 230 | 230 | $uid = (int)$uid; |
| 231 | 231 | if ($uid > 0) { |
| 232 | - $sql = 'SELECT COUNT(*) FROM ' . $this->db->prefix('newbb_online') . ' WHERE online_uid=' . $uid; |
|
| 232 | + $sql = 'SELECT COUNT(*) FROM '.$this->db->prefix('newbb_online').' WHERE online_uid='.$uid; |
|
| 233 | 233 | } else { |
| 234 | - $sql = 'SELECT COUNT(*) FROM ' . $this->db->prefix('newbb_online') . ' WHERE online_uid=' . $uid . " AND online_ip='" . $ip . "'"; |
|
| 234 | + $sql = 'SELECT COUNT(*) FROM '.$this->db->prefix('newbb_online').' WHERE online_uid='.$uid." AND online_ip='".$ip."'"; |
|
| 235 | 235 | } |
| 236 | 236 | list($count) = $this->db->fetchRow($this->db->queryF($sql)); |
| 237 | 237 | if ($count > 0) { |
| 238 | - $sql = 'UPDATE ' . $this->db->prefix('newbb_online') . " SET online_updated= '" . $time . "', online_forum = '" . $forum_id . "', online_topic = '" . $topic_id . "' WHERE online_uid = " . $uid; |
|
| 238 | + $sql = 'UPDATE '.$this->db->prefix('newbb_online')." SET online_updated= '".$time."', online_forum = '".$forum_id."', online_topic = '".$topic_id."' WHERE online_uid = ".$uid; |
|
| 239 | 239 | if (0 == $uid) { |
| 240 | - $sql .= " AND online_ip='" . $ip . "'"; |
|
| 240 | + $sql .= " AND online_ip='".$ip."'"; |
|
| 241 | 241 | } |
| 242 | 242 | } else { |
| 243 | 243 | $sql = sprintf('INSERT INTO `%s` (online_uid, online_uname, online_updated, online_ip, online_forum, online_topic) VALUES (%u, %s, %u, %s, %u, %u)', $this->db->prefix('newbb_online'), $uid, $this->db->quote($uname), $time, $this->db->quote($ip), $forum_id, $topic_id); |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | public function gc($expire) |
| 284 | 284 | { |
| 285 | 285 | global $xoopsModule; |
| 286 | - $sql = 'DELETE FROM ' . $this->db->prefix('newbb_online') . ' WHERE online_updated < ' . (time() - (int)$expire); |
|
| 286 | + $sql = 'DELETE FROM '.$this->db->prefix('newbb_online').' WHERE online_updated < '.(time() - (int)$expire); |
|
| 287 | 287 | $this->db->queryF($sql); |
| 288 | 288 | |
| 289 | 289 | $xoops_onlineHandler = xoops_getHandler('online'); |
@@ -300,9 +300,9 @@ discard block |
||
| 300 | 300 | { |
| 301 | 301 | $ret = []; |
| 302 | 302 | $limit = $start = 0; |
| 303 | - $sql = 'SELECT * FROM ' . $this->db->prefix('newbb_online'); |
|
| 303 | + $sql = 'SELECT * FROM '.$this->db->prefix('newbb_online'); |
|
| 304 | 304 | if (is_object($criteria) && is_subclass_of($criteria, 'CriteriaElement')) { |
| 305 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 305 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 306 | 306 | $limit = $criteria->getLimit(); |
| 307 | 307 | $start = $criteria->getStart(); |
| 308 | 308 | } |
@@ -333,9 +333,9 @@ discard block |
||
| 333 | 333 | if (!empty($this->user_ids)) { |
| 334 | 334 | $online_users = $this->user_ids; |
| 335 | 335 | } else { |
| 336 | - $sql = 'SELECT online_uid FROM ' . $this->db->prefix('newbb_online'); |
|
| 336 | + $sql = 'SELECT online_uid FROM '.$this->db->prefix('newbb_online'); |
|
| 337 | 337 | if (!empty($uids)) { |
| 338 | - $sql .= ' WHERE online_uid IN (' . implode(', ', array_map('intval', $uids)) . ')'; |
|
| 338 | + $sql .= ' WHERE online_uid IN ('.implode(', ', array_map('intval', $uids)).')'; |
|
| 339 | 339 | } |
| 340 | 340 | |
| 341 | 341 | $result = $this->db->query($sql); |
@@ -363,9 +363,9 @@ discard block |
||
| 363 | 363 | */ |
| 364 | 364 | public function getCount(\CriteriaElement $criteria = null) |
| 365 | 365 | { |
| 366 | - $sql = 'SELECT COUNT(*) FROM ' . $this->db->prefix('newbb_online'); |
|
| 366 | + $sql = 'SELECT COUNT(*) FROM '.$this->db->prefix('newbb_online'); |
|
| 367 | 367 | if (is_object($criteria) && is_subclass_of($criteria, 'CriteriaElement')) { |
| 368 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 368 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 369 | 369 | } |
| 370 | 370 | if (!$result = $this->db->query($sql)) { |
| 371 | 371 | return false; |
@@ -32,7 +32,7 @@ |
||
| 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 |
@@ -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 | /* deal with marks */ |
| 18 | 18 | if (Request::getInt('mark_read', 0)) { |
@@ -23,13 +23,13 @@ discard block |
||
| 23 | 23 | $markvalue = 0; |
| 24 | 24 | $markresult = _MD_NEWBB_MARK_UNREAD; |
| 25 | 25 | } |
| 26 | - require_once __DIR__ . '/include/functions.read.php'; |
|
| 26 | + require_once __DIR__.'/include/functions.read.php'; |
|
| 27 | 27 | newbbSetReadForum($markvalue); |
| 28 | - $url = XOOPS_URL . '/modules/newbb/index.php'; |
|
| 29 | - redirect_header($url, 2, _MD_NEWBB_ALL_FORUM_MARKED . ' ' . $markresult); |
|
| 28 | + $url = XOOPS_URL.'/modules/newbb/index.php'; |
|
| 29 | + redirect_header($url, 2, _MD_NEWBB_ALL_FORUM_MARKED.' '.$markresult); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | -$viewcat = Request::getInt('cat', 0, 'GET');//TODO mb check if this is GET or POST? |
|
| 32 | +$viewcat = Request::getInt('cat', 0, 'GET'); //TODO mb check if this is GET or POST? |
|
| 33 | 33 | ///** @var Newbb\CategoryHandler $categoryHandler */ |
| 34 | 34 | //$categoryHandler = Newbb\Helper::getInstance()->getHandler('Category'); |
| 35 | 35 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | $categories[$viewcat] = $categoryObject->getValues(); |
| 45 | 45 | } |
| 46 | 46 | $forum_index_title = sprintf(_MD_NEWBB_FORUMINDEX, htmlspecialchars($GLOBALS['xoopsConfig']['sitename'], ENT_QUOTES)); |
| 47 | - $xoops_pagetitle = $categoryObject->getVar('cat_title') . ' [' . $xoopsModule->getVar('name') . ']'; |
|
| 47 | + $xoops_pagetitle = $categoryObject->getVar('cat_title').' ['.$xoopsModule->getVar('name').']'; |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | if (0 === count($categories)) { |
@@ -57,12 +57,12 @@ discard block |
||
| 57 | 57 | //$xoopsOption['xoops_module_header'] = $xoops_module_header; |
| 58 | 58 | // irmtfan include header.php after defining $xoopsOption['template_main'] |
| 59 | 59 | require_once $GLOBALS['xoops']->path('header.php'); |
| 60 | -require_once __DIR__ . '/include/functions.render.php'; |
|
| 60 | +require_once __DIR__.'/include/functions.render.php'; |
|
| 61 | 61 | /* rss feed */ |
| 62 | 62 | // irmtfan new method |
| 63 | 63 | if (!empty($GLOBALS['xoopsModuleConfig']['rss_enable'])) { |
| 64 | 64 | $xoopsTpl->assign('xoops_module_header', ' |
| 65 | - <link rel="alternate" type="application/xml+rss" title="' . $xoopsModule->getVar('name') . '" href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/rss.php" /> |
|
| 65 | + <link rel="alternate" type="application/xml+rss" title="' . $xoopsModule->getVar('name').'" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/rss.php" /> |
|
| 66 | 66 | ' . @$xoopsTpl->get_template_vars('xoops_module_header')); |
| 67 | 67 | } |
| 68 | 68 | $xoopsTpl->assign('xoops_pagetitle', $xoops_pagetitle); |
@@ -89,8 +89,8 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | if (!empty($forums_allowed)) { |
| 91 | 91 | $crit_top = new \CriteriaCompo(new \Criteria('parent_forum', 0)); |
| 92 | - $crit_top->add(new \Criteria('cat_id', '(' . implode(', ', array_keys($categories)) . ')', 'IN')); |
|
| 93 | - $crit_top->add(new \Criteria('forum_id', '(' . implode(', ', $forums_allowed) . ')', 'IN')); |
|
| 92 | + $crit_top->add(new \Criteria('cat_id', '('.implode(', ', array_keys($categories)).')', 'IN')); |
|
| 93 | + $crit_top->add(new \Criteria('forum_id', '('.implode(', ', $forums_allowed).')', 'IN')); |
|
| 94 | 94 | $forums_top = $forumHandler->getIds($crit_top); |
| 95 | 95 | } |
| 96 | 96 | |
@@ -98,8 +98,8 @@ discard block |
||
| 98 | 98 | if ('hidden' === $GLOBALS['xoopsModuleConfig']['subforum_display'] || 0 === count($forums_top)) { |
| 99 | 99 | $forums_sub = []; |
| 100 | 100 | } else { |
| 101 | - $crit_sub = new \CriteriaCompo(new \Criteria('parent_forum', '(' . implode(', ', $forums_top) . ')', 'IN')); |
|
| 102 | - $crit_sub->add(new \Criteria('forum_id', '(' . implode(', ', $forums_allowed) . ')', 'IN')); |
|
| 101 | + $crit_sub = new \CriteriaCompo(new \Criteria('parent_forum', '('.implode(', ', $forums_top).')', 'IN')); |
|
| 102 | + $crit_sub->add(new \Criteria('forum_id', '('.implode(', ', $forums_allowed).')', 'IN')); |
|
| 103 | 103 | $forums_sub = $forumHandler->getIds($crit_sub); |
| 104 | 104 | } |
| 105 | 105 | |
@@ -111,17 +111,17 @@ discard block |
||
| 111 | 111 | $newposts = 0; |
| 112 | 112 | $deleteposts = 0; |
| 113 | 113 | if (0 !== count($forums_available)) { |
| 114 | - $crit_forum = new \Criteria('forum_id', '(' . implode(', ', $forums_available) . ')', 'IN'); |
|
| 114 | + $crit_forum = new \Criteria('forum_id', '('.implode(', ', $forums_available).')', 'IN'); |
|
| 115 | 115 | $crit_forum->setSort('cat_id ASC, parent_forum ASC, forum_order'); |
| 116 | 116 | $crit_forum->setOrder('ASC'); |
| 117 | 117 | $forums = $forumHandler->getAll($crit_forum, null, false); |
| 118 | 118 | $newtopics = $forumHandler->getTopicCount($forums, 0, 'pending'); |
| 119 | 119 | $deletetopics = $forumHandler->getTopicCount($forums, 0, 'deleted'); |
| 120 | 120 | $forums_array = $forumHandler->display($forums, $GLOBALS['xoopsModuleConfig']['length_title_index'], $GLOBALS['xoopsModuleConfig']['count_subforum']); |
| 121 | - $crit = new \CriteriaCompo(new \Criteria('forum_id', '(' . implode(', ', $forums_available) . ')', 'IN')); |
|
| 121 | + $crit = new \CriteriaCompo(new \Criteria('forum_id', '('.implode(', ', $forums_available).')', 'IN')); |
|
| 122 | 122 | $crit->add(new \Criteria('approved', '-1')); |
| 123 | 123 | $deleteposts = $postHandler->getCount($crit); |
| 124 | - $crit = new \CriteriaCompo(new \Criteria('forum_id', '(' . implode(', ', $forums_available) . ')', 'IN')); |
|
| 124 | + $crit = new \CriteriaCompo(new \Criteria('forum_id', '('.implode(', ', $forums_available).')', 'IN')); |
|
| 125 | 125 | $crit->add(new \Criteria('approved', '0')); |
| 126 | 126 | $newposts = $postHandler->getCount($crit); |
| 127 | 127 | } |
@@ -168,15 +168,15 @@ discard block |
||
| 168 | 168 | $forums = []; |
| 169 | 169 | $onecat = $categories[$id]; |
| 170 | 170 | |
| 171 | - $cat_element_id = 'cat_' . $onecat['cat_id']; |
|
| 171 | + $cat_element_id = 'cat_'.$onecat['cat_id']; |
|
| 172 | 172 | $expand = (count($toggles) > 0) ? (in_array($cat_element_id, $toggles) ? false : true) : true; |
| 173 | 173 | // START irmtfan to improve newbbDisplayImage |
| 174 | 174 | if ($expand) { |
| 175 | - $cat_display = 'block'; //irmtfan move semicolon |
|
| 175 | + $cat_display = 'block'; //irmtfan move semicolon |
|
| 176 | 176 | $cat_icon_display = 'minus'; |
| 177 | 177 | $cat_alt = _MD_NEWBB_HIDE; |
| 178 | 178 | } else { |
| 179 | - $cat_display = 'none'; //irmtfan move semicolon |
|
| 179 | + $cat_display = 'none'; //irmtfan move semicolon |
|
| 180 | 180 | $cat_icon_display = 'plus'; |
| 181 | 181 | $cat_alt = _MD_NEWBB_SEE; |
| 182 | 182 | } |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | $cat_image = ''; |
| 200 | 200 | $cat_image = $onecat['cat_image']; |
| 201 | 201 | if ('' !== $cat_image && 'blank.gif' !== $cat_image && $cat_image) { |
| 202 | - $cat_image = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/assets/images/category/' . $cat_image; |
|
| 202 | + $cat_image = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/assets/images/category/'.$cat_image; |
|
| 203 | 203 | } |
| 204 | 204 | $category_array[] = [ |
| 205 | 205 | 'cat_id' => $onecat['cat_id'], |
@@ -250,15 +250,15 @@ discard block |
||
| 250 | 250 | $stats = $statsHandler->getStats(array_merge([0], $forums_available)); |
| 251 | 251 | $xoopsTpl->assign_by_ref('stats', $stats); |
| 252 | 252 | $xoopsTpl->assign('subforum_display', $GLOBALS['xoopsModuleConfig']['subforum_display']); |
| 253 | -$xoopsTpl->assign('mark_read', XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/index.php?mark_read=1'); |
|
| 254 | -$xoopsTpl->assign('mark_unread', XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/index.php?mark_read=2'); |
|
| 253 | +$xoopsTpl->assign('mark_read', XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/index.php?mark_read=1'); |
|
| 254 | +$xoopsTpl->assign('mark_unread', XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/index.php?mark_read=2'); |
|
| 255 | 255 | |
| 256 | -$xoopsTpl->assign('all_link', XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/list.topic.php?status=all'); |
|
| 257 | -$xoopsTpl->assign('post_link', XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/viewpost.php?status=all'); |
|
| 258 | -$xoopsTpl->assign('newpost_link', XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/viewpost.php?status=new'); |
|
| 259 | -$xoopsTpl->assign('digest_link', XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/list.topic.php?status=digest'); |
|
| 260 | -$xoopsTpl->assign('unreplied_link', XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/list.topic.php?status=unreplied'); |
|
| 261 | -$xoopsTpl->assign('unread_link', XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/list.topic.php?status=unread'); |
|
| 256 | +$xoopsTpl->assign('all_link', XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/list.topic.php?status=all'); |
|
| 257 | +$xoopsTpl->assign('post_link', XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/viewpost.php?status=all'); |
|
| 258 | +$xoopsTpl->assign('newpost_link', XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/viewpost.php?status=new'); |
|
| 259 | +$xoopsTpl->assign('digest_link', XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/list.topic.php?status=digest'); |
|
| 260 | +$xoopsTpl->assign('unreplied_link', XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/list.topic.php?status=unreplied'); |
|
| 261 | +$xoopsTpl->assign('unread_link', XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/list.topic.php?status=unread'); |
|
| 262 | 262 | $xoopsTpl->assign('menumode', $menumode); |
| 263 | 263 | $xoopsTpl->assign('menumode_other', $menumode_other); |
| 264 | 264 | |
@@ -286,5 +286,5 @@ discard block |
||
| 286 | 286 | ]); |
| 287 | 287 | |
| 288 | 288 | // irmtfan move to footer.php |
| 289 | -require_once __DIR__ . '/footer.php'; |
|
| 289 | +require_once __DIR__.'/footer.php'; |
|
| 290 | 290 | 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 | $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'); |