@@ -462,6 +462,9 @@ |
||
| 462 | 462 | } |
| 463 | 463 | } |
| 464 | 464 | |
| 465 | + /** |
|
| 466 | + * @return string |
|
| 467 | + */ |
|
| 465 | 468 | protected function qte_move($attr_row, $action = 'move_up', $steps = 1) |
| 466 | 469 | { |
| 467 | 470 | global $db, $table_prefix; |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | global $phpbb_container, $db, $user, $phpbb_log, $template, $cache, $request, $table_prefix, $phpbb_root_path; |
| 28 | 28 | $this->qte = $phpbb_container->get('ernadoo.qte'); |
| 29 | 29 | |
| 30 | - $ext_root_path = $phpbb_root_path . 'ext/ernadoo/qte/'; |
|
| 30 | + $ext_root_path = $phpbb_root_path.'ext/ernadoo/qte/'; |
|
| 31 | 31 | |
| 32 | 32 | $action = $request->variable('action', ''); |
| 33 | 33 | $submit = $request->is_set_post('submit'); |
@@ -147,8 +147,8 @@ discard block |
||
| 147 | 147 | |
| 148 | 148 | if ($attr_id) |
| 149 | 149 | { |
| 150 | - $sql = 'UPDATE ' . $table_prefix . 'topics_attr |
|
| 151 | - SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' |
|
| 150 | + $sql = 'UPDATE '.$table_prefix.'topics_attr |
|
| 151 | + SET ' . $db->sql_build_array('UPDATE', $sql_ary).' |
|
| 152 | 152 | WHERE attr_id = ' . (int) $attr_id; |
| 153 | 153 | $db->sql_query($sql); |
| 154 | 154 | |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | else |
| 158 | 158 | { |
| 159 | 159 | $sql = 'SELECT MAX(right_id) AS right_id |
| 160 | - FROM ' . $table_prefix . 'topics_attr'; |
|
| 160 | + FROM ' . $table_prefix.'topics_attr'; |
|
| 161 | 161 | $result = $db->sql_query($sql); |
| 162 | 162 | $right_id = (int) $db->sql_fetchfield('right_id'); |
| 163 | 163 | $db->sql_freeresult($result); |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | $sql_ary['left_id'] = ($right_id + 1); |
| 166 | 166 | $sql_ary['right_id'] = ($right_id + 2); |
| 167 | 167 | |
| 168 | - $sql = 'INSERT INTO ' . $table_prefix . 'topics_attr ' . $db->sql_build_array('INSERT', $sql_ary); |
|
| 168 | + $sql = 'INSERT INTO '.$table_prefix.'topics_attr '.$db->sql_build_array('INSERT', $sql_ary); |
|
| 169 | 169 | $db->sql_query($sql); |
| 170 | 170 | |
| 171 | 171 | $message = 'ADDED'; |
@@ -173,9 +173,9 @@ discard block |
||
| 173 | 173 | |
| 174 | 174 | $cache->destroy('_attr'); |
| 175 | 175 | |
| 176 | - $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_ATTRIBUTE_' . $message, time(), array($attr_name)); |
|
| 176 | + $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_ATTRIBUTE_'.$message, time(), array($attr_name)); |
|
| 177 | 177 | |
| 178 | - trigger_error($user->lang['QTE_' . $message] . adm_back_link($this->u_action)); |
|
| 178 | + trigger_error($user->lang['QTE_'.$message].adm_back_link($this->u_action)); |
|
| 179 | 179 | } |
| 180 | 180 | } |
| 181 | 181 | else if ($attr_id) |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | $template->assign_vars(array( |
| 224 | 224 | 'S_EDIT' => true, |
| 225 | 225 | |
| 226 | - 'U_ACTION' => $this->u_action . '&action=' . (($action == 'add') ? 'add' : 'edit&id=' . (int) $attr_id), |
|
| 226 | + 'U_ACTION' => $this->u_action.'&action='.(($action == 'add') ? 'add' : 'edit&id='.(int) $attr_id), |
|
| 227 | 227 | 'U_BACK' => $this->u_action, |
| 228 | 228 | 'U_AJAX' => str_replace('&', '&', $this->u_action), |
| 229 | 229 | |
@@ -239,8 +239,8 @@ discard block |
||
| 239 | 239 | 'S_TEXT' => $attr_type_state ? true : false, |
| 240 | 240 | 'S_USER_COLOUR' => $attr_user_colour_state ? true : false, |
| 241 | 241 | |
| 242 | - 'ICON_ATTR_AUTH_ADD' => '<img src="' . $ext_root_path . 'adm/images/qte_auth_add.gif" alt="' . $user->lang['QTE_AUTH_ADD'] . '" title="' . $user->lang['QTE_AUTH_ADD'] . '" />', |
|
| 243 | - 'ICON_ATTR_AUTH_REMOVE' => '<img src="' . $ext_root_path . 'adm/images/qte_auth_remove.gif" alt="' . $user->lang['QTE_AUTH_REMOVE'] . '" title="' . $user->lang['QTE_AUTH_REMOVE'] . '" />', |
|
| 242 | + 'ICON_ATTR_AUTH_ADD' => '<img src="'.$ext_root_path.'adm/images/qte_auth_add.gif" alt="'.$user->lang['QTE_AUTH_ADD'].'" title="'.$user->lang['QTE_AUTH_ADD'].'" />', |
|
| 243 | + 'ICON_ATTR_AUTH_REMOVE' => '<img src="'.$ext_root_path.'adm/images/qte_auth_remove.gif" alt="'.$user->lang['QTE_AUTH_REMOVE'].'" title="'.$user->lang['QTE_AUTH_REMOVE'].'" />', |
|
| 244 | 244 | )); |
| 245 | 245 | |
| 246 | 246 | return; |
@@ -253,8 +253,8 @@ discard block |
||
| 253 | 253 | $this->add_auths($set_permissions['attr_auths']); |
| 254 | 254 | |
| 255 | 255 | $template->assign_vars(array( |
| 256 | - 'ICON_ATTR_AUTH_ADD' => '<img src="' . $ext_root_path . 'adm/images/qte_auth_add.gif" alt="' . $user->lang['QTE_AUTH_ADD'] . '" title="' . $user->lang['QTE_AUTH_ADD'] . '" />', |
|
| 257 | - 'ICON_ATTR_AUTH_REMOVE' => '<img src="' . $ext_root_path . 'adm/images/qte_auth_remove.gif" alt="' . $user->lang['QTE_AUTH_REMOVE'] . '" title="' . $user->lang['QTE_AUTH_REMOVE'] . '" />', |
|
| 256 | + 'ICON_ATTR_AUTH_ADD' => '<img src="'.$ext_root_path.'adm/images/qte_auth_add.gif" alt="'.$user->lang['QTE_AUTH_ADD'].'" title="'.$user->lang['QTE_AUTH_ADD'].'" />', |
|
| 257 | + 'ICON_ATTR_AUTH_REMOVE' => '<img src="'.$ext_root_path.'adm/images/qte_auth_remove.gif" alt="'.$user->lang['QTE_AUTH_REMOVE'].'" title="'.$user->lang['QTE_AUTH_REMOVE'].'" />', |
|
| 258 | 258 | )); |
| 259 | 259 | $this->tpl_name = 'acp_attributes_auths'; |
| 260 | 260 | |
@@ -264,13 +264,13 @@ discard block |
||
| 264 | 264 | |
| 265 | 265 | if (!$attr_id) |
| 266 | 266 | { |
| 267 | - trigger_error($user->lang['QTE_MUST_SELECT'] . adm_back_link($this->u_action), E_USER_WARNING); |
|
| 267 | + trigger_error($user->lang['QTE_MUST_SELECT'].adm_back_link($this->u_action), E_USER_WARNING); |
|
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | if (confirm_box(true)) |
| 271 | 271 | { |
| 272 | 272 | $sql = 'SELECT topic_id, topic_attr_id |
| 273 | - FROM ' . TOPICS_TABLE . ' |
|
| 273 | + FROM ' . TOPICS_TABLE.' |
|
| 274 | 274 | WHERE topic_attr_id = ' . (int) $attr_id; |
| 275 | 275 | $result = $db->sql_query($sql); |
| 276 | 276 | |
@@ -285,14 +285,14 @@ discard block |
||
| 285 | 285 | { |
| 286 | 286 | $fields = array('topic_attr_id' => 0, 'topic_attr_user' => 0, 'topic_attr_time' => 0); |
| 287 | 287 | |
| 288 | - $sql = 'UPDATE ' . TOPICS_TABLE . ' |
|
| 289 | - SET ' . $db->sql_build_array('UPDATE', $fields) . ' |
|
| 288 | + $sql = 'UPDATE '.TOPICS_TABLE.' |
|
| 289 | + SET ' . $db->sql_build_array('UPDATE', $fields).' |
|
| 290 | 290 | WHERE ' . $db->sql_in_set('topic_id', array_map('intval', $topic_id_ary)); |
| 291 | 291 | $db->sql_query($sql); |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | $sql = 'SELECT attr_name |
| 295 | - FROM ' . $table_prefix . 'topics_attr |
|
| 295 | + FROM ' . $table_prefix.'topics_attr |
|
| 296 | 296 | WHERE attr_id = ' . (int) $attr_id; |
| 297 | 297 | $result = $db->sql_query($sql); |
| 298 | 298 | $attr_name = (string) $db->sql_fetchfield('attr_name'); |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | |
| 301 | 301 | $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_ATTRIBUTE_REMOVED', time(), array($attr_name)); |
| 302 | 302 | |
| 303 | - $sql = 'DELETE FROM ' . $table_prefix . 'topics_attr |
|
| 303 | + $sql = 'DELETE FROM '.$table_prefix.'topics_attr |
|
| 304 | 304 | WHERE attr_id = ' . (int) $attr_id; |
| 305 | 305 | $db->sql_query($sql); |
| 306 | 306 | |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | } |
| 321 | 321 | else |
| 322 | 322 | { |
| 323 | - trigger_error($user->lang['QTE_REMOVED'] . adm_back_link($this->u_action)); |
|
| 323 | + trigger_error($user->lang['QTE_REMOVED'].adm_back_link($this->u_action)); |
|
| 324 | 324 | } |
| 325 | 325 | } |
| 326 | 326 | else |
@@ -340,11 +340,11 @@ discard block |
||
| 340 | 340 | |
| 341 | 341 | if (!$attr_id) |
| 342 | 342 | { |
| 343 | - trigger_error($user->lang['QTE_MUST_SELECT'] . adm_back_link($this->u_action), E_USER_WARNING); |
|
| 343 | + trigger_error($user->lang['QTE_MUST_SELECT'].adm_back_link($this->u_action), E_USER_WARNING); |
|
| 344 | 344 | } |
| 345 | 345 | |
| 346 | 346 | $sql = 'SELECT * |
| 347 | - FROM ' . $table_prefix . 'topics_attr |
|
| 347 | + FROM ' . $table_prefix.'topics_attr |
|
| 348 | 348 | WHERE attr_id = ' . (int) $attr_id; |
| 349 | 349 | $result = $db->sql_query($sql); |
| 350 | 350 | $row = $db->sql_fetchrow($result); |
@@ -352,13 +352,13 @@ discard block |
||
| 352 | 352 | |
| 353 | 353 | if (!$row) |
| 354 | 354 | { |
| 355 | - trigger_error($user->lang['QTE_MUST_SELECT'] . adm_back_link($this->u_action), E_USER_WARNING); |
|
| 355 | + trigger_error($user->lang['QTE_MUST_SELECT'].adm_back_link($this->u_action), E_USER_WARNING); |
|
| 356 | 356 | } |
| 357 | 357 | |
| 358 | 358 | $move_attr_name = $this->qte_move($row, $action, 1); |
| 359 | 359 | if ($move_attr_name !== false) |
| 360 | 360 | { |
| 361 | - $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_ATTRIBUTE_' . strtoupper($action), time(), array($move_attr_name)); |
|
| 361 | + $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_ATTRIBUTE_'.strtoupper($action), time(), array($move_attr_name)); |
|
| 362 | 362 | } |
| 363 | 363 | |
| 364 | 364 | if ($request->is_ajax()) |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | $template->assign_vars(array('U_ACTION' => $this->u_action)); |
| 374 | 374 | |
| 375 | 375 | $sql = 'SELECT topic_attr_id, COUNT(topic_id) AS total_topics |
| 376 | - FROM ' . TOPICS_TABLE . ' |
|
| 376 | + FROM ' . TOPICS_TABLE.' |
|
| 377 | 377 | GROUP BY topic_attr_id'; |
| 378 | 378 | $result = $db->sql_query($sql); |
| 379 | 379 | $stats = array(); |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | } |
| 386 | 386 | $db->sql_freeresult($result); |
| 387 | 387 | |
| 388 | - $sql = 'SELECT * FROM ' . $table_prefix . 'topics_attr ORDER BY left_id'; |
|
| 388 | + $sql = 'SELECT * FROM '.$table_prefix.'topics_attr ORDER BY left_id'; |
|
| 389 | 389 | $result = $db->sql_query($sql); |
| 390 | 390 | |
| 391 | 391 | while ($row = $db->sql_fetchrow($result)) |
@@ -409,10 +409,10 @@ discard block |
||
| 409 | 409 | 'QTE_COUNT' => (int) $attribute_count, |
| 410 | 410 | 'QTE_PER_CENT' => empty($total_topics) ? 0 : round(intval($attribute_count) * 100 / $total_topics), |
| 411 | 411 | |
| 412 | - 'U_EDIT' => $this->u_action . '&action=edit&id=' . $row['attr_id'], |
|
| 413 | - 'U_MOVE_UP' => $this->u_action . '&action=move_up&id=' . $row['attr_id'], |
|
| 414 | - 'U_MOVE_DOWN' => $this->u_action . '&action=move_down&id=' . $row['attr_id'], |
|
| 415 | - 'U_DELETE' => $this->u_action . '&action=delete&id=' . $row['attr_id'], |
|
| 412 | + 'U_EDIT' => $this->u_action.'&action=edit&id='.$row['attr_id'], |
|
| 413 | + 'U_MOVE_UP' => $this->u_action.'&action=move_up&id='.$row['attr_id'], |
|
| 414 | + 'U_MOVE_DOWN' => $this->u_action.'&action=move_down&id='.$row['attr_id'], |
|
| 415 | + 'U_DELETE' => $this->u_action.'&action=delete&id='.$row['attr_id'], |
|
| 416 | 416 | )); |
| 417 | 417 | } |
| 418 | 418 | $db->sql_freeresult($result); |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | { |
| 423 | 423 | global $db, $table_prefix; |
| 424 | 424 | |
| 425 | - $sql = 'SELECT * FROM ' . $table_prefix . 'topics_attr WHERE attr_id = ' . (int) $attr_id; |
|
| 425 | + $sql = 'SELECT * FROM '.$table_prefix.'topics_attr WHERE attr_id = '.(int) $attr_id; |
|
| 426 | 426 | $result = $db->sql_query($sql); |
| 427 | 427 | $attr = $db->sql_fetchrow($result); |
| 428 | 428 | $db->sql_freeresult($result); |
@@ -467,7 +467,7 @@ discard block |
||
| 467 | 467 | global $db, $table_prefix; |
| 468 | 468 | |
| 469 | 469 | $sql = 'SELECT attr_id, attr_name, left_id, right_id |
| 470 | - FROM ' . $table_prefix . "topics_attr |
|
| 470 | + FROM ' . $table_prefix."topics_attr |
|
| 471 | 471 | WHERE " . (($action == 'move_up') ? "right_id < {$attr_row['right_id']} ORDER BY right_id DESC" : "left_id > {$attr_row['left_id']} ORDER BY left_id ASC"); |
| 472 | 472 | $result = $db->sql_query_limit($sql, $steps); |
| 473 | 473 | |
@@ -506,7 +506,7 @@ discard block |
||
| 506 | 506 | $move_up_right = $target['right_id']; |
| 507 | 507 | } |
| 508 | 508 | |
| 509 | - $sql = 'UPDATE ' . $table_prefix . "topics_attr |
|
| 509 | + $sql = 'UPDATE '.$table_prefix."topics_attr |
|
| 510 | 510 | SET left_id = left_id + CASE |
| 511 | 511 | WHEN left_id BETWEEN {$move_up_left} AND {$move_up_right} THEN -{$diff_up} |
| 512 | 512 | ELSE {$diff_down} |
@@ -530,7 +530,7 @@ discard block |
||
| 530 | 530 | $s_forum_id_options = ''; |
| 531 | 531 | |
| 532 | 532 | $sql = 'SELECT forum_id, forum_name, parent_id, forum_type, left_id, right_id |
| 533 | - FROM ' . FORUMS_TABLE . ' |
|
| 533 | + FROM ' . FORUMS_TABLE.' |
|
| 534 | 534 | ORDER BY left_id ASC'; |
| 535 | 535 | $result = $db->sql_query($sql, 600); |
| 536 | 536 | |
@@ -569,11 +569,11 @@ discard block |
||
| 569 | 569 | { |
| 570 | 570 | $cat_right = max($cat_right, $row['right_id']); |
| 571 | 571 | |
| 572 | - $holding .= '<option value="' . $row['forum_id'] . '"' . (($row['forum_type'] == FORUM_POST) ? ' class="sep"' : ' disabled="disabled"') . $selected . '>' . $padding . $row['forum_name'] . '</option>'; |
|
| 572 | + $holding .= '<option value="'.$row['forum_id'].'"'.(($row['forum_type'] == FORUM_POST) ? ' class="sep"' : ' disabled="disabled"').$selected.'>'.$padding.$row['forum_name'].'</option>'; |
|
| 573 | 573 | } |
| 574 | 574 | else |
| 575 | 575 | { |
| 576 | - $s_forum_id_options .= $holding . '<option value="' . $row['forum_id'] . '"' . (($row['forum_type'] == FORUM_POST) ? ' class="sep"' : ' disabled="disabled"') . $selected . '>' . $padding . $row['forum_name'] . '</option>'; |
|
| 576 | + $s_forum_id_options .= $holding.'<option value="'.$row['forum_id'].'"'.(($row['forum_type'] == FORUM_POST) ? ' class="sep"' : ' disabled="disabled"').$selected.'>'.$padding.$row['forum_name'].'</option>'; |
|
| 577 | 577 | $holding = ''; |
| 578 | 578 | } |
| 579 | 579 | } |
@@ -629,7 +629,7 @@ discard block |
||
| 629 | 629 | $template->assign_vars(array( |
| 630 | 630 | 'S_VERSION_UNSTABLE' => true, |
| 631 | 631 | 'S_VERSION_DEV' => true, |
| 632 | - 'VERSION_WARNING' => $user->lang('QTE_DEV_WARNING', $version) . '<br />' . $user->lang['QTE_DEV_WARNING_DEV'], |
|
| 632 | + 'VERSION_WARNING' => $user->lang('QTE_DEV_WARNING', $version).'<br />'.$user->lang['QTE_DEV_WARNING_DEV'], |
|
| 633 | 633 | )); |
| 634 | 634 | } |
| 635 | 635 | else if (stripos($version, '-a') !== false) |
@@ -74,8 +74,8 @@ discard block |
||
| 74 | 74 | |
| 75 | 75 | public function delete_user($event) |
| 76 | 76 | { |
| 77 | - $sql = 'UPDATE ' . TOPICS_TABLE . ' |
|
| 78 | - SET topic_attr_user = ' . ANONYMOUS . ' |
|
| 77 | + $sql = 'UPDATE '.TOPICS_TABLE.' |
|
| 78 | + SET topic_attr_user = ' . ANONYMOUS.' |
|
| 79 | 79 | WHERE topic_attr_user = ' . (int) $event['user_ids']; |
| 80 | 80 | $this->db->sql_query($sql); |
| 81 | 81 | } |
@@ -193,8 +193,8 @@ discard block |
||
| 193 | 193 | $attr['attr_auths'][0]['forums_ids'][] = $event['forum_data']['forum_id']; |
| 194 | 194 | $sql_ary = array('attr_auths' => json_encode($attr['attr_auths'])); |
| 195 | 195 | |
| 196 | - $sql = 'UPDATE ' . $this->table_prefix . 'topics_attr |
|
| 197 | - SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' |
|
| 196 | + $sql = 'UPDATE '.$this->table_prefix.'topics_attr |
|
| 197 | + SET ' . $this->db->sql_build_array('UPDATE', $sql_ary).' |
|
| 198 | 198 | WHERE attr_id = ' . (int) $attr['attr_id']; |
| 199 | 199 | $this->db->sql_query($sql); |
| 200 | 200 | } |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | { |
| 36 | 36 | return array( |
| 37 | 37 | 'update_columns' => array( |
| 38 | - $this->table_prefix . 'topics_attr' => array( |
|
| 38 | + $this->table_prefix.'topics_attr' => array( |
|
| 39 | 39 | array('attr_desc', array('VCHAR:60', '')), |
| 40 | 40 | ), |
| 41 | 41 | ), |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | { |
| 47 | 47 | return array( |
| 48 | 48 | 'update_columns' => array( |
| 49 | - $this->table_prefix . 'topics_attr' => array( |
|
| 49 | + $this->table_prefix.'topics_attr' => array( |
|
| 50 | 50 | array('attr_desc', array('VCHAR', '')), |
| 51 | 51 | ), |
| 52 | 52 | ), |
@@ -35,13 +35,13 @@ discard block |
||
| 35 | 35 | { |
| 36 | 36 | return array( |
| 37 | 37 | 'drop_columns' => array( |
| 38 | - $this->table_prefix . 'topics_attr' => array( |
|
| 38 | + $this->table_prefix.'topics_attr' => array( |
|
| 39 | 39 | 'allowed_forums', |
| 40 | 40 | 'allowed_groups', |
| 41 | 41 | ), |
| 42 | 42 | ), |
| 43 | 43 | 'add_columns' => array( |
| 44 | - $this->table_prefix . 'topics_attr' => array( |
|
| 44 | + $this->table_prefix.'topics_attr' => array( |
|
| 45 | 45 | 'attr_desc' => array('VCHAR', ''), |
| 46 | 46 | 'attr_auths' => array('MTEXT', ''), |
| 47 | 47 | ), |
@@ -53,13 +53,13 @@ discard block |
||
| 53 | 53 | { |
| 54 | 54 | return array( |
| 55 | 55 | 'add_columns' => array( |
| 56 | - $this->table_prefix . 'topics_attr' => array( |
|
| 56 | + $this->table_prefix.'topics_attr' => array( |
|
| 57 | 57 | 'allowed_forums' => array('TEXT', ''), |
| 58 | 58 | 'allowed_groups' => array('TEXT', ''), |
| 59 | 59 | ), |
| 60 | 60 | ), |
| 61 | 61 | 'drop_columns' => array( |
| 62 | - $this->table_prefix . 'topics_attr' => array( |
|
| 62 | + $this->table_prefix.'topics_attr' => array( |
|
| 63 | 63 | 'attr_desc', |
| 64 | 64 | 'attr_auths', |
| 65 | 65 | ), |
@@ -680,7 +680,7 @@ discard block |
||
| 680 | 680 | * Generate list of groups |
| 681 | 681 | * |
| 682 | 682 | * @param int $group_ids The default groups id to mark as selected |
| 683 | - * @param array $exclude_ids The group ids to exclude from the list, false (default) if you whish to exclude no id |
|
| 683 | + * @param boolean $exclude_ids The group ids to exclude from the list, false (default) if you whish to exclude no id |
|
| 684 | 684 | * @param int $manage_founder If set to false (default) all groups are returned, if 0 only those groups returned not being managed by founders only, if 1 only those groups returned managed by founders only. |
| 685 | 685 | * |
| 686 | 686 | * @return string The list of options. |
@@ -753,7 +753,7 @@ discard block |
||
| 753 | 753 | * @param int $forum_id Forum id |
| 754 | 754 | * @param array $user_groups User's groups |
| 755 | 755 | * @param int $author_id Topic author id |
| 756 | - * @return bool |
|
| 756 | + * @return boolean|null |
|
| 757 | 757 | */ |
| 758 | 758 | private function _check_auth_attribute($attr_auth, $forum_id, $user_groups, $author_id) |
| 759 | 759 | { |
@@ -774,7 +774,7 @@ discard block |
||
| 774 | 774 | * |
| 775 | 775 | * @param array $user_groups User's groups |
| 776 | 776 | * @param array $hide_attr Groups which can't delete attribute in a forum |
| 777 | - * @return bool |
|
| 777 | + * @return boolean|null |
|
| 778 | 778 | */ |
| 779 | 779 | private function _check_auth_remove_attr(&$user_groups, $hide_attr) |
| 780 | 780 | { |
@@ -54,19 +54,19 @@ discard block |
||
| 54 | 54 | private $_name = array(); |
| 55 | 55 | |
| 56 | 56 | /** |
| 57 | - * Constructor |
|
| 58 | - * |
|
| 59 | - * @param \phpbb\request\request $request Request object |
|
| 60 | - * @param \phpbb\cache\driver\driver_interface $cache Cache object |
|
| 61 | - * @param \phpbb\config\config $config Config object |
|
| 62 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 63 | - * @param \phpbb\template\template $template Template object |
|
| 64 | - * @param \phpbb\user $user User object |
|
| 65 | - * @param \phpbb\log\log $log Log object |
|
| 66 | - * @param string $root_path phpBB root path |
|
| 67 | - * @param string $php_ext phpEx |
|
| 68 | - * @param string $table_prefix Prefix tables |
|
| 69 | - */ |
|
| 57 | + * Constructor |
|
| 58 | + * |
|
| 59 | + * @param \phpbb\request\request $request Request object |
|
| 60 | + * @param \phpbb\cache\driver\driver_interface $cache Cache object |
|
| 61 | + * @param \phpbb\config\config $config Config object |
|
| 62 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 63 | + * @param \phpbb\template\template $template Template object |
|
| 64 | + * @param \phpbb\user $user User object |
|
| 65 | + * @param \phpbb\log\log $log Log object |
|
| 66 | + * @param string $root_path phpBB root path |
|
| 67 | + * @param string $php_ext phpEx |
|
| 68 | + * @param string $table_prefix Prefix tables |
|
| 69 | + */ |
|
| 70 | 70 | public function __construct(\phpbb\request\request $request, \phpbb\cache\driver\driver_interface $cache, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\template\template $template, \phpbb\user $user, \phpbb\log\log $log, $root_path, $php_ext, $table_prefix) |
| 71 | 71 | { |
| 72 | 72 | $this->request = $request; |
@@ -85,12 +85,12 @@ discard block |
||
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | /** |
| 88 | - * Get topic attributes username |
|
| 89 | - * |
|
| 90 | - * @param array $topic_list Topic ids |
|
| 91 | - * |
|
| 92 | - * @return null |
|
| 93 | - */ |
|
| 88 | + * Get topic attributes username |
|
| 89 | + * |
|
| 90 | + * @param array $topic_list Topic ids |
|
| 91 | + * |
|
| 92 | + * @return null |
|
| 93 | + */ |
|
| 94 | 94 | public function get_users_by_topic_id($topic_list) |
| 95 | 95 | { |
| 96 | 96 | if (!empty($topic_list)) |
@@ -115,24 +115,24 @@ discard block |
||
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | /** |
| 118 | - * Get attribute name |
|
| 119 | - * |
|
| 120 | - * @param int $attr_id The attribute id |
|
| 121 | - * |
|
| 122 | - * @return string |
|
| 123 | - */ |
|
| 118 | + * Get attribute name |
|
| 119 | + * |
|
| 120 | + * @param int $attr_id The attribute id |
|
| 121 | + * |
|
| 122 | + * @return string |
|
| 123 | + */ |
|
| 124 | 124 | public function get_attr_name_by_id($attr_id) |
| 125 | 125 | { |
| 126 | 126 | return $this->_attr[$attr_id]['attr_name']; |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | /** |
| 130 | - * Get attribute author |
|
| 131 | - * |
|
| 132 | - * @param int $user_id User id |
|
| 133 | - * |
|
| 134 | - * @return string |
|
| 135 | - */ |
|
| 130 | + * Get attribute author |
|
| 131 | + * |
|
| 132 | + * @param int $user_id User id |
|
| 133 | + * |
|
| 134 | + * @return string |
|
| 135 | + */ |
|
| 136 | 136 | public function get_users_by_user_id($user_id) |
| 137 | 137 | { |
| 138 | 138 | $sql = 'SELECT user_id, username, user_colour |
@@ -153,16 +153,16 @@ discard block |
||
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | /** |
| 156 | - * Generate a list of attributes based on permissions |
|
| 157 | - * |
|
| 158 | - * @param int $forum_id Forum id |
|
| 159 | - * @param int $author_id Topic author id |
|
| 160 | - * @param int $attribute_id Current attribute id |
|
| 161 | - * @param array $hide_attr Groups which can't delete attribute in this forum |
|
| 162 | - * @param string $viewtopic_url Topic's url |
|
| 163 | - * |
|
| 164 | - * @return null |
|
| 165 | - */ |
|
| 156 | + * Generate a list of attributes based on permissions |
|
| 157 | + * |
|
| 158 | + * @param int $forum_id Forum id |
|
| 159 | + * @param int $author_id Topic author id |
|
| 160 | + * @param int $attribute_id Current attribute id |
|
| 161 | + * @param array $hide_attr Groups which can't delete attribute in this forum |
|
| 162 | + * @param string $viewtopic_url Topic's url |
|
| 163 | + * |
|
| 164 | + * @return null |
|
| 165 | + */ |
|
| 166 | 166 | public function attr_select($forum_id = 0, $author_id = 0, $attribute_id = 0, $hide_attr = array(), $viewtopic_url = '') |
| 167 | 167 | { |
| 168 | 168 | // load language |
@@ -233,10 +233,10 @@ discard block |
||
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | /** |
| 236 | - * Generate a list of all attributes for search page |
|
| 237 | - * |
|
| 238 | - * @return null |
|
| 239 | - */ |
|
| 236 | + * Generate a list of all attributes for search page |
|
| 237 | + * |
|
| 238 | + * @return null |
|
| 239 | + */ |
|
| 240 | 240 | public function attr_search() |
| 241 | 241 | { |
| 242 | 242 | // load language |
@@ -286,13 +286,13 @@ discard block |
||
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | /** |
| 289 | - * Generate a list of attributes for viewforum page |
|
| 290 | - * |
|
| 291 | - * @param int $forum_id Forum id |
|
| 292 | - * @param int $attribute_id Current attribute id |
|
| 293 | - * |
|
| 294 | - * @return null |
|
| 295 | - */ |
|
| 289 | + * Generate a list of attributes for viewforum page |
|
| 290 | + * |
|
| 291 | + * @param int $forum_id Forum id |
|
| 292 | + * @param int $attribute_id Current attribute id |
|
| 293 | + * |
|
| 294 | + * @return null |
|
| 295 | + */ |
|
| 296 | 296 | public function attr_sort($forum_id = 0, $attribute_id = 0) |
| 297 | 297 | { |
| 298 | 298 | // load language |
@@ -349,13 +349,13 @@ discard block |
||
| 349 | 349 | } |
| 350 | 350 | |
| 351 | 351 | /** |
| 352 | - * Generate a default attribute list for a forum |
|
| 353 | - * |
|
| 354 | - * @param int $forum_id Forum id |
|
| 355 | - * @param int $attribute_id Current attribute id |
|
| 356 | - * |
|
| 357 | - * @return null |
|
| 358 | - */ |
|
| 352 | + * Generate a default attribute list for a forum |
|
| 353 | + * |
|
| 354 | + * @param int $forum_id Forum id |
|
| 355 | + * @param int $attribute_id Current attribute id |
|
| 356 | + * |
|
| 357 | + * @return null |
|
| 358 | + */ |
|
| 359 | 359 | public function attr_default($forum_id = 0, $attribute_id = 0) |
| 360 | 360 | { |
| 361 | 361 | // load language |
@@ -412,14 +412,14 @@ discard block |
||
| 412 | 412 | } |
| 413 | 413 | |
| 414 | 414 | /** |
| 415 | - * Generate attribute for topic title |
|
| 416 | - * |
|
| 417 | - * @param int $attribute_id Current attribute id |
|
| 418 | - * @param int $user_id Current attribute user id |
|
| 419 | - * @param int $timestamp Attribute timestamp |
|
| 420 | - * |
|
| 421 | - * @return string Attribute html code |
|
| 422 | - */ |
|
| 415 | + * Generate attribute for topic title |
|
| 416 | + * |
|
| 417 | + * @param int $attribute_id Current attribute id |
|
| 418 | + * @param int $user_id Current attribute user id |
|
| 419 | + * @param int $timestamp Attribute timestamp |
|
| 420 | + * |
|
| 421 | + * @return string Attribute html code |
|
| 422 | + */ |
|
| 423 | 423 | public function attr_display($attribute_id = 0, $user_id = 0, $timestamp = 0) |
| 424 | 424 | { |
| 425 | 425 | if (empty($attribute_id) || empty($user_id) || empty($timestamp)) |
@@ -449,14 +449,14 @@ discard block |
||
| 449 | 449 | } |
| 450 | 450 | |
| 451 | 451 | /** |
| 452 | - * Generate attribute for page title |
|
| 453 | - * |
|
| 454 | - * @param int $attribute_id Current attribute id |
|
| 455 | - * @param int $user_id Current attribute user id |
|
| 456 | - * @param int $timestamp Attribute timestamp |
|
| 457 | - * |
|
| 458 | - * @return string attribute html code |
|
| 459 | - */ |
|
| 452 | + * Generate attribute for page title |
|
| 453 | + * |
|
| 454 | + * @param int $attribute_id Current attribute id |
|
| 455 | + * @param int $user_id Current attribute user id |
|
| 456 | + * @param int $timestamp Attribute timestamp |
|
| 457 | + * |
|
| 458 | + * @return string attribute html code |
|
| 459 | + */ |
|
| 460 | 460 | public function attr_title($attribute_id = 0, $user_id = 0, $timestamp = 0) |
| 461 | 461 | { |
| 462 | 462 | if (empty($attribute_id) || empty($user_id) || empty($timestamp)) |
@@ -485,16 +485,16 @@ discard block |
||
| 485 | 485 | |
| 486 | 486 | |
| 487 | 487 | /** |
| 488 | - * Change topic attribute |
|
| 489 | - * |
|
| 490 | - * @param int $attribute_id New attribute id |
|
| 491 | - * @param int $topic_id The id of the topic |
|
| 492 | - * @param int $forum_id The id of the forum |
|
| 493 | - * @param int $topic_attribute Current attribute id |
|
| 494 | - * @param array $hide_attr Groups which can't delete attribute in this forum |
|
| 495 | - * |
|
| 496 | - * @return null |
|
| 497 | - */ |
|
| 488 | + * Change topic attribute |
|
| 489 | + * |
|
| 490 | + * @param int $attribute_id New attribute id |
|
| 491 | + * @param int $topic_id The id of the topic |
|
| 492 | + * @param int $forum_id The id of the forum |
|
| 493 | + * @param int $topic_attribute Current attribute id |
|
| 494 | + * @param array $hide_attr Groups which can't delete attribute in this forum |
|
| 495 | + * |
|
| 496 | + * @return null |
|
| 497 | + */ |
|
| 498 | 498 | public function attr_apply($attribute_id = 0, $topic_id = 0, $forum_id = 0, $topic_attribute = '', $hide_attr = array()) |
| 499 | 499 | { |
| 500 | 500 | if (empty($topic_id) || empty($forum_id) || empty($attribute_id)) |
@@ -573,13 +573,13 @@ discard block |
||
| 573 | 573 | } |
| 574 | 574 | |
| 575 | 575 | /** |
| 576 | - * Change topic attribute in mcp |
|
| 577 | - * |
|
| 578 | - * @param int $attribute_id New attribute id |
|
| 579 | - * @param array $topic_ids Topics ids |
|
| 580 | - * |
|
| 581 | - * @return null |
|
| 582 | - */ |
|
| 576 | + * Change topic attribute in mcp |
|
| 577 | + * |
|
| 578 | + * @param int $attribute_id New attribute id |
|
| 579 | + * @param array $topic_ids Topics ids |
|
| 580 | + * |
|
| 581 | + * @return null |
|
| 582 | + */ |
|
| 583 | 583 | public function mcp_attr_apply($attribute_id = 0, $topic_ids = array()) |
| 584 | 584 | { |
| 585 | 585 | // load language |
@@ -667,24 +667,24 @@ discard block |
||
| 667 | 667 | } |
| 668 | 668 | |
| 669 | 669 | /** |
| 670 | - * Getter... |
|
| 671 | - * |
|
| 672 | - * @return array |
|
| 673 | - */ |
|
| 670 | + * Getter... |
|
| 671 | + * |
|
| 672 | + * @return array |
|
| 673 | + */ |
|
| 674 | 674 | public function getAttr() |
| 675 | 675 | { |
| 676 | 676 | return $this->_attr; |
| 677 | 677 | } |
| 678 | 678 | |
| 679 | 679 | /** |
| 680 | - * Generate list of groups |
|
| 681 | - * |
|
| 682 | - * @param int $group_ids The default groups id to mark as selected |
|
| 683 | - * @param array $exclude_ids The group ids to exclude from the list, false (default) if you whish to exclude no id |
|
| 684 | - * @param int $manage_founder If set to false (default) all groups are returned, if 0 only those groups returned not being managed by founders only, if 1 only those groups returned managed by founders only. |
|
| 685 | - * |
|
| 686 | - * @return string The list of options. |
|
| 687 | - */ |
|
| 680 | + * Generate list of groups |
|
| 681 | + * |
|
| 682 | + * @param int $group_ids The default groups id to mark as selected |
|
| 683 | + * @param array $exclude_ids The group ids to exclude from the list, false (default) if you whish to exclude no id |
|
| 684 | + * @param int $manage_founder If set to false (default) all groups are returned, if 0 only those groups returned not being managed by founders only, if 1 only those groups returned managed by founders only. |
|
| 685 | + * |
|
| 686 | + * @return string The list of options. |
|
| 687 | + */ |
|
| 688 | 688 | public function qte_group_select($group_ids, $exclude_ids = array(), $manage_founder = false) |
| 689 | 689 | { |
| 690 | 690 | $exclude_sql = ($exclude_ids !== false && sizeof($exclude_ids)) ? 'WHERE ' . $this->db->sql_in_set('group_id', array_map('intval', $exclude_ids), true) : ''; |
@@ -711,9 +711,9 @@ discard block |
||
| 711 | 711 | } |
| 712 | 712 | |
| 713 | 713 | /** |
| 714 | - * borrowed from "Categories Hierarchy" : used to check if a language key exists |
|
| 715 | - * @todo delete |
|
| 716 | - */ |
|
| 714 | + * borrowed from "Categories Hierarchy" : used to check if a language key exists |
|
| 715 | + * @todo delete |
|
| 716 | + */ |
|
| 717 | 717 | public function attr_lng_key($key) |
| 718 | 718 | { |
| 719 | 719 | // load language |
@@ -729,12 +729,12 @@ discard block |
||
| 729 | 729 | } |
| 730 | 730 | |
| 731 | 731 | /** |
| 732 | - * Build class and style attribute |
|
| 733 | - * |
|
| 734 | - * @param string $a_name Attribute name |
|
| 735 | - * @param string $a_colour Attribute color |
|
| 736 | - * @return string html code |
|
| 737 | - */ |
|
| 732 | + * Build class and style attribute |
|
| 733 | + * |
|
| 734 | + * @param string $a_name Attribute name |
|
| 735 | + * @param string $a_colour Attribute color |
|
| 736 | + * @return string html code |
|
| 737 | + */ |
|
| 738 | 738 | public function attr_colour($a_name, $a_colour) |
| 739 | 739 | { |
| 740 | 740 | $a_name = preg_replace("#[^a-z0-9 _-]#", '', strtolower($a_name)); |
@@ -747,14 +747,14 @@ discard block |
||
| 747 | 747 | } |
| 748 | 748 | |
| 749 | 749 | /** |
| 750 | - * Check if user can apply an attribute |
|
| 751 | - * |
|
| 752 | - * @param array $attr_auth Forum auth |
|
| 753 | - * @param int $forum_id Forum id |
|
| 754 | - * @param array $user_groups User's groups |
|
| 755 | - * @param int $author_id Topic author id |
|
| 756 | - * @return bool |
|
| 757 | - */ |
|
| 750 | + * Check if user can apply an attribute |
|
| 751 | + * |
|
| 752 | + * @param array $attr_auth Forum auth |
|
| 753 | + * @param int $forum_id Forum id |
|
| 754 | + * @param array $user_groups User's groups |
|
| 755 | + * @param int $author_id Topic author id |
|
| 756 | + * @return bool |
|
| 757 | + */ |
|
| 758 | 758 | private function _check_auth_attribute($attr_auth, $forum_id, $user_groups, $author_id) |
| 759 | 759 | { |
| 760 | 760 | $forum_ids = $attr_auth['forums_ids']; |
@@ -770,12 +770,12 @@ discard block |
||
| 770 | 770 | } |
| 771 | 771 | |
| 772 | 772 | /** |
| 773 | - * Check if user can delete an attribute |
|
| 774 | - * |
|
| 775 | - * @param array $user_groups User's groups |
|
| 776 | - * @param array $hide_attr Groups which can't delete attribute in a forum |
|
| 777 | - * @return bool |
|
| 778 | - */ |
|
| 773 | + * Check if user can delete an attribute |
|
| 774 | + * |
|
| 775 | + * @param array $user_groups User's groups |
|
| 776 | + * @param array $hide_attr Groups which can't delete attribute in a forum |
|
| 777 | + * @return bool |
|
| 778 | + */ |
|
| 779 | 779 | private function _check_auth_remove_attr(&$user_groups, $hide_attr) |
| 780 | 780 | { |
| 781 | 781 | // include that file ! |
@@ -804,10 +804,10 @@ discard block |
||
| 804 | 804 | } |
| 805 | 805 | |
| 806 | 806 | /** |
| 807 | - * Get attributes from database |
|
| 808 | - * |
|
| 809 | - * @return null |
|
| 810 | - */ |
|
| 807 | + * Get attributes from database |
|
| 808 | + * |
|
| 809 | + * @return null |
|
| 810 | + */ |
|
| 811 | 811 | private function _get_attributes() |
| 812 | 812 | { |
| 813 | 813 | if (($this->_attr = $this->cache->get('_attr')) === false) |
@@ -69,16 +69,16 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | public function __construct(\phpbb\request\request $request, \phpbb\cache\driver\driver_interface $cache, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\template\template $template, \phpbb\user $user, \phpbb\log\log $log, $root_path, $php_ext, $table_prefix) |
| 71 | 71 | { |
| 72 | - $this->request = $request; |
|
| 73 | - $this->cache = $cache; |
|
| 74 | - $this->config = $config; |
|
| 75 | - $this->db = $db; |
|
| 76 | - $this->template = $template; |
|
| 77 | - $this->user = $user; |
|
| 78 | - $this->log = $log; |
|
| 79 | - |
|
| 80 | - $this->root_path = $root_path; |
|
| 81 | - $this->php_ext = $php_ext; |
|
| 72 | + $this->request = $request; |
|
| 73 | + $this->cache = $cache; |
|
| 74 | + $this->config = $config; |
|
| 75 | + $this->db = $db; |
|
| 76 | + $this->template = $template; |
|
| 77 | + $this->user = $user; |
|
| 78 | + $this->log = $log; |
|
| 79 | + |
|
| 80 | + $this->root_path = $root_path; |
|
| 81 | + $this->php_ext = $php_ext; |
|
| 82 | 82 | $this->table_prefix = $table_prefix; |
| 83 | 83 | |
| 84 | 84 | $this->_get_attributes(); |
@@ -96,9 +96,9 @@ discard block |
||
| 96 | 96 | if (!empty($topic_list)) |
| 97 | 97 | { |
| 98 | 98 | $sql = 'SELECT u.user_id, u.username, u.user_colour |
| 99 | - FROM ' . USERS_TABLE . ' u |
|
| 100 | - LEFT JOIN ' . TOPICS_TABLE . ' t ON (u.user_id = t.topic_attr_user) |
|
| 101 | - WHERE ' . $this->db->sql_in_set('t.topic_id', array_map('intval', $topic_list)) . ' |
|
| 99 | + FROM ' . USERS_TABLE.' u |
|
| 100 | + LEFT JOIN ' . TOPICS_TABLE.' t ON (u.user_id = t.topic_attr_user) |
|
| 101 | + WHERE ' . $this->db->sql_in_set('t.topic_id', array_map('intval', $topic_list)).' |
|
| 102 | 102 | AND t.topic_attr_user <> ' . ANONYMOUS; |
| 103 | 103 | $result = $this->db->sql_query($sql); |
| 104 | 104 | |
@@ -136,12 +136,12 @@ discard block |
||
| 136 | 136 | public function get_users_by_user_id($user_id) |
| 137 | 137 | { |
| 138 | 138 | $sql = 'SELECT user_id, username, user_colour |
| 139 | - FROM ' . USERS_TABLE . ' |
|
| 139 | + FROM ' . USERS_TABLE.' |
|
| 140 | 140 | WHERE user_id = ' . (int) $user_id; |
| 141 | 141 | $result = $this->db->sql_query($sql); |
| 142 | 142 | |
| 143 | 143 | $this->name = array(); |
| 144 | - while ( $row = $this->db->sql_fetchrow($result) ) |
|
| 144 | + while ($row = $this->db->sql_fetchrow($result)) |
|
| 145 | 145 | { |
| 146 | 146 | $this->name[$row['user_id']] = array( |
| 147 | 147 | 'user_id' => (int) $row['user_id'], |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | 'S_QTE_EMPTY' => (empty($attribute_id) || ($attribute_id == -1) || ($attribute_id == -2)), |
| 227 | 227 | 'S_QTE_SELECTED' => ($show_remove && ($attribute_id == -1)), |
| 228 | 228 | |
| 229 | - 'L_QTE_SELECT' => $this->user->lang['QTE_ATTRIBUTE_' . (!empty($attribute_id) ? ($show_remove ? 'REMOVE' : 'RESTRICT') : 'ADD')], |
|
| 229 | + 'L_QTE_SELECT' => $this->user->lang['QTE_ATTRIBUTE_'.(!empty($attribute_id) ? ($show_remove ? 'REMOVE' : 'RESTRICT') : 'ADD')], |
|
| 230 | 230 | 'U_QTE_URL' => !empty($viewtopic_url) ? append_sid($viewtopic_url, array('attr_id' => -1)) : false, |
| 231 | 231 | )); |
| 232 | 232 | } |
@@ -444,7 +444,7 @@ discard block |
||
| 444 | 444 | |
| 445 | 445 | $attribute_name = str_replace(array('%mod%', '%date%'), array($attribute_username, $attribute_date), $this->attr_lng_key($this->_attr[$attribute_id]['attr_name'])); |
| 446 | 446 | |
| 447 | - return !$this->_attr[$attribute_id]['attr_type'] ? '<span' . $attribute_colour . '>' . $attribute_name . '</span>' : $this->attr_img_key($this->_attr[$attribute_id]['attr_img'], $attribute_name); |
|
| 447 | + return !$this->_attr[$attribute_id]['attr_type'] ? '<span'.$attribute_colour.'>'.$attribute_name.'</span>' : $this->attr_img_key($this->_attr[$attribute_id]['attr_img'], $attribute_name); |
|
| 448 | 448 | } |
| 449 | 449 | } |
| 450 | 450 | |
@@ -527,13 +527,13 @@ discard block |
||
| 527 | 527 | ); |
| 528 | 528 | } |
| 529 | 529 | |
| 530 | - $sql = 'UPDATE ' . TOPICS_TABLE . ' |
|
| 531 | - SET ' . $this->db->sql_build_array('UPDATE', $fields) . ' |
|
| 530 | + $sql = 'UPDATE '.TOPICS_TABLE.' |
|
| 531 | + SET ' . $this->db->sql_build_array('UPDATE', $fields).' |
|
| 532 | 532 | WHERE topic_id = ' . (int) $topic_id; |
| 533 | 533 | $this->db->sql_query($sql); |
| 534 | 534 | |
| 535 | 535 | $sql = 'SELECT topic_id |
| 536 | - FROM ' . TOPICS_TABLE . ' |
|
| 536 | + FROM ' . TOPICS_TABLE.' |
|
| 537 | 537 | WHERE topic_moved_id = ' . (int) $topic_id; |
| 538 | 538 | $result = $this->db->sql_query($sql); |
| 539 | 539 | $shadow_topic_id = (int) $this->db->sql_fetchfield('topic_id'); |
@@ -541,8 +541,8 @@ discard block |
||
| 541 | 541 | |
| 542 | 542 | if (!empty($shadow_topic_id)) |
| 543 | 543 | { |
| 544 | - $sql = 'UPDATE ' . TOPICS_TABLE . ' |
|
| 545 | - SET ' . $this->db->sql_build_array('UPDATE', $fields) . ' |
|
| 544 | + $sql = 'UPDATE '.TOPICS_TABLE.' |
|
| 545 | + SET ' . $this->db->sql_build_array('UPDATE', $fields).' |
|
| 546 | 546 | WHERE topic_id = ' . $shadow_topic_id; |
| 547 | 547 | $this->db->sql_query($sql); |
| 548 | 548 | } |
@@ -554,8 +554,8 @@ discard block |
||
| 554 | 554 | $this->user->add_lang('posting'); |
| 555 | 555 | $this->user->add_lang_ext('ernadoo/qte', 'attributes'); |
| 556 | 556 | |
| 557 | - $message = $this->user->lang['QTE_ATTRIBUTE_' . ($attribute_id == -1 ? 'REMOVED' : (empty($topic_attribute) ? 'ADDED' : 'UPDATED'))] . '<br /><br />' . sprintf($this->user->lang['VIEW_MESSAGE'], '<a href="' . $meta_url . '">', '</a>'); |
|
| 558 | - $message .= '<br /><br />' . sprintf($this->user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$this->root_path}viewforum.$this->php_ext", 'f=' . $forum_id) . '">', '</a>'); |
|
| 557 | + $message = $this->user->lang['QTE_ATTRIBUTE_'.($attribute_id == -1 ? 'REMOVED' : (empty($topic_attribute) ? 'ADDED' : 'UPDATED'))].'<br /><br />'.sprintf($this->user->lang['VIEW_MESSAGE'], '<a href="'.$meta_url.'">', '</a>'); |
|
| 558 | + $message .= '<br /><br />'.sprintf($this->user->lang['RETURN_FORUM'], '<a href="'.append_sid("{$this->root_path}viewforum.$this->php_ext", 'f='.$forum_id).'">', '</a>'); |
|
| 559 | 559 | |
| 560 | 560 | if ($this->request->is_ajax()) |
| 561 | 561 | { |
@@ -599,7 +599,7 @@ discard block |
||
| 599 | 599 | $current_time = time(); |
| 600 | 600 | |
| 601 | 601 | $sql = 'SELECT topic_id, forum_id, topic_title, topic_attr_id |
| 602 | - FROM ' . TOPICS_TABLE . ' |
|
| 602 | + FROM ' . TOPICS_TABLE.' |
|
| 603 | 603 | WHERE ' . $this->db->sql_in_set('topic_id', array_map('intval', $topic_ids)); |
| 604 | 604 | $result = $this->db->sql_query($sql); |
| 605 | 605 | |
@@ -612,7 +612,7 @@ discard block |
||
| 612 | 612 | 'topic_id' => $row['topic_id'], |
| 613 | 613 | $row['topic_title'], |
| 614 | 614 | ); |
| 615 | - $this->log->add('mod', $this->user->data['user_id'], $this->user->ip, 'MCP_ATTRIBUTE_' . $message, $current_time, $additional_data); |
|
| 615 | + $this->log->add('mod', $this->user->data['user_id'], $this->user->ip, 'MCP_ATTRIBUTE_'.$message, $current_time, $additional_data); |
|
| 616 | 616 | } |
| 617 | 617 | $this->db->sql_freeresult($result); |
| 618 | 618 | |
@@ -633,13 +633,13 @@ discard block |
||
| 633 | 633 | ); |
| 634 | 634 | } |
| 635 | 635 | |
| 636 | - $sql = 'UPDATE ' . TOPICS_TABLE . ' |
|
| 637 | - SET ' . $this->db->sql_build_array('UPDATE', $fields) . ' |
|
| 636 | + $sql = 'UPDATE '.TOPICS_TABLE.' |
|
| 637 | + SET ' . $this->db->sql_build_array('UPDATE', $fields).' |
|
| 638 | 638 | WHERE ' . $this->db->sql_in_set('topic_id', array_map('intval', $topic_ids)); |
| 639 | 639 | $this->db->sql_query($sql); |
| 640 | 640 | |
| 641 | 641 | $sql = 'SELECT topic_id |
| 642 | - FROM ' . TOPICS_TABLE . ' |
|
| 642 | + FROM ' . TOPICS_TABLE.' |
|
| 643 | 643 | WHERE ' . $this->db->sql_in_set('topic_moved_id', array_map('intval', $topic_ids)); |
| 644 | 644 | $result = $this->db->sql_query($sql); |
| 645 | 645 | |
@@ -652,8 +652,8 @@ discard block |
||
| 652 | 652 | |
| 653 | 653 | if (sizeof($shadow_topic_ids)) |
| 654 | 654 | { |
| 655 | - $sql = 'UPDATE ' . TOPICS_TABLE . ' |
|
| 656 | - SET ' . $this->db->sql_build_array('UPDATE', $fields) . ' |
|
| 655 | + $sql = 'UPDATE '.TOPICS_TABLE.' |
|
| 656 | + SET ' . $this->db->sql_build_array('UPDATE', $fields).' |
|
| 657 | 657 | WHERE ' . $this->db->sql_in_set('topic_id', array_map('intval', $shadow_topic_ids)); |
| 658 | 658 | $this->db->sql_query($sql); |
| 659 | 659 | } |
@@ -661,7 +661,7 @@ discard block |
||
| 661 | 661 | $redirect = $this->request->variable('redirect', $this->user->data['session_page']); |
| 662 | 662 | |
| 663 | 663 | meta_refresh(3, $redirect); |
| 664 | - trigger_error($this->user->lang['QTE_TOPIC' . (sizeof($topic_ids) == 1 ? '' : 'S') . '_ATTRIBUTE_' . $message] . '<br /><br />' . sprintf($this->user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>')); |
|
| 664 | + trigger_error($this->user->lang['QTE_TOPIC'.(sizeof($topic_ids) == 1 ? '' : 'S').'_ATTRIBUTE_'.$message].'<br /><br />'.sprintf($this->user->lang['RETURN_PAGE'], '<a href="'.$redirect.'">', '</a>')); |
|
| 665 | 665 | |
| 666 | 666 | return; |
| 667 | 667 | } |
@@ -687,12 +687,12 @@ discard block |
||
| 687 | 687 | */ |
| 688 | 688 | public function qte_group_select($group_ids, $exclude_ids = array(), $manage_founder = false) |
| 689 | 689 | { |
| 690 | - $exclude_sql = ($exclude_ids !== false && sizeof($exclude_ids)) ? 'WHERE ' . $this->db->sql_in_set('group_id', array_map('intval', $exclude_ids), true) : ''; |
|
| 691 | - $sql_and = !$this->config['coppa_enable'] ? ($exclude_sql ? ' AND ' : ' WHERE ') . "group_name <> 'REGISTERED_COPPA'" : ''; |
|
| 692 | - $sql_founder = ($manage_founder !== false) ? (($exclude_sql || $sql_and) ? ' AND ' : ' WHERE ') . 'group_founder_manage = ' . (int) $manage_founder : ''; |
|
| 690 | + $exclude_sql = ($exclude_ids !== false && sizeof($exclude_ids)) ? 'WHERE '.$this->db->sql_in_set('group_id', array_map('intval', $exclude_ids), true) : ''; |
|
| 691 | + $sql_and = !$this->config['coppa_enable'] ? ($exclude_sql ? ' AND ' : ' WHERE ')."group_name <> 'REGISTERED_COPPA'" : ''; |
|
| 692 | + $sql_founder = ($manage_founder !== false) ? (($exclude_sql || $sql_and) ? ' AND ' : ' WHERE ').'group_founder_manage = '.(int) $manage_founder : ''; |
|
| 693 | 693 | |
| 694 | 694 | $sql = 'SELECT group_id, group_name, group_type |
| 695 | - FROM ' . GROUPS_TABLE . " |
|
| 695 | + FROM ' . GROUPS_TABLE." |
|
| 696 | 696 | $exclude_sql |
| 697 | 697 | $sql_and |
| 698 | 698 | $sql_founder |
@@ -703,7 +703,7 @@ discard block |
||
| 703 | 703 | while ($row = $this->db->sql_fetchrow($result)) |
| 704 | 704 | { |
| 705 | 705 | $selected = in_array($row['group_id'], $group_ids) ? ' selected="selected"' : ''; |
| 706 | - $s_group_options .= '<option' . (($row['group_type'] == GROUP_SPECIAL) ? ' class="sep"' : '') . ' value="' . $row['group_id'] . '"' . $selected . '>' . (($row['group_type'] == GROUP_SPECIAL) ? $this->user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>'; |
|
| 706 | + $s_group_options .= '<option'.(($row['group_type'] == GROUP_SPECIAL) ? ' class="sep"' : '').' value="'.$row['group_id'].'"'.$selected.'>'.(($row['group_type'] == GROUP_SPECIAL) ? $this->user->lang['G_'.$row['group_name']] : $row['group_name']).'</option>'; |
|
| 707 | 707 | } |
| 708 | 708 | $this->db->sql_freeresult($result); |
| 709 | 709 | |
@@ -725,7 +725,7 @@ discard block |
||
| 725 | 725 | // borrowed from "Categories Hierarchy" : used to check if a image key exists |
| 726 | 726 | public function attr_img_key($key, $alt) |
| 727 | 727 | { |
| 728 | - return empty($key) ? '' : (preg_match('#^[a-z0-9_-]+$#i', $key) ? $this->user->img($key, $alt) : '<img src="' . (preg_match('#^(ht|f)tp[s]?\://#i', $key) ? $key : $this->root_path . $key) . '" alt="' . $alt . '" title="' . $alt . '" />'); |
|
| 728 | + return empty($key) ? '' : (preg_match('#^[a-z0-9_-]+$#i', $key) ? $this->user->img($key, $alt) : '<img src="'.(preg_match('#^(ht|f)tp[s]?\://#i', $key) ? $key : $this->root_path.$key).'" alt="'.$alt.'" title="'.$alt.'" />'); |
|
| 729 | 729 | } |
| 730 | 730 | |
| 731 | 731 | /** |
@@ -743,7 +743,7 @@ discard block |
||
| 743 | 743 | $a_name .= '-qte'; |
| 744 | 744 | } |
| 745 | 745 | |
| 746 | - return ' class="qte-attr ' . $a_name . '"' . (!empty($a_colour) ? ' style="color:#' . $a_colour . '; font-weight:bold;"' : ''); |
|
| 746 | + return ' class="qte-attr '.$a_name.'"'.(!empty($a_colour) ? ' style="color:#'.$a_colour.'; font-weight:bold;"' : ''); |
|
| 747 | 747 | } |
| 748 | 748 | |
| 749 | 749 | /** |
@@ -781,7 +781,7 @@ discard block |
||
| 781 | 781 | // include that file ! |
| 782 | 782 | if (!function_exists('group_memberships')) |
| 783 | 783 | { |
| 784 | - include $this->root_path . 'includes/functions_user.' . $this->php_ext; |
|
| 784 | + include $this->root_path.'includes/functions_user.'.$this->php_ext; |
|
| 785 | 785 | } |
| 786 | 786 | |
| 787 | 787 | // get groups membership ! |
@@ -813,7 +813,7 @@ discard block |
||
| 813 | 813 | if (($this->_attr = $this->cache->get('_attr')) === false) |
| 814 | 814 | { |
| 815 | 815 | $sql = 'SELECT * |
| 816 | - FROM ' . $this->table_prefix . 'topics_attr |
|
| 816 | + FROM ' . $this->table_prefix.'topics_attr |
|
| 817 | 817 | ORDER BY left_id ASC'; |
| 818 | 818 | $result = $this->db->sql_query($sql); |
| 819 | 819 | |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | { |
| 42 | 42 | return array( |
| 43 | 43 | 'add_tables' => array( |
| 44 | - $this->table_prefix . 'topics_attr' => array( |
|
| 44 | + $this->table_prefix.'topics_attr' => array( |
|
| 45 | 45 | 'COLUMNS' => array( |
| 46 | 46 | 'attr_id' => array('UINT', null, 'auto_increment'), |
| 47 | 47 | 'attr_type' => array('BOOL', 0), |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | { |
| 73 | 73 | return array( |
| 74 | 74 | 'drop_tables' => array( |
| 75 | - $this->table_prefix . 'topics_attr', |
|
| 75 | + $this->table_prefix.'topics_attr', |
|
| 76 | 76 | ), |
| 77 | 77 | 'drop_columns' => array( |
| 78 | 78 | TOPICS_TABLE => array( |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | public function viewtopic_attr_apply($event) |
| 95 | 95 | { |
| 96 | 96 | $attr_id = (int) $this->request->variable('attr_id', 0); |
| 97 | - if ( $attr_id ) |
|
| 97 | + if ($attr_id) |
|
| 98 | 98 | { |
| 99 | 99 | $this->qte->get_users_by_topic_id(array($event['topic_id'])); |
| 100 | 100 | $this->qte->attr_apply($attr_id, $event['topic_id'], $event['forum_id'], $event['topic_data']['topic_attr_id'], (array) unserialize(trim($event['topic_data']['hide_attr']))); |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | $attr_name, |
| 205 | 205 | ); |
| 206 | 206 | |
| 207 | - $this->log->add('mod', $this->user->data['user_id'], $this->user->ip, 'MCP_ATTRIBUTE_' . ($event['data']['attr_id'] == \ernadoo\qte\qte::REMOVE ? 'REMOVED' : 'UPDATED'), time(), $log_data); |
|
| 207 | + $this->log->add('mod', $this->user->data['user_id'], $this->user->ip, 'MCP_ATTRIBUTE_'.($event['data']['attr_id'] == \ernadoo\qte\qte::REMOVE ? 'REMOVED' : 'UPDATED'), time(), $log_data); |
|
| 208 | 208 | } |
| 209 | 209 | } |
| 210 | 210 | } |