@@ -13,7 +13,7 @@ |
||
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_READ_LOADED', true); |
18 | 18 | |
19 | 19 | if (!defined('NEWBB_FUNCTIONS_READ')) { |
@@ -11,16 +11,16 @@ |
||
11 | 11 | |
12 | 12 | // defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
13 | 13 | |
14 | -defined('NEWBB_FUNCTIONS_INI') || require_once __DIR__ . '/functions.ini.php'; |
|
14 | +defined('NEWBB_FUNCTIONS_INI') || require_once __DIR__.'/functions.ini.php'; |
|
15 | 15 | define('NEWBB_FUNCTIONS_LOADED', true); |
16 | 16 | |
17 | 17 | if (!defined('NEWBB_FUNCTIONS')) { |
18 | 18 | define('NEWBB_FUNCTIONS', 1); |
19 | 19 | |
20 | - require_once __DIR__ . '/functions.image.php'; |
|
21 | - require_once __DIR__ . '/functions.user.php'; |
|
22 | - require_once __DIR__ . '/functions.render.php'; |
|
23 | - require_once __DIR__ . '/functions.forum.php'; |
|
24 | - require_once __DIR__ . '/functions.session.php'; |
|
25 | - require_once __DIR__ . '/functions.stats.php'; |
|
20 | + require_once __DIR__.'/functions.image.php'; |
|
21 | + require_once __DIR__.'/functions.user.php'; |
|
22 | + require_once __DIR__.'/functions.render.php'; |
|
23 | + require_once __DIR__.'/functions.forum.php'; |
|
24 | + require_once __DIR__.'/functions.session.php'; |
|
25 | + require_once __DIR__.'/functions.stats.php'; |
|
26 | 26 | } |
@@ -13,7 +13,7 @@ |
||
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_RECON_LOADED', true); |
18 | 18 | |
19 | 19 | if (!defined('NEWBB_FUNCTIONS_RECON')) { |
@@ -54,34 +54,34 @@ discard block |
||
54 | 54 | // remove old html template files |
55 | 55 | // create an array with all folders, and then run this once |
56 | 56 | |
57 | - $templateDirectory = $GLOBALS['xoops']->path('modules/' . $module->getVar('dirname', 'n') . '/templates/'); |
|
57 | + $templateDirectory = $GLOBALS['xoops']->path('modules/'.$module->getVar('dirname', 'n').'/templates/'); |
|
58 | 58 | $template_list = array_diff(scandir($templateDirectory, SCANDIR_SORT_NONE), ['..', '.']); |
59 | 59 | foreach ($template_list as $k => $v) { |
60 | - $fileinfo = new \SplFileInfo($templateDirectory . $v); |
|
60 | + $fileinfo = new \SplFileInfo($templateDirectory.$v); |
|
61 | 61 | if ('html' === $fileinfo->getExtension() && 'index.html' !== $fileinfo->getFilename()) { |
62 | - @unlink($templateDirectory . $v); |
|
62 | + @unlink($templateDirectory.$v); |
|
63 | 63 | } |
64 | 64 | } |
65 | - $templateDirectory = $GLOBALS['xoops']->path('modules/' . $module->getVar('dirname', 'n') . '/templates/blocks'); |
|
65 | + $templateDirectory = $GLOBALS['xoops']->path('modules/'.$module->getVar('dirname', 'n').'/templates/blocks'); |
|
66 | 66 | $template_list = array_diff(scandir($templateDirectory, SCANDIR_SORT_NONE), ['..', '.']); |
67 | 67 | foreach ($template_list as $k => $v) { |
68 | - $fileinfo = new \SplFileInfo($templateDirectory . $v); |
|
68 | + $fileinfo = new \SplFileInfo($templateDirectory.$v); |
|
69 | 69 | if ('html' === $fileinfo->getExtension() && 'index.html' !== $fileinfo->getFilename()) { |
70 | - @unlink($templateDirectory . $v); |
|
70 | + @unlink($templateDirectory.$v); |
|
71 | 71 | } |
72 | 72 | } |
73 | 73 | // Load class XoopsFile |
74 | 74 | xoops_load('xoopsfile'); |
75 | 75 | //remove /images directory |
76 | - $imagesDirectory = $GLOBALS['xoops']->path('modules/' . $module->getVar('dirname', 'n') . '/images/'); |
|
76 | + $imagesDirectory = $GLOBALS['xoops']->path('modules/'.$module->getVar('dirname', 'n').'/images/'); |
|
77 | 77 | $folderHandler = \XoopsFile::getHandler('folder', $imagesDirectory); |
78 | 78 | $folderHandler->delete($imagesDirectory); |
79 | 79 | |
80 | 80 | //remove old changelogs |
81 | - array_map('unlink', glob(dirname(__DIR__) . '/docs/changelog-rev*.txt')); |
|
81 | + array_map('unlink', glob(dirname(__DIR__).'/docs/changelog-rev*.txt')); |
|
82 | 82 | |
83 | 83 | if (!empty($newbbConfig['syncOnUpdate'])) { |
84 | - require_once dirname(__DIR__) . '/include/functions.recon.php'; |
|
84 | + require_once dirname(__DIR__).'/include/functions.recon.php'; |
|
85 | 85 | newbbSynchronization(); |
86 | 86 | } |
87 | 87 | |
@@ -107,9 +107,9 @@ discard block |
||
107 | 107 | */ |
108 | 108 | function xoops_module_pre_install_newbb(\XoopsModule $module) |
109 | 109 | { |
110 | - $mod_tables =& $module->getInfo('tables'); |
|
110 | + $mod_tables = & $module->getInfo('tables'); |
|
111 | 111 | foreach ($mod_tables as $table) { |
112 | - $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS ' . $GLOBALS['xoopsDB']->prefix($table) . ';'); |
|
112 | + $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS '.$GLOBALS['xoopsDB']->prefix($table).';'); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | return true; |
@@ -176,12 +176,12 @@ discard block |
||
176 | 176 | } |
177 | 177 | foreach ($groups_post as $group_id) { |
178 | 178 | foreach ($post_items as $item) { |
179 | - $grouppermHandler->addRight('forum_' . $item, $forum_id, $group_id, $module_id); |
|
179 | + $grouppermHandler->addRight('forum_'.$item, $forum_id, $group_id, $module_id); |
|
180 | 180 | } |
181 | 181 | } |
182 | 182 | |
183 | 183 | /* Create a test post */ |
184 | - require_once __DIR__ . '/functions.user.php'; |
|
184 | + require_once __DIR__.'/functions.user.php'; |
|
185 | 185 | /** @var Newbb\PostHandler $postHandler */ |
186 | 186 | $postHandler = Newbb\Helper::getInstance()->getHandler('Post'); |
187 | 187 | /** @var $forumpost */ |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | // defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
13 | 13 | |
14 | -defined('NEWBB_FUNCTIONS_INI') || require_once __DIR__ . '/functions.ini.php'; |
|
14 | +defined('NEWBB_FUNCTIONS_INI') || require_once __DIR__.'/functions.ini.php'; |
|
15 | 15 | define('NEWBB_FUNCTIONS_RPC_LOADED', true); |
16 | 16 | |
17 | 17 | if (!defined('NEWBB_FUNCTIONS_RPC')) { |
@@ -32,16 +32,16 @@ discard block |
||
32 | 32 | } else { |
33 | 33 | $charset = _CHARSET; |
34 | 34 | } |
35 | - header('Content-Type: text/xml; charset="' . $charset . '"'); |
|
35 | + header('Content-Type: text/xml; charset="'.$charset.'"'); |
|
36 | 36 | if ($error) { |
37 | - echo '<?xml version="1.0" encoding="' . $charset . '"?' . ">\n"; |
|
37 | + echo '<?xml version="1.0" encoding="'.$charset.'"?'.">\n"; |
|
38 | 38 | echo '<response>\n'; |
39 | 39 | echo '<error>1</error>\n'; |
40 | 40 | echo '<message>$error_message</message>\n'; |
41 | 41 | echo '</response>'; |
42 | 42 | exit(); |
43 | 43 | } else { |
44 | - echo '<?xml version="1.0" encoding="' . $charset . '"?' . ">\n"; |
|
44 | + echo '<?xml version="1.0" encoding="'.$charset.'"?'.">\n"; |
|
45 | 45 | echo '<response>\n'; |
46 | 46 | echo '<error>0</error>\n'; |
47 | 47 | echo '</response>'; |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | |
22 | 22 | if ((!defined('XOOPS_ROOT_PATH')) || !($GLOBALS['xoopsUser'] instanceof \XoopsUser) |
23 | 23 | || !$GLOBALS['xoopsUser']->IsAdmin()) { |
24 | - exit('Restricted access' . PHP_EOL); |
|
24 | + exit('Restricted access'.PHP_EOL); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | /** |
@@ -82,14 +82,14 @@ discard block |
||
82 | 82 | //delete old HTML templates |
83 | 83 | if (count($configurator->templateFolders) > 0) { |
84 | 84 | foreach ($configurator->templateFolders as $folder) { |
85 | - $templateFolder = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $folder); |
|
85 | + $templateFolder = $GLOBALS['xoops']->path('modules/'.$moduleDirName.$folder); |
|
86 | 86 | if (is_dir($templateFolder)) { |
87 | 87 | $templateList = array_diff(scandir($templateFolder, SCANDIR_SORT_NONE), ['..', '.']); |
88 | 88 | foreach ($templateList as $k => $v) { |
89 | - $fileInfo = new \SplFileInfo($templateFolder . $v); |
|
89 | + $fileInfo = new \SplFileInfo($templateFolder.$v); |
|
90 | 90 | if ('html' === $fileInfo->getExtension() && 'index.html' !== $fileInfo->getFilename()) { |
91 | - if (file_exists($templateFolder . $v)) { |
|
92 | - unlink($templateFolder . $v); |
|
91 | + if (file_exists($templateFolder.$v)) { |
|
92 | + unlink($templateFolder.$v); |
|
93 | 93 | } |
94 | 94 | } |
95 | 95 | } |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | if (count($configurator->oldFiles) > 0) { |
102 | 102 | // foreach (array_keys($GLOBALS['uploadFolders']) as $i) { |
103 | 103 | foreach (array_keys($configurator->oldFiles) as $i) { |
104 | - $tempFile = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $configurator->oldFiles[$i]); |
|
104 | + $tempFile = $GLOBALS['xoops']->path('modules/'.$moduleDirName.$configurator->oldFiles[$i]); |
|
105 | 105 | if (is_file($tempFile)) { |
106 | 106 | unlink($tempFile); |
107 | 107 | } |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | if (count($configurator->oldFolders) > 0) { |
114 | 114 | // foreach (array_keys($GLOBALS['uploadFolders']) as $i) { |
115 | 115 | foreach (array_keys($configurator->oldFolders) as $i) { |
116 | - $tempFolder = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $configurator->oldFolders[$i]); |
|
116 | + $tempFolder = $GLOBALS['xoops']->path('modules/'.$moduleDirName.$configurator->oldFolders[$i]); |
|
117 | 117 | /* @var $folderHandler XoopsObjectHandler */ |
118 | 118 | $folderHandler = \XoopsFile::getHandler('folder', $tempFolder); |
119 | 119 | $folderHandler->delete($tempFolder); |
@@ -130,15 +130,15 @@ discard block |
||
130 | 130 | |
131 | 131 | // --- COPY blank.png FILES --------------- |
132 | 132 | if (count($configurator->copyBlankFiles) > 0) { |
133 | - $file = dirname(__DIR__) . '/assets/images/blank.png'; |
|
133 | + $file = dirname(__DIR__).'/assets/images/blank.png'; |
|
134 | 134 | foreach (array_keys($configurator->copyBlankFiles) as $i) { |
135 | - $dest = $configurator->copyBlankFiles[$i] . '/blank.png'; |
|
135 | + $dest = $configurator->copyBlankFiles[$i].'/blank.png'; |
|
136 | 136 | $utility::copyFile($file, $dest); |
137 | 137 | } |
138 | 138 | } |
139 | 139 | |
140 | 140 | //delete .html entries from the tpl table |
141 | - $sql = 'DELETE FROM ' . $GLOBALS['xoopsDB']->prefix('tplfile') . " WHERE `tpl_module` = '" . $module->getVar('dirname', 'n') . '\' AND `tpl_file` LIKE \'%.html%\''; |
|
141 | + $sql = 'DELETE FROM '.$GLOBALS['xoopsDB']->prefix('tplfile')." WHERE `tpl_module` = '".$module->getVar('dirname', 'n').'\' AND `tpl_file` LIKE \'%.html%\''; |
|
142 | 142 | $GLOBALS['xoopsDB']->queryF($sql); |
143 | 143 | |
144 | 144 | /** @var XoopsGroupPermHandler $grouppermHandler */ |
@@ -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 | require_once $GLOBALS['xoops']->path('footer.php'); |
@@ -34,22 +34,22 @@ discard block |
||
34 | 34 | // Project: Article Project // |
35 | 35 | // ------------------------------------------------------------------------ // |
36 | 36 | |
37 | -require_once __DIR__ . '/header.php'; |
|
37 | +require_once __DIR__.'/header.php'; |
|
38 | 38 | xoops_loadLanguage('search'); |
39 | 39 | /** @var \XoopsConfigHandler $configHandler */ |
40 | 40 | $configHandler = xoops_getHandler('config'); |
41 | 41 | $xoopsConfigSearch = $configHandler->getConfigsByCat(XOOPS_CONF_SEARCH); |
42 | 42 | if (1 !== $xoopsConfigSearch['enable_search']) { |
43 | - redirect_header(XOOPS_URL . '/modules/newbb/index.php', 2, _MD_NEWBB_SEARCHDISABLED); |
|
43 | + redirect_header(XOOPS_URL.'/modules/newbb/index.php', 2, _MD_NEWBB_SEARCHDISABLED); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | $GLOBALS['xoopsConfig']['module_cache'][$xoopsModule->getVar('mid')] = 0; |
47 | 47 | $xoopsOption['template_main'] = 'newbb_search.tpl'; |
48 | 48 | require_once $GLOBALS['xoops']->path('header.php'); |
49 | 49 | |
50 | -require_once __DIR__ . '/include/functions.render.php'; |
|
51 | -require_once __DIR__ . '/include/functions.forum.php'; |
|
52 | -require_once __DIR__ . '/include/functions.time.php'; |
|
50 | +require_once __DIR__.'/include/functions.render.php'; |
|
51 | +require_once __DIR__.'/include/functions.forum.php'; |
|
52 | +require_once __DIR__.'/include/functions.time.php'; |
|
53 | 53 | |
54 | 54 | require_once $GLOBALS['xoops']->path('modules/newbb/include/search.inc.php'); |
55 | 55 | $limit = $GLOBALS['xoopsModuleConfig']['topics_per_page']; |
@@ -118,8 +118,8 @@ discard block |
||
118 | 118 | if (!empty($search_username)) { |
119 | 119 | $uname_required = true; |
120 | 120 | $search_username = $GLOBALS['xoopsDB']->escape($search_username); |
121 | - if (!$result = $GLOBALS['xoopsDB']->query('SELECT uid FROM ' . $GLOBALS['xoopsDB']->prefix('users') . " WHERE uname LIKE '%$search_username%'")) { |
|
122 | - redirect_header(XOOPS_URL . '/search.php', 1, _MD_NEWBB_ERROROCCURED); |
|
121 | + if (!$result = $GLOBALS['xoopsDB']->query('SELECT uid FROM '.$GLOBALS['xoopsDB']->prefix('users')." WHERE uname LIKE '%$search_username%'")) { |
|
122 | + redirect_header(XOOPS_URL.'/search.php', 1, _MD_NEWBB_ERROROCCURED); |
|
123 | 123 | } |
124 | 124 | $uid = []; |
125 | 125 | while (false !== ($row = $GLOBALS['xoopsDB']->fetchArray($result))) { |
@@ -144,12 +144,12 @@ discard block |
||
144 | 144 | } |
145 | 145 | } |
146 | 146 | if (!$uname_required && 0 === count($queries)) { |
147 | - redirect_header(XOOPS_URL . '/search.php', 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min'])); |
|
147 | + redirect_header(XOOPS_URL.'/search.php', 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min'])); |
|
148 | 148 | } |
149 | 149 | } else { |
150 | 150 | //$query = trim($query); |
151 | 151 | if (!$uname_required && (strlen($query) < $xoopsConfigSearch['keyword_min'])) { |
152 | - redirect_header(XOOPS_URL . '/search.php', 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min'])); |
|
152 | + redirect_header(XOOPS_URL.'/search.php', 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min'])); |
|
153 | 153 | } |
154 | 154 | $queries = [$query]; |
155 | 155 | } |
@@ -212,14 +212,14 @@ discard block |
||
212 | 212 | if (count($next_search) > 0) { |
213 | 213 | $items = []; |
214 | 214 | foreach ($next_search as $para => $val) { |
215 | - $items[] = "{$para}=" . urlencode($val); |
|
215 | + $items[] = "{$para}=".urlencode($val); |
|
216 | 216 | } |
217 | 217 | if (count($items) > 0) { |
218 | 218 | $paras = implode('&', $items); |
219 | 219 | } |
220 | 220 | unset($next_search, $items); |
221 | 221 | } |
222 | - $search_url = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/search.php?' . $paras; |
|
222 | + $search_url = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/search.php?'.$paras; |
|
223 | 223 | // irmtfan remove to have just one query and appropriate next and prev links |
224 | 224 | //$next_results = newbb_search($queries, $andor, 1, $start + $limit, $uid, $forum, $sortby, $searchin, $subquery); |
225 | 225 | //$next_count = count($next_results); |
@@ -231,15 +231,15 @@ discard block |
||
231 | 231 | if ($num_results == $limit) { |
232 | 232 | $next = $start + $limit; |
233 | 233 | $queries = implode(',', $queries); |
234 | - $search_url_next = htmlspecialchars($search_url . "&direction=next&start={$next}", ENT_QUOTES | ENT_HTML5); |
|
235 | - $search_next = '<a href="' . $search_url_next . '">' . _SR_NEXT . '</a>'; |
|
234 | + $search_url_next = htmlspecialchars($search_url."&direction=next&start={$next}", ENT_QUOTES | ENT_HTML5); |
|
235 | + $search_next = '<a href="'.$search_url_next.'">'._SR_NEXT.'</a>'; |
|
236 | 236 | $xoopsTpl->assign('search_next', $search_next); |
237 | 237 | $xoopsTpl->assign('search_next_url', $search_url_next); |
238 | 238 | } |
239 | 239 | if ($start > 0) { |
240 | 240 | $prev = $start - $limit; |
241 | - $search_url_prev = htmlspecialchars($search_url . "&direction=previous&start={$prev}", ENT_QUOTES | ENT_HTML5); |
|
242 | - $search_prev = '<a href="' . $search_url_prev . '">' . _SR_PREVIOUS . '</a>'; |
|
241 | + $search_url_prev = htmlspecialchars($search_url."&direction=previous&start={$prev}", ENT_QUOTES | ENT_HTML5); |
|
242 | + $search_prev = '<a href="'.$search_url_prev.'">'._SR_PREVIOUS.'</a>'; |
|
243 | 243 | $xoopsTpl->assign('search_prev', $search_prev); |
244 | 244 | $xoopsTpl->assign('search_prev_url', $search_url_prev); |
245 | 245 | } |
@@ -250,18 +250,18 @@ discard block |
||
250 | 250 | redirect_header($search_url_redirect, 1, constant(strtoupper("_SR_{$direction}"))); |
251 | 251 | } |
252 | 252 | } |
253 | - $search_info = _SR_KEYWORDS . ': ' . $search_info_keywords; |
|
253 | + $search_info = _SR_KEYWORDS.': '.$search_info_keywords; |
|
254 | 254 | if ($uname_required) { |
255 | 255 | if ($search_info) { |
256 | 256 | $search_info .= '<br>'; |
257 | 257 | } |
258 | - $search_info .= _MD_NEWBB_USERNAME . ': ' . $myts->htmlSpecialChars($search_username); |
|
258 | + $search_info .= _MD_NEWBB_USERNAME.': '.$myts->htmlSpecialChars($search_username); |
|
259 | 259 | } |
260 | 260 | // add num_results |
261 | - $search_info .= '<br>' . sprintf(_SR_SHOWING, $start + 1, $start + $num_results); |
|
261 | + $search_info .= '<br>'.sprintf(_SR_SHOWING, $start + 1, $start + $num_results); |
|
262 | 262 | // if any result skip show the counter |
263 | 263 | if (!empty($skipresults)) { |
264 | - $search_info .= ' - ' . sprintf(_SR_FOUND, $num_results - $skipresults); |
|
264 | + $search_info .= ' - '.sprintf(_SR_FOUND, $num_results - $skipresults); |
|
265 | 265 | } |
266 | 266 | $xoopsTpl->assign('search_info', $search_info); |
267 | 267 | } |
@@ -275,18 +275,18 @@ discard block |
||
275 | 275 | if ('OR' === $andor) { |
276 | 276 | $andor_select .= ' selected="selected"'; |
277 | 277 | } |
278 | -$andor_select .= '>' . _SR_ANY . '</option>'; |
|
278 | +$andor_select .= '>'._SR_ANY.'</option>'; |
|
279 | 279 | $andor_select .= '<option value="AND"'; |
280 | 280 | if ('AND' === $andor || empty($andor)) { |
281 | 281 | $andor_select .= ' selected="selected"'; |
282 | 282 | } |
283 | -$andor_select .= '>' . _SR_ALL . '</option>'; |
|
283 | +$andor_select .= '>'._SR_ALL.'</option>'; |
|
284 | 284 | $andor_select .= '</select>'; |
285 | 285 | $xoopsTpl->assign('andor_selection_box', $andor_select); |
286 | 286 | |
287 | 287 | /* forum */ |
288 | 288 | $select_forum = '<select class="form-control" name="forum[]" id="forum" size="5" multiple="multiple">'; |
289 | -$select_forum .= '<option value="all">' . _MD_NEWBB_SEARCHALLFORUMS . '</option>'; |
|
289 | +$select_forum .= '<option value="all">'._MD_NEWBB_SEARCHALLFORUMS.'</option>'; |
|
290 | 290 | $select_forum .= newbbForumSelectBox($forum); |
291 | 291 | $select_forum .= '</select>'; |
292 | 292 | $xoopsTpl->assign_by_ref('forum_selection_box', $select_forum); |
@@ -297,17 +297,17 @@ discard block |
||
297 | 297 | if ('title' === $searchin) { |
298 | 298 | $searchin_select .= ' checked'; |
299 | 299 | } |
300 | -$searchin_select .= ' />' . _MD_NEWBB_SUBJECT . ' </label>'; |
|
300 | +$searchin_select .= ' />'._MD_NEWBB_SUBJECT.' </label>'; |
|
301 | 301 | $searchin_select .= '<label class="radio-inline"><input type="radio" name="searchin" value="text"'; |
302 | 302 | if ('text' === $searchin) { |
303 | 303 | $searchin_select .= ' checked'; |
304 | 304 | } |
305 | -$searchin_select .= ' />' . _MD_NEWBB_BODY . ' </label>'; |
|
305 | +$searchin_select .= ' />'._MD_NEWBB_BODY.' </label>'; |
|
306 | 306 | $searchin_select .= '<label class="radio-inline"><input type="radio" name="searchin" value="both"'; |
307 | 307 | if ('both' === $searchin || empty($searchin)) { |
308 | 308 | $searchin_select .= ' checked'; |
309 | 309 | } |
310 | -$searchin_select .= ' />' . _MD_NEWBB_SUBJECT . ' & ' . _MD_NEWBB_BODY . ' </label>'; |
|
310 | +$searchin_select .= ' />'._MD_NEWBB_SUBJECT.' & '._MD_NEWBB_BODY.' </label>'; |
|
311 | 311 | $xoopsTpl->assign('searchin_radio', $searchin_select); |
312 | 312 | |
313 | 313 | /* show_search */ |
@@ -316,12 +316,12 @@ discard block |
||
316 | 316 | if ('post' === $show_search) { |
317 | 317 | $show_search_select .= ' checked'; |
318 | 318 | } |
319 | -$show_search_select .= ' />' . _MD_NEWBB_POSTS . ' </label>'; |
|
319 | +$show_search_select .= ' />'._MD_NEWBB_POSTS.' </label>'; |
|
320 | 320 | $show_search_select .= '<label class="radio-inline"><input type="radio" name="show_search" value="post_text"'; |
321 | 321 | if ('post_text' === $show_search || empty($show_search)) { |
322 | 322 | $show_search_select .= ' checked'; |
323 | 323 | } |
324 | -$show_search_select .= ' />' . _MD_NEWBB_SEARCHPOSTTEXT . ' </label>'; |
|
324 | +$show_search_select .= ' />'._MD_NEWBB_SEARCHPOSTTEXT.' </label>'; |
|
325 | 325 | $xoopsTpl->assign('show_search_radio', $show_search_select); |
326 | 326 | |
327 | 327 | /* author */ |
@@ -333,12 +333,12 @@ discard block |
||
333 | 333 | if ('p.post_time' === $sortby || empty($sortby)) { |
334 | 334 | $sortby_select .= ' selected=\'selected\''; |
335 | 335 | } |
336 | -$sortby_select .= '>' . _MD_NEWBB_DATE . '</option>'; |
|
336 | +$sortby_select .= '>'._MD_NEWBB_DATE.'</option>'; |
|
337 | 337 | $sortby_select .= '<option value=\'p.subject\''; |
338 | 338 | if ('p.subject' === $sortby) { |
339 | 339 | $sortby_select .= ' selected="selected"'; |
340 | 340 | } |
341 | -$sortby_select .= '>' . _MD_NEWBB_TOPIC . '</option>'; |
|
341 | +$sortby_select .= '>'._MD_NEWBB_TOPIC.'</option>'; |
|
342 | 342 | $sortby_select .= '</select>'; |
343 | 343 | $xoopsTpl->assign('sortby_selection_box', $sortby_select); |
344 | 344 | |
@@ -354,5 +354,5 @@ discard block |
||
354 | 354 | $xoopsTpl->assign('search_rule', sprintf(_SR_KEYIGNORE, $xoopsConfigSearch['keyword_min'])); |
355 | 355 | } |
356 | 356 | // irmtfan move to footer.php |
357 | -require_once __DIR__ . '/footer.php'; |
|
357 | +require_once __DIR__.'/footer.php'; |
|
358 | 358 | require_once $GLOBALS['xoops']->path('footer.php'); |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | use Xmf\Request; |
33 | 33 | use XoopsModules\Newbb; |
34 | 34 | |
35 | -require_once __DIR__ . '/header.php'; |
|
35 | +require_once __DIR__.'/header.php'; |
|
36 | 36 | |
37 | 37 | $forum = Request::getInt('forum', 0, 'GET'); |
38 | 38 | $topic_id = Request::getInt('topic_id', 0, 'GET'); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | |
66 | 66 | $forumObject = $forumHandler->get($forum); |
67 | 67 | if (!$forumHandler->getPermission($forumObject)) { |
68 | - redirect_header(XOOPS_URL . '/index.php', 2, _MD_NEWBB_NORIGHTTOACCESS); |
|
68 | + redirect_header(XOOPS_URL.'/index.php', 2, _MD_NEWBB_NORIGHTTOACCESS); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | $topicObject = $topicHandler->get($topic_id); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $query_array = []; |
79 | 79 | foreach ($query_vars as $var) { |
80 | 80 | if (Request::getString($var, '', 'GET')) { |
81 | - $query_array[$var] = "{$var}=" . Request::getString($var, '', 'GET'); |
|
81 | + $query_array[$var] = "{$var}=".Request::getString($var, '', 'GET'); |
|
82 | 82 | } |
83 | 83 | } |
84 | 84 | $page_query = htmlspecialchars(implode('&', array_values($query_array)), ENT_QUOTES | ENT_HTML5); |
@@ -133,8 +133,8 @@ discard block |
||
133 | 133 | $r_subject = $postParentObject->getVar('subject', 'E'); |
134 | 134 | |
135 | 135 | $subject = $r_subject; |
136 | -if (!preg_match('/^(Re|' . _MD_NEWBB_RE . '):/i', $r_subject)) { |
|
137 | - $subject = _MD_NEWBB_RE . ': ' . $r_subject; |
|
136 | +if (!preg_match('/^(Re|'._MD_NEWBB_RE.'):/i', $r_subject)) { |
|
137 | + $subject = _MD_NEWBB_RE.': '.$r_subject; |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | $q_message = $postParentObject->getVar('post_text', 'e'); |
@@ -143,12 +143,12 @@ discard block |
||
143 | 143 | if (1 === Request::getInt('quotedac', 0, 'GET')) { |
144 | 144 | $message = "[quote]\n"; |
145 | 145 | $message .= sprintf(_MD_NEWBB_USERWROTE, $r_name); |
146 | - $message .= "\n" . $q_message . '[/quote]'; |
|
146 | + $message .= "\n".$q_message.'[/quote]'; |
|
147 | 147 | $hidden = ''; |
148 | 148 | } else { |
149 | 149 | $hidden = "[quote]\n"; |
150 | 150 | $hidden .= sprintf(_MD_NEWBB_USERWROTE, $r_name); |
151 | - $hidden .= "\n" . $q_message . '[/quote]'; |
|
151 | + $hidden .= "\n".$q_message.'[/quote]'; |
|
152 | 152 | $message = ''; |
153 | 153 | } |
154 | 154 | } else { |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | $post_karma = 0; |
168 | 168 | $require_reply = 0; |
169 | 169 | |
170 | -require_once __DIR__ . '/include/form.post.php'; |
|
170 | +require_once __DIR__.'/include/form.post.php'; |
|
171 | 171 | |
172 | 172 | ///** @var Newbb\KarmaHandler $karmaHandler */ |
173 | 173 | //$karmaHandler = Newbb\Helper::getInstance()->getHandler('Karma'); |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | foreach ($posts_contextObject as $post_contextObject) { |
181 | 181 | // Sorry, in order to save queries, we have to hide the non-open post_text even if you have replied or have adequate karma, even an admin. |
182 | 182 | if ($GLOBALS['xoopsModuleConfig']['enable_karma'] && $post_contextObject->getVar('post_karma') > 0) { |
183 | - $p_message = sprintf(_MD_NEWBB_KARMA_REQUIREMENT, '***', $post_contextObject->getVar('post_karma')) . '</div>'; |
|
183 | + $p_message = sprintf(_MD_NEWBB_KARMA_REQUIREMENT, '***', $post_contextObject->getVar('post_karma')).'</div>'; |
|
184 | 184 | } elseif ($GLOBALS['xoopsModuleConfig']['allow_require_reply'] && $post_contextObject->getVar('require_reply')) { |
185 | 185 | $p_message = _MD_NEWBB_REPLY_REQUIREMENT; |
186 | 186 | } else { |
@@ -198,11 +198,11 @@ discard block |
||
198 | 198 | |
199 | 199 | $posts_context[] = [ |
200 | 200 | 'subject' => $p_subject, |
201 | - 'meta' => _MD_NEWBB_BY . ' ' . $p_name . ' ' . _MD_NEWBB_ON . ' ' . $p_date, |
|
201 | + 'meta' => _MD_NEWBB_BY.' '.$p_name.' '._MD_NEWBB_ON.' '.$p_date, |
|
202 | 202 | 'content' => $p_message |
203 | 203 | ]; |
204 | 204 | } |
205 | 205 | $xoopsTpl->assign_by_ref('posts_context', $posts_context); |
206 | 206 | // irmtfan move to footer.php |
207 | -require_once __DIR__ . '/footer.php'; |
|
207 | +require_once __DIR__.'/footer.php'; |
|
208 | 208 | require_once $GLOBALS['xoops']->path('footer.php'); |