Passed
Branch master (dd6e46)
by Michael
03:32
created
class/StatsHandler.php 1 patch
Indentation   +80 added lines, -80 removed lines patch added patch discarded remove patch
@@ -79,50 +79,50 @@  discard block
 block discarded – undo
79 79
         }
80 80
 
81 81
         $sql    = "    UPDATE {$this->table}"
82
-                  . '    SET stats_value = CASE '
83
-                  . "                    WHEN time_format = '' OR DATE_FORMAT(time_update, time_format) = DATE_FORMAT(NOW(), time_format)  THEN stats_value + '{$increment}' "
84
-                  . "                    ELSE '{$increment}' "
85
-                  . '                END, '
86
-                  . '        time_update = NOW()'
87
-                  . '    WHERE '
88
-                  . "        (stats_id = '0' OR stats_id = '{$id}') "
89
-                  . "        AND stats_type='{$type}' ";
82
+                    . '    SET stats_value = CASE '
83
+                    . "                    WHEN time_format = '' OR DATE_FORMAT(time_update, time_format) = DATE_FORMAT(NOW(), time_format)  THEN stats_value + '{$increment}' "
84
+                    . "                    ELSE '{$increment}' "
85
+                    . '                END, '
86
+                    . '        time_update = NOW()'
87
+                    . '    WHERE '
88
+                    . "        (stats_id = '0' OR stats_id = '{$id}') "
89
+                    . "        AND stats_type='{$type}' ";
90 90
         $result = $this->db->queryF($sql);
91 91
         $rows   = $this->db->getAffectedRows();
92 92
         if (0 == $rows) {
93 93
             $sql    = "    INSERT INTO {$this->table}"
94
-                      . '        (`stats_id`, `stats_value`, `stats_type`, `stats_period`, `time_update`, `time_format`) '
95
-                      . '    VALUES '
96
-                      . "        ('0', '{$increment}', '{$type}', '"
97
-                      . array_search('total', $this->param['period'], true)
98
-                      . "', NOW(), ''), "
99
-                      . "        ('0', '{$increment}', '{$type}', '"
100
-                      . array_search('day', $this->param['period'], true)
101
-                      . "', NOW(), '%Y%j'), "
102
-                      . "        ('0', '{$increment}', '{$type}', '"
103
-                      . array_search('week', $this->param['period'], true)
104
-                      . "', NOW(), '%Y%u'), "
105
-                      . "        ('0', '{$increment}', '{$type}', '"
106
-                      . array_search('month', $this->param['period'], true)
107
-                      . "', NOW(), '%Y%m')";
94
+                        . '        (`stats_id`, `stats_value`, `stats_type`, `stats_period`, `time_update`, `time_format`) '
95
+                        . '    VALUES '
96
+                        . "        ('0', '{$increment}', '{$type}', '"
97
+                        . array_search('total', $this->param['period'], true)
98
+                        . "', NOW(), ''), "
99
+                        . "        ('0', '{$increment}', '{$type}', '"
100
+                        . array_search('day', $this->param['period'], true)
101
+                        . "', NOW(), '%Y%j'), "
102
+                        . "        ('0', '{$increment}', '{$type}', '"
103
+                        . array_search('week', $this->param['period'], true)
104
+                        . "', NOW(), '%Y%u'), "
105
+                        . "        ('0', '{$increment}', '{$type}', '"
106
+                        . array_search('month', $this->param['period'], true)
107
+                        . "', NOW(), '%Y%m')";
108 108
             $result = $this->db->queryF($sql);
109 109
         }
110 110
         if ($rows < 2 * count($this->param['period']) && !empty($id)) {
111 111
             $sql    = "    INSERT INTO {$this->table}"
112
-                      . '        (`stats_id`, `stats_value`, `stats_type`, `stats_period`, `time_update`, `time_format`) '
113
-                      . '    VALUES '
114
-                      . "        ('{$id}', '{$increment}', '{$type}', '"
115
-                      . array_search('total', $this->param['period'], true)
116
-                      . "', NOW(), ''), "
117
-                      . "        ('{$id}', '{$increment}', '{$type}', '"
118
-                      . array_search('day', $this->param['period'], true)
119
-                      . "', NOW(), '%Y%j'), "
120
-                      . "        ('{$id}', '{$increment}', '{$type}', '"
121
-                      . array_search('week', $this->param['period'], true)
122
-                      . "', NOW(), '%Y%u'), "
123
-                      . "        ('{$id}', '{$increment}', '{$type}', '"
124
-                      . array_search('month', $this->param['period'], true)
125
-                      . "', NOW(), '%Y%m')";
112
+                        . '        (`stats_id`, `stats_value`, `stats_type`, `stats_period`, `time_update`, `time_format`) '
113
+                        . '    VALUES '
114
+                        . "        ('{$id}', '{$increment}', '{$type}', '"
115
+                        . array_search('total', $this->param['period'], true)
116
+                        . "', NOW(), ''), "
117
+                        . "        ('{$id}', '{$increment}', '{$type}', '"
118
+                        . array_search('day', $this->param['period'], true)
119
+                        . "', NOW(), '%Y%j'), "
120
+                        . "        ('{$id}', '{$increment}', '{$type}', '"
121
+                        . array_search('week', $this->param['period'], true)
122
+                        . "', NOW(), '%Y%u'), "
123
+                        . "        ('{$id}', '{$increment}', '{$type}', '"
124
+                        . array_search('month', $this->param['period'], true)
125
+                        . "', NOW(), '%Y%m')";
126 126
             $result = $this->db->queryF($sql);
127 127
         }
128 128
     }
@@ -148,17 +148,17 @@  discard block
 block discarded – undo
148 148
             $_periods[] = array_search($period, $this->param['period']);
149 149
         }
150 150
         $sql    = '    SELECT stats_id, stats_value, stats_type, stats_period '
151
-                  . "    FROM {$this->table} "
152
-                  . '    WHERE '
153
-                  . "        ( time_format = '' OR DATE_FORMAT(time_update, time_format) = DATE_FORMAT(NOW(), time_format) ) "
154
-                  . '        '
155
-                  . (empty($ids) ? '' : 'AND stats_id IN ('
151
+                    . "    FROM {$this->table} "
152
+                    . '    WHERE '
153
+                    . "        ( time_format = '' OR DATE_FORMAT(time_update, time_format) = DATE_FORMAT(NOW(), time_format) ) "
154
+                    . '        '
155
+                    . (empty($ids) ? '' : 'AND stats_id IN ('
156 156
                                         . implode(', ', array_map('intval', $ids))
157 157
                                         . ')')
158
-                  . '        '
159
-                  . (empty($_types) ? '' : 'AND stats_type IN (' . implode(', ', $_types) . ')')
160
-                  . '        '
161
-                  . (empty($_periods) ? '' : 'AND stats_period IN (' . implode(', ', $_periods) . ')');
158
+                    . '        '
159
+                    . (empty($_types) ? '' : 'AND stats_type IN (' . implode(', ', $_types) . ')')
160
+                    . '        '
161
+                    . (empty($_periods) ? '' : 'AND stats_period IN (' . implode(', ', $_periods) . ')');
162 162
         $result = $this->db->query($sql);
163 163
 
164 164
         while (false !== ($row = $this->db->fetchArray($result))) {
@@ -204,21 +204,21 @@  discard block
 block discarded – undo
204 204
                 list($topics, $views) = $this->db->fetchRow($result);
205 205
                 $views = empty($views) ? 0 : $views; // null check
206 206
                 $this->db->queryF("    INSERT INTO {$this->table}"
207
-                                  . '        (`stats_id`, `stats_value`, `stats_type`, `stats_period`, `time_update`, `time_format`) '
208
-                                  . '    VALUES '
209
-                                  . "        ('{$forum_id}', '{$topics}', '"
210
-                                  . array_search('topic', $this->param['type'], true)
211
-                                  . "', '"
212
-                                  . array_search($period, $this->param['period'])
213
-                                  . "', NOW(), '{$format}')");
207
+                                    . '        (`stats_id`, `stats_value`, `stats_type`, `stats_period`, `time_update`, `time_format`) '
208
+                                    . '    VALUES '
209
+                                    . "        ('{$forum_id}', '{$topics}', '"
210
+                                    . array_search('topic', $this->param['type'], true)
211
+                                    . "', '"
212
+                                    . array_search($period, $this->param['period'])
213
+                                    . "', NOW(), '{$format}')");
214 214
                 $this->db->queryF("    INSERT INTO {$this->table}"
215
-                                  . '        (`stats_id`, `stats_value`, `stats_type`, `stats_period`, `time_update`, `time_format`) '
216
-                                  . '    VALUES '
217
-                                  . "        ('{$forum_id}', '{$views}', '"
218
-                                  . array_search('view', $this->param['type'], true)
219
-                                  . "', '"
220
-                                  . array_search($period, $this->param['period'])
221
-                                  . "', NOW(), '{$format}')");
215
+                                    . '        (`stats_id`, `stats_value`, `stats_type`, `stats_period`, `time_update`, `time_format`) '
216
+                                    . '    VALUES '
217
+                                    . "        ('{$forum_id}', '{$views}', '"
218
+                                    . array_search('view', $this->param['type'], true)
219
+                                    . "', '"
220
+                                    . array_search($period, $this->param['period'])
221
+                                    . "', NOW(), '{$format}')");
222 222
                 @$counts['topic'][$period] += $topics;
223 223
                 @$counts['view'][$period] += $views;
224 224
 
@@ -226,26 +226,26 @@  discard block
 block discarded – undo
226 226
                 $result = $this->db->query($sql);
227 227
                 list($digests) = $this->db->fetchRow($result);
228 228
                 $this->db->queryF("    INSERT INTO {$this->table}"
229
-                                  . '        (`stats_id`, `stats_value`, `stats_type`, `stats_period`, `time_update`, `time_format`) '
230
-                                  . '    VALUES '
231
-                                  . "        ('{$forum_id}', '{$digests}', '"
232
-                                  . array_search('digest', $this->param['type'], true)
233
-                                  . "', '"
234
-                                  . array_search($period, $this->param['period'])
235
-                                  . "', NOW(), '{$format}')");
229
+                                    . '        (`stats_id`, `stats_value`, `stats_type`, `stats_period`, `time_update`, `time_format`) '
230
+                                    . '    VALUES '
231
+                                    . "        ('{$forum_id}', '{$digests}', '"
232
+                                    . array_search('digest', $this->param['type'], true)
233
+                                    . "', '"
234
+                                    . array_search($period, $this->param['period'])
235
+                                    . "', NOW(), '{$format}')");
236 236
                 @$counts['digest'][$period] += $digests;
237 237
 
238 238
                 $sql    = '    SELECT COUNT(*)' . '    FROM ' . $this->db->prefix('newbb_posts') . "    WHERE approved=1 AND forum_id = {$forum_id}" . "        AND FROM_UNIXTIME(post_time, '{$format}') >= FROM_UNIXTIME({$now}, '{$format}')";
239 239
                 $result = $this->db->query($sql);
240 240
                 list($posts) = $this->db->fetchRow($result);
241 241
                 $this->db->queryF("    INSERT INTO {$this->table}"
242
-                                  . '        (`stats_id`, `stats_value`, `stats_type`, `stats_period`, `time_update`, `time_format`) '
243
-                                  . '    VALUES '
244
-                                  . "        ('{$forum_id}', '{$posts}', '"
245
-                                  . array_search('post', $this->param['type'])
246
-                                  . "', '"
247
-                                  . array_search($period, $this->param['period'], true)
248
-                                  . "', NOW(), '{$format}')");
242
+                                    . '        (`stats_id`, `stats_value`, `stats_type`, `stats_period`, `time_update`, `time_format`) '
243
+                                    . '    VALUES '
244
+                                    . "        ('{$forum_id}', '{$posts}', '"
245
+                                    . array_search('post', $this->param['type'])
246
+                                    . "', '"
247
+                                    . array_search($period, $this->param['period'], true)
248
+                                    . "', NOW(), '{$format}')");
249 249
                 @$counts['post'][$period] += $posts;
250 250
             }
251 251
         }
@@ -254,13 +254,13 @@  discard block
 block discarded – undo
254 254
         foreach ($time_start as $period => $format) {
255 255
             foreach (array_keys($counts) as $type) {
256 256
                 $this->db->queryF("    INSERT INTO {$this->table}"
257
-                                  . '        (`stats_id`, `stats_value`, `stats_type`, `stats_period`, `time_update`, `time_format`) '
258
-                                  . '    VALUES '
259
-                                  . "        ('0', '{$counts[$type][$period]}', '"
260
-                                  . array_search($type, $this->param['type'], true)
261
-                                  . "', '"
262
-                                  . array_search($period, $this->param['period'], true)
263
-                                  . "', NOW(), '{$format}')");
257
+                                    . '        (`stats_id`, `stats_value`, `stats_type`, `stats_period`, `time_update`, `time_format`) '
258
+                                    . '    VALUES '
259
+                                    . "        ('0', '{$counts[$type][$period]}', '"
260
+                                    . array_search($type, $this->param['type'], true)
261
+                                    . "', '"
262
+                                    . array_search($period, $this->param['period'], true)
263
+                                    . "', NOW(), '{$format}')");
264 264
             }
265 265
         }
266 266
     }
Please login to merge, or discard this patch.
class/User.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -188,12 +188,12 @@
 block discarded – undo
188 188
             }
189 189
             // irmtfan hardcore removed align="left"
190 190
             $table = "<table class='userlevel'><tr><td class='end'><img src='"
191
-                     . $rpg_images['img_left']
192
-                     . "' alt='' /></td><td class='center' background='"
193
-                     . $rpg_images['img_backing']
194
-                     . "'><img src='%s' width='%d' alt='' class='icon_left' /></td><td><img src='"
195
-                     . $rpg_images['img_right']
196
-                     . "' alt='' /></td></tr></table>";
191
+                        . $rpg_images['img_left']
192
+                        . "' alt='' /></td><td class='center' background='"
193
+                        . $rpg_images['img_backing']
194
+                        . "'><img src='%s' width='%d' alt='' class='icon_left' /></td><td><img src='"
195
+                        . $rpg_images['img_right']
196
+                        . "' alt='' /></td></tr></table>";
197 197
 
198 198
             $info = _MD_NEWBB_LEVEL . ' ' . $level['level'] . '<br><span title="' . _MD_NEWBB_HP_DESC . '">' . _MD_NEWBB_HP . ' ' . $level['hp'] . ' / ' . $level['hp_max'] . '</span><br>' . sprintf($table, $rpg_images['orange'], $level['hp_width']);
199 199
             $info .= '<span title="' . _MD_NEWBB_MP_DESC . '">' . _MD_NEWBB_MP . ' ' . $level['mp'] . ' / ' . $level['mp_max'] . '</span><br>' . sprintf($table, $rpg_images['green'], $level['mp_width']);
Please login to merge, or discard this patch.
class/TopicRenderer.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -488,22 +488,22 @@  discard block
 block discarded – undo
488 488
                 'sort'  => 't.topic_views'
489 489
             ],
490 490
             'lastpost'        => [ // irmtfan show topic_page_jump_icon smarty
491
-                                   'title' => _MD_NEWBB_LASTPOST,
492
-                                   /*irmtfan _MD_NEWBB_DATE to _MD_NEWBB_LASTPOSTTIME again change to _MD_LASTPOST*/
493
-                                   'sort'  => 't.topic_last_post_id'
491
+                                    'title' => _MD_NEWBB_LASTPOST,
492
+                                    /*irmtfan _MD_NEWBB_DATE to _MD_NEWBB_LASTPOSTTIME again change to _MD_LASTPOST*/
493
+                                    'sort'  => 't.topic_last_post_id'
494 494
             ],
495 495
             // START irmtfan add more sorts
496 496
             'lastposttime'    => [ // irmtfan same as lastpost
497
-                                   'title' => _MD_NEWBB_LASTPOSTTIME,
498
-                                   'sort'  => 't.topic_last_post_id'
497
+                                    'title' => _MD_NEWBB_LASTPOSTTIME,
498
+                                    'sort'  => 't.topic_last_post_id'
499 499
             ],
500 500
             'lastposter'      => [ // irmtfan
501
-                                   'title' => _MD_NEWBB_POSTER,
502
-                                   'sort'  => 'p.uid',// poster uid
501
+                                    'title' => _MD_NEWBB_POSTER,
502
+                                    'sort'  => 'p.uid',// poster uid
503 503
             ],
504 504
             'lastpostmsgicon' => [ // irmtfan
505
-                                   'title' => _MD_NEWBB_MESSAGEICON,
506
-                                   'sort'  => 'p.icon',// post message icon
505
+                                    'title' => _MD_NEWBB_MESSAGEICON,
506
+                                    'sort'  => 'p.icon',// post message icon
507 507
             ],
508 508
             'ratings'         => [
509 509
                 'title' => _MD_NEWBB_RATINGS,
@@ -855,7 +855,7 @@  discard block
 block discarded – undo
855 855
         $wheres[] = '1 = 1';
856 856
 
857 857
         $sql = '    SELECT ' . implode(', ', $selects) . '     FROM ' . implode(', ', $froms) . '        ' . implode(' ', $joins) . (!empty($this->query['join']) ? '        ' . implode(' ', $this->query['join']) : '') . // irmtfan bug fix: Undefined index: join when post_excerpt = 0
858
-               '     WHERE ' . implode(' AND ', $wheres) . '        AND ' . @implode(' AND ', @$this->query['where']);
858
+                '     WHERE ' . implode(' AND ', $wheres) . '        AND ' . @implode(' AND ', @$this->query['where']);
859 859
 
860 860
         if (!$result = $this->handler->db->query($sql)) {
861 861
             return 0;
@@ -907,7 +907,7 @@  discard block
 block discarded – undo
907 907
         //if (empty($this->query["sort"])) $this->query["sort"][] = 't.topic_last_post_id DESC'; // irmtfan commented no need
908 908
 
909 909
         $sql = '    SELECT ' . implode(', ', $selects) . '     FROM ' . implode(', ', $froms) . '        ' . implode(' ', $joins) . (!empty($this->query['join']) ? '        ' . implode(' ', $this->query['join']) : '') . // irmtfan bug fix: Undefined index join when post_excerpt = 0
910
-               '     WHERE ' . implode(' AND ', $wheres) . '        AND ' . @implode(' AND ', @$this->query['where']) . '     ORDER BY ' . implode(', ', $this->query['sort']);
910
+                '     WHERE ' . implode(' AND ', $wheres) . '        AND ' . @implode(' AND ', @$this->query['where']) . '     ORDER BY ' . implode(', ', $this->query['sort']);
911 911
 
912 912
         if (!$result = $this->handler->db->query($sql, $this->config['topics_per_page'], @$this->vars['start'])) {
913 913
             if (is_object($xoopsTpl)) {
Please login to merge, or discard this patch.
class/plugins/plugin.tag.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -85,14 +85,14 @@
 block discarded – undo
85 85
 
86 86
     /* clear tag-item links */
87 87
     $sql = "    DELETE FROM {$linkHandler->table}"
88
-           . '    WHERE '
89
-           . "        tag_modid = {$mid}"
90
-           . '        AND '
91
-           . '        ( tag_itemid NOT IN '
92
-           . "            ( SELECT DISTINCT {$itemHandler->keyName} "
93
-           . "                FROM {$itemHandler->table} "
94
-           . "                WHERE {$itemHandler->table}.approved > 0"
95
-           . '            ) '
96
-           . '        )';
88
+            . '    WHERE '
89
+            . "        tag_modid = {$mid}"
90
+            . '        AND '
91
+            . '        ( tag_itemid NOT IN '
92
+            . "            ( SELECT DISTINCT {$itemHandler->keyName} "
93
+            . "                FROM {$itemHandler->table} "
94
+            . "                WHERE {$itemHandler->table}.approved > 0"
95
+            . '            ) '
96
+            . '        )';
97 97
     $linkHandler->db->queryF($sql);
98 98
 }
Please login to merge, or discard this patch.
rss.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -124,27 +124,27 @@
 block discarded – undo
124 124
     $approveCriteria = ' AND t.approved = 1 AND p.approved = 1';
125 125
 
126 126
     $query = 'SELECT'
127
-             . '    f.forum_id, f.forum_name,'
128
-             . '    t.topic_id, t.topic_title, t.type_id,'
129
-             . '    p.post_id, p.post_time, p.subject, p.uid, p.poster_name, p.post_karma, p.require_reply, '
130
-             . '    pt.dohtml, pt.dosmiley, pt.doxcode, pt.dobr,'
131
-             . '    pt.post_text'
132
-             . '    FROM '
133
-             . $GLOBALS['xoopsDB']->prefix('newbb_posts')
134
-             . ' AS p'
135
-             . '    LEFT JOIN '
136
-             . $GLOBALS['xoopsDB']->prefix('newbb_topics')
137
-             . ' AS t ON t.topic_last_post_id=p.post_id'
138
-             . '    LEFT JOIN '
139
-             . $GLOBALS['xoopsDB']->prefix('newbb_posts_text')
140
-             . ' AS pt ON pt.post_id=p.post_id'
141
-             . '    LEFT JOIN '
142
-             . $GLOBALS['xoopsDB']->prefix('newbb_forums')
143
-             . ' AS f ON f.forum_id=p.forum_id'
144
-             . '    WHERE 1=1 '
145
-             . $forumCriteria
146
-             . $approveCriteria
147
-             . ' ORDER BY p.post_id DESC';
127
+                . '    f.forum_id, f.forum_name,'
128
+                . '    t.topic_id, t.topic_title, t.type_id,'
129
+                . '    p.post_id, p.post_time, p.subject, p.uid, p.poster_name, p.post_karma, p.require_reply, '
130
+                . '    pt.dohtml, pt.dosmiley, pt.doxcode, pt.dobr,'
131
+                . '    pt.post_text'
132
+                . '    FROM '
133
+                . $GLOBALS['xoopsDB']->prefix('newbb_posts')
134
+                . ' AS p'
135
+                . '    LEFT JOIN '
136
+                . $GLOBALS['xoopsDB']->prefix('newbb_topics')
137
+                . ' AS t ON t.topic_last_post_id=p.post_id'
138
+                . '    LEFT JOIN '
139
+                . $GLOBALS['xoopsDB']->prefix('newbb_posts_text')
140
+                . ' AS pt ON pt.post_id=p.post_id'
141
+                . '    LEFT JOIN '
142
+                . $GLOBALS['xoopsDB']->prefix('newbb_forums')
143
+                . ' AS f ON f.forum_id=p.forum_id'
144
+                . '    WHERE 1=1 '
145
+                . $forumCriteria
146
+                . $approveCriteria
147
+                . ' ORDER BY p.post_id DESC';
148 148
     $limit = (int)($GLOBALS['xoopsModuleConfig']['rss_maxitems'] * 1.5);
149 149
     if (!$result = $GLOBALS['xoopsDB']->query($query, $limit)) {
150 150
         newbbTrackbackResponse(1, _MD_NEWBB_ERROR);
Please login to merge, or discard this patch.
blocks/newbb_block.php 1 patch
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -115,25 +115,25 @@  discard block
 block discarded – undo
115 115
     }
116 116
 
117 117
     $query = 'SELECT'
118
-             . '    t.topic_id, t.topic_replies, t.forum_id, t.topic_title, t.topic_views, t.type_id,'
119
-             . '    f.forum_name,t.topic_status,'
120
-             . '    p.post_id, p.post_time, p.icon, p.uid, p.poster_name'
121
-             . '    FROM '
122
-             . $GLOBALS['xoopsDB']->prefix('newbb_topics')
123
-             . ' AS t '
124
-             . '    LEFT JOIN '
125
-             . $GLOBALS['xoopsDB']->prefix('newbb_posts')
126
-             . ' AS p ON t.topic_last_post_id=p.post_id'
127
-             . '    LEFT JOIN '
128
-             . $GLOBALS['xoopsDB']->prefix('newbb_forums')
129
-             . ' AS f ON f.forum_id=t.forum_id'
130
-             . '    WHERE 1=1 '
131
-             . $forumCriteria
132
-             . $approveCriteria
133
-             . $extraCriteria
134
-             . ' ORDER BY '
135
-             . $order
136
-             . ' DESC';
118
+                . '    t.topic_id, t.topic_replies, t.forum_id, t.topic_title, t.topic_views, t.type_id,'
119
+                . '    f.forum_name,t.topic_status,'
120
+                . '    p.post_id, p.post_time, p.icon, p.uid, p.poster_name'
121
+                . '    FROM '
122
+                . $GLOBALS['xoopsDB']->prefix('newbb_topics')
123
+                . ' AS t '
124
+                . '    LEFT JOIN '
125
+                . $GLOBALS['xoopsDB']->prefix('newbb_posts')
126
+                . ' AS p ON t.topic_last_post_id=p.post_id'
127
+                . '    LEFT JOIN '
128
+                . $GLOBALS['xoopsDB']->prefix('newbb_forums')
129
+                . ' AS f ON f.forum_id=t.forum_id'
130
+                . '    WHERE 1=1 '
131
+                . $forumCriteria
132
+                . $approveCriteria
133
+                . $extraCriteria
134
+                . ' ORDER BY '
135
+                . $order
136
+                . ' DESC';
137 137
 
138 138
     $result = $GLOBALS['xoopsDB']->query($query, $options[1], 0);
139 139
 
@@ -306,21 +306,21 @@  discard block
 block discarded – undo
306 306
     $approveCriteria = ' AND t.approved = 1';
307 307
 
308 308
     $query = 'SELECT'
309
-             . '    t.topic_id, t.topic_replies, t.forum_id, t.topic_title, t.topic_views, t.type_id, t.topic_time, t.topic_poster, t.poster_name,'
310
-             . '    f.forum_name'
311
-             . '    FROM '
312
-             . $GLOBALS['xoopsDB']->prefix('newbb_topics')
313
-             . ' AS t '
314
-             . '    LEFT JOIN '
315
-             . $GLOBALS['xoopsDB']->prefix('newbb_forums')
316
-             . ' AS f ON f.forum_id=t.forum_id'
317
-             . '    WHERE 1=1 '
318
-             . $forumCriteria
319
-             . $approveCriteria
320
-             . $extraCriteria
321
-             . ' ORDER BY '
322
-             . $order
323
-             . ' DESC';
309
+                . '    t.topic_id, t.topic_replies, t.forum_id, t.topic_title, t.topic_views, t.type_id, t.topic_time, t.topic_poster, t.poster_name,'
310
+                . '    f.forum_name'
311
+                . '    FROM '
312
+                . $GLOBALS['xoopsDB']->prefix('newbb_topics')
313
+                . ' AS t '
314
+                . '    LEFT JOIN '
315
+                . $GLOBALS['xoopsDB']->prefix('newbb_forums')
316
+                . ' AS f ON f.forum_id=t.forum_id'
317
+                . '    WHERE 1=1 '
318
+                . $forumCriteria
319
+                . $approveCriteria
320
+                . $extraCriteria
321
+                . ' ORDER BY '
322
+                . $order
323
+                . ' DESC';
324 324
 
325 325
     $result = $GLOBALS['xoopsDB']->query($query, $options[1], 0);
326 326
 
Please login to merge, or discard this patch.
reply.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -119,9 +119,9 @@
 block discarded – undo
119 119
 $xoopsTpl->assign('parentforum', $forumHandler->getParents($forumObject));
120 120
 
121 121
 $xoopsTpl->assign([
122
-                      'forum_id'   => $forumObject->getVar('forum_id'),
123
-                      'forum_name' => $forumObject->getVar('forum_name')
124
-                  ]);
122
+                        'forum_id'   => $forumObject->getVar('forum_id'),
123
+                        'forum_name' => $forumObject->getVar('forum_name')
124
+                    ]);
125 125
 
126 126
 if ($postParentObject->getVar('uid')) {
127 127
     $r_name = newbbGetUnameFromId($postParentObject->getVar('uid'), $GLOBALS['xoopsModuleConfig']['show_realname']);
Please login to merge, or discard this patch.
viewtopic.php 1 patch
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -209,12 +209,12 @@  discard block
 block discarded – undo
209 209
 // END irmtfan improve infobox
210 210
 
211 211
 $xoopsTpl->assign([
212
-                      'topic_title'    => '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/viewtopic.php?topic_id=' . $topic_id . '">' . $topicObject->getFullTitle() . '</a>',
213
-                      'forum_name'     => $forumObject->getVar('forum_name'),
214
-                      'lang_nexttopic' => _MD_NEWBB_NEXTTOPIC,
215
-                      'lang_prevtopic' => _MD_NEWBB_PREVTOPIC,
216
-                      'topic_status'   => $topicObject->getVar('topic_status')
217
-                  ]);
212
+                        'topic_title'    => '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/viewtopic.php?topic_id=' . $topic_id . '">' . $topicObject->getFullTitle() . '</a>',
213
+                        'forum_name'     => $forumObject->getVar('forum_name'),
214
+                        'lang_nexttopic' => _MD_NEWBB_NEXTTOPIC,
215
+                        'lang_prevtopic' => _MD_NEWBB_PREVTOPIC,
216
+                        'topic_status'   => $topicObject->getVar('topic_status')
217
+                    ]);
218 218
 
219 219
 //$categoryHandler = Newbb\Helper::getInstance()->getHandler('Category');
220 220
 $categoryObject = $categoryHandler->get($forumObject->getVar('cat_id'), ['cat_title']);
@@ -528,13 +528,13 @@  discard block
 block discarded – undo
528 528
                 $xp_config     = $configHandler->getConfigsByCat(0, $pollModuleHandler->getVar('mid'));
529 529
 
530 530
                 $GLOBALS['xoopsTpl']->assign([
531
-                                                 'is_visible'      => $isVisible,
532
-                                                 'visible_message' => $visibleMsg,
533
-                                                 'disp_votes'      => $xp_config['disp_vote_nums'],
534
-                                                 'lang_vote'       => constant('_MD_' . strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']) . '_VOTE'),
535
-                                                 'lang_results'    => constant('_MD_' . strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']) . '_RESULTS'),
536
-                                                 'back_link'       => ''
537
-                                             ]);
531
+                                                    'is_visible'      => $isVisible,
532
+                                                    'visible_message' => $visibleMsg,
533
+                                                    'disp_votes'      => $xp_config['disp_vote_nums'],
534
+                                                    'lang_vote'       => constant('_MD_' . strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']) . '_VOTE'),
535
+                                                    'lang_results'    => constant('_MD_' . strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']) . '_RESULTS'),
536
+                                                    'back_link'       => ''
537
+                                                ]);
538 538
                 $classRenderer = ucfirst($GLOBALS['xoopsModuleConfig']['poll_module']) . 'Renderer';
539 539
                 /** @var Xoopspoll\Renderer $renderer */
540 540
                 $renderer = new $classRenderer($pollObject);
@@ -687,18 +687,18 @@  discard block
 block discarded – undo
687 687
 }
688 688
 
689 689
 $xoopsTpl->assign([
690
-                      'lang_forum_index' => sprintf(_MD_NEWBB_FORUMINDEX, htmlspecialchars($GLOBALS['xoopsConfig']['sitename'], ENT_QUOTES)),
691
-                      'lang_from'        => _MD_NEWBB_FROM,
692
-                      'lang_joined'      => _MD_NEWBB_JOINED,
693
-                      'lang_posts'       => _MD_NEWBB_POSTS,
694
-                      'lang_poster'      => _MD_NEWBB_POSTER,
695
-                      'lang_thread'      => _MD_NEWBB_THREAD,
696
-                      'lang_edit'        => _EDIT,
697
-                      'lang_delete'      => _DELETE,
698
-                      'lang_reply'       => _REPLY,
699
-                      'lang_postedon'    => _MD_NEWBB_POSTEDON,
700
-                      'lang_groups'      => _MD_NEWBB_GROUPS
701
-                  ]);
690
+                        'lang_forum_index' => sprintf(_MD_NEWBB_FORUMINDEX, htmlspecialchars($GLOBALS['xoopsConfig']['sitename'], ENT_QUOTES)),
691
+                        'lang_from'        => _MD_NEWBB_FROM,
692
+                        'lang_joined'      => _MD_NEWBB_JOINED,
693
+                        'lang_posts'       => _MD_NEWBB_POSTS,
694
+                        'lang_poster'      => _MD_NEWBB_POSTER,
695
+                        'lang_thread'      => _MD_NEWBB_THREAD,
696
+                        'lang_edit'        => _EDIT,
697
+                        'lang_delete'      => _DELETE,
698
+                        'lang_reply'       => _REPLY,
699
+                        'lang_postedon'    => _MD_NEWBB_POSTEDON,
700
+                        'lang_groups'      => _MD_NEWBB_GROUPS
701
+                    ]);
702 702
 
703 703
 $viewmode_options = [];
704 704
 if ('DESC' === $order) {
Please login to merge, or discard this patch.
delete.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -144,13 +144,13 @@
 block discarded – undo
144 144
           </div>';
145 145
     if ($isAdmin) {
146 146
         xoops_confirm([
147
-                          'post_id'  => $post_id,
148
-                          'viewmode' => $viewmode,
149
-                          'order'    => $order,
150
-                          'forum'    => $forum,
151
-                          'topic_id' => $topic_id,
152
-                          'ok'       => 99
153
-                      ], 'delete.php', _MD_NEWBB_DEL_RELATED);
147
+                            'post_id'  => $post_id,
148
+                            'viewmode' => $viewmode,
149
+                            'order'    => $order,
150
+                            'forum'    => $forum,
151
+                            'topic_id' => $topic_id,
152
+                            'ok'       => 99
153
+                        ], 'delete.php', _MD_NEWBB_DEL_RELATED);
154 154
     }
155 155
     include $GLOBALS['xoops']->path('footer.php');
156 156
 }
Please login to merge, or discard this patch.