@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | { |
40 | 40 | $ret = []; |
41 | 41 | |
42 | - $forums = (is_array($forums) ? array_filter(array_map('intval', array_map('trim', $forums))) : (empty($forums) ? 0 : [(int)$forums])); |
|
42 | + $forums = (is_array($forums) ? array_filter(array_map('intval', array_map('trim', $forums))) : (empty($forums) ? 0 : [(int) $forums])); |
|
43 | 43 | |
44 | 44 | $sql = ' SELECT o.type_id, o.type_name, o.type_color, l.type_order' |
45 | 45 | . ' FROM ' |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | . " LEFT JOIN {$this->table} AS o ON o.{$this->keyName} = l.{$this->keyName} " |
49 | 49 | . ' WHERE ' |
50 | 50 | . ' l.forum_id ' |
51 | - . (empty($forums) ? 'IS NOT NULL' : 'IN (' . implode(', ', $forums) . ')') |
|
51 | + . (empty($forums) ? 'IS NOT NULL' : 'IN ('.implode(', ', $forums).')') |
|
52 | 52 | . ' ORDER BY l.type_order ASC'; |
53 | 53 | if (false === ($result = $this->db->query($sql))) { |
54 | 54 | //xoops_error($this->db->error()); |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | */ |
77 | 77 | public function updateByForum($forum_id, $types) |
78 | 78 | { |
79 | - $forum_id = (int)$forum_id; |
|
79 | + $forum_id = (int) $forum_id; |
|
80 | 80 | if (empty($forum_id)) { |
81 | 81 | return false; |
82 | 82 | } |
@@ -104,8 +104,8 @@ discard block |
||
104 | 104 | $types_update = array_filter($types_update); |
105 | 105 | |
106 | 106 | if (!empty($types_valid)) { |
107 | - $sql = 'DELETE FROM ' . $this->db->prefix('newbb_type_forum') . ' WHERE ' . ' forum_id = ' . $forum_id . ' AND ' . // irmtfan bug fix: delete other forums types when update the type for a specific forum |
|
108 | - " {$this->keyName} NOT IN (" . implode(', ', $types_valid) . ')'; |
|
107 | + $sql = 'DELETE FROM '.$this->db->prefix('newbb_type_forum').' WHERE '.' forum_id = '.$forum_id.' AND '.// irmtfan bug fix: delete other forums types when update the type for a specific forum |
|
108 | + " {$this->keyName} NOT IN (".implode(', ', $types_valid).')'; |
|
109 | 109 | if (false === ($result = $this->db->queryF($sql))) { |
110 | 110 | } |
111 | 111 | } |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | if ($types_existing[$key]['type_order'] == $order) { |
118 | 118 | continue; |
119 | 119 | } |
120 | - $sql = 'UPDATE ' . $this->db->prefix('newbb_type_forum') . " SET type_order = {$order}" . " WHERE {$this->keyName} = {$key} AND forum_id = {$forum_id}"; |
|
120 | + $sql = 'UPDATE '.$this->db->prefix('newbb_type_forum')." SET type_order = {$order}"." WHERE {$this->keyName} = {$key} AND forum_id = {$forum_id}"; |
|
121 | 121 | if (false === ($result = $this->db->queryF($sql))) { |
122 | 122 | } |
123 | 123 | } |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | //if (!in_array($key, $types_add)) continue; |
131 | 131 | $type_query[] = "({$key}, {$forum_id}, {$order})"; |
132 | 132 | } |
133 | - $sql = 'INSERT INTO ' . $this->db->prefix('newbb_type_forum') . ' (type_id, forum_id, type_order) ' . ' VALUES ' . implode(', ', $type_query); |
|
133 | + $sql = 'INSERT INTO '.$this->db->prefix('newbb_type_forum').' (type_id, forum_id, type_order) '.' VALUES '.implode(', ', $type_query); |
|
134 | 134 | if (false === ($result = $this->db->queryF($sql))) { |
135 | 135 | //xoops_error($this->db->error()); |
136 | 136 | } |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | /* |
157 | 157 | * Remove forum-type links |
158 | 158 | */ |
159 | - $sql = 'DELETE' . ' FROM ' . $this->db->prefix('newbb_type_forum') . ' WHERE ' . $this->keyName . ' = ' . $object->getVar($this->keyName); |
|
159 | + $sql = 'DELETE'.' FROM '.$this->db->prefix('newbb_type_forum').' WHERE '.$this->keyName.' = '.$object->getVar($this->keyName); |
|
160 | 160 | if (false === ($result = $this->db->{$queryFunc}($sql))) { |
161 | 161 | // xoops_error($this->db->error()); |
162 | 162 | } |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | /* |
165 | 165 | * Reset topic type linked to this type |
166 | 166 | */ |
167 | - $sql = 'UPATE' . ' ' . $this->db->prefix('newbb_topics') . ' SET ' . $this->keyName . '=0' . ' WHERE ' . $this->keyName . ' = ' . $object->getVar($this->keyName); |
|
167 | + $sql = 'UPATE'.' '.$this->db->prefix('newbb_topics').' SET '.$this->keyName.'=0'.' WHERE '.$this->keyName.' = '.$object->getVar($this->keyName); |
|
168 | 168 | if (false === ($result = $this->db->{$queryFunc}($sql))) { |
169 | 169 | //xoops_error($this->db->error()); |
170 | 170 | } |
@@ -183,11 +183,11 @@ discard block |
||
183 | 183 | public function cleanOrphan($table_link = '', $field_link = '', $field_object = '') //cleanOrphan() |
184 | 184 | { |
185 | 185 | /* clear forum-type links */ |
186 | - $sql = 'DELETE FROM ' . $this->db->prefix('newbb_type_forum') . " WHERE ({$this->keyName} NOT IN ( SELECT DISTINCT {$this->keyName} FROM {$this->table}) )"; |
|
186 | + $sql = 'DELETE FROM '.$this->db->prefix('newbb_type_forum')." WHERE ({$this->keyName} NOT IN ( SELECT DISTINCT {$this->keyName} FROM {$this->table}) )"; |
|
187 | 187 | $this->db->queryF($sql); |
188 | 188 | |
189 | 189 | /* reconcile topic-type link */ |
190 | - $sql = 'UPATE ' . $this->db->prefix('newbb_topics') . " SET {$this->keyName} = 0" . " WHERE ({$this->keyName} NOT IN ( SELECT DISTINCT {$this->keyName} FROM {$this->table}) )"; |
|
190 | + $sql = 'UPATE '.$this->db->prefix('newbb_topics')." SET {$this->keyName} = 0"." WHERE ({$this->keyName} NOT IN ( SELECT DISTINCT {$this->keyName} FROM {$this->table}) )"; |
|
191 | 191 | $this->db->queryF($sql); |
192 | 192 | |
193 | 193 | return true; |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | switch ($var) { |
109 | 109 | case 'forum': |
110 | 110 | if (is_numeric($val)) { |
111 | - $val = (int)$val; |
|
111 | + $val = (int) $val; |
|
112 | 112 | // START irmtfan - if the forum is array |
113 | 113 | } elseif (is_array($val)) { |
114 | 114 | $val = implode('|', $val); |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | case 'order': |
124 | 124 | case 'start': |
125 | 125 | case 'since': |
126 | - $val = (int)$val; |
|
126 | + $val = (int) $val; |
|
127 | 127 | break; |
128 | 128 | |
129 | 129 | case 'uid': // irmtfan add multi topic poster |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | // START irmtfan use read_uid to find the unread posts when the user is logged in |
233 | 233 | $read_uid = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('uid') : 0; |
234 | 234 | if (!empty($read_uid)) { |
235 | - $this->query['join'][] = 'LEFT JOIN ' . $this->handler->db->prefix('newbb_reads_topic') . ' AS r ON r.read_item = t.topic_id AND r.uid = ' . $read_uid . ' '; |
|
235 | + $this->query['join'][] = 'LEFT JOIN '.$this->handler->db->prefix('newbb_reads_topic').' AS r ON r.read_item = t.topic_id AND r.uid = '.$read_uid.' '; |
|
236 | 236 | $this->query['where'][] = 'r.post_id = t.topic_last_post_id'; |
237 | 237 | } else { |
238 | 238 | } |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | if ($lastvisit = max($GLOBALS['last_visit'], $startdate)) { |
245 | 245 | $readmode1query = ''; |
246 | 246 | if ($lastvisit > $startdate) { |
247 | - $readmode1query = 'p.post_time < ' . $lastvisit; |
|
247 | + $readmode1query = 'p.post_time < '.$lastvisit; |
|
248 | 248 | } |
249 | 249 | $topics = []; |
250 | 250 | $topic_lastread = newbbGetCookie('LT', true); |
@@ -256,9 +256,9 @@ discard block |
||
256 | 256 | } |
257 | 257 | } |
258 | 258 | if (count($topics) > 0) { |
259 | - $topicquery = ' t.topic_id IN (' . implode(',', $topics) . ')'; |
|
259 | + $topicquery = ' t.topic_id IN ('.implode(',', $topics).')'; |
|
260 | 260 | // because it should be OR |
261 | - $readmode1query = !empty($readmode1query) ? '(' . $readmode1query . ' OR ' . $topicquery . ')' : $topicquery; |
|
261 | + $readmode1query = !empty($readmode1query) ? '('.$readmode1query.' OR '.$topicquery.')' : $topicquery; |
|
262 | 262 | } |
263 | 263 | $this->query['where'][] = $readmode1query; |
264 | 264 | } |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | // START irmtfan use read_uid to find the unread posts when the user is logged in |
275 | 275 | $read_uid = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('uid') : 0; |
276 | 276 | if (!empty($read_uid)) { |
277 | - $this->query['join'][] = 'LEFT JOIN ' . $this->handler->db->prefix('newbb_reads_topic') . ' AS r ON r.read_item = t.topic_id AND r.uid = ' . $read_uid . ' '; |
|
277 | + $this->query['join'][] = 'LEFT JOIN '.$this->handler->db->prefix('newbb_reads_topic').' AS r ON r.read_item = t.topic_id AND r.uid = '.$read_uid.' '; |
|
278 | 278 | $this->query['where'][] = '(r.read_id IS NULL OR r.post_id < t.topic_last_post_id)'; |
279 | 279 | } else { |
280 | 280 | } |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | $startdate = !empty($this->vars['since']) ? (time() - newbbGetSinceTime($this->vars['since'])) : 0; |
286 | 286 | if ($lastvisit = max($GLOBALS['last_visit'], $startdate)) { |
287 | 287 | if ($lastvisit > $startdate) { |
288 | - $this->query['where'][] = 'p.post_time > ' . $lastvisit; |
|
288 | + $this->query['where'][] = 'p.post_time > '.$lastvisit; |
|
289 | 289 | } |
290 | 290 | $topics = []; |
291 | 291 | $topic_lastread = newbbGetCookie('LT', true); |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | } |
298 | 298 | } |
299 | 299 | if (count($topics) > 0) { |
300 | - $this->query['where'][] = ' t.topic_id NOT IN (' . implode(',', $topics) . ')'; |
|
300 | + $this->query['where'][] = ' t.topic_id NOT IN ('.implode(',', $topics).')'; |
|
301 | 301 | } |
302 | 302 | } |
303 | 303 | // END irmtfan fix read_mode = 1 bugs - for all users (member and anon) |
@@ -356,20 +356,20 @@ discard block |
||
356 | 356 | //} elseif (count($accessForums) === 1) { |
357 | 357 | //$this->query["where"][] = "t.forum_id = " . $accessForums[0]; |
358 | 358 | } else { |
359 | - $this->query['where'][] = 't.forum_id IN ( ' . implode(', ', $accessForums) . ' )'; |
|
359 | + $this->query['where'][] = 't.forum_id IN ( '.implode(', ', $accessForums).' )'; |
|
360 | 360 | } |
361 | 361 | break; |
362 | 362 | |
363 | 363 | case 'uid': // irmtfan add multi topic poster |
364 | 364 | if (-1 !== $val) { |
365 | 365 | $val = implode(',', array_map('intval', explode(',', $val))); |
366 | - $this->query['where'][] = 't.topic_poster IN ( ' . $val . ' )'; |
|
366 | + $this->query['where'][] = 't.topic_poster IN ( '.$val.' )'; |
|
367 | 367 | } |
368 | 368 | break; |
369 | 369 | case 'lastposter': // irmtfan add multi lastposter |
370 | 370 | if (-1 !== $val) { |
371 | 371 | $val = implode(',', array_map('intval', explode(',', $val))); |
372 | - $this->query['where'][] = 'p.uid IN ( ' . $val . ' )'; |
|
372 | + $this->query['where'][] = 'p.uid IN ( '.$val.' )'; |
|
373 | 373 | } |
374 | 374 | break; |
375 | 375 | |
@@ -383,17 +383,17 @@ discard block |
||
383 | 383 | } |
384 | 384 | // irmtfan digest_time | to accept multiple status |
385 | 385 | if (in_array('digest', explode(',', $this->vars['status'], true))) { |
386 | - $this->query['where'][] = 't.digest_time > ' . $startdate; |
|
386 | + $this->query['where'][] = 't.digest_time > '.$startdate; |
|
387 | 387 | } |
388 | 388 | // irmtfan - should be >= instead of = |
389 | - $this->query['where'][] = 'p.post_time >= ' . $startdate; |
|
389 | + $this->query['where'][] = 'p.post_time >= '.$startdate; |
|
390 | 390 | // END irmtfan if unread && read_mode = 1 and last_visit > startdate do not add where query |
391 | 391 | } |
392 | 392 | break; |
393 | 393 | |
394 | 394 | case 'type': |
395 | 395 | if (!empty($val)) { |
396 | - $this->query['where'][] = 't.type_id = ' . $val; |
|
396 | + $this->query['where'][] = 't.type_id = '.$val; |
|
397 | 397 | } |
398 | 398 | break; |
399 | 399 | |
@@ -412,9 +412,9 @@ discard block |
||
412 | 412 | |
413 | 413 | case 'sort': |
414 | 414 | if ($sort = $this->getSort($val, 'sort')) { |
415 | - $this->query['sort'][] = $sort . (empty($this->vars['order']) ? ' DESC' : ' ASC'); |
|
415 | + $this->query['sort'][] = $sort.(empty($this->vars['order']) ? ' DESC' : ' ASC'); |
|
416 | 416 | } else { // irmtfan if sort is not in the list |
417 | - $this->query['sort'][] = 't.topic_last_post_id' . (empty($this->vars['order']) ? ' DESC' : ' ASC'); |
|
417 | + $this->query['sort'][] = 't.topic_last_post_id'.(empty($this->vars['order']) ? ' DESC' : ' ASC'); |
|
418 | 418 | } |
419 | 419 | break; |
420 | 420 | |
@@ -485,23 +485,23 @@ discard block |
||
485 | 485 | 'title' => _MD_NEWBB_VIEWS, |
486 | 486 | 'sort' => 't.topic_views' |
487 | 487 | ], |
488 | - 'lastpost' => [ // irmtfan show topic_page_jump_icon smarty |
|
488 | + 'lastpost' => [// irmtfan show topic_page_jump_icon smarty |
|
489 | 489 | 'title' => _MD_NEWBB_LASTPOST, |
490 | 490 | /*irmtfan _MD_NEWBB_DATE to _MD_NEWBB_LASTPOSTTIME again change to _MD_LASTPOST*/ |
491 | 491 | 'sort' => 't.topic_last_post_id' |
492 | 492 | ], |
493 | 493 | // START irmtfan add more sorts |
494 | - 'lastposttime' => [ // irmtfan same as lastpost |
|
494 | + 'lastposttime' => [// irmtfan same as lastpost |
|
495 | 495 | 'title' => _MD_NEWBB_LASTPOSTTIME, |
496 | 496 | 'sort' => 't.topic_last_post_id' |
497 | 497 | ], |
498 | - 'lastposter' => [ // irmtfan |
|
498 | + 'lastposter' => [// irmtfan |
|
499 | 499 | 'title' => _MD_NEWBB_POSTER, |
500 | - 'sort' => 'p.uid',// poster uid |
|
500 | + 'sort' => 'p.uid', // poster uid |
|
501 | 501 | ], |
502 | - 'lastpostmsgicon' => [ // irmtfan |
|
502 | + 'lastpostmsgicon' => [// irmtfan |
|
503 | 503 | 'title' => _MD_NEWBB_MESSAGEICON, |
504 | - 'sort' => 'p.icon',// post message icon |
|
504 | + 'sort' => 'p.icon', // post message icon |
|
505 | 505 | ], |
506 | 506 | 'ratings' => [ |
507 | 507 | 'title' => _MD_NEWBB_RATINGS, |
@@ -532,7 +532,7 @@ discard block |
||
532 | 532 | 'sort' => 't.poll_id' |
533 | 533 | ] |
534 | 534 | ]; |
535 | - $types = $this->getTypes(); |
|
535 | + $types = $this->getTypes(); |
|
536 | 536 | if (!empty($types)) { |
537 | 537 | $headers['type'] = [ |
538 | 538 | 'title' => _MD_NEWBB_TYPE, |
@@ -575,7 +575,7 @@ discard block |
||
575 | 575 | // additional headers - important: those cannot be in sort anyway |
576 | 576 | $headers = array_merge($headersSort, [ |
577 | 577 | 'attachment' => _MD_NEWBB_TOPICSHASATT, // show attachment smarty |
578 | - 'read' => _MD_NEWBB_MARK_UNREAD . '|' . _MD_NEWBB_MARK_READ, // read/unread show topic_folder smarty |
|
578 | + 'read' => _MD_NEWBB_MARK_UNREAD.'|'._MD_NEWBB_MARK_READ, // read/unread show topic_folder smarty |
|
579 | 579 | 'pagenav' => _MD_NEWBB_PAGENAV_DISPLAY, // show topic_page_jump smarty - sort by topic_replies? |
580 | 580 | ]); |
581 | 581 | |
@@ -591,7 +591,7 @@ discard block |
||
591 | 591 | */ |
592 | 592 | public function getStatus($type = null, $status = null) |
593 | 593 | { |
594 | - $links = [ |
|
594 | + $links = [ |
|
595 | 595 | //"" => "", /* irmtfan remove empty array */ |
596 | 596 | 'all' => _ALL, |
597 | 597 | 'digest' => _MD_NEWBB_DIGEST, |
@@ -619,7 +619,7 @@ discard block |
||
619 | 619 | |
620 | 620 | // all status, for admin |
621 | 621 | if ($type > 1) { |
622 | - $links = array_merge($links, $links_admin);// irmtfan to accept multiple status |
|
622 | + $links = array_merge($links, $links_admin); // irmtfan to accept multiple status |
|
623 | 623 | } |
624 | 624 | |
625 | 625 | return $this->getFromKeys($links, $status); // irmtfan to accept multiple status |
@@ -633,10 +633,10 @@ discard block |
||
633 | 633 | { |
634 | 634 | $selection = ['action' => $this->page]; |
635 | 635 | $selection['vars'] = $this->vars; |
636 | - require_once dirname(__DIR__) . '/include/functions.forum.php'; |
|
636 | + require_once dirname(__DIR__).'/include/functions.forum.php'; |
|
637 | 637 | $forum_selected = empty($this->vars['forum']) ? null : explode('|', @$this->vars['forum']); |
638 | 638 | $selection['forum'] = '<select name="forum[]" multiple="multiple">'; |
639 | - $selection['forum'] .= '<option value="0">' . _MD_NEWBB_ALL . '</option>'; |
|
639 | + $selection['forum'] .= '<option value="0">'._MD_NEWBB_ALL.'</option>'; |
|
640 | 640 | $selection['forum'] .= newbbForumSelectBox($forum_selected); |
641 | 641 | $selection['forum'] .= '</select>'; |
642 | 642 | |
@@ -647,13 +647,13 @@ discard block |
||
647 | 647 | throw new \RuntimeException('$sorts must be an array.'); |
648 | 648 | } |
649 | 649 | foreach ($sorts as $sort => $title) { |
650 | - $selection['sort'] .= "<option value='" . $sort . "' " . (($sort == $sort_selected) ? " selected='selected'" : '') . '>' . $title . '</option>'; |
|
650 | + $selection['sort'] .= "<option value='".$sort."' ".(($sort == $sort_selected) ? " selected='selected'" : '').'>'.$title.'</option>'; |
|
651 | 651 | } |
652 | 652 | $selection['sort'] .= '</select>'; |
653 | 653 | |
654 | 654 | $selection['order'] = "<select name='order'>"; |
655 | - $selection['order'] .= "<option value='0' " . (empty($this->vars['order']) ? " selected='selected'" : '') . '>' . _DESCENDING . '</option>'; |
|
656 | - $selection['order'] .= "<option value='1' " . (!empty($this->vars['order']) ? " selected='selected'" : '') . '>' . _ASCENDING . '</option>'; |
|
655 | + $selection['order'] .= "<option value='0' ".(empty($this->vars['order']) ? " selected='selected'" : '').'>'._DESCENDING.'</option>'; |
|
656 | + $selection['order'] .= "<option value='1' ".(!empty($this->vars['order']) ? " selected='selected'" : '').'>'._ASCENDING.'</option>'; |
|
657 | 657 | $selection['order'] .= '</select>'; |
658 | 658 | |
659 | 659 | $since = isset($this->vars['since']) ? $this->vars['since'] : $this->config['since_default']; |
@@ -696,10 +696,10 @@ discard block |
||
696 | 696 | foreach ($headers as $header => $title) { |
697 | 697 | $_args = ["sort={$header}"]; |
698 | 698 | if (@$this->vars['sort'] == $header) { |
699 | - $_args[] = 'order=' . ((@$this->vars['order'] + 1) % 2); |
|
699 | + $_args[] = 'order='.((@$this->vars['order'] + 1) % 2); |
|
700 | 700 | } |
701 | 701 | $headers_data[$header]['title'] = $title; |
702 | - $headers_data[$header]['link'] = $this->page . '?' . implode('&', array_merge($args, $_args)); |
|
702 | + $headers_data[$header]['link'] = $this->page.'?'.implode('&', array_merge($args, $_args)); |
|
703 | 703 | } |
704 | 704 | $xoopsTpl->assign_by_ref('headers', $headers_data); |
705 | 705 | } |
@@ -723,7 +723,7 @@ discard block |
||
723 | 723 | foreach ($links as $link => $title) { |
724 | 724 | $_args = ["status={$link}"]; |
725 | 725 | $status[$link]['title'] = $title; |
726 | - $status[$link]['link'] = $this->page . '?' . implode('&', array_merge($args, $_args)); |
|
726 | + $status[$link]['link'] = $this->page.'?'.implode('&', array_merge($args, $_args)); |
|
727 | 727 | } |
728 | 728 | $xoopsTpl->assign_by_ref('filters', $status); |
729 | 729 | } |
@@ -771,7 +771,7 @@ discard block |
||
771 | 771 | foreach ($types as $id => $type) { |
772 | 772 | $_args = ["type={$id}"]; |
773 | 773 | $status[$id]['title'] = $type['type_name']; |
774 | - $status[$id]['link'] = $this->page . '?' . implode('&', array_merge($args, $_args)); |
|
774 | + $status[$id]['link'] = $this->page.'?'.implode('&', array_merge($args, $_args)); |
|
775 | 775 | } |
776 | 776 | $xoopsTpl->assign_by_ref('types', $status); |
777 | 777 | } |
@@ -794,7 +794,7 @@ discard block |
||
794 | 794 | $status = []; |
795 | 795 | $status['title'] = implode(',', $this->getStatus($this->userlevel, $this->vars['status'])); // irmtfan to accept multiple status |
796 | 796 | //$status['link'] = $this->page.(empty($this->vars['status']) ? '' : '?status='.$this->vars['status']); |
797 | - $status['link'] = $this->page . (empty($args) ? '' : '?' . implode('&', $args)); |
|
797 | + $status['link'] = $this->page.(empty($args) ? '' : '?'.implode('&', $args)); |
|
798 | 798 | |
799 | 799 | $xoopsTpl->assign_by_ref('current', $status); |
800 | 800 | } |
@@ -816,7 +816,7 @@ discard block |
||
816 | 816 | require_once $GLOBALS['xoops']->path('class/pagenav.php'); |
817 | 817 | $nav = new \XoopsPageNav($count_topic, $this->config['topics_per_page'], @$this->vars['start'], 'start', implode('&', $args)); |
818 | 818 | if (isset($GLOBALS['xoopsModuleConfig']['do_rewrite'])) { |
819 | - $nav->url = formatURL(Request::getString('SERVER_NAME', '', 'SERVER')) . ' /' . $nav->url; |
|
819 | + $nav->url = formatURL(Request::getString('SERVER_NAME', '', 'SERVER')).' /'.$nav->url; |
|
820 | 820 | } |
821 | 821 | if ('select' === $this->config['pagenav_display']) { |
822 | 822 | $navi = $nav->renderSelect(); |
@@ -848,12 +848,12 @@ discard block |
||
848 | 848 | // topic fields |
849 | 849 | $selects[] = 'COUNT(*)'; |
850 | 850 | |
851 | - $froms[] = $this->handler->db->prefix('newbb_topics') . ' AS t '; |
|
852 | - $joins[] = 'LEFT JOIN ' . $this->handler->db->prefix('newbb_posts') . ' AS p ON p.post_id = t.topic_last_post_id'; |
|
851 | + $froms[] = $this->handler->db->prefix('newbb_topics').' AS t '; |
|
852 | + $joins[] = 'LEFT JOIN '.$this->handler->db->prefix('newbb_posts').' AS p ON p.post_id = t.topic_last_post_id'; |
|
853 | 853 | $wheres[] = '1 = 1'; |
854 | 854 | |
855 | - $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 |
|
856 | - ' WHERE ' . implode(' AND ', $wheres) . ' AND ' . @implode(' AND ', @$this->query['where']); |
|
855 | + $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 |
|
856 | + ' WHERE '.implode(' AND ', $wheres).' AND '.@implode(' AND ', @$this->query['where']); |
|
857 | 857 | |
858 | 858 | if (!$result = $this->handler->db->query($sql)) { |
859 | 859 | return 0; |
@@ -894,18 +894,18 @@ discard block |
||
894 | 894 | // post fields |
895 | 895 | $selects[] = 'p.post_time as last_post_time, p.poster_name as last_poster_name, p.icon, p.post_id, p.uid'; |
896 | 896 | |
897 | - $froms[] = $this->handler->db->prefix('newbb_topics') . ' AS t '; |
|
898 | - $joins[] = 'LEFT JOIN ' . $this->handler->db->prefix('newbb_posts') . ' AS p ON p.post_id = t.topic_last_post_id'; |
|
897 | + $froms[] = $this->handler->db->prefix('newbb_topics').' AS t '; |
|
898 | + $joins[] = 'LEFT JOIN '.$this->handler->db->prefix('newbb_posts').' AS p ON p.post_id = t.topic_last_post_id'; |
|
899 | 899 | $wheres[] = '1 = 1'; |
900 | 900 | |
901 | 901 | if (!empty($this->config['post_excerpt'])) { |
902 | 902 | $selects[] = 'p.post_karma, p.require_reply, pt.post_text'; |
903 | - $this->query['join'][] = 'LEFT JOIN ' . $this->handler->db->prefix('newbb_posts_text') . ' AS pt ON pt.post_id = t.topic_last_post_id'; |
|
903 | + $this->query['join'][] = 'LEFT JOIN '.$this->handler->db->prefix('newbb_posts_text').' AS pt ON pt.post_id = t.topic_last_post_id'; |
|
904 | 904 | } |
905 | 905 | //if (empty($this->query["sort"])) $this->query["sort"][] = 't.topic_last_post_id DESC'; // irmtfan commented no need |
906 | 906 | |
907 | - $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 |
|
908 | - ' WHERE ' . implode(' AND ', $wheres) . ' AND ' . @implode(' AND ', @$this->query['where']) . ' ORDER BY ' . implode(', ', $this->query['sort']); |
|
907 | + $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 |
|
908 | + ' WHERE '.implode(' AND ', $wheres).' AND '.@implode(' AND ', @$this->query['where']).' ORDER BY '.implode(', ', $this->query['sort']); |
|
909 | 909 | |
910 | 910 | if (!$result = $this->handler->db->query($sql, $this->config['topics_per_page'], @$this->vars['start'])) { |
911 | 911 | if (is_object($xoopsTpl)) { |
@@ -917,11 +917,11 @@ discard block |
||
917 | 917 | return $ret; |
918 | 918 | } |
919 | 919 | |
920 | - require_once dirname(__DIR__) . '/include/functions.render.php'; |
|
921 | - require_once dirname(__DIR__) . '/include/functions.session.php'; |
|
922 | - require_once dirname(__DIR__) . '/include/functions.time.php'; |
|
923 | - require_once dirname(__DIR__) . '/include/functions.read.php'; |
|
924 | - require_once dirname(__DIR__) . '/include/functions.topic.php'; |
|
920 | + require_once dirname(__DIR__).'/include/functions.render.php'; |
|
921 | + require_once dirname(__DIR__).'/include/functions.session.php'; |
|
922 | + require_once dirname(__DIR__).'/include/functions.time.php'; |
|
923 | + require_once dirname(__DIR__).'/include/functions.read.php'; |
|
924 | + require_once dirname(__DIR__).'/include/functions.topic.php'; |
|
925 | 925 | |
926 | 926 | $sticky = 0; |
927 | 927 | $topics = []; |
@@ -940,9 +940,9 @@ discard block |
||
940 | 940 | // START irmtfan remove topic_icon hardcode smarty |
941 | 941 | // topic_icon: just regular topic_icon |
942 | 942 | if (!empty($myrow['icon'])) { |
943 | - $topic_icon = '<img align="middle" src="' . XOOPS_URL . '/images/subject/' . htmlspecialchars($myrow['icon'], ENT_QUOTES | ENT_HTML5) . '" alt="" />'; |
|
943 | + $topic_icon = '<img align="middle" src="'.XOOPS_URL.'/images/subject/'.htmlspecialchars($myrow['icon'], ENT_QUOTES | ENT_HTML5).'" alt="" />'; |
|
944 | 944 | } else { |
945 | - $topic_icon = '<img align="middle" src="' . XOOPS_URL . '/images/icons/no_posticon.gif" alt="" />'; |
|
945 | + $topic_icon = '<img align="middle" src="'.XOOPS_URL.'/images/icons/no_posticon.gif" alt="" />'; |
|
946 | 946 | } |
947 | 947 | // END irmtfan remove topic_icon hardcode smarty |
948 | 948 | |
@@ -953,7 +953,7 @@ discard block |
||
953 | 953 | if ($rating < 1) { |
954 | 954 | $rating_img = newbbDisplayImage('blank'); |
955 | 955 | } else { |
956 | - $rating_img = newbbDisplayImage('rate' . $rating, constant('_MD_NEWBB_RATE' . $rating)); |
|
956 | + $rating_img = newbbDisplayImage('rate'.$rating, constant('_MD_NEWBB_RATE'.$rating)); |
|
957 | 957 | } |
958 | 958 | |
959 | 959 | // ------------------------------------------------------ |
@@ -963,22 +963,22 @@ discard block |
||
963 | 963 | $totalpages = ceil(($myrow['topic_replies'] + 1) / $this->config['posts_per_page']); |
964 | 964 | if ($totalpages > 1) { |
965 | 965 | $topic_page_jump .= ' '; |
966 | - $append = false; |
|
966 | + $append = false; |
|
967 | 967 | for ($i = 1; $i <= $totalpages; ++$i) { |
968 | 968 | if ($i > 3 && $i < $totalpages) { |
969 | 969 | if (!$append) { |
970 | 970 | $topic_page_jump .= '...'; |
971 | - $append = true; |
|
971 | + $append = true; |
|
972 | 972 | } |
973 | 973 | } else { |
974 | - $topic_page_jump .= '[<a href="' . XOOPS_URL . '/modules/newbb/viewtopic.php?topic_id=' . $myrow['topic_id'] . '&start=' . (($i - 1) * $this->config['posts_per_page']) . '">' . $i . '</a>]'; |
|
974 | + $topic_page_jump .= '[<a href="'.XOOPS_URL.'/modules/newbb/viewtopic.php?topic_id='.$myrow['topic_id'].'&start='.(($i - 1) * $this->config['posts_per_page']).'">'.$i.'</a>]'; |
|
975 | 975 | // irmtfan remove here and move |
976 | 976 | //$topic_page_jump_icon = "<a href='" . XOOPS_URL . "/modules/newbb/viewtopic.php?topic_id=" . $myrow['topic_id'] . "&start=" . (($i - 1) * $this->config['posts_per_page']) . "" . "'>" . newbbDisplayImage('document',_MD_NEWBB_GOTOLASTPOST) . '</a>'; |
977 | 977 | } |
978 | 978 | } |
979 | 979 | } |
980 | 980 | // irmtfan - move here for both topics with and without pages - change topic_id to post_id |
981 | - $topic_page_jump_icon = "<a href='" . XOOPS_URL . '/modules/newbb/viewtopic.php?post_id=' . $myrow['topic_last_post_id'] . '' . "'>" . newbbDisplayImage('lastposticon', _MD_NEWBB_GOTOLASTPOST) . '</a>'; |
|
981 | + $topic_page_jump_icon = "<a href='".XOOPS_URL.'/modules/newbb/viewtopic.php?post_id='.$myrow['topic_last_post_id'].''."'>".newbbDisplayImage('lastposticon', _MD_NEWBB_GOTOLASTPOST).'</a>'; |
|
982 | 982 | |
983 | 983 | // ------------------------------------------------------ |
984 | 984 | // => topic array |
@@ -1010,7 +1010,7 @@ discard block |
||
1010 | 1010 | 'topic_title_excerpt' => $topic_title_excerpt, |
1011 | 1011 | //irmtfan use topic_title_excerpt |
1012 | 1012 | //'topic_link' => XOOPS_URL . '/modules/newbb/viewtopic.php?topic_id=' . $myrow['topic_id'], // . '&forum=' . $myrow['forum_id'], // irmtfan comment |
1013 | - 'topic_link' => 'viewtopic.php?topic_id=' . $myrow['topic_id'], |
|
1013 | + 'topic_link' => 'viewtopic.php?topic_id='.$myrow['topic_id'], |
|
1014 | 1014 | // irmtfan remove hardcode link |
1015 | 1015 | 'rating_img' => $rating_img, |
1016 | 1016 | 'votes' => $myrow['votes'], |
@@ -1069,14 +1069,14 @@ discard block |
||
1069 | 1069 | $forumHandler = Newbb\Helper::getInstance()->getHandler('Forum'); |
1070 | 1070 | |
1071 | 1071 | if (count($forums) > 0) { |
1072 | - $forum_list = $forumHandler->getAll(new \Criteria('forum_id', '(' . implode(', ', array_keys($forums)) . ')', 'IN'), ['forum_name', 'hot_threshold'], false); |
|
1072 | + $forum_list = $forumHandler->getAll(new \Criteria('forum_id', '('.implode(', ', array_keys($forums)).')', 'IN'), ['forum_name', 'hot_threshold'], false); |
|
1073 | 1073 | } else { |
1074 | 1074 | $forum_list = $forumHandler->getAll(); |
1075 | 1075 | } |
1076 | 1076 | |
1077 | 1077 | foreach (array_keys($topics) as $id) { |
1078 | 1078 | $topics[$id]['topic_read'] = empty($topic_isRead[$id]) ? 0 : 1; // add topic-read/topic-new smarty variable |
1079 | - $topics[$id]['topic_forum_link'] = '<a href="' . XOOPS_URL . '/modules/newbb/viewforum.php?forum=' . $topics[$id]['topic_forum'] . '">' . $forum_list[$topics[$id]['topic_forum']]['forum_name'] . '</a>'; |
|
1079 | + $topics[$id]['topic_forum_link'] = '<a href="'.XOOPS_URL.'/modules/newbb/viewforum.php?forum='.$topics[$id]['topic_forum'].'">'.$forum_list[$topics[$id]['topic_forum']]['forum_name'].'</a>'; |
|
1080 | 1080 | |
1081 | 1081 | //irmtfan use topic_title_excerpt -- add else |
1082 | 1082 | if (!empty($topics[$id]['type_id']) && isset($type_list[$topics[$id]['type_id']])) { |
@@ -1110,14 +1110,14 @@ discard block |
||
1110 | 1110 | $topics[$id]['topic_folder'] = newbbDisplayImage($topic_folder, $topic_folder_text); |
1111 | 1111 | // END irmtfan - add topic_folder_text for alt |
1112 | 1112 | |
1113 | - unset($topics[$id]['topic_poster_name'], $topics[$id]['topic_last_poster_name']);// irmtfan remove $topics[$id]["stats"] because it is not exist now |
|
1113 | + unset($topics[$id]['topic_poster_name'], $topics[$id]['topic_last_poster_name']); // irmtfan remove $topics[$id]["stats"] because it is not exist now |
|
1114 | 1114 | } |
1115 | 1115 | |
1116 | 1116 | if (count($topics) > 0) { |
1117 | - $sql = ' SELECT DISTINCT topic_id FROM ' . $this->handler->db->prefix('newbb_posts') . " WHERE attachment != ''" . ' AND topic_id IN (' . implode(',', array_keys($topics)) . ')'; |
|
1117 | + $sql = ' SELECT DISTINCT topic_id FROM '.$this->handler->db->prefix('newbb_posts')." WHERE attachment != ''".' AND topic_id IN ('.implode(',', array_keys($topics)).')'; |
|
1118 | 1118 | if ($result = $this->handler->db->query($sql)) { |
1119 | 1119 | while (false !== (list($topic_id) = $this->handler->db->fetchRow($result))) { |
1120 | - $topics[$topic_id]['attachment'] = ' ' . newbbDisplayImage('attachment', _MD_NEWBB_TOPICSHASATT); |
|
1120 | + $topics[$topic_id]['attachment'] = ' '.newbbDisplayImage('attachment', _MD_NEWBB_TOPICSHASATT); |
|
1121 | 1121 | } |
1122 | 1122 | } |
1123 | 1123 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | use XoopsModules\Newbb; |
34 | 34 | |
35 | -require_once __DIR__ . '/Read.php'; |
|
35 | +require_once __DIR__.'/Read.php'; |
|
36 | 36 | |
37 | 37 | /** |
38 | 38 | * A handler for read/unread handling |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | { |
64 | 64 | parent::__construct($db, 'topic'); |
65 | 65 | $newbbConfig = newbbLoadConfig(); |
66 | - $this->items_per_forum = isset($newbbConfig['read_items']) ? (int)$newbbConfig['read_items'] : 100; |
|
66 | + $this->items_per_forum = isset($newbbConfig['read_items']) ? (int) $newbbConfig['read_items'] : 100; |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | /** |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | $sticky_id = $itemHandler->getIds($criteria_sticky); |
177 | 177 | $items = $items_id + $sticky_id; |
178 | 178 | $criteria = new \CriteriaCompo(new \Criteria('uid', $uid)); |
179 | - $criteria->add(new \Criteria('read_item', '(' . implode(', ', $items) . ')', 'IN')); |
|
179 | + $criteria->add(new \Criteria('read_item', '('.implode(', ', $items).')', 'IN')); |
|
180 | 180 | $this->deleteAll($criteria, true); |
181 | 181 | |
182 | 182 | return true; |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | |
185 | 185 | $itemsObject = $itemHandler->getAll($criteria_topic, ['topic_last_post_id']); |
186 | 186 | $stickyObject = $itemHandler->getAll($criteria_sticky, ['topic_last_post_id']); |
187 | - $itemsObject += $stickyObject; |
|
187 | + $itemsObject += $stickyObject; |
|
188 | 188 | $items = []; |
189 | 189 | foreach (array_keys($itemsObject) as $key) { |
190 | 190 | $items[$key] = $itemsObject[$key]->getVar('topic_last_post_id'); |
@@ -92,11 +92,11 @@ discard block |
||
92 | 92 | public function __construct(\XoopsDatabase $db, $type) |
93 | 93 | { |
94 | 94 | $type = ('forum' === $type) ? 'forum' : 'topic'; |
95 | - parent::__construct($db, 'newbb_reads_' . $type, Read::class . $type, 'read_id', 'post_id'); |
|
95 | + parent::__construct($db, 'newbb_reads_'.$type, Read::class.$type, 'read_id', 'post_id'); |
|
96 | 96 | $this->type = $type; |
97 | 97 | $newbbConfig = newbbLoadConfig(); |
98 | 98 | // irmtfan if read_expire = 0 dont clean |
99 | - $this->lifetime = isset($newbbConfig['read_expire']) ? (int)$newbbConfig['read_expire'] * 24 * 3600 : 30 * 24 * 3600; |
|
99 | + $this->lifetime = isset($newbbConfig['read_expire']) ? (int) $newbbConfig['read_expire'] * 24 * 3600 : 30 * 24 * 3600; |
|
100 | 100 | $this->mode = isset($newbbConfig['read_mode']) ? $newbbConfig['read_mode'] : 2; |
101 | 101 | } |
102 | 102 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | return false; |
114 | 114 | } |
115 | 115 | |
116 | - $sql = 'DELETE bb FROM ' . $this->table . ' AS bb' . ' LEFT JOIN ' . $this->table . ' AS aa ON bb.read_item = aa.read_item ' . ' WHERE aa.post_id > bb.post_id'; |
|
116 | + $sql = 'DELETE bb FROM '.$this->table.' AS bb'.' LEFT JOIN '.$this->table.' AS aa ON bb.read_item = aa.read_item '.' WHERE aa.post_id > bb.post_id'; |
|
117 | 117 | if (!$result = $this->db->queryF($sql)) { |
118 | 118 | //xoops_error($this->db->error()); |
119 | 119 | return false; |
@@ -123,8 +123,8 @@ discard block |
||
123 | 123 | return true; |
124 | 124 | } |
125 | 125 | // irmtfan move here and rephrase |
126 | - $expire = time() - (int)$this->lifetime; |
|
127 | - $sql = 'DELETE FROM ' . $this->table . ' WHERE read_time < ' . $expire; |
|
126 | + $expire = time() - (int) $this->lifetime; |
|
127 | + $sql = 'DELETE FROM '.$this->table.' WHERE read_time < '.$expire; |
|
128 | 128 | if (!$result = $this->db->queryF($sql)) { |
129 | 129 | //xoops_error($this->db->error()); |
130 | 130 | return false; |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | return false; |
181 | 181 | } |
182 | 182 | } |
183 | - $sql = 'SELECT post_id ' . ' FROM ' . $this->table . ' WHERE read_item = ' . (int)$read_item . ' AND uid = ' . (int)$uid; |
|
183 | + $sql = 'SELECT post_id '.' FROM '.$this->table.' WHERE read_item = '.(int) $read_item.' AND uid = '.(int) $uid; |
|
184 | 184 | if (!$result = $this->db->queryF($sql, 1)) { |
185 | 185 | return null; |
186 | 186 | } |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | } |
237 | 237 | } |
238 | 238 | |
239 | - $sql = 'UPDATE ' . $this->table . ' SET post_id = ' . (int)$post_id . ',' . ' read_time =' . time() . ' WHERE read_item = ' . (int)$read_item . ' AND uid = ' . (int)$uid; |
|
239 | + $sql = 'UPDATE '.$this->table.' SET post_id = '.(int) $post_id.','.' read_time ='.time().' WHERE read_item = '.(int) $read_item.' AND uid = '.(int) $uid; |
|
240 | 240 | if ($this->db->queryF($sql) && $this->db->getAffectedRows()) { |
241 | 241 | return true; |
242 | 242 | } |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | } |
309 | 309 | |
310 | 310 | $criteria = new \CriteriaCompo(new \Criteria('uid', $uid)); |
311 | - $criteria->add(new \Criteria('read_item', '(' . implode(', ', array_map('intval', array_keys($items))) . ')', 'IN')); |
|
311 | + $criteria->add(new \Criteria('read_item', '('.implode(', ', array_map('intval', array_keys($items))).')', 'IN')); |
|
312 | 312 | $itemsObject = $this->getAll($criteria, ['read_item', 'post_id']); |
313 | 313 | |
314 | 314 | $items_list = []; |
@@ -340,43 +340,43 @@ discard block |
||
340 | 340 | $sql = "SET sql_mode=(SELECT REPLACE(@@sql_mode, 'ONLY_FULL_GROUP_BY', ''))"; |
341 | 341 | $this->db->queryF($sql); |
342 | 342 | |
343 | - $sql = 'CREATE TABLE ' . $this->table . '_duplicate LIKE ' . $this->table . '; '; |
|
343 | + $sql = 'CREATE TABLE '.$this->table.'_duplicate LIKE '.$this->table.'; '; |
|
344 | 344 | if (!$result = $this->db->queryF($sql)) { |
345 | - xoops_error($this->db->error() . '<br>' . $sql); |
|
345 | + xoops_error($this->db->error().'<br>'.$sql); |
|
346 | 346 | |
347 | 347 | return false; |
348 | 348 | } |
349 | - $sql = 'INSERT ' . $this->table . '_duplicate SELECT * FROM ' . $this->table . ' GROUP BY read_item, uid; '; |
|
349 | + $sql = 'INSERT '.$this->table.'_duplicate SELECT * FROM '.$this->table.' GROUP BY read_item, uid; '; |
|
350 | 350 | if (!$result = $this->db->queryF($sql)) { |
351 | - xoops_error($this->db->error() . '<br>' . $sql); |
|
351 | + xoops_error($this->db->error().'<br>'.$sql); |
|
352 | 352 | |
353 | 353 | return false; |
354 | 354 | } |
355 | - $sql = 'RENAME TABLE ' . $this->table . ' TO ' . $this->table . '_with_duplicate; '; |
|
355 | + $sql = 'RENAME TABLE '.$this->table.' TO '.$this->table.'_with_duplicate; '; |
|
356 | 356 | if (!$result = $this->db->queryF($sql)) { |
357 | - xoops_error($this->db->error() . '<br>' . $sql); |
|
357 | + xoops_error($this->db->error().'<br>'.$sql); |
|
358 | 358 | |
359 | 359 | return false; |
360 | 360 | } |
361 | - $sql = 'RENAME TABLE ' . $this->table . '_duplicate TO ' . $this->table . '; '; |
|
361 | + $sql = 'RENAME TABLE '.$this->table.'_duplicate TO '.$this->table.'; '; |
|
362 | 362 | if (!$result = $this->db->queryF($sql)) { |
363 | - xoops_error($this->db->error() . '<br>' . $sql); |
|
363 | + xoops_error($this->db->error().'<br>'.$sql); |
|
364 | 364 | |
365 | 365 | return false; |
366 | 366 | } |
367 | - $sql = 'SHOW INDEX FROM ' . $this->table . " WHERE KEY_NAME = 'read_item_uid'"; |
|
367 | + $sql = 'SHOW INDEX FROM '.$this->table." WHERE KEY_NAME = 'read_item_uid'"; |
|
368 | 368 | $result = $this->db->queryF($sql); |
369 | 369 | if (empty($result)) { |
370 | - $sql .= 'ALTER TABLE ' . $this->table . ' ADD INDEX read_item_uid ( read_item, uid ); '; |
|
370 | + $sql .= 'ALTER TABLE '.$this->table.' ADD INDEX read_item_uid ( read_item, uid ); '; |
|
371 | 371 | if (!$result = $this->db->queryF($sql)) { |
372 | - xoops_error($this->db->error() . '<br>' . $sql); |
|
372 | + xoops_error($this->db->error().'<br>'.$sql); |
|
373 | 373 | |
374 | 374 | return false; |
375 | 375 | } |
376 | 376 | } |
377 | - $sql = 'DROP TABLE ' . $this->table . '_with_duplicate; '; |
|
377 | + $sql = 'DROP TABLE '.$this->table.'_with_duplicate; '; |
|
378 | 378 | if (!$result = $this->db->queryF($sql)) { |
379 | - xoops_error($this->db->error() . '<br>' . $sql); |
|
379 | + xoops_error($this->db->error().'<br>'.$sql); |
|
380 | 380 | |
381 | 381 | return false; |
382 | 382 | } |
@@ -56,9 +56,9 @@ discard block |
||
56 | 56 | */ |
57 | 57 | public function get($id = null, $var = null) //get($id) |
58 | 58 | { |
59 | - $id = (int)$id; |
|
59 | + $id = (int) $id; |
|
60 | 60 | $post = null; |
61 | - $sql = 'SELECT p.*, t.* FROM ' . $this->db->prefix('newbb_posts') . ' p LEFT JOIN ' . $this->db->prefix('newbb_posts_text') . ' t ON p.post_id=t.post_id WHERE p.post_id=' . $id; |
|
61 | + $sql = 'SELECT p.*, t.* FROM '.$this->db->prefix('newbb_posts').' p LEFT JOIN '.$this->db->prefix('newbb_posts_text').' t ON p.post_id=t.post_id WHERE p.post_id='.$id; |
|
62 | 62 | if ($array = $this->db->fetchArray($this->db->query($sql))) { |
63 | 63 | $post = $this->create(false); |
64 | 64 | $post->assignVars($array); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $topic_id = 0, |
88 | 88 | $approved = 1 |
89 | 89 | ) { |
90 | - $sql = 'SELECT p.*, t.*, tp.topic_status FROM ' |
|
90 | + $sql = 'SELECT p.*, t.*, tp.topic_status FROM ' |
|
91 | 91 | . $this->db->prefix('newbb_posts') |
92 | 92 | . ' p LEFT JOIN ' |
93 | 93 | . $this->db->prefix('newbb_posts_text') |
@@ -379,14 +379,14 @@ discard block |
||
379 | 379 | |
380 | 380 | /* Set active post as deleted */ |
381 | 381 | if ($post->getVar('approved') > 0 && empty($force)) { |
382 | - $sql = 'UPDATE ' . $this->db->prefix('newbb_posts') . ' SET approved = -1 WHERE post_id = ' . $post->getVar('post_id'); |
|
382 | + $sql = 'UPDATE '.$this->db->prefix('newbb_posts').' SET approved = -1 WHERE post_id = '.$post->getVar('post_id'); |
|
383 | 383 | if (!$result = $this->db->queryF($sql)) { |
384 | 384 | } |
385 | 385 | /* delete pending post directly */ |
386 | 386 | } else { |
387 | 387 | $sql = sprintf('DELETE FROM `%s` WHERE post_id = %u', $this->db->prefix('newbb_posts'), $post->getVar('post_id')); |
388 | 388 | if (!$result = $this->db->queryF($sql)) { |
389 | - $post->setErrors('delete post error: ' . $sql); |
|
389 | + $post->setErrors('delete post error: '.$sql); |
|
390 | 390 | |
391 | 391 | return false; |
392 | 392 | } |
@@ -394,7 +394,7 @@ discard block |
||
394 | 394 | |
395 | 395 | $sql = sprintf('DELETE FROM `%s` WHERE post_id = %u', $this->db->prefix('newbb_posts_text'), $post->getVar('post_id')); |
396 | 396 | if (!$result = $this->db->queryF($sql)) { |
397 | - $post->setErrors('Could not remove post text: ' . $sql); |
|
397 | + $post->setErrors('Could not remove post text: '.$sql); |
|
398 | 398 | |
399 | 399 | return false; |
400 | 400 | } |
@@ -431,11 +431,11 @@ discard block |
||
431 | 431 | } |
432 | 432 | } |
433 | 433 | } else { |
434 | - $sql = 'UPDATE ' . $this->db->prefix('newbb_topics') . ' t |
|
435 | - LEFT JOIN ' . $this->db->prefix('newbb_posts') . ' p ON p.topic_id = t.topic_id |
|
434 | + $sql = 'UPDATE '.$this->db->prefix('newbb_topics').' t |
|
435 | + LEFT JOIN ' . $this->db->prefix('newbb_posts').' p ON p.topic_id = t.topic_id |
|
436 | 436 | SET t.topic_last_post_id = p.post_id |
437 | - WHERE t.topic_last_post_id = ' . $post->getVar('post_id') . ' |
|
438 | - AND p.post_id = (SELECT MAX(post_id) FROM ' . $this->db->prefix('newbb_posts') . ' WHERE topic_id=t.topic_id)'; |
|
437 | + WHERE t.topic_last_post_id = ' . $post->getVar('post_id').' |
|
438 | + AND p.post_id = (SELECT MAX(post_id) FROM ' . $this->db->prefix('newbb_posts').' WHERE topic_id=t.topic_id)'; |
|
439 | 439 | if (!$result = $this->db->queryF($sql)) { |
440 | 440 | } |
441 | 441 | } |
@@ -457,7 +457,7 @@ discard block |
||
457 | 457 | } |
458 | 458 | // irmtfan - just update the pid for approved posts when the post is not topic (pid=0) |
459 | 459 | if (!$post->isTopic()) { |
460 | - $sql = 'UPDATE ' . $this->db->prefix('newbb_posts') . ' SET pid = ' . $post->getVar('pid') . ' WHERE approved=1 AND pid=' . $post->getVar('post_id'); |
|
460 | + $sql = 'UPDATE '.$this->db->prefix('newbb_posts').' SET pid = '.$post->getVar('pid').' WHERE approved=1 AND pid='.$post->getVar('post_id'); |
|
461 | 461 | if (!$result = $this->db->queryF($sql)) { |
462 | 462 | //xoops_error($this->db->error()); |
463 | 463 | } |
@@ -481,12 +481,12 @@ discard block |
||
481 | 481 | return parent::getCount($criteria); |
482 | 482 | } |
483 | 483 | |
484 | - $sql = 'SELECT COUNT(*) as count' . ' FROM ' . $this->db->prefix('newbb_posts') . ' AS p' . ' LEFT JOIN ' . $this->db->prefix('newbb_posts_text') . ' AS t ON t.post_id = p.post_id'; |
|
484 | + $sql = 'SELECT COUNT(*) as count'.' FROM '.$this->db->prefix('newbb_posts').' AS p'.' LEFT JOIN '.$this->db->prefix('newbb_posts_text').' AS t ON t.post_id = p.post_id'; |
|
485 | 485 | // LEFT JOIN |
486 | 486 | $sql .= $join; |
487 | 487 | // WHERE |
488 | 488 | if (null !== $criteria && is_subclass_of($criteria, 'CriteriaElement')) { |
489 | - $sql .= ' ' . $criteria->renderWhere(); |
|
489 | + $sql .= ' '.$criteria->renderWhere(); |
|
490 | 490 | } |
491 | 491 | if (!$result = $this->db->query($sql)) { |
492 | 492 | //xoops_error($this->db->error().'<br>'.$sql); |
@@ -511,17 +511,17 @@ discard block |
||
511 | 511 | public function getPostsByLimit($criteria = null, $limit = 1, $start = 0, $join = null) |
512 | 512 | { |
513 | 513 | $ret = []; |
514 | - $sql = 'SELECT p.*, t.* ' . ' FROM ' . $this->db->prefix('newbb_posts') . ' AS p' . ' LEFT JOIN ' . $this->db->prefix('newbb_posts_text') . ' AS t ON t.post_id = p.post_id'; |
|
514 | + $sql = 'SELECT p.*, t.* '.' FROM '.$this->db->prefix('newbb_posts').' AS p'.' LEFT JOIN '.$this->db->prefix('newbb_posts_text').' AS t ON t.post_id = p.post_id'; |
|
515 | 515 | if (!empty($join)) { |
516 | 516 | $sql .= $join; |
517 | 517 | } |
518 | 518 | if (null !== $criteria && is_subclass_of($criteria, 'CriteriaElement')) { |
519 | - $sql .= ' ' . $criteria->renderWhere(); |
|
519 | + $sql .= ' '.$criteria->renderWhere(); |
|
520 | 520 | if ('' !== $criteria->getSort()) { |
521 | - $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
521 | + $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder(); |
|
522 | 522 | } |
523 | 523 | } |
524 | - $result = $this->db->query($sql, (int)$limit, (int)$start); |
|
524 | + $result = $this->db->query($sql, (int) $limit, (int) $start); |
|
525 | 525 | if (!$result) { |
526 | 526 | //xoops_error($this->db->error()); |
527 | 527 | return $ret; |
@@ -559,7 +559,7 @@ discard block |
||
559 | 559 | parent::cleanOrphan($this->db->prefix('newbb_topics'), 'topic_id'); |
560 | 560 | parent::cleanOrphan($this->db->prefix('newbb_posts_text'), 'post_id'); |
561 | 561 | |
562 | - $sql = 'DELETE FROM ' . $this->db->prefix('newbb_posts_text') . ' WHERE (post_id NOT IN ( SELECT DISTINCT post_id FROM ' . $this->table . ') )'; |
|
562 | + $sql = 'DELETE FROM '.$this->db->prefix('newbb_posts_text').' WHERE (post_id NOT IN ( SELECT DISTINCT post_id FROM '.$this->table.') )'; |
|
563 | 563 | if (!$result = $this->db->queryF($sql)) { |
564 | 564 | //xoops_error($this->db->error()); |
565 | 565 | return false; |
@@ -579,7 +579,7 @@ discard block |
||
579 | 579 | // irmtfan if 0 no cleanup look include/plugin.php |
580 | 580 | if (!func_num_args()) { |
581 | 581 | $newbbConfig = newbbLoadConfig(); |
582 | - $expire = isset($newbbConfig['pending_expire']) ? (int)$newbbConfig['pending_expire'] : 7; |
|
582 | + $expire = isset($newbbConfig['pending_expire']) ? (int) $newbbConfig['pending_expire'] : 7; |
|
583 | 583 | $expire = $expire * 24 * 3600; // days to seconds |
584 | 584 | } |
585 | 585 | if (empty($expire)) { |
@@ -587,7 +587,7 @@ discard block |
||
587 | 587 | } |
588 | 588 | $crit_expire = new \CriteriaCompo(new \Criteria('approved', 0, '<=')); |
589 | 589 | //if (!empty($expire)) { |
590 | - $crit_expire->add(new \Criteria('post_time', time() - (int)$expire, '<')); |
|
590 | + $crit_expire->add(new \Criteria('post_time', time() - (int) $expire, '<')); |
|
591 | 591 | |
592 | 592 | //} |
593 | 593 | return $this->deleteAll($crit_expire, true/*, true*/); |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | |
16 | 16 | // defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
17 | 17 | |
18 | -require_once dirname(__DIR__) . '/include/functions.config.php'; |
|
18 | +require_once dirname(__DIR__).'/include/functions.config.php'; |
|
19 | 19 | |
20 | 20 | /** |
21 | 21 | * Class OnlineHandler |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $this->forum_id = $forum->getVar('forum_id'); |
48 | 48 | $this->forumObject = $forum; |
49 | 49 | } else { |
50 | - $this->forum_id = (int)$forum; |
|
50 | + $this->forum_id = (int) $forum; |
|
51 | 51 | $this->forumObject = $forum; |
52 | 52 | } |
53 | 53 | if (is_object($forumtopic)) { |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | $this->forum_id = $forumtopic->getVar('forum_id'); |
57 | 57 | } |
58 | 58 | } else { |
59 | - $this->topic_id = (int)$forumtopic; |
|
59 | + $this->topic_id = (int) $forumtopic; |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | $this->update(); |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | { |
67 | 67 | global $xoopsModule; |
68 | 68 | |
69 | - mt_srand((double)microtime() * 1000000); |
|
69 | + mt_srand((double) microtime() * 1000000); |
|
70 | 70 | // set gc probabillity to 10% for now.. |
71 | 71 | if (mt_rand(1, 100) < 60) { |
72 | 72 | $this->gc(150); |
@@ -96,8 +96,8 @@ discard block |
||
96 | 96 | */ |
97 | 97 | public function render(\Smarty $xoopsTpl) |
98 | 98 | { |
99 | - require_once dirname(__DIR__) . '/include/functions.render.php'; |
|
100 | - require_once dirname(__DIR__) . '/include/functions.user.php'; |
|
99 | + require_once dirname(__DIR__).'/include/functions.render.php'; |
|
100 | + require_once dirname(__DIR__).'/include/functions.user.php'; |
|
101 | 101 | $criteria = null; |
102 | 102 | if ($this->topic_id) { |
103 | 103 | $criteria = new \Criteria('online_topic', $this->topic_id); |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | } |
117 | 117 | $users_id[] = $users[$i]['online_uid']; |
118 | 118 | $users_online[$users[$i]['online_uid']] = [ |
119 | - 'link' => XOOPS_URL . '/userinfo.php?uid=' . $users[$i]['online_uid'], |
|
119 | + 'link' => XOOPS_URL.'/userinfo.php?uid='.$users[$i]['online_uid'], |
|
120 | 120 | 'uname' => $users[$i]['online_uname'] |
121 | 121 | ]; |
122 | 122 | ++$num_user; |
@@ -155,8 +155,8 @@ discard block |
||
155 | 155 | */ |
156 | 156 | public function showOnline() |
157 | 157 | { |
158 | - require_once dirname(__DIR__) . '/include/functions.render.php'; |
|
159 | - require_once dirname(__DIR__) . '/include/functions.user.php'; |
|
158 | + require_once dirname(__DIR__).'/include/functions.render.php'; |
|
159 | + require_once dirname(__DIR__).'/include/functions.user.php'; |
|
160 | 160 | $criteria = null; |
161 | 161 | if ($this->topic_id) { |
162 | 162 | $criteria = new \Criteria('online_topic', $this->topic_id); |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | } |
176 | 176 | $users_id[] = $users[$i]['online_uid']; |
177 | 177 | $users_online[$users[$i]['online_uid']] = [ |
178 | - 'link' => XOOPS_URL . '/userinfo.php?uid=' . $users[$i]['online_uid'], |
|
178 | + 'link' => XOOPS_URL.'/userinfo.php?uid='.$users[$i]['online_uid'], |
|
179 | 179 | 'uname' => $users[$i]['online_uname'] |
180 | 180 | ]; |
181 | 181 | ++$num_user; |
@@ -227,17 +227,17 @@ discard block |
||
227 | 227 | { |
228 | 228 | global $xoopsModule, $xoopsDB; |
229 | 229 | |
230 | - $uid = (int)$uid; |
|
230 | + $uid = (int) $uid; |
|
231 | 231 | if ($uid > 0) { |
232 | - $sql = 'SELECT COUNT(*) FROM ' . $this->db->prefix('newbb_online') . ' WHERE online_uid=' . $uid; |
|
232 | + $sql = 'SELECT COUNT(*) FROM '.$this->db->prefix('newbb_online').' WHERE online_uid='.$uid; |
|
233 | 233 | } else { |
234 | - $sql = 'SELECT COUNT(*) FROM ' . $this->db->prefix('newbb_online') . ' WHERE online_uid=' . $uid . " AND online_ip='" . $ip . "'"; |
|
234 | + $sql = 'SELECT COUNT(*) FROM '.$this->db->prefix('newbb_online').' WHERE online_uid='.$uid." AND online_ip='".$ip."'"; |
|
235 | 235 | } |
236 | 236 | list($count) = $this->db->fetchRow($this->db->queryF($sql)); |
237 | 237 | if ($count > 0) { |
238 | - $sql = 'UPDATE ' . $this->db->prefix('newbb_online') . " SET online_updated= '" . $time . "', online_forum = '" . $forum_id . "', online_topic = '" . $topic_id . "' WHERE online_uid = " . $uid; |
|
238 | + $sql = 'UPDATE '.$this->db->prefix('newbb_online')." SET online_updated= '".$time."', online_forum = '".$forum_id."', online_topic = '".$topic_id."' WHERE online_uid = ".$uid; |
|
239 | 239 | if (0 == $uid) { |
240 | - $sql .= " AND online_ip='" . $ip . "'"; |
|
240 | + $sql .= " AND online_ip='".$ip."'"; |
|
241 | 241 | } |
242 | 242 | } else { |
243 | 243 | $sql = sprintf('INSERT INTO `%s` (online_uid, online_uname, online_updated, online_ip, online_forum, online_topic) VALUES (%u, %s, %u, %s, %u, %u)', $this->db->prefix('newbb_online'), $uid, $this->db->quote($uname), $time, $this->db->quote($ip), $forum_id, $topic_id); |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | public function gc($expire) |
284 | 284 | { |
285 | 285 | global $xoopsModule; |
286 | - $sql = 'DELETE FROM ' . $this->db->prefix('newbb_online') . ' WHERE online_updated < ' . (time() - (int)$expire); |
|
286 | + $sql = 'DELETE FROM '.$this->db->prefix('newbb_online').' WHERE online_updated < '.(time() - (int) $expire); |
|
287 | 287 | $this->db->queryF($sql); |
288 | 288 | |
289 | 289 | $xoops_onlineHandler = xoops_getHandler('online'); |
@@ -300,9 +300,9 @@ discard block |
||
300 | 300 | { |
301 | 301 | $ret = []; |
302 | 302 | $limit = $start = 0; |
303 | - $sql = 'SELECT * FROM ' . $this->db->prefix('newbb_online'); |
|
303 | + $sql = 'SELECT * FROM '.$this->db->prefix('newbb_online'); |
|
304 | 304 | if (is_object($criteria) && is_subclass_of($criteria, 'CriteriaElement')) { |
305 | - $sql .= ' ' . $criteria->renderWhere(); |
|
305 | + $sql .= ' '.$criteria->renderWhere(); |
|
306 | 306 | $limit = $criteria->getLimit(); |
307 | 307 | $start = $criteria->getStart(); |
308 | 308 | } |
@@ -333,9 +333,9 @@ discard block |
||
333 | 333 | if (!empty($this->user_ids)) { |
334 | 334 | $online_users = $this->user_ids; |
335 | 335 | } else { |
336 | - $sql = 'SELECT online_uid FROM ' . $this->db->prefix('newbb_online'); |
|
336 | + $sql = 'SELECT online_uid FROM '.$this->db->prefix('newbb_online'); |
|
337 | 337 | if (!empty($uids)) { |
338 | - $sql .= ' WHERE online_uid IN (' . implode(', ', array_map('intval', $uids)) . ')'; |
|
338 | + $sql .= ' WHERE online_uid IN ('.implode(', ', array_map('intval', $uids)).')'; |
|
339 | 339 | } |
340 | 340 | |
341 | 341 | $result = $this->db->query($sql); |
@@ -363,9 +363,9 @@ discard block |
||
363 | 363 | */ |
364 | 364 | public function getCount(\CriteriaElement $criteria = null) |
365 | 365 | { |
366 | - $sql = 'SELECT COUNT(*) FROM ' . $this->db->prefix('newbb_online'); |
|
366 | + $sql = 'SELECT COUNT(*) FROM '.$this->db->prefix('newbb_online'); |
|
367 | 367 | if (is_object($criteria) && is_subclass_of($criteria, 'CriteriaElement')) { |
368 | - $sql .= ' ' . $criteria->renderWhere(); |
|
368 | + $sql .= ' '.$criteria->renderWhere(); |
|
369 | 369 | } |
370 | 370 | if (!$result = $this->db->query($sql)) { |
371 | 371 | return false; |
@@ -55,13 +55,13 @@ |
||
55 | 55 | */ |
56 | 56 | public function deleteByCategory($cat_id) |
57 | 57 | { |
58 | - $cat_id = (int)$cat_id; |
|
58 | + $cat_id = (int) $cat_id; |
|
59 | 59 | if (empty($cat_id)) { |
60 | 60 | return false; |
61 | 61 | } |
62 | 62 | /** @var \XoopsGroupPermHandler $grouppermHandler */ |
63 | 63 | $grouppermHandler = xoops_getHandler('groupperm'); |
64 | - $criteria = new \CriteriaCompo(new \Criteria('gperm_modid', $GLOBALS['xoopsModule']->getVar('mid'))); |
|
64 | + $criteria = new \CriteriaCompo(new \Criteria('gperm_modid', $GLOBALS['xoopsModule']->getVar('mid'))); |
|
65 | 65 | $criteria->add(new \Criteria('gperm_name', 'category_access')); |
66 | 66 | $criteria->add(new \Criteria('gperm_itemid', $cat_id)); |
67 | 67 |
@@ -100,11 +100,11 @@ discard block |
||
100 | 100 | return $_cachedForums; |
101 | 101 | } |
102 | 102 | |
103 | - $criteria = new \CriteriaCompo(new \Criteria('forum_id', '(' . implode(', ', $valid_ids) . ')', 'IN')); |
|
103 | + $criteria = new \CriteriaCompo(new \Criteria('forum_id', '('.implode(', ', $valid_ids).')', 'IN')); |
|
104 | 104 | if (is_numeric($cat) && $cat > 0) { |
105 | - $criteria->add(new \Criteria('cat_id', (int)$cat)); |
|
105 | + $criteria->add(new \Criteria('cat_id', (int) $cat)); |
|
106 | 106 | } elseif (is_array($cat) && count($cat) > 0) { |
107 | - $criteria->add(new \Criteria('cat_id', '(' . implode(', ', $cat) . ')', 'IN')); |
|
107 | + $criteria->add(new \Criteria('cat_id', '('.implode(', ', $cat).')', 'IN')); |
|
108 | 108 | } |
109 | 109 | $criteria->setSort('forum_order'); |
110 | 110 | $criteria->setOrder('ASC'); |
@@ -181,23 +181,23 @@ discard block |
||
181 | 181 | $topic_lastread = newbbGetCookie('LT', true); |
182 | 182 | $criteria_forum = ''; |
183 | 183 | if (is_object($forum)) { |
184 | - $criteria_forum = ' AND t.forum_id = ' . $forum->getVar('forum_id'); |
|
184 | + $criteria_forum = ' AND t.forum_id = '.$forum->getVar('forum_id'); |
|
185 | 185 | $hot_threshold = $forum->getVar('hot_threshold'); |
186 | 186 | } else { |
187 | 187 | $hot_threshold = 10; |
188 | 188 | if (is_array($forum) && count($forum) > 0) { |
189 | - $criteria_forum = ' AND t.forum_id IN (' . implode(',', array_keys($forum)) . ')'; |
|
189 | + $criteria_forum = ' AND t.forum_id IN ('.implode(',', array_keys($forum)).')'; |
|
190 | 190 | } elseif (!empty($forum)) { |
191 | - $criteria_forum = ' AND t.forum_id =' . (int)$forum; |
|
191 | + $criteria_forum = ' AND t.forum_id ='.(int) $forum; |
|
192 | 192 | } |
193 | 193 | } |
194 | 194 | |
195 | - $criteria_post = $startdate ? ' p.post_time > ' . $startdate : ' 1 = 1 '; |
|
195 | + $criteria_post = $startdate ? ' p.post_time > '.$startdate : ' 1 = 1 '; |
|
196 | 196 | $criteria_topic = empty($type) ? '' : " AND t.type_id={$type}"; |
197 | 197 | $criteria_extra = ''; |
198 | 198 | $criteria_approve = ' AND t.approved = 1'; |
199 | 199 | $post_on = ' p.post_id = t.topic_last_post_id'; |
200 | - $leftjoin = ' LEFT JOIN ' . $this->db->prefix('newbb_posts') . ' p ON p.post_id = t.topic_last_post_id'; |
|
200 | + $leftjoin = ' LEFT JOIN '.$this->db->prefix('newbb_posts').' p ON p.post_id = t.topic_last_post_id'; |
|
201 | 201 | $sort_array = []; |
202 | 202 | switch ($status) { |
203 | 203 | case 'digest': |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | // START irmtfan use read_uid to find the unread posts when the user is logged in |
215 | 215 | $read_uid = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('uid') : 0; |
216 | 216 | if (!empty($read_uid)) { |
217 | - $leftjoin .= ' LEFT JOIN ' . $this->db->prefix('newbb_reads_topic') . ' r ON r.read_item = t.topic_id AND r.uid = ' . $read_uid . ' '; |
|
217 | + $leftjoin .= ' LEFT JOIN '.$this->db->prefix('newbb_reads_topic').' r ON r.read_item = t.topic_id AND r.uid = '.$read_uid.' '; |
|
218 | 218 | $criteria_post .= ' AND (r.read_id IS NULL OR r.post_id < t.topic_last_post_id)'; |
219 | 219 | } else { |
220 | 220 | } |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | } elseif (1 == $GLOBALS['xoopsModuleConfig']['read_mode']) { |
223 | 223 | // START irmtfan fix read_mode = 1 bugs - for all users (member and anon) |
224 | 224 | if ($time_criterion = max($GLOBALS['last_visit'], $startdate)) { |
225 | - $criteria_post = ' p.post_time > ' . $time_criterion; // for all users |
|
225 | + $criteria_post = ' p.post_time > '.$time_criterion; // for all users |
|
226 | 226 | $topics = []; |
227 | 227 | $topic_lastread = newbbGetCookie('LT', true); |
228 | 228 | if (count($topic_lastread) > 0) { |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | } |
234 | 234 | } |
235 | 235 | if (count($topics) > 0) { |
236 | - $criteria_extra = ' AND t.topic_id NOT IN (' . implode(',', $topics) . ')'; |
|
236 | + $criteria_extra = ' AND t.topic_id NOT IN ('.implode(',', $topics).')'; |
|
237 | 237 | } |
238 | 238 | } |
239 | 239 | // END irmtfan fix read_mode = 1 bugs - for all users (member and anon) |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | break; |
242 | 242 | case 'pending': |
243 | 243 | $post_on = ' p.topic_id = t.topic_id'; |
244 | - $criteria_post .= ' AND p.pid = 0'; |
|
244 | + $criteria_post .= ' AND p.pid = 0'; |
|
245 | 245 | $criteria_approve = ' AND t.approved = 0'; |
246 | 246 | break; |
247 | 247 | |
@@ -255,31 +255,31 @@ discard block |
||
255 | 255 | |
256 | 256 | default: |
257 | 257 | if ($startdate > 0) { |
258 | - $criteria_post = ' (p.post_time > ' . $startdate . ' OR t.topic_sticky=1)'; |
|
258 | + $criteria_post = ' (p.post_time > '.$startdate.' OR t.topic_sticky=1)'; |
|
259 | 259 | } |
260 | 260 | $sort_array[] = 't.topic_sticky DESC'; |
261 | 261 | break; |
262 | 262 | } |
263 | 263 | |
264 | - $select = 't.*, ' . ' p.post_time as last_post_time, p.poster_name as last_poster_name, p.icon, p.post_id, p.uid'; |
|
265 | - $from = $this->db->prefix('newbb_topics') . ' t ' . $leftjoin; |
|
266 | - $where = $criteria_post . $criteria_topic . $criteria_forum . $criteria_extra . $criteria_approve; |
|
264 | + $select = 't.*, '.' p.post_time as last_post_time, p.poster_name as last_poster_name, p.icon, p.post_id, p.uid'; |
|
265 | + $from = $this->db->prefix('newbb_topics').' t '.$leftjoin; |
|
266 | + $where = $criteria_post.$criteria_topic.$criteria_forum.$criteria_extra.$criteria_approve; |
|
267 | 267 | |
268 | 268 | if ($excerpt) { |
269 | 269 | $select .= ', p.post_karma, p.require_reply, pt.post_text'; |
270 | - $from .= ' LEFT JOIN ' . $this->db->prefix('newbb_posts_text') . ' pt ON pt.post_id = t.topic_last_post_id'; |
|
270 | + $from .= ' LEFT JOIN '.$this->db->prefix('newbb_posts_text').' pt ON pt.post_id = t.topic_last_post_id'; |
|
271 | 271 | } |
272 | 272 | if ('u.uname' === $sort) { |
273 | 273 | $sort = 't.topic_poster'; |
274 | 274 | } |
275 | 275 | |
276 | - $sort_array[] = trim($sort . ' ' . $order); |
|
276 | + $sort_array[] = trim($sort.' '.$order); |
|
277 | 277 | $sortby = implode(', ', array_filter($sort_array)); |
278 | 278 | if (empty($sortby)) { |
279 | 279 | $sortby = 't.topic_last_post_id DESC'; |
280 | 280 | } |
281 | 281 | |
282 | - $sql = 'SELECT ' . $select . ' FROM ' . $from . ' WHERE ' . $where . ' ORDER BY ' . $sortby; |
|
282 | + $sql = 'SELECT '.$select.' FROM '.$from.' WHERE '.$where.' ORDER BY '.$sortby; |
|
283 | 283 | |
284 | 284 | if (!$result = $this->db->query($sql, $GLOBALS['xoopsModuleConfig']['topics_per_page'], $start)) { |
285 | 285 | redirect_header('index.php', 2, _MD_NEWBB_ERROROCCURED); |
@@ -304,16 +304,16 @@ discard block |
||
304 | 304 | |
305 | 305 | if ($myrow['topic_haspoll']) { |
306 | 306 | if ($myrow['topic_sticky']) { |
307 | - $topic_icon = newbbDisplayImage('topic_sticky', _MD_NEWBB_TOPICSTICKY) . '<br>' . newbbDisplayImage('poll', _MD_NEWBB_TOPICHASPOLL); |
|
307 | + $topic_icon = newbbDisplayImage('topic_sticky', _MD_NEWBB_TOPICSTICKY).'<br>'.newbbDisplayImage('poll', _MD_NEWBB_TOPICHASPOLL); |
|
308 | 308 | } else { |
309 | 309 | $topic_icon = newbbDisplayImage('poll', _MD_NEWBB_TOPICHASPOLL); |
310 | 310 | } |
311 | 311 | } elseif ($myrow['topic_sticky']) { |
312 | 312 | $topic_icon = newbbDisplayImage('topic_sticky', _MD_NEWBB_TOPICSTICKY); |
313 | 313 | } elseif (!empty($myrow['icon'])) { |
314 | - $topic_icon = '<img src="' . XOOPS_URL . '/images/subject/' . htmlspecialchars($myrow['icon'], ENT_QUOTES | ENT_HTML5) . '" alt="" />'; |
|
314 | + $topic_icon = '<img src="'.XOOPS_URL.'/images/subject/'.htmlspecialchars($myrow['icon'], ENT_QUOTES | ENT_HTML5).'" alt="" />'; |
|
315 | 315 | } else { |
316 | - $topic_icon = '<img src="' . XOOPS_URL . '/images/icons/no_posticon.gif" alt="" />'; |
|
316 | + $topic_icon = '<img src="'.XOOPS_URL.'/images/icons/no_posticon.gif" alt="" />'; |
|
317 | 317 | } |
318 | 318 | |
319 | 319 | // ------------------------------------------------------ |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | if ($rating < 1) { |
324 | 324 | $rating_img = newbbDisplayImage('blank'); |
325 | 325 | } else { |
326 | - $rating_img = newbbDisplayImage('rate' . $rating, constant('_MD_NEWBB_RATE' . $rating)); |
|
326 | + $rating_img = newbbDisplayImage('rate'.$rating, constant('_MD_NEWBB_RATE'.$rating)); |
|
327 | 327 | } |
328 | 328 | // ------------------------------------------------------ |
329 | 329 | // topic_page_jump |
@@ -332,28 +332,28 @@ discard block |
||
332 | 332 | $totalpages = ceil(($myrow['topic_replies'] + 1) / $GLOBALS['xoopsModuleConfig']['posts_per_page']); |
333 | 333 | if ($totalpages > 1) { |
334 | 334 | $topic_page_jump .= ' '; |
335 | - $append = false; |
|
335 | + $append = false; |
|
336 | 336 | for ($i = 1; $i <= $totalpages; ++$i) { |
337 | 337 | if ($i > 3 && $i < $totalpages) { |
338 | 338 | if (!$append) { |
339 | 339 | $topic_page_jump .= '...'; |
340 | - $append = true; |
|
340 | + $append = true; |
|
341 | 341 | } |
342 | 342 | } else { |
343 | - $topic_page_jump .= '[<a href="' . XOOPS_URL . '/modules/newbb/viewtopic.php?topic_id=' . $myrow['topic_id'] . '&start=' . (($i - 1) * $GLOBALS['xoopsModuleConfig']['posts_per_page']) . '">' . $i . '</a>]'; |
|
343 | + $topic_page_jump .= '[<a href="'.XOOPS_URL.'/modules/newbb/viewtopic.php?topic_id='.$myrow['topic_id'].'&start='.(($i - 1) * $GLOBALS['xoopsModuleConfig']['posts_per_page']).'">'.$i.'</a>]'; |
|
344 | 344 | // irmtfan remove here and move |
345 | 345 | //$topic_page_jump_icon = "<a href='" . XOOPS_URL . "/modules/newbb/viewtopic.php?post_id=" . $myrow['post_id'] . "&start=" . (($i - 1) * $GLOBALS['xoopsModuleConfig']['posts_per_page']) . "'>" . newbbDisplayImage('lastposticon',_MD_NEWBB_GOTOLASTPOST) . '</a>'; |
346 | 346 | } |
347 | 347 | } |
348 | 348 | } |
349 | 349 | // irmtfan - move here for both topics with and without pages |
350 | - $topic_page_jump_icon = "<a href='" . XOOPS_URL . '/modules/newbb/viewtopic.php?post_id=' . $myrow['post_id'] . "'>" . newbbDisplayImage('lastposticon', _MD_NEWBB_GOTOLASTPOST) . '</a>'; |
|
350 | + $topic_page_jump_icon = "<a href='".XOOPS_URL.'/modules/newbb/viewtopic.php?post_id='.$myrow['post_id']."'>".newbbDisplayImage('lastposticon', _MD_NEWBB_GOTOLASTPOST).'</a>'; |
|
351 | 351 | |
352 | 352 | // ------------------------------------------------------ |
353 | 353 | // => topic array |
354 | 354 | $forum_link = ''; |
355 | 355 | if (!empty($viewAllForums[$myrow['forum_id']])) { |
356 | - $forum_link = '<a href="' . XOOPS_URL . '/modules/newbb/viewforum.php?forum=' . $myrow['forum_id'] . '">' . $viewAllForums[$myrow['forum_id']]['forum_name'] . '</a>'; |
|
356 | + $forum_link = '<a href="'.XOOPS_URL.'/modules/newbb/viewforum.php?forum='.$myrow['forum_id'].'">'.$viewAllForums[$myrow['forum_id']]['forum_name'].'</a>'; |
|
357 | 357 | } |
358 | 358 | |
359 | 359 | $topic_title = $myts->htmlSpecialChars($myrow['topic_title']); |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | //$topic_title = '<span style="color:'.$typen[$myrow["type_id"]]["type_color"].'">['.$typen[$myrow["type_id"]]["type_name"].']</span> '.$topic_title.''; |
363 | 363 | //} |
364 | 364 | if ($myrow['topic_digest']) { |
365 | - $topic_title = "<span class='digest'>" . $topic_title . '</span>'; |
|
365 | + $topic_title = "<span class='digest'>".$topic_title.'</span>'; |
|
366 | 366 | } |
367 | 367 | |
368 | 368 | if (0 == $excerpt) { |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | //'type_text' => $topic_prefix,/*irmtfan remove here and move to for loop*/ |
382 | 382 | 'topic_title' => $topic_title, |
383 | 383 | //'topic_link' => XOOPS_URL . '/modules/newbb/viewtopic.php?topic_id=' . $myrow['topic_id'], |
384 | - 'topic_link' => 'viewtopic.php?topic_id=' . $myrow['topic_id'], |
|
384 | + 'topic_link' => 'viewtopic.php?topic_id='.$myrow['topic_id'], |
|
385 | 385 | 'rating_img' => $rating_img, |
386 | 386 | 'topic_page_jump' => $topic_page_jump, |
387 | 387 | 'topic_page_jump_icon' => $topic_page_jump_icon, |
@@ -456,10 +456,10 @@ discard block |
||
456 | 456 | } // irmtfan end for loop |
457 | 457 | // END irmtfan move to a for loop |
458 | 458 | if (count($topics) > 0) { |
459 | - $sql = ' SELECT DISTINCT topic_id FROM ' . $this->db->prefix('newbb_posts') . " WHERE attachment != ''" . ' AND topic_id IN (' . implode(',', array_keys($topics)) . ')'; |
|
459 | + $sql = ' SELECT DISTINCT topic_id FROM '.$this->db->prefix('newbb_posts')." WHERE attachment != ''".' AND topic_id IN ('.implode(',', array_keys($topics)).')'; |
|
460 | 460 | if ($result = $this->db->query($sql)) { |
461 | 461 | while (false !== (list($topic_id) = $this->db->fetchRow($result))) { |
462 | - $topics[$topic_id]['attachment'] = ' ' . newbbDisplayImage('attachment', _MD_NEWBB_TOPICSHASATT); |
|
462 | + $topics[$topic_id]['attachment'] = ' '.newbbDisplayImage('attachment', _MD_NEWBB_TOPICSHASATT); |
|
463 | 463 | } |
464 | 464 | } |
465 | 465 | } |
@@ -479,8 +479,8 @@ discard block |
||
479 | 479 | |
480 | 480 | $criteria_extra = ''; |
481 | 481 | $criteria_approve = ' AND t.approved = 1'; // any others? |
482 | - $leftjoin = ' LEFT JOIN ' . $this->db->prefix('newbb_posts') . ' p ON p.post_id = t.topic_last_post_id'; |
|
483 | - $criteria_post = ' p.post_time > ' . $startdate; |
|
482 | + $leftjoin = ' LEFT JOIN '.$this->db->prefix('newbb_posts').' p ON p.post_id = t.topic_last_post_id'; |
|
483 | + $criteria_post = ' p.post_time > '.$startdate; |
|
484 | 484 | switch ($type) { |
485 | 485 | case 'digest': |
486 | 486 | $criteria_extra = ' AND topic_digest = 1'; |
@@ -495,7 +495,7 @@ discard block |
||
495 | 495 | |
496 | 496 | $read_uid = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('uid') : 0; |
497 | 497 | if (!empty($read_uid)) { |
498 | - $leftjoin .= ' LEFT JOIN ' . $this->db->prefix('newbb_reads_topic') . ' r ON r.read_item = t.topic_id AND r.uid = ' . $read_uid . ' '; |
|
498 | + $leftjoin .= ' LEFT JOIN '.$this->db->prefix('newbb_reads_topic').' r ON r.read_item = t.topic_id AND r.uid = '.$read_uid.' '; |
|
499 | 499 | $criteria_post .= ' AND (r.read_id IS NULL OR r.post_id < t.topic_last_post_id)'; |
500 | 500 | } else { |
501 | 501 | } |
@@ -503,7 +503,7 @@ discard block |
||
503 | 503 | } elseif (1 == $GLOBALS['xoopsModuleConfig']['read_mode']) { |
504 | 504 | // START irmtfan fix read_mode = 1 bugs - for all users (member and anon) |
505 | 505 | if ($time_criterion = max($GLOBALS['last_visit'], $startdate)) { |
506 | - $criteria_post = ' p.post_time > ' . $time_criterion; // for all users |
|
506 | + $criteria_post = ' p.post_time > '.$time_criterion; // for all users |
|
507 | 507 | $topics = []; |
508 | 508 | $topic_lastread = newbbGetCookie('LT', true); |
509 | 509 | if (count($topic_lastread) > 0) { |
@@ -514,7 +514,7 @@ discard block |
||
514 | 514 | } |
515 | 515 | } |
516 | 516 | if (count($topics) > 0) { |
517 | - $criteria_extra = ' AND t.topic_id NOT IN (' . implode(',', $topics) . ')'; |
|
517 | + $criteria_extra = ' AND t.topic_id NOT IN ('.implode(',', $topics).')'; |
|
518 | 518 | } |
519 | 519 | } |
520 | 520 | // END irmtfan fix read_mode = 1 bugs - for all users (member and anon) |
@@ -529,22 +529,22 @@ discard block |
||
529 | 529 | case 'all': |
530 | 530 | break; |
531 | 531 | default: |
532 | - $criteria_post = ' (p.post_time > ' . $startdate . ' OR t.topic_sticky=1)'; |
|
532 | + $criteria_post = ' (p.post_time > '.$startdate.' OR t.topic_sticky=1)'; |
|
533 | 533 | break; |
534 | 534 | } |
535 | 535 | $criteria_forum = ''; |
536 | 536 | if (is_object($forum)) { |
537 | - $criteria_forum = ' AND t.forum_id = ' . $forum->getVar('forum_id'); |
|
537 | + $criteria_forum = ' AND t.forum_id = '.$forum->getVar('forum_id'); |
|
538 | 538 | } else { |
539 | 539 | if (is_array($forum) && count($forum) > 0) { |
540 | - $criteria_forum = ' AND t.forum_id IN (' . implode(',', array_keys($forum)) . ')'; |
|
540 | + $criteria_forum = ' AND t.forum_id IN ('.implode(',', array_keys($forum)).')'; |
|
541 | 541 | } elseif (!empty($forum)) { |
542 | - $criteria_forum = ' AND t.forum_id =' . (int)$forum; |
|
542 | + $criteria_forum = ' AND t.forum_id ='.(int) $forum; |
|
543 | 543 | } |
544 | 544 | } |
545 | 545 | |
546 | - $sql = 'SELECT COUNT(*) AS count FROM ' . $this->db->prefix('newbb_topics') . ' t ' . $leftjoin; |
|
547 | - $sql .= ' WHERE ' . $criteria_post . $criteria_forum . $criteria_extra . $criteria_approve; |
|
546 | + $sql = 'SELECT COUNT(*) AS count FROM '.$this->db->prefix('newbb_topics').' t '.$leftjoin; |
|
547 | + $sql .= ' WHERE '.$criteria_post.$criteria_forum.$criteria_extra.$criteria_approve; |
|
548 | 548 | if (!$result = $this->db->query($sql)) { |
549 | 549 | //xoops_error($this->db->error().'<br>'.$sql); |
550 | 550 | return null; |
@@ -572,7 +572,7 @@ discard block |
||
572 | 572 | return true; |
573 | 573 | } |
574 | 574 | |
575 | - require_once dirname(__DIR__) . '/include/functions.user.php'; |
|
575 | + require_once dirname(__DIR__).'/include/functions.user.php'; |
|
576 | 576 | if (newbbIsAdmin($forum)) { |
577 | 577 | return true; |
578 | 578 | } |
@@ -673,7 +673,7 @@ discard block |
||
673 | 673 | " OR parent_forum = forum_id"; |
674 | 674 | */ |
675 | 675 | $criteria = new \CriteriaCompo(); |
676 | - $criteria->add(new \Criteria('parent_forum', '(' . implode(', ', $forum_ids) . ')', 'NOT IN'), 'AND'); |
|
676 | + $criteria->add(new \Criteria('parent_forum', '('.implode(', ', $forum_ids).')', 'NOT IN'), 'AND'); |
|
677 | 677 | $criteria->add(new \Criteria('parent_forum', '`forum_id`', '='), 'OR'); |
678 | 678 | $b1 = $this->updateAll('parent_forum', 0, $criteria, true); |
679 | 679 | // check cat_id orphan forums |
@@ -683,7 +683,7 @@ discard block |
||
683 | 683 | return false; |
684 | 684 | } |
685 | 685 | $criteria = new \CriteriaCompo(); |
686 | - $criteria->add(new \Criteria('cat_id', '(' . implode(', ', $cat_ids) . ')', 'NOT IN'), 'AND'); |
|
686 | + $criteria->add(new \Criteria('cat_id', '('.implode(', ', $cat_ids).')', 'NOT IN'), 'AND'); |
|
687 | 687 | $b2 = $this->updateAll('cat_id', $cat_ids[0], $criteria, true); |
688 | 688 | |
689 | 689 | return ($b1 && $b2); |
@@ -711,20 +711,20 @@ discard block |
||
711 | 711 | } |
712 | 712 | |
713 | 713 | if (!is_object($object)) { |
714 | - $object = $this->get((int)$object); |
|
714 | + $object = $this->get((int) $object); |
|
715 | 715 | } |
716 | 716 | |
717 | 717 | if (!$object->getVar('forum_id')) { |
718 | 718 | return false; |
719 | 719 | } |
720 | - $sql = 'SELECT MAX(post_id) AS last_post, COUNT(*) AS total FROM ' . $this->db->prefix('newbb_posts') . ' AS p LEFT JOIN ' . $this->db->prefix('newbb_topics') . ' AS t ON p.topic_id=t.topic_id WHERE p.approved=1 AND t.approved=1 AND p.forum_id = ' . $object->getVar('forum_id'); |
|
720 | + $sql = 'SELECT MAX(post_id) AS last_post, COUNT(*) AS total FROM '.$this->db->prefix('newbb_posts').' AS p LEFT JOIN '.$this->db->prefix('newbb_topics').' AS t ON p.topic_id=t.topic_id WHERE p.approved=1 AND t.approved=1 AND p.forum_id = '.$object->getVar('forum_id'); |
|
721 | 721 | |
722 | 722 | if ($result = $this->db->query($sql)) { |
723 | 723 | $last_post = 0; |
724 | 724 | $posts = 0; |
725 | 725 | if ($row = $this->db->fetchArray($result)) { |
726 | - $last_post = (int)$row['last_post']; |
|
727 | - $posts = (int)$row['total']; |
|
726 | + $last_post = (int) $row['last_post']; |
|
727 | + $posts = (int) $row['total']; |
|
728 | 728 | } |
729 | 729 | if ($object->getVar('forum_last_post_id') !== $last_post) { |
730 | 730 | $object->setVar('forum_last_post_id', $last_post); |
@@ -734,7 +734,7 @@ discard block |
||
734 | 734 | } |
735 | 735 | } |
736 | 736 | |
737 | - $sql = 'SELECT COUNT(*) AS total FROM ' . $this->db->prefix('newbb_topics') . ' WHERE approved=1 AND forum_id = ' . $object->getVar('forum_id'); |
|
737 | + $sql = 'SELECT COUNT(*) AS total FROM '.$this->db->prefix('newbb_topics').' WHERE approved=1 AND forum_id = '.$object->getVar('forum_id'); |
|
738 | 738 | if ($result = $this->db->query($sql)) { |
739 | 739 | if ($row = $this->db->fetchArray($result)) { |
740 | 740 | if ($object->getVar('forum_topics') !== $row['total']) { |
@@ -776,7 +776,7 @@ discard block |
||
776 | 776 | if (!$forums_id) { |
777 | 777 | return $stats; |
778 | 778 | } |
779 | - $sql = ' SELECT forum_posts AS posts, forum_topics AS topics, forum_id AS id' . ' FROM ' . $this->table . ' WHERE forum_id IN (' . implode(', ', $forums_id) . ')'; |
|
779 | + $sql = ' SELECT forum_posts AS posts, forum_topics AS topics, forum_id AS id'.' FROM '.$this->table.' WHERE forum_id IN ('.implode(', ', $forums_id).')'; |
|
780 | 780 | if (!$result = $this->db->query($sql)) { |
781 | 781 | return $stats; |
782 | 782 | } |
@@ -821,7 +821,7 @@ discard block |
||
821 | 821 | if (!empty($length_title_index)) { |
822 | 822 | $tags_post[] = 'subject'; |
823 | 823 | } |
824 | - $posts = $postHandler->getAll(new \Criteria('post_id', '(' . implode(', ', $posts) . ')', 'IN'), $tags_post, false); |
|
824 | + $posts = $postHandler->getAll(new \Criteria('post_id', '('.implode(', ', $posts).')', 'IN'), $tags_post, false); |
|
825 | 825 | } |
826 | 826 | |
827 | 827 | // Get topic/post stats per forum |
@@ -836,7 +836,7 @@ discard block |
||
836 | 836 | $topics = []; |
837 | 837 | |
838 | 838 | foreach (array_keys($forums) as $id) { |
839 | - $forum =& $forums[$id]; |
|
839 | + $forum = & $forums[$id]; |
|
840 | 840 | |
841 | 841 | if (!$forum['forum_last_post_id']) { |
842 | 842 | continue; |
@@ -868,7 +868,7 @@ discard block |
||
868 | 868 | $name_anonymous = $myts->htmlSpecialChars($GLOBALS['xoopsConfig']['anonymous']); |
869 | 869 | |
870 | 870 | foreach (array_keys($forums) as $id) { |
871 | - $forum =& $forums[$id]; |
|
871 | + $forum = & $forums[$id]; |
|
872 | 872 | |
873 | 873 | $_forum_data = []; |
874 | 874 | $_forum_data['forum_order'] = $forum['forum_order']; |
@@ -891,7 +891,7 @@ discard block |
||
891 | 891 | |
892 | 892 | // irmtfan change if/endif to if{} method |
893 | 893 | if ($post_id = $forum['forum_last_post_id']) { |
894 | - $post =& $posts[$post_id]; |
|
894 | + $post = & $posts[$post_id]; |
|
895 | 895 | $_forum_data['forum_lastpost_id'] = $post_id; |
896 | 896 | $_forum_data['forum_lastpost_time'] = newbbFormatTimestamp($post['post_time']); |
897 | 897 | if (!empty($users_linked[$post['uid']])) { |
@@ -940,14 +940,14 @@ discard block |
||
940 | 940 | */ |
941 | 941 | public function &getTree($cat_id = 0, $pid = 0, $permission = 'access', $prefix = '--', $tags = null) |
942 | 942 | { |
943 | - $pid = (int)$pid; |
|
943 | + $pid = (int) $pid; |
|
944 | 944 | $perm_string = $permission; |
945 | 945 | if (!is_array($tags) || 0 === count($tags)) { |
946 | 946 | $tags = ['forum_id', 'parent_forum', 'forum_name', 'forum_order', 'cat_id']; |
947 | 947 | } |
948 | 948 | $forumsObject = $this->getByPermission($cat_id, $perm_string, $tags); |
949 | 949 | |
950 | - require_once __DIR__ . '/Tree.php'; |
|
950 | + require_once __DIR__.'/Tree.php'; |
|
951 | 951 | $forums_structured = []; |
952 | 952 | foreach (array_keys($forumsObject) as $key) { |
953 | 953 | $forums_structured[$forumsObject[$key]->getVar('cat_id')][$key] = $forumsObject[$key]; |
@@ -976,17 +976,17 @@ discard block |
||
976 | 976 | */ |
977 | 977 | public function &getArrayTree($cat_id = 0, $pid = 0, $permission = 'access', $tags = null, $depth = 0) |
978 | 978 | { |
979 | - $pid = (int)$pid; |
|
979 | + $pid = (int) $pid; |
|
980 | 980 | $perm_string = $permission; |
981 | 981 | if (!is_array($tags) || 0 === count($tags)) { |
982 | 982 | $tags = ['forum_id', 'parent_forum', 'forum_name', 'forum_order', 'cat_id']; |
983 | 983 | } |
984 | 984 | $forumsObject = $this->getByPermission($cat_id, $perm_string, $tags); |
985 | 985 | |
986 | - require_once __DIR__ . '/Tree.php'; |
|
986 | + require_once __DIR__.'/Tree.php'; |
|
987 | 987 | $forums_structured = []; |
988 | 988 | foreach (array_keys($forumsObject) as $key) { |
989 | - $forumObject =& $forumsObject[$key]; |
|
989 | + $forumObject = & $forumsObject[$key]; |
|
990 | 990 | $forums_structured[$forumObject->getVar('cat_id')][$key] = $forumsObject[$key]; |
991 | 991 | } |
992 | 992 | foreach (array_keys($forums_structured) as $cid) { |
@@ -1013,7 +1013,7 @@ discard block |
||
1013 | 1013 | if (!$parents = newbbGetParentForum($object->getVar('forum_id'))) { |
1014 | 1014 | return $ret; |
1015 | 1015 | } |
1016 | - $parents_list = $this->getList(new \Criteria('forum_id', '(' . implode(', ', $parents) . ')', 'IN')); |
|
1016 | + $parents_list = $this->getList(new \Criteria('forum_id', '('.implode(', ', $parents).')', 'IN')); |
|
1017 | 1017 | foreach ($parents as $key => $id) { |
1018 | 1018 | $ret[] = ['forum_id' => $id, 'forum_name' => $parents_list[$id]]; |
1019 | 1019 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | use Xmf\Request; |
33 | 33 | use XoopsModules\Newbb; |
34 | 34 | |
35 | -require_once __DIR__ . '/header.php'; |
|
35 | +require_once __DIR__.'/header.php'; |
|
36 | 36 | |
37 | 37 | $start = Request::getInt('start', 0, 'GET'); |
38 | 38 | $forum_id = Request::getInt('forum', 0, 'GET'); |
@@ -72,8 +72,8 @@ discard block |
||
72 | 72 | //echo $mode.' - '.$status; |
73 | 73 | $post_perpage = $GLOBALS['xoopsModuleConfig']['posts_per_page']; |
74 | 74 | |
75 | -$criteria_count = new \CriteriaCompo(new \Criteria('forum_id', '(' . implode(',', $accessForums) . ')', 'IN')); |
|
76 | -$criteria_post = new \CriteriaCompo(new \Criteria('p.forum_id', '(' . implode(',', $accessForums) . ')', 'IN')); |
|
75 | +$criteria_count = new \CriteriaCompo(new \Criteria('forum_id', '('.implode(',', $accessForums).')', 'IN')); |
|
76 | +$criteria_post = new \CriteriaCompo(new \Criteria('p.forum_id', '('.implode(',', $accessForums).')', 'IN')); |
|
77 | 77 | $criteria_post->setSort('p.post_id'); |
78 | 78 | $criteria_post->setOrder($order); |
79 | 79 | |
@@ -106,33 +106,33 @@ discard block |
||
106 | 106 | // START irmtfan use read_uid to find the unread posts when the user is logged in |
107 | 107 | $read_uid = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('uid') : 0; |
108 | 108 | if (!empty($read_uid)) { |
109 | - $join = ' LEFT JOIN ' . $GLOBALS['xoopsDB']->prefix('newbb_reads_topic') . ' AS r ON r.read_item = p.topic_id AND r.uid = ' . $read_uid . ' '; // irmtfan corrected add AS |
|
110 | - $criteria_status_post = new \CriteriaCompo();// irmtfan new \Criteria |
|
109 | + $join = ' LEFT JOIN '.$GLOBALS['xoopsDB']->prefix('newbb_reads_topic').' AS r ON r.read_item = p.topic_id AND r.uid = '.$read_uid.' '; // irmtfan corrected add AS |
|
110 | + $criteria_status_post = new \CriteriaCompo(); // irmtfan new \Criteria |
|
111 | 111 | $criteria_status_post->add(new \Criteria('p.post_id', 'r.`post_id`', '>')); // irmtfan corrected - should use $value='r.``' to render in XOOPS/class/criteria.php |
112 | - $criteria_status_post->add(new \Criteria('r.read_id', null, 'IS NULL'), 'OR');// irmtfan corrected - should use "IS NULL" to render in XOOPS/class/criteria.php |
|
112 | + $criteria_status_post->add(new \Criteria('r.read_id', null, 'IS NULL'), 'OR'); // irmtfan corrected - should use "IS NULL" to render in XOOPS/class/criteria.php |
|
113 | 113 | $criteria_post->add($criteria_status_post); // irmtfan add the status criteria to post criteria - move here |
114 | - $criteria_count = $criteria_post;// irmtfan criteria count is equal to criteria post - move here |
|
114 | + $criteria_count = $criteria_post; // irmtfan criteria count is equal to criteria post - move here |
|
115 | 115 | } else { |
116 | 116 | } |
117 | 117 | // END irmtfan use read_uid to find the unread posts when the user is logged in |
118 | 118 | //$criteria_status_post->add(new \Criteria("p.approved", 1)); // irmtfan commented and removed |
119 | 119 | //$criteria_status_count =& $criteria_status_post; |
120 | 120 | } elseif (1 == $GLOBALS['xoopsModuleConfig']['read_mode']) { |
121 | - $criteria_count->add(new \Criteria('post_time', (int)$last_visit, '>')); // irmtfan add new \Criteria |
|
122 | - $criteria_post->add(new \Criteria('p.post_time', (int)$last_visit, '>')); // irmtfan add new \Criteria |
|
121 | + $criteria_count->add(new \Criteria('post_time', (int) $last_visit, '>')); // irmtfan add new \Criteria |
|
122 | + $criteria_post->add(new \Criteria('p.post_time', (int) $last_visit, '>')); // irmtfan add new \Criteria |
|
123 | 123 | // START irmtfan fix read_mode = 1 bugs - for all users (member and anon) |
124 | 124 | $topics = []; |
125 | 125 | $topic_lastread = newbbGetCookie('LT', true); |
126 | 126 | if (count($topic_lastread) > 0) { |
127 | 127 | foreach ($topic_lastread as $id => $time) { |
128 | - if ($time > (int)$last_visit) { |
|
128 | + if ($time > (int) $last_visit) { |
|
129 | 129 | $topics[] = $id; |
130 | 130 | } |
131 | 131 | } |
132 | 132 | } |
133 | 133 | if (count($topics) > 0) { |
134 | - $criteria_count->add(new \Criteria('topic_id', '(' . implode(',', $topics) . ')', 'NOT IN')); |
|
135 | - $criteria_post->add(new \Criteria('p.topic_id', '(' . implode(',', $topics) . ')', 'NOT IN')); |
|
134 | + $criteria_count->add(new \Criteria('topic_id', '('.implode(',', $topics).')', 'NOT IN')); |
|
135 | + $criteria_post->add(new \Criteria('p.topic_id', '('.implode(',', $topics).')', 'NOT IN')); |
|
136 | 136 | } |
137 | 137 | // END irmtfan fix read_mode = 1 bugs - for all users (member and anon) |
138 | 138 | //$criteria_status_count->add(new \Criteria("approved", 1));// irmtfan commented and removed |
@@ -161,8 +161,8 @@ discard block |
||
161 | 161 | $viewmode = Request::getString('viewmode', (!empty($viewmode_cookie) ? $viewmode_cookie : (@$valid_modes[$GLOBALS['xoopsModuleConfig']['view_mode'] - 1])), 'GET'); |
162 | 162 | $viewmode = in_array($viewmode, $valid_modes) ? $viewmode : $valid_modes[0]; |
163 | 163 | |
164 | -$postCount = $postHandler->getPostCount($criteria_count, $join);// irmtfan add join for read_mode = 2 |
|
165 | -$posts = $postHandler->getPostsByLimit($criteria_post, $post_perpage, $start, $join);// irmtfan add join for read_mode = 2 |
|
164 | +$postCount = $postHandler->getPostCount($criteria_count, $join); // irmtfan add join for read_mode = 2 |
|
165 | +$posts = $postHandler->getPostsByLimit($criteria_post, $post_perpage, $start, $join); // irmtfan add join for read_mode = 2 |
|
166 | 166 | |
167 | 167 | $poster_array = []; |
168 | 168 | if (count($posts) > 0) { |
@@ -172,20 +172,20 @@ discard block |
||
172 | 172 | } |
173 | 173 | } |
174 | 174 | |
175 | -$xoops_pagetitle = $xoopsModule->getVar('name') . ' - ' . _MD_NEWBB_VIEWALLPOSTS; |
|
175 | +$xoops_pagetitle = $xoopsModule->getVar('name').' - '._MD_NEWBB_VIEWALLPOSTS; |
|
176 | 176 | $xoopsOption['xoops_pagetitle'] = $xoops_pagetitle; |
177 | 177 | $xoopsOption['template_main'] = 'newbb_viewpost.tpl'; |
178 | 178 | |
179 | 179 | require_once $GLOBALS['xoops']->path('header.php'); |
180 | -require_once __DIR__ . '/include/functions.time.php'; |
|
181 | -require_once __DIR__ . '/include/functions.render.php'; |
|
180 | +require_once __DIR__.'/include/functions.time.php'; |
|
181 | +require_once __DIR__.'/include/functions.render.php'; |
|
182 | 182 | |
183 | 183 | //global $xoTheme; |
184 | 184 | //$xoTheme->addScript('/Frameworks/textsanitizer/xoops.js'); |
185 | 185 | |
186 | 186 | if (!empty($forum_id)) { |
187 | 187 | if (!$forumHandler->getPermission($forumObject, 'view')) { |
188 | - redirect_header(XOOPS_URL . '/index.php', 2, _MD_NEWBB_NORIGHTTOACCESS); |
|
188 | + redirect_header(XOOPS_URL.'/index.php', 2, _MD_NEWBB_NORIGHTTOACCESS); |
|
189 | 189 | } |
190 | 190 | if ($forumObject->getVar('parent_forum')) { |
191 | 191 | $parent_forumObject = $forumHandler->get($forumObject->getVar('parent_forum'), ['forum_name']); |
@@ -199,17 +199,17 @@ discard block |
||
199 | 199 | $xoopsTpl->assign('forum_name', $forumObject->getVar('forum_name')); |
200 | 200 | $xoopsTpl->assign('forum_moderators', $forumObject->dispForumModerators()); |
201 | 201 | |
202 | - $xoops_pagetitle = $forumObject->getVar('forum_name') . ' - ' . _MD_NEWBB_VIEWALLPOSTS . ' [' . $xoopsModule->getVar('name') . ']'; |
|
202 | + $xoops_pagetitle = $forumObject->getVar('forum_name').' - '._MD_NEWBB_VIEWALLPOSTS.' ['.$xoopsModule->getVar('name').']'; |
|
203 | 203 | $xoopsTpl->assign('forum_id', $forumObject->getVar('forum_id')); |
204 | 204 | // irmtfan new method |
205 | 205 | if (!empty($GLOBALS['xoopsModuleConfig']['rss_enable'])) { |
206 | 206 | $xoopsTpl->assign('xoops_module_header', ' |
207 | - <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 . '" /> |
|
207 | + <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.'" /> |
|
208 | 208 | ' . @$xoopsTpl->get_template_vars('xoops_module_header')); |
209 | 209 | } |
210 | 210 | } elseif (!empty($GLOBALS['xoopsModuleConfig']['rss_enable'])) { |
211 | 211 | $xoopsTpl->assign('xoops_module_header', ' |
212 | - <link rel="alternate" type="application/xml+rss" title="' . $xoopsModule->getVar('name') . '" href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/rss.php" /> |
|
212 | + <link rel="alternate" type="application/xml+rss" title="' . $xoopsModule->getVar('name').'" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/rss.php" /> |
|
213 | 213 | ' . @$xoopsTpl->get_template_vars('xoops_module_header')); |
214 | 214 | } |
215 | 215 | // irmtfan remove and move to footer.php |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | /** @var \XoopsMembershipHandler $memberHandler */ |
223 | 223 | $memberHandler = xoops_getHandler('member'); |
224 | 224 | $userid_array = array_keys($poster_array); |
225 | - $user_criteria = '(' . implode(',', $userid_array) . ')'; |
|
225 | + $user_criteria = '('.implode(',', $userid_array).')'; |
|
226 | 226 | $users = $memberHandler->getUsers(new \Criteria('uid', $user_criteria, 'IN'), true); |
227 | 227 | } else { |
228 | 228 | $user_criteria = ''; |
@@ -260,9 +260,9 @@ discard block |
||
260 | 260 | $post_title = $post->getVar('subject'); |
261 | 261 | |
262 | 262 | if ($posticon = $post->getVar('icon')) { |
263 | - $post_image = '<a name="' . $post->getVar('post_id') . '"><img src="' . XOOPS_URL . '/images/subject/' . htmlspecialchars($posticon, ENT_QUOTES | ENT_HTML5) . '" alt="" /></a>'; |
|
263 | + $post_image = '<a name="'.$post->getVar('post_id').'"><img src="'.XOOPS_URL.'/images/subject/'.htmlspecialchars($posticon, ENT_QUOTES | ENT_HTML5).'" alt="" /></a>'; |
|
264 | 264 | } else { |
265 | - $post_image = '<a name="' . $post->getVar('post_id') . '"><img src="' . XOOPS_URL . '/images/icons/no_posticon.gif" alt="" /></a>'; |
|
265 | + $post_image = '<a name="'.$post->getVar('post_id').'"><img src="'.XOOPS_URL.'/images/icons/no_posticon.gif" alt="" /></a>'; |
|
266 | 266 | } |
267 | 267 | $poster = [ |
268 | 268 | 'uid' => 0, |
@@ -276,10 +276,10 @@ discard block |
||
276 | 276 | $post_text = $post->getVar('post_text'); |
277 | 277 | $post_attachment = $post->displayAttachment(); |
278 | 278 | } elseif ($GLOBALS['xoopsModuleConfig']['enable_karma'] && $post->getVar('post_karma') > $user_karma) { |
279 | - $post_text = "<div class='karma'>" . sprintf(_MD_NEWBB_KARMA_REQUIREMENT, $user_karma, $post->getVar('post_karma')) . '</div>'; |
|
279 | + $post_text = "<div class='karma'>".sprintf(_MD_NEWBB_KARMA_REQUIREMENT, $user_karma, $post->getVar('post_karma')).'</div>'; |
|
280 | 280 | $post_attachment = ''; |
281 | 281 | } elseif ($GLOBALS['xoopsModuleConfig']['allow_require_reply'] && $post->getVar('require_reply')) { |
282 | - $post_text = "<div class='karma'>" . _MD_NEWBB_REPLY_REQUIREMENT . '</div>'; |
|
282 | + $post_text = "<div class='karma'>"._MD_NEWBB_REPLY_REQUIREMENT.'</div>'; |
|
283 | 283 | $post_attachment = ''; |
284 | 284 | } else { |
285 | 285 | $post_text = $post->getVar('post_text'); |
@@ -299,40 +299,40 @@ discard block |
||
299 | 299 | || (!$suspension[$post->getVar('forum_id')] && $post->checkIdentity() |
300 | 300 | && $post->checkTimelimit('delete_timelimit'))) { |
301 | 301 | $thread_buttons['delete']['image'] = newbbDisplayImage('p_delete', _DELETE); |
302 | - $thread_buttons['delete']['link'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/delete.php?forum=' . $post->getVar('forum_id') . '&topic_id=' . $post->getVar('topic_id'); |
|
302 | + $thread_buttons['delete']['link'] = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/delete.php?forum='.$post->getVar('forum_id').'&topic_id='.$post->getVar('topic_id'); |
|
303 | 303 | $thread_buttons['delete']['name'] = _DELETE; |
304 | 304 | } |
305 | 305 | if ($isAdmin |
306 | 306 | || !$suspension[$post->getVar('forum_id')] && $post->checkIdentity() |
307 | 307 | && $post->checkTimelimit('edit_timelimit')) { |
308 | 308 | $thread_buttons['edit']['image'] = newbbDisplayImage('p_edit', _EDIT); |
309 | - $thread_buttons['edit']['link'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/edit.php?forum=' . $post->getVar('forum_id') . '&topic_id=' . $post->getVar('topic_id'); |
|
309 | + $thread_buttons['edit']['link'] = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/edit.php?forum='.$post->getVar('forum_id').'&topic_id='.$post->getVar('topic_id'); |
|
310 | 310 | $thread_buttons['edit']['name'] = _EDIT; |
311 | 311 | } |
312 | 312 | if (is_object($GLOBALS['xoopsUser']) && !$suspension[$post->getVar('forum_id')]) { |
313 | 313 | $thread_buttons['reply']['image'] = newbbDisplayImage('p_reply', _MD_NEWBB_REPLY); |
314 | - $thread_buttons['reply']['link'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/reply.php?forum=' . $post->getVar('forum_id') . '&topic_id=' . $post->getVar('topic_id'); |
|
314 | + $thread_buttons['reply']['link'] = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/reply.php?forum='.$post->getVar('forum_id').'&topic_id='.$post->getVar('topic_id'); |
|
315 | 315 | $thread_buttons['reply']['name'] = _MD_NEWBB_REPLY; |
316 | 316 | |
317 | 317 | $thread_buttons['quote']['image'] = newbbDisplayImage('p_quote', _MD_NEWBB_QUOTE); |
318 | - $thread_buttons['quote']['link'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/reply.php?forum=' . $post->getVar('forum_id') . '&topic_id=' . $post->getVar('topic_id') . '&quotedac=1'; |
|
318 | + $thread_buttons['quote']['link'] = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/reply.php?forum='.$post->getVar('forum_id').'&topic_id='.$post->getVar('topic_id').'&quotedac=1'; |
|
319 | 319 | $thread_buttons['quote']['name'] = _MD_NEWBB_QUOTE; |
320 | 320 | } |
321 | 321 | } else { |
322 | 322 | $thread_buttons['delete']['image'] = newbbDisplayImage('p_delete', _DELETE); |
323 | - $thread_buttons['delete']['link'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/delete.php?forum=' . $post->getVar('forum_id') . '&topic_id=' . $post->getVar('topic_id'); |
|
323 | + $thread_buttons['delete']['link'] = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/delete.php?forum='.$post->getVar('forum_id').'&topic_id='.$post->getVar('topic_id'); |
|
324 | 324 | $thread_buttons['delete']['name'] = _DELETE; |
325 | 325 | $thread_buttons['edit']['image'] = newbbDisplayImage('p_edit', _EDIT); |
326 | - $thread_buttons['edit']['link'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/edit.php?forum=' . $post->getVar('forum_id') . '&topic_id=' . $post->getVar('topic_id'); |
|
326 | + $thread_buttons['edit']['link'] = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/edit.php?forum='.$post->getVar('forum_id').'&topic_id='.$post->getVar('topic_id'); |
|
327 | 327 | $thread_buttons['edit']['name'] = _EDIT; |
328 | 328 | $thread_buttons['reply']['image'] = newbbDisplayImage('p_reply', _MD_NEWBB_REPLY); |
329 | - $thread_buttons['reply']['link'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/reply.php?forum=' . $post->getVar('forum_id') . '&topic_id=' . $post->getVar('topic_id'); |
|
329 | + $thread_buttons['reply']['link'] = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/reply.php?forum='.$post->getVar('forum_id').'&topic_id='.$post->getVar('topic_id'); |
|
330 | 330 | $thread_buttons['reply']['name'] = _MD_NEWBB_REPLY; |
331 | 331 | } |
332 | 332 | |
333 | 333 | if (!$isAdmin && $GLOBALS['xoopsModuleConfig']['reportmod_enabled']) { |
334 | 334 | $thread_buttons['report']['image'] = newbbDisplayImage('p_report', _MD_NEWBB_REPORT); |
335 | - $thread_buttons['report']['link'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/report.php?forum=' . $post->getVar('forum_id') . '&topic_id=' . $post->getVar('topic_id'); |
|
335 | + $thread_buttons['report']['link'] = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/report.php?forum='.$post->getVar('forum_id').'&topic_id='.$post->getVar('topic_id'); |
|
336 | 336 | $thread_buttons['report']['name'] = _MD_NEWBB_REPORT; |
337 | 337 | } |
338 | 338 | $thread_action = []; |
@@ -361,13 +361,13 @@ discard block |
||
361 | 361 | unset($viewtopic_users, $forums); |
362 | 362 | |
363 | 363 | if (!empty($GLOBALS['xoopsModuleConfig']['show_jump'])) { |
364 | - require_once __DIR__ . '/include/functions.forum.php'; |
|
364 | + require_once __DIR__.'/include/functions.forum.php'; |
|
365 | 365 | $xoopsTpl->assign('forum_jumpbox', newbbMakeJumpbox($forum_id)); |
366 | 366 | } |
367 | 367 | |
368 | 368 | if ($postCount > $post_perpage) { |
369 | 369 | require_once $GLOBALS['xoops']->path('class/pagenav.php'); |
370 | - $nav = new \XoopsPageNav($postCount, $post_perpage, $start, 'start', 'forum=' . $forum_id . '&viewmode=' . $viewmode . '&status=' . $status . '&uid=' . $uid . '&order=' . $order . '&mode=' . $mode); |
|
370 | + $nav = new \XoopsPageNav($postCount, $post_perpage, $start, 'start', 'forum='.$forum_id.'&viewmode='.$viewmode.'&status='.$status.'&uid='.$uid.'&order='.$order.'&mode='.$mode); |
|
371 | 371 | //if (isset($GLOBALS['xoopsModuleConfig']['do_rewrite'])) $nav->url = formatURL(Request::getString('SERVER_NAME', '', 'SERVER')) . $nav->url; |
372 | 372 | if ('select' === $GLOBALS['xoopsModuleConfig']['pagenav_display']) { |
373 | 373 | $navi = $nav->renderSelect(); |
@@ -386,13 +386,13 @@ discard block |
||
386 | 386 | |
387 | 387 | switch ($status) { |
388 | 388 | case 'active': |
389 | - $lang_title = _MD_NEWBB_VIEWALLPOSTS . ' [' . _MD_NEWBB_TYPE_ADMIN . ']'; |
|
389 | + $lang_title = _MD_NEWBB_VIEWALLPOSTS.' ['._MD_NEWBB_TYPE_ADMIN.']'; |
|
390 | 390 | break; |
391 | 391 | case 'pending': |
392 | - $lang_title = _MD_NEWBB_VIEWALLPOSTS . ' [' . _MD_NEWBB_TYPE_PENDING . ']'; |
|
392 | + $lang_title = _MD_NEWBB_VIEWALLPOSTS.' ['._MD_NEWBB_TYPE_PENDING.']'; |
|
393 | 393 | break; |
394 | 394 | case 'deleted': |
395 | - $lang_title = _MD_NEWBB_VIEWALLPOSTS . ' [' . _MD_NEWBB_TYPE_DELETED . ']'; |
|
395 | + $lang_title = _MD_NEWBB_VIEWALLPOSTS.' ['._MD_NEWBB_TYPE_DELETED.']'; |
|
396 | 396 | break; |
397 | 397 | case 'new': |
398 | 398 | $lang_title = _MD_NEWBB_NEWPOSTS; |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | break; |
403 | 403 | } |
404 | 404 | if ($uid > 0) { |
405 | - $lang_title .= ' (' . \XoopsUser::getUnameFromId($uid) . ')'; |
|
405 | + $lang_title .= ' ('.\XoopsUser::getUnameFromId($uid).')'; |
|
406 | 406 | } |
407 | 407 | $xoopsTpl->assign('lang_title', $lang_title); |
408 | 408 | // irmtfan up to p_up |
@@ -411,12 +411,12 @@ discard block |
||
411 | 411 | $xoopsTpl->assign('anonymous_prefix', $GLOBALS['xoopsModuleConfig']['anonymous_prefix']); |
412 | 412 | $xoopsTpl->assign('down', newbbDisplayImage('down', _MD_NEWBB_BOTTOM)); |
413 | 413 | |
414 | -$all_link = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewpost.php?forum=' . $forum_id . "&start=$start"; |
|
415 | -$post_link = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewpost.php?forum=' . $forum_id; |
|
416 | -$newpost_link = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewpost.php?forum=' . $forum_id . '&status=new'; |
|
417 | -$digest_link = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewpost.php?forum=' . $forum_id . "&start=$start&status=digest"; |
|
418 | -$unreplied_link = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewpost.php?forum=' . $forum_id . "&start=$start&status=unreplied"; |
|
419 | -$unread_link = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewpost.php?forum=' . $forum_id . "&start=$start&status=unread"; |
|
414 | +$all_link = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/viewpost.php?forum='.$forum_id."&start=$start"; |
|
415 | +$post_link = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/viewpost.php?forum='.$forum_id; |
|
416 | +$newpost_link = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/viewpost.php?forum='.$forum_id.'&status=new'; |
|
417 | +$digest_link = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/viewpost.php?forum='.$forum_id."&start=$start&status=digest"; |
|
418 | +$unreplied_link = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/viewpost.php?forum='.$forum_id."&start=$start&status=unreplied"; |
|
419 | +$unread_link = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/viewpost.php?forum='.$forum_id."&start=$start&status=unread"; |
|
420 | 420 | |
421 | 421 | $xoopsTpl->assign('all_link', $all_link); |
422 | 422 | $xoopsTpl->assign('post_link', $post_link); |
@@ -428,12 +428,12 @@ discard block |
||
428 | 428 | $viewmode_options = []; |
429 | 429 | if ('DESC' === $order) { |
430 | 430 | $viewmode_options[] = [ |
431 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewpost.php?viewmode=flat&order=ASC&forum=' . $forum_id, |
|
431 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/viewpost.php?viewmode=flat&order=ASC&forum='.$forum_id, |
|
432 | 432 | 'title' => _OLDESTFIRST |
433 | 433 | ]; |
434 | 434 | } else { |
435 | 435 | $viewmode_options[] = [ |
436 | - 'link' => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewpost.php?viewmode=flat&order=DESC&forum=' . $forum_id, |
|
436 | + 'link' => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/viewpost.php?viewmode=flat&order=DESC&forum='.$forum_id, |
|
437 | 437 | 'title' => _NEWESTFIRST |
438 | 438 | ]; |
439 | 439 | } |
@@ -448,5 +448,5 @@ discard block |
||
448 | 448 | $xoopsTpl->assign('mode', $mode); |
449 | 449 | $xoopsTpl->assign('status', $status); |
450 | 450 | // irmtfan move to footer.php |
451 | -require_once __DIR__ . '/footer.php'; |
|
451 | +require_once __DIR__.'/footer.php'; |
|
452 | 452 | require_once $GLOBALS['xoops']->path('footer.php'); |