@@ -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,9 +2,9 @@ |
||
2 | 2 | // |
3 | 3 | // Blocks |
4 | 4 | if (defined('NEWBB_BLOCKS_DEFINED')) { |
5 | - return; |
|
5 | + return; |
|
6 | 6 | } else { |
7 | - define('NEWBB_BLOCKS_DEFINED', true); |
|
7 | + define('NEWBB_BLOCKS_DEFINED', true); |
|
8 | 8 | } |
9 | 9 | define('_MB_NEWBB_FORUM', 'Forum'); |
10 | 10 | define('_MB_NEWBB_TOPIC', 'Topic'); |
@@ -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'], |
@@ -231,9 +231,9 @@ discard block |
||
231 | 231 | // /** @var Newbb\UserstatsHandler $userstatsHandler */ |
232 | 232 | // $userstatsHandler = Newbb\Helper::getInstance()->getHandler('Userstats'); |
233 | 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'])); |
|
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 | 237 | $userstats['currenttime'] = sprintf(_MD_NEWBB_TIMENOW, formatTimestamp(time(), 's')); // irmtfan should be removed because it is for anon users too |
238 | 238 | $userstats['lastvisit'] = sprintf(_MD_NEWBB_USER_LASTVISIT, formatTimestamp($last_visit, 's')); // irmtfan should be removed because it is for anon users too |
239 | 239 | $userstats['lastpost'] = empty($userstats_row['user_lastpost']) ? _MD_NEWBB_USER_NOLASTPOST : sprintf(_MD_NEWBB_USER_LASTPOST, formatTimestamp($userstats_row['user_lastpost'], 's')); |
@@ -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'); |
@@ -22,22 +22,22 @@ discard block |
||
22 | 22 | require_once __DIR__ . '/header.php'; |
23 | 23 | |
24 | 24 | foreach ([ |
25 | - 'forum', |
|
26 | - 'topic_id', |
|
27 | - 'post_id', |
|
28 | - 'order', |
|
29 | - 'pid', |
|
30 | - 'start', |
|
31 | - 'isreply', |
|
32 | - 'isedit' |
|
33 | - ] as $getint) { |
|
34 | - ${$getint} = Request::getInt($getint, 0, 'POST'); |
|
25 | + 'forum', |
|
26 | + 'topic_id', |
|
27 | + 'post_id', |
|
28 | + 'order', |
|
29 | + 'pid', |
|
30 | + 'start', |
|
31 | + 'isreply', |
|
32 | + 'isedit' |
|
33 | + ] as $getint) { |
|
34 | + ${$getint} = Request::getInt($getint, 0, 'POST'); |
|
35 | 35 | } |
36 | 36 | $token_valid = false; |
37 | 37 | $op = Request::getCmd('op', '', 'POST'); |
38 | 38 | $viewmode = ('flat' !== Request::getString('viewmode', '', 'POST')) ? 'thread' : 'flat'; |
39 | 39 | if (empty($forum)) { |
40 | - redirect_header('index.php', 2, _MD_NEWBB_ERRORFORUM); |
|
40 | + redirect_header('index.php', 2, _MD_NEWBB_ERRORFORUM); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | ///** @var Newbb\ForumHandler $forumHandler */ |
@@ -48,356 +48,356 @@ discard block |
||
48 | 48 | //$postHandler = Newbb\Helper::getInstance()->getHandler('Post'); |
49 | 49 | |
50 | 50 | if (!empty($isedit) && $post_id > 0) { |
51 | - /** @var Post $postObject */ |
|
52 | - $postObject = $postHandler->get($post_id); |
|
53 | - $topic_id = $postObject->getVar('topic_id'); |
|
51 | + /** @var Post $postObject */ |
|
52 | + $postObject = $postHandler->get($post_id); |
|
53 | + $topic_id = $postObject->getVar('topic_id'); |
|
54 | 54 | } else { |
55 | - $postObject = $postHandler->create(); |
|
55 | + $postObject = $postHandler->create(); |
|
56 | 56 | } |
57 | 57 | $topicObject = $topicHandler->get($topic_id); |
58 | 58 | $forum_id = $topic_id ? $topicObject->getVar('forum_id') : $forum; |
59 | 59 | $forumObject = $forumHandler->get($forum_id); |
60 | 60 | if (!$forumHandler->getPermission($forumObject)) { |
61 | - redirect_header('index.php', 2, _NOPERM); |
|
61 | + redirect_header('index.php', 2, _NOPERM); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | if ($GLOBALS['xoopsModuleConfig']['wol_enabled']) { |
65 | - // /** @var Newbb\OnlineHandler $onlineHandler */ |
|
66 | - // $onlineHandler = Newbb\Helper::getInstance()->getHandler('Online'); |
|
67 | - $onlineHandler->init($forumObject); |
|
65 | + // /** @var Newbb\OnlineHandler $onlineHandler */ |
|
66 | + // $onlineHandler = Newbb\Helper::getInstance()->getHandler('Online'); |
|
67 | + $onlineHandler->init($forumObject); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | $error_message = []; |
71 | 71 | |
72 | 72 | if (Request::getString('contents_submit', '', 'POST')) { |
73 | - $token_valid = $GLOBALS['xoopsSecurity']->check(); |
|
74 | - |
|
75 | - $captcha_invalid = false; |
|
76 | - if (!is_object($GLOBALS['xoopsUser']) && Request::hasVar('uname', 'POST') && Request::hasVar('pass', 'POST')) { |
|
77 | - $uname = Request::getString('uname', '', 'POST'); |
|
78 | - $pass = Request::getString('pass', '', 'POST'); |
|
79 | - /** @var \XoopsMemberHandler $memberHandler */ |
|
80 | - $memberHandler = xoops_getHandler('member'); |
|
81 | - $user = $memberHandler->loginUser($uname, $pass); |
|
82 | - if (is_object($user) && 0 < $user->getVar('level')) { |
|
83 | - if (Request::getString('login', '', 'POST')) { |
|
84 | - $user->setVar('last_login', time()); |
|
85 | - if (!$memberHandler->insertUser($user)) { |
|
86 | - } |
|
87 | - $_SESSION = []; |
|
88 | - $_SESSION['xoopsUserId'] = $user->getVar('uid'); |
|
89 | - $_SESSION['xoopsUserGroups'] = $user->getGroups(); |
|
90 | - if ($GLOBALS['xoopsConfig']['use_mysession'] && '' !== $GLOBALS['xoopsConfig']['session_name']) { |
|
91 | - setcookie($GLOBALS['xoopsConfig']['session_name'], session_id(), time() + (60 * $GLOBALS['xoopsConfig']['session_expire']), '/', '', 0); |
|
92 | - } |
|
93 | - $user_theme = $user->getVar('theme'); |
|
94 | - if (in_array($user_theme, $GLOBALS['xoopsConfig']['theme_set_allowed'])) { |
|
95 | - $_SESSION['xoopsUserTheme'] = $user_theme; |
|
96 | - } |
|
97 | - } |
|
98 | - $GLOBALS['xoopsUser'] = $user; |
|
99 | - $xoopsUserIsAdmin = $GLOBALS['xoopsUser']->isAdmin($xoopsModule->getVar('mid')); |
|
100 | - } |
|
101 | - } |
|
102 | - if (!is_object($GLOBALS['xoopsUser'])) { |
|
103 | - xoops_load('captcha'); |
|
104 | - $xoopsCaptcha = \XoopsCaptcha::getInstance(); |
|
105 | - if (!$xoopsCaptcha->verify()) { |
|
106 | - $captcha_invalid = true; |
|
107 | - $error_message[] = $xoopsCaptcha->getMessage(); |
|
108 | - } |
|
109 | - } |
|
110 | - |
|
111 | - $isAdmin = newbbIsAdmin($forumObject); |
|
112 | - |
|
113 | - $time_valid = true; |
|
114 | - if (!$isAdmin && !empty($GLOBALS['xoopsModuleConfig']['post_timelimit'])) { |
|
115 | - $last_post = newbbGetSession('LP'); |
|
116 | - if (time() - $last_post < $GLOBALS['xoopsModuleConfig']['post_timelimit']) { |
|
117 | - $time_valid = false; |
|
118 | - } |
|
119 | - } |
|
120 | - |
|
121 | - if ($captcha_invalid || !$token_valid || !$time_valid) { |
|
122 | - $_POST['contents_preview'] = 1; |
|
123 | - $_POST['contents_submit'] = null; |
|
124 | - $_POST['contents_upload'] = null; |
|
125 | - if (!$token_valid) { |
|
126 | - $error_message[] = _MD_NEWBB_INVALID_SUBMIT; |
|
127 | - } |
|
128 | - if (!$time_valid) { |
|
129 | - $error_message[] = sprintf(_MD_NEWBB_POSTING_LIMITED, $GLOBALS['xoopsModuleConfig']['post_timelimit']); |
|
130 | - } |
|
131 | - } |
|
73 | + $token_valid = $GLOBALS['xoopsSecurity']->check(); |
|
74 | + |
|
75 | + $captcha_invalid = false; |
|
76 | + if (!is_object($GLOBALS['xoopsUser']) && Request::hasVar('uname', 'POST') && Request::hasVar('pass', 'POST')) { |
|
77 | + $uname = Request::getString('uname', '', 'POST'); |
|
78 | + $pass = Request::getString('pass', '', 'POST'); |
|
79 | + /** @var \XoopsMemberHandler $memberHandler */ |
|
80 | + $memberHandler = xoops_getHandler('member'); |
|
81 | + $user = $memberHandler->loginUser($uname, $pass); |
|
82 | + if (is_object($user) && 0 < $user->getVar('level')) { |
|
83 | + if (Request::getString('login', '', 'POST')) { |
|
84 | + $user->setVar('last_login', time()); |
|
85 | + if (!$memberHandler->insertUser($user)) { |
|
86 | + } |
|
87 | + $_SESSION = []; |
|
88 | + $_SESSION['xoopsUserId'] = $user->getVar('uid'); |
|
89 | + $_SESSION['xoopsUserGroups'] = $user->getGroups(); |
|
90 | + if ($GLOBALS['xoopsConfig']['use_mysession'] && '' !== $GLOBALS['xoopsConfig']['session_name']) { |
|
91 | + setcookie($GLOBALS['xoopsConfig']['session_name'], session_id(), time() + (60 * $GLOBALS['xoopsConfig']['session_expire']), '/', '', 0); |
|
92 | + } |
|
93 | + $user_theme = $user->getVar('theme'); |
|
94 | + if (in_array($user_theme, $GLOBALS['xoopsConfig']['theme_set_allowed'])) { |
|
95 | + $_SESSION['xoopsUserTheme'] = $user_theme; |
|
96 | + } |
|
97 | + } |
|
98 | + $GLOBALS['xoopsUser'] = $user; |
|
99 | + $xoopsUserIsAdmin = $GLOBALS['xoopsUser']->isAdmin($xoopsModule->getVar('mid')); |
|
100 | + } |
|
101 | + } |
|
102 | + if (!is_object($GLOBALS['xoopsUser'])) { |
|
103 | + xoops_load('captcha'); |
|
104 | + $xoopsCaptcha = \XoopsCaptcha::getInstance(); |
|
105 | + if (!$xoopsCaptcha->verify()) { |
|
106 | + $captcha_invalid = true; |
|
107 | + $error_message[] = $xoopsCaptcha->getMessage(); |
|
108 | + } |
|
109 | + } |
|
110 | + |
|
111 | + $isAdmin = newbbIsAdmin($forumObject); |
|
112 | + |
|
113 | + $time_valid = true; |
|
114 | + if (!$isAdmin && !empty($GLOBALS['xoopsModuleConfig']['post_timelimit'])) { |
|
115 | + $last_post = newbbGetSession('LP'); |
|
116 | + if (time() - $last_post < $GLOBALS['xoopsModuleConfig']['post_timelimit']) { |
|
117 | + $time_valid = false; |
|
118 | + } |
|
119 | + } |
|
120 | + |
|
121 | + if ($captcha_invalid || !$token_valid || !$time_valid) { |
|
122 | + $_POST['contents_preview'] = 1; |
|
123 | + $_POST['contents_submit'] = null; |
|
124 | + $_POST['contents_upload'] = null; |
|
125 | + if (!$token_valid) { |
|
126 | + $error_message[] = _MD_NEWBB_INVALID_SUBMIT; |
|
127 | + } |
|
128 | + if (!$time_valid) { |
|
129 | + $error_message[] = sprintf(_MD_NEWBB_POSTING_LIMITED, $GLOBALS['xoopsModuleConfig']['post_timelimit']); |
|
130 | + } |
|
131 | + } |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | if (Request::getString('contents_submit', '', 'POST')) { |
135 | - $message = Request::getText('message', '', 'POST'); |
|
136 | - if (empty($message)) { |
|
137 | - // irmtfan - issue with javascript:history.go(-1) - add error message |
|
138 | - redirect_header(Request::getString('HTTP_REFERER', '', 'SERVER'), 1, _MD_NEWBB_ERROR_BACK); |
|
139 | - } |
|
140 | - if (!empty($isedit) && $post_id > 0) { |
|
141 | - $uid = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('uid') : 0; |
|
142 | - |
|
143 | - $topic_status = $topicObject->getVar('topic_status'); |
|
144 | - if ($topicHandler->getPermission($forumObject, $topic_status, 'edit') |
|
145 | - && ($isAdmin |
|
146 | - || ($postObject->checkTimelimit('edit_timelimit') |
|
147 | - && $postObject->checkIdentity()))) { |
|
148 | - } else { |
|
149 | - redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?forum={$forum_id}&topic_id={$topic_id}&post_id={$post_id}&order={$order}&viewmode={$viewmode}", 2, _MD_NEWBB_NORIGHTTOEDIT); |
|
150 | - } |
|
151 | - |
|
152 | - $delete_attach = Request::getArray('delete_attach', [], 'POST'); |
|
153 | - if (is_array($delete_attach) && count($delete_attach) > 0) { |
|
154 | - $postObject->deleteAttachment($delete_attach); |
|
155 | - } |
|
156 | - } else { |
|
157 | - if ($topic_id) { |
|
158 | - $topic_status = $topicObject->getVar('topic_status'); |
|
159 | - if (!$topicHandler->getPermission($forumObject, $topic_status, 'reply')) { |
|
160 | - redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?forum={$forum_id}&topic_id={$topic_id}&post_id={$post_id}&order={$order}&viewmode={$viewmode}", 2, _MD_NEWBB_NORIGHTTOREPLY); |
|
161 | - } |
|
162 | - } else { |
|
163 | - $topic_status = 0; |
|
164 | - if (!$topicHandler->getPermission($forumObject, $topic_status, 'post')) { |
|
165 | - redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?forum={$forum_id}", 2, _MD_NEWBB_NORIGHTTOPOST); |
|
166 | - } |
|
167 | - } |
|
168 | - |
|
169 | - $isreply = 0; |
|
170 | - $isnew = 1; |
|
171 | - if (!is_object($GLOBALS['xoopsUser']) |
|
172 | - || (Request::getString('noname', '', 'POST') |
|
173 | - && !empty($GLOBALS['xoopsModuleConfig']['allow_user_anonymous']))) { |
|
174 | - $uid = 0; |
|
175 | - } else { |
|
176 | - $uid = $GLOBALS['xoopsUser']->getVar('uid'); |
|
177 | - } |
|
178 | - if (!empty($pid)) { |
|
179 | - $postObject->setVar('pid', $pid); |
|
180 | - } |
|
181 | - if (!empty($topic_id)) { |
|
182 | - $postObject->setVar('topic_id', $topic_id); |
|
183 | - $isreply = 1; |
|
184 | - } |
|
185 | - $postObject->setVar('poster_ip', Xmf\IPAddress::fromRequest()->asReadable()); |
|
186 | - $postObject->setVar('uid', $uid); |
|
187 | - $postObject->setVar('post_time', time()); |
|
188 | - } |
|
189 | - |
|
190 | - $approved = $topicHandler->getPermission($forumObject, $topic_status, 'noapprove'); |
|
191 | - $postObject->setVar('approved', $approved); |
|
192 | - |
|
193 | - $postObject->setVar('forum_id', $forumObject->getVar('forum_id')); |
|
194 | - |
|
195 | - $subject = xoops_trim(Request::getString('subject', '', 'POST')); |
|
196 | - $subject = ('' === $subject) ? _NOTITLE : $subject; |
|
197 | - $poster_name = xoops_trim(Request::getString('poster_name', '', 'POST')); |
|
198 | - $dohtml = Request::getInt('dohtml', 0, 'POST') |
|
199 | - && $topicHandler->getPermission($forumObject, $topic_status, 'html'); |
|
200 | - $dosmiley = Request::getInt('dosmiley', 0, 'POST'); |
|
201 | - $doxcode = Request::getInt('doxcode', 0, 'POST') ? 1 : 0; |
|
202 | - $dobr = Request::getInt('dobr', 0, 'POST') ? 1 : 0; |
|
203 | - $icon = (Request::getString('icon', '', 'POST') |
|
204 | - && is_file($GLOBALS['xoops']->path('images/subject/' . Request::getString('icon', '', 'POST'))) ? Request::getString('icon', '', 'POST') : ''); |
|
205 | - $attachsig = Request::getBool('attachsig', false, 'POST') |
|
206 | - && $topicHandler->getPermission($forumObject, $topic_status, 'signature'); |
|
207 | - $view_require = Request::getString('view_require', '', 'POST'); |
|
208 | - $post_karma = ('require_karma' === $view_require) ? Request::getInt('post_karma', 0, 'POST') : 0; |
|
209 | - $require_reply = ('require_reply' === $view_require); |
|
210 | - $postObject->setVar('subject', $subject); |
|
211 | - $editwhy = xoops_trim(Request::getString('editwhy', '', 'POST')); // !empty($_POST['editwhy'])) ? xoops_trim($_POST['editwhy']) : ""; |
|
212 | - |
|
213 | - if ($dohtml && !newbbIsAdmin($forumObject)) { |
|
214 | - //$message=newbb_textFilter($message); |
|
215 | - } |
|
216 | - $postObject->setVar('post_text', $message); |
|
217 | - $postObject->setVar('post_karma', $post_karma); |
|
218 | - $postObject->setVar('require_reply', $require_reply); |
|
219 | - $postObject->setVar('poster_name', $poster_name); |
|
220 | - $postObject->setVar('dohtml', $dohtml); |
|
221 | - $postObject->setVar('dosmiley', $dosmiley); |
|
222 | - $postObject->setVar('doxcode', $doxcode); |
|
223 | - $postObject->setVar('dobr', $dobr); |
|
224 | - $postObject->setVar('icon', $icon); |
|
225 | - $postObject->setVar('attachsig', $attachsig); |
|
226 | - $postObject->setAttachment(); |
|
227 | - if (!empty($post_id)) { |
|
228 | - $postObject->setPostEdit($poster_name, $editwhy); |
|
229 | - } // is reply |
|
230 | - |
|
231 | - // $attachments_tmp = array(); |
|
232 | - // if (!empty($_POST["attachments_tmp"])) { |
|
233 | - if (Request::getString('attachments_tmp', '', 'POST')) { |
|
234 | - $attachments_tmp = unserialize(base64_decode(Request::getString('attachments_tmp', '', 'POST'))); |
|
235 | - if (Request::getArray('delete_tmp', null, 'POST') && count(Request::getArray('delete_tmp', null, 'POST')) > 1) { |
|
236 | - foreach (Request::getArray('delete_tmp', null, 'POST') as $key) { |
|
237 | - unlink($GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'] . '/' . $attachments_tmp[$key][0])); |
|
238 | - unset($attachments_tmp[$key]); |
|
239 | - } |
|
240 | - } |
|
241 | - } |
|
242 | - if (isset($attachments_tmp) && count($attachments_tmp)) { |
|
243 | - foreach ($attachments_tmp as $key => $attach) { |
|
244 | - if (rename(XOOPS_CACHE_PATH . '/' . $attachments_tmp[$key][0], $GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'] . '/' . $attachments_tmp[$key][0]))) { |
|
245 | - $postObject->setAttachment($attach[0], $attach[1], $attach[2]); |
|
246 | - } |
|
247 | - } |
|
248 | - } |
|
249 | - $error_upload = ''; |
|
250 | - |
|
251 | - if (isset($_FILES['userfile']['name']) && '' !== $_FILES['userfile']['name'] |
|
252 | - && $topicHandler->getPermission($forumObject, $topic_status, 'attach')) { |
|
135 | + $message = Request::getText('message', '', 'POST'); |
|
136 | + if (empty($message)) { |
|
137 | + // irmtfan - issue with javascript:history.go(-1) - add error message |
|
138 | + redirect_header(Request::getString('HTTP_REFERER', '', 'SERVER'), 1, _MD_NEWBB_ERROR_BACK); |
|
139 | + } |
|
140 | + if (!empty($isedit) && $post_id > 0) { |
|
141 | + $uid = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('uid') : 0; |
|
142 | + |
|
143 | + $topic_status = $topicObject->getVar('topic_status'); |
|
144 | + if ($topicHandler->getPermission($forumObject, $topic_status, 'edit') |
|
145 | + && ($isAdmin |
|
146 | + || ($postObject->checkTimelimit('edit_timelimit') |
|
147 | + && $postObject->checkIdentity()))) { |
|
148 | + } else { |
|
149 | + redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?forum={$forum_id}&topic_id={$topic_id}&post_id={$post_id}&order={$order}&viewmode={$viewmode}", 2, _MD_NEWBB_NORIGHTTOEDIT); |
|
150 | + } |
|
151 | + |
|
152 | + $delete_attach = Request::getArray('delete_attach', [], 'POST'); |
|
153 | + if (is_array($delete_attach) && count($delete_attach) > 0) { |
|
154 | + $postObject->deleteAttachment($delete_attach); |
|
155 | + } |
|
156 | + } else { |
|
157 | + if ($topic_id) { |
|
158 | + $topic_status = $topicObject->getVar('topic_status'); |
|
159 | + if (!$topicHandler->getPermission($forumObject, $topic_status, 'reply')) { |
|
160 | + redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?forum={$forum_id}&topic_id={$topic_id}&post_id={$post_id}&order={$order}&viewmode={$viewmode}", 2, _MD_NEWBB_NORIGHTTOREPLY); |
|
161 | + } |
|
162 | + } else { |
|
163 | + $topic_status = 0; |
|
164 | + if (!$topicHandler->getPermission($forumObject, $topic_status, 'post')) { |
|
165 | + redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?forum={$forum_id}", 2, _MD_NEWBB_NORIGHTTOPOST); |
|
166 | + } |
|
167 | + } |
|
168 | + |
|
169 | + $isreply = 0; |
|
170 | + $isnew = 1; |
|
171 | + if (!is_object($GLOBALS['xoopsUser']) |
|
172 | + || (Request::getString('noname', '', 'POST') |
|
173 | + && !empty($GLOBALS['xoopsModuleConfig']['allow_user_anonymous']))) { |
|
174 | + $uid = 0; |
|
175 | + } else { |
|
176 | + $uid = $GLOBALS['xoopsUser']->getVar('uid'); |
|
177 | + } |
|
178 | + if (!empty($pid)) { |
|
179 | + $postObject->setVar('pid', $pid); |
|
180 | + } |
|
181 | + if (!empty($topic_id)) { |
|
182 | + $postObject->setVar('topic_id', $topic_id); |
|
183 | + $isreply = 1; |
|
184 | + } |
|
185 | + $postObject->setVar('poster_ip', Xmf\IPAddress::fromRequest()->asReadable()); |
|
186 | + $postObject->setVar('uid', $uid); |
|
187 | + $postObject->setVar('post_time', time()); |
|
188 | + } |
|
189 | + |
|
190 | + $approved = $topicHandler->getPermission($forumObject, $topic_status, 'noapprove'); |
|
191 | + $postObject->setVar('approved', $approved); |
|
192 | + |
|
193 | + $postObject->setVar('forum_id', $forumObject->getVar('forum_id')); |
|
194 | + |
|
195 | + $subject = xoops_trim(Request::getString('subject', '', 'POST')); |
|
196 | + $subject = ('' === $subject) ? _NOTITLE : $subject; |
|
197 | + $poster_name = xoops_trim(Request::getString('poster_name', '', 'POST')); |
|
198 | + $dohtml = Request::getInt('dohtml', 0, 'POST') |
|
199 | + && $topicHandler->getPermission($forumObject, $topic_status, 'html'); |
|
200 | + $dosmiley = Request::getInt('dosmiley', 0, 'POST'); |
|
201 | + $doxcode = Request::getInt('doxcode', 0, 'POST') ? 1 : 0; |
|
202 | + $dobr = Request::getInt('dobr', 0, 'POST') ? 1 : 0; |
|
203 | + $icon = (Request::getString('icon', '', 'POST') |
|
204 | + && is_file($GLOBALS['xoops']->path('images/subject/' . Request::getString('icon', '', 'POST'))) ? Request::getString('icon', '', 'POST') : ''); |
|
205 | + $attachsig = Request::getBool('attachsig', false, 'POST') |
|
206 | + && $topicHandler->getPermission($forumObject, $topic_status, 'signature'); |
|
207 | + $view_require = Request::getString('view_require', '', 'POST'); |
|
208 | + $post_karma = ('require_karma' === $view_require) ? Request::getInt('post_karma', 0, 'POST') : 0; |
|
209 | + $require_reply = ('require_reply' === $view_require); |
|
210 | + $postObject->setVar('subject', $subject); |
|
211 | + $editwhy = xoops_trim(Request::getString('editwhy', '', 'POST')); // !empty($_POST['editwhy'])) ? xoops_trim($_POST['editwhy']) : ""; |
|
212 | + |
|
213 | + if ($dohtml && !newbbIsAdmin($forumObject)) { |
|
214 | + //$message=newbb_textFilter($message); |
|
215 | + } |
|
216 | + $postObject->setVar('post_text', $message); |
|
217 | + $postObject->setVar('post_karma', $post_karma); |
|
218 | + $postObject->setVar('require_reply', $require_reply); |
|
219 | + $postObject->setVar('poster_name', $poster_name); |
|
220 | + $postObject->setVar('dohtml', $dohtml); |
|
221 | + $postObject->setVar('dosmiley', $dosmiley); |
|
222 | + $postObject->setVar('doxcode', $doxcode); |
|
223 | + $postObject->setVar('dobr', $dobr); |
|
224 | + $postObject->setVar('icon', $icon); |
|
225 | + $postObject->setVar('attachsig', $attachsig); |
|
226 | + $postObject->setAttachment(); |
|
227 | + if (!empty($post_id)) { |
|
228 | + $postObject->setPostEdit($poster_name, $editwhy); |
|
229 | + } // is reply |
|
230 | + |
|
231 | + // $attachments_tmp = array(); |
|
232 | + // if (!empty($_POST["attachments_tmp"])) { |
|
233 | + if (Request::getString('attachments_tmp', '', 'POST')) { |
|
234 | + $attachments_tmp = unserialize(base64_decode(Request::getString('attachments_tmp', '', 'POST'))); |
|
235 | + if (Request::getArray('delete_tmp', null, 'POST') && count(Request::getArray('delete_tmp', null, 'POST')) > 1) { |
|
236 | + foreach (Request::getArray('delete_tmp', null, 'POST') as $key) { |
|
237 | + unlink($GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'] . '/' . $attachments_tmp[$key][0])); |
|
238 | + unset($attachments_tmp[$key]); |
|
239 | + } |
|
240 | + } |
|
241 | + } |
|
242 | + if (isset($attachments_tmp) && count($attachments_tmp)) { |
|
243 | + foreach ($attachments_tmp as $key => $attach) { |
|
244 | + if (rename(XOOPS_CACHE_PATH . '/' . $attachments_tmp[$key][0], $GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'] . '/' . $attachments_tmp[$key][0]))) { |
|
245 | + $postObject->setAttachment($attach[0], $attach[1], $attach[2]); |
|
246 | + } |
|
247 | + } |
|
248 | + } |
|
249 | + $error_upload = ''; |
|
250 | + |
|
251 | + if (isset($_FILES['userfile']['name']) && '' !== $_FILES['userfile']['name'] |
|
252 | + && $topicHandler->getPermission($forumObject, $topic_status, 'attach')) { |
|
253 | 253 | // require_once $GLOBALS['xoops']->path('modules/' . $xoopsModule->getVar('dirname', 'n') . '/class/uploader.php'); |
254 | - $maxfilesize = $forumObject->getVar('attach_maxkb') * 1024; |
|
255 | - $uploaddir = XOOPS_CACHE_PATH; |
|
256 | - |
|
257 | - $uploader = new Newbb\Uploader($uploaddir, $forumObject->getVar('attach_ext'), (int)$maxfilesize, (int)$GLOBALS['xoopsModuleConfig']['max_img_width'], (int)$GLOBALS['xoopsModuleConfig']['max_img_height']); |
|
258 | - |
|
259 | - if ($_FILES['userfile']['error'] > 0) { |
|
260 | - switch ($_FILES['userfile']['error']) { |
|
261 | - case 1: |
|
262 | - $error_message[] = _MD_NEWBB_MAXUPLOADFILEINI; |
|
263 | - break; |
|
264 | - case 2: |
|
265 | - $error_message[] = sprintf(_MD_NEWBB_MAXKB, $forumObject->getVar('attach_maxkb')); |
|
266 | - break; |
|
267 | - default: |
|
268 | - $error_message[] = _MD_NEWBB_UPLOAD_ERRNODEF; |
|
269 | - break; |
|
270 | - } |
|
271 | - } else { |
|
272 | - $uploader->setCheckMediaTypeByExt(); |
|
273 | - $temp = Request::getArray('xoops_upload_file', [], 'POST'); |
|
274 | - if ($uploader->fetchMedia($temp[0])) { |
|
275 | - $prefix = is_object($GLOBALS['xoopsUser']) ? (string)$GLOBALS['xoopsUser']->uid() . '_' : 'newbb_'; |
|
276 | - $uploader->setPrefix($prefix); |
|
277 | - if (!$uploader->upload()) { |
|
278 | - $error_message[] = $error_upload = $uploader->getErrors(); |
|
279 | - } else { |
|
280 | - if (is_file($uploader->getSavedDestination())) { |
|
281 | - if (rename(XOOPS_CACHE_PATH . '/' . $uploader->getSavedFileName(), $GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'] . '/' . $uploader->getSavedFileName()))) { |
|
282 | - $postObject->setAttachment($uploader->getSavedFileName(), $uploader->getMediaName(), $uploader->getMediaType()); |
|
283 | - } |
|
284 | - } |
|
285 | - } |
|
286 | - } else { |
|
287 | - $error_message[] = $error_upload = $uploader->getErrors(); |
|
288 | - } |
|
289 | - } |
|
290 | - } |
|
291 | - |
|
292 | - $postid = $postHandler->insert($postObject); |
|
293 | - |
|
294 | - if (!$postid) { |
|
295 | - require_once $GLOBALS['xoops']->path('header.php'); |
|
296 | - xoops_error($postObject->getErrors()); |
|
297 | - require_once $GLOBALS['xoops']->path('footer.php'); |
|
298 | - } |
|
299 | - newbbSetSession('LP', time()); // Recording last post time |
|
300 | - $topicObject = $topicHandler->get($postObject->getVar('topic_id')); |
|
301 | - $uid = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('uid') : 0; |
|
302 | - if (newbbIsAdmin($forumObject) |
|
303 | - || ($topicHandler->getPermission($forumObject, $topic_status, 'type') |
|
304 | - && (0 == $topic_id |
|
305 | - || $uid == $topicObject->getVar('topic_poster')))) { |
|
306 | - $topicObject->setVar('type_id', Request::getInt('type_id', 0, 'POST')); |
|
307 | - } |
|
308 | - |
|
309 | - if (!empty($GLOBALS['xoopsModuleConfig']['do_tag']) && $postObject->isTopic()) { |
|
310 | - $topicObject->setVar('topic_tags', Request::getInt('topic_tags', 0, 'POST')); |
|
311 | - } |
|
312 | - $topicHandler->insert($topicObject); |
|
313 | - |
|
314 | - // Set read mark |
|
315 | - if (!empty($isnew)) { |
|
316 | - require_once $GLOBALS['xoops']->path('modules/newbb/include/functions.read.php'); |
|
317 | - newbbSetRead('topic', $topicObject->getVar('topic_id'), $postid); |
|
318 | - if (!$postObject->getVar('pid')) { |
|
319 | - newbbSetRead('forum', $forumObject->getVar('forum_id'), $postid); |
|
320 | - } |
|
321 | - } |
|
322 | - |
|
323 | - //$postObject->loadFilters(empty($isnew) ? 'update' : 'insert'); |
|
324 | - |
|
325 | - // Define tags for notification message |
|
326 | - if (!empty($isnew) && $approved && !empty($GLOBALS['xoopsModuleConfig']['notification_enabled'])) { |
|
327 | - $tags = []; |
|
328 | - $tags['THREAD_NAME'] = Request::getString('subject', '', 'POST'); |
|
329 | - $tags['THREAD_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/viewtopic.php?post_id=' . $postid; |
|
330 | - $tags['POST_URL'] = $tags['THREAD_URL']; // . '#forumpost' . $postid; |
|
331 | - require_once __DIR__ . '/include/notification.inc.php'; |
|
332 | - $forum_info = newbb_notify_iteminfo('forum', $forumObject->getVar('forum_id')); |
|
333 | - $tags['FORUM_NAME'] = $forum_info['name']; |
|
334 | - $tags['FORUM_URL'] = $forum_info['url']; |
|
335 | - /** @var \XoopsNotificationHandler $notificationHandler */ |
|
336 | - $notificationHandler = xoops_getHandler('notification'); |
|
337 | - if (empty($isreply)) { |
|
338 | - // Notify of new thread |
|
339 | - $notificationHandler->triggerEvent('forum', $forumObject->getVar('forum_id'), 'new_thread', $tags); |
|
340 | - } else { |
|
341 | - // Notify of new post |
|
342 | - $notificationHandler->triggerEvent('thread', $topic_id, 'new_post', $tags); |
|
343 | - $_tags['name'] = $tags['THREAD_NAME']; |
|
344 | - $_tags['url'] = $tags['POST_URL']; |
|
345 | - $_tags['uid'] = $uid; |
|
346 | - $notificationHandler->triggerEvent('thread', $topic_id, 'post', $_tags); |
|
347 | - } |
|
348 | - $notificationHandler->triggerEvent('global', 0, 'new_post', $tags); |
|
349 | - $notificationHandler->triggerEvent('forum', $forumObject->getVar('forum_id'), 'new_post', $tags); |
|
350 | - $tags['POST_CONTENT'] = Request::getString('message', '', 'POST'); |
|
351 | - $tags['POST_NAME'] = Request::getString('subject', '', 'POST'); |
|
352 | - $notificationHandler->triggerEvent('global', 0, 'new_fullpost', $tags); |
|
353 | - $notificationHandler->triggerEvent('forum', $forumObject->getVar('forum_id'), 'new_fullpost', $tags); |
|
354 | - } |
|
355 | - |
|
356 | - // If user checked notification box, subscribe them to the |
|
357 | - // appropriate event; if unchecked, then unsubscribe |
|
358 | - if (!empty($GLOBALS['xoopsUser']) && !empty($GLOBALS['xoopsModuleConfig']['notification_enabled'])) { |
|
359 | - $notificationHandler = xoops_getHandler('notification'); |
|
360 | - if (!Request::getInt('notify', 0, 'POST')) { |
|
361 | - $notificationHandler->unsubscribe('thread', $postObject->getVar('topic_id'), 'new_post'); |
|
362 | - } elseif (Request::getInt('notify', 0, 'POST') > 0) { |
|
363 | - $notificationHandler->subscribe('thread', $postObject->getVar('topic_id'), 'new_post'); |
|
364 | - } |
|
365 | - // elseif ($_POST['notify']<0) keep it as it is |
|
366 | - } |
|
367 | - |
|
368 | - if ($approved) { |
|
369 | - if (!empty($GLOBALS['xoopsModuleConfig']['cache_enabled'])) { |
|
370 | - newbbSetSession('t' . $postObject->getVar('topic_id'), null); |
|
371 | - } |
|
372 | - // Update user |
|
373 | - if ($uid > 0) { |
|
374 | - $sql = 'SELECT count(*)' . ' FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_topics') . ' WHERE approved=1 AND topic_poster =' . $uid; |
|
375 | - $ret = $GLOBALS['xoopsDB']->query($sql); |
|
376 | - list($topics) = $GLOBALS['xoopsDB']->fetchRow($ret); |
|
377 | - |
|
378 | - $sql = ' SELECT count(*)' . ' FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_topics') . ' WHERE approved=1 AND topic_digest > 0 AND topic_poster =' . $uid; |
|
379 | - $ret = $GLOBALS['xoopsDB']->query($sql); |
|
380 | - list($digests) = $GLOBALS['xoopsDB']->fetchRow($ret); |
|
381 | - |
|
382 | - $sql = ' SELECT count(*), MAX(post_time)' . ' FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_posts') . ' WHERE approved=1 AND uid =' . $uid; |
|
383 | - $ret = $GLOBALS['xoopsDB']->query($sql); |
|
384 | - list($posts, $lastpost) = $GLOBALS['xoopsDB']->fetchRow($ret); |
|
385 | - |
|
386 | - $GLOBALS['xoopsDB']->queryF(' REPLACE INTO ' . $GLOBALS['xoopsDB']->prefix('newbb_user_stats') . " SET uid = '{$uid}', user_topics = '{$topics}', user_posts = '{$posts}', user_digests = '{$digests}', user_lastpost = '{$lastpost}'"); |
|
387 | - } |
|
388 | - |
|
389 | - $redirect = XOOPS_URL . '/modules/newbb/viewtopic.php?post_id=' . $postid; |
|
390 | - $message = _MD_NEWBB_THANKSSUBMIT . '<br>' . $error_upload; |
|
391 | - } else { |
|
392 | - $redirect = XOOPS_URL . '/modules/newbb/viewforum.php?forum=' . $postObject->getVar('forum_id'); |
|
393 | - $message = _MD_NEWBB_THANKSSUBMIT . '<br>' . _MD_NEWBB_WAITFORAPPROVAL . '<br>' . $error_upload; |
|
394 | - } |
|
395 | - |
|
396 | - if ('add' === $op) { |
|
397 | - redirect_header(XOOPS_URL . '/modules/newbb/polls.php?op=add&forum=' . $postObject->getVar('forum_id') . '&topic_id=' . $postObject->getVar('topic_id'), 1, _MD_NEWBB_ADDPOLL); |
|
398 | - } else { |
|
399 | - redirect_header($redirect, 2, $message); |
|
400 | - } |
|
254 | + $maxfilesize = $forumObject->getVar('attach_maxkb') * 1024; |
|
255 | + $uploaddir = XOOPS_CACHE_PATH; |
|
256 | + |
|
257 | + $uploader = new Newbb\Uploader($uploaddir, $forumObject->getVar('attach_ext'), (int)$maxfilesize, (int)$GLOBALS['xoopsModuleConfig']['max_img_width'], (int)$GLOBALS['xoopsModuleConfig']['max_img_height']); |
|
258 | + |
|
259 | + if ($_FILES['userfile']['error'] > 0) { |
|
260 | + switch ($_FILES['userfile']['error']) { |
|
261 | + case 1: |
|
262 | + $error_message[] = _MD_NEWBB_MAXUPLOADFILEINI; |
|
263 | + break; |
|
264 | + case 2: |
|
265 | + $error_message[] = sprintf(_MD_NEWBB_MAXKB, $forumObject->getVar('attach_maxkb')); |
|
266 | + break; |
|
267 | + default: |
|
268 | + $error_message[] = _MD_NEWBB_UPLOAD_ERRNODEF; |
|
269 | + break; |
|
270 | + } |
|
271 | + } else { |
|
272 | + $uploader->setCheckMediaTypeByExt(); |
|
273 | + $temp = Request::getArray('xoops_upload_file', [], 'POST'); |
|
274 | + if ($uploader->fetchMedia($temp[0])) { |
|
275 | + $prefix = is_object($GLOBALS['xoopsUser']) ? (string)$GLOBALS['xoopsUser']->uid() . '_' : 'newbb_'; |
|
276 | + $uploader->setPrefix($prefix); |
|
277 | + if (!$uploader->upload()) { |
|
278 | + $error_message[] = $error_upload = $uploader->getErrors(); |
|
279 | + } else { |
|
280 | + if (is_file($uploader->getSavedDestination())) { |
|
281 | + if (rename(XOOPS_CACHE_PATH . '/' . $uploader->getSavedFileName(), $GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'] . '/' . $uploader->getSavedFileName()))) { |
|
282 | + $postObject->setAttachment($uploader->getSavedFileName(), $uploader->getMediaName(), $uploader->getMediaType()); |
|
283 | + } |
|
284 | + } |
|
285 | + } |
|
286 | + } else { |
|
287 | + $error_message[] = $error_upload = $uploader->getErrors(); |
|
288 | + } |
|
289 | + } |
|
290 | + } |
|
291 | + |
|
292 | + $postid = $postHandler->insert($postObject); |
|
293 | + |
|
294 | + if (!$postid) { |
|
295 | + require_once $GLOBALS['xoops']->path('header.php'); |
|
296 | + xoops_error($postObject->getErrors()); |
|
297 | + require_once $GLOBALS['xoops']->path('footer.php'); |
|
298 | + } |
|
299 | + newbbSetSession('LP', time()); // Recording last post time |
|
300 | + $topicObject = $topicHandler->get($postObject->getVar('topic_id')); |
|
301 | + $uid = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('uid') : 0; |
|
302 | + if (newbbIsAdmin($forumObject) |
|
303 | + || ($topicHandler->getPermission($forumObject, $topic_status, 'type') |
|
304 | + && (0 == $topic_id |
|
305 | + || $uid == $topicObject->getVar('topic_poster')))) { |
|
306 | + $topicObject->setVar('type_id', Request::getInt('type_id', 0, 'POST')); |
|
307 | + } |
|
308 | + |
|
309 | + if (!empty($GLOBALS['xoopsModuleConfig']['do_tag']) && $postObject->isTopic()) { |
|
310 | + $topicObject->setVar('topic_tags', Request::getInt('topic_tags', 0, 'POST')); |
|
311 | + } |
|
312 | + $topicHandler->insert($topicObject); |
|
313 | + |
|
314 | + // Set read mark |
|
315 | + if (!empty($isnew)) { |
|
316 | + require_once $GLOBALS['xoops']->path('modules/newbb/include/functions.read.php'); |
|
317 | + newbbSetRead('topic', $topicObject->getVar('topic_id'), $postid); |
|
318 | + if (!$postObject->getVar('pid')) { |
|
319 | + newbbSetRead('forum', $forumObject->getVar('forum_id'), $postid); |
|
320 | + } |
|
321 | + } |
|
322 | + |
|
323 | + //$postObject->loadFilters(empty($isnew) ? 'update' : 'insert'); |
|
324 | + |
|
325 | + // Define tags for notification message |
|
326 | + if (!empty($isnew) && $approved && !empty($GLOBALS['xoopsModuleConfig']['notification_enabled'])) { |
|
327 | + $tags = []; |
|
328 | + $tags['THREAD_NAME'] = Request::getString('subject', '', 'POST'); |
|
329 | + $tags['THREAD_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/viewtopic.php?post_id=' . $postid; |
|
330 | + $tags['POST_URL'] = $tags['THREAD_URL']; // . '#forumpost' . $postid; |
|
331 | + require_once __DIR__ . '/include/notification.inc.php'; |
|
332 | + $forum_info = newbb_notify_iteminfo('forum', $forumObject->getVar('forum_id')); |
|
333 | + $tags['FORUM_NAME'] = $forum_info['name']; |
|
334 | + $tags['FORUM_URL'] = $forum_info['url']; |
|
335 | + /** @var \XoopsNotificationHandler $notificationHandler */ |
|
336 | + $notificationHandler = xoops_getHandler('notification'); |
|
337 | + if (empty($isreply)) { |
|
338 | + // Notify of new thread |
|
339 | + $notificationHandler->triggerEvent('forum', $forumObject->getVar('forum_id'), 'new_thread', $tags); |
|
340 | + } else { |
|
341 | + // Notify of new post |
|
342 | + $notificationHandler->triggerEvent('thread', $topic_id, 'new_post', $tags); |
|
343 | + $_tags['name'] = $tags['THREAD_NAME']; |
|
344 | + $_tags['url'] = $tags['POST_URL']; |
|
345 | + $_tags['uid'] = $uid; |
|
346 | + $notificationHandler->triggerEvent('thread', $topic_id, 'post', $_tags); |
|
347 | + } |
|
348 | + $notificationHandler->triggerEvent('global', 0, 'new_post', $tags); |
|
349 | + $notificationHandler->triggerEvent('forum', $forumObject->getVar('forum_id'), 'new_post', $tags); |
|
350 | + $tags['POST_CONTENT'] = Request::getString('message', '', 'POST'); |
|
351 | + $tags['POST_NAME'] = Request::getString('subject', '', 'POST'); |
|
352 | + $notificationHandler->triggerEvent('global', 0, 'new_fullpost', $tags); |
|
353 | + $notificationHandler->triggerEvent('forum', $forumObject->getVar('forum_id'), 'new_fullpost', $tags); |
|
354 | + } |
|
355 | + |
|
356 | + // If user checked notification box, subscribe them to the |
|
357 | + // appropriate event; if unchecked, then unsubscribe |
|
358 | + if (!empty($GLOBALS['xoopsUser']) && !empty($GLOBALS['xoopsModuleConfig']['notification_enabled'])) { |
|
359 | + $notificationHandler = xoops_getHandler('notification'); |
|
360 | + if (!Request::getInt('notify', 0, 'POST')) { |
|
361 | + $notificationHandler->unsubscribe('thread', $postObject->getVar('topic_id'), 'new_post'); |
|
362 | + } elseif (Request::getInt('notify', 0, 'POST') > 0) { |
|
363 | + $notificationHandler->subscribe('thread', $postObject->getVar('topic_id'), 'new_post'); |
|
364 | + } |
|
365 | + // elseif ($_POST['notify']<0) keep it as it is |
|
366 | + } |
|
367 | + |
|
368 | + if ($approved) { |
|
369 | + if (!empty($GLOBALS['xoopsModuleConfig']['cache_enabled'])) { |
|
370 | + newbbSetSession('t' . $postObject->getVar('topic_id'), null); |
|
371 | + } |
|
372 | + // Update user |
|
373 | + if ($uid > 0) { |
|
374 | + $sql = 'SELECT count(*)' . ' FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_topics') . ' WHERE approved=1 AND topic_poster =' . $uid; |
|
375 | + $ret = $GLOBALS['xoopsDB']->query($sql); |
|
376 | + list($topics) = $GLOBALS['xoopsDB']->fetchRow($ret); |
|
377 | + |
|
378 | + $sql = ' SELECT count(*)' . ' FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_topics') . ' WHERE approved=1 AND topic_digest > 0 AND topic_poster =' . $uid; |
|
379 | + $ret = $GLOBALS['xoopsDB']->query($sql); |
|
380 | + list($digests) = $GLOBALS['xoopsDB']->fetchRow($ret); |
|
381 | + |
|
382 | + $sql = ' SELECT count(*), MAX(post_time)' . ' FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_posts') . ' WHERE approved=1 AND uid =' . $uid; |
|
383 | + $ret = $GLOBALS['xoopsDB']->query($sql); |
|
384 | + list($posts, $lastpost) = $GLOBALS['xoopsDB']->fetchRow($ret); |
|
385 | + |
|
386 | + $GLOBALS['xoopsDB']->queryF(' REPLACE INTO ' . $GLOBALS['xoopsDB']->prefix('newbb_user_stats') . " SET uid = '{$uid}', user_topics = '{$topics}', user_posts = '{$posts}', user_digests = '{$digests}', user_lastpost = '{$lastpost}'"); |
|
387 | + } |
|
388 | + |
|
389 | + $redirect = XOOPS_URL . '/modules/newbb/viewtopic.php?post_id=' . $postid; |
|
390 | + $message = _MD_NEWBB_THANKSSUBMIT . '<br>' . $error_upload; |
|
391 | + } else { |
|
392 | + $redirect = XOOPS_URL . '/modules/newbb/viewforum.php?forum=' . $postObject->getVar('forum_id'); |
|
393 | + $message = _MD_NEWBB_THANKSSUBMIT . '<br>' . _MD_NEWBB_WAITFORAPPROVAL . '<br>' . $error_upload; |
|
394 | + } |
|
395 | + |
|
396 | + if ('add' === $op) { |
|
397 | + redirect_header(XOOPS_URL . '/modules/newbb/polls.php?op=add&forum=' . $postObject->getVar('forum_id') . '&topic_id=' . $postObject->getVar('topic_id'), 1, _MD_NEWBB_ADDPOLL); |
|
398 | + } else { |
|
399 | + redirect_header($redirect, 2, $message); |
|
400 | + } |
|
401 | 401 | } |
402 | 402 | |
403 | 403 | $xoopsOption['template_main'] = 'newbb_edit_post.tpl'; |
@@ -409,125 +409,125 @@ discard block |
||
409 | 409 | //$xoopsTpl->assign('xoops_module_header', $xoops_module_header); |
410 | 410 | |
411 | 411 | if (Request::getString('contents_upload', null, 'POST')) { |
412 | - $attachments_tmp = []; |
|
413 | - if (Request::getArray('attachments_tmp', null, 'POST')) { |
|
414 | - $attachments_tmp = unserialize(base64_decode(Request::getArray('attachments_tmp', [], 'POST'))); |
|
415 | - if (Request::getArray('delete_tmp', null, 'POST') && count(Request::getArray('delete_tmp', null, 'POST'))) { |
|
416 | - foreach (Request::getArray('delete_tmp', '', 'POST') as $key) { |
|
417 | - unlink($uploaddir = $GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'] . '/' . $attachments_tmp[$key][0])); |
|
418 | - unset($attachments_tmp[$key]); |
|
419 | - } |
|
420 | - } |
|
421 | - } |
|
422 | - |
|
423 | - $error_upload = ''; |
|
424 | - if (isset($_FILES['userfile']['name']) && '' !== $_FILES['userfile']['name']) { |
|
412 | + $attachments_tmp = []; |
|
413 | + if (Request::getArray('attachments_tmp', null, 'POST')) { |
|
414 | + $attachments_tmp = unserialize(base64_decode(Request::getArray('attachments_tmp', [], 'POST'))); |
|
415 | + if (Request::getArray('delete_tmp', null, 'POST') && count(Request::getArray('delete_tmp', null, 'POST'))) { |
|
416 | + foreach (Request::getArray('delete_tmp', '', 'POST') as $key) { |
|
417 | + unlink($uploaddir = $GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'] . '/' . $attachments_tmp[$key][0])); |
|
418 | + unset($attachments_tmp[$key]); |
|
419 | + } |
|
420 | + } |
|
421 | + } |
|
422 | + |
|
423 | + $error_upload = ''; |
|
424 | + if (isset($_FILES['userfile']['name']) && '' !== $_FILES['userfile']['name']) { |
|
425 | 425 | // require_once $GLOBALS['xoops']->path('modules/' . $xoopsModule->getVar('dirname', 'n') . '/class/uploader.php'); |
426 | - $maxfilesize = $forumObject->getVar('attach_maxkb') * 1024; |
|
427 | - $uploaddir = XOOPS_CACHE_PATH; |
|
428 | - |
|
429 | - $uploader = new Newbb\Uploader($uploaddir, $forumObject->getVar('attach_ext'), (int)$maxfilesize, (int)$GLOBALS['xoopsModuleConfig']['max_img_width'], (int)$GLOBALS['xoopsModuleConfig']['max_img_height']); |
|
430 | - if ($_FILES['userfile']['error'] > 0) { |
|
431 | - switch ($_FILES['userfile']['error']) { |
|
432 | - case 1: |
|
433 | - $error_message[] = _MD_NEWBB_MAXUPLOADFILEINI; |
|
434 | - break; |
|
435 | - case 2: |
|
436 | - $error_message[] = sprintf(_MD_NEWBB_MAXKB, $forumObject->getVar('attach_maxkb')); |
|
437 | - break; |
|
438 | - default: |
|
439 | - $error_message[] = _MD_NEWBB_UPLOAD_ERRNODEF; |
|
440 | - break; |
|
441 | - } |
|
442 | - } else { |
|
443 | - $uploader->setCheckMediaTypeByExt(); |
|
444 | - $temp = Request::getArray('xoops_upload_file', [], 'POST'); |
|
445 | - if ($uploader->fetchMedia($temp[0])) { |
|
446 | - $prefix = is_object($GLOBALS['xoopsUser']) ? (string)$GLOBALS['xoopsUser']->uid() . '_' : 'newbb_'; |
|
447 | - $uploader->setPrefix($prefix); |
|
448 | - if (!$uploader->upload()) { |
|
449 | - $error_message[] = $error_upload = $uploader->getErrors(); |
|
450 | - } else { |
|
451 | - if (is_file($uploader->getSavedDestination())) { |
|
452 | - $attachments_tmp[(string)time()] = [ |
|
453 | - $uploader->getSavedFileName(), |
|
454 | - $uploader->getMediaName(), |
|
455 | - $uploader->getMediaType() |
|
456 | - ]; |
|
457 | - } |
|
458 | - } |
|
459 | - } else { |
|
460 | - $error_message[] = $error_upload = $uploader->getErrors(); |
|
461 | - } |
|
462 | - } |
|
463 | - } |
|
426 | + $maxfilesize = $forumObject->getVar('attach_maxkb') * 1024; |
|
427 | + $uploaddir = XOOPS_CACHE_PATH; |
|
428 | + |
|
429 | + $uploader = new Newbb\Uploader($uploaddir, $forumObject->getVar('attach_ext'), (int)$maxfilesize, (int)$GLOBALS['xoopsModuleConfig']['max_img_width'], (int)$GLOBALS['xoopsModuleConfig']['max_img_height']); |
|
430 | + if ($_FILES['userfile']['error'] > 0) { |
|
431 | + switch ($_FILES['userfile']['error']) { |
|
432 | + case 1: |
|
433 | + $error_message[] = _MD_NEWBB_MAXUPLOADFILEINI; |
|
434 | + break; |
|
435 | + case 2: |
|
436 | + $error_message[] = sprintf(_MD_NEWBB_MAXKB, $forumObject->getVar('attach_maxkb')); |
|
437 | + break; |
|
438 | + default: |
|
439 | + $error_message[] = _MD_NEWBB_UPLOAD_ERRNODEF; |
|
440 | + break; |
|
441 | + } |
|
442 | + } else { |
|
443 | + $uploader->setCheckMediaTypeByExt(); |
|
444 | + $temp = Request::getArray('xoops_upload_file', [], 'POST'); |
|
445 | + if ($uploader->fetchMedia($temp[0])) { |
|
446 | + $prefix = is_object($GLOBALS['xoopsUser']) ? (string)$GLOBALS['xoopsUser']->uid() . '_' : 'newbb_'; |
|
447 | + $uploader->setPrefix($prefix); |
|
448 | + if (!$uploader->upload()) { |
|
449 | + $error_message[] = $error_upload = $uploader->getErrors(); |
|
450 | + } else { |
|
451 | + if (is_file($uploader->getSavedDestination())) { |
|
452 | + $attachments_tmp[(string)time()] = [ |
|
453 | + $uploader->getSavedFileName(), |
|
454 | + $uploader->getMediaName(), |
|
455 | + $uploader->getMediaType() |
|
456 | + ]; |
|
457 | + } |
|
458 | + } |
|
459 | + } else { |
|
460 | + $error_message[] = $error_upload = $uploader->getErrors(); |
|
461 | + } |
|
462 | + } |
|
463 | + } |
|
464 | 464 | } |
465 | 465 | |
466 | 466 | if (Request::getString('contents_preview', Request::getString('contents_preview', '', 'POST'), 'GET')) { |
467 | - if (Request::getString('attachments_tmp', '', 'POST')) { |
|
468 | - $attachments_tmp = unserialize(base64_decode(Request::getString('attachments_tmp', '', 'POST'))); |
|
469 | - } |
|
470 | - |
|
471 | - $p_subject = $myts->htmlSpecialChars(Request::getString('subject', '', 'POST')); |
|
472 | - $dosmiley = Request::getInt('dosmiley', 0, 'POST'); |
|
473 | - $dohtml = Request::getInt('dohtml', 0, 'POST'); |
|
474 | - $doxcode = Request::getInt('doxcode', 0, 'POST'); |
|
475 | - $dobr = Request::getInt('dobr', 0, 'POST'); |
|
476 | - $p_message = Request::getString('message', '', 'POST'); |
|
477 | - $p_message = $myts->previewTarea($p_message, $dohtml, $dosmiley, $doxcode, 1, $dobr); |
|
478 | - $p_date = formatTimestamp(time()); |
|
479 | - if ($postObject->isNew()) { |
|
480 | - if (is_object($GLOBALS['xoopsUser'])) { |
|
481 | - $p_name = $GLOBALS['xoopsUser']->getVar('uname'); |
|
482 | - if (!empty($GLOBALS['xoopsModuleConfig']['show_realname']) && $GLOBALS['xoopsUser']->getVar('name')) { |
|
483 | - $p_name = $GLOBALS['xoopsUser']->getVar('name'); |
|
484 | - } |
|
485 | - } |
|
486 | - } elseif ($postObject->getVar('uid')) { |
|
487 | - $p_name = newbbGetUnameFromId($postObject->getVar('uid'), $GLOBALS['xoopsModuleConfig']['show_realname']); |
|
488 | - } |
|
489 | - if (empty($p_name)) { |
|
490 | - $p_name = Request::getString('poster_name', '', 'POST') ? htmlspecialchars(Request::getString('poster_name', '', 'POST'), ENT_QUOTES | ENT_HTML5) : htmlspecialchars($GLOBALS['xoopsConfig']['anonymous'], ENT_QUOTES | ENT_HTML5); |
|
491 | - } |
|
492 | - |
|
493 | - $post_preview = [ |
|
494 | - 'subject' => $p_subject, |
|
495 | - 'meta' => _MD_NEWBB_BY . ' ' . $p_name . ' ' . _MD_NEWBB_ON . ' ' . $p_date, |
|
496 | - 'content' => $p_message |
|
497 | - ]; |
|
498 | - $xoopsTpl->assign_by_ref('post_preview', $post_preview); |
|
467 | + if (Request::getString('attachments_tmp', '', 'POST')) { |
|
468 | + $attachments_tmp = unserialize(base64_decode(Request::getString('attachments_tmp', '', 'POST'))); |
|
469 | + } |
|
470 | + |
|
471 | + $p_subject = $myts->htmlSpecialChars(Request::getString('subject', '', 'POST')); |
|
472 | + $dosmiley = Request::getInt('dosmiley', 0, 'POST'); |
|
473 | + $dohtml = Request::getInt('dohtml', 0, 'POST'); |
|
474 | + $doxcode = Request::getInt('doxcode', 0, 'POST'); |
|
475 | + $dobr = Request::getInt('dobr', 0, 'POST'); |
|
476 | + $p_message = Request::getString('message', '', 'POST'); |
|
477 | + $p_message = $myts->previewTarea($p_message, $dohtml, $dosmiley, $doxcode, 1, $dobr); |
|
478 | + $p_date = formatTimestamp(time()); |
|
479 | + if ($postObject->isNew()) { |
|
480 | + if (is_object($GLOBALS['xoopsUser'])) { |
|
481 | + $p_name = $GLOBALS['xoopsUser']->getVar('uname'); |
|
482 | + if (!empty($GLOBALS['xoopsModuleConfig']['show_realname']) && $GLOBALS['xoopsUser']->getVar('name')) { |
|
483 | + $p_name = $GLOBALS['xoopsUser']->getVar('name'); |
|
484 | + } |
|
485 | + } |
|
486 | + } elseif ($postObject->getVar('uid')) { |
|
487 | + $p_name = newbbGetUnameFromId($postObject->getVar('uid'), $GLOBALS['xoopsModuleConfig']['show_realname']); |
|
488 | + } |
|
489 | + if (empty($p_name)) { |
|
490 | + $p_name = Request::getString('poster_name', '', 'POST') ? htmlspecialchars(Request::getString('poster_name', '', 'POST'), ENT_QUOTES | ENT_HTML5) : htmlspecialchars($GLOBALS['xoopsConfig']['anonymous'], ENT_QUOTES | ENT_HTML5); |
|
491 | + } |
|
492 | + |
|
493 | + $post_preview = [ |
|
494 | + 'subject' => $p_subject, |
|
495 | + 'meta' => _MD_NEWBB_BY . ' ' . $p_name . ' ' . _MD_NEWBB_ON . ' ' . $p_date, |
|
496 | + 'content' => $p_message |
|
497 | + ]; |
|
498 | + $xoopsTpl->assign_by_ref('post_preview', $post_preview); |
|
499 | 499 | } |
500 | 500 | |
501 | 501 | if (Request::getString('contents_upload', null, 'POST') || Request::getString('contents_preview', null, 'POST') |
502 | - || Request::getString('contents_preview', null, 'GET') |
|
503 | - || Request::getString('editor', '', 'POST')) { |
|
504 | - $editor = Request::getString('editor', '', 'POST'); |
|
505 | - $dosmiley = Request::getInt('dosmiley', 0, 'POST'); |
|
506 | - $dohtml = Request::getInt('dohtml', 0, 'POST'); |
|
507 | - $doxcode = Request::getInt('doxcode', 0, 'POST'); |
|
508 | - $dobr = Request::getInt('dobr', 0, 'POST'); |
|
509 | - $subject = Request::getString('subject', '', 'POST'); |
|
510 | - $message = Request::getString('message', '', 'POST'); |
|
511 | - $poster_name = Request::getString('poster_name', '', 'POST'); |
|
512 | - $hidden = Request::getString('hidden', '', 'POST'); |
|
513 | - $notify = Request::getInt('notify', 0, 'POST'); |
|
514 | - $attachsig = Request::getInt('attachsig', 0, 'POST');//!empty($_POST['attachsig']) ? 1 : 0; |
|
515 | - $isreply = Request::getInt('isreply', 0, 'POST'); //!empty($_POST['isreply']) ? 1 : 0; |
|
516 | - $isedit = Request::getInt('isedit', 0, 'POST'); //!empty($_POST['isedit']) ? 1 : 0; |
|
517 | - $icon = (Request::getString('icon', '', 'POST') |
|
518 | - && is_file($GLOBALS['xoops']->path('images/subject/' . Request::getString('icon', '', 'POST'))) ? Request::getString('icon', '', 'POST') : ''); |
|
519 | - $view_require = Request::getString('view_require', '', 'POST'); |
|
520 | - $post_karma = (('require_karma' === $view_require) |
|
521 | - && !Request::getInt('post_karma', 0, 'POST')) ? Request::getInt('post_karma', 0, 'POST') : 0; |
|
522 | - $require_reply = ('require_reply' === $view_require) ? 1 : 0; |
|
523 | - |
|
524 | - if (!Request::getString('contents_upload', '', 'POST')) { |
|
525 | - $contents_preview = 1; |
|
526 | - } |
|
527 | - $attachments = $postObject->getAttachment(); |
|
528 | - $xoopsTpl->assign('error_message', implode('<br>', $error_message)); |
|
529 | - |
|
530 | - require_once __DIR__ . '/include/form.post.php'; |
|
502 | + || Request::getString('contents_preview', null, 'GET') |
|
503 | + || Request::getString('editor', '', 'POST')) { |
|
504 | + $editor = Request::getString('editor', '', 'POST'); |
|
505 | + $dosmiley = Request::getInt('dosmiley', 0, 'POST'); |
|
506 | + $dohtml = Request::getInt('dohtml', 0, 'POST'); |
|
507 | + $doxcode = Request::getInt('doxcode', 0, 'POST'); |
|
508 | + $dobr = Request::getInt('dobr', 0, 'POST'); |
|
509 | + $subject = Request::getString('subject', '', 'POST'); |
|
510 | + $message = Request::getString('message', '', 'POST'); |
|
511 | + $poster_name = Request::getString('poster_name', '', 'POST'); |
|
512 | + $hidden = Request::getString('hidden', '', 'POST'); |
|
513 | + $notify = Request::getInt('notify', 0, 'POST'); |
|
514 | + $attachsig = Request::getInt('attachsig', 0, 'POST');//!empty($_POST['attachsig']) ? 1 : 0; |
|
515 | + $isreply = Request::getInt('isreply', 0, 'POST'); //!empty($_POST['isreply']) ? 1 : 0; |
|
516 | + $isedit = Request::getInt('isedit', 0, 'POST'); //!empty($_POST['isedit']) ? 1 : 0; |
|
517 | + $icon = (Request::getString('icon', '', 'POST') |
|
518 | + && is_file($GLOBALS['xoops']->path('images/subject/' . Request::getString('icon', '', 'POST'))) ? Request::getString('icon', '', 'POST') : ''); |
|
519 | + $view_require = Request::getString('view_require', '', 'POST'); |
|
520 | + $post_karma = (('require_karma' === $view_require) |
|
521 | + && !Request::getInt('post_karma', 0, 'POST')) ? Request::getInt('post_karma', 0, 'POST') : 0; |
|
522 | + $require_reply = ('require_reply' === $view_require) ? 1 : 0; |
|
523 | + |
|
524 | + if (!Request::getString('contents_upload', '', 'POST')) { |
|
525 | + $contents_preview = 1; |
|
526 | + } |
|
527 | + $attachments = $postObject->getAttachment(); |
|
528 | + $xoopsTpl->assign('error_message', implode('<br>', $error_message)); |
|
529 | + |
|
530 | + require_once __DIR__ . '/include/form.post.php'; |
|
531 | 531 | } |
532 | 532 | // irmtfan move to footer.php |
533 | 533 | require_once __DIR__ . '/footer.php'; |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | use Xmf\Request; |
20 | 20 | use XoopsModules\Newbb; |
21 | 21 | |
22 | -require_once __DIR__ . '/header.php'; |
|
22 | +require_once __DIR__.'/header.php'; |
|
23 | 23 | |
24 | 24 | foreach ([ |
25 | 25 | 'forum', |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | || ($postObject->checkTimelimit('edit_timelimit') |
147 | 147 | && $postObject->checkIdentity()))) { |
148 | 148 | } else { |
149 | - redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?forum={$forum_id}&topic_id={$topic_id}&post_id={$post_id}&order={$order}&viewmode={$viewmode}", 2, _MD_NEWBB_NORIGHTTOEDIT); |
|
149 | + redirect_header(XOOPS_URL."/modules/newbb/viewtopic.php?forum={$forum_id}&topic_id={$topic_id}&post_id={$post_id}&order={$order}&viewmode={$viewmode}", 2, _MD_NEWBB_NORIGHTTOEDIT); |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | $delete_attach = Request::getArray('delete_attach', [], 'POST'); |
@@ -157,12 +157,12 @@ discard block |
||
157 | 157 | if ($topic_id) { |
158 | 158 | $topic_status = $topicObject->getVar('topic_status'); |
159 | 159 | if (!$topicHandler->getPermission($forumObject, $topic_status, 'reply')) { |
160 | - redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?forum={$forum_id}&topic_id={$topic_id}&post_id={$post_id}&order={$order}&viewmode={$viewmode}", 2, _MD_NEWBB_NORIGHTTOREPLY); |
|
160 | + redirect_header(XOOPS_URL."/modules/newbb/viewtopic.php?forum={$forum_id}&topic_id={$topic_id}&post_id={$post_id}&order={$order}&viewmode={$viewmode}", 2, _MD_NEWBB_NORIGHTTOREPLY); |
|
161 | 161 | } |
162 | 162 | } else { |
163 | 163 | $topic_status = 0; |
164 | 164 | if (!$topicHandler->getPermission($forumObject, $topic_status, 'post')) { |
165 | - redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?forum={$forum_id}", 2, _MD_NEWBB_NORIGHTTOPOST); |
|
165 | + redirect_header(XOOPS_URL."/modules/newbb/viewtopic.php?forum={$forum_id}", 2, _MD_NEWBB_NORIGHTTOPOST); |
|
166 | 166 | } |
167 | 167 | } |
168 | 168 | |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | $doxcode = Request::getInt('doxcode', 0, 'POST') ? 1 : 0; |
202 | 202 | $dobr = Request::getInt('dobr', 0, 'POST') ? 1 : 0; |
203 | 203 | $icon = (Request::getString('icon', '', 'POST') |
204 | - && is_file($GLOBALS['xoops']->path('images/subject/' . Request::getString('icon', '', 'POST'))) ? Request::getString('icon', '', 'POST') : ''); |
|
204 | + && is_file($GLOBALS['xoops']->path('images/subject/'.Request::getString('icon', '', 'POST'))) ? Request::getString('icon', '', 'POST') : ''); |
|
205 | 205 | $attachsig = Request::getBool('attachsig', false, 'POST') |
206 | 206 | && $topicHandler->getPermission($forumObject, $topic_status, 'signature'); |
207 | 207 | $view_require = Request::getString('view_require', '', 'POST'); |
@@ -234,14 +234,14 @@ discard block |
||
234 | 234 | $attachments_tmp = unserialize(base64_decode(Request::getString('attachments_tmp', '', 'POST'))); |
235 | 235 | if (Request::getArray('delete_tmp', null, 'POST') && count(Request::getArray('delete_tmp', null, 'POST')) > 1) { |
236 | 236 | foreach (Request::getArray('delete_tmp', null, 'POST') as $key) { |
237 | - unlink($GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'] . '/' . $attachments_tmp[$key][0])); |
|
237 | + unlink($GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'].'/'.$attachments_tmp[$key][0])); |
|
238 | 238 | unset($attachments_tmp[$key]); |
239 | 239 | } |
240 | 240 | } |
241 | 241 | } |
242 | 242 | if (isset($attachments_tmp) && count($attachments_tmp)) { |
243 | 243 | foreach ($attachments_tmp as $key => $attach) { |
244 | - if (rename(XOOPS_CACHE_PATH . '/' . $attachments_tmp[$key][0], $GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'] . '/' . $attachments_tmp[$key][0]))) { |
|
244 | + if (rename(XOOPS_CACHE_PATH.'/'.$attachments_tmp[$key][0], $GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'].'/'.$attachments_tmp[$key][0]))) { |
|
245 | 245 | $postObject->setAttachment($attach[0], $attach[1], $attach[2]); |
246 | 246 | } |
247 | 247 | } |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | $maxfilesize = $forumObject->getVar('attach_maxkb') * 1024; |
255 | 255 | $uploaddir = XOOPS_CACHE_PATH; |
256 | 256 | |
257 | - $uploader = new Newbb\Uploader($uploaddir, $forumObject->getVar('attach_ext'), (int)$maxfilesize, (int)$GLOBALS['xoopsModuleConfig']['max_img_width'], (int)$GLOBALS['xoopsModuleConfig']['max_img_height']); |
|
257 | + $uploader = new Newbb\Uploader($uploaddir, $forumObject->getVar('attach_ext'), (int) $maxfilesize, (int) $GLOBALS['xoopsModuleConfig']['max_img_width'], (int) $GLOBALS['xoopsModuleConfig']['max_img_height']); |
|
258 | 258 | |
259 | 259 | if ($_FILES['userfile']['error'] > 0) { |
260 | 260 | switch ($_FILES['userfile']['error']) { |
@@ -272,13 +272,13 @@ discard block |
||
272 | 272 | $uploader->setCheckMediaTypeByExt(); |
273 | 273 | $temp = Request::getArray('xoops_upload_file', [], 'POST'); |
274 | 274 | if ($uploader->fetchMedia($temp[0])) { |
275 | - $prefix = is_object($GLOBALS['xoopsUser']) ? (string)$GLOBALS['xoopsUser']->uid() . '_' : 'newbb_'; |
|
275 | + $prefix = is_object($GLOBALS['xoopsUser']) ? (string) $GLOBALS['xoopsUser']->uid().'_' : 'newbb_'; |
|
276 | 276 | $uploader->setPrefix($prefix); |
277 | 277 | if (!$uploader->upload()) { |
278 | 278 | $error_message[] = $error_upload = $uploader->getErrors(); |
279 | 279 | } else { |
280 | 280 | if (is_file($uploader->getSavedDestination())) { |
281 | - if (rename(XOOPS_CACHE_PATH . '/' . $uploader->getSavedFileName(), $GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'] . '/' . $uploader->getSavedFileName()))) { |
|
281 | + if (rename(XOOPS_CACHE_PATH.'/'.$uploader->getSavedFileName(), $GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'].'/'.$uploader->getSavedFileName()))) { |
|
282 | 282 | $postObject->setAttachment($uploader->getSavedFileName(), $uploader->getMediaName(), $uploader->getMediaType()); |
283 | 283 | } |
284 | 284 | } |
@@ -326,9 +326,9 @@ discard block |
||
326 | 326 | if (!empty($isnew) && $approved && !empty($GLOBALS['xoopsModuleConfig']['notification_enabled'])) { |
327 | 327 | $tags = []; |
328 | 328 | $tags['THREAD_NAME'] = Request::getString('subject', '', 'POST'); |
329 | - $tags['THREAD_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/viewtopic.php?post_id=' . $postid; |
|
329 | + $tags['THREAD_URL'] = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/viewtopic.php?post_id='.$postid; |
|
330 | 330 | $tags['POST_URL'] = $tags['THREAD_URL']; // . '#forumpost' . $postid; |
331 | - require_once __DIR__ . '/include/notification.inc.php'; |
|
331 | + require_once __DIR__.'/include/notification.inc.php'; |
|
332 | 332 | $forum_info = newbb_notify_iteminfo('forum', $forumObject->getVar('forum_id')); |
333 | 333 | $tags['FORUM_NAME'] = $forum_info['name']; |
334 | 334 | $tags['FORUM_URL'] = $forum_info['url']; |
@@ -367,34 +367,34 @@ discard block |
||
367 | 367 | |
368 | 368 | if ($approved) { |
369 | 369 | if (!empty($GLOBALS['xoopsModuleConfig']['cache_enabled'])) { |
370 | - newbbSetSession('t' . $postObject->getVar('topic_id'), null); |
|
370 | + newbbSetSession('t'.$postObject->getVar('topic_id'), null); |
|
371 | 371 | } |
372 | 372 | // Update user |
373 | 373 | if ($uid > 0) { |
374 | - $sql = 'SELECT count(*)' . ' FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_topics') . ' WHERE approved=1 AND topic_poster =' . $uid; |
|
374 | + $sql = 'SELECT count(*)'.' FROM '.$GLOBALS['xoopsDB']->prefix('newbb_topics').' WHERE approved=1 AND topic_poster ='.$uid; |
|
375 | 375 | $ret = $GLOBALS['xoopsDB']->query($sql); |
376 | 376 | list($topics) = $GLOBALS['xoopsDB']->fetchRow($ret); |
377 | 377 | |
378 | - $sql = ' SELECT count(*)' . ' FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_topics') . ' WHERE approved=1 AND topic_digest > 0 AND topic_poster =' . $uid; |
|
378 | + $sql = ' SELECT count(*)'.' FROM '.$GLOBALS['xoopsDB']->prefix('newbb_topics').' WHERE approved=1 AND topic_digest > 0 AND topic_poster ='.$uid; |
|
379 | 379 | $ret = $GLOBALS['xoopsDB']->query($sql); |
380 | 380 | list($digests) = $GLOBALS['xoopsDB']->fetchRow($ret); |
381 | 381 | |
382 | - $sql = ' SELECT count(*), MAX(post_time)' . ' FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_posts') . ' WHERE approved=1 AND uid =' . $uid; |
|
382 | + $sql = ' SELECT count(*), MAX(post_time)'.' FROM '.$GLOBALS['xoopsDB']->prefix('newbb_posts').' WHERE approved=1 AND uid ='.$uid; |
|
383 | 383 | $ret = $GLOBALS['xoopsDB']->query($sql); |
384 | 384 | list($posts, $lastpost) = $GLOBALS['xoopsDB']->fetchRow($ret); |
385 | 385 | |
386 | - $GLOBALS['xoopsDB']->queryF(' REPLACE INTO ' . $GLOBALS['xoopsDB']->prefix('newbb_user_stats') . " SET uid = '{$uid}', user_topics = '{$topics}', user_posts = '{$posts}', user_digests = '{$digests}', user_lastpost = '{$lastpost}'"); |
|
386 | + $GLOBALS['xoopsDB']->queryF(' REPLACE INTO '.$GLOBALS['xoopsDB']->prefix('newbb_user_stats')." SET uid = '{$uid}', user_topics = '{$topics}', user_posts = '{$posts}', user_digests = '{$digests}', user_lastpost = '{$lastpost}'"); |
|
387 | 387 | } |
388 | 388 | |
389 | - $redirect = XOOPS_URL . '/modules/newbb/viewtopic.php?post_id=' . $postid; |
|
390 | - $message = _MD_NEWBB_THANKSSUBMIT . '<br>' . $error_upload; |
|
389 | + $redirect = XOOPS_URL.'/modules/newbb/viewtopic.php?post_id='.$postid; |
|
390 | + $message = _MD_NEWBB_THANKSSUBMIT.'<br>'.$error_upload; |
|
391 | 391 | } else { |
392 | - $redirect = XOOPS_URL . '/modules/newbb/viewforum.php?forum=' . $postObject->getVar('forum_id'); |
|
393 | - $message = _MD_NEWBB_THANKSSUBMIT . '<br>' . _MD_NEWBB_WAITFORAPPROVAL . '<br>' . $error_upload; |
|
392 | + $redirect = XOOPS_URL.'/modules/newbb/viewforum.php?forum='.$postObject->getVar('forum_id'); |
|
393 | + $message = _MD_NEWBB_THANKSSUBMIT.'<br>'._MD_NEWBB_WAITFORAPPROVAL.'<br>'.$error_upload; |
|
394 | 394 | } |
395 | 395 | |
396 | 396 | if ('add' === $op) { |
397 | - redirect_header(XOOPS_URL . '/modules/newbb/polls.php?op=add&forum=' . $postObject->getVar('forum_id') . '&topic_id=' . $postObject->getVar('topic_id'), 1, _MD_NEWBB_ADDPOLL); |
|
397 | + redirect_header(XOOPS_URL.'/modules/newbb/polls.php?op=add&forum='.$postObject->getVar('forum_id').'&topic_id='.$postObject->getVar('topic_id'), 1, _MD_NEWBB_ADDPOLL); |
|
398 | 398 | } else { |
399 | 399 | redirect_header($redirect, 2, $message); |
400 | 400 | } |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | $attachments_tmp = unserialize(base64_decode(Request::getArray('attachments_tmp', [], 'POST'))); |
415 | 415 | if (Request::getArray('delete_tmp', null, 'POST') && count(Request::getArray('delete_tmp', null, 'POST'))) { |
416 | 416 | foreach (Request::getArray('delete_tmp', '', 'POST') as $key) { |
417 | - unlink($uploaddir = $GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'] . '/' . $attachments_tmp[$key][0])); |
|
417 | + unlink($uploaddir = $GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'].'/'.$attachments_tmp[$key][0])); |
|
418 | 418 | unset($attachments_tmp[$key]); |
419 | 419 | } |
420 | 420 | } |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | $maxfilesize = $forumObject->getVar('attach_maxkb') * 1024; |
427 | 427 | $uploaddir = XOOPS_CACHE_PATH; |
428 | 428 | |
429 | - $uploader = new Newbb\Uploader($uploaddir, $forumObject->getVar('attach_ext'), (int)$maxfilesize, (int)$GLOBALS['xoopsModuleConfig']['max_img_width'], (int)$GLOBALS['xoopsModuleConfig']['max_img_height']); |
|
429 | + $uploader = new Newbb\Uploader($uploaddir, $forumObject->getVar('attach_ext'), (int) $maxfilesize, (int) $GLOBALS['xoopsModuleConfig']['max_img_width'], (int) $GLOBALS['xoopsModuleConfig']['max_img_height']); |
|
430 | 430 | if ($_FILES['userfile']['error'] > 0) { |
431 | 431 | switch ($_FILES['userfile']['error']) { |
432 | 432 | case 1: |
@@ -443,13 +443,13 @@ discard block |
||
443 | 443 | $uploader->setCheckMediaTypeByExt(); |
444 | 444 | $temp = Request::getArray('xoops_upload_file', [], 'POST'); |
445 | 445 | if ($uploader->fetchMedia($temp[0])) { |
446 | - $prefix = is_object($GLOBALS['xoopsUser']) ? (string)$GLOBALS['xoopsUser']->uid() . '_' : 'newbb_'; |
|
446 | + $prefix = is_object($GLOBALS['xoopsUser']) ? (string) $GLOBALS['xoopsUser']->uid().'_' : 'newbb_'; |
|
447 | 447 | $uploader->setPrefix($prefix); |
448 | 448 | if (!$uploader->upload()) { |
449 | 449 | $error_message[] = $error_upload = $uploader->getErrors(); |
450 | 450 | } else { |
451 | 451 | if (is_file($uploader->getSavedDestination())) { |
452 | - $attachments_tmp[(string)time()] = [ |
|
452 | + $attachments_tmp[(string) time()] = [ |
|
453 | 453 | $uploader->getSavedFileName(), |
454 | 454 | $uploader->getMediaName(), |
455 | 455 | $uploader->getMediaType() |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | |
493 | 493 | $post_preview = [ |
494 | 494 | 'subject' => $p_subject, |
495 | - 'meta' => _MD_NEWBB_BY . ' ' . $p_name . ' ' . _MD_NEWBB_ON . ' ' . $p_date, |
|
495 | + 'meta' => _MD_NEWBB_BY.' '.$p_name.' '._MD_NEWBB_ON.' '.$p_date, |
|
496 | 496 | 'content' => $p_message |
497 | 497 | ]; |
498 | 498 | $xoopsTpl->assign_by_ref('post_preview', $post_preview); |
@@ -511,11 +511,11 @@ discard block |
||
511 | 511 | $poster_name = Request::getString('poster_name', '', 'POST'); |
512 | 512 | $hidden = Request::getString('hidden', '', 'POST'); |
513 | 513 | $notify = Request::getInt('notify', 0, 'POST'); |
514 | - $attachsig = Request::getInt('attachsig', 0, 'POST');//!empty($_POST['attachsig']) ? 1 : 0; |
|
514 | + $attachsig = Request::getInt('attachsig', 0, 'POST'); //!empty($_POST['attachsig']) ? 1 : 0; |
|
515 | 515 | $isreply = Request::getInt('isreply', 0, 'POST'); //!empty($_POST['isreply']) ? 1 : 0; |
516 | 516 | $isedit = Request::getInt('isedit', 0, 'POST'); //!empty($_POST['isedit']) ? 1 : 0; |
517 | 517 | $icon = (Request::getString('icon', '', 'POST') |
518 | - && is_file($GLOBALS['xoops']->path('images/subject/' . Request::getString('icon', '', 'POST'))) ? Request::getString('icon', '', 'POST') : ''); |
|
518 | + && is_file($GLOBALS['xoops']->path('images/subject/'.Request::getString('icon', '', 'POST'))) ? Request::getString('icon', '', 'POST') : ''); |
|
519 | 519 | $view_require = Request::getString('view_require', '', 'POST'); |
520 | 520 | $post_karma = (('require_karma' === $view_require) |
521 | 521 | && !Request::getInt('post_karma', 0, 'POST')) ? Request::getInt('post_karma', 0, 'POST') : 0; |
@@ -527,8 +527,8 @@ discard block |
||
527 | 527 | $attachments = $postObject->getAttachment(); |
528 | 528 | $xoopsTpl->assign('error_message', implode('<br>', $error_message)); |
529 | 529 | |
530 | - require_once __DIR__ . '/include/form.post.php'; |
|
530 | + require_once __DIR__.'/include/form.post.php'; |
|
531 | 531 | } |
532 | 532 | // irmtfan move to footer.php |
533 | -require_once __DIR__ . '/footer.php'; |
|
533 | +require_once __DIR__.'/footer.php'; |
|
534 | 534 | require_once $GLOBALS['xoops']->path('footer.php'); |
@@ -14,14 +14,14 @@ discard block |
||
14 | 14 | require_once __DIR__ . '/header.php'; |
15 | 15 | |
16 | 16 | if (!$forum = Request::getString('forum', '', 'GET')) { |
17 | - redirect_header(XOOPS_URL . '/index.php', 2, _MD_NEWBB_ERRORFORUM); |
|
17 | + redirect_header(XOOPS_URL . '/index.php', 2, _MD_NEWBB_ERRORFORUM); |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | ///** @var Newbb\ForumHandler $forumHandler */ |
21 | 21 | //$forumHandler = Newbb\Helper::getInstance()->getHandler('Forum'); |
22 | 22 | $forumObject = $forumHandler->get($forum); |
23 | 23 | if (!$forumHandler->getPermission($forumObject)) { |
24 | - redirect_header(XOOPS_URL . '/index.php', 2, _NOPERM); |
|
24 | + redirect_header(XOOPS_URL . '/index.php', 2, _NOPERM); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | ///** @var Newbb\TopicHandler $topicHandler */ |
@@ -29,25 +29,25 @@ discard block |
||
29 | 29 | $topicObject = $topicHandler->create(); |
30 | 30 | $topicObject->setVar('forum_id', $forum); |
31 | 31 | if (!$topicHandler->getPermission($forumObject, 0, 'post')) { |
32 | - /* |
|
32 | + /* |
|
33 | 33 | * Build the page query |
34 | 34 | */ |
35 | - $query_vars = ['forum', 'order', 'mode', 'viewmode']; |
|
36 | - $query_array = []; |
|
37 | - foreach ($query_vars as $var) { |
|
38 | - if (Request::getString($var, '', 'GET')) { |
|
39 | - $query_array[$var] = "{$var}=" . Request::getString($var, '', 'GET'); |
|
40 | - } |
|
41 | - } |
|
42 | - $page_query = htmlspecialchars(implode('&', array_values($query_array)), ENT_QUOTES | ENT_HTML5); |
|
43 | - unset($query_array); |
|
44 | - redirect_header(XOOPS_URL . "/modules/newbb/viewforum.php?{$page_query}", 2, _MD_NEWBB_NORIGHTTOPOST); |
|
35 | + $query_vars = ['forum', 'order', 'mode', 'viewmode']; |
|
36 | + $query_array = []; |
|
37 | + foreach ($query_vars as $var) { |
|
38 | + if (Request::getString($var, '', 'GET')) { |
|
39 | + $query_array[$var] = "{$var}=" . Request::getString($var, '', 'GET'); |
|
40 | + } |
|
41 | + } |
|
42 | + $page_query = htmlspecialchars(implode('&', array_values($query_array)), ENT_QUOTES | ENT_HTML5); |
|
43 | + unset($query_array); |
|
44 | + redirect_header(XOOPS_URL . "/modules/newbb/viewforum.php?{$page_query}", 2, _MD_NEWBB_NORIGHTTOPOST); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | if ($GLOBALS['xoopsModuleConfig']['wol_enabled']) { |
48 | - // /** @var Newbb\OnlineHandler $onlineHandler */ |
|
49 | - // $onlineHandler = Newbb\Helper::getInstance()->getHandler('Online'); |
|
50 | - $onlineHandler->init($forumObject); |
|
48 | + // /** @var Newbb\OnlineHandler $onlineHandler */ |
|
49 | + // $onlineHandler = Newbb\Helper::getInstance()->getHandler('Online'); |
|
50 | + $onlineHandler->init($forumObject); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | $xoopsOption['template_main'] = 'newbb_edit_post.tpl'; |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | require_once $GLOBALS['xoops']->path('header.php'); |
56 | 56 | |
57 | 57 | if (1 == $GLOBALS['xoopsModuleConfig']['disc_show'] || 3 == $GLOBALS['xoopsModuleConfig']['disc_show']) { |
58 | - $xoopsTpl->assign('disclaimer', $GLOBALS['xoopsModuleConfig']['disclaimer']); |
|
58 | + $xoopsTpl->assign('disclaimer', $GLOBALS['xoopsModuleConfig']['disclaimer']); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | $subject = ''; |
@@ -11,17 +11,17 @@ discard block |
||
11 | 11 | |
12 | 12 | use Xmf\Request; |
13 | 13 | |
14 | -require_once __DIR__ . '/header.php'; |
|
14 | +require_once __DIR__.'/header.php'; |
|
15 | 15 | |
16 | 16 | if (!$forum = Request::getString('forum', '', 'GET')) { |
17 | - redirect_header(XOOPS_URL . '/index.php', 2, _MD_NEWBB_ERRORFORUM); |
|
17 | + redirect_header(XOOPS_URL.'/index.php', 2, _MD_NEWBB_ERRORFORUM); |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | ///** @var Newbb\ForumHandler $forumHandler */ |
21 | 21 | //$forumHandler = Newbb\Helper::getInstance()->getHandler('Forum'); |
22 | 22 | $forumObject = $forumHandler->get($forum); |
23 | 23 | if (!$forumHandler->getPermission($forumObject)) { |
24 | - redirect_header(XOOPS_URL . '/index.php', 2, _NOPERM); |
|
24 | + redirect_header(XOOPS_URL.'/index.php', 2, _NOPERM); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | ///** @var Newbb\TopicHandler $topicHandler */ |
@@ -36,12 +36,12 @@ discard block |
||
36 | 36 | $query_array = []; |
37 | 37 | foreach ($query_vars as $var) { |
38 | 38 | if (Request::getString($var, '', 'GET')) { |
39 | - $query_array[$var] = "{$var}=" . Request::getString($var, '', 'GET'); |
|
39 | + $query_array[$var] = "{$var}=".Request::getString($var, '', 'GET'); |
|
40 | 40 | } |
41 | 41 | } |
42 | 42 | $page_query = htmlspecialchars(implode('&', array_values($query_array)), ENT_QUOTES | ENT_HTML5); |
43 | 43 | unset($query_array); |
44 | - redirect_header(XOOPS_URL . "/modules/newbb/viewforum.php?{$page_query}", 2, _MD_NEWBB_NORIGHTTOPOST); |
|
44 | + redirect_header(XOOPS_URL."/modules/newbb/viewforum.php?{$page_query}", 2, _MD_NEWBB_NORIGHTTOPOST); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | if ($GLOBALS['xoopsModuleConfig']['wol_enabled']) { |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $attachsig = (is_object($GLOBALS['xoopsUser']) && $GLOBALS['xoopsUser']->getVar('attachsig')) ? 1 : 0; |
71 | 71 | $post_id = 0; |
72 | 72 | $topic_id = 0; |
73 | -require_once __DIR__ . '/include/form.post.php'; |
|
73 | +require_once __DIR__.'/include/form.post.php'; |
|
74 | 74 | |
75 | -require_once __DIR__ . '/footer.php'; |
|
75 | +require_once __DIR__.'/footer.php'; |
|
76 | 76 | require_once $GLOBALS['xoops']->path('footer.php'); |
@@ -35,25 +35,25 @@ discard block |
||
35 | 35 | require_once __DIR__ . '/header.php'; |
36 | 36 | |
37 | 37 | if (Request::getString('submit', '', 'POST')) { |
38 | - foreach (['forum', 'newforum', 'newtopic'] as $getint) { |
|
39 | - ${$getint} = Request::getInt($getint, 0, 'POST');// (int)(@$_POST[$getint]); |
|
40 | - } |
|
41 | - foreach (['topic_id'] as $getint) { |
|
42 | - ${$getint} = Request::getInt($getint, 0, 'POST');// (int)(@$_POST[$getint]); |
|
43 | - } |
|
44 | - if (!is_array($topic_id)) { |
|
45 | - $topic_id = [$topic_id]; |
|
46 | - } |
|
38 | + foreach (['forum', 'newforum', 'newtopic'] as $getint) { |
|
39 | + ${$getint} = Request::getInt($getint, 0, 'POST');// (int)(@$_POST[$getint]); |
|
40 | + } |
|
41 | + foreach (['topic_id'] as $getint) { |
|
42 | + ${$getint} = Request::getInt($getint, 0, 'POST');// (int)(@$_POST[$getint]); |
|
43 | + } |
|
44 | + if (!is_array($topic_id)) { |
|
45 | + $topic_id = [$topic_id]; |
|
46 | + } |
|
47 | 47 | } else { |
48 | - foreach (['forum', 'topic_id'] as $getint) { |
|
49 | - ${$getint} = Request::getInt($getint, 0, 'GET');// (int)(@$_GET[$getint]); |
|
50 | - } |
|
48 | + foreach (['forum', 'topic_id'] as $getint) { |
|
49 | + ${$getint} = Request::getInt($getint, 0, 'GET');// (int)(@$_GET[$getint]); |
|
50 | + } |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | if (empty($topic_id)) { |
54 | - $redirect = empty($forum_id) ? 'index.php' : 'viewforum.php?forum={$forum}'; |
|
55 | - $redirect = XOOPS_URL . '/modules/newbb/' . $redirect; |
|
56 | - redirect_header($redirect, 2, _MD_NEWBB_ERRORTOPIC); |
|
54 | + $redirect = empty($forum_id) ? 'index.php' : 'viewforum.php?forum={$forum}'; |
|
55 | + $redirect = XOOPS_URL . '/modules/newbb/' . $redirect; |
|
56 | + redirect_header($redirect, 2, _MD_NEWBB_ERRORTOPIC); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | ///** @var Newbb\TopicHandler $topicHandler */ |
@@ -62,43 +62,43 @@ discard block |
||
62 | 62 | //$forumHandler = Newbb\Helper::getInstance()->getHandler('Forum'); |
63 | 63 | |
64 | 64 | if (!$forum) { |
65 | - /** @var Newbb\Topic $topicObject */ |
|
66 | - $topicObject = $topicHandler->get((int)$topic_id); |
|
67 | - if (is_object($topicObject)) { |
|
68 | - $forum = $topicObject->getVar('forum_id'); |
|
69 | - } else { |
|
70 | - $redirect = XOOPS_URL . '/modules/newbb/viewtopic.php?topic_id=' . $topic_id; |
|
71 | - redirect_header($redirect, 2, _MD_NEWBB_FORUMNOEXIST); |
|
72 | - } |
|
73 | - unset($topicObject); |
|
65 | + /** @var Newbb\Topic $topicObject */ |
|
66 | + $topicObject = $topicHandler->get((int)$topic_id); |
|
67 | + if (is_object($topicObject)) { |
|
68 | + $forum = $topicObject->getVar('forum_id'); |
|
69 | + } else { |
|
70 | + $redirect = XOOPS_URL . '/modules/newbb/viewtopic.php?topic_id=' . $topic_id; |
|
71 | + redirect_header($redirect, 2, _MD_NEWBB_FORUMNOEXIST); |
|
72 | + } |
|
73 | + unset($topicObject); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | if ($GLOBALS['xoopsModuleConfig']['wol_enabled']) { |
77 | - // /** @var Newbb\OnlineHandler $onlineHandler */ |
|
78 | - // $onlineHandler = Newbb\Helper::getInstance()->getHandler('Online'); |
|
79 | - $onlineHandler->init($forum); |
|
77 | + // /** @var Newbb\OnlineHandler $onlineHandler */ |
|
78 | + // $onlineHandler = Newbb\Helper::getInstance()->getHandler('Online'); |
|
79 | + $onlineHandler->init($forum); |
|
80 | 80 | } |
81 | 81 | // irmtfan add restore to viewtopic |
82 | 82 | $action_array = [ |
83 | - 'merge', |
|
84 | - 'delete', |
|
85 | - 'restore', |
|
86 | - 'move', |
|
87 | - 'lock', |
|
88 | - 'unlock', |
|
89 | - 'sticky', |
|
90 | - 'unsticky', |
|
91 | - 'digest', |
|
92 | - 'undigest' |
|
83 | + 'merge', |
|
84 | + 'delete', |
|
85 | + 'restore', |
|
86 | + 'move', |
|
87 | + 'lock', |
|
88 | + 'unlock', |
|
89 | + 'sticky', |
|
90 | + 'unsticky', |
|
91 | + 'digest', |
|
92 | + 'undigest' |
|
93 | 93 | ]; |
94 | 94 | foreach ($action_array as $_action) { |
95 | - $action[$_action] = [ |
|
96 | - 'name' => $_action, |
|
97 | - 'desc' => constant(strtoupper("_MD_NEWBB_DESC_{$_action}")), |
|
98 | - 'submit' => constant(strtoupper("_MD_NEWBB_{$_action}")), |
|
99 | - 'sql' => "topic_{$_action}=1", |
|
100 | - 'msg' => constant(strtoupper("_MD_NEWBB_TOPIC{$_action}")) |
|
101 | - ]; |
|
95 | + $action[$_action] = [ |
|
96 | + 'name' => $_action, |
|
97 | + 'desc' => constant(strtoupper("_MD_NEWBB_DESC_{$_action}")), |
|
98 | + 'submit' => constant(strtoupper("_MD_NEWBB_{$_action}")), |
|
99 | + 'sql' => "topic_{$_action}=1", |
|
100 | + 'msg' => constant(strtoupper("_MD_NEWBB_TOPIC{$_action}")) |
|
101 | + ]; |
|
102 | 102 | } |
103 | 103 | $action['lock']['sql'] = 'topic_status = 1'; |
104 | 104 | $action['unlock']['sql'] = 'topic_status = 0'; |
@@ -112,269 +112,269 @@ discard block |
||
112 | 112 | require_once $GLOBALS['xoops']->path('header.php'); |
113 | 113 | |
114 | 114 | if (Request::getString('submit', '', 'POST')) { |
115 | - $mode = Request::getString('mode', '', 'POST');// $_POST['mode']; |
|
115 | + $mode = Request::getString('mode', '', 'POST');// $_POST['mode']; |
|
116 | 116 | |
117 | - if ('delete' === $mode) { |
|
118 | - foreach ($topic_id as $tid) { |
|
119 | - $topicObject = $topicHandler->get($tid); |
|
120 | - $topicHandler->delete($topicObject, false); |
|
121 | - // irmtfan - sync topic after delete |
|
122 | - $topicHandler->synchronization($topicObject); |
|
123 | - $forumHandler->synchronization($forum); |
|
124 | - //$topicObject->loadFilters("delete"); |
|
125 | - //sync($topic_id, "topic"); |
|
126 | - //xoops_notification_deletebyitem ($xoopsModule->getVar('mid'), 'thread', $topic_id); |
|
127 | - } |
|
128 | - // irmtfan full URL |
|
129 | - echo $action[$mode]['msg'] . "<p><a href='" . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/viewforum.php?forum=$forum'>" . _MD_NEWBB_RETURNTOTHEFORUM . "</a></p><p><a href='index.php'>" . _MD_NEWBB_RETURNFORUMINDEX . '</a></p>'; |
|
130 | - } elseif ('restore' === $mode) { |
|
131 | - //$topicHandler = Newbb\Helper::getInstance()->getHandler('Topic'); |
|
132 | - $forums = []; |
|
133 | - $topicsObject = $topicHandler->getAll(new \Criteria('topic_id', '(' . implode(',', $topic_id) . ')', 'IN')); |
|
134 | - foreach (array_keys($topicsObject) as $id) { |
|
135 | - $topicObject = $topicsObject[$id]; |
|
136 | - $topicHandler->approve($topicObject); |
|
137 | - $topicHandler->synchronization($topicObject); |
|
138 | - $forums[$topicObject->getVar('forum_id')] = 1; |
|
139 | - } |
|
140 | - //irmtfan remove - no need to approve posts manually - see class/post.php approve function |
|
141 | - $criteria_forum = new \Criteria('forum_id', '(' . implode(',', array_keys($forums)) . ')', 'IN'); |
|
142 | - $forumsObject = $forumHandler->getAll($criteria_forum); |
|
143 | - foreach (array_keys($forumsObject) as $id) { |
|
144 | - $forumHandler->synchronization($forumsObject[$id]); |
|
145 | - } |
|
146 | - unset($topicsObject, $forumsObject); |
|
147 | - // irmtfan add restore to viewtopic |
|
148 | - $restoretopic_id = $topicObject->getVar('topic_id'); |
|
149 | - // irmtfan / missing in URL |
|
150 | - echo $action[$mode]['msg'] |
|
151 | - . "<p><a href='" |
|
152 | - . XOOPS_URL |
|
153 | - . '/modules/' |
|
154 | - . $xoopsModule->getVar('dirname') |
|
155 | - . "/viewtopic.php?topic_id=$restoretopic_id'>" |
|
156 | - . _MD_NEWBB_VIEWTHETOPIC |
|
157 | - . '</a></p>' |
|
158 | - . "<p><a href='" |
|
159 | - . XOOPS_URL |
|
160 | - . '/modules/' |
|
161 | - . $xoopsModule->getVar('dirname') |
|
162 | - . "/viewforum.php?forum=$forum'>" |
|
163 | - . _MD_NEWBB_RETURNTOTHEFORUM |
|
164 | - . '</a></p>' |
|
165 | - . "<p><a href='index.php'>" |
|
166 | - . _MD_NEWBB_RETURNFORUMINDEX |
|
167 | - . '</a></p>'; |
|
168 | - } elseif ('merge' === $mode) { |
|
169 | - // /** @var PostHandler $postHandler */ |
|
170 | - // $postHandler = Newbb\Helper::getInstance()->getHandler('Post'); |
|
171 | - // /** @var Newbb\RateHandler $rateHandler */ |
|
172 | - // $rateHandler = Newbb\Helper::getInstance()->getHandler('Rate'); |
|
117 | + if ('delete' === $mode) { |
|
118 | + foreach ($topic_id as $tid) { |
|
119 | + $topicObject = $topicHandler->get($tid); |
|
120 | + $topicHandler->delete($topicObject, false); |
|
121 | + // irmtfan - sync topic after delete |
|
122 | + $topicHandler->synchronization($topicObject); |
|
123 | + $forumHandler->synchronization($forum); |
|
124 | + //$topicObject->loadFilters("delete"); |
|
125 | + //sync($topic_id, "topic"); |
|
126 | + //xoops_notification_deletebyitem ($xoopsModule->getVar('mid'), 'thread', $topic_id); |
|
127 | + } |
|
128 | + // irmtfan full URL |
|
129 | + echo $action[$mode]['msg'] . "<p><a href='" . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/viewforum.php?forum=$forum'>" . _MD_NEWBB_RETURNTOTHEFORUM . "</a></p><p><a href='index.php'>" . _MD_NEWBB_RETURNFORUMINDEX . '</a></p>'; |
|
130 | + } elseif ('restore' === $mode) { |
|
131 | + //$topicHandler = Newbb\Helper::getInstance()->getHandler('Topic'); |
|
132 | + $forums = []; |
|
133 | + $topicsObject = $topicHandler->getAll(new \Criteria('topic_id', '(' . implode(',', $topic_id) . ')', 'IN')); |
|
134 | + foreach (array_keys($topicsObject) as $id) { |
|
135 | + $topicObject = $topicsObject[$id]; |
|
136 | + $topicHandler->approve($topicObject); |
|
137 | + $topicHandler->synchronization($topicObject); |
|
138 | + $forums[$topicObject->getVar('forum_id')] = 1; |
|
139 | + } |
|
140 | + //irmtfan remove - no need to approve posts manually - see class/post.php approve function |
|
141 | + $criteria_forum = new \Criteria('forum_id', '(' . implode(',', array_keys($forums)) . ')', 'IN'); |
|
142 | + $forumsObject = $forumHandler->getAll($criteria_forum); |
|
143 | + foreach (array_keys($forumsObject) as $id) { |
|
144 | + $forumHandler->synchronization($forumsObject[$id]); |
|
145 | + } |
|
146 | + unset($topicsObject, $forumsObject); |
|
147 | + // irmtfan add restore to viewtopic |
|
148 | + $restoretopic_id = $topicObject->getVar('topic_id'); |
|
149 | + // irmtfan / missing in URL |
|
150 | + echo $action[$mode]['msg'] |
|
151 | + . "<p><a href='" |
|
152 | + . XOOPS_URL |
|
153 | + . '/modules/' |
|
154 | + . $xoopsModule->getVar('dirname') |
|
155 | + . "/viewtopic.php?topic_id=$restoretopic_id'>" |
|
156 | + . _MD_NEWBB_VIEWTHETOPIC |
|
157 | + . '</a></p>' |
|
158 | + . "<p><a href='" |
|
159 | + . XOOPS_URL |
|
160 | + . '/modules/' |
|
161 | + . $xoopsModule->getVar('dirname') |
|
162 | + . "/viewforum.php?forum=$forum'>" |
|
163 | + . _MD_NEWBB_RETURNTOTHEFORUM |
|
164 | + . '</a></p>' |
|
165 | + . "<p><a href='index.php'>" |
|
166 | + . _MD_NEWBB_RETURNFORUMINDEX |
|
167 | + . '</a></p>'; |
|
168 | + } elseif ('merge' === $mode) { |
|
169 | + // /** @var PostHandler $postHandler */ |
|
170 | + // $postHandler = Newbb\Helper::getInstance()->getHandler('Post'); |
|
171 | + // /** @var Newbb\RateHandler $rateHandler */ |
|
172 | + // $rateHandler = Newbb\Helper::getInstance()->getHandler('Rate'); |
|
173 | 173 | |
174 | - foreach ($topic_id as $tid) { |
|
175 | - $topicObject = $topicHandler->get($tid); |
|
176 | - $newtopicObject = $topicHandler->get($newtopic); |
|
174 | + foreach ($topic_id as $tid) { |
|
175 | + $topicObject = $topicHandler->get($tid); |
|
176 | + $newtopicObject = $topicHandler->get($newtopic); |
|
177 | 177 | |
178 | - /* return false if destination topic is not existing */ |
|
179 | - // irmtfan bug fix: the old topic will be deleted if user input a not exist new topic |
|
180 | - if (!is_object($newtopicObject)) { |
|
181 | - $redirect = XOOPS_URL . '/modules/newbb/viewtopic.php?topic_id=' . $tid; |
|
182 | - redirect_header($redirect, 2, _MD_NEWBB_ERRORTOPIC); |
|
183 | - } |
|
184 | - $criteria_topic = new \Criteria('topic_id', $tid); |
|
185 | - $criteria = new \CriteriaCompo($criteria_topic); |
|
186 | - $criteria->add(new \Criteria('pid', 0)); |
|
187 | - // irmtfan OR change to this for less query?: |
|
188 | - // $postHandler->updateAll("pid", $newtopicObject->getVar("topic_last_post_id"), $criteria, true); |
|
189 | - $postHandler->updateAll('pid', $topicHandler->getTopPostId($newtopic), $criteria, true); |
|
190 | - $postHandler->updateAll('topic_id', $newtopic, $criteria_topic, true); |
|
191 | - // irmtfan update vote data instead of deleting them |
|
192 | - $rateHandler->updateAll('topic_id', $newtopic, $criteria_topic, true); |
|
178 | + /* return false if destination topic is not existing */ |
|
179 | + // irmtfan bug fix: the old topic will be deleted if user input a not exist new topic |
|
180 | + if (!is_object($newtopicObject)) { |
|
181 | + $redirect = XOOPS_URL . '/modules/newbb/viewtopic.php?topic_id=' . $tid; |
|
182 | + redirect_header($redirect, 2, _MD_NEWBB_ERRORTOPIC); |
|
183 | + } |
|
184 | + $criteria_topic = new \Criteria('topic_id', $tid); |
|
185 | + $criteria = new \CriteriaCompo($criteria_topic); |
|
186 | + $criteria->add(new \Criteria('pid', 0)); |
|
187 | + // irmtfan OR change to this for less query?: |
|
188 | + // $postHandler->updateAll("pid", $newtopicObject->getVar("topic_last_post_id"), $criteria, true); |
|
189 | + $postHandler->updateAll('pid', $topicHandler->getTopPostId($newtopic), $criteria, true); |
|
190 | + $postHandler->updateAll('topic_id', $newtopic, $criteria_topic, true); |
|
191 | + // irmtfan update vote data instead of deleting them |
|
192 | + $rateHandler->updateAll('topic_id', $newtopic, $criteria_topic, true); |
|
193 | 193 | |
194 | - $topic_views = $topicObject->getVar('topic_views') + $newtopicObject->getVar('topic_views'); |
|
195 | - // irmtfan better method to update topic_views in new topic |
|
196 | - //$criteria_newtopic = new \Criteria('topic_id', $newtopic); |
|
197 | - //$topicHandler->updateAll('topic_views', $topic_views, $criteria_newtopic, true); |
|
198 | - $newtopicObject->setVar('topic_views', $topic_views); |
|
199 | - // START irmtfan poll_module and rewrite the method |
|
200 | - // irmtfan only move poll in old topic to new topic if new topic has not a poll |
|
201 | - $poll_id = $topicObject->getVar('poll_id'); |
|
202 | - if ($poll_id > 0 && (0 == $newtopicObject->getVar('poll_id'))) { |
|
203 | - $newtopicObject->setVar('topic_haspoll', 1); |
|
204 | - $newtopicObject->setVar('poll_id', $poll_id); |
|
205 | - $poll_id = 0;// set to not delete the poll |
|
206 | - $topicObject->setVar('topic_haspoll', 0); // set to not delete the poll |
|
207 | - $topicObject->setVar('poll_id', 0);// set to not delete the poll |
|
208 | - } |
|
209 | - //update and sync newtopic after merge |
|
210 | - //$topicHandler->insert($newtopicObject, true); |
|
211 | - $topicHandler->synchronization($newtopicObject); // very important: only use object |
|
212 | - //sync newforum after merge |
|
213 | - $newforum = $newtopicObject->getVar('forum_id'); |
|
214 | - $forumHandler->synchronization($newforum); |
|
215 | - //hardcode remove force to delete old topic from database |
|
216 | - //$topicHandler->delete($topicObject,true); // cannot use this |
|
217 | - $topicHandler->deleteAll($criteria_topic, true); // $force = true |
|
218 | - //delete poll if old topic had a poll |
|
219 | - $topicObject->deletePoll($poll_id); |
|
220 | - //sync forum after delete old topic |
|
221 | - $forumHandler->synchronization($forum); |
|
222 | - // END irmtfan poll_module and rewrite the method |
|
223 | - } |
|
224 | - echo $action[$mode]['msg'] |
|
225 | - . // irmtfan full URL |
|
226 | - "<p><a href='" |
|
227 | - . XOOPS_URL |
|
228 | - . '/modules/' |
|
229 | - . $xoopsModule->getVar('dirname') |
|
230 | - . "/viewtopic.php?topic_id=$newtopic'>" |
|
231 | - . _MD_NEWBB_VIEWTHETOPIC |
|
232 | - . '</a></p>' |
|
233 | - . "<p><a href='" |
|
234 | - . XOOPS_URL |
|
235 | - . '/modules/' |
|
236 | - . $xoopsModule->getVar('dirname') |
|
237 | - . "/viewforum.php?forum=$forum'>" |
|
238 | - . _MD_NEWBB_RETURNTOTHEFORUM |
|
239 | - . '</a></p>' |
|
240 | - . "<p><a href='" |
|
241 | - . XOOPS_URL |
|
242 | - . '/modules/' |
|
243 | - . $xoopsModule->getVar('dirname') |
|
244 | - . "/index.php'>" |
|
245 | - . _MD_NEWBB_RETURNFORUMINDEX |
|
246 | - . '</a></p>'; |
|
247 | - } elseif ('move' === $mode) { |
|
248 | - if ($newforum > 0) { |
|
249 | - $topic_id = $topic_id[0]; |
|
250 | - $topicObject = $topicHandler->get($topic_id); |
|
251 | - $topicObject->loadFilters('update'); |
|
252 | - $topicObject->setVar('forum_id', $newforum, true); |
|
253 | - $topicHandler->insert($topicObject, true); |
|
254 | - $topicObject->loadFilters('update'); |
|
194 | + $topic_views = $topicObject->getVar('topic_views') + $newtopicObject->getVar('topic_views'); |
|
195 | + // irmtfan better method to update topic_views in new topic |
|
196 | + //$criteria_newtopic = new \Criteria('topic_id', $newtopic); |
|
197 | + //$topicHandler->updateAll('topic_views', $topic_views, $criteria_newtopic, true); |
|
198 | + $newtopicObject->setVar('topic_views', $topic_views); |
|
199 | + // START irmtfan poll_module and rewrite the method |
|
200 | + // irmtfan only move poll in old topic to new topic if new topic has not a poll |
|
201 | + $poll_id = $topicObject->getVar('poll_id'); |
|
202 | + if ($poll_id > 0 && (0 == $newtopicObject->getVar('poll_id'))) { |
|
203 | + $newtopicObject->setVar('topic_haspoll', 1); |
|
204 | + $newtopicObject->setVar('poll_id', $poll_id); |
|
205 | + $poll_id = 0;// set to not delete the poll |
|
206 | + $topicObject->setVar('topic_haspoll', 0); // set to not delete the poll |
|
207 | + $topicObject->setVar('poll_id', 0);// set to not delete the poll |
|
208 | + } |
|
209 | + //update and sync newtopic after merge |
|
210 | + //$topicHandler->insert($newtopicObject, true); |
|
211 | + $topicHandler->synchronization($newtopicObject); // very important: only use object |
|
212 | + //sync newforum after merge |
|
213 | + $newforum = $newtopicObject->getVar('forum_id'); |
|
214 | + $forumHandler->synchronization($newforum); |
|
215 | + //hardcode remove force to delete old topic from database |
|
216 | + //$topicHandler->delete($topicObject,true); // cannot use this |
|
217 | + $topicHandler->deleteAll($criteria_topic, true); // $force = true |
|
218 | + //delete poll if old topic had a poll |
|
219 | + $topicObject->deletePoll($poll_id); |
|
220 | + //sync forum after delete old topic |
|
221 | + $forumHandler->synchronization($forum); |
|
222 | + // END irmtfan poll_module and rewrite the method |
|
223 | + } |
|
224 | + echo $action[$mode]['msg'] |
|
225 | + . // irmtfan full URL |
|
226 | + "<p><a href='" |
|
227 | + . XOOPS_URL |
|
228 | + . '/modules/' |
|
229 | + . $xoopsModule->getVar('dirname') |
|
230 | + . "/viewtopic.php?topic_id=$newtopic'>" |
|
231 | + . _MD_NEWBB_VIEWTHETOPIC |
|
232 | + . '</a></p>' |
|
233 | + . "<p><a href='" |
|
234 | + . XOOPS_URL |
|
235 | + . '/modules/' |
|
236 | + . $xoopsModule->getVar('dirname') |
|
237 | + . "/viewforum.php?forum=$forum'>" |
|
238 | + . _MD_NEWBB_RETURNTOTHEFORUM |
|
239 | + . '</a></p>' |
|
240 | + . "<p><a href='" |
|
241 | + . XOOPS_URL |
|
242 | + . '/modules/' |
|
243 | + . $xoopsModule->getVar('dirname') |
|
244 | + . "/index.php'>" |
|
245 | + . _MD_NEWBB_RETURNFORUMINDEX |
|
246 | + . '</a></p>'; |
|
247 | + } elseif ('move' === $mode) { |
|
248 | + if ($newforum > 0) { |
|
249 | + $topic_id = $topic_id[0]; |
|
250 | + $topicObject = $topicHandler->get($topic_id); |
|
251 | + $topicObject->loadFilters('update'); |
|
252 | + $topicObject->setVar('forum_id', $newforum, true); |
|
253 | + $topicHandler->insert($topicObject, true); |
|
254 | + $topicObject->loadFilters('update'); |
|
255 | 255 | |
256 | - $sql = sprintf('UPDATE "%s" SET forum_id = "%u" WHERE topic_id = "%u"', $GLOBALS['xoopsDB']->prefix('newbb_posts'), $newforum, $topic_id); |
|
257 | - if (!$r = $GLOBALS['xoopsDB']->query($sql)) { |
|
258 | - return false; |
|
259 | - } |
|
260 | - $forumHandler->synchronization($forum); |
|
261 | - $forumHandler->synchronization($newforum); |
|
262 | - // irmtfan full URL |
|
263 | - echo $action[$mode]['msg'] |
|
264 | - . "<p><a href='" |
|
265 | - . XOOPS_URL |
|
266 | - . '/modules/' |
|
267 | - . $xoopsModule->getVar('dirname') |
|
268 | - . "/viewtopic.php?topic_id=$topic_id&forum=$newforum'>" |
|
269 | - . _MD_NEWBB_GOTONEWFORUM |
|
270 | - . "</a></p><p><a href='" |
|
271 | - . XOOPS_URL |
|
272 | - . "/modules/newbb/index.php'>" |
|
273 | - . _MD_NEWBB_RETURNFORUMINDEX |
|
274 | - . '</a></p>'; |
|
275 | - } else { |
|
276 | - // irmtfan - issue with javascript:history.go(-1) |
|
277 | - redirect_header(Request::getString('HTTP_REFERER', '', 'SERVER'), 2, _MD_NEWBB_ERRORFORUM); |
|
278 | - } |
|
279 | - } else { |
|
280 | - $topic_id = $topic_id[0]; |
|
281 | - $forum = $topicHandler->get($topic_id, 'forum_id'); |
|
282 | - $forum_new = !empty($newtopic) ? $topicHandler->get($newtopic, 'forum_id') : 0; |
|
256 | + $sql = sprintf('UPDATE "%s" SET forum_id = "%u" WHERE topic_id = "%u"', $GLOBALS['xoopsDB']->prefix('newbb_posts'), $newforum, $topic_id); |
|
257 | + if (!$r = $GLOBALS['xoopsDB']->query($sql)) { |
|
258 | + return false; |
|
259 | + } |
|
260 | + $forumHandler->synchronization($forum); |
|
261 | + $forumHandler->synchronization($newforum); |
|
262 | + // irmtfan full URL |
|
263 | + echo $action[$mode]['msg'] |
|
264 | + . "<p><a href='" |
|
265 | + . XOOPS_URL |
|
266 | + . '/modules/' |
|
267 | + . $xoopsModule->getVar('dirname') |
|
268 | + . "/viewtopic.php?topic_id=$topic_id&forum=$newforum'>" |
|
269 | + . _MD_NEWBB_GOTONEWFORUM |
|
270 | + . "</a></p><p><a href='" |
|
271 | + . XOOPS_URL |
|
272 | + . "/modules/newbb/index.php'>" |
|
273 | + . _MD_NEWBB_RETURNFORUMINDEX |
|
274 | + . '</a></p>'; |
|
275 | + } else { |
|
276 | + // irmtfan - issue with javascript:history.go(-1) |
|
277 | + redirect_header(Request::getString('HTTP_REFERER', '', 'SERVER'), 2, _MD_NEWBB_ERRORFORUM); |
|
278 | + } |
|
279 | + } else { |
|
280 | + $topic_id = $topic_id[0]; |
|
281 | + $forum = $topicHandler->get($topic_id, 'forum_id'); |
|
282 | + $forum_new = !empty($newtopic) ? $topicHandler->get($newtopic, 'forum_id') : 0; |
|
283 | 283 | |
284 | - if (!$forumHandler->getPermission($forum, 'moderate') |
|
285 | - || (!empty($forum_new) |
|
286 | - && !$forumHandler->getPermission($forum_new, 'reply')) // The forum for the topic to be merged to |
|
287 | - || (!empty($newforum) && !$forumHandler->getPermission($newforum, 'post')) // The forum to be moved to |
|
288 | - ) { |
|
289 | - redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?forum=$forum&topic_id=$topic_id", 2, _NOPERM); |
|
290 | - } |
|
284 | + if (!$forumHandler->getPermission($forum, 'moderate') |
|
285 | + || (!empty($forum_new) |
|
286 | + && !$forumHandler->getPermission($forum_new, 'reply')) // The forum for the topic to be merged to |
|
287 | + || (!empty($newforum) && !$forumHandler->getPermission($newforum, 'post')) // The forum to be moved to |
|
288 | + ) { |
|
289 | + redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?forum=$forum&topic_id=$topic_id", 2, _NOPERM); |
|
290 | + } |
|
291 | 291 | |
292 | - if (!empty($action[$mode]['sql'])) { |
|
293 | - $sql = sprintf('UPDATE `%s` SET ' . $action[$mode]['sql'] . ' WHERE topic_id = %u', $GLOBALS['xoopsDB']->prefix('newbb_topics'), $topic_id); |
|
294 | - if (!$r = $GLOBALS['xoopsDB']->query($sql)) { |
|
295 | - redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?forum=$forum&topic_id=$topic_id&order=$order&viewmode=$viewmode", 2, _MD_NEWBB_ERROR_BACK . '<br>sql: ' . $sql); |
|
296 | - } |
|
297 | - } else { |
|
298 | - redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?forum=$forum&topic_id=$topic_id", 2, _MD_NEWBB_ERROR_BACK); |
|
299 | - } |
|
300 | - if ('digest' === $mode && $GLOBALS['xoopsDB']->getAffectedRows()) { |
|
301 | - $topicObject = $topicHandler->get($topic_id); |
|
302 | - // /** @var Newbb\StatsHandler $statsHandler */ |
|
303 | - // $statsHandler = Newbb\Helper::getInstance()->getHandler('Stats'); |
|
304 | - $statsHandler->update($topicObject->getVar('forum_id'), 'digest'); |
|
305 | - // /** @var Newbb\UserstatsHandler $userstatsHandler */ |
|
306 | - // $userstatsHandler = Newbb\Helper::getInstance()->getHandler('Userstats'); |
|
307 | - if ($user_stat = $userstatsHandler->get($topicObject->getVar('topic_poster'))) { |
|
308 | - $z = $user_stat->getVar('user_digests') + 1; |
|
309 | - $user_stat->setVar('user_digests', (int)$z); |
|
310 | - $userstatsHandler->insert($user_stat); |
|
311 | - } |
|
312 | - } |
|
313 | - // irmtfan full URL |
|
314 | - echo $action[$mode]['msg'] |
|
315 | - . "<p><a href='" |
|
316 | - . XOOPS_URL |
|
317 | - . '/modules/' |
|
318 | - . $xoopsModule->getVar('dirname') |
|
319 | - . "/viewtopic.php?topic_id=$topic_id&forum=$forum'>" |
|
320 | - . _MD_NEWBB_VIEWTHETOPIC |
|
321 | - . "</a></p><p><a href='" |
|
322 | - . XOOPS_URL |
|
323 | - . "/modules/newbb/viewforum.php?forum=$forum'>" |
|
324 | - . _MD_NEWBB_RETURNFORUMINDEX |
|
325 | - . '</a></p>'; |
|
326 | - } |
|
292 | + if (!empty($action[$mode]['sql'])) { |
|
293 | + $sql = sprintf('UPDATE `%s` SET ' . $action[$mode]['sql'] . ' WHERE topic_id = %u', $GLOBALS['xoopsDB']->prefix('newbb_topics'), $topic_id); |
|
294 | + if (!$r = $GLOBALS['xoopsDB']->query($sql)) { |
|
295 | + redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?forum=$forum&topic_id=$topic_id&order=$order&viewmode=$viewmode", 2, _MD_NEWBB_ERROR_BACK . '<br>sql: ' . $sql); |
|
296 | + } |
|
297 | + } else { |
|
298 | + redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?forum=$forum&topic_id=$topic_id", 2, _MD_NEWBB_ERROR_BACK); |
|
299 | + } |
|
300 | + if ('digest' === $mode && $GLOBALS['xoopsDB']->getAffectedRows()) { |
|
301 | + $topicObject = $topicHandler->get($topic_id); |
|
302 | + // /** @var Newbb\StatsHandler $statsHandler */ |
|
303 | + // $statsHandler = Newbb\Helper::getInstance()->getHandler('Stats'); |
|
304 | + $statsHandler->update($topicObject->getVar('forum_id'), 'digest'); |
|
305 | + // /** @var Newbb\UserstatsHandler $userstatsHandler */ |
|
306 | + // $userstatsHandler = Newbb\Helper::getInstance()->getHandler('Userstats'); |
|
307 | + if ($user_stat = $userstatsHandler->get($topicObject->getVar('topic_poster'))) { |
|
308 | + $z = $user_stat->getVar('user_digests') + 1; |
|
309 | + $user_stat->setVar('user_digests', (int)$z); |
|
310 | + $userstatsHandler->insert($user_stat); |
|
311 | + } |
|
312 | + } |
|
313 | + // irmtfan full URL |
|
314 | + echo $action[$mode]['msg'] |
|
315 | + . "<p><a href='" |
|
316 | + . XOOPS_URL |
|
317 | + . '/modules/' |
|
318 | + . $xoopsModule->getVar('dirname') |
|
319 | + . "/viewtopic.php?topic_id=$topic_id&forum=$forum'>" |
|
320 | + . _MD_NEWBB_VIEWTHETOPIC |
|
321 | + . "</a></p><p><a href='" |
|
322 | + . XOOPS_URL |
|
323 | + . "/modules/newbb/viewforum.php?forum=$forum'>" |
|
324 | + . _MD_NEWBB_RETURNFORUMINDEX |
|
325 | + . '</a></p>'; |
|
326 | + } |
|
327 | 327 | } else { // No submit |
328 | - $mode = Request::getString('mode', '', 'GET'); //$_GET['mode']; |
|
329 | - echo "<form action='" . Request::getString('PHP_SELF', '', 'SERVER') . "' method='post'>"; |
|
330 | - echo "<table border='0' cellpadding='1' cellspacing='0' align='center' width='95%'>"; |
|
331 | - echo "<tr><td class='bg2'>"; |
|
332 | - echo "<table border='0' cellpadding='1' cellspacing='1' width='100%'>"; |
|
333 | - echo "<tr class='bg3' align='left'>"; |
|
334 | - echo "<td colspan='2' align='center'>" . $action[$mode]['desc'] . '</td></tr>'; |
|
328 | + $mode = Request::getString('mode', '', 'GET'); //$_GET['mode']; |
|
329 | + echo "<form action='" . Request::getString('PHP_SELF', '', 'SERVER') . "' method='post'>"; |
|
330 | + echo "<table border='0' cellpadding='1' cellspacing='0' align='center' width='95%'>"; |
|
331 | + echo "<tr><td class='bg2'>"; |
|
332 | + echo "<table border='0' cellpadding='1' cellspacing='1' width='100%'>"; |
|
333 | + echo "<tr class='bg3' align='left'>"; |
|
334 | + echo "<td colspan='2' align='center'>" . $action[$mode]['desc'] . '</td></tr>'; |
|
335 | 335 | |
336 | - if ('move' === $mode) { |
|
337 | - echo '<tr><td class="bg3">' . _MD_NEWBB_MOVETOPICTO . '</td><td class="bg1">'; |
|
338 | - $box = '<select name="newforum" size="1">'; |
|
336 | + if ('move' === $mode) { |
|
337 | + echo '<tr><td class="bg3">' . _MD_NEWBB_MOVETOPICTO . '</td><td class="bg1">'; |
|
338 | + $box = '<select name="newforum" size="1">'; |
|
339 | 339 | |
340 | - // /** @var Newbb\CategoryHandler $categoryHandler */ |
|
341 | - // $categoryHandler = Newbb\Helper::getInstance()->getHandler('Category'); |
|
342 | - $categories = $categoryHandler->getByPermission('access'); |
|
343 | - $forums = $forumHandler->getForumsByCategory(array_keys($categories), 'post', false); |
|
340 | + // /** @var Newbb\CategoryHandler $categoryHandler */ |
|
341 | + // $categoryHandler = Newbb\Helper::getInstance()->getHandler('Category'); |
|
342 | + $categories = $categoryHandler->getByPermission('access'); |
|
343 | + $forums = $forumHandler->getForumsByCategory(array_keys($categories), 'post', false); |
|
344 | 344 | |
345 | - if (count($categories) > 0 && count($forums) > 0) { |
|
346 | - foreach (array_keys($forums) as $key) { |
|
347 | - /** @var Newbb\Category[] $categories */ |
|
348 | - $box .= "<option value='-1'>[" . $categories[$key]->getVar('cat_title') . ']</option>'; |
|
349 | - foreach ($forums[$key] as $forumid => $_forum) { |
|
350 | - $box .= "<option value='" . $forumid . "'>-- " . $_forum['title'] . '</option>'; |
|
351 | - if (!isset($_forum['sub'])) { |
|
352 | - continue; |
|
353 | - } |
|
354 | - foreach (array_keys($_forum['sub']) as $fid) { |
|
355 | - $box .= "<option value='" . $fid . "'>---- " . $_forum['sub'][$fid]['title'] . '</option>'; |
|
356 | - } |
|
357 | - } |
|
358 | - } |
|
359 | - } else { |
|
360 | - $box .= "<option value='-1'>" . _MD_NEWBB_NOFORUMINDB . '</option>'; |
|
361 | - } |
|
362 | - unset($forums, $categories); |
|
345 | + if (count($categories) > 0 && count($forums) > 0) { |
|
346 | + foreach (array_keys($forums) as $key) { |
|
347 | + /** @var Newbb\Category[] $categories */ |
|
348 | + $box .= "<option value='-1'>[" . $categories[$key]->getVar('cat_title') . ']</option>'; |
|
349 | + foreach ($forums[$key] as $forumid => $_forum) { |
|
350 | + $box .= "<option value='" . $forumid . "'>-- " . $_forum['title'] . '</option>'; |
|
351 | + if (!isset($_forum['sub'])) { |
|
352 | + continue; |
|
353 | + } |
|
354 | + foreach (array_keys($_forum['sub']) as $fid) { |
|
355 | + $box .= "<option value='" . $fid . "'>---- " . $_forum['sub'][$fid]['title'] . '</option>'; |
|
356 | + } |
|
357 | + } |
|
358 | + } |
|
359 | + } else { |
|
360 | + $box .= "<option value='-1'>" . _MD_NEWBB_NOFORUMINDB . '</option>'; |
|
361 | + } |
|
362 | + unset($forums, $categories); |
|
363 | 363 | |
364 | - echo $box; |
|
365 | - echo '</select></td></tr>'; |
|
366 | - } |
|
367 | - if ('merge' === $mode) { |
|
368 | - echo '<tr><td class="bg3">' . _MD_NEWBB_MERGETOPICTO . '</td><td class="bg1">'; |
|
369 | - echo _MD_NEWBB_TOPIC . " ID-$topic_id -> ID: <input name='newtopic' value='' />"; |
|
370 | - echo '</td></tr>'; |
|
371 | - } |
|
372 | - echo '<tr class="bg3"><td colspan="2" align="center">'; |
|
373 | - echo "<input type='hidden' name='mode' value='" . $action[$mode]['name'] . "' />"; |
|
374 | - echo "<input type='hidden' name='topic_id' value='" . $topic_id . "' />"; |
|
375 | - echo "<input type='hidden' name='forum' value='" . $forum . "' />"; |
|
376 | - echo "<input type='submit' name='submit' value='" . $action[$mode]['submit'] . "' />"; |
|
377 | - echo '</td></tr></form></table></td></tr></table>'; |
|
364 | + echo $box; |
|
365 | + echo '</select></td></tr>'; |
|
366 | + } |
|
367 | + if ('merge' === $mode) { |
|
368 | + echo '<tr><td class="bg3">' . _MD_NEWBB_MERGETOPICTO . '</td><td class="bg1">'; |
|
369 | + echo _MD_NEWBB_TOPIC . " ID-$topic_id -> ID: <input name='newtopic' value='' />"; |
|
370 | + echo '</td></tr>'; |
|
371 | + } |
|
372 | + echo '<tr class="bg3"><td colspan="2" align="center">'; |
|
373 | + echo "<input type='hidden' name='mode' value='" . $action[$mode]['name'] . "' />"; |
|
374 | + echo "<input type='hidden' name='topic_id' value='" . $topic_id . "' />"; |
|
375 | + echo "<input type='hidden' name='forum' value='" . $forum . "' />"; |
|
376 | + echo "<input type='submit' name='submit' value='" . $action[$mode]['submit'] . "' />"; |
|
377 | + echo '</td></tr></form></table></td></tr></table>'; |
|
378 | 378 | } |
379 | 379 | // irmtfan move to footer.php |
380 | 380 | require_once __DIR__ . '/footer.php'; |
@@ -32,27 +32,27 @@ discard block |
||
32 | 32 | // URL: https://xoops.org // |
33 | 33 | // Project: Article Project // |
34 | 34 | // ------------------------------------------------------------------------ // |
35 | -require_once __DIR__ . '/header.php'; |
|
35 | +require_once __DIR__.'/header.php'; |
|
36 | 36 | |
37 | 37 | if (Request::getString('submit', '', 'POST')) { |
38 | 38 | foreach (['forum', 'newforum', 'newtopic'] as $getint) { |
39 | - ${$getint} = Request::getInt($getint, 0, 'POST');// (int)(@$_POST[$getint]); |
|
39 | + ${$getint} = Request::getInt($getint, 0, 'POST'); // (int)(@$_POST[$getint]); |
|
40 | 40 | } |
41 | 41 | foreach (['topic_id'] as $getint) { |
42 | - ${$getint} = Request::getInt($getint, 0, 'POST');// (int)(@$_POST[$getint]); |
|
42 | + ${$getint} = Request::getInt($getint, 0, 'POST'); // (int)(@$_POST[$getint]); |
|
43 | 43 | } |
44 | 44 | if (!is_array($topic_id)) { |
45 | 45 | $topic_id = [$topic_id]; |
46 | 46 | } |
47 | 47 | } else { |
48 | 48 | foreach (['forum', 'topic_id'] as $getint) { |
49 | - ${$getint} = Request::getInt($getint, 0, 'GET');// (int)(@$_GET[$getint]); |
|
49 | + ${$getint} = Request::getInt($getint, 0, 'GET'); // (int)(@$_GET[$getint]); |
|
50 | 50 | } |
51 | 51 | } |
52 | 52 | |
53 | 53 | if (empty($topic_id)) { |
54 | 54 | $redirect = empty($forum_id) ? 'index.php' : 'viewforum.php?forum={$forum}'; |
55 | - $redirect = XOOPS_URL . '/modules/newbb/' . $redirect; |
|
55 | + $redirect = XOOPS_URL.'/modules/newbb/'.$redirect; |
|
56 | 56 | redirect_header($redirect, 2, _MD_NEWBB_ERRORTOPIC); |
57 | 57 | } |
58 | 58 | |
@@ -63,11 +63,11 @@ discard block |
||
63 | 63 | |
64 | 64 | if (!$forum) { |
65 | 65 | /** @var Newbb\Topic $topicObject */ |
66 | - $topicObject = $topicHandler->get((int)$topic_id); |
|
66 | + $topicObject = $topicHandler->get((int) $topic_id); |
|
67 | 67 | if (is_object($topicObject)) { |
68 | 68 | $forum = $topicObject->getVar('forum_id'); |
69 | 69 | } else { |
70 | - $redirect = XOOPS_URL . '/modules/newbb/viewtopic.php?topic_id=' . $topic_id; |
|
70 | + $redirect = XOOPS_URL.'/modules/newbb/viewtopic.php?topic_id='.$topic_id; |
|
71 | 71 | redirect_header($redirect, 2, _MD_NEWBB_FORUMNOEXIST); |
72 | 72 | } |
73 | 73 | unset($topicObject); |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | $action['unlock']['sql'] = 'topic_status = 0'; |
105 | 105 | $action['unsticky']['sql'] = 'topic_sticky = 0'; |
106 | 106 | $action['undigest']['sql'] = 'topic_digest = 0'; |
107 | -$action['digest']['sql'] = 'topic_digest = 1, digest_time = ' . time(); |
|
107 | +$action['digest']['sql'] = 'topic_digest = 1, digest_time = '.time(); |
|
108 | 108 | |
109 | 109 | // Disable cache |
110 | 110 | $GLOBALS['xoopsConfig']['module_cache'][$xoopsModule->getVar('mid')] = 0; |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | require_once $GLOBALS['xoops']->path('header.php'); |
113 | 113 | |
114 | 114 | if (Request::getString('submit', '', 'POST')) { |
115 | - $mode = Request::getString('mode', '', 'POST');// $_POST['mode']; |
|
115 | + $mode = Request::getString('mode', '', 'POST'); // $_POST['mode']; |
|
116 | 116 | |
117 | 117 | if ('delete' === $mode) { |
118 | 118 | foreach ($topic_id as $tid) { |
@@ -126,11 +126,11 @@ discard block |
||
126 | 126 | //xoops_notification_deletebyitem ($xoopsModule->getVar('mid'), 'thread', $topic_id); |
127 | 127 | } |
128 | 128 | // irmtfan full URL |
129 | - echo $action[$mode]['msg'] . "<p><a href='" . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/viewforum.php?forum=$forum'>" . _MD_NEWBB_RETURNTOTHEFORUM . "</a></p><p><a href='index.php'>" . _MD_NEWBB_RETURNFORUMINDEX . '</a></p>'; |
|
129 | + echo $action[$mode]['msg']."<p><a href='".XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/viewforum.php?forum=$forum'>"._MD_NEWBB_RETURNTOTHEFORUM."</a></p><p><a href='index.php'>"._MD_NEWBB_RETURNFORUMINDEX.'</a></p>'; |
|
130 | 130 | } elseif ('restore' === $mode) { |
131 | 131 | //$topicHandler = Newbb\Helper::getInstance()->getHandler('Topic'); |
132 | 132 | $forums = []; |
133 | - $topicsObject = $topicHandler->getAll(new \Criteria('topic_id', '(' . implode(',', $topic_id) . ')', 'IN')); |
|
133 | + $topicsObject = $topicHandler->getAll(new \Criteria('topic_id', '('.implode(',', $topic_id).')', 'IN')); |
|
134 | 134 | foreach (array_keys($topicsObject) as $id) { |
135 | 135 | $topicObject = $topicsObject[$id]; |
136 | 136 | $topicHandler->approve($topicObject); |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | $forums[$topicObject->getVar('forum_id')] = 1; |
139 | 139 | } |
140 | 140 | //irmtfan remove - no need to approve posts manually - see class/post.php approve function |
141 | - $criteria_forum = new \Criteria('forum_id', '(' . implode(',', array_keys($forums)) . ')', 'IN'); |
|
141 | + $criteria_forum = new \Criteria('forum_id', '('.implode(',', array_keys($forums)).')', 'IN'); |
|
142 | 142 | $forumsObject = $forumHandler->getAll($criteria_forum); |
143 | 143 | foreach (array_keys($forumsObject) as $id) { |
144 | 144 | $forumHandler->synchronization($forumsObject[$id]); |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | /* return false if destination topic is not existing */ |
179 | 179 | // irmtfan bug fix: the old topic will be deleted if user input a not exist new topic |
180 | 180 | if (!is_object($newtopicObject)) { |
181 | - $redirect = XOOPS_URL . '/modules/newbb/viewtopic.php?topic_id=' . $tid; |
|
181 | + $redirect = XOOPS_URL.'/modules/newbb/viewtopic.php?topic_id='.$tid; |
|
182 | 182 | redirect_header($redirect, 2, _MD_NEWBB_ERRORTOPIC); |
183 | 183 | } |
184 | 184 | $criteria_topic = new \Criteria('topic_id', $tid); |
@@ -202,9 +202,9 @@ discard block |
||
202 | 202 | if ($poll_id > 0 && (0 == $newtopicObject->getVar('poll_id'))) { |
203 | 203 | $newtopicObject->setVar('topic_haspoll', 1); |
204 | 204 | $newtopicObject->setVar('poll_id', $poll_id); |
205 | - $poll_id = 0;// set to not delete the poll |
|
205 | + $poll_id = 0; // set to not delete the poll |
|
206 | 206 | $topicObject->setVar('topic_haspoll', 0); // set to not delete the poll |
207 | - $topicObject->setVar('poll_id', 0);// set to not delete the poll |
|
207 | + $topicObject->setVar('poll_id', 0); // set to not delete the poll |
|
208 | 208 | } |
209 | 209 | //update and sync newtopic after merge |
210 | 210 | //$topicHandler->insert($newtopicObject, true); |
@@ -286,16 +286,16 @@ discard block |
||
286 | 286 | && !$forumHandler->getPermission($forum_new, 'reply')) // The forum for the topic to be merged to |
287 | 287 | || (!empty($newforum) && !$forumHandler->getPermission($newforum, 'post')) // The forum to be moved to |
288 | 288 | ) { |
289 | - redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?forum=$forum&topic_id=$topic_id", 2, _NOPERM); |
|
289 | + redirect_header(XOOPS_URL."/modules/newbb/viewtopic.php?forum=$forum&topic_id=$topic_id", 2, _NOPERM); |
|
290 | 290 | } |
291 | 291 | |
292 | 292 | if (!empty($action[$mode]['sql'])) { |
293 | - $sql = sprintf('UPDATE `%s` SET ' . $action[$mode]['sql'] . ' WHERE topic_id = %u', $GLOBALS['xoopsDB']->prefix('newbb_topics'), $topic_id); |
|
293 | + $sql = sprintf('UPDATE `%s` SET '.$action[$mode]['sql'].' WHERE topic_id = %u', $GLOBALS['xoopsDB']->prefix('newbb_topics'), $topic_id); |
|
294 | 294 | if (!$r = $GLOBALS['xoopsDB']->query($sql)) { |
295 | - redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?forum=$forum&topic_id=$topic_id&order=$order&viewmode=$viewmode", 2, _MD_NEWBB_ERROR_BACK . '<br>sql: ' . $sql); |
|
295 | + redirect_header(XOOPS_URL."/modules/newbb/viewtopic.php?forum=$forum&topic_id=$topic_id&order=$order&viewmode=$viewmode", 2, _MD_NEWBB_ERROR_BACK.'<br>sql: '.$sql); |
|
296 | 296 | } |
297 | 297 | } else { |
298 | - redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?forum=$forum&topic_id=$topic_id", 2, _MD_NEWBB_ERROR_BACK); |
|
298 | + redirect_header(XOOPS_URL."/modules/newbb/viewtopic.php?forum=$forum&topic_id=$topic_id", 2, _MD_NEWBB_ERROR_BACK); |
|
299 | 299 | } |
300 | 300 | if ('digest' === $mode && $GLOBALS['xoopsDB']->getAffectedRows()) { |
301 | 301 | $topicObject = $topicHandler->get($topic_id); |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | // $userstatsHandler = Newbb\Helper::getInstance()->getHandler('Userstats'); |
307 | 307 | if ($user_stat = $userstatsHandler->get($topicObject->getVar('topic_poster'))) { |
308 | 308 | $z = $user_stat->getVar('user_digests') + 1; |
309 | - $user_stat->setVar('user_digests', (int)$z); |
|
309 | + $user_stat->setVar('user_digests', (int) $z); |
|
310 | 310 | $userstatsHandler->insert($user_stat); |
311 | 311 | } |
312 | 312 | } |
@@ -326,15 +326,15 @@ discard block |
||
326 | 326 | } |
327 | 327 | } else { // No submit |
328 | 328 | $mode = Request::getString('mode', '', 'GET'); //$_GET['mode']; |
329 | - echo "<form action='" . Request::getString('PHP_SELF', '', 'SERVER') . "' method='post'>"; |
|
329 | + echo "<form action='".Request::getString('PHP_SELF', '', 'SERVER')."' method='post'>"; |
|
330 | 330 | echo "<table border='0' cellpadding='1' cellspacing='0' align='center' width='95%'>"; |
331 | 331 | echo "<tr><td class='bg2'>"; |
332 | 332 | echo "<table border='0' cellpadding='1' cellspacing='1' width='100%'>"; |
333 | 333 | echo "<tr class='bg3' align='left'>"; |
334 | - echo "<td colspan='2' align='center'>" . $action[$mode]['desc'] . '</td></tr>'; |
|
334 | + echo "<td colspan='2' align='center'>".$action[$mode]['desc'].'</td></tr>'; |
|
335 | 335 | |
336 | 336 | if ('move' === $mode) { |
337 | - echo '<tr><td class="bg3">' . _MD_NEWBB_MOVETOPICTO . '</td><td class="bg1">'; |
|
337 | + echo '<tr><td class="bg3">'._MD_NEWBB_MOVETOPICTO.'</td><td class="bg1">'; |
|
338 | 338 | $box = '<select name="newforum" size="1">'; |
339 | 339 | |
340 | 340 | // /** @var Newbb\CategoryHandler $categoryHandler */ |
@@ -345,19 +345,19 @@ discard block |
||
345 | 345 | if (count($categories) > 0 && count($forums) > 0) { |
346 | 346 | foreach (array_keys($forums) as $key) { |
347 | 347 | /** @var Newbb\Category[] $categories */ |
348 | - $box .= "<option value='-1'>[" . $categories[$key]->getVar('cat_title') . ']</option>'; |
|
348 | + $box .= "<option value='-1'>[".$categories[$key]->getVar('cat_title').']</option>'; |
|
349 | 349 | foreach ($forums[$key] as $forumid => $_forum) { |
350 | - $box .= "<option value='" . $forumid . "'>-- " . $_forum['title'] . '</option>'; |
|
350 | + $box .= "<option value='".$forumid."'>-- ".$_forum['title'].'</option>'; |
|
351 | 351 | if (!isset($_forum['sub'])) { |
352 | 352 | continue; |
353 | 353 | } |
354 | 354 | foreach (array_keys($_forum['sub']) as $fid) { |
355 | - $box .= "<option value='" . $fid . "'>---- " . $_forum['sub'][$fid]['title'] . '</option>'; |
|
355 | + $box .= "<option value='".$fid."'>---- ".$_forum['sub'][$fid]['title'].'</option>'; |
|
356 | 356 | } |
357 | 357 | } |
358 | 358 | } |
359 | 359 | } else { |
360 | - $box .= "<option value='-1'>" . _MD_NEWBB_NOFORUMINDB . '</option>'; |
|
360 | + $box .= "<option value='-1'>"._MD_NEWBB_NOFORUMINDB.'</option>'; |
|
361 | 361 | } |
362 | 362 | unset($forums, $categories); |
363 | 363 | |
@@ -365,17 +365,17 @@ discard block |
||
365 | 365 | echo '</select></td></tr>'; |
366 | 366 | } |
367 | 367 | if ('merge' === $mode) { |
368 | - echo '<tr><td class="bg3">' . _MD_NEWBB_MERGETOPICTO . '</td><td class="bg1">'; |
|
369 | - echo _MD_NEWBB_TOPIC . " ID-$topic_id -> ID: <input name='newtopic' value='' />"; |
|
368 | + echo '<tr><td class="bg3">'._MD_NEWBB_MERGETOPICTO.'</td><td class="bg1">'; |
|
369 | + echo _MD_NEWBB_TOPIC." ID-$topic_id -> ID: <input name='newtopic' value='' />"; |
|
370 | 370 | echo '</td></tr>'; |
371 | 371 | } |
372 | 372 | echo '<tr class="bg3"><td colspan="2" align="center">'; |
373 | - echo "<input type='hidden' name='mode' value='" . $action[$mode]['name'] . "' />"; |
|
374 | - echo "<input type='hidden' name='topic_id' value='" . $topic_id . "' />"; |
|
375 | - echo "<input type='hidden' name='forum' value='" . $forum . "' />"; |
|
376 | - echo "<input type='submit' name='submit' value='" . $action[$mode]['submit'] . "' />"; |
|
373 | + echo "<input type='hidden' name='mode' value='".$action[$mode]['name']."' />"; |
|
374 | + echo "<input type='hidden' name='topic_id' value='".$topic_id."' />"; |
|
375 | + echo "<input type='hidden' name='forum' value='".$forum."' />"; |
|
376 | + echo "<input type='submit' name='submit' value='".$action[$mode]['submit']."' />"; |
|
377 | 377 | echo '</td></tr></form></table></td></tr></table>'; |
378 | 378 | } |
379 | 379 | // irmtfan move to footer.php |
380 | -require_once __DIR__ . '/footer.php'; |
|
380 | +require_once __DIR__.'/footer.php'; |
|
381 | 381 | require_once $GLOBALS['xoops']->path('footer.php'); |
@@ -28,5 +28,5 @@ |
||
28 | 28 | // URL: http://www.myweb.ne.jp/, https://xoops.org/, http://jp.xoops.org/ // |
29 | 29 | // Project: XOOPS Project // |
30 | 30 | // ------------------------------------------------------------------------- // |
31 | -require_once dirname(dirname(__DIR__)) . '/mainfile.php'; |
|
31 | +require_once dirname(dirname(__DIR__)).'/mainfile.php'; |
|
32 | 32 | require_once $GLOBALS['xoops']->path('include/notification_update.php'); |