Verzeichnisstruktur phpBB-3.1.0


Veröffentlicht
27.10.2014

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

      (Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

mcp_warn.php

Zuletzt modifiziert: 09.10.2024, 12:52 - Dateigröße: 17.64 KiB


 001  <?php
 002  /**
 003  *
 004  * This file is part of the phpBB Forum Software package.
 005  *
 006  * @copyright (c) phpBB Limited <https://www.phpbb.com>
 007  * @license GNU General Public License, version 2 (GPL-2.0)
 008  *
 009  * For full copyright and license information, please see
 010  * the docs/CREDITS.txt file.
 011  *
 012  */
 013   
 014  /**
 015  * @ignore
 016  */
 017  if (!defined('IN_PHPBB'))
 018  {
 019      exit;
 020  }
 021   
 022  /**
 023  * mcp_warn
 024  * Handling warning the users
 025  */
 026  class mcp_warn
 027  {
 028      var $p_master;
 029      var $u_action;
 030   
 031      function mcp_warn(&$p_master)
 032      {
 033          $this->p_master = &$p_master;
 034      }
 035   
 036      function main($id, $mode)
 037      {
 038          global $auth, $db, $user, $template;
 039          global $config, $phpbb_root_path, $phpEx;
 040   
 041          $action = request_var('action', array('' => ''));
 042   
 043          if (is_array($action))
 044          {
 045              list($action, ) = each($action);
 046          }
 047   
 048          $this->page_title = 'MCP_WARN';
 049   
 050          add_form_key('mcp_warn');
 051   
 052          switch ($mode)
 053          {
 054              case 'front':
 055                  $this->mcp_warn_front_view();
 056                  $this->tpl_name = 'mcp_warn_front';
 057              break;
 058   
 059              case 'list':
 060                  $this->mcp_warn_list_view($action);
 061                  $this->tpl_name = 'mcp_warn_list';
 062              break;
 063   
 064              case 'warn_post':
 065                  $this->mcp_warn_post_view($action);
 066                  $this->tpl_name = 'mcp_warn_post';
 067              break;
 068   
 069              case 'warn_user':
 070                  $this->mcp_warn_user_view($action);
 071                  $this->tpl_name = 'mcp_warn_user';
 072              break;
 073          }
 074      }
 075   
 076      /**
 077      * Generates the summary on the main page of the warning module
 078      */
 079      function mcp_warn_front_view()
 080      {
 081          global $phpEx, $phpbb_root_path, $config;
 082          global $template, $db, $user, $auth;
 083   
 084          $template->assign_vars(array(
 085              'U_FIND_USERNAME'    => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=mcp&amp;field=username&amp;select_single=true'),
 086              'U_POST_ACTION'        => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user'),
 087          ));
 088   
 089          // Obtain a list of the 5 naughtiest users....
 090          // These are the 5 users with the highest warning count
 091          $highest = array();
 092          $count = 0;
 093   
 094          view_warned_users($highest, $count, 5);
 095   
 096          foreach ($highest as $row)
 097          {
 098              $template->assign_block_vars('highest', array(
 099                  'U_NOTES'        => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $row['user_id']),
 100   
 101                  'USERNAME_FULL'        => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
 102   
 103                  'WARNING_TIME'    => $user->format_date($row['user_last_warning']),
 104                  'WARNINGS'        => $row['user_warnings'],
 105              ));
 106          }
 107   
 108          // And now the 5 most recent users to get in trouble
 109          $sql = 'SELECT u.user_id, u.username, u.username_clean, u.user_colour, u.user_warnings, w.warning_time
 110              FROM ' . USERS_TABLE . ' u, ' . WARNINGS_TABLE . ' w
 111              WHERE u.user_id = w.user_id
 112              ORDER BY w.warning_time DESC';
 113          $result = $db->sql_query_limit($sql, 5);
 114   
 115          while ($row = $db->sql_fetchrow($result))
 116          {
 117              $template->assign_block_vars('latest', array(
 118                  'U_NOTES'        => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $row['user_id']),
 119   
 120                  'USERNAME_FULL'        => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
 121   
 122                  'WARNING_TIME'    => $user->format_date($row['warning_time']),
 123                  'WARNINGS'        => $row['user_warnings'],
 124              ));
 125          }
 126          $db->sql_freeresult($result);
 127      }
 128   
 129      /**
 130      * Lists all users with warnings
 131      */
 132      function mcp_warn_list_view($action)
 133      {
 134          global $phpEx, $phpbb_root_path, $config, $phpbb_container;
 135          global $template, $db, $user, $auth;
 136   
 137          $user->add_lang('memberlist');
 138          $pagination = $phpbb_container->get('pagination');
 139   
 140          $start    = request_var('start', 0);
 141          $st        = request_var('st', 0);
 142          $sk        = request_var('sk', 'b');
 143          $sd        = request_var('sd', 'd');
 144   
 145          $limit_days = array(0 => $user->lang['ALL_ENTRIES'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
 146          $sort_by_text = array('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang['SORT_DATE'], 'c' => $user->lang['SORT_WARNINGS']);
 147          $sort_by_sql = array('a' => 'username_clean', 'b' => 'user_last_warning', 'c' => 'user_warnings');
 148   
 149          $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
 150          gen_sort_selects($limit_days, $sort_by_text, $st, $sk, $sd, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
 151   
 152          // Define where and sort sql for use in displaying logs
 153          $sql_where = ($st) ? (time() - ($st * 86400)) : 0;
 154          $sql_sort = $sort_by_sql[$sk] . ' ' . (($sd == 'd') ? 'DESC' : 'ASC');
 155   
 156          $users = array();
 157          $user_count = 0;
 158   
 159          view_warned_users($users, $user_count, $config['topics_per_page'], $start, $sql_where, $sql_sort);
 160   
 161          foreach ($users as $row)
 162          {
 163              $template->assign_block_vars('user', array(
 164                  'U_NOTES'        => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $row['user_id']),
 165   
 166                  'USERNAME_FULL'        => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
 167   
 168                  'WARNING_TIME'    => $user->format_date($row['user_last_warning']),
 169                  'WARNINGS'        => $row['user_warnings'],
 170              ));
 171          }
 172   
 173          $base_url = append_sid("{$phpbb_root_path}mcp.$phpEx", "i=warn&amp;mode=list&amp;st=$st&amp;sk=$sk&amp;sd=$sd");
 174          $pagination->generate_template_pagination($base_url, 'pagination', 'start', $user_count, $config['topics_per_page'], $start);
 175   
 176          $template->assign_vars(array(
 177              'U_POST_ACTION'            => $this->u_action,
 178              'S_CLEAR_ALLOWED'        => ($auth->acl_get('a_clearlogs')) ? true : false,
 179              'S_SELECT_SORT_DIR'        => $s_sort_dir,
 180              'S_SELECT_SORT_KEY'        => $s_sort_key,
 181              'S_SELECT_SORT_DAYS'    => $s_limit_days,
 182   
 183              'TOTAL_USERS'        => $user->lang('LIST_USERS', (int) $user_count),
 184          ));
 185      }
 186   
 187      /**
 188      * Handles warning the user when the warning is for a specific post
 189      */
 190      function mcp_warn_post_view($action)
 191      {
 192          global $phpEx, $phpbb_root_path, $config;
 193          global $template, $db, $user, $auth, $phpbb_dispatcher;
 194   
 195          $post_id = request_var('p', 0);
 196          $forum_id = request_var('f', 0);
 197          $notify = (isset($_REQUEST['notify_user'])) ? true : false;
 198          $warning = utf8_normalize_nfc(request_var('warning', '', true));
 199   
 200          $sql = 'SELECT u.*, p.*
 201              FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . " u
 202              WHERE p.post_id = $post_id
 203                  AND u.user_id = p.poster_id";
 204          $result = $db->sql_query($sql);
 205          $user_row = $db->sql_fetchrow($result);
 206          $db->sql_freeresult($result);
 207   
 208          if (!$user_row)
 209          {
 210              trigger_error('NO_POST');
 211          }
 212   
 213          // There is no point issuing a warning to ignored users (ie anonymous and bots)
 214          if ($user_row['user_type'] == USER_IGNORE)
 215          {
 216              trigger_error('CANNOT_WARN_ANONYMOUS');
 217          }
 218   
 219          // Prevent someone from warning themselves
 220          if ($user_row['user_id'] == $user->data['user_id'])
 221          {
 222              trigger_error('CANNOT_WARN_SELF');
 223          }
 224   
 225          // Check if there is already a warning for this post to prevent multiple
 226          // warnings for the same offence
 227          $sql = 'SELECT post_id
 228              FROM ' . WARNINGS_TABLE . "
 229              WHERE post_id = $post_id";
 230          $result = $db->sql_query($sql);
 231          $row = $db->sql_fetchrow($result);
 232          $db->sql_freeresult($result);
 233   
 234          if ($row)
 235          {
 236              trigger_error('ALREADY_WARNED');
 237          }
 238   
 239          $user_id = $user_row['user_id'];
 240   
 241          if (strpos($this->u_action, "&amp;f=$forum_id&amp;p=$post_id") === false)
 242          {
 243              $this->p_master->adjust_url("&amp;f=$forum_id&amp;p=$post_id");
 244              $this->u_action .= "&amp;f=$forum_id&amp;p=$post_id";
 245          }
 246   
 247          // Check if can send a notification
 248          if ($config['allow_privmsg'])
 249          {
 250              $auth2 = new \phpbb\auth\auth();
 251              $auth2->acl($user_row);
 252              $s_can_notify = ($auth2->acl_get('u_readpm')) ? true : false;
 253              unset($auth2);
 254          }
 255          else
 256          {
 257              $s_can_notify = false;
 258          }
 259   
 260          // Prevent against clever people
 261          if ($notify && !$s_can_notify)
 262          {
 263              $notify = false;
 264          }
 265   
 266          if ($warning && $action == 'add_warning')
 267          {
 268              if (check_form_key('mcp_warn'))
 269              {
 270                  $s_mcp_warn_post = true;
 271   
 272                  /**
 273                  * Event for before warning a user for a post.
 274                  *
 275                  * @event core.mcp_warn_post_before
 276                  * @var array    user_row        The entire user row
 277                  * @var string    warning            The warning message
 278                  * @var bool        notify            If true, we notify the user for the warning
 279                  * @var int        post_id            The post id for which the warning is added
 280                  * @var bool        s_mcp_warn_post If true, we add the warning else we omit it
 281                  * @since 3.1.0-b4
 282                  */
 283                  $vars = array(
 284                          'user_row',
 285                          'warning',
 286                          'notify',
 287                          'post_id',
 288                          's_mcp_warn_post',
 289                  );
 290                  extract($phpbb_dispatcher->trigger_event('core.mcp_warn_post_before', compact($vars)));
 291   
 292                  if ($s_mcp_warn_post)
 293                  {
 294                      add_warning($user_row, $warning, $notify, $post_id);
 295                      $message = $user->lang['USER_WARNING_ADDED'];
 296   
 297                      /**
 298                      * Event for after warning a user for a post.
 299                      *
 300                      * @event core.mcp_warn_post_after
 301                      * @var array    user_row    The entire user row
 302                      * @var string    warning        The warning message
 303                      * @var bool        notify        If true, the user was notified for the warning
 304                      * @var int        post_id        The post id for which the warning is added
 305                      * @var string    message        Message displayed to the moderator
 306                      * @since 3.1.0-b4
 307                      */
 308                      $vars = array(
 309                              'user_row',
 310                              'warning',
 311                              'notify',
 312                              'post_id',
 313                              'message',
 314                      );
 315                      extract($phpbb_dispatcher->trigger_event('core.mcp_warn_post_after', compact($vars)));
 316                  }
 317              }
 318              else
 319              {
 320                  $message = $user->lang['FORM_INVALID'];
 321              }
 322   
 323              if (!empty($message))
 324              {
 325                  $redirect = append_sid("{$phpbb_root_path}mcp.$phpEx", "i=notes&amp;mode=user_notes&amp;u=$user_id");
 326                  meta_refresh(2, $redirect);
 327                  trigger_error($message . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
 328              }
 329          }
 330   
 331          // OK, they didn't submit a warning so lets build the page for them to do so
 332   
 333          // We want to make the message available here as a reminder
 334          // Parse the message and subject
 335          $parse_flags = OPTION_FLAG_SMILIES | ($user_row['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0);
 336          $message = generate_text_for_display($user_row['post_text'], $user_row['bbcode_uid'], $user_row['bbcode_bitfield'], $parse_flags, true);
 337   
 338          // Generate the appropriate user information for the user we are looking at
 339          if (!function_exists('phpbb_get_user_rank'))
 340          {
 341              include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
 342          }
 343   
 344          $user_rank_data = phpbb_get_user_rank($user_row, $user_row['user_posts']);
 345          $avatar_img = phpbb_get_user_avatar($user_row);
 346   
 347          $template->assign_vars(array(
 348              'U_POST_ACTION'        => $this->u_action,
 349   
 350              'POST'                => $message,
 351              'USERNAME'            => $user_row['username'],
 352              'USER_COLOR'        => (!empty($user_row['user_colour'])) ? $user_row['user_colour'] : '',
 353              'RANK_TITLE'        => $user_rank_data['title'],
 354              'JOINED'            => $user->format_date($user_row['user_regdate']),
 355              'POSTS'                => ($user_row['user_posts']) ? $user_row['user_posts'] : 0,
 356              'WARNINGS'            => ($user_row['user_warnings']) ? $user_row['user_warnings'] : 0,
 357   
 358              'AVATAR_IMG'        => $avatar_img,
 359              'RANK_IMG'            => $user_rank_data['img'],
 360   
 361              'L_WARNING_POST_DEFAULT'    => sprintf($user->lang['WARNING_POST_DEFAULT'], generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&amp;p=$post_id#p$post_id"),
 362   
 363              'S_CAN_NOTIFY'        => $s_can_notify,
 364          ));
 365      }
 366   
 367      /**
 368      * Handles warning the user
 369      */
 370      function mcp_warn_user_view($action)
 371      {
 372          global $phpEx, $phpbb_root_path, $config, $module;
 373          global $template, $db, $user, $auth, $phpbb_dispatcher;
 374   
 375          $user_id = request_var('u', 0);
 376          $username = request_var('username', '', true);
 377          $notify = (isset($_REQUEST['notify_user'])) ? true : false;
 378          $warning = utf8_normalize_nfc(request_var('warning', '', true));
 379   
 380          $sql_where = ($user_id) ? "user_id = $user_id" : "username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'";
 381   
 382          $sql = 'SELECT *
 383              FROM ' . USERS_TABLE . '
 384              WHERE ' . $sql_where;
 385          $result = $db->sql_query($sql);
 386          $user_row = $db->sql_fetchrow($result);
 387          $db->sql_freeresult($result);
 388   
 389          if (!$user_row)
 390          {
 391              trigger_error('NO_USER');
 392          }
 393   
 394          // Prevent someone from warning themselves
 395          if ($user_row['user_id'] == $user->data['user_id'])
 396          {
 397              trigger_error('CANNOT_WARN_SELF');
 398          }
 399   
 400          $user_id = $user_row['user_id'];
 401   
 402          if (strpos($this->u_action, "&amp;u=$user_id") === false)
 403          {
 404              $this->p_master->adjust_url('&amp;u=' . $user_id);
 405              $this->u_action .= "&amp;u=$user_id";
 406          }
 407   
 408          // Check if can send a notification
 409          if ($config['allow_privmsg'])
 410          {
 411              $auth2 = new \phpbb\auth\auth();
 412              $auth2->acl($user_row);
 413              $s_can_notify = ($auth2->acl_get('u_readpm')) ? true : false;
 414              unset($auth2);
 415          }
 416          else
 417          {
 418              $s_can_notify = false;
 419          }
 420   
 421          // Prevent against clever people
 422          if ($notify && !$s_can_notify)
 423          {
 424              $notify = false;
 425          }
 426   
 427          if ($warning && $action == 'add_warning')
 428          {
 429              if (check_form_key('mcp_warn'))
 430              {
 431                  $s_mcp_warn_user = true;
 432   
 433                  /**
 434                  * Event for before warning a user from MCP.
 435                  *
 436                  * @event core.mcp_warn_user_before
 437                  * @var array    user_row        The entire user row
 438                  * @var string    warning            The warning message
 439                  * @var bool        notify            If true, we notify the user for the warning
 440                  * @var bool        s_mcp_warn_user If true, we add the warning else we omit it
 441                  * @since 3.1.0-b4
 442                  */
 443                  $vars = array(
 444                          'user_row',
 445                          'warning',
 446                          'notify',
 447                          's_mcp_warn_user',
 448                  );
 449                  extract($phpbb_dispatcher->trigger_event('core.mcp_warn_user_before', compact($vars)));
 450   
 451                  if ($s_mcp_warn_user)
 452                  {
 453                      add_warning($user_row, $warning, $notify);
 454                      $message = $user->lang['USER_WARNING_ADDED'];
 455   
 456                      /**
 457                      * Event for after warning a user from MCP.
 458                      *
 459                      * @event core.mcp_warn_user_after
 460                      * @var array    user_row    The entire user row
 461                      * @var string    warning        The warning message
 462                      * @var bool        notify        If true, the user was notified for the warning
 463                      * @var string    message        Message displayed to the moderator
 464                      * @since 3.1.0-b4
 465                      */
 466                      $vars = array(
 467                              'user_row',
 468                              'warning',
 469                              'notify',
 470                              'message',
 471                      );
 472                      extract($phpbb_dispatcher->trigger_event('core.mcp_warn_user_after', compact($vars)));
 473                  }
 474              }
 475              else
 476              {
 477                  $message = $user->lang['FORM_INVALID'];
 478              }
 479   
 480              if (!empty($message))
 481              {
 482                  $redirect = append_sid("{$phpbb_root_path}mcp.$phpEx", "i=notes&amp;mode=user_notes&amp;u=$user_id");
 483                  meta_refresh(2, $redirect);
 484                  trigger_error($message . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
 485              }
 486          }
 487   
 488          // Generate the appropriate user information for the user we are looking at
 489          if (!function_exists('phpbb_get_user_rank'))
 490          {
 491              include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
 492          }
 493          $user_rank_data = phpbb_get_user_rank($user_row, $user_row['user_posts']);
 494          $avatar_img = phpbb_get_user_avatar($user_row);
 495   
 496          // OK, they didn't submit a warning so lets build the page for them to do so
 497          $template->assign_vars(array(
 498              'U_POST_ACTION'        => $this->u_action,
 499   
 500              'RANK_TITLE'        => $user_rank_data['title'],
 501              'JOINED'            => $user->format_date($user_row['user_regdate']),
 502              'POSTS'                => ($user_row['user_posts']) ? $user_row['user_posts'] : 0,
 503              'WARNINGS'            => ($user_row['user_warnings']) ? $user_row['user_warnings'] : 0,
 504   
 505              'USERNAME_FULL'        => get_username_string('full', $user_row['user_id'], $user_row['username'], $user_row['user_colour']),
 506              'USERNAME_COLOUR'    => get_username_string('colour', $user_row['user_id'], $user_row['username'], $user_row['user_colour']),
 507              'USERNAME'            => get_username_string('username', $user_row['user_id'], $user_row['username'], $user_row['user_colour']),
 508              'U_PROFILE'            => get_username_string('profile', $user_row['user_id'], $user_row['username'], $user_row['user_colour']),
 509   
 510              'AVATAR_IMG'        => $avatar_img,
 511              'RANK_IMG'            => $user_rank_data['img'],
 512   
 513              'S_CAN_NOTIFY'        => $s_can_notify,
 514          ));
 515   
 516          return $user_id;
 517      }
 518  }
 519   
 520  /**
 521  * Insert the warning into the database
 522  */
 523  function add_warning($user_row, $warning, $send_pm = true, $post_id = 0)
 524  {
 525      global $phpEx, $phpbb_root_path, $config;
 526      global $template, $db, $user, $auth;
 527   
 528      if ($send_pm)
 529      {
 530          include_once($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx);
 531          include_once($phpbb_root_path . 'includes/message_parser.' . $phpEx);
 532   
 533          $user_row['user_lang'] = (file_exists($phpbb_root_path . 'language/' . $user_row['user_lang'] . "/mcp.$phpEx")) ? $user_row['user_lang'] : $config['default_lang'];
 534          include($phpbb_root_path . 'language/' . basename($user_row['user_lang']) . "/mcp.$phpEx");
 535   
 536          $message_parser = new parse_message();
 537   
 538          $message_parser->message = $user->lang('WARNING_PM_BODY', $warning);
 539          $message_parser->parse(true, true, true, false, false, true, true);
 540   
 541          $pm_data = array(
 542              'from_user_id'            => $user->data['user_id'],
 543              'from_user_ip'            => $user->ip,
 544              'from_username'            => $user->data['username'],
 545              'enable_sig'            => false,
 546              'enable_bbcode'            => true,
 547              'enable_smilies'        => true,
 548              'enable_urls'            => false,
 549              'icon_id'                => 0,
 550              'bbcode_bitfield'        => $message_parser->bbcode_bitfield,
 551              'bbcode_uid'            => $message_parser->bbcode_uid,
 552              'message'                => $message_parser->message,
 553              'address_list'            => array('u' => array($user_row['user_id'] => 'to')),
 554          );
 555   
 556          submit_pm('post', $user->lang('WARNING_PM_SUBJECT'), $pm_data, false);
 557      }
 558   
 559      add_log('admin', 'LOG_USER_WARNING', $user_row['username']);
 560      $log_id = add_log('user', $user_row['user_id'], 'LOG_USER_WARNING_BODY', $warning);
 561   
 562      $sql_ary = array(
 563          'user_id'        => $user_row['user_id'],
 564          'post_id'        => $post_id,
 565          'log_id'        => $log_id,
 566          'warning_time'    => time(),
 567      );
 568   
 569      $db->sql_query('INSERT INTO ' . WARNINGS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
 570   
 571      $sql = 'UPDATE ' . USERS_TABLE . '
 572          SET user_warnings = user_warnings + 1,
 573              user_last_warning = ' . time() . '
 574          WHERE user_id = ' . $user_row['user_id'];
 575      $db->sql_query($sql);
 576   
 577      // We add this to the mod log too for moderators to see that a specific user got warned.
 578      $sql = 'SELECT forum_id, topic_id
 579          FROM ' . POSTS_TABLE . '
 580          WHERE post_id = ' . $post_id;
 581      $result = $db->sql_query($sql);
 582      $row = $db->sql_fetchrow($result);
 583      $db->sql_freeresult($result);
 584   
 585      add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_USER_WARNING', $user_row['username']);
 586  }
 587