@@ -17,37 +17,37 @@ |
||
17 | 17 | define('NEWBB_FUNCTIONS_CONFIG_LOADED', true); |
18 | 18 | |
19 | 19 | if (!defined('NEWBB_FUNCTIONS_CONFIG')) { |
20 | - define('NEWBB_FUNCTIONS_CONFIG', 1); |
|
21 | - |
|
22 | - /** |
|
23 | - * @return array |
|
24 | - * @internal param string $category |
|
25 | - * @internal param string $dirname |
|
26 | - */ |
|
27 | - function newbbLoadConfig() |
|
28 | - { |
|
20 | + define('NEWBB_FUNCTIONS_CONFIG', 1); |
|
21 | + |
|
22 | + /** |
|
23 | + * @return array |
|
24 | + * @internal param string $category |
|
25 | + * @internal param string $dirname |
|
26 | + */ |
|
27 | + function newbbLoadConfig() |
|
28 | + { |
|
29 | 29 | // require_once dirname(__DIR__) . '/class/Helper.php'; |
30 | - //$helper = NewBB::getInstance(); |
|
31 | - /** @var Newbb\Helper $helper */ |
|
32 | - $helper = Newbb\Helper::getInstance(); |
|
33 | - static $configs = null; |
|
34 | - |
|
35 | - if (null !== $configs) { |
|
36 | - return $configs; |
|
37 | - } |
|
38 | - |
|
39 | - $configs = is_object($helper) ? $helper->getConfig() : []; |
|
40 | - $plugins = require_once __DIR__ . '/plugin.php'; |
|
41 | - if (is_array($configs) && is_array($plugins)) { |
|
42 | - $configs = array_merge($configs, $plugins); |
|
43 | - } |
|
44 | - if (!isset($GLOBALS['xoopsModuleConfig'])) { |
|
45 | - $GLOBALS['xoopsModuleConfig'] = []; |
|
46 | - } |
|
47 | - if (is_array($configs)) { |
|
48 | - $GLOBALS['xoopsModuleConfig'] = array_merge($GLOBALS['xoopsModuleConfig'], $configs); |
|
49 | - } |
|
50 | - |
|
51 | - return $configs; |
|
52 | - } |
|
30 | + //$helper = NewBB::getInstance(); |
|
31 | + /** @var Newbb\Helper $helper */ |
|
32 | + $helper = Newbb\Helper::getInstance(); |
|
33 | + static $configs = null; |
|
34 | + |
|
35 | + if (null !== $configs) { |
|
36 | + return $configs; |
|
37 | + } |
|
38 | + |
|
39 | + $configs = is_object($helper) ? $helper->getConfig() : []; |
|
40 | + $plugins = require_once __DIR__ . '/plugin.php'; |
|
41 | + if (is_array($configs) && is_array($plugins)) { |
|
42 | + $configs = array_merge($configs, $plugins); |
|
43 | + } |
|
44 | + if (!isset($GLOBALS['xoopsModuleConfig'])) { |
|
45 | + $GLOBALS['xoopsModuleConfig'] = []; |
|
46 | + } |
|
47 | + if (is_array($configs)) { |
|
48 | + $GLOBALS['xoopsModuleConfig'] = array_merge($GLOBALS['xoopsModuleConfig'], $configs); |
|
49 | + } |
|
50 | + |
|
51 | + return $configs; |
|
52 | + } |
|
53 | 53 | } |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | |
14 | 14 | use XoopsModules\Newbb; |
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_CONFIG_LOADED', true); |
18 | 18 | |
19 | 19 | if (!defined('NEWBB_FUNCTIONS_CONFIG')) { |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | } |
38 | 38 | |
39 | 39 | $configs = is_object($helper) ? $helper->getConfig() : []; |
40 | - $plugins = require_once __DIR__ . '/plugin.php'; |
|
40 | + $plugins = require_once __DIR__.'/plugin.php'; |
|
41 | 41 | if (is_array($configs) && is_array($plugins)) { |
42 | 42 | $configs = array_merge($configs, $plugins); |
43 | 43 | } |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | $mode = Request::getInt('mode', 1, 'GET'); |
24 | 24 | |
25 | 25 | if (0 === count($post_id) || 0 === count($op)) { |
26 | - // irmtfan - issue with javascript:history.go(-1) |
|
27 | - redirect_header(Request::getString('HTTP_REFERER', '', 'SERVER'), 2, _MD_NEWBB_NO_SELECTION); |
|
26 | + // irmtfan - issue with javascript:history.go(-1) |
|
27 | + redirect_header(Request::getString('HTTP_REFERER', '', 'SERVER'), 2, _MD_NEWBB_NO_SELECTION); |
|
28 | 28 | } |
29 | 29 | ///** @var PostHandler $postHandler */ |
30 | 30 | //$postHandler = Newbb\Helper::getInstance()->getHandler('Post'); |
@@ -33,199 +33,199 @@ discard block |
||
33 | 33 | ///** @var NewbbForumHandler $forumHandler */ |
34 | 34 | //$forumHandler = Newbb\Helper::getInstance()->getHandler('Forum'); |
35 | 35 | if (empty($topic_id)) { |
36 | - $forumObject = null; |
|
36 | + $forumObject = null; |
|
37 | 37 | } else { |
38 | - $topicObject = $topicHandler->get($topic_id); |
|
39 | - $forum_id = $topicObject->getVar('forum_id'); |
|
40 | - $forumObject = $forumHandler->get($forum_id); |
|
38 | + $topicObject = $topicHandler->get($topic_id); |
|
39 | + $forum_id = $topicObject->getVar('forum_id'); |
|
40 | + $forumObject = $forumHandler->get($forum_id); |
|
41 | 41 | } |
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) { |
49 | - case 'restore': |
|
50 | - $post_id = array_values($post_id); |
|
51 | - sort($post_id); |
|
52 | - $topics = []; |
|
53 | - $forums = []; |
|
54 | - foreach ($post_id as $post) { |
|
55 | - $postObject = $postHandler->get($post); |
|
56 | - if ($postObject->getVar('topic_id') < 1) { |
|
57 | - continue; |
|
58 | - } |
|
59 | - |
|
60 | - $postHandler->approve($postObject, true); |
|
61 | - $topics[$postObject->getVar('topic_id')] = 1; |
|
62 | - $forums[$postObject->getVar('forum_id')] = 1; |
|
63 | - unset($postObject); |
|
64 | - } |
|
65 | - foreach (array_keys($topics) as $topic) { |
|
66 | - $topicHandler->synchronization($topic); |
|
67 | - } |
|
68 | - foreach (array_keys($forums) as $forum) { |
|
69 | - $forumHandler->synchronization($forum); |
|
70 | - } |
|
71 | - break; |
|
72 | - case 'approve': |
|
73 | - $post_id = array_values($post_id); |
|
74 | - sort($post_id); |
|
75 | - $topics = []; |
|
76 | - $forums = []; |
|
77 | - $criteria = new \Criteria('post_id', '(' . implode(',', $post_id) . ')', 'IN'); |
|
78 | - $postsObject = $postHandler->getObjects($criteria, true); |
|
79 | - foreach ($post_id as $post) { |
|
80 | - /** @var Newbb\Post $postObject */ |
|
81 | - $postObject = $postsObject[$post]; |
|
82 | - if (!empty($topic_id) && $topic_id !== $postObject->getVar('topic_id')) { |
|
83 | - continue; |
|
84 | - } |
|
85 | - $postHandler->approve($postObject); |
|
86 | - $topics[$postObject->getVar('topic_id')] = $post; |
|
87 | - $forums[$postObject->getVar('forum_id')] = 1; |
|
88 | - } |
|
89 | - foreach (array_keys($topics) as $topic) { |
|
90 | - $topicHandler->synchronization($topic); |
|
91 | - } |
|
92 | - foreach (array_keys($forums) as $forum) { |
|
93 | - $forumHandler->synchronization($forum); |
|
94 | - } |
|
95 | - |
|
96 | - if (empty($GLOBALS['xoopsModuleConfig']['notification_enabled'])) { |
|
97 | - break; |
|
98 | - } |
|
99 | - |
|
100 | - $criteria_topic = new \Criteria('topic_id', '(' . implode(',', array_keys($topics)) . ')', 'IN'); |
|
101 | - $topic_list = $topicHandler->getList($criteria_topic, true); |
|
102 | - |
|
103 | - $criteria_forum = new \Criteria('forum_id', '(' . implode(',', array_keys($forums)) . ')', 'IN'); |
|
104 | - $forum_list = $forumHandler->getList($criteria_forum); |
|
105 | - |
|
106 | - require_once __DIR__ . '/include/notification.inc.php'; |
|
107 | - /** @var \XoopsNotificationHandler $notificationHandler */ |
|
108 | - $notificationHandler = xoops_getHandler('notification'); |
|
109 | - foreach ($post_id as $post) { |
|
110 | - $tags = []; |
|
111 | - /** @var Newbb\Post[] $postsObject [$post] */ |
|
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'); |
|
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; |
|
117 | - $notificationHandler->triggerEvent('thread', $postsObject[$post]->getVar('topic_id'), 'new_post', $tags); |
|
118 | - $notificationHandler->triggerEvent('forum', $postsObject[$post]->getVar('forum_id'), 'new_post', $tags); |
|
119 | - $notificationHandler->triggerEvent('global', 0, 'new_post', $tags); |
|
120 | - $tags['POST_CONTENT'] = $postsObject[$post]->getVar('post_text'); |
|
121 | - $tags['POST_NAME'] = $postsObject[$post]->getVar('subject'); |
|
122 | - $notificationHandler->triggerEvent('global', 0, 'new_fullpost', $tags); |
|
123 | - $notificationHandler->triggerEvent('forum', $postsObject[$post]->getVar('forum_id'), 'new_fullpost', $tags); |
|
124 | - } |
|
125 | - break; |
|
126 | - case 'delete': |
|
127 | - $post_id = array_values($post_id); |
|
128 | - rsort($post_id); |
|
129 | - $topics = []; |
|
130 | - $forums = []; |
|
131 | - foreach ($post_id as $post) { |
|
132 | - $postObject = $postHandler->get($post); |
|
133 | - if (!empty($topic_id) && $topic_id !== $postObject->getVar('topic_id')) { |
|
134 | - continue; |
|
135 | - } |
|
136 | - $topics[$postObject->getVar('topic_id')] = 1; |
|
137 | - $forums[$postObject->getVar('forum_id')] = 1; |
|
138 | - $postHandler->delete($postObject, true); |
|
139 | - unset($postObject); |
|
140 | - } |
|
141 | - foreach (array_keys($topics) as $topic) { |
|
142 | - $topicHandler->synchronization($topic); |
|
143 | - } |
|
144 | - foreach (array_keys($forums) as $forum) { |
|
145 | - $forumHandler->synchronization($forum); |
|
146 | - } |
|
147 | - break; |
|
148 | - case 'split': |
|
149 | - /** @var Newbb\Post $postObject */ |
|
150 | - $postObject = $postHandler->get($post_id); |
|
151 | - if (0 === count($post_id) || $postObject->isTopic()) { |
|
152 | - break; |
|
153 | - } |
|
154 | - $topic_id = $postObject->getVar('topic_id'); |
|
155 | - |
|
156 | - $newtopic = $topicHandler->create(); |
|
157 | - $newtopic->setVar('topic_title', $postObject->getVar('subject'), true); |
|
158 | - $newtopic->setVar('topic_poster', $postObject->getVar('uid'), true); |
|
159 | - $newtopic->setVar('forum_id', $postObject->getVar('forum_id'), true); |
|
160 | - $newtopic->setVar('topic_time', $postObject->getVar('post_time'), true); |
|
161 | - $newtopic->setVar('poster_name', $postObject->getVar('poster_name'), true); |
|
162 | - $newtopic->setVar('approved', 1, true); |
|
163 | - $topicHandler->insert($newtopic, true); |
|
164 | - $new_topic_id = $newtopic->getVar('topic_id'); |
|
165 | - |
|
166 | - $pid = $postObject->getVar('pid'); |
|
167 | - |
|
168 | - $postObject->setVar('topic_id', $new_topic_id, true); |
|
169 | - $postObject->setVar('pid', 0, true); |
|
170 | - $postHandler->insert($postObject); |
|
171 | - |
|
172 | - /* split a single post */ |
|
173 | - if (1 === $mode) { |
|
174 | - $criteria = new \CriteriaCompo(new \Criteria('topic_id', $topic_id)); |
|
175 | - $criteria->add(new \Criteria('pid', $post_id)); |
|
176 | - $postHandler->updateAll('pid', $pid, $criteria, true); |
|
177 | - /* split a post and its children posts */ |
|
178 | - } elseif (2 === $mode) { |
|
179 | - require_once $GLOBALS['xoops']->path('class/xoopstree.php'); |
|
180 | - $mytree = new \XoopsTree($GLOBALS['xoopsDB']->prefix('newbb_posts'), 'post_id', 'pid'); |
|
181 | - $posts = $mytree->getAllChildId($post_id); |
|
182 | - if (count($posts) > 0) { |
|
183 | - $criteria = new \Criteria('post_id', '(' . implode(',', $posts) . ')', 'IN'); |
|
184 | - $postHandler->updateAll('topic_id', $new_topic_id, $criteria, true); |
|
185 | - } |
|
186 | - /* split a post and all posts coming after */ |
|
187 | - } elseif (3 === $mode) { |
|
188 | - $criteria = new \CriteriaCompo(new \Criteria('topic_id', $topic_id)); |
|
189 | - $criteria->add(new \Criteria('post_id', $post_id, '>')); |
|
190 | - $postHandler->updateAll('topic_id', $new_topic_id, $criteria, true); |
|
191 | - |
|
192 | - unset($criteria); |
|
193 | - $criteria = new \CriteriaCompo(new \Criteria('topic_id', $new_topic_id)); |
|
194 | - $criteria->add(new \Criteria('post_id', $post_id, '>')); |
|
195 | - $postHandler->identifierName = 'pid'; |
|
196 | - $posts = $postHandler->getList($criteria); |
|
197 | - |
|
198 | - unset($criteria); |
|
199 | - $post_update = []; |
|
200 | - foreach ($posts as $postid => $pid) { |
|
201 | - // if (!in_array($pid, array_keys($posts))) { |
|
202 | - if (!array_key_exists($pid, $posts)) { |
|
203 | - $post_update[] = $pid; |
|
204 | - } |
|
205 | - if (!array_key_exists($pid, $posts)) { |
|
206 | - $post_update2[] = $pid; |
|
207 | - } |
|
208 | - } |
|
209 | - if (count($post_update)) { |
|
210 | - $criteria = new \Criteria('post_id', '(' . implode(',', $post_update) . ')', 'IN'); |
|
211 | - $postHandler->updateAll('pid', $post_id, $criteria, true); |
|
212 | - } |
|
213 | - } |
|
214 | - |
|
215 | - $forum_id = $postObject->getVar('forum_id'); |
|
216 | - $topicHandler->synchronization($topic_id); |
|
217 | - $topicHandler->synchronization($new_topic_id); |
|
218 | - $sql = sprintf('UPDATE "%s" SET forum_topics = forum_topics+1 WHERE forum_id = "%u"', $GLOBALS['xoopsDB']->prefix('newbb_forums'), $forum_id); |
|
219 | - $result = $GLOBALS['xoopsDB']->queryF($sql); |
|
220 | - |
|
221 | - break; |
|
49 | + case 'restore': |
|
50 | + $post_id = array_values($post_id); |
|
51 | + sort($post_id); |
|
52 | + $topics = []; |
|
53 | + $forums = []; |
|
54 | + foreach ($post_id as $post) { |
|
55 | + $postObject = $postHandler->get($post); |
|
56 | + if ($postObject->getVar('topic_id') < 1) { |
|
57 | + continue; |
|
58 | + } |
|
59 | + |
|
60 | + $postHandler->approve($postObject, true); |
|
61 | + $topics[$postObject->getVar('topic_id')] = 1; |
|
62 | + $forums[$postObject->getVar('forum_id')] = 1; |
|
63 | + unset($postObject); |
|
64 | + } |
|
65 | + foreach (array_keys($topics) as $topic) { |
|
66 | + $topicHandler->synchronization($topic); |
|
67 | + } |
|
68 | + foreach (array_keys($forums) as $forum) { |
|
69 | + $forumHandler->synchronization($forum); |
|
70 | + } |
|
71 | + break; |
|
72 | + case 'approve': |
|
73 | + $post_id = array_values($post_id); |
|
74 | + sort($post_id); |
|
75 | + $topics = []; |
|
76 | + $forums = []; |
|
77 | + $criteria = new \Criteria('post_id', '(' . implode(',', $post_id) . ')', 'IN'); |
|
78 | + $postsObject = $postHandler->getObjects($criteria, true); |
|
79 | + foreach ($post_id as $post) { |
|
80 | + /** @var Newbb\Post $postObject */ |
|
81 | + $postObject = $postsObject[$post]; |
|
82 | + if (!empty($topic_id) && $topic_id !== $postObject->getVar('topic_id')) { |
|
83 | + continue; |
|
84 | + } |
|
85 | + $postHandler->approve($postObject); |
|
86 | + $topics[$postObject->getVar('topic_id')] = $post; |
|
87 | + $forums[$postObject->getVar('forum_id')] = 1; |
|
88 | + } |
|
89 | + foreach (array_keys($topics) as $topic) { |
|
90 | + $topicHandler->synchronization($topic); |
|
91 | + } |
|
92 | + foreach (array_keys($forums) as $forum) { |
|
93 | + $forumHandler->synchronization($forum); |
|
94 | + } |
|
95 | + |
|
96 | + if (empty($GLOBALS['xoopsModuleConfig']['notification_enabled'])) { |
|
97 | + break; |
|
98 | + } |
|
99 | + |
|
100 | + $criteria_topic = new \Criteria('topic_id', '(' . implode(',', array_keys($topics)) . ')', 'IN'); |
|
101 | + $topic_list = $topicHandler->getList($criteria_topic, true); |
|
102 | + |
|
103 | + $criteria_forum = new \Criteria('forum_id', '(' . implode(',', array_keys($forums)) . ')', 'IN'); |
|
104 | + $forum_list = $forumHandler->getList($criteria_forum); |
|
105 | + |
|
106 | + require_once __DIR__ . '/include/notification.inc.php'; |
|
107 | + /** @var \XoopsNotificationHandler $notificationHandler */ |
|
108 | + $notificationHandler = xoops_getHandler('notification'); |
|
109 | + foreach ($post_id as $post) { |
|
110 | + $tags = []; |
|
111 | + /** @var Newbb\Post[] $postsObject [$post] */ |
|
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'); |
|
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; |
|
117 | + $notificationHandler->triggerEvent('thread', $postsObject[$post]->getVar('topic_id'), 'new_post', $tags); |
|
118 | + $notificationHandler->triggerEvent('forum', $postsObject[$post]->getVar('forum_id'), 'new_post', $tags); |
|
119 | + $notificationHandler->triggerEvent('global', 0, 'new_post', $tags); |
|
120 | + $tags['POST_CONTENT'] = $postsObject[$post]->getVar('post_text'); |
|
121 | + $tags['POST_NAME'] = $postsObject[$post]->getVar('subject'); |
|
122 | + $notificationHandler->triggerEvent('global', 0, 'new_fullpost', $tags); |
|
123 | + $notificationHandler->triggerEvent('forum', $postsObject[$post]->getVar('forum_id'), 'new_fullpost', $tags); |
|
124 | + } |
|
125 | + break; |
|
126 | + case 'delete': |
|
127 | + $post_id = array_values($post_id); |
|
128 | + rsort($post_id); |
|
129 | + $topics = []; |
|
130 | + $forums = []; |
|
131 | + foreach ($post_id as $post) { |
|
132 | + $postObject = $postHandler->get($post); |
|
133 | + if (!empty($topic_id) && $topic_id !== $postObject->getVar('topic_id')) { |
|
134 | + continue; |
|
135 | + } |
|
136 | + $topics[$postObject->getVar('topic_id')] = 1; |
|
137 | + $forums[$postObject->getVar('forum_id')] = 1; |
|
138 | + $postHandler->delete($postObject, true); |
|
139 | + unset($postObject); |
|
140 | + } |
|
141 | + foreach (array_keys($topics) as $topic) { |
|
142 | + $topicHandler->synchronization($topic); |
|
143 | + } |
|
144 | + foreach (array_keys($forums) as $forum) { |
|
145 | + $forumHandler->synchronization($forum); |
|
146 | + } |
|
147 | + break; |
|
148 | + case 'split': |
|
149 | + /** @var Newbb\Post $postObject */ |
|
150 | + $postObject = $postHandler->get($post_id); |
|
151 | + if (0 === count($post_id) || $postObject->isTopic()) { |
|
152 | + break; |
|
153 | + } |
|
154 | + $topic_id = $postObject->getVar('topic_id'); |
|
155 | + |
|
156 | + $newtopic = $topicHandler->create(); |
|
157 | + $newtopic->setVar('topic_title', $postObject->getVar('subject'), true); |
|
158 | + $newtopic->setVar('topic_poster', $postObject->getVar('uid'), true); |
|
159 | + $newtopic->setVar('forum_id', $postObject->getVar('forum_id'), true); |
|
160 | + $newtopic->setVar('topic_time', $postObject->getVar('post_time'), true); |
|
161 | + $newtopic->setVar('poster_name', $postObject->getVar('poster_name'), true); |
|
162 | + $newtopic->setVar('approved', 1, true); |
|
163 | + $topicHandler->insert($newtopic, true); |
|
164 | + $new_topic_id = $newtopic->getVar('topic_id'); |
|
165 | + |
|
166 | + $pid = $postObject->getVar('pid'); |
|
167 | + |
|
168 | + $postObject->setVar('topic_id', $new_topic_id, true); |
|
169 | + $postObject->setVar('pid', 0, true); |
|
170 | + $postHandler->insert($postObject); |
|
171 | + |
|
172 | + /* split a single post */ |
|
173 | + if (1 === $mode) { |
|
174 | + $criteria = new \CriteriaCompo(new \Criteria('topic_id', $topic_id)); |
|
175 | + $criteria->add(new \Criteria('pid', $post_id)); |
|
176 | + $postHandler->updateAll('pid', $pid, $criteria, true); |
|
177 | + /* split a post and its children posts */ |
|
178 | + } elseif (2 === $mode) { |
|
179 | + require_once $GLOBALS['xoops']->path('class/xoopstree.php'); |
|
180 | + $mytree = new \XoopsTree($GLOBALS['xoopsDB']->prefix('newbb_posts'), 'post_id', 'pid'); |
|
181 | + $posts = $mytree->getAllChildId($post_id); |
|
182 | + if (count($posts) > 0) { |
|
183 | + $criteria = new \Criteria('post_id', '(' . implode(',', $posts) . ')', 'IN'); |
|
184 | + $postHandler->updateAll('topic_id', $new_topic_id, $criteria, true); |
|
185 | + } |
|
186 | + /* split a post and all posts coming after */ |
|
187 | + } elseif (3 === $mode) { |
|
188 | + $criteria = new \CriteriaCompo(new \Criteria('topic_id', $topic_id)); |
|
189 | + $criteria->add(new \Criteria('post_id', $post_id, '>')); |
|
190 | + $postHandler->updateAll('topic_id', $new_topic_id, $criteria, true); |
|
191 | + |
|
192 | + unset($criteria); |
|
193 | + $criteria = new \CriteriaCompo(new \Criteria('topic_id', $new_topic_id)); |
|
194 | + $criteria->add(new \Criteria('post_id', $post_id, '>')); |
|
195 | + $postHandler->identifierName = 'pid'; |
|
196 | + $posts = $postHandler->getList($criteria); |
|
197 | + |
|
198 | + unset($criteria); |
|
199 | + $post_update = []; |
|
200 | + foreach ($posts as $postid => $pid) { |
|
201 | + // if (!in_array($pid, array_keys($posts))) { |
|
202 | + if (!array_key_exists($pid, $posts)) { |
|
203 | + $post_update[] = $pid; |
|
204 | + } |
|
205 | + if (!array_key_exists($pid, $posts)) { |
|
206 | + $post_update2[] = $pid; |
|
207 | + } |
|
208 | + } |
|
209 | + if (count($post_update)) { |
|
210 | + $criteria = new \Criteria('post_id', '(' . implode(',', $post_update) . ')', 'IN'); |
|
211 | + $postHandler->updateAll('pid', $post_id, $criteria, true); |
|
212 | + } |
|
213 | + } |
|
214 | + |
|
215 | + $forum_id = $postObject->getVar('forum_id'); |
|
216 | + $topicHandler->synchronization($topic_id); |
|
217 | + $topicHandler->synchronization($new_topic_id); |
|
218 | + $sql = sprintf('UPDATE "%s" SET forum_topics = forum_topics+1 WHERE forum_id = "%u"', $GLOBALS['xoopsDB']->prefix('newbb_forums'), $forum_id); |
|
219 | + $result = $GLOBALS['xoopsDB']->queryF($sql); |
|
220 | + |
|
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 | 231 | require_once __DIR__ . '/footer.php'; |
@@ -46,179 +46,179 @@ |
||
46 | 46 | } |
47 | 47 | |
48 | 48 | switch ($op) { |
49 | - case 'restore': |
|
50 | - $post_id = array_values($post_id); |
|
51 | - sort($post_id); |
|
52 | - $topics = []; |
|
53 | - $forums = []; |
|
54 | - foreach ($post_id as $post) { |
|
55 | - $postObject = $postHandler->get($post); |
|
56 | - if ($postObject->getVar('topic_id') < 1) { |
|
57 | - continue; |
|
58 | - } |
|
59 | - |
|
60 | - $postHandler->approve($postObject, true); |
|
61 | - $topics[$postObject->getVar('topic_id')] = 1; |
|
62 | - $forums[$postObject->getVar('forum_id')] = 1; |
|
63 | - unset($postObject); |
|
64 | - } |
|
65 | - foreach (array_keys($topics) as $topic) { |
|
66 | - $topicHandler->synchronization($topic); |
|
67 | - } |
|
68 | - foreach (array_keys($forums) as $forum) { |
|
69 | - $forumHandler->synchronization($forum); |
|
70 | - } |
|
71 | - break; |
|
72 | - case 'approve': |
|
73 | - $post_id = array_values($post_id); |
|
74 | - sort($post_id); |
|
75 | - $topics = []; |
|
76 | - $forums = []; |
|
77 | - $criteria = new \Criteria('post_id', '(' . implode(',', $post_id) . ')', 'IN'); |
|
78 | - $postsObject = $postHandler->getObjects($criteria, true); |
|
79 | - foreach ($post_id as $post) { |
|
80 | - /** @var Newbb\Post $postObject */ |
|
81 | - $postObject = $postsObject[$post]; |
|
82 | - if (!empty($topic_id) && $topic_id !== $postObject->getVar('topic_id')) { |
|
83 | - continue; |
|
84 | - } |
|
85 | - $postHandler->approve($postObject); |
|
86 | - $topics[$postObject->getVar('topic_id')] = $post; |
|
87 | - $forums[$postObject->getVar('forum_id')] = 1; |
|
88 | - } |
|
89 | - foreach (array_keys($topics) as $topic) { |
|
90 | - $topicHandler->synchronization($topic); |
|
91 | - } |
|
92 | - foreach (array_keys($forums) as $forum) { |
|
93 | - $forumHandler->synchronization($forum); |
|
94 | - } |
|
95 | - |
|
96 | - if (empty($GLOBALS['xoopsModuleConfig']['notification_enabled'])) { |
|
97 | - break; |
|
98 | - } |
|
99 | - |
|
100 | - $criteria_topic = new \Criteria('topic_id', '(' . implode(',', array_keys($topics)) . ')', 'IN'); |
|
101 | - $topic_list = $topicHandler->getList($criteria_topic, true); |
|
102 | - |
|
103 | - $criteria_forum = new \Criteria('forum_id', '(' . implode(',', array_keys($forums)) . ')', 'IN'); |
|
104 | - $forum_list = $forumHandler->getList($criteria_forum); |
|
105 | - |
|
106 | - require_once __DIR__ . '/include/notification.inc.php'; |
|
107 | - /** @var \XoopsNotificationHandler $notificationHandler */ |
|
108 | - $notificationHandler = xoops_getHandler('notification'); |
|
109 | - foreach ($post_id as $post) { |
|
110 | - $tags = []; |
|
111 | - /** @var Newbb\Post[] $postsObject [$post] */ |
|
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'); |
|
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; |
|
117 | - $notificationHandler->triggerEvent('thread', $postsObject[$post]->getVar('topic_id'), 'new_post', $tags); |
|
118 | - $notificationHandler->triggerEvent('forum', $postsObject[$post]->getVar('forum_id'), 'new_post', $tags); |
|
119 | - $notificationHandler->triggerEvent('global', 0, 'new_post', $tags); |
|
120 | - $tags['POST_CONTENT'] = $postsObject[$post]->getVar('post_text'); |
|
121 | - $tags['POST_NAME'] = $postsObject[$post]->getVar('subject'); |
|
122 | - $notificationHandler->triggerEvent('global', 0, 'new_fullpost', $tags); |
|
123 | - $notificationHandler->triggerEvent('forum', $postsObject[$post]->getVar('forum_id'), 'new_fullpost', $tags); |
|
124 | - } |
|
125 | - break; |
|
126 | - case 'delete': |
|
127 | - $post_id = array_values($post_id); |
|
128 | - rsort($post_id); |
|
129 | - $topics = []; |
|
130 | - $forums = []; |
|
131 | - foreach ($post_id as $post) { |
|
132 | - $postObject = $postHandler->get($post); |
|
133 | - if (!empty($topic_id) && $topic_id !== $postObject->getVar('topic_id')) { |
|
134 | - continue; |
|
135 | - } |
|
136 | - $topics[$postObject->getVar('topic_id')] = 1; |
|
137 | - $forums[$postObject->getVar('forum_id')] = 1; |
|
138 | - $postHandler->delete($postObject, true); |
|
139 | - unset($postObject); |
|
140 | - } |
|
141 | - foreach (array_keys($topics) as $topic) { |
|
142 | - $topicHandler->synchronization($topic); |
|
143 | - } |
|
144 | - foreach (array_keys($forums) as $forum) { |
|
145 | - $forumHandler->synchronization($forum); |
|
146 | - } |
|
147 | - break; |
|
148 | - case 'split': |
|
149 | - /** @var Newbb\Post $postObject */ |
|
150 | - $postObject = $postHandler->get($post_id); |
|
151 | - if (0 === count($post_id) || $postObject->isTopic()) { |
|
152 | - break; |
|
153 | - } |
|
154 | - $topic_id = $postObject->getVar('topic_id'); |
|
155 | - |
|
156 | - $newtopic = $topicHandler->create(); |
|
157 | - $newtopic->setVar('topic_title', $postObject->getVar('subject'), true); |
|
158 | - $newtopic->setVar('topic_poster', $postObject->getVar('uid'), true); |
|
159 | - $newtopic->setVar('forum_id', $postObject->getVar('forum_id'), true); |
|
160 | - $newtopic->setVar('topic_time', $postObject->getVar('post_time'), true); |
|
161 | - $newtopic->setVar('poster_name', $postObject->getVar('poster_name'), true); |
|
162 | - $newtopic->setVar('approved', 1, true); |
|
163 | - $topicHandler->insert($newtopic, true); |
|
164 | - $new_topic_id = $newtopic->getVar('topic_id'); |
|
165 | - |
|
166 | - $pid = $postObject->getVar('pid'); |
|
167 | - |
|
168 | - $postObject->setVar('topic_id', $new_topic_id, true); |
|
169 | - $postObject->setVar('pid', 0, true); |
|
170 | - $postHandler->insert($postObject); |
|
171 | - |
|
172 | - /* split a single post */ |
|
173 | - if (1 === $mode) { |
|
174 | - $criteria = new \CriteriaCompo(new \Criteria('topic_id', $topic_id)); |
|
175 | - $criteria->add(new \Criteria('pid', $post_id)); |
|
176 | - $postHandler->updateAll('pid', $pid, $criteria, true); |
|
177 | - /* split a post and its children posts */ |
|
178 | - } elseif (2 === $mode) { |
|
179 | - require_once $GLOBALS['xoops']->path('class/xoopstree.php'); |
|
180 | - $mytree = new \XoopsTree($GLOBALS['xoopsDB']->prefix('newbb_posts'), 'post_id', 'pid'); |
|
181 | - $posts = $mytree->getAllChildId($post_id); |
|
182 | - if (count($posts) > 0) { |
|
183 | - $criteria = new \Criteria('post_id', '(' . implode(',', $posts) . ')', 'IN'); |
|
184 | - $postHandler->updateAll('topic_id', $new_topic_id, $criteria, true); |
|
185 | - } |
|
186 | - /* split a post and all posts coming after */ |
|
187 | - } elseif (3 === $mode) { |
|
188 | - $criteria = new \CriteriaCompo(new \Criteria('topic_id', $topic_id)); |
|
189 | - $criteria->add(new \Criteria('post_id', $post_id, '>')); |
|
190 | - $postHandler->updateAll('topic_id', $new_topic_id, $criteria, true); |
|
191 | - |
|
192 | - unset($criteria); |
|
193 | - $criteria = new \CriteriaCompo(new \Criteria('topic_id', $new_topic_id)); |
|
194 | - $criteria->add(new \Criteria('post_id', $post_id, '>')); |
|
195 | - $postHandler->identifierName = 'pid'; |
|
196 | - $posts = $postHandler->getList($criteria); |
|
197 | - |
|
198 | - unset($criteria); |
|
199 | - $post_update = []; |
|
200 | - foreach ($posts as $postid => $pid) { |
|
201 | - // if (!in_array($pid, array_keys($posts))) { |
|
202 | - if (!array_key_exists($pid, $posts)) { |
|
203 | - $post_update[] = $pid; |
|
204 | - } |
|
205 | - if (!array_key_exists($pid, $posts)) { |
|
206 | - $post_update2[] = $pid; |
|
207 | - } |
|
208 | - } |
|
209 | - if (count($post_update)) { |
|
210 | - $criteria = new \Criteria('post_id', '(' . implode(',', $post_update) . ')', 'IN'); |
|
211 | - $postHandler->updateAll('pid', $post_id, $criteria, true); |
|
212 | - } |
|
213 | - } |
|
214 | - |
|
215 | - $forum_id = $postObject->getVar('forum_id'); |
|
216 | - $topicHandler->synchronization($topic_id); |
|
217 | - $topicHandler->synchronization($new_topic_id); |
|
218 | - $sql = sprintf('UPDATE "%s" SET forum_topics = forum_topics+1 WHERE forum_id = "%u"', $GLOBALS['xoopsDB']->prefix('newbb_forums'), $forum_id); |
|
219 | - $result = $GLOBALS['xoopsDB']->queryF($sql); |
|
220 | - |
|
221 | - break; |
|
49 | + case 'restore': |
|
50 | + $post_id = array_values($post_id); |
|
51 | + sort($post_id); |
|
52 | + $topics = []; |
|
53 | + $forums = []; |
|
54 | + foreach ($post_id as $post) { |
|
55 | + $postObject = $postHandler->get($post); |
|
56 | + if ($postObject->getVar('topic_id') < 1) { |
|
57 | + continue; |
|
58 | + } |
|
59 | + |
|
60 | + $postHandler->approve($postObject, true); |
|
61 | + $topics[$postObject->getVar('topic_id')] = 1; |
|
62 | + $forums[$postObject->getVar('forum_id')] = 1; |
|
63 | + unset($postObject); |
|
64 | + } |
|
65 | + foreach (array_keys($topics) as $topic) { |
|
66 | + $topicHandler->synchronization($topic); |
|
67 | + } |
|
68 | + foreach (array_keys($forums) as $forum) { |
|
69 | + $forumHandler->synchronization($forum); |
|
70 | + } |
|
71 | + break; |
|
72 | + case 'approve': |
|
73 | + $post_id = array_values($post_id); |
|
74 | + sort($post_id); |
|
75 | + $topics = []; |
|
76 | + $forums = []; |
|
77 | + $criteria = new \Criteria('post_id', '(' . implode(',', $post_id) . ')', 'IN'); |
|
78 | + $postsObject = $postHandler->getObjects($criteria, true); |
|
79 | + foreach ($post_id as $post) { |
|
80 | + /** @var Newbb\Post $postObject */ |
|
81 | + $postObject = $postsObject[$post]; |
|
82 | + if (!empty($topic_id) && $topic_id !== $postObject->getVar('topic_id')) { |
|
83 | + continue; |
|
84 | + } |
|
85 | + $postHandler->approve($postObject); |
|
86 | + $topics[$postObject->getVar('topic_id')] = $post; |
|
87 | + $forums[$postObject->getVar('forum_id')] = 1; |
|
88 | + } |
|
89 | + foreach (array_keys($topics) as $topic) { |
|
90 | + $topicHandler->synchronization($topic); |
|
91 | + } |
|
92 | + foreach (array_keys($forums) as $forum) { |
|
93 | + $forumHandler->synchronization($forum); |
|
94 | + } |
|
95 | + |
|
96 | + if (empty($GLOBALS['xoopsModuleConfig']['notification_enabled'])) { |
|
97 | + break; |
|
98 | + } |
|
99 | + |
|
100 | + $criteria_topic = new \Criteria('topic_id', '(' . implode(',', array_keys($topics)) . ')', 'IN'); |
|
101 | + $topic_list = $topicHandler->getList($criteria_topic, true); |
|
102 | + |
|
103 | + $criteria_forum = new \Criteria('forum_id', '(' . implode(',', array_keys($forums)) . ')', 'IN'); |
|
104 | + $forum_list = $forumHandler->getList($criteria_forum); |
|
105 | + |
|
106 | + require_once __DIR__ . '/include/notification.inc.php'; |
|
107 | + /** @var \XoopsNotificationHandler $notificationHandler */ |
|
108 | + $notificationHandler = xoops_getHandler('notification'); |
|
109 | + foreach ($post_id as $post) { |
|
110 | + $tags = []; |
|
111 | + /** @var Newbb\Post[] $postsObject [$post] */ |
|
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'); |
|
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; |
|
117 | + $notificationHandler->triggerEvent('thread', $postsObject[$post]->getVar('topic_id'), 'new_post', $tags); |
|
118 | + $notificationHandler->triggerEvent('forum', $postsObject[$post]->getVar('forum_id'), 'new_post', $tags); |
|
119 | + $notificationHandler->triggerEvent('global', 0, 'new_post', $tags); |
|
120 | + $tags['POST_CONTENT'] = $postsObject[$post]->getVar('post_text'); |
|
121 | + $tags['POST_NAME'] = $postsObject[$post]->getVar('subject'); |
|
122 | + $notificationHandler->triggerEvent('global', 0, 'new_fullpost', $tags); |
|
123 | + $notificationHandler->triggerEvent('forum', $postsObject[$post]->getVar('forum_id'), 'new_fullpost', $tags); |
|
124 | + } |
|
125 | + break; |
|
126 | + case 'delete': |
|
127 | + $post_id = array_values($post_id); |
|
128 | + rsort($post_id); |
|
129 | + $topics = []; |
|
130 | + $forums = []; |
|
131 | + foreach ($post_id as $post) { |
|
132 | + $postObject = $postHandler->get($post); |
|
133 | + if (!empty($topic_id) && $topic_id !== $postObject->getVar('topic_id')) { |
|
134 | + continue; |
|
135 | + } |
|
136 | + $topics[$postObject->getVar('topic_id')] = 1; |
|
137 | + $forums[$postObject->getVar('forum_id')] = 1; |
|
138 | + $postHandler->delete($postObject, true); |
|
139 | + unset($postObject); |
|
140 | + } |
|
141 | + foreach (array_keys($topics) as $topic) { |
|
142 | + $topicHandler->synchronization($topic); |
|
143 | + } |
|
144 | + foreach (array_keys($forums) as $forum) { |
|
145 | + $forumHandler->synchronization($forum); |
|
146 | + } |
|
147 | + break; |
|
148 | + case 'split': |
|
149 | + /** @var Newbb\Post $postObject */ |
|
150 | + $postObject = $postHandler->get($post_id); |
|
151 | + if (0 === count($post_id) || $postObject->isTopic()) { |
|
152 | + break; |
|
153 | + } |
|
154 | + $topic_id = $postObject->getVar('topic_id'); |
|
155 | + |
|
156 | + $newtopic = $topicHandler->create(); |
|
157 | + $newtopic->setVar('topic_title', $postObject->getVar('subject'), true); |
|
158 | + $newtopic->setVar('topic_poster', $postObject->getVar('uid'), true); |
|
159 | + $newtopic->setVar('forum_id', $postObject->getVar('forum_id'), true); |
|
160 | + $newtopic->setVar('topic_time', $postObject->getVar('post_time'), true); |
|
161 | + $newtopic->setVar('poster_name', $postObject->getVar('poster_name'), true); |
|
162 | + $newtopic->setVar('approved', 1, true); |
|
163 | + $topicHandler->insert($newtopic, true); |
|
164 | + $new_topic_id = $newtopic->getVar('topic_id'); |
|
165 | + |
|
166 | + $pid = $postObject->getVar('pid'); |
|
167 | + |
|
168 | + $postObject->setVar('topic_id', $new_topic_id, true); |
|
169 | + $postObject->setVar('pid', 0, true); |
|
170 | + $postHandler->insert($postObject); |
|
171 | + |
|
172 | + /* split a single post */ |
|
173 | + if (1 === $mode) { |
|
174 | + $criteria = new \CriteriaCompo(new \Criteria('topic_id', $topic_id)); |
|
175 | + $criteria->add(new \Criteria('pid', $post_id)); |
|
176 | + $postHandler->updateAll('pid', $pid, $criteria, true); |
|
177 | + /* split a post and its children posts */ |
|
178 | + } elseif (2 === $mode) { |
|
179 | + require_once $GLOBALS['xoops']->path('class/xoopstree.php'); |
|
180 | + $mytree = new \XoopsTree($GLOBALS['xoopsDB']->prefix('newbb_posts'), 'post_id', 'pid'); |
|
181 | + $posts = $mytree->getAllChildId($post_id); |
|
182 | + if (count($posts) > 0) { |
|
183 | + $criteria = new \Criteria('post_id', '(' . implode(',', $posts) . ')', 'IN'); |
|
184 | + $postHandler->updateAll('topic_id', $new_topic_id, $criteria, true); |
|
185 | + } |
|
186 | + /* split a post and all posts coming after */ |
|
187 | + } elseif (3 === $mode) { |
|
188 | + $criteria = new \CriteriaCompo(new \Criteria('topic_id', $topic_id)); |
|
189 | + $criteria->add(new \Criteria('post_id', $post_id, '>')); |
|
190 | + $postHandler->updateAll('topic_id', $new_topic_id, $criteria, true); |
|
191 | + |
|
192 | + unset($criteria); |
|
193 | + $criteria = new \CriteriaCompo(new \Criteria('topic_id', $new_topic_id)); |
|
194 | + $criteria->add(new \Criteria('post_id', $post_id, '>')); |
|
195 | + $postHandler->identifierName = 'pid'; |
|
196 | + $posts = $postHandler->getList($criteria); |
|
197 | + |
|
198 | + unset($criteria); |
|
199 | + $post_update = []; |
|
200 | + foreach ($posts as $postid => $pid) { |
|
201 | + // if (!in_array($pid, array_keys($posts))) { |
|
202 | + if (!array_key_exists($pid, $posts)) { |
|
203 | + $post_update[] = $pid; |
|
204 | + } |
|
205 | + if (!array_key_exists($pid, $posts)) { |
|
206 | + $post_update2[] = $pid; |
|
207 | + } |
|
208 | + } |
|
209 | + if (count($post_update)) { |
|
210 | + $criteria = new \Criteria('post_id', '(' . implode(',', $post_update) . ')', 'IN'); |
|
211 | + $postHandler->updateAll('pid', $post_id, $criteria, true); |
|
212 | + } |
|
213 | + } |
|
214 | + |
|
215 | + $forum_id = $postObject->getVar('forum_id'); |
|
216 | + $topicHandler->synchronization($topic_id); |
|
217 | + $topicHandler->synchronization($new_topic_id); |
|
218 | + $sql = sprintf('UPDATE "%s" SET forum_topics = forum_topics+1 WHERE forum_id = "%u"', $GLOBALS['xoopsDB']->prefix('newbb_forums'), $forum_id); |
|
219 | + $result = $GLOBALS['xoopsDB']->queryF($sql); |
|
220 | + |
|
221 | + break; |
|
222 | 222 | } |
223 | 223 | if (!empty($topic_id)) { |
224 | 224 | redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?topic_id=$topic_id", 2, _MD_NEWBB_DBUPDATED); |
@@ -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'); |
@@ -40,7 +40,7 @@ discard block |
||
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; |
@@ -75,195 +75,195 @@ discard block |
||
75 | 75 | $search_username = trim($uname); |
76 | 76 | |
77 | 77 | if ($GLOBALS['xoopsModuleConfig']['wol_enabled']) { |
78 | - // /** @var Newbb\OnlineHandler $onlineHandler */ |
|
79 | - // $onlineHandler = Newbb\Helper::getInstance()->getHandler('Online'); |
|
80 | - $onlineHandler->init(0); |
|
78 | + // /** @var Newbb\OnlineHandler $onlineHandler */ |
|
79 | + // $onlineHandler = Newbb\Helper::getInstance()->getHandler('Online'); |
|
80 | + $onlineHandler->init(0); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | $xoopsTpl->assign('forumindex', sprintf(_MD_NEWBB_FORUMINDEX, htmlspecialchars($GLOBALS['xoopsConfig']['sitename'], ENT_QUOTES))); |
84 | 84 | //$xoopsTpl->assign("img_folder", newbbDisplayImage($forumImage['topic'])); |
85 | 85 | |
86 | 86 | if (!empty($uname) || Request::getString('submit', '') || !empty($term)) { |
87 | - // irmtfan filter positive numbers |
|
88 | - $selectlength = !empty($selectlength) ? abs($selectlength) : 200; |
|
89 | - // irmtfan add select parameters for next search |
|
90 | - $next_search['selectlength'] = $selectlength; |
|
87 | + // irmtfan filter positive numbers |
|
88 | + $selectlength = !empty($selectlength) ? abs($selectlength) : 200; |
|
89 | + // irmtfan add select parameters for next search |
|
90 | + $next_search['selectlength'] = $selectlength; |
|
91 | 91 | |
92 | - $start = Request::getInt('start', 0); |
|
93 | - $forum = Request::getInt('forum', null); |
|
94 | - if (empty($forum) || 'all' === $forum || (is_array($forum) && in_array('all', $forum, true))) { |
|
95 | - $forum = []; |
|
96 | - } elseif (!is_array($forum)) { |
|
97 | - $forum = array_map('intval', explode('|', $forum)); |
|
98 | - } |
|
99 | - $next_search['forum'] = implode('|', $forum); |
|
100 | - // START irmtfan topic search |
|
101 | - $topic = Request::getString('topic', null); |
|
102 | - $next_search['topic'] = $topic; |
|
103 | - // END irmtfan topic search |
|
104 | - // START irmtfan add show search |
|
105 | - $show_search = Request::getString('show_search', 'post_text'); |
|
106 | - $next_search['show_search'] = $show_search; |
|
107 | - // START irmtfan add show search |
|
92 | + $start = Request::getInt('start', 0); |
|
93 | + $forum = Request::getInt('forum', null); |
|
94 | + if (empty($forum) || 'all' === $forum || (is_array($forum) && in_array('all', $forum, true))) { |
|
95 | + $forum = []; |
|
96 | + } elseif (!is_array($forum)) { |
|
97 | + $forum = array_map('intval', explode('|', $forum)); |
|
98 | + } |
|
99 | + $next_search['forum'] = implode('|', $forum); |
|
100 | + // START irmtfan topic search |
|
101 | + $topic = Request::getString('topic', null); |
|
102 | + $next_search['topic'] = $topic; |
|
103 | + // END irmtfan topic search |
|
104 | + // START irmtfan add show search |
|
105 | + $show_search = Request::getString('show_search', 'post_text'); |
|
106 | + $next_search['show_search'] = $show_search; |
|
107 | + // START irmtfan add show search |
|
108 | 108 | |
109 | - $addterms = Request::getString('andor', 'AND'); |
|
110 | - $next_search['andor'] = $addterms; |
|
111 | - $andor = strtoupper($addterms); |
|
112 | - if (!in_array($addterms, ['OR', 'AND'], true)) { |
|
113 | - $andor = 'AND'; |
|
114 | - } |
|
109 | + $addterms = Request::getString('andor', 'AND'); |
|
110 | + $next_search['andor'] = $addterms; |
|
111 | + $andor = strtoupper($addterms); |
|
112 | + if (!in_array($addterms, ['OR', 'AND'], true)) { |
|
113 | + $andor = 'AND'; |
|
114 | + } |
|
115 | 115 | |
116 | - $uname_required = false; |
|
117 | - $next_search['uname'] = $search_username; |
|
118 | - if (!empty($search_username)) { |
|
119 | - $uname_required = true; |
|
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); |
|
123 | - } |
|
124 | - $uid = []; |
|
125 | - while (false !== ($row = $GLOBALS['xoopsDB']->fetchArray($result))) { |
|
126 | - $uid[] = $row['uid']; |
|
127 | - } |
|
128 | - } else { |
|
129 | - $uid = 0; |
|
130 | - } |
|
116 | + $uname_required = false; |
|
117 | + $next_search['uname'] = $search_username; |
|
118 | + if (!empty($search_username)) { |
|
119 | + $uname_required = true; |
|
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); |
|
123 | + } |
|
124 | + $uid = []; |
|
125 | + while (false !== ($row = $GLOBALS['xoopsDB']->fetchArray($result))) { |
|
126 | + $uid[] = $row['uid']; |
|
127 | + } |
|
128 | + } else { |
|
129 | + $uid = 0; |
|
130 | + } |
|
131 | 131 | |
132 | - $next_search['term'] = htmlspecialchars($term, ENT_QUOTES); |
|
133 | - $query = trim($term); |
|
132 | + $next_search['term'] = htmlspecialchars($term, ENT_QUOTES); |
|
133 | + $query = trim($term); |
|
134 | 134 | |
135 | - if ('EXACT' !== $andor) { |
|
136 | - $ignored_queries = []; // holds keywords that are shorter than allowed minimum length |
|
137 | - $temp_queries = str_getcsv($query, ' ', '"'); |
|
138 | - foreach ($temp_queries as $q) { |
|
139 | - $q = trim($q); |
|
140 | - if (strlen($q) >= $xoopsConfigSearch['keyword_min']) { |
|
141 | - $queries[] = $q; |
|
142 | - } else { |
|
143 | - $ignored_queries[] = $q; |
|
144 | - } |
|
145 | - } |
|
146 | - if (!$uname_required && 0 === count($queries)) { |
|
147 | - redirect_header(XOOPS_URL . '/search.php', 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min'])); |
|
148 | - } |
|
149 | - } else { |
|
150 | - //$query = trim($query); |
|
151 | - if (!$uname_required && (strlen($query) < $xoopsConfigSearch['keyword_min'])) { |
|
152 | - redirect_header(XOOPS_URL . '/search.php', 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min'])); |
|
153 | - } |
|
154 | - $queries = [$query]; |
|
155 | - } |
|
135 | + if ('EXACT' !== $andor) { |
|
136 | + $ignored_queries = []; // holds keywords that are shorter than allowed minimum length |
|
137 | + $temp_queries = str_getcsv($query, ' ', '"'); |
|
138 | + foreach ($temp_queries as $q) { |
|
139 | + $q = trim($q); |
|
140 | + if (strlen($q) >= $xoopsConfigSearch['keyword_min']) { |
|
141 | + $queries[] = $q; |
|
142 | + } else { |
|
143 | + $ignored_queries[] = $q; |
|
144 | + } |
|
145 | + } |
|
146 | + if (!$uname_required && 0 === count($queries)) { |
|
147 | + redirect_header(XOOPS_URL . '/search.php', 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min'])); |
|
148 | + } |
|
149 | + } else { |
|
150 | + //$query = trim($query); |
|
151 | + if (!$uname_required && (strlen($query) < $xoopsConfigSearch['keyword_min'])) { |
|
152 | + redirect_header(XOOPS_URL . '/search.php', 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min'])); |
|
153 | + } |
|
154 | + $queries = [$query]; |
|
155 | + } |
|
156 | 156 | |
157 | - // entries must be lowercase |
|
158 | - $allowed = ['p.post_time', 'p.subject']; // irmtfan just post time and subject |
|
157 | + // entries must be lowercase |
|
158 | + $allowed = ['p.post_time', 'p.subject']; // irmtfan just post time and subject |
|
159 | 159 | |
160 | - $sortby = Request::getString('sortby', 'p.post_time'); |
|
161 | - $next_search['sortby'] = $sortby; |
|
162 | - //$sortby = (in_array(strtolower($sortby), $allowed)) ? $sortby : 't.topic_last_post_id'; |
|
163 | - $sortby = in_array(strtolower($sortby), $allowed) ? $sortby : 'p.post_time'; |
|
164 | - $searchin = Request::getString('searchin', 'both'); |
|
165 | - $next_search['searchin'] = $searchin; |
|
166 | - // START irmtfan use criteria - add since and topic search |
|
167 | - if (!empty($since)) { |
|
168 | - $criteriaExtra->add(new \Criteria('p.post_time', time() - newbbGetSinceTime($since), '>='), 'OR'); |
|
169 | - } |
|
170 | - if (is_numeric($topic) && !empty($topic)) { |
|
171 | - $criteriaExtra->add(new \Criteria('p.topic_id', $topic), 'OR'); |
|
172 | - } |
|
173 | - // END irmtfan use criteria - add since and topic search |
|
160 | + $sortby = Request::getString('sortby', 'p.post_time'); |
|
161 | + $next_search['sortby'] = $sortby; |
|
162 | + //$sortby = (in_array(strtolower($sortby), $allowed)) ? $sortby : 't.topic_last_post_id'; |
|
163 | + $sortby = in_array(strtolower($sortby), $allowed) ? $sortby : 'p.post_time'; |
|
164 | + $searchin = Request::getString('searchin', 'both'); |
|
165 | + $next_search['searchin'] = $searchin; |
|
166 | + // START irmtfan use criteria - add since and topic search |
|
167 | + if (!empty($since)) { |
|
168 | + $criteriaExtra->add(new \Criteria('p.post_time', time() - newbbGetSinceTime($since), '>='), 'OR'); |
|
169 | + } |
|
170 | + if (is_numeric($topic) && !empty($topic)) { |
|
171 | + $criteriaExtra->add(new \Criteria('p.topic_id', $topic), 'OR'); |
|
172 | + } |
|
173 | + // END irmtfan use criteria - add since and topic search |
|
174 | 174 | |
175 | - if ($uname_required && (!$uid || count($uid) < 1)) { |
|
176 | - $results = []; |
|
177 | - } // irmtfan bug fix array() |
|
178 | - else { |
|
179 | - $results = newbb_search($queries, $andor, $limit, $start, $uid, $forum, $sortby, $searchin, $criteriaExtra); |
|
180 | - } // irmtfan $criteriaExtra |
|
175 | + if ($uname_required && (!$uid || count($uid) < 1)) { |
|
176 | + $results = []; |
|
177 | + } // irmtfan bug fix array() |
|
178 | + else { |
|
179 | + $results = newbb_search($queries, $andor, $limit, $start, $uid, $forum, $sortby, $searchin, $criteriaExtra); |
|
180 | + } // irmtfan $criteriaExtra |
|
181 | 181 | |
182 | - $search_info_keywords = Highlighter::apply($myts->htmlSpecialChars($term, ENT_QUOTES), implode(' ', $queries), '<mark>', '</mark>'); |
|
183 | - $num_results = count($results); |
|
184 | - if ($num_results < 1) { |
|
185 | - $xoopsTpl->assign('lang_nomatch', _SR_NOMATCH); |
|
186 | - } else { |
|
187 | - $skipresults = 0; |
|
188 | - foreach ($results as $row) { |
|
189 | - $post_text_select = ''; |
|
190 | - $post_subject_select = Highlighter::apply($queries, $row['title'], '<mark>', '</mark>'); |
|
191 | - if ('post_text' === $show_search) { |
|
192 | - $post_text_select = Metagen::getSearchSummary($row['post_text'], $queries, $selectlength); |
|
193 | - $post_text_select = Highlighter::apply($queries, $post_text_select, '<mark>', '</mark>'); |
|
194 | - } |
|
195 | - // if no text remained after select text continue |
|
196 | - if (empty($post_text_select) && empty($post_subject_select)) { |
|
197 | - ++$skipresults; |
|
198 | - continue; |
|
199 | - } |
|
200 | - $xoopsTpl->append('results', [ |
|
201 | - 'forum_name' => $row['forum_name'], |
|
202 | - 'forum_link' => $row['forum_link'], |
|
203 | - 'link' => $row['link'], |
|
204 | - 'title' => $post_subject_select, |
|
205 | - 'poster' => $row['poster'], |
|
206 | - 'post_time' => formatTimestamp($row['time'], 'm'), |
|
207 | - 'post_text' => $post_text_select |
|
208 | - ]); |
|
209 | - } |
|
210 | - unset($results); |
|
182 | + $search_info_keywords = Highlighter::apply($myts->htmlSpecialChars($term, ENT_QUOTES), implode(' ', $queries), '<mark>', '</mark>'); |
|
183 | + $num_results = count($results); |
|
184 | + if ($num_results < 1) { |
|
185 | + $xoopsTpl->assign('lang_nomatch', _SR_NOMATCH); |
|
186 | + } else { |
|
187 | + $skipresults = 0; |
|
188 | + foreach ($results as $row) { |
|
189 | + $post_text_select = ''; |
|
190 | + $post_subject_select = Highlighter::apply($queries, $row['title'], '<mark>', '</mark>'); |
|
191 | + if ('post_text' === $show_search) { |
|
192 | + $post_text_select = Metagen::getSearchSummary($row['post_text'], $queries, $selectlength); |
|
193 | + $post_text_select = Highlighter::apply($queries, $post_text_select, '<mark>', '</mark>'); |
|
194 | + } |
|
195 | + // if no text remained after select text continue |
|
196 | + if (empty($post_text_select) && empty($post_subject_select)) { |
|
197 | + ++$skipresults; |
|
198 | + continue; |
|
199 | + } |
|
200 | + $xoopsTpl->append('results', [ |
|
201 | + 'forum_name' => $row['forum_name'], |
|
202 | + 'forum_link' => $row['forum_link'], |
|
203 | + 'link' => $row['link'], |
|
204 | + 'title' => $post_subject_select, |
|
205 | + 'poster' => $row['poster'], |
|
206 | + 'post_time' => formatTimestamp($row['time'], 'm'), |
|
207 | + 'post_text' => $post_text_select |
|
208 | + ]); |
|
209 | + } |
|
210 | + unset($results); |
|
211 | 211 | |
212 | - if (count($next_search) > 0) { |
|
213 | - $items = []; |
|
214 | - foreach ($next_search as $para => $val) { |
|
215 | - $items[] = "{$para}=" . urlencode($val); |
|
216 | - } |
|
217 | - if (count($items) > 0) { |
|
218 | - $paras = implode('&', $items); |
|
219 | - } |
|
220 | - unset($next_search, $items); |
|
221 | - } |
|
222 | - $search_url = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/search.php?' . $paras; |
|
223 | - // irmtfan remove to have just one query and appropriate next and prev links |
|
224 | - //$next_results = newbb_search($queries, $andor, 1, $start + $limit, $uid, $forum, $sortby, $searchin, $subquery); |
|
225 | - //$next_count = count($next_results); |
|
226 | - //$has_next = false; |
|
227 | - //if (is_array($next_results) && $next_count >0) { |
|
228 | - //$has_next = true; |
|
229 | - //} |
|
230 | - // irmtfan if $results < $limit => it is impossible to have next |
|
231 | - if ($num_results == $limit) { |
|
232 | - $next = $start + $limit; |
|
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>'; |
|
236 | - $xoopsTpl->assign('search_next', $search_next); |
|
237 | - $xoopsTpl->assign('search_next_url', $search_url_next); |
|
238 | - } |
|
239 | - if ($start > 0) { |
|
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>'; |
|
243 | - $xoopsTpl->assign('search_prev', $search_prev); |
|
244 | - $xoopsTpl->assign('search_prev_url', $search_url_prev); |
|
245 | - } |
|
246 | - // irmtfan if all results skipped then redirect to the next/previous page |
|
247 | - if ($num_results == $skipresults) { |
|
248 | - $direction = Request::getString('direction', 'next'); |
|
249 | - $search_url_redirect = ('next' === strtolower($direction)) ? $search_url_next : $search_url_prev; |
|
250 | - redirect_header($search_url_redirect, 1, constant(strtoupper("_SR_{$direction}"))); |
|
251 | - } |
|
252 | - } |
|
253 | - $search_info = _SR_KEYWORDS . ': ' . $search_info_keywords; |
|
254 | - if ($uname_required) { |
|
255 | - if ($search_info) { |
|
256 | - $search_info .= '<br>'; |
|
257 | - } |
|
258 | - $search_info .= _MD_NEWBB_USERNAME . ': ' . $myts->htmlSpecialChars($search_username); |
|
259 | - } |
|
260 | - // add num_results |
|
261 | - $search_info .= '<br>' . sprintf(_SR_SHOWING, $start + 1, $start + $num_results); |
|
262 | - // if any result skip show the counter |
|
263 | - if (!empty($skipresults)) { |
|
264 | - $search_info .= ' - ' . sprintf(_SR_FOUND, $num_results - $skipresults); |
|
265 | - } |
|
266 | - $xoopsTpl->assign('search_info', $search_info); |
|
212 | + if (count($next_search) > 0) { |
|
213 | + $items = []; |
|
214 | + foreach ($next_search as $para => $val) { |
|
215 | + $items[] = "{$para}=" . urlencode($val); |
|
216 | + } |
|
217 | + if (count($items) > 0) { |
|
218 | + $paras = implode('&', $items); |
|
219 | + } |
|
220 | + unset($next_search, $items); |
|
221 | + } |
|
222 | + $search_url = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/search.php?' . $paras; |
|
223 | + // irmtfan remove to have just one query and appropriate next and prev links |
|
224 | + //$next_results = newbb_search($queries, $andor, 1, $start + $limit, $uid, $forum, $sortby, $searchin, $subquery); |
|
225 | + //$next_count = count($next_results); |
|
226 | + //$has_next = false; |
|
227 | + //if (is_array($next_results) && $next_count >0) { |
|
228 | + //$has_next = true; |
|
229 | + //} |
|
230 | + // irmtfan if $results < $limit => it is impossible to have next |
|
231 | + if ($num_results == $limit) { |
|
232 | + $next = $start + $limit; |
|
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>'; |
|
236 | + $xoopsTpl->assign('search_next', $search_next); |
|
237 | + $xoopsTpl->assign('search_next_url', $search_url_next); |
|
238 | + } |
|
239 | + if ($start > 0) { |
|
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>'; |
|
243 | + $xoopsTpl->assign('search_prev', $search_prev); |
|
244 | + $xoopsTpl->assign('search_prev_url', $search_url_prev); |
|
245 | + } |
|
246 | + // irmtfan if all results skipped then redirect to the next/previous page |
|
247 | + if ($num_results == $skipresults) { |
|
248 | + $direction = Request::getString('direction', 'next'); |
|
249 | + $search_url_redirect = ('next' === strtolower($direction)) ? $search_url_next : $search_url_prev; |
|
250 | + redirect_header($search_url_redirect, 1, constant(strtoupper("_SR_{$direction}"))); |
|
251 | + } |
|
252 | + } |
|
253 | + $search_info = _SR_KEYWORDS . ': ' . $search_info_keywords; |
|
254 | + if ($uname_required) { |
|
255 | + if ($search_info) { |
|
256 | + $search_info .= '<br>'; |
|
257 | + } |
|
258 | + $search_info .= _MD_NEWBB_USERNAME . ': ' . $myts->htmlSpecialChars($search_username); |
|
259 | + } |
|
260 | + // add num_results |
|
261 | + $search_info .= '<br>' . sprintf(_SR_SHOWING, $start + 1, $start + $num_results); |
|
262 | + // if any result skip show the counter |
|
263 | + if (!empty($skipresults)) { |
|
264 | + $search_info .= ' - ' . sprintf(_SR_FOUND, $num_results - $skipresults); |
|
265 | + } |
|
266 | + $xoopsTpl->assign('search_info', $search_info); |
|
267 | 267 | } |
268 | 268 | // assign template vars for search |
269 | 269 | /* term */ |
@@ -273,12 +273,12 @@ discard block |
||
273 | 273 | $andor_select = '<select name="andor" id="andor" class="form-control">'; |
274 | 274 | $andor_select .= '<option value="OR"'; |
275 | 275 | if ('OR' === $andor) { |
276 | - $andor_select .= ' selected="selected"'; |
|
276 | + $andor_select .= ' selected="selected"'; |
|
277 | 277 | } |
278 | 278 | $andor_select .= '>' . _SR_ANY . '</option>'; |
279 | 279 | $andor_select .= '<option value="AND"'; |
280 | 280 | if ('AND' === $andor || empty($andor)) { |
281 | - $andor_select .= ' selected="selected"'; |
|
281 | + $andor_select .= ' selected="selected"'; |
|
282 | 282 | } |
283 | 283 | $andor_select .= '>' . _SR_ALL . '</option>'; |
284 | 284 | $andor_select .= '</select>'; |
@@ -295,17 +295,17 @@ discard block |
||
295 | 295 | $searchin_select = ''; |
296 | 296 | $searchin_select .= '<label class="radio-inline"><input type="radio" name="searchin" value="title"'; |
297 | 297 | if ('title' === $searchin) { |
298 | - $searchin_select .= ' checked'; |
|
298 | + $searchin_select .= ' checked'; |
|
299 | 299 | } |
300 | 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 | - $searchin_select .= ' checked'; |
|
303 | + $searchin_select .= ' checked'; |
|
304 | 304 | } |
305 | 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 | - $searchin_select .= ' checked'; |
|
308 | + $searchin_select .= ' checked'; |
|
309 | 309 | } |
310 | 310 | $searchin_select .= ' />' . _MD_NEWBB_SUBJECT . ' & ' . _MD_NEWBB_BODY . ' </label>'; |
311 | 311 | $xoopsTpl->assign('searchin_radio', $searchin_select); |
@@ -314,12 +314,12 @@ discard block |
||
314 | 314 | $show_search_select = ''; |
315 | 315 | $show_search_select .= '<label class="radio-inline"><input type="radio" name="show_search" value="post"'; |
316 | 316 | if ('post' === $show_search) { |
317 | - $show_search_select .= ' checked'; |
|
317 | + $show_search_select .= ' checked'; |
|
318 | 318 | } |
319 | 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 | - $show_search_select .= ' checked'; |
|
322 | + $show_search_select .= ' checked'; |
|
323 | 323 | } |
324 | 324 | $show_search_select .= ' />' . _MD_NEWBB_SEARCHPOSTTEXT . ' </label>'; |
325 | 325 | $xoopsTpl->assign('show_search_radio', $show_search_select); |
@@ -331,12 +331,12 @@ discard block |
||
331 | 331 | $sortby_select = '<select name="sortby" id="sortby" class="form-control">'; |
332 | 332 | $sortby_select .= '<option value=\'p.post_time\''; |
333 | 333 | if ('p.post_time' === $sortby || empty($sortby)) { |
334 | - $sortby_select .= ' selected=\'selected\''; |
|
334 | + $sortby_select .= ' selected=\'selected\''; |
|
335 | 335 | } |
336 | 336 | $sortby_select .= '>' . _MD_NEWBB_DATE . '</option>'; |
337 | 337 | $sortby_select .= '<option value=\'p.subject\''; |
338 | 338 | if ('p.subject' === $sortby) { |
339 | - $sortby_select .= ' selected="selected"'; |
|
339 | + $sortby_select .= ' selected="selected"'; |
|
340 | 340 | } |
341 | 341 | $sortby_select .= '>' . _MD_NEWBB_TOPIC . '</option>'; |
342 | 342 | $sortby_select .= '</select>'; |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | $xoopsTpl->assign_by_ref('since_selection_box', $select_since); |
352 | 352 | |
353 | 353 | if ($xoopsConfigSearch['keyword_min'] > 0) { |
354 | - $xoopsTpl->assign('search_rule', sprintf(_SR_KEYIGNORE, $xoopsConfigSearch['keyword_min'])); |
|
354 | + $xoopsTpl->assign('search_rule', sprintf(_SR_KEYIGNORE, $xoopsConfigSearch['keyword_min'])); |
|
355 | 355 | } |
356 | 356 | // irmtfan move to footer.php |
357 | 357 | require_once __DIR__ . '/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'); |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | $start = Request::getInt('start', 0, 'GET'); |
42 | 42 | |
43 | 43 | if (!$topic_id && !$post_id) { |
44 | - $redirect = empty($forum) ? 'index.php' : "viewforum.php?forum={$forum}"; |
|
45 | - redirect_header($redirect, 2, _MD_NEWBB_ERRORTOPIC); |
|
44 | + $redirect = empty($forum) ? 'index.php' : "viewforum.php?forum={$forum}"; |
|
45 | + redirect_header($redirect, 2, _MD_NEWBB_ERRORTOPIC); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | ///** @var NewbbForumHandler $forumHandler */ |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | //$postHandler = Newbb\Helper::getInstance()->getHandler('Post'); |
54 | 54 | |
55 | 55 | if (!$pid = $post_id) { |
56 | - $pid = $topicHandler->getTopPostId($topic_id); |
|
56 | + $pid = $topicHandler->getTopPostId($topic_id); |
|
57 | 57 | } |
58 | 58 | $postParentObject = $postHandler->get($pid); |
59 | 59 | $topic_id = $postParentObject->getVar('topic_id'); |
@@ -65,32 +65,32 @@ 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); |
72 | 72 | $topic_status = $topicObject->getVar('topic_status'); |
73 | 73 | if (!$topicHandler->getPermission($forumObject, $topic_status, 'reply')) { |
74 | - /* |
|
74 | + /* |
|
75 | 75 | * Build the page query |
76 | 76 | */ |
77 | - $query_vars = ['topic_id', 'post_id', 'status', 'order', 'mode', 'viewmode']; |
|
78 | - $query_array = []; |
|
79 | - foreach ($query_vars as $var) { |
|
80 | - if (Request::getString($var, '', 'GET')) { |
|
81 | - $query_array[$var] = "{$var}=" . Request::getString($var, '', 'GET'); |
|
82 | - } |
|
83 | - } |
|
84 | - $page_query = htmlspecialchars(implode('&', array_values($query_array)), ENT_QUOTES | ENT_HTML5); |
|
85 | - unset($query_array); |
|
86 | - |
|
87 | - redirect_header("viewtopic.php?{$page_query}", 2, _MD_NEWBB_NORIGHTTOREPLY); |
|
77 | + $query_vars = ['topic_id', 'post_id', 'status', 'order', 'mode', 'viewmode']; |
|
78 | + $query_array = []; |
|
79 | + foreach ($query_vars as $var) { |
|
80 | + if (Request::getString($var, '', 'GET')) { |
|
81 | + $query_array[$var] = "{$var}=" . Request::getString($var, '', 'GET'); |
|
82 | + } |
|
83 | + } |
|
84 | + $page_query = htmlspecialchars(implode('&', array_values($query_array)), ENT_QUOTES | ENT_HTML5); |
|
85 | + unset($query_array); |
|
86 | + |
|
87 | + redirect_header("viewtopic.php?{$page_query}", 2, _MD_NEWBB_NORIGHTTOREPLY); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | if ($GLOBALS['xoopsModuleConfig']['wol_enabled']) { |
91 | - // /** @var OnlineHandler $onlineHandler */ |
|
92 | - // $onlineHandler = Newbb\Helper::getInstance()->getHandler('Online'); |
|
93 | - $onlineHandler->init($forumObject); |
|
91 | + // /** @var OnlineHandler $onlineHandler */ |
|
92 | + // $onlineHandler = Newbb\Helper::getInstance()->getHandler('Online'); |
|
93 | + $onlineHandler->init($forumObject); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | $xoopsOption['template_main'] = 'newbb_edit_post.tpl'; |
@@ -113,47 +113,47 @@ discard block |
||
113 | 113 | */ |
114 | 114 | |
115 | 115 | if ((2 == $GLOBALS['xoopsModuleConfig']['disc_show']) || (3 == $GLOBALS['xoopsModuleConfig']['disc_show'])) { |
116 | - $xoopsTpl->assign('disclaimer', $GLOBALS['xoopsModuleConfig']['disclaimer']); |
|
116 | + $xoopsTpl->assign('disclaimer', $GLOBALS['xoopsModuleConfig']['disclaimer']); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | $xoopsTpl->assign('parentforum', $forumHandler->getParents($forumObject)); |
120 | 120 | |
121 | 121 | $xoopsTpl->assign([ |
122 | - 'forum_id' => $forumObject->getVar('forum_id'), |
|
123 | - 'forum_name' => $forumObject->getVar('forum_name') |
|
124 | - ]); |
|
122 | + 'forum_id' => $forumObject->getVar('forum_id'), |
|
123 | + 'forum_name' => $forumObject->getVar('forum_name') |
|
124 | + ]); |
|
125 | 125 | |
126 | 126 | if ($postParentObject->getVar('uid')) { |
127 | - $r_name = newbbGetUnameFromId($postParentObject->getVar('uid'), $GLOBALS['xoopsModuleConfig']['show_realname']); |
|
127 | + $r_name = newbbGetUnameFromId($postParentObject->getVar('uid'), $GLOBALS['xoopsModuleConfig']['show_realname']); |
|
128 | 128 | } else { |
129 | - $poster_name = $postParentObject->getVar('poster_name'); |
|
130 | - $r_name = empty($poster_name) ? $myts->htmlSpecialChars($GLOBALS['xoopsConfig']['anonymous']) : $poster_name; |
|
129 | + $poster_name = $postParentObject->getVar('poster_name'); |
|
130 | + $r_name = empty($poster_name) ? $myts->htmlSpecialChars($GLOBALS['xoopsConfig']['anonymous']) : $poster_name; |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | $r_subject = $postParentObject->getVar('subject', 'E'); |
134 | 134 | |
135 | 135 | $subject = $r_subject; |
136 | 136 | if (!preg_match('/^(Re|' . _MD_NEWBB_RE . '):/i', $r_subject)) { |
137 | - $subject = _MD_NEWBB_RE . ': ' . $r_subject; |
|
137 | + $subject = _MD_NEWBB_RE . ': ' . $r_subject; |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | $q_message = $postParentObject->getVar('post_text', 'e'); |
141 | 141 | if ((!$GLOBALS['xoopsModuleConfig']['enable_karma'] || !$postParentObject->getVar('post_karma')) |
142 | - && (!$GLOBALS['xoopsModuleConfig']['allow_require_reply'] || !$postParentObject->getVar('require_reply'))) { |
|
143 | - if (1 === Request::getInt('quotedac', 0, 'GET')) { |
|
144 | - $message = "[quote]\n"; |
|
145 | - $message .= sprintf(_MD_NEWBB_USERWROTE, $r_name); |
|
146 | - $message .= "\n" . $q_message . '[/quote]'; |
|
147 | - $hidden = ''; |
|
148 | - } else { |
|
149 | - $hidden = "[quote]\n"; |
|
150 | - $hidden .= sprintf(_MD_NEWBB_USERWROTE, $r_name); |
|
151 | - $hidden .= "\n" . $q_message . '[/quote]'; |
|
152 | - $message = ''; |
|
153 | - } |
|
142 | + && (!$GLOBALS['xoopsModuleConfig']['allow_require_reply'] || !$postParentObject->getVar('require_reply'))) { |
|
143 | + if (1 === Request::getInt('quotedac', 0, 'GET')) { |
|
144 | + $message = "[quote]\n"; |
|
145 | + $message .= sprintf(_MD_NEWBB_USERWROTE, $r_name); |
|
146 | + $message .= "\n" . $q_message . '[/quote]'; |
|
147 | + $hidden = ''; |
|
148 | + } else { |
|
149 | + $hidden = "[quote]\n"; |
|
150 | + $hidden .= sprintf(_MD_NEWBB_USERWROTE, $r_name); |
|
151 | + $hidden .= "\n" . $q_message . '[/quote]'; |
|
152 | + $message = ''; |
|
153 | + } |
|
154 | 154 | } else { |
155 | - $hidden = ''; |
|
156 | - $message = ''; |
|
155 | + $hidden = ''; |
|
156 | + $message = ''; |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | $isreply = 1; |
@@ -178,29 +178,29 @@ discard block |
||
178 | 178 | $posts_contextObject = $postHandler->getByLimit(5, 0, null, null, true, $topic_id, 1); |
179 | 179 | /** @var Newbb\Post $post_contextObject */ |
180 | 180 | foreach ($posts_contextObject as $post_contextObject) { |
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 | - 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>'; |
|
184 | - } elseif ($GLOBALS['xoopsModuleConfig']['allow_require_reply'] && $post_contextObject->getVar('require_reply')) { |
|
185 | - $p_message = _MD_NEWBB_REPLY_REQUIREMENT; |
|
186 | - } else { |
|
187 | - $p_message = $post_contextObject->getVar('post_text'); |
|
188 | - } |
|
189 | - |
|
190 | - if ($post_contextObject->getVar('uid')) { |
|
191 | - $p_name = newbbGetUnameFromId($post_contextObject->getVar('uid'), $GLOBALS['xoopsModuleConfig']['show_realname']); |
|
192 | - } else { |
|
193 | - $poster_name = $post_contextObject->getVar('poster_name'); |
|
194 | - $p_name = empty($poster_name) ? htmlspecialchars($GLOBALS['xoopsConfig']['anonymous'], ENT_QUOTES | ENT_HTML5) : $poster_name; |
|
195 | - } |
|
196 | - $p_date = formatTimestamp($post_contextObject->getVar('post_time')); |
|
197 | - $p_subject = $post_contextObject->getVar('subject'); |
|
198 | - |
|
199 | - $posts_context[] = [ |
|
200 | - 'subject' => $p_subject, |
|
201 | - 'meta' => _MD_NEWBB_BY . ' ' . $p_name . ' ' . _MD_NEWBB_ON . ' ' . $p_date, |
|
202 | - 'content' => $p_message |
|
203 | - ]; |
|
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 | + 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>'; |
|
184 | + } elseif ($GLOBALS['xoopsModuleConfig']['allow_require_reply'] && $post_contextObject->getVar('require_reply')) { |
|
185 | + $p_message = _MD_NEWBB_REPLY_REQUIREMENT; |
|
186 | + } else { |
|
187 | + $p_message = $post_contextObject->getVar('post_text'); |
|
188 | + } |
|
189 | + |
|
190 | + if ($post_contextObject->getVar('uid')) { |
|
191 | + $p_name = newbbGetUnameFromId($post_contextObject->getVar('uid'), $GLOBALS['xoopsModuleConfig']['show_realname']); |
|
192 | + } else { |
|
193 | + $poster_name = $post_contextObject->getVar('poster_name'); |
|
194 | + $p_name = empty($poster_name) ? htmlspecialchars($GLOBALS['xoopsConfig']['anonymous'], ENT_QUOTES | ENT_HTML5) : $poster_name; |
|
195 | + } |
|
196 | + $p_date = formatTimestamp($post_contextObject->getVar('post_time')); |
|
197 | + $p_subject = $post_contextObject->getVar('subject'); |
|
198 | + |
|
199 | + $posts_context[] = [ |
|
200 | + 'subject' => $p_subject, |
|
201 | + 'meta' => _MD_NEWBB_BY . ' ' . $p_name . ' ' . _MD_NEWBB_ON . ' ' . $p_date, |
|
202 | + 'content' => $p_message |
|
203 | + ]; |
|
204 | 204 | } |
205 | 205 | $xoopsTpl->assign_by_ref('posts_context', $posts_context); |
206 | 206 | // irmtfan move to 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'); |
@@ -44,54 +44,54 @@ discard block |
||
44 | 44 | $query_vars = ['post_id', 'topic_id', 'status', 'order', 'start', 'move', 'mode']; |
45 | 45 | $query_array = []; |
46 | 46 | foreach ($query_vars as $var) { |
47 | - if (Request::getString($var, '', 'GET')) { |
|
48 | - $query_array[$var] = "{$var}=" . Request::getString($var, '', 'GET'); |
|
49 | - } |
|
47 | + if (Request::getString($var, '', 'GET')) { |
|
48 | + $query_array[$var] = "{$var}=" . Request::getString($var, '', 'GET'); |
|
49 | + } |
|
50 | 50 | } |
51 | 51 | $page_query = htmlspecialchars(implode('&', array_values($query_array)), ENT_QUOTES | ENT_HTML5); |
52 | 52 | unset($query_array); |
53 | 53 | |
54 | 54 | $forum_id = Request::getInt('forum', 0, 'GET'); |
55 | 55 | $read = (Request::getString('read', '', 'GET') |
56 | - && 'new' === Request::getString('read', '', 'GET')) ? Request::getString('read', '', 'GET') : ''; |
|
56 | + && 'new' === Request::getString('read', '', 'GET')) ? Request::getString('read', '', 'GET') : ''; |
|
57 | 57 | $topic_id = Request::getInt('topic_id', 0, 'GET'); // isset($_GET['topic_id']) ? (int)($_GET['topic_id']) : 0; |
58 | 58 | $post_id = Request::getInt('post_id', 0, 'GET'); // !empty($_GET['post_id']) ? (int)($_GET['post_id']) : 0; |
59 | 59 | $move = strtolower(Request::getString('move', '', 'GET')); // isset($_GET['move']) ? strtolower($_GET['move']) : ''; |
60 | 60 | $start = Request::getInt('start', 0, 'GET'); // !empty($_GET['start']) ? (int)($_GET['start']) : 0; |
61 | 61 | $status = (Request::getString('status', '', 'GET') |
62 | - && in_array(Request::getString('status', '', 'GET'), ['active', 'pending', 'deleted'], true)) ? Request::getString('status', '', 'GET') : ''; |
|
62 | + && in_array(Request::getString('status', '', 'GET'), ['active', 'pending', 'deleted'], true)) ? Request::getString('status', '', 'GET') : ''; |
|
63 | 63 | $mode = Request::getInt('mode', (!empty($status) ? 2 : 0), 'GET'); // !empty($_GET['mode']) ? (int)($_GET['mode']) : (!empty($status) ? 2 : 0); |
64 | 64 | $order = (Request::getString('order', '', 'GET') |
65 | - && in_array(Request::getString('order', '', 'GET'), ['ASC', 'DESC'], true)) ? Request::getString('order', '', 'GET') : ''; |
|
65 | + && in_array(Request::getString('order', '', 'GET'), ['ASC', 'DESC'], true)) ? Request::getString('order', '', 'GET') : ''; |
|
66 | 66 | |
67 | 67 | if ('' === $order) { |
68 | - if (is_object($GLOBALS['xoopsUser']) && $GLOBALS['xoopsUser']->isActive()) { |
|
69 | - $order = (1 == $GLOBALS['xoopsUser']->getVar('uorder')) ? 'DESC' : 'ASC'; |
|
70 | - } else { |
|
71 | - $order = (1 == $GLOBALS['xoopsConfig']['com_order']) ? 'DESC' : 'ASC'; |
|
72 | - } |
|
68 | + if (is_object($GLOBALS['xoopsUser']) && $GLOBALS['xoopsUser']->isActive()) { |
|
69 | + $order = (1 == $GLOBALS['xoopsUser']->getVar('uorder')) ? 'DESC' : 'ASC'; |
|
70 | + } else { |
|
71 | + $order = (1 == $GLOBALS['xoopsConfig']['com_order']) ? 'DESC' : 'ASC'; |
|
72 | + } |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | if (!$topic_id && !$post_id) { |
76 | - $redirect = empty($forum_id) ? XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/index.php' : XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/viewforum.php?forum={$forum_id}"; |
|
77 | - redirect_header($redirect, 2, _MD_NEWBB_ERRORTOPIC); |
|
76 | + $redirect = empty($forum_id) ? XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/index.php' : XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/viewforum.php?forum={$forum_id}"; |
|
77 | + redirect_header($redirect, 2, _MD_NEWBB_ERRORTOPIC); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | ///** @var Newbb\TopicHandler $topicHandler */ |
81 | 81 | //$topicHandler = Newbb\Helper::getInstance()->getHandler('Topic'); |
82 | 82 | if (!empty($post_id)) { |
83 | - $topicObject = $topicHandler->getByPost($post_id); |
|
84 | - $topic_id = $topicObject->getVar('topic_id'); |
|
83 | + $topicObject = $topicHandler->getByPost($post_id); |
|
84 | + $topic_id = $topicObject->getVar('topic_id'); |
|
85 | 85 | } elseif (!empty($move)) { |
86 | - $topicObject = $topicHandler->getByMove($topic_id, ('prev' === $move) ? -1 : 1, $forum_id); |
|
87 | - $topic_id = $topicObject->getVar('topic_id'); |
|
86 | + $topicObject = $topicHandler->getByMove($topic_id, ('prev' === $move) ? -1 : 1, $forum_id); |
|
87 | + $topic_id = $topicObject->getVar('topic_id'); |
|
88 | 88 | } else { |
89 | - $topicObject = $topicHandler->get($topic_id); |
|
89 | + $topicObject = $topicHandler->get($topic_id); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | if (!is_object($topicObject) || !$topic_id = $topicObject->getVar('topic_id')) { |
93 | - $redirect = empty($forum_id) ? XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/index.php' : XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/viewforum.php?forum={$forum_id}"; |
|
94 | - redirect_header($redirect, 2, _MD_NEWBB_ERRORTOPIC); |
|
93 | + $redirect = empty($forum_id) ? XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/index.php' : XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/viewforum.php?forum={$forum_id}"; |
|
94 | + redirect_header($redirect, 2, _MD_NEWBB_ERRORTOPIC); |
|
95 | 95 | } |
96 | 96 | $forum_id = $topicObject->getVar('forum_id'); |
97 | 97 | ///** @var Newbb\ForumHandler $forumHandler */ |
@@ -101,8 +101,8 @@ discard block |
||
101 | 101 | $isAdmin = newbbIsAdmin($forumObject); |
102 | 102 | |
103 | 103 | if ((!$isAdmin && $topicObject->getVar('approved') < 0) || (!$forumHandler->getPermission($forumObject)) |
104 | - || (!$topicHandler->getPermission($forumObject, $topicObject->getVar('topic_status'), 'view'))) { |
|
105 | - redirect_header(XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewforum.php?forum=' . $forum_id, 2, _MD_NEWBB_NORIGHTTOVIEW); |
|
104 | + || (!$topicHandler->getPermission($forumObject, $topicObject->getVar('topic_status'), 'view'))) { |
|
105 | + redirect_header(XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewforum.php?forum=' . $forum_id, 2, _MD_NEWBB_NORIGHTTOVIEW); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | // START irmtfan - find if topic is read or unread - for all users (member and anon) |
@@ -118,32 +118,32 @@ discard block |
||
118 | 118 | */ |
119 | 119 | $topic_last_post_time_or_id_read = newbbGetRead('topic', $topic_id); |
120 | 120 | if (!empty($topic_last_post_time_or_id_read)) { |
121 | - if (1 == $GLOBALS['xoopsModuleConfig']['read_mode']) { |
|
122 | - // $postHandler = Newbb\Helper::getInstance()->getHandler('Post'); |
|
123 | - $postObject = $postHandler->get($topicObject->getVar('topic_last_post_id')); |
|
124 | - $topic_is_unread = ($topic_last_post_time_or_id_read < $postObject->getVar('post_time')); |
|
125 | - } |
|
126 | - if (2 == $GLOBALS['xoopsModuleConfig']['read_mode']) { |
|
127 | - $topic_is_unread = ($topic_last_post_time_or_id_read < $topicObject->getVar('topic_last_post_id')); |
|
128 | - // hack jump to last post read if post_id is empty - is there any better way? |
|
129 | - if (empty($post_id) && $topic_is_unread |
|
130 | - && !empty($GLOBALS['xoopsModuleConfig']['jump_to_topic_last_post_read_enabled'])) { |
|
131 | - header('Location: ' . Request::getString('REQUEST_URI', '', 'SERVER') . '&post_id=' . $topic_last_post_time_or_id_read); |
|
132 | - } |
|
133 | - } |
|
121 | + if (1 == $GLOBALS['xoopsModuleConfig']['read_mode']) { |
|
122 | + // $postHandler = Newbb\Helper::getInstance()->getHandler('Post'); |
|
123 | + $postObject = $postHandler->get($topicObject->getVar('topic_last_post_id')); |
|
124 | + $topic_is_unread = ($topic_last_post_time_or_id_read < $postObject->getVar('post_time')); |
|
125 | + } |
|
126 | + if (2 == $GLOBALS['xoopsModuleConfig']['read_mode']) { |
|
127 | + $topic_is_unread = ($topic_last_post_time_or_id_read < $topicObject->getVar('topic_last_post_id')); |
|
128 | + // hack jump to last post read if post_id is empty - is there any better way? |
|
129 | + if (empty($post_id) && $topic_is_unread |
|
130 | + && !empty($GLOBALS['xoopsModuleConfig']['jump_to_topic_last_post_read_enabled'])) { |
|
131 | + header('Location: ' . Request::getString('REQUEST_URI', '', 'SERVER') . '&post_id=' . $topic_last_post_time_or_id_read); |
|
132 | + } |
|
133 | + } |
|
134 | 134 | } |
135 | 135 | // END irmtfan - find if topic is read or unread - for all users (member and anon) |
136 | 136 | |
137 | 137 | /* Only admin has access to admin mode */ |
138 | 138 | if (!$isAdmin) { |
139 | - $status = ''; |
|
140 | - $mode = 0; |
|
139 | + $status = ''; |
|
140 | + $mode = 0; |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | if (!empty($GLOBALS['xoopsModuleConfig']['enable_karma'])) { |
144 | - // /** @var Newbb\KarmaHandler $karmaHandler */ |
|
145 | - // $karmaHandler = Newbb\Helper::getInstance()->getHandler('Karma'); |
|
146 | - $user_karma = $karmaHandler->getUserKarma(); |
|
144 | + // /** @var Newbb\KarmaHandler $karmaHandler */ |
|
145 | + // $karmaHandler = Newbb\Helper::getInstance()->getHandler('Karma'); |
|
146 | + $user_karma = $karmaHandler->getUserKarma(); |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | //$viewmode = "flat"; |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | |
155 | 155 | //irmtfan - increment topic_views only if the topic is unread |
156 | 156 | if ($topic_is_unread) { |
157 | - $topicObject->incrementCounter(); |
|
157 | + $topicObject->incrementCounter(); |
|
158 | 158 | } |
159 | 159 | newbbSetRead('topic', $topic_id, $topicObject->getVar('topic_last_post_id')); |
160 | 160 | |
@@ -166,16 +166,16 @@ discard block |
||
166 | 166 | //$xoopsTpl->assign('xoops_module_header', $xoops_module_header); |
167 | 167 | // irmtfan new method |
168 | 168 | if (!empty($GLOBALS['xoopsModuleConfig']['rss_enable'])) { |
169 | - $xoopsTpl->assign('xoops_module_header', ' |
|
169 | + $xoopsTpl->assign('xoops_module_header', ' |
|
170 | 170 | <link rel="alternate" type="application/rss+xml" title="' . $xoopsModule->getVar('name') . '-' . $forumObject->getVar('forum_name') . '" href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/rss.php?f=' . $forumObject->getVar('forum_id') . '" /> |
171 | 171 | ' . @$xoopsTpl->get_template_vars('xoops_module_header')); |
172 | 172 | } |
173 | 173 | |
174 | 174 | if ($GLOBALS['xoopsModuleConfig']['wol_enabled']) { |
175 | - /** @var Newbb\OnlineHandler $onlineHandler */ |
|
176 | - $onlineHandler = Newbb\Helper::getInstance()->getHandler('Online'); |
|
177 | - $onlineHandler->init($forumObject, $topicObject); |
|
178 | - $xoopsTpl->assign('online', $onlineHandler->showOnline()); |
|
175 | + /** @var Newbb\OnlineHandler $onlineHandler */ |
|
176 | + $onlineHandler = Newbb\Helper::getInstance()->getHandler('Online'); |
|
177 | + $onlineHandler->init($forumObject, $topicObject); |
|
178 | + $xoopsTpl->assign('online', $onlineHandler->showOnline()); |
|
179 | 179 | } |
180 | 180 | $xoopsTpl->assign('parentforum', $forumHandler->getParents($forumObject)); |
181 | 181 | // irmtfan - remove icon_path and use newbbDisplayImage |
@@ -189,32 +189,32 @@ discard block |
||
189 | 189 | $iconHandler = newbbGetIconHandler(); // can be use in the follwing codes in this file |
190 | 190 | |
191 | 191 | if ($infobox['show'] > 0) { |
192 | - // irmtfan - remove icon_path and use newbbDisplayImage |
|
193 | - $infobox['icon'] = [ |
|
194 | - 'expand' => $iconHandler->getImageSource('less'), |
|
195 | - 'collapse' => $iconHandler->getImageSource('more') |
|
196 | - ]; |
|
197 | - if (1 == $infobox['show']) { |
|
198 | - $infobox['style'] = 'none'; //irmtfan move semicolon |
|
199 | - $infobox['alt'] = _MD_NEWBB_SEEUSERDATA; |
|
200 | - $infobox['src'] = 'more'; |
|
201 | - } else { |
|
202 | - $infobox['style'] = 'block'; //irmtfan move semicolon |
|
203 | - $infobox['alt'] = _MD_NEWBB_HIDEUSERDATA; |
|
204 | - $infobox['src'] = 'less'; |
|
205 | - } |
|
206 | - $infobox['displayImage'] = newbbDisplayImage($infobox['src'], $infobox['alt']); |
|
192 | + // irmtfan - remove icon_path and use newbbDisplayImage |
|
193 | + $infobox['icon'] = [ |
|
194 | + 'expand' => $iconHandler->getImageSource('less'), |
|
195 | + 'collapse' => $iconHandler->getImageSource('more') |
|
196 | + ]; |
|
197 | + if (1 == $infobox['show']) { |
|
198 | + $infobox['style'] = 'none'; //irmtfan move semicolon |
|
199 | + $infobox['alt'] = _MD_NEWBB_SEEUSERDATA; |
|
200 | + $infobox['src'] = 'more'; |
|
201 | + } else { |
|
202 | + $infobox['style'] = 'block'; //irmtfan move semicolon |
|
203 | + $infobox['alt'] = _MD_NEWBB_HIDEUSERDATA; |
|
204 | + $infobox['src'] = 'less'; |
|
205 | + } |
|
206 | + $infobox['displayImage'] = newbbDisplayImage($infobox['src'], $infobox['alt']); |
|
207 | 207 | } |
208 | 208 | $xoopsTpl->assign('infobox', $infobox); |
209 | 209 | // END irmtfan improve infobox |
210 | 210 | |
211 | 211 | $xoopsTpl->assign([ |
212 | - 'topic_title' => '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/viewtopic.php?topic_id=' . $topic_id . '">' . $topicObject->getFullTitle() . '</a>', |
|
213 | - 'forum_name' => $forumObject->getVar('forum_name'), |
|
214 | - 'lang_nexttopic' => _MD_NEWBB_NEXTTOPIC, |
|
215 | - 'lang_prevtopic' => _MD_NEWBB_PREVTOPIC, |
|
216 | - 'topic_status' => $topicObject->getVar('topic_status') |
|
217 | - ]); |
|
212 | + 'topic_title' => '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/viewtopic.php?topic_id=' . $topic_id . '">' . $topicObject->getFullTitle() . '</a>', |
|
213 | + 'forum_name' => $forumObject->getVar('forum_name'), |
|
214 | + 'lang_nexttopic' => _MD_NEWBB_NEXTTOPIC, |
|
215 | + 'lang_prevtopic' => _MD_NEWBB_PREVTOPIC, |
|
216 | + 'topic_status' => $topicObject->getVar('topic_status') |
|
217 | + ]); |
|
218 | 218 | |
219 | 219 | //$categoryHandler = Newbb\Helper::getInstance()->getHandler('Category'); |
220 | 220 | $categoryObject = $categoryHandler->get($forumObject->getVar('cat_id'), ['cat_title']); |
@@ -231,149 +231,149 @@ discard block |
||
231 | 231 | $t_reply = newbbDisplayImage('t_reply', _MD_NEWBB_REPLY); |
232 | 232 | // irmtfan show topic status if show reg is 0 and revise forum_post_or_register |
233 | 233 | if ($topicHandler->getPermission($forumObject, $topicObject->getVar('topic_status'), 'post')) { |
234 | - $xoopsTpl->assign('forum_post', '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/newtopic.php?forum=' . $forum_id . '"> ' . $t_new . '</a>'); |
|
234 | + $xoopsTpl->assign('forum_post', '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/newtopic.php?forum=' . $forum_id . '"> ' . $t_new . '</a>'); |
|
235 | 235 | } else { |
236 | - if ($topicObject->getVar('topic_status')) { |
|
237 | - $xoopsTpl->assign('topic_lock', _MD_NEWBB_TOPICLOCKED); |
|
238 | - } |
|
239 | - if (!is_object($GLOBALS['xoopsUser']) && !empty($GLOBALS['xoopsModuleConfig']['show_reg'])) { |
|
240 | - $xoopsTpl->assign('forum_register', '<a href="' . XOOPS_URL . '/user.php?xoops_redirect=' . htmlspecialchars($xoopsRequestUri, ENT_QUOTES | ENT_HTML5) . '">' . _MD_NEWBB_REGTOPOST . '</a>'); |
|
241 | - } |
|
236 | + if ($topicObject->getVar('topic_status')) { |
|
237 | + $xoopsTpl->assign('topic_lock', _MD_NEWBB_TOPICLOCKED); |
|
238 | + } |
|
239 | + if (!is_object($GLOBALS['xoopsUser']) && !empty($GLOBALS['xoopsModuleConfig']['show_reg'])) { |
|
240 | + $xoopsTpl->assign('forum_register', '<a href="' . XOOPS_URL . '/user.php?xoops_redirect=' . htmlspecialchars($xoopsRequestUri, ENT_QUOTES | ENT_HTML5) . '">' . _MD_NEWBB_REGTOPOST . '</a>'); |
|
241 | + } |
|
242 | 242 | } |
243 | 243 | // irmtfan for backward compatibility assign forum_post_or_register smarty again. |
244 | 244 | $xoopsTpl->assign('forum_post_or_register', @$xoopsTpl->get_template_vars('forum_post') . @$xoopsTpl->get_template_vars('forum_register') . @$xoopsTpl->get_template_vars('topic_lock')); |
245 | 245 | |
246 | 246 | if ($topicHandler->getPermission($forumObject, $topicObject->getVar('topic_status'), 'reply')) { |
247 | - $xoopsTpl->assign('forum_reply', '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/reply.php?topic_id=' . $topic_id . '"> ' . $t_reply . '</a>'); |
|
247 | + $xoopsTpl->assign('forum_reply', '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/reply.php?topic_id=' . $topic_id . '"> ' . $t_reply . '</a>'); |
|
248 | 248 | } |
249 | 249 | |
250 | 250 | $poster_array = []; |
251 | 251 | $require_reply = false; |
252 | 252 | /** @var Post $eachpost */ |
253 | 253 | foreach ($postsArray as $eachpost) { |
254 | - if ($eachpost->getVar('uid') > 0) { |
|
255 | - $poster_array[$eachpost->getVar('uid')] = 1; |
|
256 | - } |
|
257 | - if ($eachpost->getVar('require_reply') > 0) { |
|
258 | - $require_reply = true; |
|
259 | - } |
|
254 | + if ($eachpost->getVar('uid') > 0) { |
|
255 | + $poster_array[$eachpost->getVar('uid')] = 1; |
|
256 | + } |
|
257 | + if ($eachpost->getVar('require_reply') > 0) { |
|
258 | + $require_reply = true; |
|
259 | + } |
|
260 | 260 | } |
261 | 261 | |
262 | 262 | $userid_array = []; |
263 | 263 | $online = []; |
264 | 264 | if (is_array($poster_array) && count($poster_array) > 0) { |
265 | - /** @var \XoopsMemberHandler $memberHandler */ |
|
266 | - $memberHandler = xoops_getHandler('member'); |
|
267 | - $userid_array = array_keys($poster_array); |
|
268 | - $user_criteria = '(' . implode(',', $userid_array) . ')'; |
|
269 | - $users = $memberHandler->getUsers(new \Criteria('uid', $user_criteria, 'IN'), true); |
|
265 | + /** @var \XoopsMemberHandler $memberHandler */ |
|
266 | + $memberHandler = xoops_getHandler('member'); |
|
267 | + $userid_array = array_keys($poster_array); |
|
268 | + $user_criteria = '(' . implode(',', $userid_array) . ')'; |
|
269 | + $users = $memberHandler->getUsers(new \Criteria('uid', $user_criteria, 'IN'), true); |
|
270 | 270 | } else { |
271 | - $users = []; |
|
271 | + $users = []; |
|
272 | 272 | } |
273 | 273 | |
274 | 274 | $viewtopic_users = []; |
275 | 275 | if (is_array($userid_array) && count($userid_array) > 0) { |
276 | 276 | // require_once $GLOBALS['xoops']->path('modules/' . $xoopsModule->getVar('dirname', 'n') . '/class/user.php'); |
277 | - $userHandler = new Newbb\UserHandler($GLOBALS['xoopsModuleConfig']['groupbar_enabled'], $GLOBALS['xoopsModuleConfig']['wol_enabled']); |
|
278 | - $userHandler->users = $users; |
|
279 | - $userHandler->online = $online; |
|
280 | - $viewtopic_users = $userHandler->getUsers(); |
|
277 | + $userHandler = new Newbb\UserHandler($GLOBALS['xoopsModuleConfig']['groupbar_enabled'], $GLOBALS['xoopsModuleConfig']['wol_enabled']); |
|
278 | + $userHandler->users = $users; |
|
279 | + $userHandler->online = $online; |
|
280 | + $viewtopic_users = $userHandler->getUsers(); |
|
281 | 281 | } |
282 | 282 | unset($users); |
283 | 283 | |
284 | 284 | if ($GLOBALS['xoopsModuleConfig']['allow_require_reply'] && $require_reply) { |
285 | - if (!empty($GLOBALS['xoopsModuleConfig']['cache_enabled'])) { |
|
286 | - $viewtopic_posters = newbbGetSession('t' . $topic_id, true); |
|
287 | - if (!is_array($viewtopic_posters) || 0 === count($viewtopic_posters)) { |
|
288 | - $viewtopic_posters = $topicHandler->getAllPosters($topicObject); |
|
289 | - newbbSetSession('t' . $topic_id, $viewtopic_posters); |
|
290 | - } |
|
291 | - } else { |
|
292 | - $viewtopic_posters = $topicHandler->getAllPosters($topicObject); |
|
293 | - } |
|
285 | + if (!empty($GLOBALS['xoopsModuleConfig']['cache_enabled'])) { |
|
286 | + $viewtopic_posters = newbbGetSession('t' . $topic_id, true); |
|
287 | + if (!is_array($viewtopic_posters) || 0 === count($viewtopic_posters)) { |
|
288 | + $viewtopic_posters = $topicHandler->getAllPosters($topicObject); |
|
289 | + newbbSetSession('t' . $topic_id, $viewtopic_posters); |
|
290 | + } |
|
291 | + } else { |
|
292 | + $viewtopic_posters = $topicHandler->getAllPosters($topicObject); |
|
293 | + } |
|
294 | 294 | } else { |
295 | - $viewtopic_posters = []; |
|
295 | + $viewtopic_posters = []; |
|
296 | 296 | } |
297 | 297 | |
298 | 298 | if ($GLOBALS['xoopsModuleConfig']['show_advertising']) { |
299 | - $post_werbung = [ |
|
300 | - 'post_id' => 0, |
|
301 | - 'post_parent_id' => 0, |
|
302 | - 'post_date' => 0, |
|
303 | - 'post_image' => '', |
|
304 | - 'post_title' => '', |
|
305 | - 'post_text' => '<div style="text-align: center;vertical-align: middle;"><br>' . xoops_getbanner() . '</div>', |
|
306 | - 'post_attachment' => '', |
|
307 | - 'post_edit' => 0, |
|
308 | - 'post_no' => 0, |
|
309 | - 'post_signature' => _MD_NEWBB_ADVERTISING_BLOCK, |
|
310 | - 'poster_ip' => '', |
|
311 | - 'thread_action' => '', |
|
312 | - 'thread_buttons' => '', |
|
313 | - 'mod_buttons' => '', |
|
314 | - 'poster' => [ |
|
315 | - 'uid' => -1, |
|
316 | - 'link' => _MD_NEWBB_ADVERTISING_USER, |
|
317 | - 'avatar' => 'avatars/blank.gif', |
|
318 | - 'regdate' => 0, |
|
319 | - 'last_login' => 0, |
|
320 | - 'rank' => ['title' => ''] |
|
321 | - ], |
|
322 | - // irmtfan add last_login |
|
323 | - 'post_permalink' => '' |
|
324 | - ]; |
|
299 | + $post_werbung = [ |
|
300 | + 'post_id' => 0, |
|
301 | + 'post_parent_id' => 0, |
|
302 | + 'post_date' => 0, |
|
303 | + 'post_image' => '', |
|
304 | + 'post_title' => '', |
|
305 | + 'post_text' => '<div style="text-align: center;vertical-align: middle;"><br>' . xoops_getbanner() . '</div>', |
|
306 | + 'post_attachment' => '', |
|
307 | + 'post_edit' => 0, |
|
308 | + 'post_no' => 0, |
|
309 | + 'post_signature' => _MD_NEWBB_ADVERTISING_BLOCK, |
|
310 | + 'poster_ip' => '', |
|
311 | + 'thread_action' => '', |
|
312 | + 'thread_buttons' => '', |
|
313 | + 'mod_buttons' => '', |
|
314 | + 'poster' => [ |
|
315 | + 'uid' => -1, |
|
316 | + 'link' => _MD_NEWBB_ADVERTISING_USER, |
|
317 | + 'avatar' => 'avatars/blank.gif', |
|
318 | + 'regdate' => 0, |
|
319 | + 'last_login' => 0, |
|
320 | + 'rank' => ['title' => ''] |
|
321 | + ], |
|
322 | + // irmtfan add last_login |
|
323 | + 'post_permalink' => '' |
|
324 | + ]; |
|
325 | 325 | } |
326 | 326 | |
327 | 327 | $i = 0; |
328 | 328 | /** @var Post $eachpost */ |
329 | 329 | foreach ($postsArray as $eachpost) { |
330 | - if ($GLOBALS['xoopsModuleConfig']['show_advertising']) { |
|
331 | - if (2 === $i) { |
|
332 | - $xoopsTpl->append('topic_posts', $post_werbung); |
|
333 | - } |
|
334 | - ++$i; |
|
335 | - } |
|
336 | - $xoopsTpl->append('topic_posts', $eachpost->showPost($isAdmin)); |
|
330 | + if ($GLOBALS['xoopsModuleConfig']['show_advertising']) { |
|
331 | + if (2 === $i) { |
|
332 | + $xoopsTpl->append('topic_posts', $post_werbung); |
|
333 | + } |
|
334 | + ++$i; |
|
335 | + } |
|
336 | + $xoopsTpl->append('topic_posts', $eachpost->showPost($isAdmin)); |
|
337 | 337 | } |
338 | 338 | |
339 | 339 | if ($total_posts > $GLOBALS['xoopsModuleConfig']['posts_per_page']) { |
340 | - require_once $GLOBALS['xoops']->path('class/pagenav.php'); |
|
341 | - |
|
342 | - $nav = new \XoopsPageNav($total_posts, $GLOBALS['xoopsModuleConfig']['posts_per_page'], $start, 'start', 'topic_id=' . $topic_id . '&order=' . $order . '&status=' . $status . '&mode=' . $mode); |
|
343 | - //if (isset($GLOBALS['xoopsModuleConfig']['do_rewrite']) && $GLOBALS['xoopsModuleConfig']['do_rewrite'] === 1) $nav->url = XOOPS_URL . $nav->url; |
|
344 | - if ('select' === $GLOBALS['xoopsModuleConfig']['pagenav_display']) { |
|
345 | - $navi = $nav->renderSelect(); |
|
346 | - } elseif ('image' === $GLOBALS['xoopsModuleConfig']['pagenav_display']) { |
|
347 | - $navi = $nav->renderImageNav(4); |
|
348 | - } else { |
|
349 | - $navi = $nav->renderNav(4); |
|
350 | - } |
|
351 | - $xoopsTpl->assign('forum_page_nav', $navi); |
|
340 | + require_once $GLOBALS['xoops']->path('class/pagenav.php'); |
|
341 | + |
|
342 | + $nav = new \XoopsPageNav($total_posts, $GLOBALS['xoopsModuleConfig']['posts_per_page'], $start, 'start', 'topic_id=' . $topic_id . '&order=' . $order . '&status=' . $status . '&mode=' . $mode); |
|
343 | + //if (isset($GLOBALS['xoopsModuleConfig']['do_rewrite']) && $GLOBALS['xoopsModuleConfig']['do_rewrite'] === 1) $nav->url = XOOPS_URL . $nav->url; |
|
344 | + if ('select' === $GLOBALS['xoopsModuleConfig']['pagenav_display']) { |
|
345 | + $navi = $nav->renderSelect(); |
|
346 | + } elseif ('image' === $GLOBALS['xoopsModuleConfig']['pagenav_display']) { |
|
347 | + $navi = $nav->renderImageNav(4); |
|
348 | + } else { |
|
349 | + $navi = $nav->renderNav(4); |
|
350 | + } |
|
351 | + $xoopsTpl->assign('forum_page_nav', $navi); |
|
352 | 352 | } else { |
353 | - $xoopsTpl->assign('forum_page_nav', ''); |
|
353 | + $xoopsTpl->assign('forum_page_nav', ''); |
|
354 | 354 | } |
355 | 355 | |
356 | 356 | if (empty($post_id)) { |
357 | - $first = array_keys($postsArray); |
|
358 | - $post_id = !empty($first[0]) ? $first[0] : 0; |
|
357 | + $first = array_keys($postsArray); |
|
358 | + $post_id = !empty($first[0]) ? $first[0] : 0; |
|
359 | 359 | } |
360 | 360 | |
361 | 361 | if (!empty($postsArray[$post_id])) { |
362 | - $xoops_pagetitle = $postsArray[$post_id]->getVar('subject') . ' [' . $forumObject->getVar('forum_name') . ']'; |
|
363 | - $xoopsTpl->assign('xoops_pagetitle', $xoops_pagetitle); |
|
364 | - $xoopsOption['xoops_pagetitle'] = $xoops_pagetitle; |
|
365 | - $kw = array_unique(explode(' ', strip_tags($postsArray[$post_id]->getVar('post_text')), 150)); |
|
366 | - asort($kw); |
|
367 | - $kwort = ''; |
|
368 | - $z = 0; |
|
369 | - foreach ($kw as $k) { |
|
370 | - if ($z < 30 && strlen(trim($k)) > 5) { |
|
371 | - $kwort .= trim($k) . ' '; |
|
372 | - ++$z; |
|
373 | - } |
|
374 | - } |
|
375 | - $xoTheme->addMeta('meta', 'keywords', $kwort); |
|
376 | - $xoTheme->addMeta('meta', 'description', substr(strip_tags($postsArray[$post_id]->getVar('post_text')), 0, 120)); |
|
362 | + $xoops_pagetitle = $postsArray[$post_id]->getVar('subject') . ' [' . $forumObject->getVar('forum_name') . ']'; |
|
363 | + $xoopsTpl->assign('xoops_pagetitle', $xoops_pagetitle); |
|
364 | + $xoopsOption['xoops_pagetitle'] = $xoops_pagetitle; |
|
365 | + $kw = array_unique(explode(' ', strip_tags($postsArray[$post_id]->getVar('post_text')), 150)); |
|
366 | + asort($kw); |
|
367 | + $kwort = ''; |
|
368 | + $z = 0; |
|
369 | + foreach ($kw as $k) { |
|
370 | + if ($z < 30 && strlen(trim($k)) > 5) { |
|
371 | + $kwort .= trim($k) . ' '; |
|
372 | + ++$z; |
|
373 | + } |
|
374 | + } |
|
375 | + $xoTheme->addMeta('meta', 'keywords', $kwort); |
|
376 | + $xoTheme->addMeta('meta', 'description', substr(strip_tags($postsArray[$post_id]->getVar('post_text')), 0, 120)); |
|
377 | 377 | } |
378 | 378 | unset($postsArray); |
379 | 379 | |
@@ -395,67 +395,67 @@ discard block |
||
395 | 395 | // START irmtfan add restore to viewtopic |
396 | 396 | // if the topic is active |
397 | 397 | if ($topicObject->getVar('approved') > 0) { |
398 | - $admin_actions['merge'] = [ |
|
399 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=merge&topic_id=' . $topic_id, |
|
400 | - 'name' => _MD_NEWBB_MERGETOPIC, |
|
401 | - 'image' => $ad_merge |
|
402 | - ]; |
|
403 | - $admin_actions['move'] = [ |
|
404 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=move&topic_id=' . $topic_id, |
|
405 | - 'name' => _MD_NEWBB_MOVETOPIC, |
|
406 | - 'image' => $ad_move |
|
407 | - ]; |
|
408 | - $admin_actions['delete'] = [ |
|
409 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=delete&topic_id=' . $topic_id, |
|
410 | - 'name' => _MD_NEWBB_DELETETOPIC, |
|
411 | - 'image' => $ad_delete |
|
412 | - ]; |
|
413 | - if (!$topicObject->getVar('topic_status')) { |
|
414 | - $admin_actions['lock'] = [ |
|
415 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=lock&topic_id=' . $topic_id, |
|
416 | - 'image' => $ad_lock, |
|
417 | - 'name' => _MD_NEWBB_LOCKTOPIC |
|
418 | - ]; |
|
419 | - } else { |
|
420 | - $admin_actions['unlock'] = [ |
|
421 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=unlock&topic_id=' . $topic_id, |
|
422 | - 'image' => $ad_unlock, |
|
423 | - 'name' => _MD_NEWBB_UNLOCKTOPIC |
|
424 | - ]; |
|
425 | - } |
|
426 | - if (!$topicObject->getVar('topic_sticky')) { |
|
427 | - $admin_actions['sticky'] = [ |
|
428 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=sticky&topic_id=' . $topic_id, |
|
429 | - 'image' => $ad_sticky, |
|
430 | - 'name' => _MD_NEWBB_STICKYTOPIC |
|
431 | - ]; |
|
432 | - } else { |
|
433 | - $admin_actions['unsticky'] = [ |
|
434 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=unsticky&topic_id=' . $topic_id, |
|
435 | - 'image' => $ad_unsticky, |
|
436 | - 'name' => _MD_NEWBB_UNSTICKYTOPIC |
|
437 | - ]; |
|
438 | - } |
|
439 | - if (!$topicObject->getVar('topic_digest')) { |
|
440 | - $admin_actions['digest'] = [ |
|
441 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=digest&topic_id=' . $topic_id, |
|
442 | - 'image' => $ad_digest, |
|
443 | - 'name' => _MD_NEWBB_DIGESTTOPIC |
|
444 | - ]; |
|
445 | - } else { |
|
446 | - $admin_actions['undigest'] = [ |
|
447 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=undigest&topic_id=' . $topic_id, |
|
448 | - 'image' => $ad_undigest, |
|
449 | - 'name' => _MD_NEWBB_UNDIGESTTOPIC |
|
450 | - ]; |
|
451 | - } |
|
452 | - // if the topic is pending/deleted then restore/approve |
|
398 | + $admin_actions['merge'] = [ |
|
399 | + 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=merge&topic_id=' . $topic_id, |
|
400 | + 'name' => _MD_NEWBB_MERGETOPIC, |
|
401 | + 'image' => $ad_merge |
|
402 | + ]; |
|
403 | + $admin_actions['move'] = [ |
|
404 | + 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=move&topic_id=' . $topic_id, |
|
405 | + 'name' => _MD_NEWBB_MOVETOPIC, |
|
406 | + 'image' => $ad_move |
|
407 | + ]; |
|
408 | + $admin_actions['delete'] = [ |
|
409 | + 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=delete&topic_id=' . $topic_id, |
|
410 | + 'name' => _MD_NEWBB_DELETETOPIC, |
|
411 | + 'image' => $ad_delete |
|
412 | + ]; |
|
413 | + if (!$topicObject->getVar('topic_status')) { |
|
414 | + $admin_actions['lock'] = [ |
|
415 | + 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=lock&topic_id=' . $topic_id, |
|
416 | + 'image' => $ad_lock, |
|
417 | + 'name' => _MD_NEWBB_LOCKTOPIC |
|
418 | + ]; |
|
419 | + } else { |
|
420 | + $admin_actions['unlock'] = [ |
|
421 | + 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=unlock&topic_id=' . $topic_id, |
|
422 | + 'image' => $ad_unlock, |
|
423 | + 'name' => _MD_NEWBB_UNLOCKTOPIC |
|
424 | + ]; |
|
425 | + } |
|
426 | + if (!$topicObject->getVar('topic_sticky')) { |
|
427 | + $admin_actions['sticky'] = [ |
|
428 | + 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=sticky&topic_id=' . $topic_id, |
|
429 | + 'image' => $ad_sticky, |
|
430 | + 'name' => _MD_NEWBB_STICKYTOPIC |
|
431 | + ]; |
|
432 | + } else { |
|
433 | + $admin_actions['unsticky'] = [ |
|
434 | + 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=unsticky&topic_id=' . $topic_id, |
|
435 | + 'image' => $ad_unsticky, |
|
436 | + 'name' => _MD_NEWBB_UNSTICKYTOPIC |
|
437 | + ]; |
|
438 | + } |
|
439 | + if (!$topicObject->getVar('topic_digest')) { |
|
440 | + $admin_actions['digest'] = [ |
|
441 | + 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=digest&topic_id=' . $topic_id, |
|
442 | + 'image' => $ad_digest, |
|
443 | + 'name' => _MD_NEWBB_DIGESTTOPIC |
|
444 | + ]; |
|
445 | + } else { |
|
446 | + $admin_actions['undigest'] = [ |
|
447 | + 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=undigest&topic_id=' . $topic_id, |
|
448 | + 'image' => $ad_undigest, |
|
449 | + 'name' => _MD_NEWBB_UNDIGESTTOPIC |
|
450 | + ]; |
|
451 | + } |
|
452 | + // if the topic is pending/deleted then restore/approve |
|
453 | 453 | } else { |
454 | - $admin_actions['restore'] = [ |
|
455 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=restore&topic_id=' . $topic_id, |
|
456 | - 'name' => _MD_NEWBB_RESTORETOPIC, |
|
457 | - 'image' => $ad_restore |
|
458 | - ]; |
|
454 | + $admin_actions['restore'] = [ |
|
455 | + 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=restore&topic_id=' . $topic_id, |
|
456 | + 'name' => _MD_NEWBB_RESTORETOPIC, |
|
457 | + 'image' => $ad_restore |
|
458 | + ]; |
|
459 | 459 | } |
460 | 460 | // END irmtfan add restore to viewtopic |
461 | 461 | |
@@ -463,10 +463,10 @@ discard block |
||
463 | 463 | $xoopsTpl->assign('viewer_level', (int)($isAdmin ? 2 : is_object($GLOBALS['xoopsUser']))); |
464 | 464 | |
465 | 465 | if ($GLOBALS['xoopsModuleConfig']['show_permissiontable']) { |
466 | - // /** var Newbb\PermissionHandler $permHandler */ |
|
467 | - // $permHandler = Newbb\Helper::getInstance()->getHandler('Permission'); |
|
468 | - $permission_table = $permHandler->getPermissionTable($forumObject, $topicObject->getVar('topic_status'), $isAdmin); |
|
469 | - $xoopsTpl->assign_by_ref('permission_table', $permission_table); |
|
466 | + // /** var Newbb\PermissionHandler $permHandler */ |
|
467 | + // $permHandler = Newbb\Helper::getInstance()->getHandler('Permission'); |
|
468 | + $permission_table = $permHandler->getPermissionTable($forumObject, $topicObject->getVar('topic_status'), $isAdmin); |
|
469 | + $xoopsTpl->assign_by_ref('permission_table', $permission_table); |
|
470 | 470 | } |
471 | 471 | |
472 | 472 | /////////////////////////////// |
@@ -489,167 +489,167 @@ discard block |
||
489 | 489 | //irmtfan remove |
490 | 490 | $pollModuleHandler = $moduleHandler->getByDirname($GLOBALS['xoopsModuleConfig']['poll_module']); |
491 | 491 | if (is_object($pollModuleHandler) && $pollModuleHandler->getVar('isactive')) { |
492 | - $poll_id = $topicObject->getVar('poll_id'); |
|
493 | - // can vote in poll |
|
494 | - $pollVote = ($topicObject->getVar('topic_haspoll') && $poll_id > 0 |
|
495 | - && $topicHandler->getPermission($forumObject, $topicObject->getVar('topic_status'), 'vote')); |
|
496 | - // can add poll |
|
497 | - $pollAdd = $topicHandler->getPermission($forumObject, $topicObject->getVar('topic_status'), 'addpoll'); |
|
498 | - if ($pollVote || $pollAdd) { |
|
499 | - $pollModuleHandler = $moduleHandler->getByDirname($GLOBALS['xoopsModuleConfig']['poll_module']); |
|
500 | - // new xoopspoll module |
|
501 | - if ($pollModuleHandler->getVar('version') >= 140) { |
|
492 | + $poll_id = $topicObject->getVar('poll_id'); |
|
493 | + // can vote in poll |
|
494 | + $pollVote = ($topicObject->getVar('topic_haspoll') && $poll_id > 0 |
|
495 | + && $topicHandler->getPermission($forumObject, $topicObject->getVar('topic_status'), 'vote')); |
|
496 | + // can add poll |
|
497 | + $pollAdd = $topicHandler->getPermission($forumObject, $topicObject->getVar('topic_status'), 'addpoll'); |
|
498 | + if ($pollVote || $pollAdd) { |
|
499 | + $pollModuleHandler = $moduleHandler->getByDirname($GLOBALS['xoopsModuleConfig']['poll_module']); |
|
500 | + // new xoopspoll module |
|
501 | + if ($pollModuleHandler->getVar('version') >= 140) { |
|
502 | 502 | // xoops_load('renderer', $GLOBALS['xoopsModuleConfig']['poll_module']); |
503 | - xoops_loadLanguage('main', $GLOBALS['xoopsModuleConfig']['poll_module']); |
|
504 | - // old xoopspoll or umfrage or any clone from them |
|
505 | - } else { |
|
506 | - $classPoll = $topicObject->loadOldPoll(); |
|
507 | - } |
|
508 | - } |
|
509 | - // START can vote in poll |
|
510 | - if ($pollVote) { |
|
511 | - $xoopsTpl->assign('topic_poll', 1); |
|
512 | - $uid = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('uid') : 0; |
|
513 | - // new xoopspoll module |
|
514 | - if ($pollModuleHandler->getVar('version') >= 140) { |
|
515 | - $xpollHandler = Xoopspoll\Helper::getInstance()->getHandler('Poll'); |
|
516 | - /** @var \XoopsPoll $pollObject */ |
|
517 | - $pollObject = $xpollHandler->get($poll_id); |
|
518 | - if (is_object($pollObject)) { |
|
519 | - |
|
520 | - /* check to see if user has rights to view the results */ |
|
521 | - $vis_return = $pollObject->isResultVisible(); |
|
522 | - $isVisible = $vis_return; |
|
523 | - $visibleMsg = $isVisible ? '' : $vis_return; |
|
524 | - |
|
525 | - /* setup the module config handler */ |
|
526 | - /** @var \XoopsConfigHandler $configHandler */ |
|
527 | - $configHandler = xoops_getHandler('config'); |
|
528 | - $xp_config = $configHandler->getConfigsByCat(0, $pollModuleHandler->getVar('mid')); |
|
529 | - |
|
530 | - $GLOBALS['xoopsTpl']->assign([ |
|
531 | - 'is_visible' => $isVisible, |
|
532 | - 'visible_message' => $visibleMsg, |
|
533 | - 'disp_votes' => $xp_config['disp_vote_nums'], |
|
534 | - 'lang_vote' => constant('_MD_' . strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']) . '_VOTE'), |
|
535 | - 'lang_results' => constant('_MD_' . strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']) . '_RESULTS'), |
|
536 | - 'back_link' => '' |
|
537 | - ]); |
|
538 | - $classRenderer = ucfirst($GLOBALS['xoopsModuleConfig']['poll_module']) . 'Renderer'; |
|
539 | - /** @var Xoopspoll\Renderer $renderer */ |
|
540 | - $renderer = new $classRenderer($pollObject); |
|
541 | - // check to see if user has voted, show form if not, otherwise get results for form |
|
542 | - |
|
543 | - /** @var Xoopspoll\LogHandler $logHandler */ |
|
544 | - $logHandler = Xoopspoll\Helper::getInstance()->getHandler('Log'); |
|
545 | - if ($pollObject->isAllowedToVote() |
|
546 | - && (!$logHandler->hasVoted($poll_id, xoops_getenv('REMOTE_ADDR'), $uid))) { |
|
547 | - $myTpl = new \XoopsTpl(); |
|
548 | - $renderer->assignForm($myTpl); |
|
549 | - $myTpl->assign('action', $GLOBALS['xoops']->url("modules/newbb/votepolls.php?topic_id={$topic_id}&poll_id={$poll_id}")); |
|
550 | - $topic_pollform = $myTpl->fetch($GLOBALS['xoops']->path('modules/' . $GLOBALS['xoopsModuleConfig']['poll_module'] . '/templates/' . $GLOBALS['xoopsModuleConfig']['poll_module'] . '_view.tpl')); |
|
551 | - $GLOBALS['xoopsTpl']->assign('topic_pollform', $topic_pollform); |
|
552 | - } else { |
|
553 | - $GLOBALS['xoopsTpl']->assign('can_vote', false); |
|
554 | - $xoopsTpl->assign('topic_pollresult', 1); |
|
555 | - $GLOBALS['xoopsTpl']->assign('topic_resultform', $renderer->renderResults()); |
|
556 | - } |
|
557 | - } |
|
558 | - // old xoopspoll or umfrage or any clone from them |
|
559 | - } else { |
|
560 | - $pollObject = new $classPoll($poll_id); |
|
561 | - $classRenderer = $classPoll . 'Renderer'; |
|
562 | - $renderer = new $classRenderer($pollObject); |
|
563 | - $xoopsTpl->assign('lang_alreadyvoted2', _PL_ALREADYVOTED2); |
|
564 | - $xoopsTpl->assign('has_ended', $pollObject->getVar('end_time') < time() ? 1 : 0); |
|
565 | - // umfrage has polltype |
|
566 | - $polltype = $pollObject->getVar('polltype'); |
|
567 | - if (!empty($polltype)) { |
|
568 | - $xoopsTpl->assign('polltype', $polltype); |
|
569 | - switch ($polltype) { |
|
570 | - case 1: |
|
571 | - $xoopsTpl->assign('polltypecomment', ''); |
|
572 | - break; |
|
573 | - case 2: |
|
574 | - $xoopsTpl->assign('polltypecomment', _PL_FULLBLIND); |
|
575 | - break; |
|
576 | - case 3: |
|
577 | - $xoopsTpl->assign('polltypecomment', _PL_HALFBLIND); |
|
578 | - break; |
|
579 | - |
|
580 | - } |
|
581 | - } |
|
582 | - $classLog = $classPoll . 'Log'; |
|
583 | - $hasvoted = 0; |
|
584 | - if ($GLOBALS['xoopsUser']) { |
|
585 | - if ($classLog::hasVoted($poll_id, Request::getString('REMOTE_ADDR', '', 'SERVER'), $uid)) { |
|
586 | - $hasvoted = 1; |
|
587 | - } |
|
588 | - } else { |
|
589 | - $hasvoted = 1; |
|
590 | - } |
|
591 | - $xoopsTpl->assign('hasVoted', $hasvoted); |
|
592 | - $xoopsTpl->assign('lang_vote', _PL_VOTE); |
|
593 | - $xoopsTpl->assign('lang_results', $pollObject->getVar('end_time') < time() ? _PL_RESULTS : _PL_STANDINGS); |
|
594 | - // irmtfan - if the poll is expired show the result |
|
595 | - if ($hasvoted || $pollObject->hasExpired()) { |
|
596 | - $renderer->assignResults($xoopsTpl); |
|
597 | - $xoopsTpl->assign('topic_pollresult', 1); |
|
598 | - setcookie('newbb_polls[' . $poll_id . ']', 1); |
|
599 | - } else { |
|
600 | - $renderer->assignForm($xoopsTpl); |
|
601 | - $xoopsTpl->assign('lang_vote', _PL_VOTE); |
|
602 | - $xoopsTpl->assign('lang_results', _PL_RESULTS); |
|
603 | - setcookie('newbb_polls[' . $poll_id . ']', 1); |
|
604 | - } |
|
605 | - } |
|
606 | - } |
|
607 | - // END can vote in poll |
|
608 | - // START can add poll |
|
609 | - if ($pollAdd) { |
|
610 | - if (!$topicObject->getVar('topic_haspoll')) { |
|
611 | - if (is_object($GLOBALS['xoopsUser']) |
|
612 | - && $GLOBALS['xoopsUser']->getVar('uid') == $topicObject->getVar('topic_poster')) { |
|
613 | - $t_poll = newbbDisplayImage('t_poll', _MD_NEWBB_ADDPOLL); |
|
614 | - $xoopsTpl->assign('forum_addpoll', '<a href=\'' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/polls.php?op=add&topic_id=' . $topic_id . '\'>' . $t_poll . '</a>'); |
|
615 | - } |
|
616 | - } elseif ($isAdmin |
|
617 | - || (is_object($pollObject) && is_object($GLOBALS['xoopsUser']) |
|
618 | - && $GLOBALS['xoopsUser']->getVar('uid') == $pollObject->getVar('user_id'))) { |
|
619 | - $poll_edit = ''; |
|
620 | - $poll_delete = ''; |
|
621 | - $poll_restart = ''; |
|
622 | - $poll_log = ''; |
|
623 | - |
|
624 | - $adminpoll_actions = []; |
|
625 | - $adminpoll_actions['editpoll'] = [ |
|
626 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/polls.php?op=edit&poll_id=' . $topicObject->getVar('poll_id') . '&topic_id=' . $topic_id, |
|
627 | - 'image' => $poll_edit, |
|
628 | - 'name' => _MD_NEWBB_EDITPOLL |
|
629 | - ]; |
|
630 | - $adminpoll_actions['deletepoll'] = [ |
|
631 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/polls.php?op=delete&poll_id=' . $topicObject->getVar('poll_id') . '&topic_id=' . $topic_id, |
|
632 | - 'image' => $poll_delete, |
|
633 | - 'name' => _MD_NEWBB_DELETEPOLL |
|
634 | - ]; |
|
635 | - $adminpoll_actions['restartpoll'] = [ |
|
636 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/polls.php?op=restart&poll_id=' . $topicObject->getVar('poll_id') . '&topic_id=' . $topic_id . '&forum=' . $forum_id, |
|
637 | - 'image' => $poll_restart, |
|
638 | - 'name' => _MD_NEWBB_RESTARTPOLL |
|
639 | - ]; |
|
640 | - $adminpoll_actions['logpoll'] = [ |
|
641 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/polls.php?op=log&poll_id=' . $topicObject->getVar('poll_id') . '&topic_id=' . $topic_id . '&forum=' . $forum_id, |
|
642 | - 'image' => $poll_log, |
|
643 | - 'name' => _MD_NEWBB_POLL_VIEWLOG |
|
644 | - ]; |
|
645 | - |
|
646 | - $xoopsTpl->assign_by_ref('adminpoll_actions', $adminpoll_actions); |
|
647 | - } |
|
648 | - } |
|
649 | - // END can add poll |
|
503 | + xoops_loadLanguage('main', $GLOBALS['xoopsModuleConfig']['poll_module']); |
|
504 | + // old xoopspoll or umfrage or any clone from them |
|
505 | + } else { |
|
506 | + $classPoll = $topicObject->loadOldPoll(); |
|
507 | + } |
|
508 | + } |
|
509 | + // START can vote in poll |
|
510 | + if ($pollVote) { |
|
511 | + $xoopsTpl->assign('topic_poll', 1); |
|
512 | + $uid = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('uid') : 0; |
|
513 | + // new xoopspoll module |
|
514 | + if ($pollModuleHandler->getVar('version') >= 140) { |
|
515 | + $xpollHandler = Xoopspoll\Helper::getInstance()->getHandler('Poll'); |
|
516 | + /** @var \XoopsPoll $pollObject */ |
|
517 | + $pollObject = $xpollHandler->get($poll_id); |
|
518 | + if (is_object($pollObject)) { |
|
519 | + |
|
520 | + /* check to see if user has rights to view the results */ |
|
521 | + $vis_return = $pollObject->isResultVisible(); |
|
522 | + $isVisible = $vis_return; |
|
523 | + $visibleMsg = $isVisible ? '' : $vis_return; |
|
524 | + |
|
525 | + /* setup the module config handler */ |
|
526 | + /** @var \XoopsConfigHandler $configHandler */ |
|
527 | + $configHandler = xoops_getHandler('config'); |
|
528 | + $xp_config = $configHandler->getConfigsByCat(0, $pollModuleHandler->getVar('mid')); |
|
529 | + |
|
530 | + $GLOBALS['xoopsTpl']->assign([ |
|
531 | + 'is_visible' => $isVisible, |
|
532 | + 'visible_message' => $visibleMsg, |
|
533 | + 'disp_votes' => $xp_config['disp_vote_nums'], |
|
534 | + 'lang_vote' => constant('_MD_' . strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']) . '_VOTE'), |
|
535 | + 'lang_results' => constant('_MD_' . strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']) . '_RESULTS'), |
|
536 | + 'back_link' => '' |
|
537 | + ]); |
|
538 | + $classRenderer = ucfirst($GLOBALS['xoopsModuleConfig']['poll_module']) . 'Renderer'; |
|
539 | + /** @var Xoopspoll\Renderer $renderer */ |
|
540 | + $renderer = new $classRenderer($pollObject); |
|
541 | + // check to see if user has voted, show form if not, otherwise get results for form |
|
542 | + |
|
543 | + /** @var Xoopspoll\LogHandler $logHandler */ |
|
544 | + $logHandler = Xoopspoll\Helper::getInstance()->getHandler('Log'); |
|
545 | + if ($pollObject->isAllowedToVote() |
|
546 | + && (!$logHandler->hasVoted($poll_id, xoops_getenv('REMOTE_ADDR'), $uid))) { |
|
547 | + $myTpl = new \XoopsTpl(); |
|
548 | + $renderer->assignForm($myTpl); |
|
549 | + $myTpl->assign('action', $GLOBALS['xoops']->url("modules/newbb/votepolls.php?topic_id={$topic_id}&poll_id={$poll_id}")); |
|
550 | + $topic_pollform = $myTpl->fetch($GLOBALS['xoops']->path('modules/' . $GLOBALS['xoopsModuleConfig']['poll_module'] . '/templates/' . $GLOBALS['xoopsModuleConfig']['poll_module'] . '_view.tpl')); |
|
551 | + $GLOBALS['xoopsTpl']->assign('topic_pollform', $topic_pollform); |
|
552 | + } else { |
|
553 | + $GLOBALS['xoopsTpl']->assign('can_vote', false); |
|
554 | + $xoopsTpl->assign('topic_pollresult', 1); |
|
555 | + $GLOBALS['xoopsTpl']->assign('topic_resultform', $renderer->renderResults()); |
|
556 | + } |
|
557 | + } |
|
558 | + // old xoopspoll or umfrage or any clone from them |
|
559 | + } else { |
|
560 | + $pollObject = new $classPoll($poll_id); |
|
561 | + $classRenderer = $classPoll . 'Renderer'; |
|
562 | + $renderer = new $classRenderer($pollObject); |
|
563 | + $xoopsTpl->assign('lang_alreadyvoted2', _PL_ALREADYVOTED2); |
|
564 | + $xoopsTpl->assign('has_ended', $pollObject->getVar('end_time') < time() ? 1 : 0); |
|
565 | + // umfrage has polltype |
|
566 | + $polltype = $pollObject->getVar('polltype'); |
|
567 | + if (!empty($polltype)) { |
|
568 | + $xoopsTpl->assign('polltype', $polltype); |
|
569 | + switch ($polltype) { |
|
570 | + case 1: |
|
571 | + $xoopsTpl->assign('polltypecomment', ''); |
|
572 | + break; |
|
573 | + case 2: |
|
574 | + $xoopsTpl->assign('polltypecomment', _PL_FULLBLIND); |
|
575 | + break; |
|
576 | + case 3: |
|
577 | + $xoopsTpl->assign('polltypecomment', _PL_HALFBLIND); |
|
578 | + break; |
|
579 | + |
|
580 | + } |
|
581 | + } |
|
582 | + $classLog = $classPoll . 'Log'; |
|
583 | + $hasvoted = 0; |
|
584 | + if ($GLOBALS['xoopsUser']) { |
|
585 | + if ($classLog::hasVoted($poll_id, Request::getString('REMOTE_ADDR', '', 'SERVER'), $uid)) { |
|
586 | + $hasvoted = 1; |
|
587 | + } |
|
588 | + } else { |
|
589 | + $hasvoted = 1; |
|
590 | + } |
|
591 | + $xoopsTpl->assign('hasVoted', $hasvoted); |
|
592 | + $xoopsTpl->assign('lang_vote', _PL_VOTE); |
|
593 | + $xoopsTpl->assign('lang_results', $pollObject->getVar('end_time') < time() ? _PL_RESULTS : _PL_STANDINGS); |
|
594 | + // irmtfan - if the poll is expired show the result |
|
595 | + if ($hasvoted || $pollObject->hasExpired()) { |
|
596 | + $renderer->assignResults($xoopsTpl); |
|
597 | + $xoopsTpl->assign('topic_pollresult', 1); |
|
598 | + setcookie('newbb_polls[' . $poll_id . ']', 1); |
|
599 | + } else { |
|
600 | + $renderer->assignForm($xoopsTpl); |
|
601 | + $xoopsTpl->assign('lang_vote', _PL_VOTE); |
|
602 | + $xoopsTpl->assign('lang_results', _PL_RESULTS); |
|
603 | + setcookie('newbb_polls[' . $poll_id . ']', 1); |
|
604 | + } |
|
605 | + } |
|
606 | + } |
|
607 | + // END can vote in poll |
|
608 | + // START can add poll |
|
609 | + if ($pollAdd) { |
|
610 | + if (!$topicObject->getVar('topic_haspoll')) { |
|
611 | + if (is_object($GLOBALS['xoopsUser']) |
|
612 | + && $GLOBALS['xoopsUser']->getVar('uid') == $topicObject->getVar('topic_poster')) { |
|
613 | + $t_poll = newbbDisplayImage('t_poll', _MD_NEWBB_ADDPOLL); |
|
614 | + $xoopsTpl->assign('forum_addpoll', '<a href=\'' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/polls.php?op=add&topic_id=' . $topic_id . '\'>' . $t_poll . '</a>'); |
|
615 | + } |
|
616 | + } elseif ($isAdmin |
|
617 | + || (is_object($pollObject) && is_object($GLOBALS['xoopsUser']) |
|
618 | + && $GLOBALS['xoopsUser']->getVar('uid') == $pollObject->getVar('user_id'))) { |
|
619 | + $poll_edit = ''; |
|
620 | + $poll_delete = ''; |
|
621 | + $poll_restart = ''; |
|
622 | + $poll_log = ''; |
|
623 | + |
|
624 | + $adminpoll_actions = []; |
|
625 | + $adminpoll_actions['editpoll'] = [ |
|
626 | + 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/polls.php?op=edit&poll_id=' . $topicObject->getVar('poll_id') . '&topic_id=' . $topic_id, |
|
627 | + 'image' => $poll_edit, |
|
628 | + 'name' => _MD_NEWBB_EDITPOLL |
|
629 | + ]; |
|
630 | + $adminpoll_actions['deletepoll'] = [ |
|
631 | + 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/polls.php?op=delete&poll_id=' . $topicObject->getVar('poll_id') . '&topic_id=' . $topic_id, |
|
632 | + 'image' => $poll_delete, |
|
633 | + 'name' => _MD_NEWBB_DELETEPOLL |
|
634 | + ]; |
|
635 | + $adminpoll_actions['restartpoll'] = [ |
|
636 | + 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/polls.php?op=restart&poll_id=' . $topicObject->getVar('poll_id') . '&topic_id=' . $topic_id . '&forum=' . $forum_id, |
|
637 | + 'image' => $poll_restart, |
|
638 | + 'name' => _MD_NEWBB_RESTARTPOLL |
|
639 | + ]; |
|
640 | + $adminpoll_actions['logpoll'] = [ |
|
641 | + 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/polls.php?op=log&poll_id=' . $topicObject->getVar('poll_id') . '&topic_id=' . $topic_id . '&forum=' . $forum_id, |
|
642 | + 'image' => $poll_log, |
|
643 | + 'name' => _MD_NEWBB_POLL_VIEWLOG |
|
644 | + ]; |
|
645 | + |
|
646 | + $xoopsTpl->assign_by_ref('adminpoll_actions', $adminpoll_actions); |
|
647 | + } |
|
648 | + } |
|
649 | + // END can add poll |
|
650 | 650 | } |
651 | 651 | if (isset($pollObject)) { |
652 | - unset($pollObject); |
|
652 | + unset($pollObject); |
|
653 | 653 | } |
654 | 654 | // END irmtfan poll_module |
655 | 655 | |
@@ -664,68 +664,68 @@ discard block |
||
664 | 664 | $xoopsTpl->assign('post_content', newbbDisplayImage('post')); |
665 | 665 | |
666 | 666 | if (!empty($GLOBALS['xoopsModuleConfig']['rating_enabled'])) { |
667 | - $xoopsTpl->assign('votes', $topicObject->getVar('votes')); |
|
668 | - $rating = number_format($topicObject->getVar('rating') / 2, 0); |
|
669 | - if ($rating < 1) { |
|
670 | - $rating_img = newbbDisplayImage('blank'); |
|
671 | - } else { |
|
672 | - // irmtfan - add alt key for rating |
|
673 | - $rating_img = newbbDisplayImage('rate' . $rating, constant('_MD_NEWBB_RATE' . $rating)); |
|
674 | - } |
|
675 | - $xoopsTpl->assign('rating_img', $rating_img); |
|
676 | - $xoopsTpl->assign('rate1', newbbDisplayImage('rate1', _MD_NEWBB_RATE1)); |
|
677 | - $xoopsTpl->assign('rate2', newbbDisplayImage('rate2', _MD_NEWBB_RATE2)); |
|
678 | - $xoopsTpl->assign('rate3', newbbDisplayImage('rate3', _MD_NEWBB_RATE3)); |
|
679 | - $xoopsTpl->assign('rate4', newbbDisplayImage('rate4', _MD_NEWBB_RATE4)); |
|
680 | - $xoopsTpl->assign('rate5', newbbDisplayImage('rate5', _MD_NEWBB_RATE5)); |
|
667 | + $xoopsTpl->assign('votes', $topicObject->getVar('votes')); |
|
668 | + $rating = number_format($topicObject->getVar('rating') / 2, 0); |
|
669 | + if ($rating < 1) { |
|
670 | + $rating_img = newbbDisplayImage('blank'); |
|
671 | + } else { |
|
672 | + // irmtfan - add alt key for rating |
|
673 | + $rating_img = newbbDisplayImage('rate' . $rating, constant('_MD_NEWBB_RATE' . $rating)); |
|
674 | + } |
|
675 | + $xoopsTpl->assign('rating_img', $rating_img); |
|
676 | + $xoopsTpl->assign('rate1', newbbDisplayImage('rate1', _MD_NEWBB_RATE1)); |
|
677 | + $xoopsTpl->assign('rate2', newbbDisplayImage('rate2', _MD_NEWBB_RATE2)); |
|
678 | + $xoopsTpl->assign('rate3', newbbDisplayImage('rate3', _MD_NEWBB_RATE3)); |
|
679 | + $xoopsTpl->assign('rate4', newbbDisplayImage('rate4', _MD_NEWBB_RATE4)); |
|
680 | + $xoopsTpl->assign('rate5', newbbDisplayImage('rate5', _MD_NEWBB_RATE5)); |
|
681 | 681 | } |
682 | 682 | |
683 | 683 | // create jump box |
684 | 684 | if (!empty($GLOBALS['xoopsModuleConfig']['show_jump'])) { |
685 | - require_once __DIR__ . '/include/functions.forum.php'; |
|
686 | - $xoopsTpl->assign('forum_jumpbox', newbbMakeJumpbox($forum_id)); |
|
685 | + require_once __DIR__ . '/include/functions.forum.php'; |
|
686 | + $xoopsTpl->assign('forum_jumpbox', newbbMakeJumpbox($forum_id)); |
|
687 | 687 | } |
688 | 688 | |
689 | 689 | $xoopsTpl->assign([ |
690 | - 'lang_forum_index' => sprintf(_MD_NEWBB_FORUMINDEX, htmlspecialchars($GLOBALS['xoopsConfig']['sitename'], ENT_QUOTES)), |
|
691 | - 'lang_from' => _MD_NEWBB_FROM, |
|
692 | - 'lang_joined' => _MD_NEWBB_JOINED, |
|
693 | - 'lang_posts' => _MD_NEWBB_POSTS, |
|
694 | - 'lang_poster' => _MD_NEWBB_POSTER, |
|
695 | - 'lang_thread' => _MD_NEWBB_THREAD, |
|
696 | - 'lang_edit' => _EDIT, |
|
697 | - 'lang_delete' => _DELETE, |
|
698 | - 'lang_reply' => _REPLY, |
|
699 | - 'lang_postedon' => _MD_NEWBB_POSTEDON, |
|
700 | - 'lang_groups' => _MD_NEWBB_GROUPS |
|
701 | - ]); |
|
690 | + 'lang_forum_index' => sprintf(_MD_NEWBB_FORUMINDEX, htmlspecialchars($GLOBALS['xoopsConfig']['sitename'], ENT_QUOTES)), |
|
691 | + 'lang_from' => _MD_NEWBB_FROM, |
|
692 | + 'lang_joined' => _MD_NEWBB_JOINED, |
|
693 | + 'lang_posts' => _MD_NEWBB_POSTS, |
|
694 | + 'lang_poster' => _MD_NEWBB_POSTER, |
|
695 | + 'lang_thread' => _MD_NEWBB_THREAD, |
|
696 | + 'lang_edit' => _EDIT, |
|
697 | + 'lang_delete' => _DELETE, |
|
698 | + 'lang_reply' => _REPLY, |
|
699 | + 'lang_postedon' => _MD_NEWBB_POSTEDON, |
|
700 | + 'lang_groups' => _MD_NEWBB_GROUPS |
|
701 | + ]); |
|
702 | 702 | |
703 | 703 | $viewmode_options = []; |
704 | 704 | if ('DESC' === $order) { |
705 | - $viewmode_options[] = [ |
|
706 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/viewtopic.php?order=ASC&status=$status&topic_id=' . $topic_id, |
|
707 | - 'title' => _OLDESTFIRST |
|
708 | - ]; |
|
705 | + $viewmode_options[] = [ |
|
706 | + 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/viewtopic.php?order=ASC&status=$status&topic_id=' . $topic_id, |
|
707 | + 'title' => _OLDESTFIRST |
|
708 | + ]; |
|
709 | 709 | } else { |
710 | - $viewmode_options[] = [ |
|
711 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/viewtopic.php?order=DESC&status=$status&topic_id=' . $topic_id, |
|
712 | - 'title' => _NEWESTFIRST |
|
713 | - ]; |
|
710 | + $viewmode_options[] = [ |
|
711 | + 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/viewtopic.php?order=DESC&status=$status&topic_id=' . $topic_id, |
|
712 | + 'title' => _NEWESTFIRST |
|
713 | + ]; |
|
714 | 714 | } |
715 | 715 | |
716 | 716 | switch ($status) { |
717 | - case 'active': |
|
718 | - $current_status = '[' . _MD_NEWBB_TYPE_ADMIN . ']'; |
|
719 | - break; |
|
720 | - case 'pending': |
|
721 | - $current_status = '[' . _MD_NEWBB_TYPE_PENDING . ']'; |
|
722 | - break; |
|
723 | - case 'deleted': |
|
724 | - $current_status = '[' . _MD_NEWBB_TYPE_DELETED . ']'; |
|
725 | - break; |
|
726 | - default: |
|
727 | - $current_status = ''; |
|
728 | - break; |
|
717 | + case 'active': |
|
718 | + $current_status = '[' . _MD_NEWBB_TYPE_ADMIN . ']'; |
|
719 | + break; |
|
720 | + case 'pending': |
|
721 | + $current_status = '[' . _MD_NEWBB_TYPE_PENDING . ']'; |
|
722 | + break; |
|
723 | + case 'deleted': |
|
724 | + $current_status = '[' . _MD_NEWBB_TYPE_DELETED . ']'; |
|
725 | + break; |
|
726 | + default: |
|
727 | + $current_status = ''; |
|
728 | + break; |
|
729 | 729 | } |
730 | 730 | $xoopsTpl->assign('topicstatus', $current_status); |
731 | 731 | |
@@ -741,91 +741,91 @@ discard block |
||
741 | 741 | //check banning |
742 | 742 | //$moderateHandler = Newbb\Helper::getInstance()->getHandler('Moderate'); |
743 | 743 | if (!empty($GLOBALS['xoopsModuleConfig']['quickreply_enabled']) |
744 | - && $topicHandler->getPermission($forumObject, $topicObject->getVar('topic_status'), 'reply') |
|
745 | - && $moderateHandler->verifyUser(-1, '', $forumObject->getVar('forum_id'))) { |
|
746 | - // END irmtfan add verifyUser to quick reply |
|
747 | - $forum_form = new \XoopsThemeForm(_MD_NEWBB_POSTREPLY, 'quick_reply', XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/post.php', 'post', true); |
|
748 | - if (!is_object($GLOBALS['xoopsUser'])) { |
|
749 | - //$configHandler = xoops_getHandler('config'); |
|
750 | - $user_tray = new \XoopsFormElementTray(_MD_NEWBB_ACCOUNT); |
|
751 | - $user_tray->addElement(new \XoopsFormText(_MD_NEWBB_NAME, 'uname', 26, 255)); |
|
752 | - $user_tray->addElement(new \XoopsFormPassword(_MD_NEWBB_PASSWORD, 'pass', 10, 32)); |
|
753 | - $login_checkbox = new \XoopsFormCheckBox('', 'login', 1); |
|
754 | - $login_checkbox->addOption(1, _MD_NEWBB_LOGIN); |
|
755 | - $user_tray->addElement($login_checkbox); |
|
756 | - $forum_form->addElement($user_tray); |
|
757 | - $captcha = new \XoopsFormCaptcha('', "topic_{$topic_id}_{$start}"); |
|
758 | - $captcha->setConfig('mode', 'text'); |
|
759 | - $forum_form->addElement($captcha); |
|
760 | - } |
|
761 | - |
|
762 | - //$quickform = ( !empty($GLOBALS['xoopsModuleConfig']["editor_default"]) ) ? $GLOBALS['xoopsModuleConfig']["editor_default"] : "textarea"; |
|
763 | - $quickform = !empty($GLOBALS['xoopsModuleConfig']['editor_quick_default']) ? $GLOBALS['xoopsModuleConfig']['editor_quick_default'] : 'textarea'; |
|
764 | - $editor_configs = []; |
|
765 | - $editor_configs ['name'] = 'message'; |
|
766 | - //$editor_configs [ "value" ] = $message ; |
|
767 | - $editor_configs ['rows'] = empty($GLOBALS['xoopsModuleConfig'] ['editor_rows']) ? 10 : $GLOBALS['xoopsModuleConfig'] ['editor_rows']; |
|
768 | - $editor_configs ['cols'] = empty($GLOBALS['xoopsModuleConfig'] ['editor_cols']) ? 30 : $GLOBALS['xoopsModuleConfig'] ['editor_cols']; |
|
769 | - $editor_configs ['width'] = empty($GLOBALS['xoopsModuleConfig'] ['editor_width']) ? '100%' : $GLOBALS['xoopsModuleConfig'] ['editor_width']; |
|
770 | - $editor_configs ['height'] = empty($GLOBALS['xoopsModuleConfig'] ['editor_height']) ? '400px' : $GLOBALS['xoopsModuleConfig'] ['editor_height']; |
|
771 | - $_editor = new \XoopsFormEditor(_MD_NEWBB_MESSAGEC, $quickform, $editor_configs, true); |
|
772 | - $forum_form->addElement($_editor, true); |
|
773 | - |
|
774 | - $forum_form->addElement(new \XoopsFormHidden('dohtml', 0)); |
|
775 | - $forum_form->addElement(new \XoopsFormHidden('dosmiley', 1)); |
|
776 | - $forum_form->addElement(new \XoopsFormHidden('doxcode', 1)); |
|
777 | - $forum_form->addElement(new \XoopsFormHidden('dobr', 1)); |
|
778 | - $forum_form->addElement(new \XoopsFormHidden('attachsig', 1)); |
|
779 | - |
|
780 | - $forum_form->addElement(new \XoopsFormHidden('isreply', 1)); |
|
781 | - |
|
782 | - $forum_form->addElement(new \XoopsFormHidden('subject', _MD_NEWBB_RE . ': ' . $topicObject->getVar('topic_title', 'e'))); |
|
783 | - $forum_form->addElement(new \XoopsFormHidden('pid', empty($post_id) ? $topicHandler->getTopPostId($topic_id) : $post_id)); |
|
784 | - $forum_form->addElement(new \XoopsFormHidden('topic_id', $topic_id)); |
|
785 | - $forum_form->addElement(new \XoopsFormHidden('forum', $forum_id)); |
|
786 | - //$forum_form->addElement(new \XoopsFormHidden('viewmode', $viewmode)); |
|
787 | - $forum_form->addElement(new \XoopsFormHidden('order', $order)); |
|
788 | - $forum_form->addElement(new \XoopsFormHidden('start', $start)); |
|
789 | - |
|
790 | - $forum_form->addElement(new \XoopsFormHidden('notify', -1)); |
|
791 | - $forum_form->addElement(new \XoopsFormHidden('contents_submit', 1)); |
|
792 | - |
|
793 | - $submit_button = new \XoopsFormButton('', 'quick_submit', _SUBMIT, 'submit'); |
|
794 | - $submit_button->setExtra('onclick="if (document.forms.quick_reply.message.value === \'RE\' || document.forms.quick_reply.message.value === \'\') { alert(\'' . _MD_NEWBB_QUICKREPLY_EMPTY . '\'); return false;} else { return true;}"'); |
|
795 | - $forum_form->addElement($submit_button); |
|
796 | - |
|
797 | - $toggles = newbbGetCookie('G', true); |
|
798 | - // START irmtfan improve quickreply smarty variable - add alt key to quick reply button - change $display to $style for more comprehension - add toggle $quickreply['expand'] |
|
799 | - $quickreply = []; |
|
800 | - $qr_collapse = 't_qr'; |
|
801 | - $qr_expand = 't_qr_expand'; // change this |
|
802 | - $quickreply['icon'] = [ |
|
803 | - 'expand' => $iconHandler->getImageSource($qr_expand), |
|
804 | - 'collapse' => $iconHandler->getImageSource($qr_collapse) |
|
805 | - ]; |
|
806 | - $quickreply['show'] = 1; // = !empty($GLOBALS['xoopsModuleConfig']['quickreply_enabled'] |
|
807 | - $quickreply['expand'] = (count($toggles) > 0) ? (in_array('qr', $toggles, true) ? false : true) : true; |
|
808 | - if ($quickreply['expand']) { |
|
809 | - $quickreply['style'] = 'block'; //irmtfan move semicolon |
|
810 | - $quickreply_icon_display = $qr_expand; |
|
811 | - $quickreply_alt = _MD_NEWBB_HIDE . ' ' . _MD_NEWBB_QUICKREPLY; |
|
812 | - } else { |
|
813 | - $quickreply['style'] = 'none'; //irmtfan move semicolon |
|
814 | - $quickreply_icon_display = $qr_collapse; |
|
815 | - $quickreply_alt = _MD_NEWBB_SEE . ' ' . _MD_NEWBB_QUICKREPLY; |
|
816 | - } |
|
817 | - $quickreply['displayImage'] = newbbDisplayImage($quickreply_icon_display, $quickreply_alt); |
|
818 | - $quickreply['form'] = $forum_form->render(); |
|
819 | - $xoopsTpl->assign('quickreply', $quickreply); |
|
820 | - // END irmtfan improve quickreply smarty variable |
|
821 | - unset($forum_form); |
|
744 | + && $topicHandler->getPermission($forumObject, $topicObject->getVar('topic_status'), 'reply') |
|
745 | + && $moderateHandler->verifyUser(-1, '', $forumObject->getVar('forum_id'))) { |
|
746 | + // END irmtfan add verifyUser to quick reply |
|
747 | + $forum_form = new \XoopsThemeForm(_MD_NEWBB_POSTREPLY, 'quick_reply', XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/post.php', 'post', true); |
|
748 | + if (!is_object($GLOBALS['xoopsUser'])) { |
|
749 | + //$configHandler = xoops_getHandler('config'); |
|
750 | + $user_tray = new \XoopsFormElementTray(_MD_NEWBB_ACCOUNT); |
|
751 | + $user_tray->addElement(new \XoopsFormText(_MD_NEWBB_NAME, 'uname', 26, 255)); |
|
752 | + $user_tray->addElement(new \XoopsFormPassword(_MD_NEWBB_PASSWORD, 'pass', 10, 32)); |
|
753 | + $login_checkbox = new \XoopsFormCheckBox('', 'login', 1); |
|
754 | + $login_checkbox->addOption(1, _MD_NEWBB_LOGIN); |
|
755 | + $user_tray->addElement($login_checkbox); |
|
756 | + $forum_form->addElement($user_tray); |
|
757 | + $captcha = new \XoopsFormCaptcha('', "topic_{$topic_id}_{$start}"); |
|
758 | + $captcha->setConfig('mode', 'text'); |
|
759 | + $forum_form->addElement($captcha); |
|
760 | + } |
|
761 | + |
|
762 | + //$quickform = ( !empty($GLOBALS['xoopsModuleConfig']["editor_default"]) ) ? $GLOBALS['xoopsModuleConfig']["editor_default"] : "textarea"; |
|
763 | + $quickform = !empty($GLOBALS['xoopsModuleConfig']['editor_quick_default']) ? $GLOBALS['xoopsModuleConfig']['editor_quick_default'] : 'textarea'; |
|
764 | + $editor_configs = []; |
|
765 | + $editor_configs ['name'] = 'message'; |
|
766 | + //$editor_configs [ "value" ] = $message ; |
|
767 | + $editor_configs ['rows'] = empty($GLOBALS['xoopsModuleConfig'] ['editor_rows']) ? 10 : $GLOBALS['xoopsModuleConfig'] ['editor_rows']; |
|
768 | + $editor_configs ['cols'] = empty($GLOBALS['xoopsModuleConfig'] ['editor_cols']) ? 30 : $GLOBALS['xoopsModuleConfig'] ['editor_cols']; |
|
769 | + $editor_configs ['width'] = empty($GLOBALS['xoopsModuleConfig'] ['editor_width']) ? '100%' : $GLOBALS['xoopsModuleConfig'] ['editor_width']; |
|
770 | + $editor_configs ['height'] = empty($GLOBALS['xoopsModuleConfig'] ['editor_height']) ? '400px' : $GLOBALS['xoopsModuleConfig'] ['editor_height']; |
|
771 | + $_editor = new \XoopsFormEditor(_MD_NEWBB_MESSAGEC, $quickform, $editor_configs, true); |
|
772 | + $forum_form->addElement($_editor, true); |
|
773 | + |
|
774 | + $forum_form->addElement(new \XoopsFormHidden('dohtml', 0)); |
|
775 | + $forum_form->addElement(new \XoopsFormHidden('dosmiley', 1)); |
|
776 | + $forum_form->addElement(new \XoopsFormHidden('doxcode', 1)); |
|
777 | + $forum_form->addElement(new \XoopsFormHidden('dobr', 1)); |
|
778 | + $forum_form->addElement(new \XoopsFormHidden('attachsig', 1)); |
|
779 | + |
|
780 | + $forum_form->addElement(new \XoopsFormHidden('isreply', 1)); |
|
781 | + |
|
782 | + $forum_form->addElement(new \XoopsFormHidden('subject', _MD_NEWBB_RE . ': ' . $topicObject->getVar('topic_title', 'e'))); |
|
783 | + $forum_form->addElement(new \XoopsFormHidden('pid', empty($post_id) ? $topicHandler->getTopPostId($topic_id) : $post_id)); |
|
784 | + $forum_form->addElement(new \XoopsFormHidden('topic_id', $topic_id)); |
|
785 | + $forum_form->addElement(new \XoopsFormHidden('forum', $forum_id)); |
|
786 | + //$forum_form->addElement(new \XoopsFormHidden('viewmode', $viewmode)); |
|
787 | + $forum_form->addElement(new \XoopsFormHidden('order', $order)); |
|
788 | + $forum_form->addElement(new \XoopsFormHidden('start', $start)); |
|
789 | + |
|
790 | + $forum_form->addElement(new \XoopsFormHidden('notify', -1)); |
|
791 | + $forum_form->addElement(new \XoopsFormHidden('contents_submit', 1)); |
|
792 | + |
|
793 | + $submit_button = new \XoopsFormButton('', 'quick_submit', _SUBMIT, 'submit'); |
|
794 | + $submit_button->setExtra('onclick="if (document.forms.quick_reply.message.value === \'RE\' || document.forms.quick_reply.message.value === \'\') { alert(\'' . _MD_NEWBB_QUICKREPLY_EMPTY . '\'); return false;} else { return true;}"'); |
|
795 | + $forum_form->addElement($submit_button); |
|
796 | + |
|
797 | + $toggles = newbbGetCookie('G', true); |
|
798 | + // START irmtfan improve quickreply smarty variable - add alt key to quick reply button - change $display to $style for more comprehension - add toggle $quickreply['expand'] |
|
799 | + $quickreply = []; |
|
800 | + $qr_collapse = 't_qr'; |
|
801 | + $qr_expand = 't_qr_expand'; // change this |
|
802 | + $quickreply['icon'] = [ |
|
803 | + 'expand' => $iconHandler->getImageSource($qr_expand), |
|
804 | + 'collapse' => $iconHandler->getImageSource($qr_collapse) |
|
805 | + ]; |
|
806 | + $quickreply['show'] = 1; // = !empty($GLOBALS['xoopsModuleConfig']['quickreply_enabled'] |
|
807 | + $quickreply['expand'] = (count($toggles) > 0) ? (in_array('qr', $toggles, true) ? false : true) : true; |
|
808 | + if ($quickreply['expand']) { |
|
809 | + $quickreply['style'] = 'block'; //irmtfan move semicolon |
|
810 | + $quickreply_icon_display = $qr_expand; |
|
811 | + $quickreply_alt = _MD_NEWBB_HIDE . ' ' . _MD_NEWBB_QUICKREPLY; |
|
812 | + } else { |
|
813 | + $quickreply['style'] = 'none'; //irmtfan move semicolon |
|
814 | + $quickreply_icon_display = $qr_collapse; |
|
815 | + $quickreply_alt = _MD_NEWBB_SEE . ' ' . _MD_NEWBB_QUICKREPLY; |
|
816 | + } |
|
817 | + $quickreply['displayImage'] = newbbDisplayImage($quickreply_icon_display, $quickreply_alt); |
|
818 | + $quickreply['form'] = $forum_form->render(); |
|
819 | + $xoopsTpl->assign('quickreply', $quickreply); |
|
820 | + // END irmtfan improve quickreply smarty variable |
|
821 | + unset($forum_form); |
|
822 | 822 | } else { |
823 | - $xoopsTpl->assign('quickreply', ['show' => 0]); |
|
823 | + $xoopsTpl->assign('quickreply', ['show' => 0]); |
|
824 | 824 | } |
825 | 825 | |
826 | 826 | if ($GLOBALS['xoopsModuleConfig']['do_tag'] |
827 | - && @require_once $GLOBALS['xoops']->path('modules/tag/include/tagbar.php')) { |
|
828 | - $xoopsTpl->assign('tagbar', tagBar($topicObject->getVar('topic_tags', 'n'))); |
|
827 | + && @require_once $GLOBALS['xoops']->path('modules/tag/include/tagbar.php')) { |
|
828 | + $xoopsTpl->assign('tagbar', tagBar($topicObject->getVar('topic_tags', 'n'))); |
|
829 | 829 | } |
830 | 830 | // irmtfan move to footer.php |
831 | 831 | require_once __DIR__ . '/footer.php'; |
@@ -714,18 +714,18 @@ |
||
714 | 714 | } |
715 | 715 | |
716 | 716 | switch ($status) { |
717 | - case 'active': |
|
718 | - $current_status = '[' . _MD_NEWBB_TYPE_ADMIN . ']'; |
|
719 | - break; |
|
720 | - case 'pending': |
|
721 | - $current_status = '[' . _MD_NEWBB_TYPE_PENDING . ']'; |
|
722 | - break; |
|
723 | - case 'deleted': |
|
724 | - $current_status = '[' . _MD_NEWBB_TYPE_DELETED . ']'; |
|
725 | - break; |
|
726 | - default: |
|
727 | - $current_status = ''; |
|
728 | - break; |
|
717 | + case 'active': |
|
718 | + $current_status = '[' . _MD_NEWBB_TYPE_ADMIN . ']'; |
|
719 | + break; |
|
720 | + case 'pending': |
|
721 | + $current_status = '[' . _MD_NEWBB_TYPE_PENDING . ']'; |
|
722 | + break; |
|
723 | + case 'deleted': |
|
724 | + $current_status = '[' . _MD_NEWBB_TYPE_DELETED . ']'; |
|
725 | + break; |
|
726 | + default: |
|
727 | + $current_status = ''; |
|
728 | + break; |
|
729 | 729 | } |
730 | 730 | $xoopsTpl->assign('topicstatus', $current_status); |
731 | 731 |
@@ -34,10 +34,10 @@ discard block |
||
34 | 34 | use XoopsModules\Newbb; |
35 | 35 | use XoopsModules\Xoopspoll; |
36 | 36 | |
37 | -require_once __DIR__ . '/header.php'; |
|
37 | +require_once __DIR__.'/header.php'; |
|
38 | 38 | $xoopsLogger->startTime('newBB_viewtopic'); |
39 | -require_once __DIR__ . '/include/functions.read.php'; |
|
40 | -require_once __DIR__ . '/include/functions.render.php'; |
|
39 | +require_once __DIR__.'/include/functions.read.php'; |
|
40 | +require_once __DIR__.'/include/functions.render.php'; |
|
41 | 41 | xoops_loadLanguage('user'); |
42 | 42 | |
43 | 43 | /*Build the page query*/ |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | $query_array = []; |
46 | 46 | foreach ($query_vars as $var) { |
47 | 47 | if (Request::getString($var, '', 'GET')) { |
48 | - $query_array[$var] = "{$var}=" . Request::getString($var, '', 'GET'); |
|
48 | + $query_array[$var] = "{$var}=".Request::getString($var, '', 'GET'); |
|
49 | 49 | } |
50 | 50 | } |
51 | 51 | $page_query = htmlspecialchars(implode('&', array_values($query_array)), ENT_QUOTES | ENT_HTML5); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | } |
74 | 74 | |
75 | 75 | if (!$topic_id && !$post_id) { |
76 | - $redirect = empty($forum_id) ? XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/index.php' : XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/viewforum.php?forum={$forum_id}"; |
|
76 | + $redirect = empty($forum_id) ? XOOPS_URL . '/modules/'.$xoopsModule->getVar('dirname').'/index.php' : XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/viewforum.php?forum={$forum_id}"; |
|
77 | 77 | redirect_header($redirect, 2, _MD_NEWBB_ERRORTOPIC); |
78 | 78 | } |
79 | 79 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | } |
91 | 91 | |
92 | 92 | if (!is_object($topicObject) || !$topic_id = $topicObject->getVar('topic_id')) { |
93 | - $redirect = empty($forum_id) ? XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/index.php' : XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/viewforum.php?forum={$forum_id}"; |
|
93 | + $redirect = empty($forum_id) ? XOOPS_URL . '/modules/'.$xoopsModule->getVar('dirname').'/index.php' : XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/viewforum.php?forum={$forum_id}"; |
|
94 | 94 | redirect_header($redirect, 2, _MD_NEWBB_ERRORTOPIC); |
95 | 95 | } |
96 | 96 | $forum_id = $topicObject->getVar('forum_id'); |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | |
103 | 103 | if ((!$isAdmin && $topicObject->getVar('approved') < 0) || (!$forumHandler->getPermission($forumObject)) |
104 | 104 | || (!$topicHandler->getPermission($forumObject, $topicObject->getVar('topic_status'), 'view'))) { |
105 | - redirect_header(XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewforum.php?forum=' . $forum_id, 2, _MD_NEWBB_NORIGHTTOVIEW); |
|
105 | + redirect_header(XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/viewforum.php?forum='.$forum_id, 2, _MD_NEWBB_NORIGHTTOVIEW); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | // START irmtfan - find if topic is read or unread - for all users (member and anon) |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | // hack jump to last post read if post_id is empty - is there any better way? |
129 | 129 | if (empty($post_id) && $topic_is_unread |
130 | 130 | && !empty($GLOBALS['xoopsModuleConfig']['jump_to_topic_last_post_read_enabled'])) { |
131 | - header('Location: ' . Request::getString('REQUEST_URI', '', 'SERVER') . '&post_id=' . $topic_last_post_time_or_id_read); |
|
131 | + header('Location: '.Request::getString('REQUEST_URI', '', 'SERVER').'&post_id='.$topic_last_post_time_or_id_read); |
|
132 | 132 | } |
133 | 133 | } |
134 | 134 | } |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | // irmtfan new method |
168 | 168 | if (!empty($GLOBALS['xoopsModuleConfig']['rss_enable'])) { |
169 | 169 | $xoopsTpl->assign('xoops_module_header', ' |
170 | - <link rel="alternate" type="application/rss+xml" title="' . $xoopsModule->getVar('name') . '-' . $forumObject->getVar('forum_name') . '" href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/rss.php?f=' . $forumObject->getVar('forum_id') . '" /> |
|
170 | + <link rel="alternate" type="application/rss+xml" title="' . $xoopsModule->getVar('name').'-'.$forumObject->getVar('forum_name').'" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/rss.php?f='.$forumObject->getVar('forum_id').'" /> |
|
171 | 171 | ' . @$xoopsTpl->get_template_vars('xoops_module_header')); |
172 | 172 | } |
173 | 173 | |
@@ -195,11 +195,11 @@ discard block |
||
195 | 195 | 'collapse' => $iconHandler->getImageSource('more') |
196 | 196 | ]; |
197 | 197 | if (1 == $infobox['show']) { |
198 | - $infobox['style'] = 'none'; //irmtfan move semicolon |
|
198 | + $infobox['style'] = 'none'; //irmtfan move semicolon |
|
199 | 199 | $infobox['alt'] = _MD_NEWBB_SEEUSERDATA; |
200 | 200 | $infobox['src'] = 'more'; |
201 | 201 | } else { |
202 | - $infobox['style'] = 'block'; //irmtfan move semicolon |
|
202 | + $infobox['style'] = 'block'; //irmtfan move semicolon |
|
203 | 203 | $infobox['alt'] = _MD_NEWBB_HIDEUSERDATA; |
204 | 204 | $infobox['src'] = 'less'; |
205 | 205 | } |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | // END irmtfan improve infobox |
210 | 210 | |
211 | 211 | $xoopsTpl->assign([ |
212 | - 'topic_title' => '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/viewtopic.php?topic_id=' . $topic_id . '">' . $topicObject->getFullTitle() . '</a>', |
|
212 | + 'topic_title' => '<a href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/viewtopic.php?topic_id='.$topic_id.'">'.$topicObject->getFullTitle().'</a>', |
|
213 | 213 | 'forum_name' => $forumObject->getVar('forum_name'), |
214 | 214 | 'lang_nexttopic' => _MD_NEWBB_NEXTTOPIC, |
215 | 215 | 'lang_prevtopic' => _MD_NEWBB_PREVTOPIC, |
@@ -231,20 +231,20 @@ discard block |
||
231 | 231 | $t_reply = newbbDisplayImage('t_reply', _MD_NEWBB_REPLY); |
232 | 232 | // irmtfan show topic status if show reg is 0 and revise forum_post_or_register |
233 | 233 | if ($topicHandler->getPermission($forumObject, $topicObject->getVar('topic_status'), 'post')) { |
234 | - $xoopsTpl->assign('forum_post', '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/newtopic.php?forum=' . $forum_id . '"> ' . $t_new . '</a>'); |
|
234 | + $xoopsTpl->assign('forum_post', '<a href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/newtopic.php?forum='.$forum_id.'"> '.$t_new.'</a>'); |
|
235 | 235 | } else { |
236 | 236 | if ($topicObject->getVar('topic_status')) { |
237 | 237 | $xoopsTpl->assign('topic_lock', _MD_NEWBB_TOPICLOCKED); |
238 | 238 | } |
239 | 239 | if (!is_object($GLOBALS['xoopsUser']) && !empty($GLOBALS['xoopsModuleConfig']['show_reg'])) { |
240 | - $xoopsTpl->assign('forum_register', '<a href="' . XOOPS_URL . '/user.php?xoops_redirect=' . htmlspecialchars($xoopsRequestUri, ENT_QUOTES | ENT_HTML5) . '">' . _MD_NEWBB_REGTOPOST . '</a>'); |
|
240 | + $xoopsTpl->assign('forum_register', '<a href="'.XOOPS_URL.'/user.php?xoops_redirect='.htmlspecialchars($xoopsRequestUri, ENT_QUOTES | ENT_HTML5).'">'._MD_NEWBB_REGTOPOST.'</a>'); |
|
241 | 241 | } |
242 | 242 | } |
243 | 243 | // irmtfan for backward compatibility assign forum_post_or_register smarty again. |
244 | -$xoopsTpl->assign('forum_post_or_register', @$xoopsTpl->get_template_vars('forum_post') . @$xoopsTpl->get_template_vars('forum_register') . @$xoopsTpl->get_template_vars('topic_lock')); |
|
244 | +$xoopsTpl->assign('forum_post_or_register', @$xoopsTpl->get_template_vars('forum_post').@$xoopsTpl->get_template_vars('forum_register').@$xoopsTpl->get_template_vars('topic_lock')); |
|
245 | 245 | |
246 | 246 | if ($topicHandler->getPermission($forumObject, $topicObject->getVar('topic_status'), 'reply')) { |
247 | - $xoopsTpl->assign('forum_reply', '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/reply.php?topic_id=' . $topic_id . '"> ' . $t_reply . '</a>'); |
|
247 | + $xoopsTpl->assign('forum_reply', '<a href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/reply.php?topic_id='.$topic_id.'"> '.$t_reply.'</a>'); |
|
248 | 248 | } |
249 | 249 | |
250 | 250 | $poster_array = []; |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | /** @var \XoopsMemberHandler $memberHandler */ |
266 | 266 | $memberHandler = xoops_getHandler('member'); |
267 | 267 | $userid_array = array_keys($poster_array); |
268 | - $user_criteria = '(' . implode(',', $userid_array) . ')'; |
|
268 | + $user_criteria = '('.implode(',', $userid_array).')'; |
|
269 | 269 | $users = $memberHandler->getUsers(new \Criteria('uid', $user_criteria, 'IN'), true); |
270 | 270 | } else { |
271 | 271 | $users = []; |
@@ -283,10 +283,10 @@ discard block |
||
283 | 283 | |
284 | 284 | if ($GLOBALS['xoopsModuleConfig']['allow_require_reply'] && $require_reply) { |
285 | 285 | if (!empty($GLOBALS['xoopsModuleConfig']['cache_enabled'])) { |
286 | - $viewtopic_posters = newbbGetSession('t' . $topic_id, true); |
|
286 | + $viewtopic_posters = newbbGetSession('t'.$topic_id, true); |
|
287 | 287 | if (!is_array($viewtopic_posters) || 0 === count($viewtopic_posters)) { |
288 | 288 | $viewtopic_posters = $topicHandler->getAllPosters($topicObject); |
289 | - newbbSetSession('t' . $topic_id, $viewtopic_posters); |
|
289 | + newbbSetSession('t'.$topic_id, $viewtopic_posters); |
|
290 | 290 | } |
291 | 291 | } else { |
292 | 292 | $viewtopic_posters = $topicHandler->getAllPosters($topicObject); |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | 'post_date' => 0, |
303 | 303 | 'post_image' => '', |
304 | 304 | 'post_title' => '', |
305 | - 'post_text' => '<div style="text-align: center;vertical-align: middle;"><br>' . xoops_getbanner() . '</div>', |
|
305 | + 'post_text' => '<div style="text-align: center;vertical-align: middle;"><br>'.xoops_getbanner().'</div>', |
|
306 | 306 | 'post_attachment' => '', |
307 | 307 | 'post_edit' => 0, |
308 | 308 | 'post_no' => 0, |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | if ($total_posts > $GLOBALS['xoopsModuleConfig']['posts_per_page']) { |
340 | 340 | require_once $GLOBALS['xoops']->path('class/pagenav.php'); |
341 | 341 | |
342 | - $nav = new \XoopsPageNav($total_posts, $GLOBALS['xoopsModuleConfig']['posts_per_page'], $start, 'start', 'topic_id=' . $topic_id . '&order=' . $order . '&status=' . $status . '&mode=' . $mode); |
|
342 | + $nav = new \XoopsPageNav($total_posts, $GLOBALS['xoopsModuleConfig']['posts_per_page'], $start, 'start', 'topic_id='.$topic_id.'&order='.$order.'&status='.$status.'&mode='.$mode); |
|
343 | 343 | //if (isset($GLOBALS['xoopsModuleConfig']['do_rewrite']) && $GLOBALS['xoopsModuleConfig']['do_rewrite'] === 1) $nav->url = XOOPS_URL . $nav->url; |
344 | 344 | if ('select' === $GLOBALS['xoopsModuleConfig']['pagenav_display']) { |
345 | 345 | $navi = $nav->renderSelect(); |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | } |
360 | 360 | |
361 | 361 | if (!empty($postsArray[$post_id])) { |
362 | - $xoops_pagetitle = $postsArray[$post_id]->getVar('subject') . ' [' . $forumObject->getVar('forum_name') . ']'; |
|
362 | + $xoops_pagetitle = $postsArray[$post_id]->getVar('subject').' ['.$forumObject->getVar('forum_name').']'; |
|
363 | 363 | $xoopsTpl->assign('xoops_pagetitle', $xoops_pagetitle); |
364 | 364 | $xoopsOption['xoops_pagetitle'] = $xoops_pagetitle; |
365 | 365 | $kw = array_unique(explode(' ', strip_tags($postsArray[$post_id]->getVar('post_text')), 150)); |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | $z = 0; |
369 | 369 | foreach ($kw as $k) { |
370 | 370 | if ($z < 30 && strlen(trim($k)) > 5) { |
371 | - $kwort .= trim($k) . ' '; |
|
371 | + $kwort .= trim($k).' '; |
|
372 | 372 | ++$z; |
373 | 373 | } |
374 | 374 | } |
@@ -395,56 +395,56 @@ discard block |
||
395 | 395 | // START irmtfan add restore to viewtopic |
396 | 396 | // if the topic is active |
397 | 397 | if ($topicObject->getVar('approved') > 0) { |
398 | - $admin_actions['merge'] = [ |
|
399 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=merge&topic_id=' . $topic_id, |
|
398 | + $admin_actions['merge'] = [ |
|
399 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/topicmanager.php?mode=merge&topic_id='.$topic_id, |
|
400 | 400 | 'name' => _MD_NEWBB_MERGETOPIC, |
401 | 401 | 'image' => $ad_merge |
402 | 402 | ]; |
403 | - $admin_actions['move'] = [ |
|
404 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=move&topic_id=' . $topic_id, |
|
403 | + $admin_actions['move'] = [ |
|
404 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/topicmanager.php?mode=move&topic_id='.$topic_id, |
|
405 | 405 | 'name' => _MD_NEWBB_MOVETOPIC, |
406 | 406 | 'image' => $ad_move |
407 | 407 | ]; |
408 | 408 | $admin_actions['delete'] = [ |
409 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=delete&topic_id=' . $topic_id, |
|
409 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/topicmanager.php?mode=delete&topic_id='.$topic_id, |
|
410 | 410 | 'name' => _MD_NEWBB_DELETETOPIC, |
411 | 411 | 'image' => $ad_delete |
412 | 412 | ]; |
413 | 413 | if (!$topicObject->getVar('topic_status')) { |
414 | 414 | $admin_actions['lock'] = [ |
415 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=lock&topic_id=' . $topic_id, |
|
415 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/topicmanager.php?mode=lock&topic_id='.$topic_id, |
|
416 | 416 | 'image' => $ad_lock, |
417 | 417 | 'name' => _MD_NEWBB_LOCKTOPIC |
418 | 418 | ]; |
419 | 419 | } else { |
420 | 420 | $admin_actions['unlock'] = [ |
421 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=unlock&topic_id=' . $topic_id, |
|
421 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/topicmanager.php?mode=unlock&topic_id='.$topic_id, |
|
422 | 422 | 'image' => $ad_unlock, |
423 | 423 | 'name' => _MD_NEWBB_UNLOCKTOPIC |
424 | 424 | ]; |
425 | 425 | } |
426 | 426 | if (!$topicObject->getVar('topic_sticky')) { |
427 | 427 | $admin_actions['sticky'] = [ |
428 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=sticky&topic_id=' . $topic_id, |
|
428 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/topicmanager.php?mode=sticky&topic_id='.$topic_id, |
|
429 | 429 | 'image' => $ad_sticky, |
430 | 430 | 'name' => _MD_NEWBB_STICKYTOPIC |
431 | 431 | ]; |
432 | 432 | } else { |
433 | 433 | $admin_actions['unsticky'] = [ |
434 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=unsticky&topic_id=' . $topic_id, |
|
434 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/topicmanager.php?mode=unsticky&topic_id='.$topic_id, |
|
435 | 435 | 'image' => $ad_unsticky, |
436 | 436 | 'name' => _MD_NEWBB_UNSTICKYTOPIC |
437 | 437 | ]; |
438 | 438 | } |
439 | 439 | if (!$topicObject->getVar('topic_digest')) { |
440 | 440 | $admin_actions['digest'] = [ |
441 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=digest&topic_id=' . $topic_id, |
|
441 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/topicmanager.php?mode=digest&topic_id='.$topic_id, |
|
442 | 442 | 'image' => $ad_digest, |
443 | 443 | 'name' => _MD_NEWBB_DIGESTTOPIC |
444 | 444 | ]; |
445 | 445 | } else { |
446 | 446 | $admin_actions['undigest'] = [ |
447 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=undigest&topic_id=' . $topic_id, |
|
447 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/topicmanager.php?mode=undigest&topic_id='.$topic_id, |
|
448 | 448 | 'image' => $ad_undigest, |
449 | 449 | 'name' => _MD_NEWBB_UNDIGESTTOPIC |
450 | 450 | ]; |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | // if the topic is pending/deleted then restore/approve |
453 | 453 | } else { |
454 | 454 | $admin_actions['restore'] = [ |
455 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=restore&topic_id=' . $topic_id, |
|
455 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/topicmanager.php?mode=restore&topic_id='.$topic_id, |
|
456 | 456 | 'name' => _MD_NEWBB_RESTORETOPIC, |
457 | 457 | 'image' => $ad_restore |
458 | 458 | ]; |
@@ -531,11 +531,11 @@ discard block |
||
531 | 531 | 'is_visible' => $isVisible, |
532 | 532 | 'visible_message' => $visibleMsg, |
533 | 533 | 'disp_votes' => $xp_config['disp_vote_nums'], |
534 | - 'lang_vote' => constant('_MD_' . strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']) . '_VOTE'), |
|
535 | - 'lang_results' => constant('_MD_' . strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']) . '_RESULTS'), |
|
534 | + 'lang_vote' => constant('_MD_'.strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']).'_VOTE'), |
|
535 | + 'lang_results' => constant('_MD_'.strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']).'_RESULTS'), |
|
536 | 536 | 'back_link' => '' |
537 | 537 | ]); |
538 | - $classRenderer = ucfirst($GLOBALS['xoopsModuleConfig']['poll_module']) . 'Renderer'; |
|
538 | + $classRenderer = ucfirst($GLOBALS['xoopsModuleConfig']['poll_module']).'Renderer'; |
|
539 | 539 | /** @var Xoopspoll\Renderer $renderer */ |
540 | 540 | $renderer = new $classRenderer($pollObject); |
541 | 541 | // check to see if user has voted, show form if not, otherwise get results for form |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | $myTpl = new \XoopsTpl(); |
548 | 548 | $renderer->assignForm($myTpl); |
549 | 549 | $myTpl->assign('action', $GLOBALS['xoops']->url("modules/newbb/votepolls.php?topic_id={$topic_id}&poll_id={$poll_id}")); |
550 | - $topic_pollform = $myTpl->fetch($GLOBALS['xoops']->path('modules/' . $GLOBALS['xoopsModuleConfig']['poll_module'] . '/templates/' . $GLOBALS['xoopsModuleConfig']['poll_module'] . '_view.tpl')); |
|
550 | + $topic_pollform = $myTpl->fetch($GLOBALS['xoops']->path('modules/'.$GLOBALS['xoopsModuleConfig']['poll_module'].'/templates/'.$GLOBALS['xoopsModuleConfig']['poll_module'].'_view.tpl')); |
|
551 | 551 | $GLOBALS['xoopsTpl']->assign('topic_pollform', $topic_pollform); |
552 | 552 | } else { |
553 | 553 | $GLOBALS['xoopsTpl']->assign('can_vote', false); |
@@ -558,7 +558,7 @@ discard block |
||
558 | 558 | // old xoopspoll or umfrage or any clone from them |
559 | 559 | } else { |
560 | 560 | $pollObject = new $classPoll($poll_id); |
561 | - $classRenderer = $classPoll . 'Renderer'; |
|
561 | + $classRenderer = $classPoll.'Renderer'; |
|
562 | 562 | $renderer = new $classRenderer($pollObject); |
563 | 563 | $xoopsTpl->assign('lang_alreadyvoted2', _PL_ALREADYVOTED2); |
564 | 564 | $xoopsTpl->assign('has_ended', $pollObject->getVar('end_time') < time() ? 1 : 0); |
@@ -579,7 +579,7 @@ discard block |
||
579 | 579 | |
580 | 580 | } |
581 | 581 | } |
582 | - $classLog = $classPoll . 'Log'; |
|
582 | + $classLog = $classPoll.'Log'; |
|
583 | 583 | $hasvoted = 0; |
584 | 584 | if ($GLOBALS['xoopsUser']) { |
585 | 585 | if ($classLog::hasVoted($poll_id, Request::getString('REMOTE_ADDR', '', 'SERVER'), $uid)) { |
@@ -595,12 +595,12 @@ discard block |
||
595 | 595 | if ($hasvoted || $pollObject->hasExpired()) { |
596 | 596 | $renderer->assignResults($xoopsTpl); |
597 | 597 | $xoopsTpl->assign('topic_pollresult', 1); |
598 | - setcookie('newbb_polls[' . $poll_id . ']', 1); |
|
598 | + setcookie('newbb_polls['.$poll_id.']', 1); |
|
599 | 599 | } else { |
600 | 600 | $renderer->assignForm($xoopsTpl); |
601 | 601 | $xoopsTpl->assign('lang_vote', _PL_VOTE); |
602 | 602 | $xoopsTpl->assign('lang_results', _PL_RESULTS); |
603 | - setcookie('newbb_polls[' . $poll_id . ']', 1); |
|
603 | + setcookie('newbb_polls['.$poll_id.']', 1); |
|
604 | 604 | } |
605 | 605 | } |
606 | 606 | } |
@@ -611,7 +611,7 @@ discard block |
||
611 | 611 | if (is_object($GLOBALS['xoopsUser']) |
612 | 612 | && $GLOBALS['xoopsUser']->getVar('uid') == $topicObject->getVar('topic_poster')) { |
613 | 613 | $t_poll = newbbDisplayImage('t_poll', _MD_NEWBB_ADDPOLL); |
614 | - $xoopsTpl->assign('forum_addpoll', '<a href=\'' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/polls.php?op=add&topic_id=' . $topic_id . '\'>' . $t_poll . '</a>'); |
|
614 | + $xoopsTpl->assign('forum_addpoll', '<a href=\''.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/polls.php?op=add&topic_id='.$topic_id.'\'>'.$t_poll.'</a>'); |
|
615 | 615 | } |
616 | 616 | } elseif ($isAdmin |
617 | 617 | || (is_object($pollObject) && is_object($GLOBALS['xoopsUser']) |
@@ -623,22 +623,22 @@ discard block |
||
623 | 623 | |
624 | 624 | $adminpoll_actions = []; |
625 | 625 | $adminpoll_actions['editpoll'] = [ |
626 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/polls.php?op=edit&poll_id=' . $topicObject->getVar('poll_id') . '&topic_id=' . $topic_id, |
|
626 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/polls.php?op=edit&poll_id='.$topicObject->getVar('poll_id').'&topic_id='.$topic_id, |
|
627 | 627 | 'image' => $poll_edit, |
628 | 628 | 'name' => _MD_NEWBB_EDITPOLL |
629 | 629 | ]; |
630 | - $adminpoll_actions['deletepoll'] = [ |
|
631 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/polls.php?op=delete&poll_id=' . $topicObject->getVar('poll_id') . '&topic_id=' . $topic_id, |
|
630 | + $adminpoll_actions['deletepoll'] = [ |
|
631 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/polls.php?op=delete&poll_id='.$topicObject->getVar('poll_id').'&topic_id='.$topic_id, |
|
632 | 632 | 'image' => $poll_delete, |
633 | 633 | 'name' => _MD_NEWBB_DELETEPOLL |
634 | 634 | ]; |
635 | 635 | $adminpoll_actions['restartpoll'] = [ |
636 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/polls.php?op=restart&poll_id=' . $topicObject->getVar('poll_id') . '&topic_id=' . $topic_id . '&forum=' . $forum_id, |
|
636 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/polls.php?op=restart&poll_id='.$topicObject->getVar('poll_id').'&topic_id='.$topic_id.'&forum='.$forum_id, |
|
637 | 637 | 'image' => $poll_restart, |
638 | 638 | 'name' => _MD_NEWBB_RESTARTPOLL |
639 | 639 | ]; |
640 | - $adminpoll_actions['logpoll'] = [ |
|
641 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/polls.php?op=log&poll_id=' . $topicObject->getVar('poll_id') . '&topic_id=' . $topic_id . '&forum=' . $forum_id, |
|
640 | + $adminpoll_actions['logpoll'] = [ |
|
641 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/polls.php?op=log&poll_id='.$topicObject->getVar('poll_id').'&topic_id='.$topic_id.'&forum='.$forum_id, |
|
642 | 642 | 'image' => $poll_log, |
643 | 643 | 'name' => _MD_NEWBB_POLL_VIEWLOG |
644 | 644 | ]; |
@@ -670,7 +670,7 @@ discard block |
||
670 | 670 | $rating_img = newbbDisplayImage('blank'); |
671 | 671 | } else { |
672 | 672 | // irmtfan - add alt key for rating |
673 | - $rating_img = newbbDisplayImage('rate' . $rating, constant('_MD_NEWBB_RATE' . $rating)); |
|
673 | + $rating_img = newbbDisplayImage('rate'.$rating, constant('_MD_NEWBB_RATE'.$rating)); |
|
674 | 674 | } |
675 | 675 | $xoopsTpl->assign('rating_img', $rating_img); |
676 | 676 | $xoopsTpl->assign('rate1', newbbDisplayImage('rate1', _MD_NEWBB_RATE1)); |
@@ -682,7 +682,7 @@ discard block |
||
682 | 682 | |
683 | 683 | // create jump box |
684 | 684 | if (!empty($GLOBALS['xoopsModuleConfig']['show_jump'])) { |
685 | - require_once __DIR__ . '/include/functions.forum.php'; |
|
685 | + require_once __DIR__.'/include/functions.forum.php'; |
|
686 | 686 | $xoopsTpl->assign('forum_jumpbox', newbbMakeJumpbox($forum_id)); |
687 | 687 | } |
688 | 688 | |
@@ -703,25 +703,25 @@ discard block |
||
703 | 703 | $viewmode_options = []; |
704 | 704 | if ('DESC' === $order) { |
705 | 705 | $viewmode_options[] = [ |
706 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/viewtopic.php?order=ASC&status=$status&topic_id=' . $topic_id, |
|
706 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/viewtopic.php?order=ASC&status=$status&topic_id='.$topic_id, |
|
707 | 707 | 'title' => _OLDESTFIRST |
708 | 708 | ]; |
709 | 709 | } else { |
710 | 710 | $viewmode_options[] = [ |
711 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/viewtopic.php?order=DESC&status=$status&topic_id=' . $topic_id, |
|
711 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/viewtopic.php?order=DESC&status=$status&topic_id='.$topic_id, |
|
712 | 712 | 'title' => _NEWESTFIRST |
713 | 713 | ]; |
714 | 714 | } |
715 | 715 | |
716 | 716 | switch ($status) { |
717 | 717 | case 'active': |
718 | - $current_status = '[' . _MD_NEWBB_TYPE_ADMIN . ']'; |
|
718 | + $current_status = '['._MD_NEWBB_TYPE_ADMIN.']'; |
|
719 | 719 | break; |
720 | 720 | case 'pending': |
721 | - $current_status = '[' . _MD_NEWBB_TYPE_PENDING . ']'; |
|
721 | + $current_status = '['._MD_NEWBB_TYPE_PENDING.']'; |
|
722 | 722 | break; |
723 | 723 | case 'deleted': |
724 | - $current_status = '[' . _MD_NEWBB_TYPE_DELETED . ']'; |
|
724 | + $current_status = '['._MD_NEWBB_TYPE_DELETED.']'; |
|
725 | 725 | break; |
726 | 726 | default: |
727 | 727 | $current_status = ''; |
@@ -744,7 +744,7 @@ discard block |
||
744 | 744 | && $topicHandler->getPermission($forumObject, $topicObject->getVar('topic_status'), 'reply') |
745 | 745 | && $moderateHandler->verifyUser(-1, '', $forumObject->getVar('forum_id'))) { |
746 | 746 | // END irmtfan add verifyUser to quick reply |
747 | - $forum_form = new \XoopsThemeForm(_MD_NEWBB_POSTREPLY, 'quick_reply', XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/post.php', 'post', true); |
|
747 | + $forum_form = new \XoopsThemeForm(_MD_NEWBB_POSTREPLY, 'quick_reply', XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/post.php', 'post', true); |
|
748 | 748 | if (!is_object($GLOBALS['xoopsUser'])) { |
749 | 749 | //$configHandler = xoops_getHandler('config'); |
750 | 750 | $user_tray = new \XoopsFormElementTray(_MD_NEWBB_ACCOUNT); |
@@ -779,7 +779,7 @@ discard block |
||
779 | 779 | |
780 | 780 | $forum_form->addElement(new \XoopsFormHidden('isreply', 1)); |
781 | 781 | |
782 | - $forum_form->addElement(new \XoopsFormHidden('subject', _MD_NEWBB_RE . ': ' . $topicObject->getVar('topic_title', 'e'))); |
|
782 | + $forum_form->addElement(new \XoopsFormHidden('subject', _MD_NEWBB_RE.': '.$topicObject->getVar('topic_title', 'e'))); |
|
783 | 783 | $forum_form->addElement(new \XoopsFormHidden('pid', empty($post_id) ? $topicHandler->getTopPostId($topic_id) : $post_id)); |
784 | 784 | $forum_form->addElement(new \XoopsFormHidden('topic_id', $topic_id)); |
785 | 785 | $forum_form->addElement(new \XoopsFormHidden('forum', $forum_id)); |
@@ -791,7 +791,7 @@ discard block |
||
791 | 791 | $forum_form->addElement(new \XoopsFormHidden('contents_submit', 1)); |
792 | 792 | |
793 | 793 | $submit_button = new \XoopsFormButton('', 'quick_submit', _SUBMIT, 'submit'); |
794 | - $submit_button->setExtra('onclick="if (document.forms.quick_reply.message.value === \'RE\' || document.forms.quick_reply.message.value === \'\') { alert(\'' . _MD_NEWBB_QUICKREPLY_EMPTY . '\'); return false;} else { return true;}"'); |
|
794 | + $submit_button->setExtra('onclick="if (document.forms.quick_reply.message.value === \'RE\' || document.forms.quick_reply.message.value === \'\') { alert(\''._MD_NEWBB_QUICKREPLY_EMPTY.'\'); return false;} else { return true;}"'); |
|
795 | 795 | $forum_form->addElement($submit_button); |
796 | 796 | |
797 | 797 | $toggles = newbbGetCookie('G', true); |
@@ -806,13 +806,13 @@ discard block |
||
806 | 806 | $quickreply['show'] = 1; // = !empty($GLOBALS['xoopsModuleConfig']['quickreply_enabled'] |
807 | 807 | $quickreply['expand'] = (count($toggles) > 0) ? (in_array('qr', $toggles, true) ? false : true) : true; |
808 | 808 | if ($quickreply['expand']) { |
809 | - $quickreply['style'] = 'block'; //irmtfan move semicolon |
|
809 | + $quickreply['style'] = 'block'; //irmtfan move semicolon |
|
810 | 810 | $quickreply_icon_display = $qr_expand; |
811 | - $quickreply_alt = _MD_NEWBB_HIDE . ' ' . _MD_NEWBB_QUICKREPLY; |
|
811 | + $quickreply_alt = _MD_NEWBB_HIDE.' '._MD_NEWBB_QUICKREPLY; |
|
812 | 812 | } else { |
813 | - $quickreply['style'] = 'none'; //irmtfan move semicolon |
|
813 | + $quickreply['style'] = 'none'; //irmtfan move semicolon |
|
814 | 814 | $quickreply_icon_display = $qr_collapse; |
815 | - $quickreply_alt = _MD_NEWBB_SEE . ' ' . _MD_NEWBB_QUICKREPLY; |
|
815 | + $quickreply_alt = _MD_NEWBB_SEE.' '._MD_NEWBB_QUICKREPLY; |
|
816 | 816 | } |
817 | 817 | $quickreply['displayImage'] = newbbDisplayImage($quickreply_icon_display, $quickreply_alt); |
818 | 818 | $quickreply['form'] = $forum_form->render(); |
@@ -828,6 +828,6 @@ discard block |
||
828 | 828 | $xoopsTpl->assign('tagbar', tagBar($topicObject->getVar('topic_tags', 'n'))); |
829 | 829 | } |
830 | 830 | // irmtfan move to footer.php |
831 | -require_once __DIR__ . '/footer.php'; |
|
831 | +require_once __DIR__.'/footer.php'; |
|
832 | 832 | require_once $GLOBALS['xoops']->path('footer.php'); |
833 | 833 | $xoopsLogger->stopTime('newBB_viewtopic'); |
@@ -21,8 +21,8 @@ discard block |
||
21 | 21 | $op = in_array($op, ['approve', 'delete', 'restore', 'move'], true) ? $op : ''; |
22 | 22 | |
23 | 23 | if (0 === count($topic_id) || 0 === count($op)) { |
24 | - // irmtfan - issue with javascript:history.go(-1) |
|
25 | - redirect_header(Request::getString('HTTP_REFERER', '', 'SERVER'), 2, _MD_NEWBB_NO_SELECTION); |
|
24 | + // irmtfan - issue with javascript:history.go(-1) |
|
25 | + redirect_header(Request::getString('HTTP_REFERER', '', 'SERVER'), 2, _MD_NEWBB_NO_SELECTION); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | $topic_id = array_values($topic_id); |
@@ -34,161 +34,161 @@ 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 | - case 'restore': |
|
41 | - $forums = []; |
|
42 | - $topicsObject = $topicHandler->getAll(new \Criteria('topic_id', '(' . implode(',', $topic_id) . ')', 'IN')); |
|
43 | - foreach (array_keys($topicsObject) as $id) { |
|
44 | - /** @var Newbb\Topic $topicObject */ |
|
45 | - $topicObject = $topicsObject[$id]; |
|
46 | - $topicHandler->approve($topicObject); |
|
47 | - $topicHandler->synchronization($topicObject); |
|
48 | - $forums[$topicObject->getVar('forum_id')] = 1; |
|
49 | - } |
|
50 | - $criteria_forum = new \Criteria('forum_id', '(' . implode(',', array_keys($forums)) . ')', 'IN'); |
|
51 | - $forumsObject = $forumHandler->getAll($criteria_forum); |
|
52 | - foreach (array_keys($forumsObject) as $id) { |
|
53 | - $forumHandler->synchronization($forumsObject[$id]); |
|
54 | - } |
|
55 | - unset($topicsObject, $forumsObject); |
|
56 | - break; |
|
57 | - case 'approve': |
|
58 | - $forums = []; |
|
59 | - $topicsObject = $topicHandler->getAll(new \Criteria('topic_id', '(' . implode(',', $topic_id) . ')', 'IN')); |
|
60 | - foreach (array_keys($topicsObject) as $id) { |
|
61 | - /** @var Newbb\Topic $topicObject */ |
|
62 | - $topicObject = $topicsObject[$id]; |
|
63 | - $topicHandler->approve($topicObject); |
|
64 | - $topicHandler->synchronization($topicObject); |
|
65 | - $forums[$topicObject->getVar('forum_id')] = 1; |
|
66 | - } |
|
40 | + case 'restore': |
|
41 | + $forums = []; |
|
42 | + $topicsObject = $topicHandler->getAll(new \Criteria('topic_id', '(' . implode(',', $topic_id) . ')', 'IN')); |
|
43 | + foreach (array_keys($topicsObject) as $id) { |
|
44 | + /** @var Newbb\Topic $topicObject */ |
|
45 | + $topicObject = $topicsObject[$id]; |
|
46 | + $topicHandler->approve($topicObject); |
|
47 | + $topicHandler->synchronization($topicObject); |
|
48 | + $forums[$topicObject->getVar('forum_id')] = 1; |
|
49 | + } |
|
50 | + $criteria_forum = new \Criteria('forum_id', '(' . implode(',', array_keys($forums)) . ')', 'IN'); |
|
51 | + $forumsObject = $forumHandler->getAll($criteria_forum); |
|
52 | + foreach (array_keys($forumsObject) as $id) { |
|
53 | + $forumHandler->synchronization($forumsObject[$id]); |
|
54 | + } |
|
55 | + unset($topicsObject, $forumsObject); |
|
56 | + break; |
|
57 | + case 'approve': |
|
58 | + $forums = []; |
|
59 | + $topicsObject = $topicHandler->getAll(new \Criteria('topic_id', '(' . implode(',', $topic_id) . ')', 'IN')); |
|
60 | + foreach (array_keys($topicsObject) as $id) { |
|
61 | + /** @var Newbb\Topic $topicObject */ |
|
62 | + $topicObject = $topicsObject[$id]; |
|
63 | + $topicHandler->approve($topicObject); |
|
64 | + $topicHandler->synchronization($topicObject); |
|
65 | + $forums[$topicObject->getVar('forum_id')] = 1; |
|
66 | + } |
|
67 | 67 | |
68 | - $criteria_forum = new \Criteria('forum_id', '(' . implode(',', array_keys($forums)) . ')', 'IN'); |
|
69 | - $forumsObject = $forumHandler->getAll($criteria_forum); |
|
70 | - foreach (array_keys($forumsObject) as $id) { |
|
71 | - $forumHandler->synchronization($forumsObject[$id]); |
|
72 | - } |
|
68 | + $criteria_forum = new \Criteria('forum_id', '(' . implode(',', array_keys($forums)) . ')', 'IN'); |
|
69 | + $forumsObject = $forumHandler->getAll($criteria_forum); |
|
70 | + foreach (array_keys($forumsObject) as $id) { |
|
71 | + $forumHandler->synchronization($forumsObject[$id]); |
|
72 | + } |
|
73 | 73 | |
74 | - if (empty($GLOBALS['xoopsModuleConfig']['notification_enabled'])) { |
|
75 | - break; |
|
76 | - } |
|
74 | + if (empty($GLOBALS['xoopsModuleConfig']['notification_enabled'])) { |
|
75 | + break; |
|
76 | + } |
|
77 | 77 | |
78 | - require_once __DIR__ . '/include/notification.inc.php'; |
|
79 | - /** @var \XoopsNotificationHandler $notificationHandler */ |
|
80 | - $notificationHandler = xoops_getHandler('notification'); |
|
81 | - foreach (array_keys($topicsObject) as $id) { |
|
82 | - $topicObject = $topicsObject[$id]; |
|
83 | - $tags = []; |
|
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'); |
|
86 | - /** @var Newbb\Forum[] $forumsObject */ |
|
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'); |
|
89 | - $notificationHandler->triggerEvent('global', 0, 'new_thread', $tags); |
|
90 | - $notificationHandler->triggerEvent('forum', $topicObject->getVar('forum_id'), 'new_thread', $tags); |
|
91 | - $postObject = $topicHandler->getTopPost($id); |
|
92 | - $tags['POST_URL'] = $tags['THREAD_URL'] . '#forumpost' . $postObject->getVar('post_id'); |
|
93 | - $notificationHandler->triggerEvent('thread', $id, 'new_post', $tags); |
|
94 | - $notificationHandler->triggerEvent('forum', $topicObject->getVar('forum_id'), 'new_post', $tags); |
|
95 | - $notificationHandler->triggerEvent('global', 0, 'new_post', $tags); |
|
96 | - $tags['POST_CONTENT'] = $postObject->getVar('post_text'); |
|
97 | - $tags['POST_NAME'] = $postObject->getVar('subject'); |
|
98 | - $notificationHandler->triggerEvent('global', 0, 'new_fullpost', $tags); |
|
99 | - $notificationHandler->triggerEvent('forum', $topicObject->getVar('forum_id'), 'new_fullpost', $tags); |
|
100 | - unset($postObject); |
|
101 | - } |
|
102 | - unset($topicsObject, $forumsObject); |
|
103 | - break; |
|
104 | - case 'delete': |
|
105 | - $forums = []; |
|
106 | - /** @var Newbb\TopicHandler|\XoopsPersistableObjectHandler $topicHandler */ |
|
107 | - $topicsObject = $topicHandler->getAll(new \Criteria('topic_id', '(' . implode(',', $topic_id) . ')', 'IN')); |
|
108 | - foreach (array_keys($topicsObject) as $id) { |
|
109 | - /** @var Newbb\Topic $topicObject */ |
|
110 | - $topicObject = $topicsObject[$id]; |
|
111 | - // irmtfan should be set to false to not delete topic from database |
|
112 | - $topicHandler->delete($topicObject, false); |
|
113 | - $topicHandler->synchronization($topicObject); |
|
114 | - $forums[$topicObject->getVar('forum_id')] = 1; |
|
115 | - } |
|
78 | + require_once __DIR__ . '/include/notification.inc.php'; |
|
79 | + /** @var \XoopsNotificationHandler $notificationHandler */ |
|
80 | + $notificationHandler = xoops_getHandler('notification'); |
|
81 | + foreach (array_keys($topicsObject) as $id) { |
|
82 | + $topicObject = $topicsObject[$id]; |
|
83 | + $tags = []; |
|
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'); |
|
86 | + /** @var Newbb\Forum[] $forumsObject */ |
|
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'); |
|
89 | + $notificationHandler->triggerEvent('global', 0, 'new_thread', $tags); |
|
90 | + $notificationHandler->triggerEvent('forum', $topicObject->getVar('forum_id'), 'new_thread', $tags); |
|
91 | + $postObject = $topicHandler->getTopPost($id); |
|
92 | + $tags['POST_URL'] = $tags['THREAD_URL'] . '#forumpost' . $postObject->getVar('post_id'); |
|
93 | + $notificationHandler->triggerEvent('thread', $id, 'new_post', $tags); |
|
94 | + $notificationHandler->triggerEvent('forum', $topicObject->getVar('forum_id'), 'new_post', $tags); |
|
95 | + $notificationHandler->triggerEvent('global', 0, 'new_post', $tags); |
|
96 | + $tags['POST_CONTENT'] = $postObject->getVar('post_text'); |
|
97 | + $tags['POST_NAME'] = $postObject->getVar('subject'); |
|
98 | + $notificationHandler->triggerEvent('global', 0, 'new_fullpost', $tags); |
|
99 | + $notificationHandler->triggerEvent('forum', $topicObject->getVar('forum_id'), 'new_fullpost', $tags); |
|
100 | + unset($postObject); |
|
101 | + } |
|
102 | + unset($topicsObject, $forumsObject); |
|
103 | + break; |
|
104 | + case 'delete': |
|
105 | + $forums = []; |
|
106 | + /** @var Newbb\TopicHandler|\XoopsPersistableObjectHandler $topicHandler */ |
|
107 | + $topicsObject = $topicHandler->getAll(new \Criteria('topic_id', '(' . implode(',', $topic_id) . ')', 'IN')); |
|
108 | + foreach (array_keys($topicsObject) as $id) { |
|
109 | + /** @var Newbb\Topic $topicObject */ |
|
110 | + $topicObject = $topicsObject[$id]; |
|
111 | + // irmtfan should be set to false to not delete topic from database |
|
112 | + $topicHandler->delete($topicObject, false); |
|
113 | + $topicHandler->synchronization($topicObject); |
|
114 | + $forums[$topicObject->getVar('forum_id')] = 1; |
|
115 | + } |
|
116 | 116 | |
117 | - $criteria_forum = new \Criteria('forum_id', '(' . implode(',', array_keys($forums)) . ')', 'IN'); |
|
118 | - $forumsObject = $forumHandler->getAll($criteria_forum); |
|
119 | - foreach (array_keys($forumsObject) as $id) { |
|
120 | - $forumHandler->synchronization($forumsObject[$id]); |
|
121 | - } |
|
122 | - unset($topicsObject, $forumsObject); |
|
123 | - break; |
|
124 | - case 'move': |
|
125 | - if (Request::getInt('newforum', 0, 'POST') |
|
126 | - && Request::getInt('newforum', 0, 'POST') !== $forum_id |
|
127 | - && $forumHandler->getPermission(Request::getInt('newforum', 0, 'POST'), 'post')) { |
|
128 | - $criteria = new \Criteria('topic_id', '(' . implode(',', $topic_id) . ')', 'IN'); |
|
129 | - // /** @var Newbb\PostHandler $postHandler */ |
|
130 | - // $postHandler = Newbb\Helper::getInstance()->getHandler('Post'); |
|
131 | - $postHandler->updateAll('forum_id', Request::getInt('newforum', 0, 'POST'), $criteria, true); |
|
132 | - $topicHandler->updateAll('forum_id', Request::getInt('newforum', 0, 'POST'), $criteria, true); |
|
133 | - $forumHandler->synchronization(Request::getInt('newforum', 0, 'POST')); |
|
134 | - $forumHandler->synchronization($forum_id); |
|
135 | - } else { |
|
136 | - require_once $GLOBALS['xoops']->path('header.php'); |
|
137 | - // /** @var Newbb\CategoryHandler $categoryHandler */ |
|
138 | - // $categoryHandler = Newbb\Helper::getInstance()->getHandler('Category'); |
|
139 | - $categories = $categoryHandler->getByPermission('access'); |
|
140 | - $forums = $forumHandler->getForumsByCategory(array_keys($categories), 'post', false); |
|
117 | + $criteria_forum = new \Criteria('forum_id', '(' . implode(',', array_keys($forums)) . ')', 'IN'); |
|
118 | + $forumsObject = $forumHandler->getAll($criteria_forum); |
|
119 | + foreach (array_keys($forumsObject) as $id) { |
|
120 | + $forumHandler->synchronization($forumsObject[$id]); |
|
121 | + } |
|
122 | + unset($topicsObject, $forumsObject); |
|
123 | + break; |
|
124 | + case 'move': |
|
125 | + if (Request::getInt('newforum', 0, 'POST') |
|
126 | + && Request::getInt('newforum', 0, 'POST') !== $forum_id |
|
127 | + && $forumHandler->getPermission(Request::getInt('newforum', 0, 'POST'), 'post')) { |
|
128 | + $criteria = new \Criteria('topic_id', '(' . implode(',', $topic_id) . ')', 'IN'); |
|
129 | + // /** @var Newbb\PostHandler $postHandler */ |
|
130 | + // $postHandler = Newbb\Helper::getInstance()->getHandler('Post'); |
|
131 | + $postHandler->updateAll('forum_id', Request::getInt('newforum', 0, 'POST'), $criteria, true); |
|
132 | + $topicHandler->updateAll('forum_id', Request::getInt('newforum', 0, 'POST'), $criteria, true); |
|
133 | + $forumHandler->synchronization(Request::getInt('newforum', 0, 'POST')); |
|
134 | + $forumHandler->synchronization($forum_id); |
|
135 | + } else { |
|
136 | + require_once $GLOBALS['xoops']->path('header.php'); |
|
137 | + // /** @var Newbb\CategoryHandler $categoryHandler */ |
|
138 | + // $categoryHandler = Newbb\Helper::getInstance()->getHandler('Category'); |
|
139 | + $categories = $categoryHandler->getByPermission('access'); |
|
140 | + $forums = $forumHandler->getForumsByCategory(array_keys($categories), 'post', false); |
|
141 | 141 | |
142 | - $box = '<select name="newforum" size="1">'; |
|
143 | - if (count($categories) > 0 && count($forums) > 0) { |
|
144 | - foreach (array_keys($forums) as $key) { |
|
142 | + $box = '<select name="newforum" size="1">'; |
|
143 | + if (count($categories) > 0 && count($forums) > 0) { |
|
144 | + foreach (array_keys($forums) as $key) { |
|
145 | 145 | |
146 | - /** @var Newbb\Category[] $categories */ |
|
147 | - $box .= "<option value='-1'>[" . $categories[$key]->getVar('cat_title') . ']</option>'; |
|
148 | - foreach ($forums[$key] as $forumid => $_forum) { |
|
149 | - $box .= "<option value='" . $forumid . "'>-- " . $_forum['title'] . '</option>'; |
|
150 | - if (!isset($_forum['sub'])) { |
|
151 | - continue; |
|
152 | - } |
|
153 | - foreach (array_keys($_forum['sub']) as $fid) { |
|
154 | - $box .= "<option value='" . $fid . "'>---- " . $_forum['sub'][$fid]['title'] . '</option>'; |
|
155 | - } |
|
156 | - } |
|
157 | - } |
|
158 | - } else { |
|
159 | - $box .= "<option value='-1'>" . _MD_NEWBB_NOFORUMINDB . '</option>'; |
|
160 | - } |
|
161 | - $box .= '</select>'; |
|
162 | - unset($forums, $categories); |
|
146 | + /** @var Newbb\Category[] $categories */ |
|
147 | + $box .= "<option value='-1'>[" . $categories[$key]->getVar('cat_title') . ']</option>'; |
|
148 | + foreach ($forums[$key] as $forumid => $_forum) { |
|
149 | + $box .= "<option value='" . $forumid . "'>-- " . $_forum['title'] . '</option>'; |
|
150 | + if (!isset($_forum['sub'])) { |
|
151 | + continue; |
|
152 | + } |
|
153 | + foreach (array_keys($_forum['sub']) as $fid) { |
|
154 | + $box .= "<option value='" . $fid . "'>---- " . $_forum['sub'][$fid]['title'] . '</option>'; |
|
155 | + } |
|
156 | + } |
|
157 | + } |
|
158 | + } else { |
|
159 | + $box .= "<option value='-1'>" . _MD_NEWBB_NOFORUMINDB . '</option>'; |
|
160 | + } |
|
161 | + $box .= '</select>'; |
|
162 | + unset($forums, $categories); |
|
163 | 163 | |
164 | - echo "<form action='" . Request::getString('PHP_SELF', '', 'SERVER') . "' method='post'>"; |
|
165 | - echo "<table border='0' cellpadding='1' cellspacing='0' align='center' width='95%'>"; |
|
166 | - echo "<tr><td class='bg2'>"; |
|
167 | - echo "<table border='0' cellpadding='1' cellspacing='1' width='100%'>"; |
|
168 | - echo '<tr><td class="bg3">' . _MD_NEWBB_MOVETOPICTO . '</td><td class="bg1">'; |
|
169 | - echo $box; |
|
170 | - echo '</td></tr>'; |
|
171 | - echo '<tr class="bg3"><td colspan="2" align="center">'; |
|
172 | - echo "<input type='hidden' name='op' value='move' />"; |
|
173 | - echo "<input type='hidden' name='forum_id' value='{$forum_id}' />"; |
|
174 | - foreach ($topic_id as $id) { |
|
175 | - echo "<input type='hidden' name='topic_id[]' value='" . $id . "' />"; |
|
176 | - } |
|
177 | - echo "<input type='submit' name='submit' value='" . _SUBMIT . "' />"; |
|
178 | - echo '</td></tr></table></td></tr></table>'; |
|
179 | - echo '</form>'; |
|
180 | - require_once $GLOBALS['xoops']->path('footer.php'); |
|
181 | - exit(); |
|
182 | - } |
|
183 | - break; |
|
164 | + echo "<form action='" . Request::getString('PHP_SELF', '', 'SERVER') . "' method='post'>"; |
|
165 | + echo "<table border='0' cellpadding='1' cellspacing='0' align='center' width='95%'>"; |
|
166 | + echo "<tr><td class='bg2'>"; |
|
167 | + echo "<table border='0' cellpadding='1' cellspacing='1' width='100%'>"; |
|
168 | + echo '<tr><td class="bg3">' . _MD_NEWBB_MOVETOPICTO . '</td><td class="bg1">'; |
|
169 | + echo $box; |
|
170 | + echo '</td></tr>'; |
|
171 | + echo '<tr class="bg3"><td colspan="2" align="center">'; |
|
172 | + echo "<input type='hidden' name='op' value='move' />"; |
|
173 | + echo "<input type='hidden' name='forum_id' value='{$forum_id}' />"; |
|
174 | + foreach ($topic_id as $id) { |
|
175 | + echo "<input type='hidden' name='topic_id[]' value='" . $id . "' />"; |
|
176 | + } |
|
177 | + echo "<input type='submit' name='submit' value='" . _SUBMIT . "' />"; |
|
178 | + echo '</td></tr></table></td></tr></table>'; |
|
179 | + echo '</form>'; |
|
180 | + require_once $GLOBALS['xoops']->path('footer.php'); |
|
181 | + exit(); |
|
182 | + } |
|
183 | + break; |
|
184 | 184 | } |
185 | 185 | ///** @var Newbb\StatsHandler $statsHandler */ |
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 | 194 | require_once __DIR__ . '/footer.php'; |
@@ -37,150 +37,150 @@ |
||
37 | 37 | redirect_header(XOOPS_URL . '/index.php', 2, _MD_NEWBB_NORIGHTTOACCESS); |
38 | 38 | } |
39 | 39 | switch ($op) { |
40 | - case 'restore': |
|
41 | - $forums = []; |
|
42 | - $topicsObject = $topicHandler->getAll(new \Criteria('topic_id', '(' . implode(',', $topic_id) . ')', 'IN')); |
|
43 | - foreach (array_keys($topicsObject) as $id) { |
|
44 | - /** @var Newbb\Topic $topicObject */ |
|
45 | - $topicObject = $topicsObject[$id]; |
|
46 | - $topicHandler->approve($topicObject); |
|
47 | - $topicHandler->synchronization($topicObject); |
|
48 | - $forums[$topicObject->getVar('forum_id')] = 1; |
|
49 | - } |
|
50 | - $criteria_forum = new \Criteria('forum_id', '(' . implode(',', array_keys($forums)) . ')', 'IN'); |
|
51 | - $forumsObject = $forumHandler->getAll($criteria_forum); |
|
52 | - foreach (array_keys($forumsObject) as $id) { |
|
53 | - $forumHandler->synchronization($forumsObject[$id]); |
|
54 | - } |
|
55 | - unset($topicsObject, $forumsObject); |
|
56 | - break; |
|
57 | - case 'approve': |
|
58 | - $forums = []; |
|
59 | - $topicsObject = $topicHandler->getAll(new \Criteria('topic_id', '(' . implode(',', $topic_id) . ')', 'IN')); |
|
60 | - foreach (array_keys($topicsObject) as $id) { |
|
61 | - /** @var Newbb\Topic $topicObject */ |
|
62 | - $topicObject = $topicsObject[$id]; |
|
63 | - $topicHandler->approve($topicObject); |
|
64 | - $topicHandler->synchronization($topicObject); |
|
65 | - $forums[$topicObject->getVar('forum_id')] = 1; |
|
66 | - } |
|
40 | + case 'restore': |
|
41 | + $forums = []; |
|
42 | + $topicsObject = $topicHandler->getAll(new \Criteria('topic_id', '(' . implode(',', $topic_id) . ')', 'IN')); |
|
43 | + foreach (array_keys($topicsObject) as $id) { |
|
44 | + /** @var Newbb\Topic $topicObject */ |
|
45 | + $topicObject = $topicsObject[$id]; |
|
46 | + $topicHandler->approve($topicObject); |
|
47 | + $topicHandler->synchronization($topicObject); |
|
48 | + $forums[$topicObject->getVar('forum_id')] = 1; |
|
49 | + } |
|
50 | + $criteria_forum = new \Criteria('forum_id', '(' . implode(',', array_keys($forums)) . ')', 'IN'); |
|
51 | + $forumsObject = $forumHandler->getAll($criteria_forum); |
|
52 | + foreach (array_keys($forumsObject) as $id) { |
|
53 | + $forumHandler->synchronization($forumsObject[$id]); |
|
54 | + } |
|
55 | + unset($topicsObject, $forumsObject); |
|
56 | + break; |
|
57 | + case 'approve': |
|
58 | + $forums = []; |
|
59 | + $topicsObject = $topicHandler->getAll(new \Criteria('topic_id', '(' . implode(',', $topic_id) . ')', 'IN')); |
|
60 | + foreach (array_keys($topicsObject) as $id) { |
|
61 | + /** @var Newbb\Topic $topicObject */ |
|
62 | + $topicObject = $topicsObject[$id]; |
|
63 | + $topicHandler->approve($topicObject); |
|
64 | + $topicHandler->synchronization($topicObject); |
|
65 | + $forums[$topicObject->getVar('forum_id')] = 1; |
|
66 | + } |
|
67 | 67 | |
68 | - $criteria_forum = new \Criteria('forum_id', '(' . implode(',', array_keys($forums)) . ')', 'IN'); |
|
69 | - $forumsObject = $forumHandler->getAll($criteria_forum); |
|
70 | - foreach (array_keys($forumsObject) as $id) { |
|
71 | - $forumHandler->synchronization($forumsObject[$id]); |
|
72 | - } |
|
68 | + $criteria_forum = new \Criteria('forum_id', '(' . implode(',', array_keys($forums)) . ')', 'IN'); |
|
69 | + $forumsObject = $forumHandler->getAll($criteria_forum); |
|
70 | + foreach (array_keys($forumsObject) as $id) { |
|
71 | + $forumHandler->synchronization($forumsObject[$id]); |
|
72 | + } |
|
73 | 73 | |
74 | - if (empty($GLOBALS['xoopsModuleConfig']['notification_enabled'])) { |
|
75 | - break; |
|
76 | - } |
|
74 | + if (empty($GLOBALS['xoopsModuleConfig']['notification_enabled'])) { |
|
75 | + break; |
|
76 | + } |
|
77 | 77 | |
78 | - require_once __DIR__ . '/include/notification.inc.php'; |
|
79 | - /** @var \XoopsNotificationHandler $notificationHandler */ |
|
80 | - $notificationHandler = xoops_getHandler('notification'); |
|
81 | - foreach (array_keys($topicsObject) as $id) { |
|
82 | - $topicObject = $topicsObject[$id]; |
|
83 | - $tags = []; |
|
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'); |
|
86 | - /** @var Newbb\Forum[] $forumsObject */ |
|
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'); |
|
89 | - $notificationHandler->triggerEvent('global', 0, 'new_thread', $tags); |
|
90 | - $notificationHandler->triggerEvent('forum', $topicObject->getVar('forum_id'), 'new_thread', $tags); |
|
91 | - $postObject = $topicHandler->getTopPost($id); |
|
92 | - $tags['POST_URL'] = $tags['THREAD_URL'] . '#forumpost' . $postObject->getVar('post_id'); |
|
93 | - $notificationHandler->triggerEvent('thread', $id, 'new_post', $tags); |
|
94 | - $notificationHandler->triggerEvent('forum', $topicObject->getVar('forum_id'), 'new_post', $tags); |
|
95 | - $notificationHandler->triggerEvent('global', 0, 'new_post', $tags); |
|
96 | - $tags['POST_CONTENT'] = $postObject->getVar('post_text'); |
|
97 | - $tags['POST_NAME'] = $postObject->getVar('subject'); |
|
98 | - $notificationHandler->triggerEvent('global', 0, 'new_fullpost', $tags); |
|
99 | - $notificationHandler->triggerEvent('forum', $topicObject->getVar('forum_id'), 'new_fullpost', $tags); |
|
100 | - unset($postObject); |
|
101 | - } |
|
102 | - unset($topicsObject, $forumsObject); |
|
103 | - break; |
|
104 | - case 'delete': |
|
105 | - $forums = []; |
|
106 | - /** @var Newbb\TopicHandler|\XoopsPersistableObjectHandler $topicHandler */ |
|
107 | - $topicsObject = $topicHandler->getAll(new \Criteria('topic_id', '(' . implode(',', $topic_id) . ')', 'IN')); |
|
108 | - foreach (array_keys($topicsObject) as $id) { |
|
109 | - /** @var Newbb\Topic $topicObject */ |
|
110 | - $topicObject = $topicsObject[$id]; |
|
111 | - // irmtfan should be set to false to not delete topic from database |
|
112 | - $topicHandler->delete($topicObject, false); |
|
113 | - $topicHandler->synchronization($topicObject); |
|
114 | - $forums[$topicObject->getVar('forum_id')] = 1; |
|
115 | - } |
|
78 | + require_once __DIR__ . '/include/notification.inc.php'; |
|
79 | + /** @var \XoopsNotificationHandler $notificationHandler */ |
|
80 | + $notificationHandler = xoops_getHandler('notification'); |
|
81 | + foreach (array_keys($topicsObject) as $id) { |
|
82 | + $topicObject = $topicsObject[$id]; |
|
83 | + $tags = []; |
|
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'); |
|
86 | + /** @var Newbb\Forum[] $forumsObject */ |
|
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'); |
|
89 | + $notificationHandler->triggerEvent('global', 0, 'new_thread', $tags); |
|
90 | + $notificationHandler->triggerEvent('forum', $topicObject->getVar('forum_id'), 'new_thread', $tags); |
|
91 | + $postObject = $topicHandler->getTopPost($id); |
|
92 | + $tags['POST_URL'] = $tags['THREAD_URL'] . '#forumpost' . $postObject->getVar('post_id'); |
|
93 | + $notificationHandler->triggerEvent('thread', $id, 'new_post', $tags); |
|
94 | + $notificationHandler->triggerEvent('forum', $topicObject->getVar('forum_id'), 'new_post', $tags); |
|
95 | + $notificationHandler->triggerEvent('global', 0, 'new_post', $tags); |
|
96 | + $tags['POST_CONTENT'] = $postObject->getVar('post_text'); |
|
97 | + $tags['POST_NAME'] = $postObject->getVar('subject'); |
|
98 | + $notificationHandler->triggerEvent('global', 0, 'new_fullpost', $tags); |
|
99 | + $notificationHandler->triggerEvent('forum', $topicObject->getVar('forum_id'), 'new_fullpost', $tags); |
|
100 | + unset($postObject); |
|
101 | + } |
|
102 | + unset($topicsObject, $forumsObject); |
|
103 | + break; |
|
104 | + case 'delete': |
|
105 | + $forums = []; |
|
106 | + /** @var Newbb\TopicHandler|\XoopsPersistableObjectHandler $topicHandler */ |
|
107 | + $topicsObject = $topicHandler->getAll(new \Criteria('topic_id', '(' . implode(',', $topic_id) . ')', 'IN')); |
|
108 | + foreach (array_keys($topicsObject) as $id) { |
|
109 | + /** @var Newbb\Topic $topicObject */ |
|
110 | + $topicObject = $topicsObject[$id]; |
|
111 | + // irmtfan should be set to false to not delete topic from database |
|
112 | + $topicHandler->delete($topicObject, false); |
|
113 | + $topicHandler->synchronization($topicObject); |
|
114 | + $forums[$topicObject->getVar('forum_id')] = 1; |
|
115 | + } |
|
116 | 116 | |
117 | - $criteria_forum = new \Criteria('forum_id', '(' . implode(',', array_keys($forums)) . ')', 'IN'); |
|
118 | - $forumsObject = $forumHandler->getAll($criteria_forum); |
|
119 | - foreach (array_keys($forumsObject) as $id) { |
|
120 | - $forumHandler->synchronization($forumsObject[$id]); |
|
121 | - } |
|
122 | - unset($topicsObject, $forumsObject); |
|
123 | - break; |
|
124 | - case 'move': |
|
125 | - if (Request::getInt('newforum', 0, 'POST') |
|
126 | - && Request::getInt('newforum', 0, 'POST') !== $forum_id |
|
127 | - && $forumHandler->getPermission(Request::getInt('newforum', 0, 'POST'), 'post')) { |
|
128 | - $criteria = new \Criteria('topic_id', '(' . implode(',', $topic_id) . ')', 'IN'); |
|
129 | - // /** @var Newbb\PostHandler $postHandler */ |
|
130 | - // $postHandler = Newbb\Helper::getInstance()->getHandler('Post'); |
|
131 | - $postHandler->updateAll('forum_id', Request::getInt('newforum', 0, 'POST'), $criteria, true); |
|
132 | - $topicHandler->updateAll('forum_id', Request::getInt('newforum', 0, 'POST'), $criteria, true); |
|
133 | - $forumHandler->synchronization(Request::getInt('newforum', 0, 'POST')); |
|
134 | - $forumHandler->synchronization($forum_id); |
|
135 | - } else { |
|
136 | - require_once $GLOBALS['xoops']->path('header.php'); |
|
137 | - // /** @var Newbb\CategoryHandler $categoryHandler */ |
|
138 | - // $categoryHandler = Newbb\Helper::getInstance()->getHandler('Category'); |
|
139 | - $categories = $categoryHandler->getByPermission('access'); |
|
140 | - $forums = $forumHandler->getForumsByCategory(array_keys($categories), 'post', false); |
|
117 | + $criteria_forum = new \Criteria('forum_id', '(' . implode(',', array_keys($forums)) . ')', 'IN'); |
|
118 | + $forumsObject = $forumHandler->getAll($criteria_forum); |
|
119 | + foreach (array_keys($forumsObject) as $id) { |
|
120 | + $forumHandler->synchronization($forumsObject[$id]); |
|
121 | + } |
|
122 | + unset($topicsObject, $forumsObject); |
|
123 | + break; |
|
124 | + case 'move': |
|
125 | + if (Request::getInt('newforum', 0, 'POST') |
|
126 | + && Request::getInt('newforum', 0, 'POST') !== $forum_id |
|
127 | + && $forumHandler->getPermission(Request::getInt('newforum', 0, 'POST'), 'post')) { |
|
128 | + $criteria = new \Criteria('topic_id', '(' . implode(',', $topic_id) . ')', 'IN'); |
|
129 | + // /** @var Newbb\PostHandler $postHandler */ |
|
130 | + // $postHandler = Newbb\Helper::getInstance()->getHandler('Post'); |
|
131 | + $postHandler->updateAll('forum_id', Request::getInt('newforum', 0, 'POST'), $criteria, true); |
|
132 | + $topicHandler->updateAll('forum_id', Request::getInt('newforum', 0, 'POST'), $criteria, true); |
|
133 | + $forumHandler->synchronization(Request::getInt('newforum', 0, 'POST')); |
|
134 | + $forumHandler->synchronization($forum_id); |
|
135 | + } else { |
|
136 | + require_once $GLOBALS['xoops']->path('header.php'); |
|
137 | + // /** @var Newbb\CategoryHandler $categoryHandler */ |
|
138 | + // $categoryHandler = Newbb\Helper::getInstance()->getHandler('Category'); |
|
139 | + $categories = $categoryHandler->getByPermission('access'); |
|
140 | + $forums = $forumHandler->getForumsByCategory(array_keys($categories), 'post', false); |
|
141 | 141 | |
142 | - $box = '<select name="newforum" size="1">'; |
|
143 | - if (count($categories) > 0 && count($forums) > 0) { |
|
144 | - foreach (array_keys($forums) as $key) { |
|
142 | + $box = '<select name="newforum" size="1">'; |
|
143 | + if (count($categories) > 0 && count($forums) > 0) { |
|
144 | + foreach (array_keys($forums) as $key) { |
|
145 | 145 | |
146 | - /** @var Newbb\Category[] $categories */ |
|
147 | - $box .= "<option value='-1'>[" . $categories[$key]->getVar('cat_title') . ']</option>'; |
|
148 | - foreach ($forums[$key] as $forumid => $_forum) { |
|
149 | - $box .= "<option value='" . $forumid . "'>-- " . $_forum['title'] . '</option>'; |
|
150 | - if (!isset($_forum['sub'])) { |
|
151 | - continue; |
|
152 | - } |
|
153 | - foreach (array_keys($_forum['sub']) as $fid) { |
|
154 | - $box .= "<option value='" . $fid . "'>---- " . $_forum['sub'][$fid]['title'] . '</option>'; |
|
155 | - } |
|
156 | - } |
|
157 | - } |
|
158 | - } else { |
|
159 | - $box .= "<option value='-1'>" . _MD_NEWBB_NOFORUMINDB . '</option>'; |
|
160 | - } |
|
161 | - $box .= '</select>'; |
|
162 | - unset($forums, $categories); |
|
146 | + /** @var Newbb\Category[] $categories */ |
|
147 | + $box .= "<option value='-1'>[" . $categories[$key]->getVar('cat_title') . ']</option>'; |
|
148 | + foreach ($forums[$key] as $forumid => $_forum) { |
|
149 | + $box .= "<option value='" . $forumid . "'>-- " . $_forum['title'] . '</option>'; |
|
150 | + if (!isset($_forum['sub'])) { |
|
151 | + continue; |
|
152 | + } |
|
153 | + foreach (array_keys($_forum['sub']) as $fid) { |
|
154 | + $box .= "<option value='" . $fid . "'>---- " . $_forum['sub'][$fid]['title'] . '</option>'; |
|
155 | + } |
|
156 | + } |
|
157 | + } |
|
158 | + } else { |
|
159 | + $box .= "<option value='-1'>" . _MD_NEWBB_NOFORUMINDB . '</option>'; |
|
160 | + } |
|
161 | + $box .= '</select>'; |
|
162 | + unset($forums, $categories); |
|
163 | 163 | |
164 | - echo "<form action='" . Request::getString('PHP_SELF', '', 'SERVER') . "' method='post'>"; |
|
165 | - echo "<table border='0' cellpadding='1' cellspacing='0' align='center' width='95%'>"; |
|
166 | - echo "<tr><td class='bg2'>"; |
|
167 | - echo "<table border='0' cellpadding='1' cellspacing='1' width='100%'>"; |
|
168 | - echo '<tr><td class="bg3">' . _MD_NEWBB_MOVETOPICTO . '</td><td class="bg1">'; |
|
169 | - echo $box; |
|
170 | - echo '</td></tr>'; |
|
171 | - echo '<tr class="bg3"><td colspan="2" align="center">'; |
|
172 | - echo "<input type='hidden' name='op' value='move' />"; |
|
173 | - echo "<input type='hidden' name='forum_id' value='{$forum_id}' />"; |
|
174 | - foreach ($topic_id as $id) { |
|
175 | - echo "<input type='hidden' name='topic_id[]' value='" . $id . "' />"; |
|
176 | - } |
|
177 | - echo "<input type='submit' name='submit' value='" . _SUBMIT . "' />"; |
|
178 | - echo '</td></tr></table></td></tr></table>'; |
|
179 | - echo '</form>'; |
|
180 | - require_once $GLOBALS['xoops']->path('footer.php'); |
|
181 | - exit(); |
|
182 | - } |
|
183 | - break; |
|
164 | + echo "<form action='" . Request::getString('PHP_SELF', '', 'SERVER') . "' method='post'>"; |
|
165 | + echo "<table border='0' cellpadding='1' cellspacing='0' align='center' width='95%'>"; |
|
166 | + echo "<tr><td class='bg2'>"; |
|
167 | + echo "<table border='0' cellpadding='1' cellspacing='1' width='100%'>"; |
|
168 | + echo '<tr><td class="bg3">' . _MD_NEWBB_MOVETOPICTO . '</td><td class="bg1">'; |
|
169 | + echo $box; |
|
170 | + echo '</td></tr>'; |
|
171 | + echo '<tr class="bg3"><td colspan="2" align="center">'; |
|
172 | + echo "<input type='hidden' name='op' value='move' />"; |
|
173 | + echo "<input type='hidden' name='forum_id' value='{$forum_id}' />"; |
|
174 | + foreach ($topic_id as $id) { |
|
175 | + echo "<input type='hidden' name='topic_id[]' value='" . $id . "' />"; |
|
176 | + } |
|
177 | + echo "<input type='submit' name='submit' value='" . _SUBMIT . "' />"; |
|
178 | + echo '</td></tr></table></td></tr></table>'; |
|
179 | + echo '</form>'; |
|
180 | + require_once $GLOBALS['xoops']->path('footer.php'); |
|
181 | + exit(); |
|
182 | + } |
|
183 | + break; |
|
184 | 184 | } |
185 | 185 | ///** @var Newbb\StatsHandler $statsHandler */ |
186 | 186 | //$statsHandler = Newbb\Helper::getInstance()->getHandler('Stats'); |
@@ -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 | require_once $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 | require_once $GLOBALS['xoops']->path('footer.php'); |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | // |
3 | 3 | // Thanks Tom (http://www.wf-projects.com), for correcting the Engligh language package |
4 | 4 | if (defined('NEWBB_MODINFO_DEFINED')) { |
5 | - return; |
|
5 | + return; |
|
6 | 6 | } |
7 | 7 | define('NEWBB_MODINO_DEFINED', true); |
8 | 8 | // Module Info |
@@ -42,8 +42,8 @@ discard block |
||
42 | 42 | //define('_MI_NEWBB_THEMESET_DESC', "Module-wide, select '' . _NONE . '' will use site-wide theme"); |
43 | 43 | define('_MI_NEWBB_DIR_ATTACHMENT', 'Attachments physical path.'); |
44 | 44 | define( |
45 | - '_MI_NEWBB_DIR_ATTACHMENT_DESC', |
|
46 | - "Physical path only needs to be set from your xoops root and not before, for example you may have attachments uploaded to www.yoururl.com/uploads/newbb the path entered would then be '/uploads/newbb' never include a trailing slash '/' the thumbnails path becomes '/uploads/newbb/thumbs'" |
|
45 | + '_MI_NEWBB_DIR_ATTACHMENT_DESC', |
|
46 | + "Physical path only needs to be set from your xoops root and not before, for example you may have attachments uploaded to www.yoururl.com/uploads/newbb the path entered would then be '/uploads/newbb' never include a trailing slash '/' the thumbnails path becomes '/uploads/newbb/thumbs'" |
|
47 | 47 | ); |
48 | 48 | define('_MI_NEWBB_PATH_MAGICK', 'Path for ImageMagick'); |
49 | 49 | define('_MI_NEWBB_PATH_MAGICK_DESC', "Usually it is '/usr/bin/X11'. Leave it BLANK if you do not have ImageMagicK installed or for autodetecting."); |
@@ -81,8 +81,8 @@ discard block |
||
81 | 81 | define('_MI_NEWBB_GRAPHIC', 'graphic'); |
82 | 82 | define('_MI_NEWBB_USERLEVEL', 'HP/MP/EXP Level Mode'); |
83 | 83 | define( |
84 | - '_MI_NEWBB_USERLEVEL_DESC', |
|
85 | - '<strong>HP</strong> is determined by your average posts per day.<br><strong>MP</strong> is determined by your join date related to your post count.<br><strong>EXP</strong> goes up each time you post, and when you get to 100%, you gain a level and the EXP drops to 0 again.' |
|
84 | + '_MI_NEWBB_USERLEVEL_DESC', |
|
85 | + '<strong>HP</strong> is determined by your average posts per day.<br><strong>MP</strong> is determined by your join date related to your post count.<br><strong>EXP</strong> goes up each time you post, and when you get to 100%, you gain a level and the EXP drops to 0 again.' |
|
86 | 86 | ); |
87 | 87 | define('_MI_NEWBB_RSS_ENABLE', 'Enable RSS Feed'); |
88 | 88 | define('_MI_NEWBB_RSS_ENABLE_DESC', 'Enable RSS Feed, edit options below for maximum Items and Description length'); |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | define('_MI_NEWBB_INSTALL_FORUM_DESC', 'Forum for test.'); |
217 | 217 | define('_MI_NEWBB_INSTALL_POST_SUBJECT', 'Congratulations! The forum is working.'); |
218 | 218 | define('_MI_NEWBB_INSTALL_POST_TEXT', ' |
219 | - Welcome to ' . htmlspecialchars($GLOBALS['xoopsConfig']['sitename'], ENT_QUOTES) . ' forum. |
|
219 | + Welcome to ' . htmlspecialchars($GLOBALS['xoopsConfig']['sitename'], ENT_QUOTES).' forum. |
|
220 | 220 | Feel free to register and login to start your topics. |
221 | 221 | |
222 | 222 | If you have any question concerning NewBB usage, please visit your local support site or [url=https://xoops.org/modules/newbb/]XOOPS Support Site[/url]. |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | //Help |
326 | 326 | define('_MI_NEWBB_HELP', 'Help'); |
327 | 327 | define('_MI_NEWBB_DIRNAME', basename(dirname(dirname(__DIR__)))); |
328 | -define('_MI_NEWBB_HELP_HEADER', __DIR__ . '/help/helpheader.tpl'); |
|
328 | +define('_MI_NEWBB_HELP_HEADER', __DIR__.'/help/helpheader.tpl'); |
|
329 | 329 | define('_MI_NEWBB_BACK_2_ADMIN', 'Back to Administration of '); |
330 | 330 | define('_MI_NEWBB_OVERVIEW', 'Overview'); |
331 | 331 |
@@ -14,105 +14,105 @@ discard block |
||
14 | 14 | $moduleDirName = basename(__DIR__); |
15 | 15 | |
16 | 16 | $modversion = [ |
17 | - 'version' => 5.00, |
|
18 | - 'module_status' => 'Beta 1', |
|
19 | - 'release_date' => '2018/03/25', |
|
20 | - 'name' => _MI_NEWBB_NAME, |
|
21 | - 'description' => _MI_NEWBB_DESC, |
|
22 | - 'help' => 'page=help', |
|
23 | - 'credits' => 'NewBB 2 developed by Marko Schmuck (predator) / D.J. (phppp) / Alfred(dhcst)', |
|
24 | - 'author' => 'Marko Schmuck (predator) / D.J. (phppp) / Alfred(dhcst) / (irmtfan) / (Geekwright) / (Mamba) / (Aerograf)', |
|
25 | - 'license' => 'GNU GPL 2.0', |
|
26 | - 'license_url' => 'www.gnu.org/licenses/gpl-2.0.html/', |
|
27 | - 'image' => 'assets/images/logoModule.png', |
|
28 | - 'dirname' => basename(__DIR__), |
|
29 | - 'author_realname' => 'NewBB Dev Team', |
|
30 | - 'author_email' => '', |
|
31 | - 'module_website_url' => 'www.xoops.org/', |
|
32 | - 'module_website_name' => 'XOOPS', |
|
33 | - 'min_php' => '5.5', |
|
34 | - 'min_xoops' => '2.5.9', |
|
35 | - 'min_admin' => '1.2', |
|
36 | - 'min_db' => ['mysql' => '5.5'], |
|
37 | - 'modicons16' => 'assets/images/icons/16', |
|
38 | - 'modicons32' => 'assets/images/icons/32', |
|
39 | - 'demo_site_url' => 'https://xoops.org/newbb/', |
|
40 | - 'demo_site_name' => 'XOOPS Project', |
|
41 | - 'support_site_url' => 'https://xoops.org/newbb/', |
|
42 | - 'support_site_name' => 'XOOPS Project', |
|
43 | - 'submit_feature' => 'https://xoops.org/modules/newbb/viewforum.php?forum=30', |
|
44 | - 'submit_bug' => 'https://xoops.org/modules/newbb/viewforum.php?forum=28', |
|
45 | - // ------------------- Mysql ----------------------------- |
|
46 | - 'sqlfile' => ['mysql' => 'sql/mysql.sql'], |
|
47 | - // ------------------- Tables ---------------------------- |
|
48 | - 'tables' => [ |
|
49 | - $moduleDirName . '_' . 'archive', |
|
50 | - $moduleDirName . '_' . 'categories', |
|
51 | - $moduleDirName . '_' . 'votedata', |
|
52 | - $moduleDirName . '_' . 'forums', |
|
53 | - $moduleDirName . '_' . 'posts', |
|
54 | - $moduleDirName . '_' . 'posts_text', |
|
55 | - $moduleDirName . '_' . 'topics', |
|
56 | - $moduleDirName . '_' . 'online', |
|
57 | - $moduleDirName . '_' . 'digest', |
|
58 | - $moduleDirName . '_' . 'report', |
|
59 | - $moduleDirName . '_' . 'attachments', |
|
60 | - $moduleDirName . '_' . 'moderates', |
|
61 | - $moduleDirName . '_' . 'reads_forum', |
|
62 | - $moduleDirName . '_' . 'reads_topic', |
|
63 | - $moduleDirName . '_' . 'type', |
|
64 | - $moduleDirName . '_' . 'type_forum', |
|
65 | - $moduleDirName . '_' . 'stats', |
|
66 | - $moduleDirName . '_' . 'user_stats' |
|
67 | - ], |
|
68 | - // ------------------- Admin Menu ------------------- |
|
69 | - 'system_menu' => 1, |
|
70 | - 'hasAdmin' => 1, |
|
71 | - 'adminindex' => 'admin/index.php', |
|
72 | - 'adminmenu' => 'admin/menu.php', |
|
73 | - // ------------------- Main Menu ------------------- |
|
74 | - 'hasMain' => 1, |
|
75 | - // ------------------- Search --------------------------- |
|
76 | - 'hasSearch' => 1, |
|
77 | - 'search' => [ |
|
78 | - 'file' => 'include/search.inc.php', |
|
79 | - 'func' => 'newbb_search', |
|
80 | - ], |
|
81 | - // ------------------- Install/Update ------------------- |
|
82 | - 'onInstall' => 'include/module.php', |
|
83 | - 'onUpdate' => 'include/module.php', |
|
84 | - // 'onUninstall' => 'include/onuninstall.php', |
|
17 | + 'version' => 5.00, |
|
18 | + 'module_status' => 'Beta 1', |
|
19 | + 'release_date' => '2018/03/25', |
|
20 | + 'name' => _MI_NEWBB_NAME, |
|
21 | + 'description' => _MI_NEWBB_DESC, |
|
22 | + 'help' => 'page=help', |
|
23 | + 'credits' => 'NewBB 2 developed by Marko Schmuck (predator) / D.J. (phppp) / Alfred(dhcst)', |
|
24 | + 'author' => 'Marko Schmuck (predator) / D.J. (phppp) / Alfred(dhcst) / (irmtfan) / (Geekwright) / (Mamba) / (Aerograf)', |
|
25 | + 'license' => 'GNU GPL 2.0', |
|
26 | + 'license_url' => 'www.gnu.org/licenses/gpl-2.0.html/', |
|
27 | + 'image' => 'assets/images/logoModule.png', |
|
28 | + 'dirname' => basename(__DIR__), |
|
29 | + 'author_realname' => 'NewBB Dev Team', |
|
30 | + 'author_email' => '', |
|
31 | + 'module_website_url' => 'www.xoops.org/', |
|
32 | + 'module_website_name' => 'XOOPS', |
|
33 | + 'min_php' => '5.5', |
|
34 | + 'min_xoops' => '2.5.9', |
|
35 | + 'min_admin' => '1.2', |
|
36 | + 'min_db' => ['mysql' => '5.5'], |
|
37 | + 'modicons16' => 'assets/images/icons/16', |
|
38 | + 'modicons32' => 'assets/images/icons/32', |
|
39 | + 'demo_site_url' => 'https://xoops.org/newbb/', |
|
40 | + 'demo_site_name' => 'XOOPS Project', |
|
41 | + 'support_site_url' => 'https://xoops.org/newbb/', |
|
42 | + 'support_site_name' => 'XOOPS Project', |
|
43 | + 'submit_feature' => 'https://xoops.org/modules/newbb/viewforum.php?forum=30', |
|
44 | + 'submit_bug' => 'https://xoops.org/modules/newbb/viewforum.php?forum=28', |
|
45 | + // ------------------- Mysql ----------------------------- |
|
46 | + 'sqlfile' => ['mysql' => 'sql/mysql.sql'], |
|
47 | + // ------------------- Tables ---------------------------- |
|
48 | + 'tables' => [ |
|
49 | + $moduleDirName . '_' . 'archive', |
|
50 | + $moduleDirName . '_' . 'categories', |
|
51 | + $moduleDirName . '_' . 'votedata', |
|
52 | + $moduleDirName . '_' . 'forums', |
|
53 | + $moduleDirName . '_' . 'posts', |
|
54 | + $moduleDirName . '_' . 'posts_text', |
|
55 | + $moduleDirName . '_' . 'topics', |
|
56 | + $moduleDirName . '_' . 'online', |
|
57 | + $moduleDirName . '_' . 'digest', |
|
58 | + $moduleDirName . '_' . 'report', |
|
59 | + $moduleDirName . '_' . 'attachments', |
|
60 | + $moduleDirName . '_' . 'moderates', |
|
61 | + $moduleDirName . '_' . 'reads_forum', |
|
62 | + $moduleDirName . '_' . 'reads_topic', |
|
63 | + $moduleDirName . '_' . 'type', |
|
64 | + $moduleDirName . '_' . 'type_forum', |
|
65 | + $moduleDirName . '_' . 'stats', |
|
66 | + $moduleDirName . '_' . 'user_stats' |
|
67 | + ], |
|
68 | + // ------------------- Admin Menu ------------------- |
|
69 | + 'system_menu' => 1, |
|
70 | + 'hasAdmin' => 1, |
|
71 | + 'adminindex' => 'admin/index.php', |
|
72 | + 'adminmenu' => 'admin/menu.php', |
|
73 | + // ------------------- Main Menu ------------------- |
|
74 | + 'hasMain' => 1, |
|
75 | + // ------------------- Search --------------------------- |
|
76 | + 'hasSearch' => 1, |
|
77 | + 'search' => [ |
|
78 | + 'file' => 'include/search.inc.php', |
|
79 | + 'func' => 'newbb_search', |
|
80 | + ], |
|
81 | + // ------------------- Install/Update ------------------- |
|
82 | + 'onInstall' => 'include/module.php', |
|
83 | + 'onUpdate' => 'include/module.php', |
|
84 | + // 'onUninstall' => 'include/onuninstall.php', |
|
85 | 85 | ]; |
86 | 86 | // ------------------- Help files ------------------- // |
87 | 87 | $modversion['helpsection'] = [ |
88 | - ['name' => _MI_NEWBB_OVERVIEW, 'link' => 'page=help'], |
|
89 | - ['name' => _MI_NEWBB_HELP_DISCLAIMER, 'link' => 'page=disclaimer'], |
|
90 | - ['name' => _MI_NEWBB_LICENSE, 'link' => 'page=license'], |
|
91 | - ['name' => _MI_NEWBB_SUPPORT, 'link' => 'page=support'], |
|
92 | - // array('name' => _MI_NEWBB_HOWTO, 'link' => 'page=__howto'), |
|
93 | - // array('name' => _MI_NEWBB_REQUIREMENTS, 'link' => 'page=__requirements'), |
|
94 | - // array('name' => _MI_NEWBB_CREDITS, 'link' => 'page=__credits'), |
|
88 | + ['name' => _MI_NEWBB_OVERVIEW, 'link' => 'page=help'], |
|
89 | + ['name' => _MI_NEWBB_HELP_DISCLAIMER, 'link' => 'page=disclaimer'], |
|
90 | + ['name' => _MI_NEWBB_LICENSE, 'link' => 'page=license'], |
|
91 | + ['name' => _MI_NEWBB_SUPPORT, 'link' => 'page=support'], |
|
92 | + // array('name' => _MI_NEWBB_HOWTO, 'link' => 'page=__howto'), |
|
93 | + // array('name' => _MI_NEWBB_REQUIREMENTS, 'link' => 'page=__requirements'), |
|
94 | + // array('name' => _MI_NEWBB_CREDITS, 'link' => 'page=__credits'), |
|
95 | 95 | ]; |
96 | 96 | // Templates |
97 | 97 | $modversion['templates'] = [ |
98 | - ['file' => 'newbb_index_menu.tpl', 'description' => ''], |
|
99 | - ['file' => 'newbb_index.tpl', 'description' => ''], |
|
100 | - ['file' => 'newbb_viewforum_subforum.tpl', 'description' => ''], |
|
101 | - ['file' => 'newbb_viewforum_menu.tpl', 'description' => ''], |
|
102 | - ['file' => 'newbb_viewforum.tpl', 'description' => ''], |
|
103 | - ['file' => 'newbb_viewtopic.tpl', 'description' => ''], |
|
104 | - ['file' => 'newbb_thread.tpl', 'description' => ''], |
|
105 | - ['file' => 'newbb_edit_post.tpl', 'description' => ''], |
|
106 | - ['file' => 'newbb_poll_results.tpl', 'description' => ''], |
|
107 | - ['file' => 'newbb_poll_view.tpl', 'description' => ''], |
|
108 | - ['file' => 'newbb_searchresults.tpl', 'description' => ''], |
|
109 | - ['file' => 'newbb_search.tpl', 'description' => ''], |
|
110 | - ['file' => 'newbb_viewall.tpl', 'description' => ''], |
|
111 | - ['file' => 'newbb_viewpost.tpl', 'description' => ''], |
|
112 | - ['file' => 'newbb_online.tpl', 'description' => ''], |
|
113 | - ['file' => 'newbb_rss.tpl', 'description' => ''], |
|
114 | - ['file' => 'newbb_notification_select.tpl', 'description' => ''], |
|
115 | - ['file' => 'newbb_moderate.tpl', 'description' => ''], |
|
98 | + ['file' => 'newbb_index_menu.tpl', 'description' => ''], |
|
99 | + ['file' => 'newbb_index.tpl', 'description' => ''], |
|
100 | + ['file' => 'newbb_viewforum_subforum.tpl', 'description' => ''], |
|
101 | + ['file' => 'newbb_viewforum_menu.tpl', 'description' => ''], |
|
102 | + ['file' => 'newbb_viewforum.tpl', 'description' => ''], |
|
103 | + ['file' => 'newbb_viewtopic.tpl', 'description' => ''], |
|
104 | + ['file' => 'newbb_thread.tpl', 'description' => ''], |
|
105 | + ['file' => 'newbb_edit_post.tpl', 'description' => ''], |
|
106 | + ['file' => 'newbb_poll_results.tpl', 'description' => ''], |
|
107 | + ['file' => 'newbb_poll_view.tpl', 'description' => ''], |
|
108 | + ['file' => 'newbb_searchresults.tpl', 'description' => ''], |
|
109 | + ['file' => 'newbb_search.tpl', 'description' => ''], |
|
110 | + ['file' => 'newbb_viewall.tpl', 'description' => ''], |
|
111 | + ['file' => 'newbb_viewpost.tpl', 'description' => ''], |
|
112 | + ['file' => 'newbb_online.tpl', 'description' => ''], |
|
113 | + ['file' => 'newbb_rss.tpl', 'description' => ''], |
|
114 | + ['file' => 'newbb_notification_select.tpl', 'description' => ''], |
|
115 | + ['file' => 'newbb_moderate.tpl', 'description' => ''], |
|
116 | 116 | ]; |
117 | 117 | // Blocks |
118 | 118 | // options[0] - Citeria valid: time(by default) |
@@ -122,14 +122,14 @@ discard block |
||
122 | 122 | // options[4] - Display Navigator: 1 (by default), 0 (No) |
123 | 123 | // options[5] - SelectedForumIDs: null for all |
124 | 124 | $modversion['blocks'][1] = [ |
125 | - 'file' => 'newbb_block.php', |
|
126 | - 'name' => _MI_NEWBB_BLOCK_TOPIC_POST, |
|
127 | - 'description' => 'It Will drop (use advance topic renderer block)', |
|
128 | - // irmtfan |
|
129 | - 'show_func' => 'b_newbb_show', |
|
130 | - 'options' => 'time|5|360|0|1|0', |
|
131 | - 'edit_func' => 'b_newbb_edit', |
|
132 | - 'template' => 'newbb_block.tpl' |
|
125 | + 'file' => 'newbb_block.php', |
|
126 | + 'name' => _MI_NEWBB_BLOCK_TOPIC_POST, |
|
127 | + 'description' => 'It Will drop (use advance topic renderer block)', |
|
128 | + // irmtfan |
|
129 | + 'show_func' => 'b_newbb_show', |
|
130 | + 'options' => 'time|5|360|0|1|0', |
|
131 | + 'edit_func' => 'b_newbb_edit', |
|
132 | + 'template' => 'newbb_block.tpl' |
|
133 | 133 | ]; |
134 | 134 | // options[0] - Citeria valid: time(by default), views, replies, digest, sticky |
135 | 135 | // options[1] - NumberToDisplay: any positive integer |
@@ -139,14 +139,14 @@ discard block |
||
139 | 139 | // options[5] - Title Length : 0 - no limit |
140 | 140 | // options[6] - SelectedForumIDs: null for all |
141 | 141 | $modversion['blocks'][] = [ |
142 | - 'file' => 'newbb_block.php', |
|
143 | - 'name' => _MI_NEWBB_BLOCK_TOPIC, |
|
144 | - 'description' => 'It Will drop (use advance topic renderer block)', |
|
145 | - // irmtfan |
|
146 | - 'show_func' => 'b_newbb_topic_show', |
|
147 | - 'options' => 'time|5|0|0|1|0|0', |
|
148 | - 'edit_func' => 'b_newbb_topic_edit', |
|
149 | - 'template' => 'newbb_block_topic.tpl' |
|
142 | + 'file' => 'newbb_block.php', |
|
143 | + 'name' => _MI_NEWBB_BLOCK_TOPIC, |
|
144 | + 'description' => 'It Will drop (use advance topic renderer block)', |
|
145 | + // irmtfan |
|
146 | + 'show_func' => 'b_newbb_topic_show', |
|
147 | + 'options' => 'time|5|0|0|1|0|0', |
|
148 | + 'edit_func' => 'b_newbb_topic_edit', |
|
149 | + 'template' => 'newbb_block_topic.tpl' |
|
150 | 150 | ]; |
151 | 151 | // options[0] - Citeria valid: title(by default), text |
152 | 152 | // options[1] - NumberToDisplay: any positive integer |
@@ -156,13 +156,13 @@ discard block |
||
156 | 156 | // options[5] - Title/Text Length : 0 - no limit |
157 | 157 | // options[6] - SelectedForumIDs: null for all |
158 | 158 | $modversion['blocks'][] = [ |
159 | - 'file' => 'newbb_block.php', |
|
160 | - 'name' => _MI_NEWBB_BLOCK_POST, |
|
161 | - 'description' => 'Shows recent posts in the forums', |
|
162 | - 'show_func' => 'b_newbb_post_show', |
|
163 | - 'options' => 'title|10|0|0|1|0|0', |
|
164 | - 'edit_func' => 'b_newbb_post_edit', |
|
165 | - 'template' => 'newbb_block_post.tpl' |
|
159 | + 'file' => 'newbb_block.php', |
|
160 | + 'name' => _MI_NEWBB_BLOCK_POST, |
|
161 | + 'description' => 'Shows recent posts in the forums', |
|
162 | + 'show_func' => 'b_newbb_post_show', |
|
163 | + 'options' => 'title|10|0|0|1|0|0', |
|
164 | + 'edit_func' => 'b_newbb_post_edit', |
|
165 | + 'template' => 'newbb_block_post.tpl' |
|
166 | 166 | ]; |
167 | 167 | // options[0] - Citeria valid: post(by default), topic, digest, sticky |
168 | 168 | // options[1] - NumberToDisplay: any positive integer |
@@ -171,13 +171,13 @@ discard block |
||
171 | 171 | // options[4] - Display Navigator: 1 (by default), 0 (No) |
172 | 172 | // options[5] - SelectedForumIDs: null for all |
173 | 173 | $modversion['blocks'][] = [ |
174 | - 'file' => 'newbb_block.php', |
|
175 | - 'name' => _MI_NEWBB_BLOCK_AUTHOR, |
|
176 | - 'description' => 'Shows authors stats', |
|
177 | - 'show_func' => 'b_newbb_author_show', |
|
178 | - 'options' => 'topic|5|0|0|1|0', |
|
179 | - 'edit_func' => 'b_newbb_author_edit', |
|
180 | - 'template' => 'newbb_block_author.tpl' |
|
174 | + 'file' => 'newbb_block.php', |
|
175 | + 'name' => _MI_NEWBB_BLOCK_AUTHOR, |
|
176 | + 'description' => 'Shows authors stats', |
|
177 | + 'show_func' => 'b_newbb_author_show', |
|
178 | + 'options' => 'topic|5|0|0|1|0', |
|
179 | + 'edit_func' => 'b_newbb_author_edit', |
|
180 | + 'template' => 'newbb_block_author.tpl' |
|
181 | 181 | ]; |
182 | 182 | /* |
183 | 183 | * $options: |
@@ -187,13 +187,13 @@ discard block |
||
187 | 187 | * $options[3] - min font size (px or %) |
188 | 188 | */ |
189 | 189 | $modversion['blocks'][] = [ |
190 | - 'file' => 'newbb_block_tag.php', |
|
191 | - 'name' => _MI_NEWBB_BLOCK_TAG_CLOUD, |
|
192 | - 'description' => 'Show tag cloud', |
|
193 | - 'show_func' => 'newbb_tag_block_cloud_show', |
|
194 | - 'edit_func' => 'newbb_tag_block_cloud_edit', |
|
195 | - 'options' => '100|0|150|80', |
|
196 | - 'template' => 'newbb_tag_block_cloud.tpl' |
|
190 | + 'file' => 'newbb_block_tag.php', |
|
191 | + 'name' => _MI_NEWBB_BLOCK_TAG_CLOUD, |
|
192 | + 'description' => 'Show tag cloud', |
|
193 | + 'show_func' => 'newbb_tag_block_cloud_show', |
|
194 | + 'edit_func' => 'newbb_tag_block_cloud_edit', |
|
195 | + 'options' => '100|0|150|80', |
|
196 | + 'template' => 'newbb_tag_block_cloud.tpl' |
|
197 | 197 | ]; |
198 | 198 | /* |
199 | 199 | * $options: |
@@ -202,13 +202,13 @@ discard block |
||
202 | 202 | * $options[2] - sort: a - alphabet; c - count; t - time |
203 | 203 | */ |
204 | 204 | $modversion['blocks'][] = [ |
205 | - 'file' => 'newbb_block_tag.php', |
|
206 | - 'name' => _MI_NEWBB_BLOCK_TAG_TOP, |
|
207 | - 'description' => 'Show top tags', |
|
208 | - 'show_func' => 'newbb_tag_block_top_show', |
|
209 | - 'edit_func' => 'newbb_tag_block_top_edit', |
|
210 | - 'options' => '50|0|c', |
|
211 | - 'template' => 'newbb_tag_block_top.tpl' |
|
205 | + 'file' => 'newbb_block_tag.php', |
|
206 | + 'name' => _MI_NEWBB_BLOCK_TAG_TOP, |
|
207 | + 'description' => 'Show top tags', |
|
208 | + 'show_func' => 'newbb_tag_block_top_show', |
|
209 | + 'edit_func' => 'newbb_tag_block_top_edit', |
|
210 | + 'options' => '50|0|c', |
|
211 | + 'template' => 'newbb_tag_block_top.tpl' |
|
212 | 212 | ]; |
213 | 213 | // options[0] - Status in WHERE claus: all(by default), sticky, digest,lock, poll, voted, viewed, replied, read, (UN_) , active, pending, deleted (admin) (It is multi-select) |
214 | 214 | // options[1] - Uid in WHERE claus: uid of the topic poster : -1 - all users (by default) |
@@ -224,498 +224,498 @@ discard block |
||
224 | 224 | // options[11] - Post text Length: 0 - dont show post text - 200 by default |
225 | 225 | // options[12] - SelectedForumIDs: multi-select ngative values for categories and positive values for forums: null for all(by default) |
226 | 226 | $modversion['blocks'][] = [ |
227 | - 'file' => 'list_topic.php', |
|
228 | - 'name' => _MI_NEWBB_BLOCK_LIST_TOPIC, |
|
229 | - 'description' => 'Shows a list of topics (advance renderer)', |
|
230 | - 'show_func' => 'newbb_list_topic_show', |
|
231 | - 'options' => 'all|-1|-1|0|lastpost|0|5|360|topic,forum,replies,lastpost,lastposttime,lastposter,lastpostmsgicon,publish|1|0|200|0', |
|
232 | - 'edit_func' => 'newbb_list_topic_edit', |
|
233 | - 'template' => 'newbb_block_list_topic.tpl' |
|
227 | + 'file' => 'list_topic.php', |
|
228 | + 'name' => _MI_NEWBB_BLOCK_LIST_TOPIC, |
|
229 | + 'description' => 'Shows a list of topics (advance renderer)', |
|
230 | + 'show_func' => 'newbb_list_topic_show', |
|
231 | + 'options' => 'all|-1|-1|0|lastpost|0|5|360|topic,forum,replies,lastpost,lastposttime,lastposter,lastpostmsgicon,publish|1|0|200|0', |
|
232 | + 'edit_func' => 'newbb_list_topic_edit', |
|
233 | + 'template' => 'newbb_block_list_topic.tpl' |
|
234 | 234 | ]; |
235 | 235 | // Smarty |
236 | 236 | $modversion['use_smarty'] = 1; |
237 | 237 | // Configs |
238 | 238 | $modversion['config'] = []; |
239 | 239 | $modversion['config'][] = [ |
240 | - 'name' => 'do_rewrite', |
|
241 | - 'title' => '_MI_NEWBB_DO_REWRITE', |
|
242 | - 'description' => '_MI_NEWBB_DO_REWRITE_DESC', |
|
243 | - 'formtype' => 'yesno', |
|
244 | - 'valuetype' => 'int', |
|
245 | - 'default' => 0 |
|
246 | -]; |
|
247 | -$modversion['config'][] = [ |
|
248 | - 'name' => 'subforum_display', |
|
249 | - 'title' => '_MI_NEWBB_SUBFORUM_DISPLAY', |
|
250 | - 'description' => '_MI_NEWBB_SUBFORUM_DISPLAY_DESC', |
|
251 | - 'formtype' => 'select', |
|
252 | - 'valuetype' => 'text', |
|
253 | - 'options' => [ |
|
254 | - _MI_NEWBB_SUBFORUM_EXPAND => 'expand', |
|
255 | - _MI_NEWBB_SUBFORUM_COLLAPSE => 'collapse', |
|
256 | - _MI_NEWBB_SUBFORUM_HIDDEN => 'hidden' |
|
257 | - ], |
|
258 | - 'default' => 'collapse' |
|
259 | -]; |
|
260 | -$modversion['config'][] = [ |
|
261 | - 'name' => 'post_excerpt', |
|
262 | - 'title' => '_MI_NEWBB_POST_EXCERPT', |
|
263 | - 'description' => '_MI_NEWBB_POST_EXCERPT_DESC', |
|
264 | - 'formtype' => 'textbox', |
|
265 | - 'valuetype' => 'int', |
|
266 | - 'default' => 100 |
|
267 | -]; |
|
268 | -$modversion['config'][] = [ |
|
269 | - 'name' => 'topics_per_page', |
|
270 | - 'title' => '_MI_NEWBB_TOPICSPERPAGE', |
|
271 | - 'description' => '_MI_NEWBB_TOPICSPERPAGE_DESC', |
|
272 | - 'formtype' => 'textbox', |
|
273 | - 'valuetype' => 'int', |
|
274 | - 'default' => 20 |
|
275 | -]; |
|
276 | -$modversion['config'][] = [ |
|
277 | - 'name' => 'posts_per_page', |
|
278 | - 'title' => '_MI_NEWBB_POSTSPERPAGE', |
|
279 | - 'description' => '_MI_NEWBB_POSTSPERPAGE_DESC', |
|
280 | - 'formtype' => 'textbox', |
|
281 | - 'valuetype' => 'int', |
|
282 | - 'default' => 10 |
|
283 | -]; |
|
284 | -$modversion['config'][] = [ |
|
285 | - 'name' => 'pagenav_display', |
|
286 | - 'title' => '_MI_NEWBB_PAGENAV_DISPLAY', |
|
287 | - 'description' => '_MI_NEWBB_PAGENAV_DISPLAY_DESC', |
|
288 | - 'formtype' => 'select', |
|
289 | - 'valuetype' => 'text', |
|
290 | - 'options' => [ |
|
291 | - _MI_NEWBB_PAGENAV_NUMBER => 'number', |
|
292 | - _MI_NEWBB_PAGENAV_IMAGE => 'image', |
|
293 | - _MI_NEWBB_PAGENAV_SELECT => 'select' |
|
294 | - ], |
|
295 | - 'default' => 'number' |
|
296 | -]; |
|
297 | -$modversion['config'][] = [ |
|
298 | - 'name' => 'cache_enabled', |
|
299 | - 'title' => '_MI_NEWBB_CACHE_ENABLE', |
|
300 | - 'description' => '_MI_NEWBB_CACHE_ENABLE_DESC', |
|
301 | - 'formtype' => 'yesno', |
|
302 | - 'valuetype' => 'int', |
|
303 | - 'default' => 0 |
|
304 | -]; |
|
305 | -$modversion['config'][] = [ |
|
306 | - 'name' => 'statistik_enabled', |
|
307 | - 'title' => '_MI_NEWBB_STATISTIK_ENABLE', |
|
308 | - 'description' => '_MI_NEWBB_STATISTIK_ENABLE_DESC', |
|
309 | - 'formtype' => 'yesno', |
|
310 | - 'valuetype' => 'int', |
|
311 | - 'default' => 1 |
|
312 | -]; |
|
313 | -$modversion['config'][] = [ |
|
314 | - 'name' => 'dir_attachments', |
|
315 | - 'title' => '_MI_NEWBB_DIR_ATTACHMENT', |
|
316 | - 'description' => '_MI_NEWBB_DIR_ATTACHMENT_DESC', |
|
317 | - 'formtype' => 'textbox', |
|
318 | - 'valuetype' => 'text', |
|
319 | - 'default' => 'uploads/newbb' |
|
320 | -]; |
|
321 | -$modversion['config'][] = [ |
|
322 | - 'name' => 'media_allowed', |
|
323 | - 'title' => '_MI_NEWBB_MEDIA_ENABLE', |
|
324 | - 'description' => '_MI_NEWBB_MEDIA_ENABLE_DESC', |
|
325 | - 'formtype' => 'yesno', |
|
326 | - 'valuetype' => 'int', |
|
327 | - 'default' => 1 |
|
328 | -]; |
|
329 | -$modversion['config'][] = [ |
|
330 | - 'name' => 'path_magick', |
|
331 | - 'title' => '_MI_NEWBB_PATH_MAGICK', |
|
332 | - 'description' => '_MI_NEWBB_PATH_MAGICK_DESC', |
|
333 | - 'formtype' => 'textbox', |
|
334 | - 'valuetype' => 'text', |
|
335 | - 'default' => '/usr/bin/X11' |
|
336 | -]; |
|
337 | -$modversion['config'][] = [ |
|
338 | - 'name' => 'path_netpbm', |
|
339 | - 'title' => '_MI_NEWBB_PATH_NETPBM', |
|
340 | - 'description' => '_MI_NEWBB_PATH_NETPBM_DESC', |
|
341 | - 'formtype' => 'textbox', |
|
342 | - 'valuetype' => 'text', |
|
343 | - 'default' => '/usr/bin' |
|
344 | -]; |
|
345 | -$modversion['config'][] = [ |
|
346 | - 'name' => 'image_lib', |
|
347 | - 'title' => '_MI_NEWBB_IMAGELIB', |
|
348 | - 'description' => '_MI_NEWBB_IMAGELIB_DESC', |
|
349 | - 'formtype' => 'select', |
|
350 | - 'valuetype' => 'int', |
|
351 | - 'default' => 0, |
|
352 | - 'options' => [ |
|
353 | - _MI_NEWBB_AUTO => 0, |
|
354 | - _MI_NEWBB_MAGICK => 1, |
|
355 | - _MI_NEWBB_NETPBM => 2, |
|
356 | - _MI_NEWBB_GD1 => 3, |
|
357 | - _MI_NEWBB_GD2 => 4 |
|
358 | - ] |
|
359 | -]; |
|
360 | -$modversion['config'][] = [ |
|
361 | - 'name' => 'show_userattach', |
|
362 | - 'title' => '_MI_NEWBB_USERATTACH_ENABLE', |
|
363 | - 'description' => '_MI_NEWBB_USERATTACH_ENABLE_DESC', |
|
364 | - 'formtype' => 'yesno', |
|
365 | - 'valuetype' => 'int', |
|
366 | - 'default' => 1 |
|
367 | -]; |
|
368 | -$modversion['config'][] = [ |
|
369 | - 'name' => 'max_img_width', |
|
370 | - 'title' => '_MI_NEWBB_MAX_IMG_WIDTH', |
|
371 | - 'description' => '_MI_NEWBB_MAX_IMG_WIDTH_DESC', |
|
372 | - 'formtype' => 'textbox', |
|
373 | - 'valuetype' => 'int', |
|
374 | - 'default' => 800 |
|
375 | -]; |
|
376 | -$modversion['config'][] = [ |
|
377 | - 'name' => 'max_img_height', |
|
378 | - 'title' => '_MI_NEWBB_MAX_IMG_HEIGHT', |
|
379 | - 'description' => '_MI_NEWBB_MAX_IMG_HEIGHT_DESC', |
|
380 | - 'formtype' => 'textbox', |
|
381 | - 'valuetype' => 'int', |
|
382 | - 'default' => 640 |
|
383 | -]; |
|
384 | -$modversion['config'][] = [ |
|
385 | - 'name' => 'max_image_width', |
|
386 | - 'title' => '_MI_NEWBB_MAX_IMAGE_WIDTH', |
|
387 | - 'description' => '_MI_NEWBB_MAX_IMAGE_WIDTH_DESC', |
|
388 | - 'formtype' => 'textbox', |
|
389 | - 'valuetype' => 'int', |
|
390 | - 'default' => 150 |
|
391 | -]; |
|
392 | -$modversion['config'][] = [ |
|
393 | - 'name' => 'max_image_height', |
|
394 | - 'title' => '_MI_NEWBB_MAX_IMAGE_HEIGHT', |
|
395 | - 'description' => '_MI_NEWBB_MAX_IMAGE_HEIGHT_DESC', |
|
396 | - 'formtype' => 'textbox', |
|
397 | - 'valuetype' => 'int', |
|
398 | - 'default' => 150 |
|
399 | -]; |
|
400 | -$modversion['config'][] = [ |
|
401 | - 'name' => 'wol_enabled', |
|
402 | - 'title' => '_MI_NEWBB_WOL_ENABLE', |
|
403 | - 'description' => '_MI_NEWBB_WOL_ENABLE_DESC', |
|
404 | - 'formtype' => 'yesno', |
|
405 | - 'valuetype' => 'int', |
|
406 | - 'default' => 1 |
|
407 | -]; |
|
408 | -$modversion['config'][] = [ |
|
409 | - 'name' => 'user_level', |
|
410 | - 'title' => '_MI_NEWBB_USERLEVEL', |
|
411 | - 'description' => '_MI_NEWBB_USERLEVEL_DESC', |
|
412 | - 'formtype' => 'select', |
|
413 | - 'valuetype' => 'int', |
|
414 | - 'default' => 2, |
|
415 | - 'options' => [ |
|
416 | - _MI_NEWBB_NULL => 0, |
|
417 | - _MI_NEWBB_TEXT => 1, |
|
418 | - _MI_NEWBB_GRAPHIC => 2 |
|
419 | - ] |
|
420 | -]; |
|
421 | -$modversion['config'][] = [ |
|
422 | - 'name' => 'show_realname', |
|
423 | - 'title' => '_MI_NEWBB_SHOW_REALNAME', |
|
424 | - 'description' => '_MI_NEWBB_SHOW_REALNAME_DESC', |
|
425 | - 'formtype' => 'yesno', |
|
426 | - 'valuetype' => 'int', |
|
427 | - 'default' => 0 |
|
428 | -]; |
|
429 | -$modversion['config'][] = [ |
|
430 | - 'name' => 'groupbar_enabled', |
|
431 | - 'title' => '_MI_NEWBB_GROUPBAR_ENABLE', |
|
432 | - 'description' => '_MI_NEWBB_GROUPBAR_ENABLE_DESC', |
|
433 | - 'formtype' => 'yesno', |
|
434 | - 'valuetype' => 'int', |
|
435 | - 'default' => 1 |
|
436 | -]; |
|
437 | -$modversion['config'][] = [ |
|
438 | - 'name' => 'rating_enabled', |
|
439 | - 'title' => '_MI_NEWBB_RATING_ENABLE', |
|
440 | - 'description' => '_MI_NEWBB_RATING_ENABLE_DESC', |
|
441 | - 'formtype' => 'yesno', |
|
442 | - 'valuetype' => 'int', |
|
443 | - 'default' => 0 |
|
444 | -]; |
|
445 | -$modversion['config'][] = [ |
|
446 | - 'name' => 'reportmod_enabled', |
|
447 | - 'title' => '_MI_NEWBB_REPORTMOD_ENABLE', |
|
448 | - 'description' => '_MI_NEWBB_REPORTMOD_ENABLE_DESC', |
|
449 | - 'formtype' => 'yesno', |
|
450 | - 'valuetype' => 'int', |
|
451 | - 'default' => 0 |
|
452 | -]; |
|
453 | -$modversion['config'][] = [ |
|
454 | - 'name' => 'quickreply_enabled', |
|
455 | - 'title' => '_MI_NEWBB_QUICKREPLY_ENABLE', |
|
456 | - 'description' => '_MI_NEWBB_QUICKREPLY_ENABLE_DESC', |
|
457 | - 'formtype' => 'yesno', |
|
458 | - 'valuetype' => 'int', |
|
459 | - 'default' => 1 |
|
460 | -]; |
|
461 | -$modversion['config'][] = [ |
|
462 | - 'name' => 'rss_enable', |
|
463 | - 'title' => '_MI_NEWBB_RSS_ENABLE', |
|
464 | - 'description' => '_MI_NEWBB_RSS_ENABLE_DESC', |
|
465 | - 'formtype' => 'yesno', |
|
466 | - 'valuetype' => 'int', |
|
467 | - 'default' => 1 |
|
468 | -]; |
|
469 | -$modversion['config'][] = [ |
|
470 | - 'name' => 'rss_maxitems', |
|
471 | - 'title' => '_MI_NEWBB_RSS_MAX_ITEMS', |
|
472 | - 'description' => '', |
|
473 | - 'formtype' => 'textbox', |
|
474 | - 'valuetype' => 'int', |
|
475 | - 'default' => 10 |
|
476 | -]; |
|
477 | -$modversion['config'][] = [ |
|
478 | - 'name' => 'rss_maxdescription', |
|
479 | - 'title' => '_MI_NEWBB_RSS_MAX_DESCRIPTION', |
|
480 | - 'description' => '', |
|
481 | - 'formtype' => 'textbox', |
|
482 | - 'valuetype' => 'int', |
|
483 | - 'default' => 0 |
|
484 | -]; |
|
485 | -$modversion['config'][] = [ |
|
486 | - 'name' => 'rss_cachetime', |
|
487 | - 'title' => '_MI_NEWBB_RSS_CACHETIME', |
|
488 | - 'description' => '_MI_NEWBB_RSS_CACHETIME_DESCRIPTION', |
|
489 | - 'formtype' => 'textbox', |
|
490 | - 'valuetype' => 'int', |
|
491 | - 'default' => 30 |
|
240 | + 'name' => 'do_rewrite', |
|
241 | + 'title' => '_MI_NEWBB_DO_REWRITE', |
|
242 | + 'description' => '_MI_NEWBB_DO_REWRITE_DESC', |
|
243 | + 'formtype' => 'yesno', |
|
244 | + 'valuetype' => 'int', |
|
245 | + 'default' => 0 |
|
246 | +]; |
|
247 | +$modversion['config'][] = [ |
|
248 | + 'name' => 'subforum_display', |
|
249 | + 'title' => '_MI_NEWBB_SUBFORUM_DISPLAY', |
|
250 | + 'description' => '_MI_NEWBB_SUBFORUM_DISPLAY_DESC', |
|
251 | + 'formtype' => 'select', |
|
252 | + 'valuetype' => 'text', |
|
253 | + 'options' => [ |
|
254 | + _MI_NEWBB_SUBFORUM_EXPAND => 'expand', |
|
255 | + _MI_NEWBB_SUBFORUM_COLLAPSE => 'collapse', |
|
256 | + _MI_NEWBB_SUBFORUM_HIDDEN => 'hidden' |
|
257 | + ], |
|
258 | + 'default' => 'collapse' |
|
259 | +]; |
|
260 | +$modversion['config'][] = [ |
|
261 | + 'name' => 'post_excerpt', |
|
262 | + 'title' => '_MI_NEWBB_POST_EXCERPT', |
|
263 | + 'description' => '_MI_NEWBB_POST_EXCERPT_DESC', |
|
264 | + 'formtype' => 'textbox', |
|
265 | + 'valuetype' => 'int', |
|
266 | + 'default' => 100 |
|
267 | +]; |
|
268 | +$modversion['config'][] = [ |
|
269 | + 'name' => 'topics_per_page', |
|
270 | + 'title' => '_MI_NEWBB_TOPICSPERPAGE', |
|
271 | + 'description' => '_MI_NEWBB_TOPICSPERPAGE_DESC', |
|
272 | + 'formtype' => 'textbox', |
|
273 | + 'valuetype' => 'int', |
|
274 | + 'default' => 20 |
|
275 | +]; |
|
276 | +$modversion['config'][] = [ |
|
277 | + 'name' => 'posts_per_page', |
|
278 | + 'title' => '_MI_NEWBB_POSTSPERPAGE', |
|
279 | + 'description' => '_MI_NEWBB_POSTSPERPAGE_DESC', |
|
280 | + 'formtype' => 'textbox', |
|
281 | + 'valuetype' => 'int', |
|
282 | + 'default' => 10 |
|
283 | +]; |
|
284 | +$modversion['config'][] = [ |
|
285 | + 'name' => 'pagenav_display', |
|
286 | + 'title' => '_MI_NEWBB_PAGENAV_DISPLAY', |
|
287 | + 'description' => '_MI_NEWBB_PAGENAV_DISPLAY_DESC', |
|
288 | + 'formtype' => 'select', |
|
289 | + 'valuetype' => 'text', |
|
290 | + 'options' => [ |
|
291 | + _MI_NEWBB_PAGENAV_NUMBER => 'number', |
|
292 | + _MI_NEWBB_PAGENAV_IMAGE => 'image', |
|
293 | + _MI_NEWBB_PAGENAV_SELECT => 'select' |
|
294 | + ], |
|
295 | + 'default' => 'number' |
|
296 | +]; |
|
297 | +$modversion['config'][] = [ |
|
298 | + 'name' => 'cache_enabled', |
|
299 | + 'title' => '_MI_NEWBB_CACHE_ENABLE', |
|
300 | + 'description' => '_MI_NEWBB_CACHE_ENABLE_DESC', |
|
301 | + 'formtype' => 'yesno', |
|
302 | + 'valuetype' => 'int', |
|
303 | + 'default' => 0 |
|
304 | +]; |
|
305 | +$modversion['config'][] = [ |
|
306 | + 'name' => 'statistik_enabled', |
|
307 | + 'title' => '_MI_NEWBB_STATISTIK_ENABLE', |
|
308 | + 'description' => '_MI_NEWBB_STATISTIK_ENABLE_DESC', |
|
309 | + 'formtype' => 'yesno', |
|
310 | + 'valuetype' => 'int', |
|
311 | + 'default' => 1 |
|
312 | +]; |
|
313 | +$modversion['config'][] = [ |
|
314 | + 'name' => 'dir_attachments', |
|
315 | + 'title' => '_MI_NEWBB_DIR_ATTACHMENT', |
|
316 | + 'description' => '_MI_NEWBB_DIR_ATTACHMENT_DESC', |
|
317 | + 'formtype' => 'textbox', |
|
318 | + 'valuetype' => 'text', |
|
319 | + 'default' => 'uploads/newbb' |
|
320 | +]; |
|
321 | +$modversion['config'][] = [ |
|
322 | + 'name' => 'media_allowed', |
|
323 | + 'title' => '_MI_NEWBB_MEDIA_ENABLE', |
|
324 | + 'description' => '_MI_NEWBB_MEDIA_ENABLE_DESC', |
|
325 | + 'formtype' => 'yesno', |
|
326 | + 'valuetype' => 'int', |
|
327 | + 'default' => 1 |
|
328 | +]; |
|
329 | +$modversion['config'][] = [ |
|
330 | + 'name' => 'path_magick', |
|
331 | + 'title' => '_MI_NEWBB_PATH_MAGICK', |
|
332 | + 'description' => '_MI_NEWBB_PATH_MAGICK_DESC', |
|
333 | + 'formtype' => 'textbox', |
|
334 | + 'valuetype' => 'text', |
|
335 | + 'default' => '/usr/bin/X11' |
|
336 | +]; |
|
337 | +$modversion['config'][] = [ |
|
338 | + 'name' => 'path_netpbm', |
|
339 | + 'title' => '_MI_NEWBB_PATH_NETPBM', |
|
340 | + 'description' => '_MI_NEWBB_PATH_NETPBM_DESC', |
|
341 | + 'formtype' => 'textbox', |
|
342 | + 'valuetype' => 'text', |
|
343 | + 'default' => '/usr/bin' |
|
344 | +]; |
|
345 | +$modversion['config'][] = [ |
|
346 | + 'name' => 'image_lib', |
|
347 | + 'title' => '_MI_NEWBB_IMAGELIB', |
|
348 | + 'description' => '_MI_NEWBB_IMAGELIB_DESC', |
|
349 | + 'formtype' => 'select', |
|
350 | + 'valuetype' => 'int', |
|
351 | + 'default' => 0, |
|
352 | + 'options' => [ |
|
353 | + _MI_NEWBB_AUTO => 0, |
|
354 | + _MI_NEWBB_MAGICK => 1, |
|
355 | + _MI_NEWBB_NETPBM => 2, |
|
356 | + _MI_NEWBB_GD1 => 3, |
|
357 | + _MI_NEWBB_GD2 => 4 |
|
358 | + ] |
|
359 | +]; |
|
360 | +$modversion['config'][] = [ |
|
361 | + 'name' => 'show_userattach', |
|
362 | + 'title' => '_MI_NEWBB_USERATTACH_ENABLE', |
|
363 | + 'description' => '_MI_NEWBB_USERATTACH_ENABLE_DESC', |
|
364 | + 'formtype' => 'yesno', |
|
365 | + 'valuetype' => 'int', |
|
366 | + 'default' => 1 |
|
367 | +]; |
|
368 | +$modversion['config'][] = [ |
|
369 | + 'name' => 'max_img_width', |
|
370 | + 'title' => '_MI_NEWBB_MAX_IMG_WIDTH', |
|
371 | + 'description' => '_MI_NEWBB_MAX_IMG_WIDTH_DESC', |
|
372 | + 'formtype' => 'textbox', |
|
373 | + 'valuetype' => 'int', |
|
374 | + 'default' => 800 |
|
375 | +]; |
|
376 | +$modversion['config'][] = [ |
|
377 | + 'name' => 'max_img_height', |
|
378 | + 'title' => '_MI_NEWBB_MAX_IMG_HEIGHT', |
|
379 | + 'description' => '_MI_NEWBB_MAX_IMG_HEIGHT_DESC', |
|
380 | + 'formtype' => 'textbox', |
|
381 | + 'valuetype' => 'int', |
|
382 | + 'default' => 640 |
|
383 | +]; |
|
384 | +$modversion['config'][] = [ |
|
385 | + 'name' => 'max_image_width', |
|
386 | + 'title' => '_MI_NEWBB_MAX_IMAGE_WIDTH', |
|
387 | + 'description' => '_MI_NEWBB_MAX_IMAGE_WIDTH_DESC', |
|
388 | + 'formtype' => 'textbox', |
|
389 | + 'valuetype' => 'int', |
|
390 | + 'default' => 150 |
|
391 | +]; |
|
392 | +$modversion['config'][] = [ |
|
393 | + 'name' => 'max_image_height', |
|
394 | + 'title' => '_MI_NEWBB_MAX_IMAGE_HEIGHT', |
|
395 | + 'description' => '_MI_NEWBB_MAX_IMAGE_HEIGHT_DESC', |
|
396 | + 'formtype' => 'textbox', |
|
397 | + 'valuetype' => 'int', |
|
398 | + 'default' => 150 |
|
399 | +]; |
|
400 | +$modversion['config'][] = [ |
|
401 | + 'name' => 'wol_enabled', |
|
402 | + 'title' => '_MI_NEWBB_WOL_ENABLE', |
|
403 | + 'description' => '_MI_NEWBB_WOL_ENABLE_DESC', |
|
404 | + 'formtype' => 'yesno', |
|
405 | + 'valuetype' => 'int', |
|
406 | + 'default' => 1 |
|
407 | +]; |
|
408 | +$modversion['config'][] = [ |
|
409 | + 'name' => 'user_level', |
|
410 | + 'title' => '_MI_NEWBB_USERLEVEL', |
|
411 | + 'description' => '_MI_NEWBB_USERLEVEL_DESC', |
|
412 | + 'formtype' => 'select', |
|
413 | + 'valuetype' => 'int', |
|
414 | + 'default' => 2, |
|
415 | + 'options' => [ |
|
416 | + _MI_NEWBB_NULL => 0, |
|
417 | + _MI_NEWBB_TEXT => 1, |
|
418 | + _MI_NEWBB_GRAPHIC => 2 |
|
419 | + ] |
|
420 | +]; |
|
421 | +$modversion['config'][] = [ |
|
422 | + 'name' => 'show_realname', |
|
423 | + 'title' => '_MI_NEWBB_SHOW_REALNAME', |
|
424 | + 'description' => '_MI_NEWBB_SHOW_REALNAME_DESC', |
|
425 | + 'formtype' => 'yesno', |
|
426 | + 'valuetype' => 'int', |
|
427 | + 'default' => 0 |
|
428 | +]; |
|
429 | +$modversion['config'][] = [ |
|
430 | + 'name' => 'groupbar_enabled', |
|
431 | + 'title' => '_MI_NEWBB_GROUPBAR_ENABLE', |
|
432 | + 'description' => '_MI_NEWBB_GROUPBAR_ENABLE_DESC', |
|
433 | + 'formtype' => 'yesno', |
|
434 | + 'valuetype' => 'int', |
|
435 | + 'default' => 1 |
|
436 | +]; |
|
437 | +$modversion['config'][] = [ |
|
438 | + 'name' => 'rating_enabled', |
|
439 | + 'title' => '_MI_NEWBB_RATING_ENABLE', |
|
440 | + 'description' => '_MI_NEWBB_RATING_ENABLE_DESC', |
|
441 | + 'formtype' => 'yesno', |
|
442 | + 'valuetype' => 'int', |
|
443 | + 'default' => 0 |
|
444 | +]; |
|
445 | +$modversion['config'][] = [ |
|
446 | + 'name' => 'reportmod_enabled', |
|
447 | + 'title' => '_MI_NEWBB_REPORTMOD_ENABLE', |
|
448 | + 'description' => '_MI_NEWBB_REPORTMOD_ENABLE_DESC', |
|
449 | + 'formtype' => 'yesno', |
|
450 | + 'valuetype' => 'int', |
|
451 | + 'default' => 0 |
|
452 | +]; |
|
453 | +$modversion['config'][] = [ |
|
454 | + 'name' => 'quickreply_enabled', |
|
455 | + 'title' => '_MI_NEWBB_QUICKREPLY_ENABLE', |
|
456 | + 'description' => '_MI_NEWBB_QUICKREPLY_ENABLE_DESC', |
|
457 | + 'formtype' => 'yesno', |
|
458 | + 'valuetype' => 'int', |
|
459 | + 'default' => 1 |
|
460 | +]; |
|
461 | +$modversion['config'][] = [ |
|
462 | + 'name' => 'rss_enable', |
|
463 | + 'title' => '_MI_NEWBB_RSS_ENABLE', |
|
464 | + 'description' => '_MI_NEWBB_RSS_ENABLE_DESC', |
|
465 | + 'formtype' => 'yesno', |
|
466 | + 'valuetype' => 'int', |
|
467 | + 'default' => 1 |
|
468 | +]; |
|
469 | +$modversion['config'][] = [ |
|
470 | + 'name' => 'rss_maxitems', |
|
471 | + 'title' => '_MI_NEWBB_RSS_MAX_ITEMS', |
|
472 | + 'description' => '', |
|
473 | + 'formtype' => 'textbox', |
|
474 | + 'valuetype' => 'int', |
|
475 | + 'default' => 10 |
|
476 | +]; |
|
477 | +$modversion['config'][] = [ |
|
478 | + 'name' => 'rss_maxdescription', |
|
479 | + 'title' => '_MI_NEWBB_RSS_MAX_DESCRIPTION', |
|
480 | + 'description' => '', |
|
481 | + 'formtype' => 'textbox', |
|
482 | + 'valuetype' => 'int', |
|
483 | + 'default' => 0 |
|
484 | +]; |
|
485 | +$modversion['config'][] = [ |
|
486 | + 'name' => 'rss_cachetime', |
|
487 | + 'title' => '_MI_NEWBB_RSS_CACHETIME', |
|
488 | + 'description' => '_MI_NEWBB_RSS_CACHETIME_DESCRIPTION', |
|
489 | + 'formtype' => 'textbox', |
|
490 | + 'valuetype' => 'int', |
|
491 | + 'default' => 30 |
|
492 | 492 | ]; |
493 | 493 | // 4.05 |
494 | 494 | $modversion['config'][] = [ |
495 | - 'name' => 'show_infobox', |
|
496 | - 'title' => '_MI_NEWBB_SHOW_INFOBOX', |
|
497 | - 'description' => '_MI_NEWBB_SHOW_INFOBOX_DESC', |
|
498 | - 'formtype' => 'select', |
|
499 | - 'valuetype' => 'int', |
|
500 | - 'default' => 1, |
|
501 | - 'options' => [ |
|
502 | - _MI_NEWBB_INFOBOX_NONE => 0, |
|
503 | - _MI_NEWBB_INFOBOX_HIDDEN => 1, |
|
504 | - _MI_NEWBB_INFOBOX_SHOW => 2 |
|
505 | - ] |
|
506 | -]; |
|
507 | -$modversion['config'][] = [ |
|
508 | - 'name' => 'show_sociallinks', |
|
509 | - 'title' => '_MI_NEWBB_SHOW_SOCIALLINKS', |
|
510 | - 'description' => '_MI_NEWBB_SHOW_SOCIALLINKS_DESC', |
|
511 | - 'formtype' => 'yesno', |
|
512 | - 'valuetype' => 'int', |
|
513 | - 'default' => 1 |
|
514 | -]; |
|
515 | -$modversion['config'][] = [ |
|
516 | - 'name' => 'show_advertising', |
|
517 | - 'title' => '_MI_NEWBB_ADVERTISING', |
|
518 | - 'description' => '_MI_NEWBB_ADVERTISING_DESC', |
|
519 | - 'formtype' => 'yesno', |
|
520 | - 'valuetype' => 'int', |
|
521 | - 'default' => 0 |
|
522 | -]; |
|
523 | -$modversion['config'][] = [ |
|
524 | - 'name' => 'show_jump', |
|
525 | - 'title' => '_MI_NEWBB_SHOW_JUMPBOX', |
|
526 | - 'description' => '_MI_NEWBB_SHOW_JUMPBOX_DESC', |
|
527 | - 'formtype' => 'yesno', |
|
528 | - 'valuetype' => 'int', |
|
529 | - 'default' => 1 |
|
530 | -]; |
|
531 | -$modversion['config'][] = [ |
|
532 | - 'name' => 'show_permissiontable', |
|
533 | - 'title' => '_MI_NEWBB_SHOW_PERMISSIONTABLE', |
|
534 | - 'description' => '_MI_NEWBB_SHOW_PERMISSIONTABLE_DESC', |
|
535 | - 'formtype' => 'yesno', |
|
536 | - 'valuetype' => 'int', |
|
537 | - 'default' => 1 |
|
538 | -]; |
|
539 | -$modversion['config'][] = [ |
|
540 | - 'name' => 'email_digest', |
|
541 | - 'title' => '_MI_NEWBB_EMAIL_DIGEST', |
|
542 | - 'description' => '_MI_NEWBB_EMAIL_DIGEST_DESC', |
|
543 | - 'formtype' => 'select', |
|
544 | - 'valuetype' => 'int', |
|
545 | - 'default' => 0, |
|
546 | - 'options' => [ |
|
547 | - _MI_NEWBB_EMAIL_NONE => 0, |
|
548 | - _MI_NEWBB_EMAIL_DAILY => 1, |
|
549 | - _MI_NEWBB_EMAIL_WEEKLY => 2 |
|
550 | - ] |
|
551 | -]; |
|
552 | -$modversion['config'][] = [ |
|
553 | - 'name' => 'show_ip', |
|
554 | - 'title' => '_MI_NEWBB_SHOW_IP', |
|
555 | - 'description' => '_MI_NEWBB_SHOW_IP_DESC', |
|
556 | - 'formtype' => 'yesno', |
|
557 | - 'valuetype' => 'int', |
|
558 | - 'default' => 1 |
|
559 | -]; |
|
560 | -$modversion['config'][] = [ |
|
561 | - 'name' => 'enable_karma', |
|
562 | - 'title' => '_MI_NEWBB_ENABLE_KARMA', |
|
563 | - 'description' => '_MI_NEWBB_ENABLE_KARMA_DESC', |
|
564 | - 'formtype' => 'yesno', |
|
565 | - 'valuetype' => 'int', |
|
566 | - 'default' => 1 |
|
567 | -]; |
|
568 | -$modversion['config'][] = [ |
|
569 | - 'name' => 'karma_options', |
|
570 | - 'title' => '_MI_NEWBB_KARMA_OPTIONS', |
|
571 | - 'description' => '_MI_NEWBB_KARMA_OPTIONS_DESC', |
|
572 | - 'formtype' => 'textbox', |
|
573 | - 'valuetype' => 'text', |
|
574 | - 'default' => '0, 10, 50, 100, 500, 1000, 5000, 10000' |
|
495 | + 'name' => 'show_infobox', |
|
496 | + 'title' => '_MI_NEWBB_SHOW_INFOBOX', |
|
497 | + 'description' => '_MI_NEWBB_SHOW_INFOBOX_DESC', |
|
498 | + 'formtype' => 'select', |
|
499 | + 'valuetype' => 'int', |
|
500 | + 'default' => 1, |
|
501 | + 'options' => [ |
|
502 | + _MI_NEWBB_INFOBOX_NONE => 0, |
|
503 | + _MI_NEWBB_INFOBOX_HIDDEN => 1, |
|
504 | + _MI_NEWBB_INFOBOX_SHOW => 2 |
|
505 | + ] |
|
506 | +]; |
|
507 | +$modversion['config'][] = [ |
|
508 | + 'name' => 'show_sociallinks', |
|
509 | + 'title' => '_MI_NEWBB_SHOW_SOCIALLINKS', |
|
510 | + 'description' => '_MI_NEWBB_SHOW_SOCIALLINKS_DESC', |
|
511 | + 'formtype' => 'yesno', |
|
512 | + 'valuetype' => 'int', |
|
513 | + 'default' => 1 |
|
514 | +]; |
|
515 | +$modversion['config'][] = [ |
|
516 | + 'name' => 'show_advertising', |
|
517 | + 'title' => '_MI_NEWBB_ADVERTISING', |
|
518 | + 'description' => '_MI_NEWBB_ADVERTISING_DESC', |
|
519 | + 'formtype' => 'yesno', |
|
520 | + 'valuetype' => 'int', |
|
521 | + 'default' => 0 |
|
522 | +]; |
|
523 | +$modversion['config'][] = [ |
|
524 | + 'name' => 'show_jump', |
|
525 | + 'title' => '_MI_NEWBB_SHOW_JUMPBOX', |
|
526 | + 'description' => '_MI_NEWBB_SHOW_JUMPBOX_DESC', |
|
527 | + 'formtype' => 'yesno', |
|
528 | + 'valuetype' => 'int', |
|
529 | + 'default' => 1 |
|
530 | +]; |
|
531 | +$modversion['config'][] = [ |
|
532 | + 'name' => 'show_permissiontable', |
|
533 | + 'title' => '_MI_NEWBB_SHOW_PERMISSIONTABLE', |
|
534 | + 'description' => '_MI_NEWBB_SHOW_PERMISSIONTABLE_DESC', |
|
535 | + 'formtype' => 'yesno', |
|
536 | + 'valuetype' => 'int', |
|
537 | + 'default' => 1 |
|
538 | +]; |
|
539 | +$modversion['config'][] = [ |
|
540 | + 'name' => 'email_digest', |
|
541 | + 'title' => '_MI_NEWBB_EMAIL_DIGEST', |
|
542 | + 'description' => '_MI_NEWBB_EMAIL_DIGEST_DESC', |
|
543 | + 'formtype' => 'select', |
|
544 | + 'valuetype' => 'int', |
|
545 | + 'default' => 0, |
|
546 | + 'options' => [ |
|
547 | + _MI_NEWBB_EMAIL_NONE => 0, |
|
548 | + _MI_NEWBB_EMAIL_DAILY => 1, |
|
549 | + _MI_NEWBB_EMAIL_WEEKLY => 2 |
|
550 | + ] |
|
551 | +]; |
|
552 | +$modversion['config'][] = [ |
|
553 | + 'name' => 'show_ip', |
|
554 | + 'title' => '_MI_NEWBB_SHOW_IP', |
|
555 | + 'description' => '_MI_NEWBB_SHOW_IP_DESC', |
|
556 | + 'formtype' => 'yesno', |
|
557 | + 'valuetype' => 'int', |
|
558 | + 'default' => 1 |
|
559 | +]; |
|
560 | +$modversion['config'][] = [ |
|
561 | + 'name' => 'enable_karma', |
|
562 | + 'title' => '_MI_NEWBB_ENABLE_KARMA', |
|
563 | + 'description' => '_MI_NEWBB_ENABLE_KARMA_DESC', |
|
564 | + 'formtype' => 'yesno', |
|
565 | + 'valuetype' => 'int', |
|
566 | + 'default' => 1 |
|
567 | +]; |
|
568 | +$modversion['config'][] = [ |
|
569 | + 'name' => 'karma_options', |
|
570 | + 'title' => '_MI_NEWBB_KARMA_OPTIONS', |
|
571 | + 'description' => '_MI_NEWBB_KARMA_OPTIONS_DESC', |
|
572 | + 'formtype' => 'textbox', |
|
573 | + 'valuetype' => 'text', |
|
574 | + 'default' => '0, 10, 50, 100, 500, 1000, 5000, 10000' |
|
575 | 575 | ]; |
576 | 576 | // irmtfan - add 365 = one year |
577 | 577 | $modversion['config'][] = [ |
578 | - 'name' => 'since_options', |
|
579 | - 'title' => '_MI_NEWBB_SINCE_OPTIONS', |
|
580 | - 'description' => '_MI_NEWBB_SINCE_OPTIONS_DESC', |
|
581 | - 'formtype' => 'textbox', |
|
582 | - 'valuetype' => 'text', |
|
583 | - 'default' => '-1, -2, -6, -12, 0, 1, 2, 5, 10, 20, 30, 60, 100, 365' |
|
584 | -]; |
|
585 | -$modversion['config'][] = [ |
|
586 | - 'name' => 'since_default', |
|
587 | - 'title' => '_MI_NEWBB_SINCE_DEFAULT', |
|
588 | - 'description' => '_MI_NEWBB_SINCE_DEFAULT_DESC', |
|
589 | - 'formtype' => 'textbox', |
|
590 | - 'valuetype' => 'int', |
|
591 | - 'default' => 0 |
|
592 | -]; |
|
593 | -$modversion['config'][] = [ |
|
594 | - 'name' => 'allow_user_anonymous', |
|
595 | - 'title' => '_MI_NEWBB_USER_ANONYMOUS', |
|
596 | - 'description' => '_MI_NEWBB_USER_ANONYMOUS_DESC', |
|
597 | - 'formtype' => 'yesno', |
|
598 | - 'valuetype' => 'int', |
|
599 | - 'default' => 0 |
|
600 | -]; |
|
601 | -$modversion['config'][] = [ |
|
602 | - 'name' => 'anonymous_prefix', |
|
603 | - 'title' => '_MI_NEWBB_ANONYMOUS_PRE', |
|
604 | - 'description' => '_MI_NEWBB_ANONYMOUS_PRE_DESC', |
|
605 | - 'formtype' => 'textbox', |
|
606 | - 'valuetype' => 'text', |
|
607 | - 'default' => $GLOBALS['xoopsConfig']['anonymous'] . '-' |
|
608 | -]; |
|
609 | -$modversion['config'][] = [ |
|
610 | - 'name' => 'allow_require_reply', |
|
611 | - 'title' => '_MI_NEWBB_REQUIRE_REPLY', |
|
612 | - 'description' => '_MI_NEWBB_REQUIRE_REPLY_DESC', |
|
613 | - 'formtype' => 'yesno', |
|
614 | - 'valuetype' => 'int', |
|
615 | - 'default' => 0 |
|
616 | -]; |
|
617 | -$modversion['config'][] = [ |
|
618 | - 'name' => 'edit_timelimit', |
|
619 | - 'title' => '_MI_NEWBB_EDIT_TIMELIMIT', |
|
620 | - 'description' => '_MI_NEWBB_EDIT_TIMELIMIT_DESC', |
|
621 | - 'formtype' => 'textbox', |
|
622 | - 'valuetype' => 'int', |
|
623 | - 'default' => 60 |
|
624 | -]; |
|
625 | -$modversion['config'][] = [ |
|
626 | - 'name' => 'recordedit_timelimit', |
|
627 | - 'title' => '_MI_RECORDEDIT_TIMELIMIT', |
|
628 | - 'description' => '_MI_RECORDEDIT_TIMELIMIT_DESC', |
|
629 | - 'formtype' => 'textbox', |
|
630 | - 'valuetype' => 'int', |
|
631 | - 'default' => 15 |
|
632 | -]; |
|
633 | -$modversion['config'][] = [ |
|
634 | - 'name' => 'delete_timelimit', |
|
635 | - 'title' => '_MI_NEWBB_DELETE_TIMELIMIT', |
|
636 | - 'description' => '_MI_NEWBB_DELETE_TIMELIMIT_DESC', |
|
637 | - 'formtype' => 'textbox', |
|
638 | - 'valuetype' => 'int', |
|
639 | - 'default' => 60 |
|
640 | -]; |
|
641 | -$modversion['config'][] = [ |
|
642 | - 'name' => 'post_timelimit', |
|
643 | - 'title' => '_MI_NEWBB_POST_TIMELIMIT', |
|
644 | - 'description' => '_MI_NEWBB_POST_TIMELIMIT_DESC', |
|
645 | - 'formtype' => 'textbox', |
|
646 | - 'valuetype' => 'int', |
|
647 | - 'default' => 30 |
|
648 | -]; |
|
649 | -$modversion['config'][] = [ |
|
650 | - 'name' => 'enable_permcheck', |
|
651 | - 'title' => '_MI_NEWBB_PERMCHECK_ONDISPLAY', |
|
652 | - 'description' => '_MI_NEWBB_PERMCHECK_ONDISPLAY_DESC', |
|
653 | - 'formtype' => 'yesno', |
|
654 | - 'valuetype' => 'int', |
|
655 | - 'default' => 1 |
|
656 | -]; |
|
657 | -$modversion['config'][] = [ |
|
658 | - 'name' => 'enable_usermoderate', |
|
659 | - 'title' => '_MI_NEWBB_USERMODERATE', |
|
660 | - 'description' => '_MI_NEWBB_USERMODERATE_DESC', |
|
661 | - 'formtype' => 'yesno', |
|
662 | - 'valuetype' => 'int', |
|
663 | - 'default' => 0 |
|
664 | -]; |
|
665 | -$modversion['config'][] = [ |
|
666 | - 'name' => 'disc_show', |
|
667 | - 'title' => '_MI_NEWBB_SHOW_DIS', |
|
668 | - 'description' => '', |
|
669 | - 'formtype' => 'select', |
|
670 | - 'valuetype' => 'int', |
|
671 | - 'default' => 0, |
|
672 | - 'options' => [ |
|
673 | - _MI_NEWBB_NONE => 0, |
|
674 | - _MI_NEWBB_POST => 1, |
|
675 | - _MI_NEWBB_REPLY => 2, |
|
676 | - _MI_NEWBB_OP_BOTH => 3 |
|
677 | - ] |
|
678 | -]; |
|
679 | -$modversion['config'][] = [ |
|
680 | - 'name' => 'disclaimer', |
|
681 | - 'title' => '_MI_NEWBB_DISCLAIMER', |
|
682 | - 'description' => '_MI_NEWBB_DISCLAIMER_DESC', |
|
683 | - 'formtype' => 'textarea', |
|
684 | - 'valuetype' => 'text', |
|
685 | - 'default' => _MI_NEWBB_DISCLAIMER_TEXT |
|
686 | -]; |
|
687 | -$modversion['config'][] = [ |
|
688 | - 'name' => 'welcome_forum', |
|
689 | - 'title' => '_MI_NEWBB_WELCOMEFORUM', |
|
690 | - 'description' => '_MI_NEWBB_WELCOMEFORUM_DESC', |
|
691 | - 'formtype' => 'textbox', |
|
692 | - 'valuetype' => 'int', |
|
693 | - 'default' => 0, |
|
694 | - // 'options' => $forum_options |
|
695 | -]; |
|
696 | -$modversion['config'][] = [ |
|
697 | - 'name' => 'welcome_forum_message', |
|
698 | - 'title' => '_MI_NEWBB_WELCOMEFORUM_MESSAGE', |
|
699 | - 'description' => '_MI_NEWBB_WELCOMEFORUM_MESSAGE_DESC', |
|
700 | - 'formtype' => 'textarea', |
|
701 | - 'valuetype' => 'text', |
|
702 | - 'default' => _MI_NEWBB_WELCOMEFORUM_DESC_MESSAGE |
|
703 | -]; |
|
704 | -$modversion['config'][] = [ |
|
705 | - 'name' => 'poll_module', |
|
706 | - 'title' => '_MI_NEWBB_POLL_MODULE', |
|
707 | - 'description' => '_MI_NEWBB_POLL_MODULE_DESC', |
|
708 | - 'valuetype' => 'text', |
|
709 | - 'formtype' => 'textbox', |
|
710 | - 'default' => 'xoopspoll', |
|
711 | -]; |
|
712 | -$modversion['config'][] = [ |
|
713 | - 'name' => 'forum_desc_length', |
|
714 | - 'title' => '_MI_NEWBB_FORUM_DESC_LENGTH', |
|
715 | - 'description' => '_MI_NEWBB_FORUM_DESC_LENGTH_DESC', |
|
716 | - 'formtype' => 'textbox', |
|
717 | - 'valuetype' => 'int', |
|
718 | - 'default' => 440 |
|
578 | + 'name' => 'since_options', |
|
579 | + 'title' => '_MI_NEWBB_SINCE_OPTIONS', |
|
580 | + 'description' => '_MI_NEWBB_SINCE_OPTIONS_DESC', |
|
581 | + 'formtype' => 'textbox', |
|
582 | + 'valuetype' => 'text', |
|
583 | + 'default' => '-1, -2, -6, -12, 0, 1, 2, 5, 10, 20, 30, 60, 100, 365' |
|
584 | +]; |
|
585 | +$modversion['config'][] = [ |
|
586 | + 'name' => 'since_default', |
|
587 | + 'title' => '_MI_NEWBB_SINCE_DEFAULT', |
|
588 | + 'description' => '_MI_NEWBB_SINCE_DEFAULT_DESC', |
|
589 | + 'formtype' => 'textbox', |
|
590 | + 'valuetype' => 'int', |
|
591 | + 'default' => 0 |
|
592 | +]; |
|
593 | +$modversion['config'][] = [ |
|
594 | + 'name' => 'allow_user_anonymous', |
|
595 | + 'title' => '_MI_NEWBB_USER_ANONYMOUS', |
|
596 | + 'description' => '_MI_NEWBB_USER_ANONYMOUS_DESC', |
|
597 | + 'formtype' => 'yesno', |
|
598 | + 'valuetype' => 'int', |
|
599 | + 'default' => 0 |
|
600 | +]; |
|
601 | +$modversion['config'][] = [ |
|
602 | + 'name' => 'anonymous_prefix', |
|
603 | + 'title' => '_MI_NEWBB_ANONYMOUS_PRE', |
|
604 | + 'description' => '_MI_NEWBB_ANONYMOUS_PRE_DESC', |
|
605 | + 'formtype' => 'textbox', |
|
606 | + 'valuetype' => 'text', |
|
607 | + 'default' => $GLOBALS['xoopsConfig']['anonymous'] . '-' |
|
608 | +]; |
|
609 | +$modversion['config'][] = [ |
|
610 | + 'name' => 'allow_require_reply', |
|
611 | + 'title' => '_MI_NEWBB_REQUIRE_REPLY', |
|
612 | + 'description' => '_MI_NEWBB_REQUIRE_REPLY_DESC', |
|
613 | + 'formtype' => 'yesno', |
|
614 | + 'valuetype' => 'int', |
|
615 | + 'default' => 0 |
|
616 | +]; |
|
617 | +$modversion['config'][] = [ |
|
618 | + 'name' => 'edit_timelimit', |
|
619 | + 'title' => '_MI_NEWBB_EDIT_TIMELIMIT', |
|
620 | + 'description' => '_MI_NEWBB_EDIT_TIMELIMIT_DESC', |
|
621 | + 'formtype' => 'textbox', |
|
622 | + 'valuetype' => 'int', |
|
623 | + 'default' => 60 |
|
624 | +]; |
|
625 | +$modversion['config'][] = [ |
|
626 | + 'name' => 'recordedit_timelimit', |
|
627 | + 'title' => '_MI_RECORDEDIT_TIMELIMIT', |
|
628 | + 'description' => '_MI_RECORDEDIT_TIMELIMIT_DESC', |
|
629 | + 'formtype' => 'textbox', |
|
630 | + 'valuetype' => 'int', |
|
631 | + 'default' => 15 |
|
632 | +]; |
|
633 | +$modversion['config'][] = [ |
|
634 | + 'name' => 'delete_timelimit', |
|
635 | + 'title' => '_MI_NEWBB_DELETE_TIMELIMIT', |
|
636 | + 'description' => '_MI_NEWBB_DELETE_TIMELIMIT_DESC', |
|
637 | + 'formtype' => 'textbox', |
|
638 | + 'valuetype' => 'int', |
|
639 | + 'default' => 60 |
|
640 | +]; |
|
641 | +$modversion['config'][] = [ |
|
642 | + 'name' => 'post_timelimit', |
|
643 | + 'title' => '_MI_NEWBB_POST_TIMELIMIT', |
|
644 | + 'description' => '_MI_NEWBB_POST_TIMELIMIT_DESC', |
|
645 | + 'formtype' => 'textbox', |
|
646 | + 'valuetype' => 'int', |
|
647 | + 'default' => 30 |
|
648 | +]; |
|
649 | +$modversion['config'][] = [ |
|
650 | + 'name' => 'enable_permcheck', |
|
651 | + 'title' => '_MI_NEWBB_PERMCHECK_ONDISPLAY', |
|
652 | + 'description' => '_MI_NEWBB_PERMCHECK_ONDISPLAY_DESC', |
|
653 | + 'formtype' => 'yesno', |
|
654 | + 'valuetype' => 'int', |
|
655 | + 'default' => 1 |
|
656 | +]; |
|
657 | +$modversion['config'][] = [ |
|
658 | + 'name' => 'enable_usermoderate', |
|
659 | + 'title' => '_MI_NEWBB_USERMODERATE', |
|
660 | + 'description' => '_MI_NEWBB_USERMODERATE_DESC', |
|
661 | + 'formtype' => 'yesno', |
|
662 | + 'valuetype' => 'int', |
|
663 | + 'default' => 0 |
|
664 | +]; |
|
665 | +$modversion['config'][] = [ |
|
666 | + 'name' => 'disc_show', |
|
667 | + 'title' => '_MI_NEWBB_SHOW_DIS', |
|
668 | + 'description' => '', |
|
669 | + 'formtype' => 'select', |
|
670 | + 'valuetype' => 'int', |
|
671 | + 'default' => 0, |
|
672 | + 'options' => [ |
|
673 | + _MI_NEWBB_NONE => 0, |
|
674 | + _MI_NEWBB_POST => 1, |
|
675 | + _MI_NEWBB_REPLY => 2, |
|
676 | + _MI_NEWBB_OP_BOTH => 3 |
|
677 | + ] |
|
678 | +]; |
|
679 | +$modversion['config'][] = [ |
|
680 | + 'name' => 'disclaimer', |
|
681 | + 'title' => '_MI_NEWBB_DISCLAIMER', |
|
682 | + 'description' => '_MI_NEWBB_DISCLAIMER_DESC', |
|
683 | + 'formtype' => 'textarea', |
|
684 | + 'valuetype' => 'text', |
|
685 | + 'default' => _MI_NEWBB_DISCLAIMER_TEXT |
|
686 | +]; |
|
687 | +$modversion['config'][] = [ |
|
688 | + 'name' => 'welcome_forum', |
|
689 | + 'title' => '_MI_NEWBB_WELCOMEFORUM', |
|
690 | + 'description' => '_MI_NEWBB_WELCOMEFORUM_DESC', |
|
691 | + 'formtype' => 'textbox', |
|
692 | + 'valuetype' => 'int', |
|
693 | + 'default' => 0, |
|
694 | + // 'options' => $forum_options |
|
695 | +]; |
|
696 | +$modversion['config'][] = [ |
|
697 | + 'name' => 'welcome_forum_message', |
|
698 | + 'title' => '_MI_NEWBB_WELCOMEFORUM_MESSAGE', |
|
699 | + 'description' => '_MI_NEWBB_WELCOMEFORUM_MESSAGE_DESC', |
|
700 | + 'formtype' => 'textarea', |
|
701 | + 'valuetype' => 'text', |
|
702 | + 'default' => _MI_NEWBB_WELCOMEFORUM_DESC_MESSAGE |
|
703 | +]; |
|
704 | +$modversion['config'][] = [ |
|
705 | + 'name' => 'poll_module', |
|
706 | + 'title' => '_MI_NEWBB_POLL_MODULE', |
|
707 | + 'description' => '_MI_NEWBB_POLL_MODULE_DESC', |
|
708 | + 'valuetype' => 'text', |
|
709 | + 'formtype' => 'textbox', |
|
710 | + 'default' => 'xoopspoll', |
|
711 | +]; |
|
712 | +$modversion['config'][] = [ |
|
713 | + 'name' => 'forum_desc_length', |
|
714 | + 'title' => '_MI_NEWBB_FORUM_DESC_LENGTH', |
|
715 | + 'description' => '_MI_NEWBB_FORUM_DESC_LENGTH_DESC', |
|
716 | + 'formtype' => 'textbox', |
|
717 | + 'valuetype' => 'int', |
|
718 | + 'default' => 440 |
|
719 | 719 | ]; |
720 | 720 | |
721 | 721 | // Notification |
@@ -724,98 +724,98 @@ discard block |
||
724 | 724 | $modversion['notification']['lookup_file'] = 'include/notification.inc.php'; |
725 | 725 | $modversion['notification']['lookup_func'] = 'newbb_notify_iteminfo'; |
726 | 726 | $modversion['notification']['category'][] = [ |
727 | - 'name' => 'thread', |
|
728 | - 'title' => _MI_NEWBB_THREAD_NOTIFY, |
|
729 | - 'description' => _MI_NEWBB_THREAD_NOTIFYDSC, |
|
730 | - 'subscribe_from' => 'viewtopic.php', |
|
731 | - 'item_name' => 'topic_id', |
|
732 | - 'allow_bookmark' => 1, |
|
727 | + 'name' => 'thread', |
|
728 | + 'title' => _MI_NEWBB_THREAD_NOTIFY, |
|
729 | + 'description' => _MI_NEWBB_THREAD_NOTIFYDSC, |
|
730 | + 'subscribe_from' => 'viewtopic.php', |
|
731 | + 'item_name' => 'topic_id', |
|
732 | + 'allow_bookmark' => 1, |
|
733 | 733 | ]; |
734 | 734 | $modversion['notification']['category'][] = [ |
735 | - 'name' => 'forum', |
|
736 | - 'title' => _MI_NEWBB_FORUM_NOTIFY, |
|
737 | - 'description' => _MI_NEWBB_FORUM_NOTIFYDSC, |
|
738 | - 'subscribe_from' => 'viewforum.php', |
|
739 | - 'item_name' => 'forum', |
|
740 | - 'allow_bookmark' => 1, |
|
735 | + 'name' => 'forum', |
|
736 | + 'title' => _MI_NEWBB_FORUM_NOTIFY, |
|
737 | + 'description' => _MI_NEWBB_FORUM_NOTIFYDSC, |
|
738 | + 'subscribe_from' => 'viewforum.php', |
|
739 | + 'item_name' => 'forum', |
|
740 | + 'allow_bookmark' => 1, |
|
741 | 741 | ]; |
742 | 742 | $modversion['notification']['category'][] = [ |
743 | - 'name' => 'global', |
|
744 | - 'title' => _MI_NEWBB_GLOBAL_NOTIFY, |
|
745 | - 'description' => _MI_NEWBB_GLOBAL_NOTIFYDSC, |
|
746 | - 'subscribe_from' => 'index.php', |
|
743 | + 'name' => 'global', |
|
744 | + 'title' => _MI_NEWBB_GLOBAL_NOTIFY, |
|
745 | + 'description' => _MI_NEWBB_GLOBAL_NOTIFYDSC, |
|
746 | + 'subscribe_from' => 'index.php', |
|
747 | 747 | ]; |
748 | 748 | $modversion['notification']['event'][] = [ |
749 | - 'name' => 'new_post', |
|
750 | - 'category' => 'thread', |
|
751 | - 'title' => _MI_NEWBB_THREAD_NEWPOST_NOTIFY, |
|
752 | - 'caption' => _MI_NEWBB_THREAD_NEWPOST_NOTIFYCAP, |
|
753 | - 'description' => _MI_NEWBB_THREAD_NEWPOST_NOTIFYDSC, |
|
754 | - 'mail_template' => 'thread_newpost_notify', |
|
755 | - 'mail_subject' => _MI_NEWBB_THREAD_NEWPOST_NOTIFYSBJ, |
|
749 | + 'name' => 'new_post', |
|
750 | + 'category' => 'thread', |
|
751 | + 'title' => _MI_NEWBB_THREAD_NEWPOST_NOTIFY, |
|
752 | + 'caption' => _MI_NEWBB_THREAD_NEWPOST_NOTIFYCAP, |
|
753 | + 'description' => _MI_NEWBB_THREAD_NEWPOST_NOTIFYDSC, |
|
754 | + 'mail_template' => 'thread_newpost_notify', |
|
755 | + 'mail_subject' => _MI_NEWBB_THREAD_NEWPOST_NOTIFYSBJ, |
|
756 | 756 | ]; |
757 | 757 | $modversion['notification']['event'][] = [ |
758 | - 'name' => 'new_thread', |
|
759 | - 'category' => 'forum', |
|
760 | - 'title' => _MI_NEWBB_FORUM_NEWTHREAD_NOTIFY, |
|
761 | - 'caption' => _MI_NEWBB_FORUM_NEWTHREAD_NOTIFYCAP, |
|
762 | - 'description' => _MI_NEWBB_FORUM_NEWTHREAD_NOTIFYDSC, |
|
763 | - 'mail_template' => 'forum_newthread_notify', |
|
764 | - 'mail_subject' => _MI_NEWBB_FORUM_NEWTHREAD_NOTIFYSBJ, |
|
758 | + 'name' => 'new_thread', |
|
759 | + 'category' => 'forum', |
|
760 | + 'title' => _MI_NEWBB_FORUM_NEWTHREAD_NOTIFY, |
|
761 | + 'caption' => _MI_NEWBB_FORUM_NEWTHREAD_NOTIFYCAP, |
|
762 | + 'description' => _MI_NEWBB_FORUM_NEWTHREAD_NOTIFYDSC, |
|
763 | + 'mail_template' => 'forum_newthread_notify', |
|
764 | + 'mail_subject' => _MI_NEWBB_FORUM_NEWTHREAD_NOTIFYSBJ, |
|
765 | 765 | ]; |
766 | 766 | $modversion['notification']['event'][] = [ |
767 | - 'name' => 'new_forum', |
|
768 | - 'category' => 'global', |
|
769 | - 'title' => _MI_NEWBB_GLOBAL_NEWFORUM_NOTIFY, |
|
770 | - 'caption' => _MI_NEWBB_GLOBAL_NEWFORUM_NOTIFYCAP, |
|
771 | - 'description' => _MI_NEWBB_GLOBAL_NEWFORUM_NOTIFYDSC, |
|
772 | - 'mail_template' => 'global_newforum_notify', |
|
773 | - 'mail_subject' => _MI_NEWBB_GLOBAL_NEWFORUM_NOTIFYSBJ, |
|
767 | + 'name' => 'new_forum', |
|
768 | + 'category' => 'global', |
|
769 | + 'title' => _MI_NEWBB_GLOBAL_NEWFORUM_NOTIFY, |
|
770 | + 'caption' => _MI_NEWBB_GLOBAL_NEWFORUM_NOTIFYCAP, |
|
771 | + 'description' => _MI_NEWBB_GLOBAL_NEWFORUM_NOTIFYDSC, |
|
772 | + 'mail_template' => 'global_newforum_notify', |
|
773 | + 'mail_subject' => _MI_NEWBB_GLOBAL_NEWFORUM_NOTIFYSBJ, |
|
774 | 774 | ]; |
775 | 775 | $modversion['notification']['event'][] = [ |
776 | - 'name' => 'new_post', |
|
777 | - 'category' => 'global', |
|
778 | - 'title' => _MI_NEWBB_GLOBAL_NEWPOST_NOTIFY, |
|
779 | - 'caption' => _MI_NEWBB_GLOBAL_NEWPOST_NOTIFYCAP, |
|
780 | - 'description' => _MI_NEWBB_GLOBAL_NEWPOST_NOTIFYDSC, |
|
781 | - 'mail_template' => 'global_newpost_notify', |
|
782 | - 'mail_subject' => _MI_NEWBB_GLOBAL_NEWPOST_NOTIFYSBJ, |
|
776 | + 'name' => 'new_post', |
|
777 | + 'category' => 'global', |
|
778 | + 'title' => _MI_NEWBB_GLOBAL_NEWPOST_NOTIFY, |
|
779 | + 'caption' => _MI_NEWBB_GLOBAL_NEWPOST_NOTIFYCAP, |
|
780 | + 'description' => _MI_NEWBB_GLOBAL_NEWPOST_NOTIFYDSC, |
|
781 | + 'mail_template' => 'global_newpost_notify', |
|
782 | + 'mail_subject' => _MI_NEWBB_GLOBAL_NEWPOST_NOTIFYSBJ, |
|
783 | 783 | ]; |
784 | 784 | $modversion['notification']['event'][] = [ |
785 | - 'name' => 'new_post', |
|
786 | - 'category' => 'forum', |
|
787 | - 'title' => _MI_NEWBB_FORUM_NEWPOST_NOTIFY, |
|
788 | - 'caption' => _MI_NEWBB_FORUM_NEWPOST_NOTIFYCAP, |
|
789 | - 'description' => _MI_NEWBB_FORUM_NEWPOST_NOTIFYDSC, |
|
790 | - 'mail_template' => 'forum_newpost_notify', |
|
791 | - 'mail_subject' => _MI_NEWBB_FORUM_NEWPOST_NOTIFYSBJ, |
|
785 | + 'name' => 'new_post', |
|
786 | + 'category' => 'forum', |
|
787 | + 'title' => _MI_NEWBB_FORUM_NEWPOST_NOTIFY, |
|
788 | + 'caption' => _MI_NEWBB_FORUM_NEWPOST_NOTIFYCAP, |
|
789 | + 'description' => _MI_NEWBB_FORUM_NEWPOST_NOTIFYDSC, |
|
790 | + 'mail_template' => 'forum_newpost_notify', |
|
791 | + 'mail_subject' => _MI_NEWBB_FORUM_NEWPOST_NOTIFYSBJ, |
|
792 | 792 | ]; |
793 | 793 | $modversion['notification']['event'][] = [ |
794 | - 'name' => 'new_fullpost', |
|
795 | - 'category' => 'global', |
|
796 | - 'admin_only' => 1, |
|
797 | - 'title' => _MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFY, |
|
798 | - 'caption' => _MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFYCAP, |
|
799 | - 'description' => _MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFYDSC, |
|
800 | - 'mail_template' => 'global_newfullpost_notify', |
|
801 | - 'mail_subject' => _MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFYSBJ, |
|
794 | + 'name' => 'new_fullpost', |
|
795 | + 'category' => 'global', |
|
796 | + 'admin_only' => 1, |
|
797 | + 'title' => _MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFY, |
|
798 | + 'caption' => _MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFYCAP, |
|
799 | + 'description' => _MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFYDSC, |
|
800 | + 'mail_template' => 'global_newfullpost_notify', |
|
801 | + 'mail_subject' => _MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFYSBJ, |
|
802 | 802 | ]; |
803 | 803 | $modversion['notification']['event'][] = [ |
804 | - 'name' => 'digest', |
|
805 | - 'category' => 'global', |
|
806 | - 'title' => _MI_NEWBB_GLOBAL_DIGEST_NOTIFY, |
|
807 | - 'caption' => _MI_NEWBB_GLOBAL_DIGEST_NOTIFYCAP, |
|
808 | - 'description' => _MI_NEWBB_GLOBAL_DIGEST_NOTIFYDSC, |
|
809 | - 'mail_template' => 'global_digest_notify', |
|
810 | - 'mail_subject' => _MI_NEWBB_GLOBAL_DIGEST_NOTIFYSBJ, |
|
804 | + 'name' => 'digest', |
|
805 | + 'category' => 'global', |
|
806 | + 'title' => _MI_NEWBB_GLOBAL_DIGEST_NOTIFY, |
|
807 | + 'caption' => _MI_NEWBB_GLOBAL_DIGEST_NOTIFYCAP, |
|
808 | + 'description' => _MI_NEWBB_GLOBAL_DIGEST_NOTIFYDSC, |
|
809 | + 'mail_template' => 'global_digest_notify', |
|
810 | + 'mail_subject' => _MI_NEWBB_GLOBAL_DIGEST_NOTIFYSBJ, |
|
811 | 811 | ]; |
812 | 812 | $modversion['notification']['event'][] = [ |
813 | - 'name' => 'new_fullpost', |
|
814 | - 'category' => 'forum', |
|
815 | - 'admin_only' => 1, |
|
816 | - 'title' => _MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFY, |
|
817 | - 'caption' => _MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFYCAP, |
|
818 | - 'description' => _MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFYDSC, |
|
819 | - 'mail_template' => 'global_newfullpost_notify', |
|
820 | - 'mail_subject' => _MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFYSBJ, |
|
813 | + 'name' => 'new_fullpost', |
|
814 | + 'category' => 'forum', |
|
815 | + 'admin_only' => 1, |
|
816 | + 'title' => _MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFY, |
|
817 | + 'caption' => _MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFYCAP, |
|
818 | + 'description' => _MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFYDSC, |
|
819 | + 'mail_template' => 'global_newfullpost_notify', |
|
820 | + 'mail_subject' => _MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFYSBJ, |
|
821 | 821 | ]; |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * @package module::newbb |
10 | 10 | */ |
11 | 11 | |
12 | -require_once __DIR__ . '/preloads/autoloader.php'; |
|
12 | +require_once __DIR__.'/preloads/autoloader.php'; |
|
13 | 13 | |
14 | 14 | $moduleDirName = basename(__DIR__); |
15 | 15 | |
@@ -46,24 +46,24 @@ discard block |
||
46 | 46 | 'sqlfile' => ['mysql' => 'sql/mysql.sql'], |
47 | 47 | // ------------------- Tables ---------------------------- |
48 | 48 | 'tables' => [ |
49 | - $moduleDirName . '_' . 'archive', |
|
50 | - $moduleDirName . '_' . 'categories', |
|
51 | - $moduleDirName . '_' . 'votedata', |
|
52 | - $moduleDirName . '_' . 'forums', |
|
53 | - $moduleDirName . '_' . 'posts', |
|
54 | - $moduleDirName . '_' . 'posts_text', |
|
55 | - $moduleDirName . '_' . 'topics', |
|
56 | - $moduleDirName . '_' . 'online', |
|
57 | - $moduleDirName . '_' . 'digest', |
|
58 | - $moduleDirName . '_' . 'report', |
|
59 | - $moduleDirName . '_' . 'attachments', |
|
60 | - $moduleDirName . '_' . 'moderates', |
|
61 | - $moduleDirName . '_' . 'reads_forum', |
|
62 | - $moduleDirName . '_' . 'reads_topic', |
|
63 | - $moduleDirName . '_' . 'type', |
|
64 | - $moduleDirName . '_' . 'type_forum', |
|
65 | - $moduleDirName . '_' . 'stats', |
|
66 | - $moduleDirName . '_' . 'user_stats' |
|
49 | + $moduleDirName.'_'.'archive', |
|
50 | + $moduleDirName.'_'.'categories', |
|
51 | + $moduleDirName.'_'.'votedata', |
|
52 | + $moduleDirName.'_'.'forums', |
|
53 | + $moduleDirName.'_'.'posts', |
|
54 | + $moduleDirName.'_'.'posts_text', |
|
55 | + $moduleDirName.'_'.'topics', |
|
56 | + $moduleDirName.'_'.'online', |
|
57 | + $moduleDirName.'_'.'digest', |
|
58 | + $moduleDirName.'_'.'report', |
|
59 | + $moduleDirName.'_'.'attachments', |
|
60 | + $moduleDirName.'_'.'moderates', |
|
61 | + $moduleDirName.'_'.'reads_forum', |
|
62 | + $moduleDirName.'_'.'reads_topic', |
|
63 | + $moduleDirName.'_'.'type', |
|
64 | + $moduleDirName.'_'.'type_forum', |
|
65 | + $moduleDirName.'_'.'stats', |
|
66 | + $moduleDirName.'_'.'user_stats' |
|
67 | 67 | ], |
68 | 68 | // ------------------- Admin Menu ------------------- |
69 | 69 | 'system_menu' => 1, |
@@ -604,7 +604,7 @@ discard block |
||
604 | 604 | 'description' => '_MI_NEWBB_ANONYMOUS_PRE_DESC', |
605 | 605 | 'formtype' => 'textbox', |
606 | 606 | 'valuetype' => 'text', |
607 | - 'default' => $GLOBALS['xoopsConfig']['anonymous'] . '-' |
|
607 | + 'default' => $GLOBALS['xoopsConfig']['anonymous'].'-' |
|
608 | 608 | ]; |
609 | 609 | $modversion['config'][] = [ |
610 | 610 | 'name' => 'allow_require_reply', |
@@ -731,7 +731,7 @@ discard block |
||
731 | 731 | 'item_name' => 'topic_id', |
732 | 732 | 'allow_bookmark' => 1, |
733 | 733 | ]; |
734 | -$modversion['notification']['category'][] = [ |
|
734 | +$modversion['notification']['category'][] = [ |
|
735 | 735 | 'name' => 'forum', |
736 | 736 | 'title' => _MI_NEWBB_FORUM_NOTIFY, |
737 | 737 | 'description' => _MI_NEWBB_FORUM_NOTIFYDSC, |
@@ -739,13 +739,13 @@ discard block |
||
739 | 739 | 'item_name' => 'forum', |
740 | 740 | 'allow_bookmark' => 1, |
741 | 741 | ]; |
742 | -$modversion['notification']['category'][] = [ |
|
742 | +$modversion['notification']['category'][] = [ |
|
743 | 743 | 'name' => 'global', |
744 | 744 | 'title' => _MI_NEWBB_GLOBAL_NOTIFY, |
745 | 745 | 'description' => _MI_NEWBB_GLOBAL_NOTIFYDSC, |
746 | 746 | 'subscribe_from' => 'index.php', |
747 | 747 | ]; |
748 | -$modversion['notification']['event'][] = [ |
|
748 | +$modversion['notification']['event'][] = [ |
|
749 | 749 | 'name' => 'new_post', |
750 | 750 | 'category' => 'thread', |
751 | 751 | 'title' => _MI_NEWBB_THREAD_NEWPOST_NOTIFY, |
@@ -754,7 +754,7 @@ discard block |
||
754 | 754 | 'mail_template' => 'thread_newpost_notify', |
755 | 755 | 'mail_subject' => _MI_NEWBB_THREAD_NEWPOST_NOTIFYSBJ, |
756 | 756 | ]; |
757 | -$modversion['notification']['event'][] = [ |
|
757 | +$modversion['notification']['event'][] = [ |
|
758 | 758 | 'name' => 'new_thread', |
759 | 759 | 'category' => 'forum', |
760 | 760 | 'title' => _MI_NEWBB_FORUM_NEWTHREAD_NOTIFY, |
@@ -763,7 +763,7 @@ discard block |
||
763 | 763 | 'mail_template' => 'forum_newthread_notify', |
764 | 764 | 'mail_subject' => _MI_NEWBB_FORUM_NEWTHREAD_NOTIFYSBJ, |
765 | 765 | ]; |
766 | -$modversion['notification']['event'][] = [ |
|
766 | +$modversion['notification']['event'][] = [ |
|
767 | 767 | 'name' => 'new_forum', |
768 | 768 | 'category' => 'global', |
769 | 769 | 'title' => _MI_NEWBB_GLOBAL_NEWFORUM_NOTIFY, |
@@ -772,7 +772,7 @@ discard block |
||
772 | 772 | 'mail_template' => 'global_newforum_notify', |
773 | 773 | 'mail_subject' => _MI_NEWBB_GLOBAL_NEWFORUM_NOTIFYSBJ, |
774 | 774 | ]; |
775 | -$modversion['notification']['event'][] = [ |
|
775 | +$modversion['notification']['event'][] = [ |
|
776 | 776 | 'name' => 'new_post', |
777 | 777 | 'category' => 'global', |
778 | 778 | 'title' => _MI_NEWBB_GLOBAL_NEWPOST_NOTIFY, |
@@ -781,7 +781,7 @@ discard block |
||
781 | 781 | 'mail_template' => 'global_newpost_notify', |
782 | 782 | 'mail_subject' => _MI_NEWBB_GLOBAL_NEWPOST_NOTIFYSBJ, |
783 | 783 | ]; |
784 | -$modversion['notification']['event'][] = [ |
|
784 | +$modversion['notification']['event'][] = [ |
|
785 | 785 | 'name' => 'new_post', |
786 | 786 | 'category' => 'forum', |
787 | 787 | 'title' => _MI_NEWBB_FORUM_NEWPOST_NOTIFY, |
@@ -790,7 +790,7 @@ discard block |
||
790 | 790 | 'mail_template' => 'forum_newpost_notify', |
791 | 791 | 'mail_subject' => _MI_NEWBB_FORUM_NEWPOST_NOTIFYSBJ, |
792 | 792 | ]; |
793 | -$modversion['notification']['event'][] = [ |
|
793 | +$modversion['notification']['event'][] = [ |
|
794 | 794 | 'name' => 'new_fullpost', |
795 | 795 | 'category' => 'global', |
796 | 796 | 'admin_only' => 1, |
@@ -800,7 +800,7 @@ discard block |
||
800 | 800 | 'mail_template' => 'global_newfullpost_notify', |
801 | 801 | 'mail_subject' => _MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFYSBJ, |
802 | 802 | ]; |
803 | -$modversion['notification']['event'][] = [ |
|
803 | +$modversion['notification']['event'][] = [ |
|
804 | 804 | 'name' => 'digest', |
805 | 805 | 'category' => 'global', |
806 | 806 | 'title' => _MI_NEWBB_GLOBAL_DIGEST_NOTIFY, |
@@ -809,7 +809,7 @@ discard block |
||
809 | 809 | 'mail_template' => 'global_digest_notify', |
810 | 810 | 'mail_subject' => _MI_NEWBB_GLOBAL_DIGEST_NOTIFYSBJ, |
811 | 811 | ]; |
812 | -$modversion['notification']['event'][] = [ |
|
812 | +$modversion['notification']['event'][] = [ |
|
813 | 813 | 'name' => 'new_fullpost', |
814 | 814 | 'category' => 'forum', |
815 | 815 | 'admin_only' => 1, |
@@ -16,17 +16,17 @@ discard block |
||
16 | 16 | |
17 | 17 | /* deal with marks */ |
18 | 18 | if (Request::getInt('mark_read', 0)) { |
19 | - if (1 === Request::getInt('mark_read', 0)) { // marked as read |
|
20 | - $markvalue = 1; |
|
21 | - $markresult = _MD_NEWBB_MARK_READ; |
|
22 | - } else { // marked as unread |
|
23 | - $markvalue = 0; |
|
24 | - $markresult = _MD_NEWBB_MARK_UNREAD; |
|
25 | - } |
|
26 | - require_once __DIR__ . '/include/functions.read.php'; |
|
27 | - newbbSetReadForum($markvalue); |
|
28 | - $url = XOOPS_URL . '/modules/newbb/index.php'; |
|
29 | - redirect_header($url, 2, _MD_NEWBB_ALL_FORUM_MARKED . ' ' . $markresult); |
|
19 | + if (1 === Request::getInt('mark_read', 0)) { // marked as read |
|
20 | + $markvalue = 1; |
|
21 | + $markresult = _MD_NEWBB_MARK_READ; |
|
22 | + } else { // marked as unread |
|
23 | + $markvalue = 0; |
|
24 | + $markresult = _MD_NEWBB_MARK_UNREAD; |
|
25 | + } |
|
26 | + require_once __DIR__ . '/include/functions.read.php'; |
|
27 | + newbbSetReadForum($markvalue); |
|
28 | + $url = XOOPS_URL . '/modules/newbb/index.php'; |
|
29 | + redirect_header($url, 2, _MD_NEWBB_ALL_FORUM_MARKED . ' ' . $markresult); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | $viewcat = Request::getInt('cat', 0, 'GET');//TODO mb check if this is GET or POST? |
@@ -35,20 +35,20 @@ discard block |
||
35 | 35 | |
36 | 36 | $categories = []; |
37 | 37 | if (!$viewcat) { |
38 | - $categories = $categoryHandler->getByPermission('access', null, false); |
|
39 | - $forum_index_title = ''; |
|
40 | - $xoops_pagetitle = $xoopsModule->getVar('name'); |
|
38 | + $categories = $categoryHandler->getByPermission('access', null, false); |
|
39 | + $forum_index_title = ''; |
|
40 | + $xoops_pagetitle = $xoopsModule->getVar('name'); |
|
41 | 41 | } else { |
42 | - $categoryObject = $categoryHandler->get($viewcat); |
|
43 | - if ($categoryHandler->getPermission($categoryObject)) { |
|
44 | - $categories[$viewcat] = $categoryObject->getValues(); |
|
45 | - } |
|
46 | - $forum_index_title = sprintf(_MD_NEWBB_FORUMINDEX, htmlspecialchars($GLOBALS['xoopsConfig']['sitename'], ENT_QUOTES)); |
|
47 | - $xoops_pagetitle = $categoryObject->getVar('cat_title') . ' [' . $xoopsModule->getVar('name') . ']'; |
|
42 | + $categoryObject = $categoryHandler->get($viewcat); |
|
43 | + if ($categoryHandler->getPermission($categoryObject)) { |
|
44 | + $categories[$viewcat] = $categoryObject->getValues(); |
|
45 | + } |
|
46 | + $forum_index_title = sprintf(_MD_NEWBB_FORUMINDEX, htmlspecialchars($GLOBALS['xoopsConfig']['sitename'], ENT_QUOTES)); |
|
47 | + $xoops_pagetitle = $categoryObject->getVar('cat_title') . ' [' . $xoopsModule->getVar('name') . ']'; |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | if (0 === count($categories)) { |
51 | - redirect_header(XOOPS_URL, 2, _MD_NEWBB_NORIGHTTOACCESS); |
|
51 | + redirect_header(XOOPS_URL, 2, _MD_NEWBB_NORIGHTTOACCESS); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | $xoopsOption['template_main'] = 'newbb_index.tpl'; |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | /* rss feed */ |
62 | 62 | // irmtfan new method |
63 | 63 | if (!empty($GLOBALS['xoopsModuleConfig']['rss_enable'])) { |
64 | - $xoopsTpl->assign('xoops_module_header', ' |
|
64 | + $xoopsTpl->assign('xoops_module_header', ' |
|
65 | 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 | } |
@@ -71,10 +71,10 @@ discard block |
||
71 | 71 | $xoopsTpl->assign('forum_index_title', $forum_index_title); |
72 | 72 | //if ($GLOBALS['xoopsModuleConfig']['wol_enabled']) { |
73 | 73 | if (!empty($GLOBALS['xoopsModuleConfig']['wol_enabled'])) { |
74 | - // /** @var Newbb\OnlineHandler $onlineHandler */ |
|
75 | - // $onlineHandler = Newbb\Helper::getInstance()->getHandler('Online'); |
|
76 | - $onlineHandler->init(); |
|
77 | - $xoopsTpl->assign('online', $onlineHandler->showOnline()); |
|
74 | + // /** @var Newbb\OnlineHandler $onlineHandler */ |
|
75 | + // $onlineHandler = Newbb\Helper::getInstance()->getHandler('Online'); |
|
76 | + $onlineHandler->init(); |
|
77 | + $xoopsTpl->assign('online', $onlineHandler->showOnline()); |
|
78 | 78 | } |
79 | 79 | /** @var Newbb\ForumHandler $forumHandler */ |
80 | 80 | $forumHandler = Newbb\Helper::getInstance()->getHandler('Forum'); |
@@ -88,19 +88,19 @@ discard block |
||
88 | 88 | $forums_top = []; |
89 | 89 | |
90 | 90 | if (!empty($forums_allowed)) { |
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')); |
|
94 | - $forums_top = $forumHandler->getIds($crit_top); |
|
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')); |
|
94 | + $forums_top = $forumHandler->getIds($crit_top); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | /* fetch subforums if required to display */ |
98 | 98 | if ('hidden' === $GLOBALS['xoopsModuleConfig']['subforum_display'] || 0 === count($forums_top)) { |
99 | - $forums_sub = []; |
|
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')); |
|
103 | - $forums_sub = $forumHandler->getIds($crit_sub); |
|
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 | + $forums_sub = $forumHandler->getIds($crit_sub); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | /* Fetch forum data */ |
@@ -111,32 +111,32 @@ 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'); |
|
115 | - $crit_forum->setSort('cat_id ASC, parent_forum ASC, forum_order'); |
|
116 | - $crit_forum->setOrder('ASC'); |
|
117 | - $forums = $forumHandler->getAll($crit_forum, null, false); |
|
118 | - $newtopics = $forumHandler->getTopicCount($forums, 0, 'pending'); |
|
119 | - $deletetopics = $forumHandler->getTopicCount($forums, 0, 'deleted'); |
|
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')); |
|
122 | - $crit->add(new \Criteria('approved', '-1')); |
|
123 | - $deleteposts = $postHandler->getCount($crit); |
|
124 | - $crit = new \CriteriaCompo(new \Criteria('forum_id', '(' . implode(', ', $forums_available) . ')', 'IN')); |
|
125 | - $crit->add(new \Criteria('approved', '0')); |
|
126 | - $newposts = $postHandler->getCount($crit); |
|
114 | + $crit_forum = new \Criteria('forum_id', '(' . implode(', ', $forums_available) . ')', 'IN'); |
|
115 | + $crit_forum->setSort('cat_id ASC, parent_forum ASC, forum_order'); |
|
116 | + $crit_forum->setOrder('ASC'); |
|
117 | + $forums = $forumHandler->getAll($crit_forum, null, false); |
|
118 | + $newtopics = $forumHandler->getTopicCount($forums, 0, 'pending'); |
|
119 | + $deletetopics = $forumHandler->getTopicCount($forums, 0, 'deleted'); |
|
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')); |
|
122 | + $crit->add(new \Criteria('approved', '-1')); |
|
123 | + $deleteposts = $postHandler->getCount($crit); |
|
124 | + $crit = new \CriteriaCompo(new \Criteria('forum_id', '(' . implode(', ', $forums_available) . ')', 'IN')); |
|
125 | + $crit->add(new \Criteria('approved', '0')); |
|
126 | + $newposts = $postHandler->getCount($crit); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | if ($newtopics > 0) { |
130 | - $xoopsTpl->assign('wait_new_topic', $newtopics); |
|
130 | + $xoopsTpl->assign('wait_new_topic', $newtopics); |
|
131 | 131 | } |
132 | 132 | if ($deletetopics > 0) { |
133 | - $xoopsTpl->assign('delete_topic', $deletetopics); |
|
133 | + $xoopsTpl->assign('delete_topic', $deletetopics); |
|
134 | 134 | } |
135 | 135 | if ($newposts > 0) { |
136 | - $xoopsTpl->assign('wait_new_post', $newposts); |
|
136 | + $xoopsTpl->assign('wait_new_post', $newposts); |
|
137 | 137 | } |
138 | 138 | if ($deleteposts > 0) { |
139 | - $xoopsTpl->assign('delete_post', $deleteposts); |
|
139 | + $xoopsTpl->assign('delete_post', $deleteposts); |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | ///** @var Newbb\ReportHandler $reportHandler */ |
@@ -144,74 +144,74 @@ discard block |
||
144 | 144 | $reported = $reportHandler->getCount(new \Criteria('report_result', 0)); |
145 | 145 | $xoopsTpl->assign('reported_count', $reported); |
146 | 146 | if ($reported > 0) { |
147 | - $xoopsTpl->assign('report_post', sprintf(_MD_NEWBB_SEEWAITREPORT, $reported)); |
|
147 | + $xoopsTpl->assign('report_post', sprintf(_MD_NEWBB_SEEWAITREPORT, $reported)); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | if (count($forums_array) > 0) { |
151 | - foreach ($forums_array[0] as $parent => $forum) { |
|
152 | - if (isset($forums_array[$forum['forum_id']])) { |
|
153 | - $forum['subforum'] = $forums_array[$forum['forum_id']]; |
|
154 | - } |
|
155 | - $forumsByCat[$forum['forum_cid']][] = $forum; |
|
156 | - } |
|
151 | + foreach ($forums_array[0] as $parent => $forum) { |
|
152 | + if (isset($forums_array[$forum['forum_id']])) { |
|
153 | + $forum['subforum'] = $forums_array[$forum['forum_id']]; |
|
154 | + } |
|
155 | + $forumsByCat[$forum['forum_cid']][] = $forum; |
|
156 | + } |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | $category_array = []; |
160 | 160 | $toggles = newbbGetCookie('G', true); |
161 | 161 | $iconHandler = newbbGetIconHandler(); |
162 | 162 | $category_icon = [ |
163 | - 'expand' => $iconHandler->getImageSource('minus'), |
|
164 | - 'collapse' => $iconHandler->getImageSource('plus') |
|
163 | + 'expand' => $iconHandler->getImageSource('minus'), |
|
164 | + 'collapse' => $iconHandler->getImageSource('plus') |
|
165 | 165 | ]; |
166 | 166 | |
167 | 167 | foreach (array_keys($categories) as $id) { |
168 | - $forums = []; |
|
169 | - $onecat = $categories[$id]; |
|
168 | + $forums = []; |
|
169 | + $onecat = $categories[$id]; |
|
170 | 170 | |
171 | - $cat_element_id = 'cat_' . $onecat['cat_id']; |
|
172 | - $expand = (count($toggles) > 0) ? (in_array($cat_element_id, $toggles) ? false : true) : true; |
|
173 | - // START irmtfan to improve newbbDisplayImage |
|
174 | - if ($expand) { |
|
175 | - $cat_display = 'block'; //irmtfan move semicolon |
|
176 | - $cat_icon_display = 'minus'; |
|
177 | - $cat_alt = _MD_NEWBB_HIDE; |
|
178 | - } else { |
|
179 | - $cat_display = 'none'; //irmtfan move semicolon |
|
180 | - $cat_icon_display = 'plus'; |
|
181 | - $cat_alt = _MD_NEWBB_SEE; |
|
182 | - } |
|
183 | - $cat_displayImage = newbbDisplayImage($cat_icon_display, $cat_alt); |
|
171 | + $cat_element_id = 'cat_' . $onecat['cat_id']; |
|
172 | + $expand = (count($toggles) > 0) ? (in_array($cat_element_id, $toggles) ? false : true) : true; |
|
173 | + // START irmtfan to improve newbbDisplayImage |
|
174 | + if ($expand) { |
|
175 | + $cat_display = 'block'; //irmtfan move semicolon |
|
176 | + $cat_icon_display = 'minus'; |
|
177 | + $cat_alt = _MD_NEWBB_HIDE; |
|
178 | + } else { |
|
179 | + $cat_display = 'none'; //irmtfan move semicolon |
|
180 | + $cat_icon_display = 'plus'; |
|
181 | + $cat_alt = _MD_NEWBB_SEE; |
|
182 | + } |
|
183 | + $cat_displayImage = newbbDisplayImage($cat_icon_display, $cat_alt); |
|
184 | 184 | |
185 | - if (isset($forumsByCat[$onecat['cat_id']])) { |
|
186 | - $forums = $forumsByCat[$onecat['cat_id']]; |
|
187 | - } |
|
185 | + if (isset($forumsByCat[$onecat['cat_id']])) { |
|
186 | + $forums = $forumsByCat[$onecat['cat_id']]; |
|
187 | + } |
|
188 | 188 | |
189 | - $cat_sponsor = []; |
|
190 | - @list($url, $title) = array_map('trim', explode(' ', $onecat['cat_url'], 2)); |
|
191 | - if ('' === $title) { |
|
192 | - $title = $url; |
|
193 | - } |
|
194 | - $title = $myts->htmlSpecialChars($title); |
|
195 | - if ('' !== $url) { |
|
196 | - $cat_sponsor = ['title' => $title, 'link' => formatURL($url)]; |
|
197 | - } |
|
198 | - //$cat_image = $onecat['cat_image']; |
|
199 | - $cat_image = ''; |
|
200 | - $cat_image = $onecat['cat_image']; |
|
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; |
|
203 | - } |
|
204 | - $category_array[] = [ |
|
205 | - 'cat_id' => $onecat['cat_id'], |
|
206 | - 'cat_title' => $myts->displayTarea($onecat['cat_title'], 1), |
|
207 | - 'cat_image' => $cat_image, |
|
208 | - 'cat_sponsor' => $cat_sponsor, |
|
209 | - 'cat_description' => $myts->displayTarea($onecat['cat_description'], 1), |
|
210 | - 'cat_element_id' => $cat_element_id, |
|
211 | - 'cat_display' => $cat_display, |
|
212 | - 'cat_displayImage' => $cat_displayImage, |
|
213 | - 'forums' => $forums |
|
214 | - ]; |
|
189 | + $cat_sponsor = []; |
|
190 | + @list($url, $title) = array_map('trim', explode(' ', $onecat['cat_url'], 2)); |
|
191 | + if ('' === $title) { |
|
192 | + $title = $url; |
|
193 | + } |
|
194 | + $title = $myts->htmlSpecialChars($title); |
|
195 | + if ('' !== $url) { |
|
196 | + $cat_sponsor = ['title' => $title, 'link' => formatURL($url)]; |
|
197 | + } |
|
198 | + //$cat_image = $onecat['cat_image']; |
|
199 | + $cat_image = ''; |
|
200 | + $cat_image = $onecat['cat_image']; |
|
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; |
|
203 | + } |
|
204 | + $category_array[] = [ |
|
205 | + 'cat_id' => $onecat['cat_id'], |
|
206 | + 'cat_title' => $myts->displayTarea($onecat['cat_title'], 1), |
|
207 | + 'cat_image' => $cat_image, |
|
208 | + 'cat_sponsor' => $cat_sponsor, |
|
209 | + 'cat_description' => $myts->displayTarea($onecat['cat_description'], 1), |
|
210 | + 'cat_element_id' => $cat_element_id, |
|
211 | + 'cat_display' => $cat_display, |
|
212 | + 'cat_displayImage' => $cat_displayImage, |
|
213 | + 'forums' => $forums |
|
214 | + ]; |
|
215 | 215 | } |
216 | 216 | |
217 | 217 | unset($categories, $forums_array, $forumsByCat); |
@@ -220,28 +220,28 @@ discard block |
||
220 | 220 | $xoopsTpl->assign('notifyicon', $category_icon); |
221 | 221 | |
222 | 222 | $xoopsTpl->assign([ |
223 | - 'index_title' => sprintf(_MD_NEWBB_WELCOME, htmlspecialchars($GLOBALS['xoopsConfig']['sitename'], ENT_QUOTES)), |
|
224 | - 'index_desc' => _MD_NEWBB_TOSTART |
|
225 | - ]); |
|
223 | + 'index_title' => sprintf(_MD_NEWBB_WELCOME, htmlspecialchars($GLOBALS['xoopsConfig']['sitename'], ENT_QUOTES)), |
|
224 | + 'index_desc' => _MD_NEWBB_TOSTART |
|
225 | + ]); |
|
226 | 226 | |
227 | 227 | /* display user stats */ |
228 | 228 | if (!empty($GLOBALS['xoopsModuleConfig']['statistik_enabled'])) { |
229 | - $userstats = []; |
|
230 | - if (is_object($GLOBALS['xoopsUser'])) { |
|
231 | - // /** @var Newbb\UserstatsHandler $userstatsHandler */ |
|
232 | - // $userstatsHandler = Newbb\Helper::getInstance()->getHandler('Userstats'); |
|
233 | - $userstats_row = $userstatsHandler->getStats($GLOBALS['xoopsUser']->getVar('uid')); |
|
234 | - $userstats['topics'] = sprintf(_MD_NEWBB_USER_TOPICS, (int)(@$userstats_row['user_topics'])); |
|
235 | - $userstats['posts'] = sprintf(_MD_NEWBB_USER_POSTS, (int)(@$userstats_row['user_posts'])); |
|
236 | - $userstats['digests'] = sprintf(_MD_NEWBB_USER_DIGESTS, (int)(@$userstats_row['user_digests'])); |
|
237 | - $userstats['currenttime'] = sprintf(_MD_NEWBB_TIMENOW, formatTimestamp(time(), 's')); // irmtfan should be removed because it is for anon users too |
|
238 | - $userstats['lastvisit'] = sprintf(_MD_NEWBB_USER_LASTVISIT, formatTimestamp($last_visit, 's')); // irmtfan should be removed because it is for anon users too |
|
239 | - $userstats['lastpost'] = empty($userstats_row['user_lastpost']) ? _MD_NEWBB_USER_NOLASTPOST : sprintf(_MD_NEWBB_USER_LASTPOST, formatTimestamp($userstats_row['user_lastpost'], 's')); |
|
240 | - } |
|
241 | - $xoopsTpl->assign_by_ref('userstats', $userstats); |
|
242 | - // irmtfan add lastvisit smarty variable for all users |
|
243 | - $xoopsTpl->assign('lastvisit', sprintf(_MD_NEWBB_USER_LASTVISIT, formatTimestamp($last_visit, 'l'))); |
|
244 | - $xoopsTpl->assign('currenttime', sprintf(_MD_NEWBB_TIMENOW, formatTimestamp(time(), 'm'))); |
|
229 | + $userstats = []; |
|
230 | + if (is_object($GLOBALS['xoopsUser'])) { |
|
231 | + // /** @var Newbb\UserstatsHandler $userstatsHandler */ |
|
232 | + // $userstatsHandler = Newbb\Helper::getInstance()->getHandler('Userstats'); |
|
233 | + $userstats_row = $userstatsHandler->getStats($GLOBALS['xoopsUser']->getVar('uid')); |
|
234 | + $userstats['topics'] = sprintf(_MD_NEWBB_USER_TOPICS, (int)(@$userstats_row['user_topics'])); |
|
235 | + $userstats['posts'] = sprintf(_MD_NEWBB_USER_POSTS, (int)(@$userstats_row['user_posts'])); |
|
236 | + $userstats['digests'] = sprintf(_MD_NEWBB_USER_DIGESTS, (int)(@$userstats_row['user_digests'])); |
|
237 | + $userstats['currenttime'] = sprintf(_MD_NEWBB_TIMENOW, formatTimestamp(time(), 's')); // irmtfan should be removed because it is for anon users too |
|
238 | + $userstats['lastvisit'] = sprintf(_MD_NEWBB_USER_LASTVISIT, formatTimestamp($last_visit, 's')); // irmtfan should be removed because it is for anon users too |
|
239 | + $userstats['lastpost'] = empty($userstats_row['user_lastpost']) ? _MD_NEWBB_USER_NOLASTPOST : sprintf(_MD_NEWBB_USER_LASTPOST, formatTimestamp($userstats_row['user_lastpost'], 's')); |
|
240 | + } |
|
241 | + $xoopsTpl->assign_by_ref('userstats', $userstats); |
|
242 | + // irmtfan add lastvisit smarty variable for all users |
|
243 | + $xoopsTpl->assign('lastvisit', sprintf(_MD_NEWBB_USER_LASTVISIT, formatTimestamp($last_visit, 'l'))); |
|
244 | + $xoopsTpl->assign('currenttime', sprintf(_MD_NEWBB_TIMENOW, formatTimestamp(time(), 'm'))); |
|
245 | 245 | } |
246 | 246 | |
247 | 247 | /* display forum stats */ |
@@ -272,18 +272,18 @@ discard block |
||
272 | 272 | |
273 | 273 | /* To be removed */ |
274 | 274 | if ($isAdmin) { |
275 | - $xoopsTpl->assign('forum_index_cpanel', ['link' => 'admin/index.php', 'name' => _MD_NEWBB_ADMINCP]); |
|
275 | + $xoopsTpl->assign('forum_index_cpanel', ['link' => 'admin/index.php', 'name' => _MD_NEWBB_ADMINCP]); |
|
276 | 276 | } |
277 | 277 | |
278 | 278 | if (1 == $GLOBALS['xoopsModuleConfig']['rss_enable']) { |
279 | - $xoopsTpl->assign('rss_enable', 1); |
|
280 | - $xoopsTpl->assign('rss_button', newbbDisplayImage('rss', 'RSS feed')); |
|
279 | + $xoopsTpl->assign('rss_enable', 1); |
|
280 | + $xoopsTpl->assign('rss_button', newbbDisplayImage('rss', 'RSS feed')); |
|
281 | 281 | } |
282 | 282 | $xoopsTpl->assign([ |
283 | - 'img_forum_new' => newbbDisplayImage('forum_new', _MD_NEWBB_NEWPOSTS), |
|
284 | - 'img_forum' => newbbDisplayImage('forum', _MD_NEWBB_NONEWPOSTS), |
|
285 | - 'img_subforum' => newbbDisplayImage('subforum') |
|
286 | - ]); |
|
283 | + 'img_forum_new' => newbbDisplayImage('forum_new', _MD_NEWBB_NEWPOSTS), |
|
284 | + 'img_forum' => newbbDisplayImage('forum', _MD_NEWBB_NONEWPOSTS), |
|
285 | + 'img_subforum' => newbbDisplayImage('subforum') |
|
286 | + ]); |
|
287 | 287 | |
288 | 288 | // irmtfan move to footer.php |
289 | 289 | require_once __DIR__ . '/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 | /* 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 | require_once $GLOBALS['xoops']->path('footer.php'); |