Passed
Push — master ( 492cc7...e5a5fc )
by Michael
45s queued 11s
created
class/IconHandler.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -94,23 +94,23 @@  discard block
 block discarded – undo
94 94
     public function getPath($type, $dirname = 'newbb', $default = '', $endDir = 'images')
95 95
     {
96 96
         static $paths;
97
-        if (isset($paths[$endDir . '/' . $type])) {
98
-            return $paths[$endDir . '/' . $type];
97
+        if (isset($paths[$endDir.'/'.$type])) {
98
+            return $paths[$endDir.'/'.$type];
99 99
         }
100 100
 
101 101
         $theme_path = $this->template->currentTheme->path;
102 102
         $rel_dir    = "modules/{$dirname}/{$endDir}";
103 103
         // START irmtfan add default for all pathes
104 104
         if (empty($default)) {
105
-            $path = is_dir($theme_path . "/{$rel_dir}/{$type}/") ? $theme_path . "/{$rel_dir}/{$type}"
106
-                : (is_dir(XOOPS_THEME_PATH . "/default/{$rel_dir}/{$type}/") ? XOOPS_THEME_PATH . "/default/{$rel_dir}/{$type}"
105
+            $path = is_dir($theme_path."/{$rel_dir}/{$type}/") ? $theme_path."/{$rel_dir}/{$type}"
106
+                : (is_dir(XOOPS_THEME_PATH."/default/{$rel_dir}/{$type}/") ? XOOPS_THEME_PATH . "/default/{$rel_dir}/{$type}"
107 107
                 : $GLOBALS['xoops']->path("modules/{$dirname}/templates/{$endDir}/{$type}"));
108 108
         } else {
109
-            $path = is_dir($theme_path . "/{$rel_dir}/{$type}/") ? $theme_path . "/{$rel_dir}/{$type}" : (
110
-                is_dir($theme_path . "/{$rel_dir}/{$default}/") ? $theme_path . "/{$rel_dir}/{$default}" : (
111
-                is_dir(XOOPS_THEME_PATH . "/default/{$rel_dir}/{$type}/") ? XOOPS_THEME_PATH
109
+            $path = is_dir($theme_path."/{$rel_dir}/{$type}/") ? $theme_path."/{$rel_dir}/{$type}" : (
110
+                is_dir($theme_path."/{$rel_dir}/{$default}/") ? $theme_path."/{$rel_dir}/{$default}" : (
111
+                is_dir(XOOPS_THEME_PATH."/default/{$rel_dir}/{$type}/") ? XOOPS_THEME_PATH
112 112
                  . "/default/{$rel_dir}/{$type}" : (
113
-                     is_dir(XOOPS_THEME_PATH . "/default/{$rel_dir}/{$default}/") ? XOOPS_THEME_PATH . "/default/{$rel_dir}/{$default}"
113
+                     is_dir(XOOPS_THEME_PATH."/default/{$rel_dir}/{$default}/") ? XOOPS_THEME_PATH . "/default/{$rel_dir}/{$default}"
114 114
                     : (is_dir($GLOBALS['xoops']->path("modules/{$dirname}/templates/{$endDir}/{$type}/")) ? $GLOBALS['xoops']->path("modules/{$dirname}/templates/{$endDir}/{$type}")
115 115
                     : $GLOBALS['xoops']->path("modules/{$dirname}/templates/{$endDir}/{$default}")) // XOOPS_ROOT_PATH
116 116
             ) // XOOPS_THEME_PATH {$default}
@@ -118,9 +118,9 @@  discard block
 block discarded – undo
118 118
             ); // $theme_path {$default}
119 119
         }
120 120
         // END irmtfan add default for all pathes
121
-        $paths[$endDir . '/' . $type] = str_replace(XOOPS_ROOT_PATH, '', str_replace('\\', '/', $path));
121
+        $paths[$endDir.'/'.$type] = str_replace(XOOPS_ROOT_PATH, '', str_replace('\\', '/', $path));
122 122
 
123
-        return $paths[$endDir . '/' . $type];
123
+        return $paths[$endDir.'/'.$type];
124 124
     }
125 125
 
126 126
     // END irmtfan - improve to get other "end dirnames" like "css" and "js" - change images with $endDir
@@ -135,8 +135,8 @@  discard block
 block discarded – undo
135 135
     ) {
136 136
         $this->forumImage = require_once $GLOBALS['xoops']->path("modules/{$dirname}/include/images.php");
137 137
 
138
-        $this->forumImage['icon']     = XOOPS_URL . $this->getPath('icon', $dirname) . '/';
139
-        $this->forumImage['language'] = XOOPS_URL . $this->getPath("language/{$language}", $dirname, 'language/english') . '/';
138
+        $this->forumImage['icon']     = XOOPS_URL.$this->getPath('icon', $dirname).'/';
139
+        $this->forumImage['language'] = XOOPS_URL.$this->getPath("language/{$language}", $dirname, 'language/english').'/';
140 140
     }
141 141
 
142 142
     /**
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
      */
161 161
     public function getImageSource($image)
162 162
     {
163
-        return $this->forumImage[$this->forumImage[$image]] . $this->prefix . $image . $this->postfix;
163
+        return $this->forumImage[$this->forumImage[$image]].$this->prefix.$image.$this->postfix;
164 164
     }
165 165
 
166 166
     /**
Please login to merge, or discard this patch.
viewforum.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -11,12 +11,12 @@  discard block
 block discarded – undo
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 (!Request::getInt('forum', 0, '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
-require_once __DIR__ . '/include/functions.read.php';
19
+require_once __DIR__.'/include/functions.read.php';
20 20
 
21 21
 /*
22 22
  * Build the page query
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 $query_array = [];
26 26
 foreach ($query_vars as $var) {
27 27
     if (Request::getString($var, '', 'GET')) {
28
-        $query_array[$var] = "{$var}=" . Request::getString($var, '', 'GET');
28
+        $query_array[$var] = "{$var}=".Request::getString($var, '', 'GET');
29 29
     }
30 30
 }
31 31
 $page_query = implode('&', array_values($query_array));
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
         $markresult = _MD_NEWBB_MARK_UNREAD;
40 40
     }
41 41
     newbbSetReadTopic($markvalue, Request::getInt('forum', 0, 'GET'));
42
-    $url = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewforum.php?' . $page_query;
43
-    redirect_header($url, 2, _MD_NEWBB_ALL_TOPIC_MARKED . ' ' . $markresult);
42
+    $url = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/viewforum.php?'.$page_query;
43
+    redirect_header($url, 2, _MD_NEWBB_ALL_TOPIC_MARKED.' '.$markresult);
44 44
 }
45 45
 
46 46
 $forum_id = Request::getInt('forum', 0, 'GET');
@@ -67,25 +67,25 @@  discard block
 block discarded – undo
67 67
 $forumObject = $forumHandler->get($forum_id);
68 68
 
69 69
 if (!$forumObject) {
70
-    redirect_header(XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/index.php', 2, _MD_NEWBB_ERRORFORUM);
70
+    redirect_header(XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/index.php', 2, _MD_NEWBB_ERRORFORUM);
71 71
 }
72 72
 
73 73
 if (!$forumHandler->getPermission($forumObject)) {
74
-    redirect_header(XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/index.php', 2, _NOPERM);
74
+    redirect_header(XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/index.php', 2, _NOPERM);
75 75
 }
76 76
 newbbSetRead('forum', $forum_id, $forumObject->getVar('forum_last_post_id'));
77 77
 
78
-$xoops_pagetitle = $forumObject->getVar('forum_name') . ' [' . $xoopsModule->getVar('name') . ']';
78
+$xoops_pagetitle = $forumObject->getVar('forum_name').' ['.$xoopsModule->getVar('name').']';
79 79
 
80 80
 $xoopsOption['template_main']   = 'newbb_viewforum.tpl';
81 81
 $xoopsOption['xoops_pagetitle'] = $xoops_pagetitle;
82 82
 
83 83
 require_once $GLOBALS['xoops']->path('header.php');
84
-require_once __DIR__ . '/include/functions.render.php';
84
+require_once __DIR__.'/include/functions.render.php';
85 85
 
86 86
 if (!empty($GLOBALS['xoopsModuleConfig']['rss_enable'])) {
87 87
     $xoopsTpl->assign('xoops_module_header', '
88
-    <link rel="alternate" type="application/xml+rss" title="' . $xoopsModule->getVar('name') . '-' . $forumObject->getVar('forum_name') . '" href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/rss.php?f=' . $forum_id . '" />
88
+    <link rel="alternate" type="application/xml+rss" title="' . $xoopsModule->getVar('name').'-'.$forumObject->getVar('forum_name').'" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/rss.php?f='.$forum_id.'" />
89 89
     ' . @$xoopsTpl->get_template_vars('xoops_module_header'));
90 90
 }
91 91
 $forumDescription = $forumObject->getVar('forum_desc');
@@ -119,16 +119,16 @@  discard block
 block discarded – undo
119 119
 
120 120
 if ($forumHandler->getPermission($forumObject, 'post')) {
121 121
     $xoopsTpl->assign('viewer_level', $isAdmin ? 2 : 1);
122
-    $xoopsTpl->assign('forum_post_or_register', '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/newtopic.php?forum={$forum_id}\">" . newbbDisplayImage('t_new', _MD_NEWBB_POSTNEW) . '</a>');
122
+    $xoopsTpl->assign('forum_post_or_register', '<a href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/newtopic.php?forum={$forum_id}\">".newbbDisplayImage('t_new', _MD_NEWBB_POSTNEW).'</a>');
123 123
     if ($pollmodules && $forumHandler->getPermission($forumObject, 'addpoll')) {
124 124
         $t_poll = newbbDisplayImage('t_poll', _MD_NEWBB_ADDPOLL);
125
-        $xoopsTpl->assign('forum_addpoll', '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/polls.php?op=add&amp;forum={$forum_id}\">{$t_poll}</a>");
125
+        $xoopsTpl->assign('forum_addpoll', '<a href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/polls.php?op=add&amp;forum={$forum_id}\">{$t_poll}</a>");
126 126
     }
127 127
 } else {
128 128
     $xoopsTpl->assign('viewer_level', 0);
129 129
     if (!is_object($GLOBALS['xoopsUser']) && !empty($GLOBALS['xoopsModuleConfig']['show_reg'])) {
130
-        $redirect = preg_replace("|(.*)\/modules\/Newbb\/(.*)|", "\\1/modules/newbb/newtopic.php?forum=" . $forum_id, htmlspecialchars($xoopsRequestUri, ENT_QUOTES | ENT_HTML5));
131
-        $xoopsTpl->assign('forum_post_or_register', "<a href='" . XOOPS_URL . "/user.php?xoops_redirect={$redirect}'>" . _MD_NEWBB_REGTOPOST . '</a>');
130
+        $redirect = preg_replace("|(.*)\/modules\/Newbb\/(.*)|", "\\1/modules/newbb/newtopic.php?forum=".$forum_id, htmlspecialchars($xoopsRequestUri, ENT_QUOTES | ENT_HTML5));
131
+        $xoopsTpl->assign('forum_post_or_register', "<a href='".XOOPS_URL."/user.php?xoops_redirect={$redirect}'>"._MD_NEWBB_REGTOPOST.'</a>');
132 132
         $xoopsTpl->assign('forum_addpoll', '');
133 133
     } else {
134 134
         $xoopsTpl->assign('forum_post_or_register', '');
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 $xoopsTpl->assign_by_ref('parentforum', $parentforum);
140 140
 
141 141
 $criteria = new \CriteriaCompo(new \Criteria('parent_forum', $forum_id));
142
-$criteria->add(new \Criteria('forum_id', '(' . implode(', ', $forumHandler->getIdsByPermission('access')) . ')', 'IN'));
142
+$criteria->add(new \Criteria('forum_id', '('.implode(', ', $forumHandler->getIdsByPermission('access')).')', 'IN'));
143 143
 $criteria->setSort('forum_order');
144 144
 
145 145
 if ($forums = $forumHandler->getAll($criteria, null, false)) {
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 
176 176
 $forum_selection_sort = '<select name="sort">';
177 177
 foreach ($sel_sort_array as $sort_k => $sort_v) {
178
-    $forum_selection_sort .= '<option value="' . $sort_k . '"' . (($sort == $sort_k) ? ' selected="selected"' : '') . '>' . $sort_v . '</option>';
178
+    $forum_selection_sort .= '<option value="'.$sort_k.'"'.(($sort == $sort_k) ? ' selected="selected"' : '').'>'.$sort_v.'</option>';
179 179
 }
180 180
 $forum_selection_sort .= '</select>';
181 181
 
@@ -184,14 +184,14 @@  discard block
 block discarded – undo
184 184
 $order                 = (!Request::getString('order', '', 'GET')
185 185
                           || 'ASC' !== Request::getString('order', '', 'GET')) ? 'DESC' : 'ASC';
186 186
 $forum_selection_order = '<select name="order">';
187
-$forum_selection_order .= '<option value="ASC"' . (('ASC' === $order) ? ' selected' : '') . '>' . _MD_NEWBB_ASCENDING . '</option>';
188
-$forum_selection_order .= '<option value="DESC"' . (('DESC' === $order) ? ' selected' : '') . '>' . _MD_NEWBB_DESCENDING . '</option>';
187
+$forum_selection_order .= '<option value="ASC"'.(('ASC' === $order) ? ' selected' : '').'>'._MD_NEWBB_ASCENDING.'</option>';
188
+$forum_selection_order .= '<option value="DESC"'.(('DESC' === $order) ? ' selected' : '').'>'._MD_NEWBB_DESCENDING.'</option>';
189 189
 $forum_selection_order .= '</select>';
190 190
 
191 191
 $xoopsTpl->assign_by_ref('forum_selection_order', $forum_selection_order);
192 192
 
193 193
 $since = Request::getInt('since', $GLOBALS['xoopsModuleConfig']['since_default'], 'GET');
194
-require_once __DIR__ . '/include/functions.time.php';
194
+require_once __DIR__.'/include/functions.time.php';
195 195
 $forum_selection_since = newbbSinceSelectBox($since);
196 196
 $xoopsTpl->assign_by_ref('forum_selection_since', $forum_selection_since);
197 197
 
@@ -200,14 +200,14 @@  discard block
 block discarded – undo
200 200
 $page_query_sort = implode('&amp;', array_values($query_sort));
201 201
 unset($query_sort);
202 202
 // irmtfan - edit: u.uname => t.topic_poster | t.topic_time => t.topic_id | p.post_time => t.topic_last_post_id
203
-$xoopsTpl->assign('h_topic_link', XOOPS_URL . "/modules/newbb/viewforum.php?{$page_query_sort}&amp;sort=t.topic_title&amp;order=" . (('t.topic_title' === $sort && 'DESC' === $order) ? 'ASC' : 'DESC'));
204
-$xoopsTpl->assign('h_reply_link', XOOPS_URL . "/modules/newbb/viewforum.php?{$page_query_sort}&amp;sort=t.topic_replies&amp;order=" . (('t.topic_replies' === $sort && 'DESC' === $order) ? 'ASC' : 'DESC'));
205
-$xoopsTpl->assign('h_poster_link', XOOPS_URL . "/modules/newbb/viewforum.php?{$page_query_sort}&amp;sort=t.topic_poster&amp;order=" . (('t.topic_poster' === $sort && 'DESC' === $order) ? 'ASC' : 'DESC'));
206
-$xoopsTpl->assign('h_views_link', XOOPS_URL . "/modules/newbb/viewforum.php?{$page_query_sort}&amp;sort=t.topic_views&amp;order=" . (('t.topic_views' === $sort && 'DESC' === $order) ? 'ASC' : 'DESC'));
207
-$xoopsTpl->assign('h_rating_link', XOOPS_URL . "/modules/newbb/viewforum.php?{$page_query_sort}&amp;sort=t.rating&amp;order=" . (('t.rating' === $sort
203
+$xoopsTpl->assign('h_topic_link', XOOPS_URL."/modules/newbb/viewforum.php?{$page_query_sort}&amp;sort=t.topic_title&amp;order=".(('t.topic_title' === $sort && 'DESC' === $order) ? 'ASC' : 'DESC'));
204
+$xoopsTpl->assign('h_reply_link', XOOPS_URL."/modules/newbb/viewforum.php?{$page_query_sort}&amp;sort=t.topic_replies&amp;order=".(('t.topic_replies' === $sort && 'DESC' === $order) ? 'ASC' : 'DESC'));
205
+$xoopsTpl->assign('h_poster_link', XOOPS_URL."/modules/newbb/viewforum.php?{$page_query_sort}&amp;sort=t.topic_poster&amp;order=".(('t.topic_poster' === $sort && 'DESC' === $order) ? 'ASC' : 'DESC'));
206
+$xoopsTpl->assign('h_views_link', XOOPS_URL."/modules/newbb/viewforum.php?{$page_query_sort}&amp;sort=t.topic_views&amp;order=".(('t.topic_views' === $sort && 'DESC' === $order) ? 'ASC' : 'DESC'));
207
+$xoopsTpl->assign('h_rating_link', XOOPS_URL."/modules/newbb/viewforum.php?{$page_query_sort}&amp;sort=t.rating&amp;order=".(('t.rating' === $sort
208 208
                                                                                                                                   && 'DESC' === $order) ? 'ASC' : 'DESC')); // irmtfan t.topic_ratings to t.rating
209
-$xoopsTpl->assign('h_date_link', XOOPS_URL . "/modules/newbb/viewforum.php?{$page_query_sort}&amp;sort=t.topic_last_post_id&amp;order=" . (('t.topic_last_post_id' === $sort && 'DESC' === $order) ? 'ASC' : 'DESC'));
210
-$xoopsTpl->assign('h_publish_link', XOOPS_URL . "/modules/newbb/viewforum.php?{$page_query_sort}&amp;sort=t.topic_id&amp;order=" . (('t.topic_id' === $sort
209
+$xoopsTpl->assign('h_date_link', XOOPS_URL."/modules/newbb/viewforum.php?{$page_query_sort}&amp;sort=t.topic_last_post_id&amp;order=".(('t.topic_last_post_id' === $sort && 'DESC' === $order) ? 'ASC' : 'DESC'));
210
+$xoopsTpl->assign('h_publish_link', XOOPS_URL."/modules/newbb/viewforum.php?{$page_query_sort}&amp;sort=t.topic_id&amp;order=".(('t.topic_id' === $sort
211 211
                                                                                                                                      && 'DESC' === $order) ? 'ASC' : 'DESC'));
212 212
 $xoopsTpl->assign('forum_since', $since); // For $since in search.php
213 213
 
@@ -237,11 +237,11 @@  discard block
 block discarded – undo
237 237
 $xoopsTpl->assign('img_digest', newbbDisplayImage('topic_digest', _MD_NEWBB_TOPICDIGEST));
238 238
 $xoopsTpl->assign('img_poll', newbbDisplayImage('poll', _MD_NEWBB_TOPICHASPOLL));
239 239
 
240
-$xoopsTpl->assign('mark_read', XOOPS_URL . "/modules/newbb/viewforum.php?mark=1&amp;{$page_query}");
241
-$xoopsTpl->assign('mark_unread', XOOPS_URL . "/modules/newbb/viewforum.php?mark=2&amp;{$page_query}");
240
+$xoopsTpl->assign('mark_read', XOOPS_URL."/modules/newbb/viewforum.php?mark=1&amp;{$page_query}");
241
+$xoopsTpl->assign('mark_unread', XOOPS_URL."/modules/newbb/viewforum.php?mark=2&amp;{$page_query}");
242 242
 
243
-$xoopsTpl->assign('post_link', XOOPS_URL . '/modules/newbb/viewpost.php?forum=' . $forum_id);
244
-$xoopsTpl->assign('newpost_link', XOOPS_URL . '/modules/newbb/viewpost.php?status=new&amp;forum=' . $forum_id);
243
+$xoopsTpl->assign('post_link', XOOPS_URL.'/modules/newbb/viewpost.php?forum='.$forum_id);
244
+$xoopsTpl->assign('newpost_link', XOOPS_URL.'/modules/newbb/viewpost.php?status=new&amp;forum='.$forum_id);
245 245
 
246 246
 $query_type = $query_array;
247 247
 unset($query_type['type']);
@@ -252,16 +252,16 @@  discard block
 block discarded – undo
252 252
 $typeOptions = null;
253 253
 $types       = [];
254 254
 if ($types = $typeHandler->getByForum($forum_id)) {
255
-    $typeOptions[] = ['title' => _ALL, 'link' => XOOPS_URL . "/modules/newbb/viewforum.php?{$page_query_type}"];
255
+    $typeOptions[] = ['title' => _ALL, 'link' => XOOPS_URL."/modules/newbb/viewforum.php?{$page_query_type}"];
256 256
     foreach ($types as $key => $item) {
257 257
         $typeOptions[] = [
258 258
             'title' => $item['type_name'],
259
-            'link'  => XOOPS_URL . "/modules/newbb/viewforum.php?{$page_query_type}&amp;type={$key}"
259
+            'link'  => XOOPS_URL."/modules/newbb/viewforum.php?{$page_query_type}&amp;type={$key}"
260 260
         ];
261 261
     }
262 262
 }
263 263
 if ($type > 0) {
264
-    require_once __DIR__ . '/include/functions.topic.php';
264
+    require_once __DIR__.'/include/functions.topic.php';
265 265
     $xoopsTpl->assign('forum_topictype', getTopicTitle('', $types[$type]['type_name'], $types[$type]['type_color']));
266 266
 }
267 267
 $xoopsTpl->assign_by_ref('typeOptions', $typeOptions);
@@ -270,11 +270,11 @@  discard block
 block discarded – undo
270 270
 unset($query_status['status']);
271 271
 $page_query_status = implode('&amp;', array_values($query_status));
272 272
 unset($query_status);
273
-$xoopsTpl->assign('newpost_link', XOOPS_URL . '/modules/newbb/viewpost.php?status=new&amp;forum=' . $forumObject->getVar('forum_id'));
274
-$xoopsTpl->assign('all_link', XOOPS_URL . "/modules/newbb/viewforum.php?{$page_query_status}");
275
-$xoopsTpl->assign('digest_link', XOOPS_URL . "/modules/newbb/viewforum.php?{$page_query_status}&amp;status=digest");
276
-$xoopsTpl->assign('unreplied_link', XOOPS_URL . "/modules/newbb/viewforum.php?{$page_query_status}&amp;status=unreplied");
277
-$xoopsTpl->assign('unread_link', XOOPS_URL . "/modules/newbb/viewforum.php?{$page_query_status}&amp;status=unread");
273
+$xoopsTpl->assign('newpost_link', XOOPS_URL.'/modules/newbb/viewpost.php?status=new&amp;forum='.$forumObject->getVar('forum_id'));
274
+$xoopsTpl->assign('all_link', XOOPS_URL."/modules/newbb/viewforum.php?{$page_query_status}");
275
+$xoopsTpl->assign('digest_link', XOOPS_URL."/modules/newbb/viewforum.php?{$page_query_status}&amp;status=digest");
276
+$xoopsTpl->assign('unreplied_link', XOOPS_URL."/modules/newbb/viewforum.php?{$page_query_status}&amp;status=unreplied");
277
+$xoopsTpl->assign('unread_link', XOOPS_URL."/modules/newbb/viewforum.php?{$page_query_status}&amp;status=unread");
278 278
 switch ($status) {
279 279
     case 'digest':
280 280
         $current_status = _MD_NEWBB_DIGEST;
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 }
323 323
 
324 324
 if (!empty($GLOBALS['xoopsModuleConfig']['show_jump'])) {
325
-    require_once __DIR__ . '/include/functions.forum.php';
325
+    require_once __DIR__.'/include/functions.forum.php';
326 326
     $xoopsTpl->assign('forum_jumpbox', newbbMakeJumpbox($forum_id));
327 327
 }
328 328
 
@@ -335,8 +335,8 @@  discard block
 block discarded – undo
335 335
 }
336 336
 
337 337
 if (1 == $GLOBALS['xoopsModuleConfig']['rss_enable']) {
338
-    $xoopsTpl->assign('rss_button', "<div align='right'><a href='" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/rss.php?f=' . $forum_id . "' title='RSS feed' target='_blank'>" . newbbDisplayImage('rss', 'RSS feed') . '</a></div>');
338
+    $xoopsTpl->assign('rss_button', "<div align='right'><a href='".XOOPS_URL.'/modules/'.$xoopsModule->dirname().'/rss.php?f='.$forum_id."' title='RSS feed' target='_blank'>".newbbDisplayImage('rss', 'RSS feed').'</a></div>');
339 339
 }
340 340
 // irmtfan move to footer.php
341
-require_once __DIR__ . '/footer.php';
341
+require_once __DIR__.'/footer.php';
342 342
 require_once $GLOBALS['xoops']->path('footer.php');
Please login to merge, or discard this patch.
view.tag.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,5 +8,5 @@
 block discarded – undo
8 8
  * @since          4.00
9 9
  * @package        module::newbb
10 10
  */
11
-require_once __DIR__ . '/header.php';
11
+require_once __DIR__.'/header.php';
12 12
 require_once $GLOBALS['xoops']->path('modules/tag/view.tag.php');
Please login to merge, or discard this patch.
delete.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
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
 $ok = Request::getInt('ok', 0, 'POST');
17 17
 
@@ -43,15 +43,15 @@  discard block
 block discarded – undo
43 43
 }
44 44
 $topic_id = $topic->getVar('topic_id');
45 45
 if (!$topic_id) {
46
-    $redirect = empty($forum) ? 'index.php' : 'viewforum.php?forum=' . $forum;
47
-    $redirect = XOOPS_URL . '/modules/newbb/' . $redirect;
46
+    $redirect = empty($forum) ? 'index.php' : 'viewforum.php?forum='.$forum;
47
+    $redirect = XOOPS_URL.'/modules/newbb/'.$redirect;
48 48
     redirect_header($redirect, 2, _MD_NEWBB_ERRORTOPIC);
49 49
 }
50 50
 
51 51
 $forum       = $topic->getVar('forum_id');
52 52
 $forumObject = $forumHandler->get($forum);
53 53
 if (!$forumHandler->getPermission($forumObject)) {
54
-    redirect_header(XOOPS_URL . '/index.php', 2, _MD_NEWBB_NORIGHTTOACCESS);
54
+    redirect_header(XOOPS_URL.'/index.php', 2, _MD_NEWBB_NORIGHTTOACCESS);
55 55
 }
56 56
 
57 57
 $isAdmin = newbbIsAdmin($forumObject);
@@ -62,11 +62,11 @@  discard block
 block discarded – undo
62 62
 $topic_status = $topic->getVar('topic_status');
63 63
 if (($postObject->checkIdentity() || $isAdmin) && $topicHandler->getPermission($topic->getVar('forum_id'), $topic_status, 'delete')) {
64 64
 } else {
65
-    redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?topic_id=$topic_id&amp;pid=$pid&amp;forum=$forum", 2, _MD_NEWBB_DELNOTALLOWED);
65
+    redirect_header(XOOPS_URL."/modules/newbb/viewtopic.php?topic_id=$topic_id&amp;pid=$pid&amp;forum=$forum", 2, _MD_NEWBB_DELNOTALLOWED);
66 66
 }
67 67
 
68 68
 if (!$isAdmin && !$postObject->checkTimelimit('delete_timelimit')) {
69
-    redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?forum=$forum&amp;topic_id=$topic_id&amp;post_id=$post_id&amp;pid=$pid", 2, _MD_NEWBB_TIMEISUPDEL);
69
+    redirect_header(XOOPS_URL."/modules/newbb/viewtopic.php?forum=$forum&amp;topic_id=$topic_id&amp;post_id=$post_id&amp;pid=$pid", 2, _MD_NEWBB_TIMEISUPDEL);
70 70
 }
71 71
 
72 72
 if ($GLOBALS['xoopsModuleConfig']['wol_enabled']) {
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     }
83 83
     if ($isDeleteOne && $postObject->isTopic() && $topic->getVar('topic_replies') > 0) {
84 84
         //$postHandler->emptyTopic($postObject);
85
-        redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?topic_id=$topic_id&amp;pid=$pid&amp;forum=$forum", 2, _MD_NEWBB_POSTFIRSTWITHREPLYNODELETED);
85
+        redirect_header(XOOPS_URL."/modules/newbb/viewtopic.php?topic_id=$topic_id&amp;pid=$pid&amp;forum=$forum", 2, _MD_NEWBB_POSTFIRSTWITHREPLYNODELETED);
86 86
     } else {
87 87
         if (Request::getString('post_text', '', 'POST')) {
88 88
             //send a message
@@ -101,11 +101,11 @@  discard block
 block discarded – undo
101 101
                 $xoopsMailer->setToUsers($senduser);
102 102
                 $xoopsMailer->setFromName($GLOBALS['xoopsUser']->getVar('uname'));
103 103
                 $xoopsMailer->setSubject(_MD_NEWBB_DELEDEDMSG_SUBJECT);
104
-                $forenurl = '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewtopic.php?topic_id=' . $postObject->getVar('topic_id') . '">' . $postObject->getVar('subject') . '</a>';
104
+                $forenurl = '<a href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/viewtopic.php?topic_id='.$postObject->getVar('topic_id').'">'.$postObject->getVar('subject').'</a>';
105 105
                 if (!empty($GLOBALS['xoopsModuleConfig']['do_rewrite'])) {
106 106
                     $forenurl = seo_urls($forenurl);
107 107
                 }
108
-                $body = sprintf(_MD_NEWBB_DELEDEDMSG_BODY, $senduser->getVar('uname'), $forenurl, Request::getString('post_text', '', 'POST'), $GLOBALS['xoopsUser']->getVar('uname'), $GLOBALS['xoopsConfig']['sitename'], XOOPS_URL . '/');
108
+                $body = sprintf(_MD_NEWBB_DELEDEDMSG_BODY, $senduser->getVar('uname'), $forenurl, Request::getString('post_text', '', 'POST'), $GLOBALS['xoopsUser']->getVar('uname'), $GLOBALS['xoopsConfig']['sitename'], XOOPS_URL.'/');
109 109
                 $body = $myts->nl2Br($body);
110 110
                 $xoopsMailer->setBody($body);
111 111
                 $xoopsMailer->send();
@@ -121,25 +121,25 @@  discard block
 block discarded – undo
121 121
 
122 122
     //$postObject->loadFilters('delete');
123 123
     if ($isDeleteOne) {
124
-        redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?topic_id=$topic_id&amp;order=$order&amp;viewmode=$viewmode&amp;pid=$pid&amp;forum=$forum", 2, _MD_NEWBB_POSTDELETED);
124
+        redirect_header(XOOPS_URL."/modules/newbb/viewtopic.php?topic_id=$topic_id&amp;order=$order&amp;viewmode=$viewmode&amp;pid=$pid&amp;forum=$forum", 2, _MD_NEWBB_POSTDELETED);
125 125
     } else {
126
-        redirect_header(XOOPS_URL . "/modules/newbb/viewforum.php?forum=$forum", 2, _MD_NEWBB_POSTSDELETED);
126
+        redirect_header(XOOPS_URL."/modules/newbb/viewforum.php?forum=$forum", 2, _MD_NEWBB_POSTSDELETED);
127 127
     }
128 128
 } else {
129 129
     require_once $GLOBALS['xoops']->path('header.php');
130 130
     //xoops_confirm(array('post_id' => $post_id, 'viewmode' => $viewmode, 'order' => $order, 'forum' => $forum, 'topic_id' => $topic_id, 'ok' => 1), 'delete.php', _MD_NEWBB_DEL_ONE);
131
-    echo '<div class="confirmMsg">' . _MD_NEWBB_DEL_ONE . '<br>
132
-          <form method="post" action="' . XOOPS_URL . '/modules/newbb/delete.php">';
133
-    echo _MD_NEWBB_DELEDEDMSG . '<br>';
131
+    echo '<div class="confirmMsg">'._MD_NEWBB_DEL_ONE.'<br>
132
+          <form method="post" action="' . XOOPS_URL.'/modules/newbb/delete.php">';
133
+    echo _MD_NEWBB_DELEDEDMSG.'<br>';
134 134
     echo '<textarea name="post_text" cols="50" rows="5"></textarea><br>';
135
-    echo '<input type="hidden" name="post_id" value="' . htmlspecialchars($post_id, ENT_QUOTES | ENT_HTML5) . '" />';
136
-    echo '<input type="hidden" name="order" value="' . htmlspecialchars($order, ENT_QUOTES | ENT_HTML5) . '" />';
137
-    echo '<input type="hidden" name="forum" value="' . htmlspecialchars($forum, ENT_QUOTES | ENT_HTML5) . '" />';
138
-    echo '<input type="hidden" name="topic_id" value="' . htmlspecialchars($topic_id, ENT_QUOTES | ENT_HTML5) . '" />';
135
+    echo '<input type="hidden" name="post_id" value="'.htmlspecialchars($post_id, ENT_QUOTES | ENT_HTML5).'" />';
136
+    echo '<input type="hidden" name="order" value="'.htmlspecialchars($order, ENT_QUOTES | ENT_HTML5).'" />';
137
+    echo '<input type="hidden" name="forum" value="'.htmlspecialchars($forum, ENT_QUOTES | ENT_HTML5).'" />';
138
+    echo '<input type="hidden" name="topic_id" value="'.htmlspecialchars($topic_id, ENT_QUOTES | ENT_HTML5).'" />';
139 139
     echo '<input type="hidden" name="ok" value="1" />';
140 140
     echo $GLOBALS['xoopsSecurity']->getTokenHTML();
141
-    echo '<input type="submit" name="confirm_submit" value="' . _SUBMIT . '" title="' . _SUBMIT . '"/>
142
-          <input type="button" name="confirm_back" value="' . _CANCEL . '" onclick="history.go(-1);" title="' . _CANCEL . '" />
141
+    echo '<input type="submit" name="confirm_submit" value="'._SUBMIT.'" title="'._SUBMIT.'"/>
142
+          <input type="button" name="confirm_back" value="' . _CANCEL.'" onclick="history.go(-1);" title="'._CANCEL.'" />
143 143
           </form>
144 144
           </div>';
145 145
     if ($isAdmin) {
Please login to merge, or discard this patch.
polls.php 1 patch
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 
24 24
 // rewrite by irmtfan and zyspec to accept xoopspoll 1.4 and all old xoopspoll and umfrage versions and all clones
25 25
 
26
-require_once __DIR__ . '/header.php';
26
+require_once __DIR__.'/header.php';
27 27
 require_once $GLOBALS['xoops']->path('class/xoopsformloader.php');
28 28
 require_once $GLOBALS['xoops']->path('class/xoopslists.php');
29 29
 require_once $GLOBALS['xoops']->path('class/xoopsblock.php');
@@ -56,18 +56,18 @@  discard block
 block discarded – undo
56 56
 if (is_object($topicObject)) {
57 57
     $forum_id = $topicObject->getVar('forum_id');
58 58
 } else {
59
-    redirect_header(XOOPS_URL . '/index.php', 2, _MD_NEWBB_POLLMODULE_ERROR . ': ' . _MD_NEWBB_FORUMNOEXIST);
59
+    redirect_header(XOOPS_URL.'/index.php', 2, _MD_NEWBB_POLLMODULE_ERROR.': '._MD_NEWBB_FORUMNOEXIST);
60 60
 }
61 61
 // forum access permission
62 62
 /** @var Newbb\ForumHandler $forumHandler */
63 63
 $forumHandler = Newbb\Helper::getInstance()->getHandler('Forum');
64 64
 $forumObject  = $forumHandler->get($forum_id);
65 65
 if (!$forumHandler->getPermission($forumObject)) {
66
-    redirect_header(XOOPS_URL . '/index.php', 2, _MD_NEWBB_NORIGHTTOACCESS);
66
+    redirect_header(XOOPS_URL.'/index.php', 2, _MD_NEWBB_NORIGHTTOACCESS);
67 67
 }
68 68
 // topic view permission
69 69
 if (!$topicHandler->getPermission($forumObject, $topicObject->getVar('topic_status'), 'view')) {
70
-    redirect_header('viewforum.php?forum=' . $forum_id, 2, _MD_NEWBB_NORIGHTTOVIEW);
70
+    redirect_header('viewforum.php?forum='.$forum_id, 2, _MD_NEWBB_NORIGHTTOVIEW);
71 71
 }
72 72
 // poll module
73 73
 $pollModuleHandler = $moduleHandler->getByDirname($GLOBALS['xoopsModuleConfig']['poll_module']);
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
         $pollObject = $xpPollHandler->get($poll_id); // will create poll if poll_id = 0 exist
85 85
         // old xoopspoll or umfrage or any clone from them
86 86
     } else {
87
-        require_once $GLOBALS['xoops']->path('modules/' . $GLOBALS['xoopsModuleConfig']['poll_module'] . '/include/constants.php');
87
+        require_once $GLOBALS['xoops']->path('modules/'.$GLOBALS['xoopsModuleConfig']['poll_module'].'/include/constants.php');
88 88
         $classPoll  = $topicObject->loadOldPoll();
89 89
         $pollObject = new $classPoll($poll_id); // will create poll if poll_id = 0 exist
90 90
     }
@@ -114,11 +114,11 @@  discard block
 block discarded – undo
114 114
     case 'add':
115 115
         // new xoopspoll module
116 116
         if ($pollModuleHandler->getVar('version') >= 140) {
117
-            echo '<h4>' . _MD_NEWBB_POLL_CREATNEWPOLL . "</h4>\n";
117
+            echo '<h4>'._MD_NEWBB_POLL_CREATNEWPOLL."</h4>\n";
118 118
             $pollObject->renderForm(Request::getString('PHP_SELF', '', 'SERVER'), 'post', ['topic_id' => $topic_id]);
119 119
         // old xoopspoll or umfrage or any clone from them
120 120
         } else {
121
-            $classOption  = $classPoll . 'Option';
121
+            $classOption  = $classPoll.'Option';
122 122
             $poll_form    = new \XoopsThemeForm(_MD_NEWBB_POLL_CREATNEWPOLL, 'poll_form', 'polls.php', 'post', true);
123 123
             $author_label = new \XoopsFormLabel(_MD_NEWBB_POLL_AUTHOR, is_object($GLOBALS['xoopsUser']) ? ("<a href='"
124 124
                                                                                                           . XOOPS_URL
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
             $poll_form->addElement($desc_tarea);
135 135
             $currenttime = formatTimestamp(time(), 'Y-m-d H:i:s');
136 136
             $endtime     = formatTimestamp(time() + 604800, 'Y-m-d H:i:s');
137
-            $expire_text = new \XoopsFormText(_MD_NEWBB_POLL_EXPIRATION . '<br><small>' . _MD_NEWBB_POLL_FORMAT . '<br>' . sprintf(_MD_NEWBB_POLL_CURRENTTIME, $currenttime) . '</small>', 'end_time', 30, 19, $endtime);
137
+            $expire_text = new \XoopsFormText(_MD_NEWBB_POLL_EXPIRATION.'<br><small>'._MD_NEWBB_POLL_FORMAT.'<br>'.sprintf(_MD_NEWBB_POLL_CURRENTTIME, $currenttime).'</small>', 'end_time', 30, 19, $endtime);
138 138
             $poll_form->addElement($expire_text);
139 139
 
140 140
             $weight_text = new \XoopsFormText(_MD_NEWBB_POLL_DISPLAYORDER, 'weight', 6, 5, 0);
@@ -147,14 +147,14 @@  discard block
 block discarded – undo
147 147
             $poll_form->addElement($notify_yn);
148 148
 
149 149
             $option_tray    = new \XoopsFormElementTray(_MD_NEWBB_POLL_POLLOPTIONS, '');
150
-            $barcolor_array = \XoopsLists::getImgListAsArray($GLOBALS['xoops']->path('modules/' . $GLOBALS['xoopsModuleConfig']['poll_module'] . '/assets/images/colorbars/'));
150
+            $barcolor_array = \XoopsLists::getImgListAsArray($GLOBALS['xoops']->path('modules/'.$GLOBALS['xoopsModuleConfig']['poll_module'].'/assets/images/colorbars/'));
151 151
             for ($i = 0; $i < 10; ++$i) {
152 152
                 $current_bar = ('blank.gif' !== current($barcolor_array)) ? current($barcolor_array) : next($barcolor_array);
153 153
                 $option_text = new \XoopsFormText('', 'option_text[]', 50, 255);
154 154
                 $option_tray->addElement($option_text);
155 155
                 $color_select = new \XoopsFormSelect('', "option_color[{$i}]", $current_bar);
156 156
                 $color_select->addOptionArray($barcolor_array);
157
-                $color_select->setExtra("onchange='showImgSelected(\"option_color_image[{$i}]\", \"option_color[{$i}]\", \"modules/" . $GLOBALS['xoopsModuleConfig']['poll_module'] . '/assets/images/colorbars", "", "' . XOOPS_URL . "\")'");
157
+                $color_select->setExtra("onchange='showImgSelected(\"option_color_image[{$i}]\", \"option_color[{$i}]\", \"modules/".$GLOBALS['xoopsModuleConfig']['poll_module'].'/assets/images/colorbars", "", "'.XOOPS_URL."\")'");
158 158
                 $color_label = new \XoopsFormLabel('', "<img src='"
159 159
                                                       . XOOPS_URL
160 160
                                                       . '/modules/'
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
             $poll_form->addElement(new \XoopsFormHidden('poll_id', $poll_id));
177 177
             $poll_form->addElement(new \XoopsFormHidden('user_id', is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('uid') : 0));
178 178
             $poll_form->addElement(new \XoopsFormButtonTray('poll_submit', _SUBMIT, 'submit'));
179
-            echo '<h4>' . _MD_NEWBB_POLL_POLLCONF . '</h4>';
179
+            echo '<h4>'._MD_NEWBB_POLL_POLLCONF.'</h4>';
180 180
             $poll_form->display();
181 181
         }
182 182
         break; // op: add
@@ -184,13 +184,13 @@  discard block
 block discarded – undo
184 184
     case 'edit':
185 185
         // new xoopspoll module
186 186
         if ($pollModuleHandler->getVar('version') >= 140) {
187
-            echo '<h4>' . _MD_NEWBB_POLL_EDITPOLL . "</h4>\n";
187
+            echo '<h4>'._MD_NEWBB_POLL_EDITPOLL."</h4>\n";
188 188
             $pollObject->renderForm(Request::getString('PHP_SELF', '', 'SERVER'), 'post', ['topic_id' => $topic_id]);
189 189
         // old xoopspoll or umfrage or any clone from them
190 190
         } else {
191
-            $classOption  = $classPoll . 'Option';
191
+            $classOption  = $classPoll.'Option';
192 192
             $poll_form    = new \XoopsThemeForm(_MD_NEWBB_POLL_EDITPOLL, 'poll_form', 'polls.php', 'post', true);
193
-            $author_label = new \XoopsFormLabel(_MD_NEWBB_POLL_AUTHOR, "<a href='" . XOOPS_URL . '/userinfo.php?uid=' . $pollObject->getVar('user_id') . "'>" . newbbGetUnameFromId($pollObject->getVar('user_id'), $GLOBALS['xoopsModuleConfig']['show_realname']) . '</a>');
193
+            $author_label = new \XoopsFormLabel(_MD_NEWBB_POLL_AUTHOR, "<a href='".XOOPS_URL.'/userinfo.php?uid='.$pollObject->getVar('user_id')."'>".newbbGetUnameFromId($pollObject->getVar('user_id'), $GLOBALS['xoopsModuleConfig']['show_realname']).'</a>');
194 194
             $poll_form->addElement($author_label);
195 195
             $question_text = new \XoopsFormText(_MD_NEWBB_POLL_POLLQUESTION, 'question', 50, 255, $pollObject->getVar('question', 'E'));
196 196
             $poll_form->addElement($question_text);
@@ -198,13 +198,13 @@  discard block
 block discarded – undo
198 198
             $poll_form->addElement($desc_tarea);
199 199
             $date = formatTimestamp($pollObject->getVar('end_time'), 'Y-m-d H:i:s'); // important "Y-m-d H:i:s" use in jdf function
200 200
             if (!$pollObject->hasExpired()) {
201
-                $expire_text = new \XoopsFormText(_MD_NEWBB_POLL_EXPIRATION . '<br><small>' . _MD_NEWBB_POLL_FORMAT . '<br>' . sprintf(_MD_NEWBB_POLL_CURRENTTIME, formatTimestamp(time(), 'Y-m-d H:i:s')) . '</small>', 'end_time', 20, 19, $date);
201
+                $expire_text = new \XoopsFormText(_MD_NEWBB_POLL_EXPIRATION.'<br><small>'._MD_NEWBB_POLL_FORMAT.'<br>'.sprintf(_MD_NEWBB_POLL_CURRENTTIME, formatTimestamp(time(), 'Y-m-d H:i:s')).'</small>', 'end_time', 20, 19, $date);
202 202
                 $poll_form->addElement($expire_text);
203 203
             } else {
204 204
                 // irmtfan full URL - add topic_id
205 205
                 $restart_label = new \XoopsFormLabel(
206 206
                     _MD_NEWBB_POLL_EXPIRATION,
207
-                                                    sprintf(_MD_NEWBB_POLL_EXPIREDAT, $date) . "<br><a href='" . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/polls.php?op=restart&amp;poll_id={$poll_id}&amp;topic_id={$topic_id}'>" . _MD_NEWBB_POLL_RESTART . '</a>'
207
+                                                    sprintf(_MD_NEWBB_POLL_EXPIREDAT, $date)."<br><a href='".XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/polls.php?op=restart&amp;poll_id={$poll_id}&amp;topic_id={$topic_id}'>"._MD_NEWBB_POLL_RESTART.'</a>'
208 208
                 );
209 209
                 $poll_form->addElement($restart_label);
210 210
             }
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
             $poll_form->addElement($weight_text);
213 213
             $multi_yn = new \XoopsFormRadioYN(_MD_NEWBB_POLL_ALLOWMULTI, 'multiple', $pollObject->getVar('multiple'));
214 214
             $poll_form->addElement($multi_yn);
215
-            $options_arr  =& $classOption::getAllByPollId($poll_id);
215
+            $options_arr  = & $classOption::getAllByPollId($poll_id);
216 216
             $notify_value = 1;
217 217
             if (0 !== $pollObject->getVar('mail_status')) {
218 218
                 $notify_value = 0;
@@ -228,9 +228,9 @@  discard block
 block discarded – undo
228 228
                 $option_tray->addElement(new \XoopsFormHidden('option_id[]', $option->getVar('option_id')));
229 229
                 $color_select = new \XoopsFormSelect('', 'option_color[{$i}]', $option->getVar('option_color'));
230 230
                 $color_select->addOptionArray($barcolor_array);
231
-                $color_select->setExtra("onchange='showImgSelected(\"option_color_image[{$i}]\", \"option_color[" . $i . "]\", \"modules/{$GLOBALS['xoopsModuleConfig']['poll_module']}/assets/images/colorbars\", \"\", \"" . XOOPS_URL . "\")'");
231
+                $color_select->setExtra("onchange='showImgSelected(\"option_color_image[{$i}]\", \"option_color[".$i."]\", \"modules/{$GLOBALS['xoopsModuleConfig']['poll_module']}/assets/images/colorbars\", \"\", \"".XOOPS_URL."\")'");
232 232
                 $color_label = new \XoopsFormLabel('', "<img src='"
233
-                                                      . $GLOBALS['xoops']->url("modules/{$GLOBALS['xoopsModuleConfig']['poll_module']}/assets/images/colorbars/" . $option->getVar('option_color', 'E'))
233
+                                                      . $GLOBALS['xoops']->url("modules/{$GLOBALS['xoopsModuleConfig']['poll_module']}/assets/images/colorbars/".$option->getVar('option_color', 'E'))
234 234
                                                       . "' name='option_color_image[{$i}]' id='option_color_image[{$i}]' class='alignbottom' width='30' height='15' alt='' /><br>");
235 235
                 $option_tray->addElement($color_select);
236 236
                 $option_tray->addElement($color_label);
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
                 ++$i;
239 239
             }
240 240
             // irmtfan full URL
241
-            $more_label = new \XoopsFormLabel('', "<br><a href='" . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/polls.php?op=addmore&amp;poll_id={$poll_id}&amp;topic_id={$topic_id}'>" . _MD_NEWBB_POLL_ADDMORE . '</a>');
241
+            $more_label = new \XoopsFormLabel('', "<br><a href='".XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/polls.php?op=addmore&amp;poll_id={$poll_id}&amp;topic_id={$topic_id}'>"._MD_NEWBB_POLL_ADDMORE.'</a>');
242 242
             $option_tray->addElement($more_label);
243 243
             $poll_form->addElement($option_tray);
244 244
             $poll_form->addElement(new \XoopsFormHidden('op', 'update'));
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
             $poll_form->addElement(new \XoopsFormHidden('poll_id', $poll_id));
247 247
             $poll_form->addElement(new \XoopsFormButtonTray('poll_submit', _SUBMIT, 'submit'));
248 248
 
249
-            echo '<h4>' . _MD_NEWBB_POLL_POLLCONF . "</h4>\n";
249
+            echo '<h4>'._MD_NEWBB_POLL_POLLCONF."</h4>\n";
250 250
             $poll_form->display();
251 251
         }
252 252
         break; // op: edit
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
             $option_empty = true;
265 265
             if (!Request::getString('option_text', '', 'POST')) {
266 266
                 // irmtfan - issue with javascript:history.go(-1)
267
-                redirect_header(Request::getString('HTTP_REFERER', '', 'SERVER'), 2, _MD_NEWBB_ERROROCCURED . ': ' . _MD_NEWBB_POLL_POLLOPTIONS . ' !');
267
+                redirect_header(Request::getString('HTTP_REFERER', '', 'SERVER'), 2, _MD_NEWBB_ERROROCCURED.': '._MD_NEWBB_POLL_POLLOPTIONS.' !');
268 268
             }
269 269
             $option_text = Request::getArray('option_text', '', 'POST');
270 270
             foreach ($option_text as $optxt) {
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
             }
276 276
             if ($option_empty) {
277 277
                 // irmtfan - issue with javascript:history.go(-1)
278
-                redirect_header(Request::getString('HTTP_REFERER', '', 'SERVER'), 2, _MD_NEWBB_ERROROCCURED . ': ' . _MD_NEWBB_POLL_POLLOPTIONS . ' !');
278
+                redirect_header(Request::getString('HTTP_REFERER', '', 'SERVER'), 2, _MD_NEWBB_ERROROCCURED.': '._MD_NEWBB_POLL_POLLOPTIONS.' !');
279 279
             }
280 280
             $pollObject->setVar('question', Request::getString('question', '', 'POST'));
281 281
             $pollObject->setVar('description', Request::getString('description', '', 'POST'));
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
             }
307 307
             $i            = 0;
308 308
             $option_color = Request::getArray('option_color', null, 'POST');
309
-            $classOption  = $classPoll . 'Option';
309
+            $classOption  = $classPoll.'Option';
310 310
             foreach ($option_text as $optxt) {
311 311
                 $optxt = trim($optxt);
312 312
                 /** @var Xoopspoll\Option $optionObject */
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
             } else {
334 334
                 redirect_header("viewtopic.php?topic_id={$topic_id}", 2, _MD_NEWBB_POLL_DBUPDATED);
335 335
             }
336
-            break;// op: save
336
+            break; // op: save
337 337
         }
338 338
     // no break
339 339
     case 'update':
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
         $option_string = is_array($option_text) ? implode('', $option_text) : $option_text;
347 347
         $option_string = trim($option_string);
348 348
         if ('' === $option_string) {
349
-            redirect_header(Request::getString('HTTP_REFERER', '', 'SERVER'), 2, _MD_NEWBB_ERROROCCURED . ': ' . _MD_NEWBB_POLL_POLLOPTIONS . ' !');
349
+            redirect_header(Request::getString('HTTP_REFERER', '', 'SERVER'), 2, _MD_NEWBB_ERROROCCURED.': '._MD_NEWBB_POLL_POLLOPTIONS.' !');
350 350
         }
351 351
 
352 352
         // new xoopspoll module
@@ -465,8 +465,8 @@  discard block
 block discarded – undo
465 465
             $i            = 0;
466 466
             $option_id    = Request::getArray('option_id', null, 'POST');
467 467
             $option_color = Request::getArray('option_color', null, 'POST');
468
-            $classOption  = $classPoll . 'Option';
469
-            $classLog     = $classPoll . 'Log';
468
+            $classOption  = $classPoll.'Option';
469
+            $classLog     = $classPoll.'Log';
470 470
             foreach ($option_id as $opid) {
471 471
                 $optionObject    = new $classOption($opid);
472 472
                 $option_text[$i] = trim($option_text[$i]);
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
         } else {
498 498
             redirect_header("viewtopic.php?topic_id={$topic_id}", 2, _MD_NEWBB_POLL_DBUPDATED);
499 499
         }
500
-        break;// op: save | update
500
+        break; // op: save | update
501 501
 
502 502
     case 'addmore':
503 503
         $question = $pollObject->getVar('question');
@@ -511,14 +511,14 @@  discard block
 block discarded – undo
511 511
         // old xoopspoll or umfrage or any clone from them
512 512
         } else {
513 513
             $option_tray    = new \XoopsFormElementTray(_MD_NEWBB_POLL_POLLOPTIONS, '');
514
-            $barcolor_array = \XoopsLists::getImgListAsArray($GLOBALS['xoops']->path('modules/' . $GLOBALS['xoopsModuleConfig']['poll_module'] . '/assets/images/colorbars/'));
514
+            $barcolor_array = \XoopsLists::getImgListAsArray($GLOBALS['xoops']->path('modules/'.$GLOBALS['xoopsModuleConfig']['poll_module'].'/assets/images/colorbars/'));
515 515
             for ($i = 0; $i < 10; ++$i) {
516 516
                 $current_bar = ('blank.gif' !== current($barcolor_array)) ? current($barcolor_array) : next($barcolor_array);
517 517
                 $option_text = new \XoopsFormText('', 'option_text[]', 50, 255);
518 518
                 $option_tray->addElement($option_text);
519 519
                 $color_select = new \XoopsFormSelect('', "option_color[{$i}]", $current_bar);
520 520
                 $color_select->addOptionArray($barcolor_array);
521
-                $color_select->setExtra("onchange='showImgSelected(\"option_color_image[{$i}]\", \"option_color[{$i}]\", \"modules/{$GLOBALS['xoopsModuleConfig']['poll_module']}/assets/images/colorbars\", \"\", \"" . XOOPS_URL . "\")'");
521
+                $color_select->setExtra("onchange='showImgSelected(\"option_color_image[{$i}]\", \"option_color[{$i}]\", \"modules/{$GLOBALS['xoopsModuleConfig']['poll_module']}/assets/images/colorbars\", \"\", \"".XOOPS_URL."\")'");
522 522
                 $color_label = new \XoopsFormLabel('', "<img src='"
523 523
                                                       . $GLOBALS['xoops']->url("modules/{$GLOBALS['xoopsModuleConfig']['poll_module']}/assets/images/colorbars/{$current_bar}")
524 524
                                                       . "' name='option_color_image[{$i}]' id='option_color_image[{$i}]' class='alignbottom' width='30' height='15' alt='' /><br>");
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
         $poll_form->addElement(new \XoopsFormHidden('topic_id', $topic_id));
537 537
         $poll_form->addElement(new \XoopsFormHidden('poll_id', $poll_id));
538 538
 
539
-        echo '<h4>' . _MD_NEWBB_POLL_POLLCONF . "</h4>\n";
539
+        echo '<h4>'._MD_NEWBB_POLL_POLLCONF."</h4>\n";
540 540
         $poll_form->display();
541 541
         break;
542 542
 
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
         $option_string = trim($option_string);
552 552
         if ('' === $option_string) {
553 553
             // irmtfan - issue with javascript:history.go(-1)
554
-            redirect_header(Request::getString('HTTP_REFERER', '', 'SERVER'), 2, _MD_NEWBB_ERROROCCURED . ': ' . _MD_NEWBB_POLL_POLLOPTIONS . ' !');
554
+            redirect_header(Request::getString('HTTP_REFERER', '', 'SERVER'), 2, _MD_NEWBB_ERROROCCURED.': '._MD_NEWBB_POLL_POLLOPTIONS.' !');
555 555
         }
556 556
         $i            = 0;
557 557
         $option_color = Request::getArray('option_color', null, 'POST');
@@ -568,7 +568,7 @@  discard block
 block discarded – undo
568 568
                     $xpOptHandler->insert($optionObject);
569 569
                 // old xoopspoll or umfrage or any clone from them
570 570
                 } else {
571
-                    $classOption  = $classPoll . 'Option';
571
+                    $classOption  = $classPoll.'Option';
572 572
                     $optionObject = new $classOption();
573 573
                     $optionObject->setVar('option_text', $optxt);
574 574
                     $optionObject->setVar('poll_id', $poll_id);
@@ -586,7 +586,7 @@  discard block
 block discarded – undo
586 586
         break;
587 587
 
588 588
     case 'delete':
589
-        echo '<h4>' . _MD_NEWBB_POLL_POLLCONF . "</h4>\n";
589
+        echo '<h4>'._MD_NEWBB_POLL_POLLCONF."</h4>\n";
590 590
         xoops_confirm(['op' => 'delete_ok', 'topic_id' => $topic_id, 'poll_id' => $poll_id], 'polls.php', sprintf(_MD_NEWBB_POLL_RUSUREDEL, $pollObject->getVar('question')));
591 591
         break;
592 592
 
@@ -610,8 +610,8 @@  discard block
 block discarded – undo
610 610
             // old xoopspoll or umfrage or any clone from them
611 611
         } else {
612 612
             $status      = $pollObject->delete();
613
-            $classOption = $classPoll . 'Option';
614
-            $classLog    = $classPoll . 'Log';
613
+            $classOption = $classPoll.'Option';
614
+            $classLog    = $classPoll.'Log';
615 615
             if (false !== $status) {
616 616
                 $classOption::deleteByPollId($poll_id);
617 617
                 $classLog::deleteByPollId($poll_id);
@@ -638,13 +638,13 @@  discard block
 block discarded – undo
638 638
             xoops_error($msg);
639 639
             break;
640 640
         }
641
-        redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?topic_id={$topic_id}", 1, _MD_NEWBB_POLL_DBUPDATED);
641
+        redirect_header(XOOPS_URL."/modules/newbb/viewtopic.php?topic_id={$topic_id}", 1, _MD_NEWBB_POLL_DBUPDATED);
642 642
         break;
643 643
 
644 644
     case 'restart':
645 645
         // new xoopspoll module
646 646
         if ($pollModuleHandler->getVar('version') >= 140) {
647
-            $classConstants   = new XoopsModules\Xoopspoll\Constants();
647
+            $classConstants = new XoopsModules\Xoopspoll\Constants();
648 648
             $default_poll_duration = $classConstants::DEFAULT_POLL_DURATION;
649 649
         // old xoopspoll or umfrage or any clone from them
650 650
         } else {
@@ -652,10 +652,10 @@  discard block
 block discarded – undo
652 652
         }
653 653
         $poll_form   = new \XoopsThemeForm(_MD_NEWBB_POLL_RESTARTPOLL, 'poll_form', 'polls.php', 'post', true);
654 654
         $expire_text = new \XoopsFormText(
655
-            _MD_NEWBB_POLL_EXPIRATION . '<br><small>' . _MD_NEWBB_POLL_FORMAT . '<br>' . sprintf(_MD_NEWBB_POLL_CURRENTTIME, formatTimestamp(time(), 'Y-m-d H:i:s')) . '<br>' . sprintf(
655
+            _MD_NEWBB_POLL_EXPIRATION.'<br><small>'._MD_NEWBB_POLL_FORMAT.'<br>'.sprintf(_MD_NEWBB_POLL_CURRENTTIME, formatTimestamp(time(), 'Y-m-d H:i:s')).'<br>'.sprintf(
656 656
             _MD_NEWBB_POLL_EXPIREDAT,
657 657
                                                                                                                                                                                                                      formatTimestamp($pollObject->getVar('end_time'), 'Y-m-d H:i:s')
658
-        ) . '</small>',
658
+        ).'</small>',
659 659
                                          'end_time',
660 660
             20,
661 661
             19,
@@ -669,7 +669,7 @@  discard block
 block discarded – undo
669 669
         $poll_form->addElement(new \XoopsFormHidden('poll_id', $poll_id));
670 670
         $poll_form->addElement(new \XoopsFormButton('', 'poll_submit', _MD_NEWBB_POLL_RESTART, 'submit'));
671 671
 
672
-        echo '<h4>' . _MD_NEWBB_POLL_POLLCONF . "</h4>\n";
672
+        echo '<h4>'._MD_NEWBB_POLL_POLLCONF."</h4>\n";
673 673
         $poll_form->display();
674 674
         break;
675 675
 
@@ -681,7 +681,7 @@  discard block
 block discarded – undo
681 681
 
682 682
         // new xoopspoll module
683 683
         if ($pollModuleHandler->getVar('version') >= 140) {
684
-            $classConstants   = new XoopsModules\Xoopspoll\Constants();
684
+            $classConstants = new XoopsModules\Xoopspoll\Constants();
685 685
             $default_poll_duration = $classConstants::DEFAULT_POLL_DURATION;
686 686
             $poll_not_mailed       = $classConstants::POLL_NOT_MAILED;
687 687
             $poll_mailed           = $classConstants::POLL_MAILED;
@@ -731,8 +731,8 @@  discard block
 block discarded – undo
731 731
                 exit();
732 732
             }
733 733
             if (Request::getInt('reset', 0, 'POST')) { // reset all logs
734
-                $classOption = $classPoll . 'Option';
735
-                $classLog    = $classPoll . 'Log';
734
+                $classOption = $classPoll.'Option';
735
+                $classLog    = $classPoll.'Log';
736 736
                 $classLog::deleteByPollId($poll_id);
737 737
                 $classOption::resetCountByPollId($poll_id);
738 738
                 $pollObject->updateCount();
@@ -741,7 +741,7 @@  discard block
 block discarded – undo
741 741
         require_once $GLOBALS['xoops']->path('class/template.php');
742 742
         xoops_template_clear_module_cache($xoopsModule->getVar('mid'));
743 743
         xoops_template_clear_module_cache($pollModuleHandler->getVar('mid'));
744
-        redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?topic_id={$topic_id}", 1, _MD_NEWBB_POLL_DBUPDATED);
744
+        redirect_header(XOOPS_URL."/modules/newbb/viewtopic.php?topic_id={$topic_id}", 1, _MD_NEWBB_POLL_DBUPDATED);
745 745
         break;
746 746
 
747 747
     case 'log':
@@ -756,5 +756,5 @@  discard block
 block discarded – undo
756 756
 } // switch
757 757
 
758 758
 // irmtfan move to footer.php
759
-require_once __DIR__ . '/footer.php';
759
+require_once __DIR__.'/footer.php';
760 760
 require_once $GLOBALS['xoops']->path('footer.php');
Please login to merge, or discard this patch.
footer.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -25,23 +25,23 @@
 block discarded – undo
25 25
 require_once $GLOBALS['xoops']->path('modules/newbb/include/functions.render.php');
26 26
 $iconHandler = newbbGetIconHandler();
27 27
 //  get css rel path from setted language
28
-$css_rel_path = $iconHandler->getPath('language/' . $GLOBALS['xoopsConfig']['language'], 'newbb', 'language/english', 'css');
28
+$css_rel_path = $iconHandler->getPath('language/'.$GLOBALS['xoopsConfig']['language'], 'newbb', 'language/english', 'css');
29 29
 // add local stylesheet
30 30
 /** @var xos_opal_Theme $xoTheme */
31
-$xoTheme->addStylesheet($css_rel_path . '/style.css');
31
+$xoTheme->addStylesheet($css_rel_path.'/style.css');
32 32
 
33 33
 //  get js rel path from setted language
34
-$js_rel_path = $iconHandler->getPath('language/' . $GLOBALS['xoopsConfig']['language'], 'newbb', 'language/english', 'js');
34
+$js_rel_path = $iconHandler->getPath('language/'.$GLOBALS['xoopsConfig']['language'], 'newbb', 'language/english', 'js');
35 35
 // add all local js files inside js directory
36 36
 xoops_load('XoopsLists');
37 37
 $allfiles = \XoopsLists::getFileListAsArray($GLOBALS['xoops']->path($js_rel_path));
38 38
 foreach ($allfiles as $jsfile) {
39 39
     if ('js' === strtolower(pathinfo($jsfile, PATHINFO_EXTENSION))) {
40
-        $xoTheme->addScript($js_rel_path . '/' . $jsfile);
40
+        $xoTheme->addScript($js_rel_path.'/'.$jsfile);
41 41
     }
42 42
 }
43
-global $forumCookie;  // for $forumCookie["prefix"] revert last change - use global instead of include
43
+global $forumCookie; // for $forumCookie["prefix"] revert last change - use global instead of include
44 44
 // add toggle script
45 45
 //$toggle_script = "var toggle_cookie=\"" . $forumCookie['prefix'] . 'G' . '\';';
46
-$toggle_script = 'var toggle_cookie="' . $forumCookie['prefix'] . 'G";';
46
+$toggle_script = 'var toggle_cookie="'.$forumCookie['prefix'].'G";';
47 47
 $xoTheme->addScript(null, ['type' => 'text/javascript'], $toggle_script);
Please login to merge, or discard this patch.
list.topic.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
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
 //$xoopsOption['xoops_module_header']= $xoops_module_header;
18 18
 $GLOBALS['xoopsOption']['template_main'] = 'newbb_viewall.tpl';
@@ -21,13 +21,13 @@  discard block
 block discarded – undo
21 21
 // irmtfan new method
22 22
 if (!empty($GLOBALS['xoopsModuleConfig']['rss_enable'])) {
23 23
     $xoopsTpl->assign('xoops_module_header', '
24
-    <link rel="alternate" type="application/xml+rss" title="' . $xoopsModule->getVar('name') . '" href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/rss.php" />
24
+    <link rel="alternate" type="application/xml+rss" title="' . $xoopsModule->getVar('name').'" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/rss.php" />
25 25
     ' . @$xoopsTpl->get_template_vars('xoops_module_header'));
26 26
 }
27 27
 //$xoopsTpl->assign('xoops_module_header', $xoops_module_header);
28 28
 
29
-require_once __DIR__ . '/include/functions.time.php';
30
-require_once __DIR__ . '/include/functions.render.php';
29
+require_once __DIR__.'/include/functions.time.php';
30
+require_once __DIR__.'/include/functions.render.php';
31 31
 
32 32
 // irmtfan use require_once because it will redeclared in newbb/blocks/list_topic.php
33 33
 //require_once __DIR__ . '/./class/TopicRenderer.php';
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 $xoopsTpl->assign('newpost_link', 'viewpost.php?status=new');
88 88
 
89 89
 if (!empty($GLOBALS['xoopsModuleConfig']['show_jump'])) {
90
-    require_once __DIR__ . '/include/functions.forum.php';
90
+    require_once __DIR__.'/include/functions.forum.php';
91 91
     $xoopsTpl->assign('forum_jumpbox', newbbMakeJumpbox());
92 92
 }
93 93
 $xoopsTpl->assign('menumode', $menumode);
@@ -95,12 +95,12 @@  discard block
 block discarded – undo
95 95
 
96 96
 $xoopsTpl->assign('mode', $mode);
97 97
 $xoopsTpl->assign('status', $status);
98
-$xoopsTpl->assign('viewer_level', $topic_renderer->userlevel);// irmtfan use userlevel
98
+$xoopsTpl->assign('viewer_level', $topic_renderer->userlevel); // irmtfan use userlevel
99 99
 
100 100
 $pagetitle = sprintf(_MD_NEWBB_FORUMINDEX, htmlspecialchars($GLOBALS['xoopsConfig']['sitename'], ENT_QUOTES));
101 101
 $xoopsTpl->assign('forum_index_title', $pagetitle);
102 102
 $xoopsTpl->assign('xoops_pagetitle', $pagetitle);
103 103
 
104 104
 // irmtfan move to footer.php
105
-require_once __DIR__ . '/footer.php';
105
+require_once __DIR__.'/footer.php';
106 106
 require_once $GLOBALS['xoops']->path('footer.php');
Please login to merge, or discard this patch.
ratethread.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
 use Xmf\Request;
33 33
 
34
-require_once __DIR__ . '/header.php';
34
+require_once __DIR__.'/header.php';
35 35
 
36 36
 $ratinguser   = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('uid') : 0;
37 37
 $anonwaitdays = 1;
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 }
52 52
 
53 53
 if (empty($rate)) {
54
-    redirect_header('viewtopic.php?topic_id=' . $topic_id . '&amp;forum=' . $forum . '', 4, _MD_NEWBB_NOVOTERATE);
54
+    redirect_header('viewtopic.php?topic_id='.$topic_id.'&amp;forum='.$forum.'', 4, _MD_NEWBB_NOVOTERATE);
55 55
 }
56 56
 ///** @var Newbb\RateHandler $rateHandler */
57 57
 //$rateHandler = Newbb\Helper::getInstance()->getHandler('Rate');
@@ -62,13 +62,13 @@  discard block
 block discarded – undo
62 62
     //    /** @var Newbb\PostHandler $postHandler */
63 63
     //    $postHandler = Newbb\Helper::getInstance()->getHandler('Post');
64 64
     if ($postHandler->getCount($crit_post)) {
65
-        redirect_header('viewtopic.php?topic_id=' . $topic_id . '&amp;forum=' . $forum . '', 4, _MD_NEWBB_CANTVOTEOWN);
65
+        redirect_header('viewtopic.php?topic_id='.$topic_id.'&amp;forum='.$forum.'', 4, _MD_NEWBB_CANTVOTEOWN);
66 66
     }
67 67
     // Check if REG user is trying to vote twice.
68 68
     $crit_rate = new \CriteriaCompo(new \Criteria('topic_id', $topic_id));
69 69
     $crit_rate->add(new \Criteria('ratinguser', $ratinguser));
70 70
     if ($rateHandler->getCount($crit_rate)) {
71
-        redirect_header('viewtopic.php?topic_id=' . $topic_id . '&amp;forum=' . $forum . '', 4, _MD_NEWBB_VOTEONCE);
71
+        redirect_header('viewtopic.php?topic_id='.$topic_id.'&amp;forum='.$forum.'', 4, _MD_NEWBB_VOTEONCE);
72 72
     }
73 73
 } else {
74 74
     // Check if ANONYMOUS user is trying to vote more than once per day.
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
     $crit_rate->add(new \Criteria('ratinghostname', $ip));
78 78
     $crit_rate->add(new \Criteria('ratingtimestamp', time() - (86400 * $anonwaitdays), '>'));
79 79
     if ($rateHandler->getCount($crit_rate)) {
80
-        redirect_header('viewtopic.php?topic_id=' . $topic_id . '&amp;forum=' . $forum . '', 4, _MD_NEWBB_VOTEONCE);
80
+        redirect_header('viewtopic.php?topic_id='.$topic_id.'&amp;forum='.$forum.'', 4, _MD_NEWBB_VOTEONCE);
81 81
     }
82 82
 }
83 83
 $rateObject = $rateHandler->create();
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 
90 90
 $ratingid = $rateHandler->insert($rateObject);
91 91
 
92
-$query       = 'SELECT rating FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_votedata') . ' WHERE topic_id = ' . $topic_id . ' ';
92
+$query       = 'SELECT rating FROM '.$GLOBALS['xoopsDB']->prefix('newbb_votedata').' WHERE topic_id = '.$topic_id.' ';
93 93
 $voteresult  = $GLOBALS['xoopsDB']->query($query);
94 94
 $votesDB     = $GLOBALS['xoopsDB']->getRowsNum($voteresult);
95 95
 $totalrating = 0;
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 $sql         = sprintf('UPDATE "%s" SET rating = "%u", votes = "%u" WHERE topic_id = "%u"', $GLOBALS['xoopsDB']->prefix('newbb_topics'), $finalrating, $votesDB, $topic_id);
102 102
 $GLOBALS['xoopsDB']->queryF($sql);
103 103
 
104
-$ratemessage = _MD_NEWBB_VOTEAPPRE . '<br>' . sprintf(_MD_NEWBB_THANKYOU, $GLOBALS['xoopsConfig']['sitename']);
105
-redirect_header('viewtopic.php?topic_id=' . $topic_id . '&amp;forum=' . $forum . '', 2, $ratemessage);
104
+$ratemessage = _MD_NEWBB_VOTEAPPRE.'<br>'.sprintf(_MD_NEWBB_THANKYOU, $GLOBALS['xoopsConfig']['sitename']);
105
+redirect_header('viewtopic.php?topic_id='.$topic_id.'&amp;forum='.$forum.'', 2, $ratemessage);
106 106
 // irmtfan enhance include footer.php
107 107
 require_once $GLOBALS['xoops']->path('footer.php');
Please login to merge, or discard this patch.
header.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@  discard block
 block discarded – undo
11 11
 
12 12
 use Xmf\Request;
13 13
 
14
-require_once dirname(dirname(__DIR__)) . '/mainfile.php';
15
-require_once __DIR__ . '/include/common.php';
14
+require_once dirname(dirname(__DIR__)).'/mainfile.php';
15
+require_once __DIR__.'/include/common.php';
16 16
 
17 17
 // defined('XOOPS_ROOT_PATH') || die('Restricted access');
18 18
 /** @var \XoopsLogger $xoopsLogger */
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 //require_once $GLOBALS['xoops']->path('header.php');
24 24
 
25 25
 if (!empty($GLOBALS['xoopsModuleConfig']['do_rewrite'])) {
26
-    require_once __DIR__ . '/seo_url.php';
26
+    require_once __DIR__.'/seo_url.php';
27 27
     /* for seo */
28 28
     $toseo_url = ['index.php', 'viewforum.php', 'viewtopic.php', 'rss.php'];
29 29
 
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
                 //rewrite only for files
38 38
 
39 39
                 if ('' !== trim(getenv('SCRIPT_NAME'))) {
40
-                    if (false === strpos(getenv('REQUEST_URI'), '/' . SEO_MODULE_NAME . '/')) {
40
+                    if (false === strpos(getenv('REQUEST_URI'), '/'.SEO_MODULE_NAME.'/')) {
41 41
                         $redir = true;
42 42
                     } elseif (getenv('QUERY_STRING')) {
43 43
                         $redir = true;
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
         }
48 48
 
49 49
         if (true === $redir) {
50
-            $s      = 'http://' . getenv('HTTP_HOST') . getenv('REQUEST_URI');
51
-            $s      = str_replace('/' . REAL_MODULE_NAME . '/', '/' . SEO_MODULE_NAME . '/', $s);
52
-            $newurl = seo_urls('<a href="' . $s . '"></a>');
50
+            $s      = 'http://'.getenv('HTTP_HOST').getenv('REQUEST_URI');
51
+            $s      = str_replace('/'.REAL_MODULE_NAME.'/', '/'.SEO_MODULE_NAME.'/', $s);
52
+            $newurl = seo_urls('<a href="'.$s.'"></a>');
53 53
             $newurl = str_replace('<a href="', '', $newurl);
54 54
             $newurl = str_replace('"></a>', '', $newurl);
55 55
             if (!headers_sent()) {
@@ -61,10 +61,10 @@  discard block
 block discarded – undo
61 61
     }
62 62
 }
63 63
 
64
-require_once $GLOBALS['xoops']->path('modules/' . $moduleDirName . '/include/vars.php');
64
+require_once $GLOBALS['xoops']->path('modules/'.$moduleDirName.'/include/vars.php');
65 65
 
66
-require_once __DIR__ . '/include/functions.user.php';
67
-require_once __DIR__ . '/include/functions.topic.php';
66
+require_once __DIR__.'/include/functions.user.php';
67
+require_once __DIR__.'/include/functions.topic.php';
68 68
 
69 69
 require_once $GLOBALS['xoops']->path('class/xoopsformloader.php');
70 70
 require_once $GLOBALS['xoops']->path('class/module.textsanitizer.php');
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 $menumode       = 0;
74 74
 $menumode_other = [];
75 75
 $menu_url       = htmlspecialchars(preg_replace('/&menumode=[^&]/', '', Request::getString('REQUEST_URI', '', 'SERVER')), ENT_QUOTES | ENT_HTML5);
76
-$menu_url       .= (false === strpos($menu_url, '?')) ? '?menumode=' : '&amp;menumode=';
76
+$menu_url .= (false === strpos($menu_url, '?')) ? '?menumode=' : '&amp;menumode=';
77 77
 //foreach ($GLOBALS['xoopsModuleConfig']['valid_menumodes'] as $key => $val) {
78 78
 //    if ($key !== $menumode) {
79 79
 //        $menumode_other[] = array('title' => $val, 'link' => $menu_url . $key);
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
 if (is_object($GLOBALS['xoopsUser']) && !empty($GLOBALS['xoopsModuleConfig']['welcome_forum'])
84 84
     && !$GLOBALS['xoopsUser']->getVar('posts')) {
85
-    require_once __DIR__ . '/include/functions.welcome.php';
85
+    require_once __DIR__.'/include/functions.welcome.php';
86 86
 }
87 87
 // irmtfan for backward compatibility
88 88
 $pollmodules = $GLOBALS['xoopsModuleConfig']['poll_module'];
Please login to merge, or discard this patch.