@@ -74,20 +74,20 @@ discard block |
||
| 74 | 74 | */ |
| 75 | 75 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\language\language $language, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\notification\manager $notification, \phpbb\filesystem\filesystem_interface $filesystem, \FastImageSize\FastImageSize $imagesize, \phpbb\files\upload $files_upload, $root_path, $php_ext) |
| 76 | 76 | { |
| 77 | - $this->db = $db; |
|
| 78 | - $this->config = $config; |
|
| 77 | + $this->db = $db; |
|
| 78 | + $this->config = $config; |
|
| 79 | 79 | $this->language = $language; |
| 80 | 80 | $this->template = $template; |
| 81 | 81 | $this->user = $user; |
| 82 | - $this->helper = $helper; |
|
| 83 | - $this->request = $request; |
|
| 82 | + $this->helper = $helper; |
|
| 83 | + $this->request = $request; |
|
| 84 | 84 | $this->auth = $auth; |
| 85 | 85 | $this->notification = $notification; |
| 86 | - $this->filesystem = $filesystem; |
|
| 86 | + $this->filesystem = $filesystem; |
|
| 87 | 87 | $this->imagesize = $imagesize; |
| 88 | 88 | $this->files_upload = $files_upload; |
| 89 | 89 | $this->root_path = $root_path; |
| 90 | - $this->php_ext = $php_ext; |
|
| 90 | + $this->php_ext = $php_ext; |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | /** |
@@ -103,13 +103,13 @@ discard block |
||
| 103 | 103 | |
| 104 | 104 | $this->db->sql_transaction('begin'); |
| 105 | 105 | |
| 106 | - $sql = 'INSERT INTO ' . $this->links_table . ' ' . $this->db->sql_build_array('INSERT', $data); |
|
| 106 | + $sql = 'INSERT INTO '.$this->links_table.' '.$this->db->sql_build_array('INSERT', $data); |
|
| 107 | 107 | $this->db->sql_query($sql); |
| 108 | 108 | $notification_data['link_id'] = $this->db->sql_nextid(); |
| 109 | 109 | |
| 110 | 110 | if (!$need_approval || $this->auth->acl_get('a_') || $this->auth->acl_get('m_')) |
| 111 | 111 | { |
| 112 | - $sql = 'UPDATE ' . $this->categories_table . ' |
|
| 112 | + $sql = 'UPDATE '.$this->categories_table.' |
|
| 113 | 113 | SET cat_links = cat_links + 1 |
| 114 | 114 | WHERE cat_id = ' . (int) $data['link_cat']; |
| 115 | 115 | $this->db->sql_query($sql); |
@@ -167,14 +167,14 @@ discard block |
||
| 167 | 167 | |
| 168 | 168 | $this->db->sql_transaction('begin'); |
| 169 | 169 | |
| 170 | - $sql = 'UPDATE ' . $this->categories_table . ' |
|
| 170 | + $sql = 'UPDATE '.$this->categories_table.' |
|
| 171 | 171 | SET cat_links = cat_links - 1 |
| 172 | 172 | WHERE cat_id = ' . (int) $old_cat; |
| 173 | 173 | $this->db->sql_query($sql); |
| 174 | 174 | |
| 175 | 175 | if (!$need_approval) |
| 176 | 176 | { |
| 177 | - $sql = 'UPDATE ' . $this->categories_table . ' |
|
| 177 | + $sql = 'UPDATE '.$this->categories_table.' |
|
| 178 | 178 | SET cat_links = cat_links + 1 |
| 179 | 179 | WHERE cat_id = ' . (int) $data['link_cat']; |
| 180 | 180 | $this->db->sql_query($sql); |
@@ -192,8 +192,8 @@ discard block |
||
| 192 | 192 | $this->notification->add_notifications($notification_type, $notification_data); |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | - $sql = 'UPDATE ' . $this->links_table . ' |
|
| 196 | - SET ' . $this->db->sql_build_array('UPDATE', $data) . ' |
|
| 195 | + $sql = 'UPDATE '.$this->links_table.' |
|
| 196 | + SET ' . $this->db->sql_build_array('UPDATE', $data).' |
|
| 197 | 197 | WHERE link_id = ' . (int) $link_id; |
| 198 | 198 | $this->db->sql_query($sql); |
| 199 | 199 | } |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | ); |
| 220 | 220 | |
| 221 | 221 | $sql = 'SELECT link_banner |
| 222 | - FROM ' . $this->links_table . ' |
|
| 222 | + FROM ' . $this->links_table.' |
|
| 223 | 223 | WHERE '. $this->db->sql_in_set('link_id', $url_array); |
| 224 | 224 | $result = $this->db->sql_query($sql); |
| 225 | 225 | |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | { |
| 228 | 228 | if ($row['link_banner'] && !preg_match('/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|www\.).+/si', $row['link_banner'])) |
| 229 | 229 | { |
| 230 | - $banner_img = $this->root_path . $this->get_banner_path(basename($row['link_banner'])); |
|
| 230 | + $banner_img = $this->root_path.$this->get_banner_path(basename($row['link_banner'])); |
|
| 231 | 231 | |
| 232 | 232 | if (file_exists($banner_img)) |
| 233 | 233 | { |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | $this->db->sql_query("DELETE FROM $table WHERE ".$this->db->sql_in_set($field, $url_array)); |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | - $sql = 'UPDATE ' . $this->categories_table . ' |
|
| 244 | + $sql = 'UPDATE '.$this->categories_table.' |
|
| 245 | 245 | SET cat_links = cat_links - '.sizeof($url_array).' |
| 246 | 246 | WHERE cat_id = ' . (int) $cat_id; |
| 247 | 247 | $this->db->sql_query($sql); |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | if ($this->request->is_ajax()) |
| 260 | 260 | { |
| 261 | 261 | $sql = 'SELECT cat_links |
| 262 | - FROM ' . $this->categories_table . ' |
|
| 262 | + FROM ' . $this->categories_table.' |
|
| 263 | 263 | WHERE cat_id = ' . (int) $cat_id; |
| 264 | 264 | $result = $this->db->sql_query($sql); |
| 265 | 265 | $data = $this->db->sql_fetchrow($result); |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | public function view($link_id) |
| 287 | 287 | { |
| 288 | 288 | $sql = 'SELECT link_id, link_url |
| 289 | - FROM ' . $this->links_table . ' |
|
| 289 | + FROM ' . $this->links_table.' |
|
| 290 | 290 | WHERE link_id = ' . (int) $link_id; |
| 291 | 291 | $result = $this->db->sql_query($sql); |
| 292 | 292 | $data = $this->db->sql_fetchrow($result); |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | throw new \phpbb\exception\http_exception(404, 'DIR_ERROR_NO_LINKS'); |
| 297 | 297 | } |
| 298 | 298 | |
| 299 | - $sql = 'UPDATE ' . $this->links_table . ' |
|
| 299 | + $sql = 'UPDATE '.$this->links_table.' |
|
| 300 | 300 | SET link_view = link_view + 1 |
| 301 | 301 | WHERE link_id = ' . (int) $link_id; |
| 302 | 302 | $this->db->sql_query($sql); |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | if ($details['scheme'] == 'https') |
| 322 | 322 | { |
| 323 | 323 | $default_port = 443; |
| 324 | - $hostname = 'ssl://' . $details['host']; |
|
| 324 | + $hostname = 'ssl://'.$details['host']; |
|
| 325 | 325 | } |
| 326 | 326 | |
| 327 | 327 | if (!isset($details['path'])) |
@@ -379,7 +379,7 @@ discard block |
||
| 379 | 379 | $flag_path = $ext_path.'images/flags/'; |
| 380 | 380 | $img_flag = 'no_flag.png'; |
| 381 | 381 | |
| 382 | - if ($this->config['dir_activ_flag'] && !empty($data['link_flag']) && file_exists($flag_path . $data['link_flag'])) |
|
| 382 | + if ($this->config['dir_activ_flag'] && !empty($data['link_flag']) && file_exists($flag_path.$data['link_flag'])) |
|
| 383 | 383 | { |
| 384 | 384 | $img_flag = $data['link_flag']; |
| 385 | 385 | } |
@@ -421,7 +421,7 @@ discard block |
||
| 421 | 421 | $list = '<select name="vote">'; |
| 422 | 422 | for ($i = 0; $i <= 10; $i++) |
| 423 | 423 | { |
| 424 | - $list .= '<option value="' . $i . '"' . (($i == 5) ? ' selected="selected"' : '') . '>' . $i . '</option>'; |
|
| 424 | + $list .= '<option value="'.$i.'"'.(($i == 5) ? ' selected="selected"' : '').'>'.$i.'</option>'; |
|
| 425 | 425 | } |
| 426 | 426 | $list .= '</select>'; |
| 427 | 427 | |
@@ -459,8 +459,8 @@ discard block |
||
| 459 | 459 | { |
| 460 | 460 | $thumb = $this->thumb_process($data['link_url']); |
| 461 | 461 | |
| 462 | - $sql = 'UPDATE ' . $this->links_table . " |
|
| 463 | - SET link_thumb = '" . $this->db->sql_escape($thumb) . "' |
|
| 462 | + $sql = 'UPDATE '.$this->links_table." |
|
| 463 | + SET link_thumb = '" . $this->db->sql_escape($thumb)."' |
|
| 464 | 464 | WHERE link_id = " . (int) $data['link_id']; |
| 465 | 465 | $this->db->sql_query($sql); |
| 466 | 466 | |
@@ -507,7 +507,7 @@ discard block |
||
| 507 | 507 | $height /= $coef_max; |
| 508 | 508 | } |
| 509 | 509 | |
| 510 | - return '<img src="' . $img_src . '" width="' . $width . '" height="' . $height . '" alt="'.$data['link_name'].'" title="'.$data['link_name'].'" />'; |
|
| 510 | + return '<img src="'.$img_src.'" width="'.$width.'" height="'.$height.'" alt="'.$data['link_name'].'" title="'.$data['link_name'].'" />'; |
|
| 511 | 511 | } |
| 512 | 512 | return ''; |
| 513 | 513 | } |
@@ -529,12 +529,12 @@ discard block |
||
| 529 | 529 | |
| 530 | 530 | $this->db->sql_transaction('begin'); |
| 531 | 531 | |
| 532 | - $sql = 'INSERT INTO ' . $this->votes_table . ' ' . $this->db->sql_build_array('INSERT', $data); |
|
| 532 | + $sql = 'INSERT INTO '.$this->votes_table.' '.$this->db->sql_build_array('INSERT', $data); |
|
| 533 | 533 | $this->db->sql_query($sql); |
| 534 | 534 | |
| 535 | - $sql = 'UPDATE ' . $this->links_table . ' |
|
| 535 | + $sql = 'UPDATE '.$this->links_table.' |
|
| 536 | 536 | SET link_vote = link_vote + 1, |
| 537 | - link_note = link_note + ' . (int) $data['vote_note'] . ' |
|
| 537 | + link_note = link_note + ' . (int) $data['vote_note'].' |
|
| 538 | 538 | WHERE link_id = ' . (int) $link_id; |
| 539 | 539 | $this->db->sql_query($sql); |
| 540 | 540 | |
@@ -542,7 +542,7 @@ discard block |
||
| 542 | 542 | |
| 543 | 543 | if ($this->request->is_ajax()) |
| 544 | 544 | { |
| 545 | - $sql= 'SELECT link_vote, link_note FROM ' . $this->links_table . ' WHERE link_id = ' . (int) $link_id; |
|
| 545 | + $sql = 'SELECT link_vote, link_note FROM '.$this->links_table.' WHERE link_id = '.(int) $link_id; |
|
| 546 | 546 | $result = $this->db->sql_query($sql); |
| 547 | 547 | $data = $this->db->sql_fetchrow($result); |
| 548 | 548 | |
@@ -576,8 +576,8 @@ discard block |
||
| 576 | 576 | |
| 577 | 577 | $details = parse_url($url); |
| 578 | 578 | |
| 579 | - $root_url = $details['scheme'].'://'.$details['host']; |
|
| 580 | - $absolute_url = isset($details['path']) ? $root_url.$details['path'] : $root_url; |
|
| 579 | + $root_url = $details['scheme'].'://'.$details['host']; |
|
| 580 | + $absolute_url = isset($details['path']) ? $root_url.$details['path'] : $root_url; |
|
| 581 | 581 | |
| 582 | 582 | if ($this->config['dir_activ_thumb_remote'] && $this->_ascreen_exist($details['scheme'], $details['host'])) |
| 583 | 583 | { |
@@ -617,7 +617,7 @@ discard block |
||
| 617 | 617 | { |
| 618 | 618 | $old_banner = $this->request->variable('old_banner', ''); |
| 619 | 619 | |
| 620 | - $destination = $this->root_path . $this->get_banner_path(); |
|
| 620 | + $destination = $this->root_path.$this->get_banner_path(); |
|
| 621 | 621 | |
| 622 | 622 | // Can we upload? |
| 623 | 623 | $can_upload = ($this->config['dir_storage_banner'] && $this->filesystem->exists($destination) && $this->filesystem->is_writable($destination) && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false; |
@@ -666,7 +666,7 @@ discard block |
||
| 666 | 666 | |
| 667 | 667 | $file = $upload->handle_upload('files.types.remote', $banner); |
| 668 | 668 | |
| 669 | - $prefix = unique_id() . '_'; |
|
| 669 | + $prefix = unique_id().'_'; |
|
| 670 | 670 | $file->clean_filename('real', $prefix); |
| 671 | 671 | |
| 672 | 672 | if (sizeof($file->error)) |
@@ -697,7 +697,7 @@ discard block |
||
| 697 | 697 | { |
| 698 | 698 | if (!preg_match('#^(http|https|ftp)://#i', $banner)) |
| 699 | 699 | { |
| 700 | - $banner = 'http://' . $banner; |
|
| 700 | + $banner = 'http://'.$banner; |
|
| 701 | 701 | } |
| 702 | 702 | if (!preg_match('#^(http|https|ftp)://(?:(.*?\.)*?[a-z0-9\-]+?\.[a-z]{2,4}|(?:\d{1,3}\.){3,5}\d{1,3}):?([0-9]*?).*?\.(gif|jpg|jpeg|png)$#i', $banner)) |
| 703 | 703 | { |
@@ -728,8 +728,8 @@ discard block |
||
| 728 | 728 | } |
| 729 | 729 | |
| 730 | 730 | // Check image type |
| 731 | - $types = \phpbb\files\upload::image_types(); |
|
| 732 | - $extension = strtolower(\phpbb\files\filespec::get_extension($banner)); |
|
| 731 | + $types = \phpbb\files\upload::image_types(); |
|
| 732 | + $extension = strtolower(\phpbb\files\filespec::get_extension($banner)); |
|
| 733 | 733 | |
| 734 | 734 | // Check if this is actually an image |
| 735 | 735 | if ($file_stream = @fopen($banner, 'r')) |
@@ -807,7 +807,7 @@ discard block |
||
| 807 | 807 | */ |
| 808 | 808 | private function _banner_delete($file) |
| 809 | 809 | { |
| 810 | - $old_banner = $this->root_path . $this->get_banner_path($file); |
|
| 810 | + $old_banner = $this->root_path.$this->get_banner_path($file); |
|
| 811 | 811 | |
| 812 | 812 | if (file_exists($old_banner)) |
| 813 | 813 | { |
@@ -851,7 +851,7 @@ discard block |
||
| 851 | 851 | |
| 852 | 852 | if (file_exists($flag_path.$img_file)) |
| 853 | 853 | { |
| 854 | - $list .= '<option value="' . $img_file . '" ' . (($img_file == $value) ? 'selected="selected"' : '') . '>' . $name . '</option>'; |
|
| 854 | + $list .= '<option value="'.$img_file.'" '.(($img_file == $value) ? 'selected="selected"' : '').'>'.$name.'</option>'; |
|
| 855 | 855 | } |
| 856 | 856 | } |
| 857 | 857 | |
@@ -867,8 +867,8 @@ discard block |
||
| 867 | 867 | { |
| 868 | 868 | if ($this->config['dir_recent_block']) |
| 869 | 869 | { |
| 870 | - $limit_sql = $this->config['dir_recent_rows'] * $this->config['dir_recent_columns']; |
|
| 871 | - $exclude_array = array_filter(explode(',', str_replace(' ', '', $this->config['dir_recent_exclude']))); |
|
| 870 | + $limit_sql = $this->config['dir_recent_rows'] * $this->config['dir_recent_columns']; |
|
| 871 | + $exclude_array = array_filter(explode(',', str_replace(' ', '', $this->config['dir_recent_exclude']))); |
|
| 872 | 872 | |
| 873 | 873 | $sql_array = array( |
| 874 | 874 | 'SELECT' => 'l.link_id, l.link_cat, l.link_url, l.link_user_id, l.link_comment, l. link_description, l.link_vote, l.link_note, l.link_view, l.link_time, l.link_name, l.link_thumb, u.user_id, u.username, u.user_colour, c.cat_name', |
@@ -884,7 +884,7 @@ discard block |
||
| 884 | 884 | 'ON' => 'l.link_cat = c.cat_id' |
| 885 | 885 | ) |
| 886 | 886 | ), |
| 887 | - 'WHERE' => 'l.link_active = 1' . (sizeof($exclude_array) ? ' AND ' . $this->db->sql_in_set('l.link_cat', $exclude_array, true) : ''), |
|
| 887 | + 'WHERE' => 'l.link_active = 1'.(sizeof($exclude_array) ? ' AND '.$this->db->sql_in_set('l.link_cat', $exclude_array, true) : ''), |
|
| 888 | 888 | 'ORDER_BY' => 'l.link_time DESC, l.link_id DESC'); |
| 889 | 889 | |
| 890 | 890 | $sql = $this->db->sql_build_query('SELECT', $sql_array); |
@@ -901,7 +901,7 @@ discard block |
||
| 901 | 901 | if (sizeof($rowset)) |
| 902 | 902 | { |
| 903 | 903 | $this->template->assign_block_vars('block', array( |
| 904 | - 'S_COL_WIDTH' => (100 / $this->config['dir_recent_columns']) . '%', |
|
| 904 | + 'S_COL_WIDTH' => (100 / $this->config['dir_recent_columns']).'%', |
|
| 905 | 905 | )); |
| 906 | 906 | |
| 907 | 907 | foreach ($rowset as $row) |
@@ -919,7 +919,7 @@ discard block |
||
| 919 | 919 | 'COUNT' => $row['link_view'], |
| 920 | 920 | 'COMMENT' => $row['link_comment'], |
| 921 | 921 | |
| 922 | - 'U_CAT' => $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $row['link_cat']), |
|
| 922 | + 'U_CAT' => $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$row['link_cat']), |
|
| 923 | 923 | 'U_COMMENT' => $this->helper->route('ernadoo_phpbbdirectory_comment_view_controller', array('link_id' => (int) $row['link_id'])), |
| 924 | 924 | 'U_LINK' => $row['link_url'], |
| 925 | 925 | 'U_THUMB' => $this->display_thumb($row), |
@@ -58,13 +58,13 @@ discard block |
||
| 58 | 58 | */ |
| 59 | 59 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\language\language $language, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\cron\manager $cron) |
| 60 | 60 | { |
| 61 | - $this->db = $db; |
|
| 62 | - $this->config = $config; |
|
| 61 | + $this->db = $db; |
|
| 62 | + $this->config = $config; |
|
| 63 | 63 | $this->language = $language; |
| 64 | 64 | $this->template = $template; |
| 65 | 65 | $this->user = $user; |
| 66 | - $this->helper = $helper; |
|
| 67 | - $this->request = $request; |
|
| 66 | + $this->helper = $helper; |
|
| 67 | + $this->request = $request; |
|
| 68 | 68 | $this->auth = $auth; |
| 69 | 69 | $this->cron = $cron; |
| 70 | 70 | } |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | public function make_cat_jumpbox() |
| 89 | 89 | { |
| 90 | 90 | $sql = 'SELECT cat_id, cat_name, parent_id, left_id, right_id |
| 91 | - FROM ' . $this->categories_table . ' |
|
| 91 | + FROM ' . $this->categories_table.' |
|
| 92 | 92 | ORDER BY left_id ASC'; |
| 93 | 93 | $result = $this->db->sql_query($sql); |
| 94 | 94 | |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | 'FORUM_ID' => $row['cat_id'], |
| 118 | 118 | 'FORUM_NAME' => $row['cat_name'], |
| 119 | 119 | 'S_FORUM_COUNT' => $iteration, |
| 120 | - 'LINK' => $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $row['cat_id']), |
|
| 120 | + 'LINK' => $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$row['cat_id']), |
|
| 121 | 121 | )); |
| 122 | 122 | |
| 123 | 123 | for ($i = 0; $i < $padding; $i++) |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | |
| 150 | 150 | // This query is identical to the jumpbox one |
| 151 | 151 | $sql = 'SELECT cat_id, cat_name, parent_id, left_id, right_id |
| 152 | - FROM ' . $this->categories_table . ' |
|
| 152 | + FROM ' . $this->categories_table.' |
|
| 153 | 153 | ORDER BY left_id ASC'; |
| 154 | 154 | $result = $this->db->sql_query($sql); |
| 155 | 155 | |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | $selected = (($row['cat_id'] == $select_id) ? ' selected="selected"' : ''); |
| 182 | - $cat_list .= '<option value="' . $row['cat_id'] . '"' . (($disabled) ? ' disabled="disabled" class="disabled-option"' : $selected) . '>' . $padding . $row['cat_name'] . '</option>'; |
|
| 182 | + $cat_list .= '<option value="'.$row['cat_id'].'"'.(($disabled) ? ' disabled="disabled" class="disabled-option"' : $selected).'>'.$padding.$row['cat_name'].'</option>'; |
|
| 183 | 183 | } |
| 184 | 184 | $this->db->sql_freeresult($result); |
| 185 | 185 | unset($padding_store); |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | */ |
| 195 | 195 | public function display() |
| 196 | 196 | { |
| 197 | - $cat_rows = $subcats = array(); |
|
| 197 | + $cat_rows = $subcats = array(); |
|
| 198 | 198 | $parent_id = $visible_cats = 0; |
| 199 | 199 | |
| 200 | 200 | $sql_array = array( |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | else |
| 213 | 213 | { |
| 214 | 214 | $root_data = $this->data; |
| 215 | - $sql_where = 'left_id > ' . $root_data['left_id'] . ' AND left_id < ' . $root_data['right_id']; |
|
| 215 | + $sql_where = 'left_id > '.$root_data['left_id'].' AND left_id < '.$root_data['right_id']; |
|
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | $sql = $this->db->sql_build_query('SELECT', array( |
@@ -259,12 +259,12 @@ discard block |
||
| 259 | 259 | { |
| 260 | 260 | foreach ($subcats[$dir_cat_id] as $subcat_id => $subcat_row) |
| 261 | 261 | { |
| 262 | - $row['cat_links'] = ($row['cat_count_all']) ? ($row['cat_links']+$subcat_row['links']) : $row['cat_links']; |
|
| 262 | + $row['cat_links'] = ($row['cat_count_all']) ? ($row['cat_links'] + $subcat_row['links']) : $row['cat_links']; |
|
| 263 | 263 | |
| 264 | 264 | if ($subcat_row['display'] && $subcat_row['parent_id'] == $dir_cat_id) |
| 265 | 265 | { |
| 266 | 266 | $subcats_list[] = array( |
| 267 | - 'link' => $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $subcat_id), |
|
| 267 | + 'link' => $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$subcat_id), |
|
| 268 | 268 | 'name' => $subcat_row['name'], |
| 269 | 269 | 'links' => $subcat_row['links'] |
| 270 | 270 | ); |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | 'CAT_LINKS' => $row['cat_links'], |
| 283 | 283 | 'CAT_IMG' => $this->get_img_path('icons', $row['cat_icon']), |
| 284 | 284 | |
| 285 | - 'U_CAT' => $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $row['cat_id']), |
|
| 285 | + 'U_CAT' => $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$row['cat_id']), |
|
| 286 | 286 | )); |
| 287 | 287 | |
| 288 | 288 | // Assign subcats loop for style authors |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | if ($task->is_ready()) |
| 315 | 315 | { |
| 316 | 316 | $url = $task->get_url(); |
| 317 | - $this->template->assign_var('RUN_CRON_TASK', '<img src="' . $url . '" width="1" height="1" alt="" />'); |
|
| 317 | + $this->template->assign_var('RUN_CRON_TASK', '<img src="'.$url.'" width="1" height="1" alt="" />'); |
|
| 318 | 318 | } |
| 319 | 319 | } |
| 320 | 320 | } |
@@ -336,10 +336,10 @@ discard block |
||
| 336 | 336 | 'LEFT_JOIN' => array( |
| 337 | 337 | array( |
| 338 | 338 | 'FROM' => array($this->watch_table => 'w'), |
| 339 | - 'ON' => 'c.cat_id = w.cat_id AND w.user_id = ' . (int) $this->user->data['user_id'] |
|
| 339 | + 'ON' => 'c.cat_id = w.cat_id AND w.user_id = '.(int) $this->user->data['user_id'] |
|
| 340 | 340 | ), |
| 341 | 341 | ), |
| 342 | - 'WHERE' => 'c.cat_id = ' . (int) $cat_id |
|
| 342 | + 'WHERE' => 'c.cat_id = '.(int) $cat_id |
|
| 343 | 343 | ); |
| 344 | 344 | $sql = $this->db->sql_build_query('SELECT', $sql_array); |
| 345 | 345 | $result = $this->db->sql_query($sql); |
@@ -376,8 +376,8 @@ discard block |
||
| 376 | 376 | $this->template->assign_block_vars('dir_navlinks', array( |
| 377 | 377 | 'FORUM_NAME' => $parent_data['cat_name'], |
| 378 | 378 | 'FORUM_ID' => $parent_cat_id, |
| 379 | - 'MICRODATA' => $microdata_attr . '="' . $parent_cat_id . '"', |
|
| 380 | - 'U_VIEW_FORUM' => $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $parent_cat_id), |
|
| 379 | + 'MICRODATA' => $microdata_attr.'="'.$parent_cat_id.'"', |
|
| 380 | + 'U_VIEW_FORUM' => $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$parent_cat_id), |
|
| 381 | 381 | )); |
| 382 | 382 | } |
| 383 | 383 | } |
@@ -385,8 +385,8 @@ discard block |
||
| 385 | 385 | $this->template->assign_block_vars('dir_navlinks', array( |
| 386 | 386 | 'FORUM_NAME' => $dir_cat_data['cat_name'], |
| 387 | 387 | 'FORUM_ID' => $dir_cat_data['cat_id'], |
| 388 | - 'MICRODATA' => $microdata_attr . '="' . $dir_cat_data['cat_id'] . '"', |
|
| 389 | - 'U_VIEW_FORUM' => $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $dir_cat_data['cat_id']), |
|
| 388 | + 'MICRODATA' => $microdata_attr.'="'.$dir_cat_data['cat_id'].'"', |
|
| 389 | + 'U_VIEW_FORUM' => $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$dir_cat_data['cat_id']), |
|
| 390 | 390 | )); |
| 391 | 391 | |
| 392 | 392 | return; |
@@ -439,17 +439,17 @@ discard block |
||
| 439 | 439 | { |
| 440 | 440 | if ($mode == 'unwatch') |
| 441 | 441 | { |
| 442 | - $sql = 'DELETE FROM ' . $this->watch_table . ' |
|
| 443 | - WHERE cat_id = ' . (int) $cat_id . ' |
|
| 442 | + $sql = 'DELETE FROM '.$this->watch_table.' |
|
| 443 | + WHERE cat_id = ' . (int) $cat_id.' |
|
| 444 | 444 | AND user_id = ' . (int) $user_id; |
| 445 | 445 | $this->db->sql_query($sql); |
| 446 | 446 | |
| 447 | - $redirect_url = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $cat_id); |
|
| 447 | + $redirect_url = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$cat_id); |
|
| 448 | 448 | $message = $this->language->lang('DIR_NOT_WATCHING_CAT'); |
| 449 | 449 | |
| 450 | 450 | if (!$this->request->is_ajax()) |
| 451 | 451 | { |
| 452 | - $message .= '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $redirect_url . '">', '</a>'); |
|
| 452 | + $message .= '<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$redirect_url.'">', '</a>'); |
|
| 453 | 453 | } |
| 454 | 454 | |
| 455 | 455 | meta_refresh(3, $redirect_url); |
@@ -461,9 +461,9 @@ discard block |
||
| 461 | 461 | |
| 462 | 462 | if ($notify_status != NOTIFY_YES) |
| 463 | 463 | { |
| 464 | - $sql = 'UPDATE ' . $this->watch_table . ' |
|
| 465 | - SET notify_status = ' . NOTIFY_YES . ' |
|
| 466 | - WHERE cat_id = '. (int) $cat_id . ' |
|
| 464 | + $sql = 'UPDATE '.$this->watch_table.' |
|
| 465 | + SET notify_status = ' . NOTIFY_YES.' |
|
| 466 | + WHERE cat_id = '. (int) $cat_id.' |
|
| 467 | 467 | AND user_id = ' . (int) $user_id; |
| 468 | 468 | $this->db->sql_query($sql); |
| 469 | 469 | } |
@@ -479,15 +479,15 @@ discard block |
||
| 479 | 479 | 'notify_status' => NOTIFY_YES |
| 480 | 480 | ); |
| 481 | 481 | |
| 482 | - $sql = 'INSERT INTO ' . $this->watch_table . ' ' . $this->db->sql_build_array('INSERT', $data); |
|
| 482 | + $sql = 'INSERT INTO '.$this->watch_table.' '.$this->db->sql_build_array('INSERT', $data); |
|
| 483 | 483 | $this->db->sql_query($sql); |
| 484 | 484 | |
| 485 | - $redirect_url = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $cat_id); |
|
| 485 | + $redirect_url = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$cat_id); |
|
| 486 | 486 | $message = $this->language->lang('DIR_ARE_WATCHING_CAT'); |
| 487 | 487 | |
| 488 | 488 | if (!$this->request->is_ajax()) |
| 489 | 489 | { |
| 490 | - $message .= '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $redirect_url . '">', '</a>'); |
|
| 490 | + $message .= '<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$redirect_url.'">', '</a>'); |
|
| 491 | 491 | } |
| 492 | 492 | |
| 493 | 493 | meta_refresh(3, $redirect_url); |
@@ -507,10 +507,10 @@ discard block |
||
| 507 | 507 | |
| 508 | 508 | if ($can_watch) |
| 509 | 509 | { |
| 510 | - $s_watching['link'] = $this->helper->route('ernadoo_phpbbdirectory_suscribe_controller', array('cat_id' => $cat_id, 'mode' => (($is_watching) ? 'unwatch' : 'watch'))); |
|
| 510 | + $s_watching['link'] = $this->helper->route('ernadoo_phpbbdirectory_suscribe_controller', array('cat_id' => $cat_id, 'mode' => (($is_watching) ? 'unwatch' : 'watch'))); |
|
| 511 | 511 | $s_watching['link_toggle'] = $this->helper->route('ernadoo_phpbbdirectory_suscribe_controller', array('cat_id' => $cat_id, 'mode' => ((!$is_watching) ? 'unwatch' : 'watch'))); |
| 512 | - $s_watching['title'] = $this->language->lang((($is_watching) ? 'DIR_STOP' : 'DIR_START') . '_WATCHING_CAT'); |
|
| 513 | - $s_watching['title_toggle'] = $this->language->lang(((!$is_watching) ? 'DIR_STOP' : 'DIR_START') . '_WATCHING_CAT'); |
|
| 512 | + $s_watching['title'] = $this->language->lang((($is_watching) ? 'DIR_STOP' : 'DIR_START').'_WATCHING_CAT'); |
|
| 513 | + $s_watching['title_toggle'] = $this->language->lang(((!$is_watching) ? 'DIR_STOP' : 'DIR_START').'_WATCHING_CAT'); |
|
| 514 | 514 | $s_watching['is_watching'] = $is_watching; |
| 515 | 515 | } |
| 516 | 516 | |
@@ -530,7 +530,7 @@ discard block |
||
| 530 | 530 | $categories_table = $phpbb_container->getParameter('tables.dir.categories'); |
| 531 | 531 | |
| 532 | 532 | $sql = 'SELECT cat_name |
| 533 | - FROM ' . $categories_table . ' |
|
| 533 | + FROM ' . $categories_table.' |
|
| 534 | 534 | WHERE cat_id = ' . (int) $cat_id; |
| 535 | 535 | $result = $db->sql_query($sql); |
| 536 | 536 | $row = $db->sql_fetchrow($result); |