Ignore:
Timestamp:
Mar 31, 2010, 6:32:40 PM (14 years ago)
Author:
george
Message:
  • Upraveno: Aktualizace fóra.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/forum/posting.php

    r400 r702  
    33*
    44* @package phpBB3
    5 * @version $Id: posting.php 9048 2008-11-04 15:54:43Z toonarmy $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    4040$cancel         = (isset($_POST['cancel']) && !isset($_POST['save'])) ? true : false;
    4141
    42 $refresh        = (isset($_POST['add_file']) || isset($_POST['delete_file']) || isset($_POST['cancel_unglobalise']) || $save || $load) ? true : false;
     42$refresh        = (isset($_POST['add_file']) || isset($_POST['delete_file']) || isset($_POST['full_editor']) || isset($_POST['cancel_unglobalise']) || $save || $load) ? true : false;
    4343$mode           = ($delete && !$preview && !$refresh && $submit) ? 'delete' : request_var('mode', '');
    4444
     
    4646$current_time = time();
    4747
    48 
    4948// Was cancel pressed? If so then redirect to the appropriate page
    5049if ($cancel || ($current_time - $lastclick < 2 && $submit))
    5150{
    52         $redirect = ($post_id) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'p=' . $post_id) . '#p' . $post_id : (($topic_id) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . $topic_id) : (($forum_id) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id) : append_sid("{$phpbb_root_path}index.$phpEx")));
     51        $f = ($forum_id) ? 'f=' . $forum_id . '&amp;' : '';
     52        $redirect = ($post_id) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", $f . 'p=' . $post_id) . '#p' . $post_id : (($topic_id) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", $f . 't=' . $topic_id) : (($forum_id) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id) : append_sid("{$phpbb_root_path}index.$phpEx")));
    5353        redirect($redirect);
    5454}
     
    7575                }
    7676
     77                // Force forum id
     78                $sql = 'SELECT forum_id
     79                        FROM ' . TOPICS_TABLE . '
     80                        WHERE topic_id = ' . $topic_id;
     81                $result = $db->sql_query($sql);
     82                $f_id = (int) $db->sql_fetchfield('forum_id');
     83                $db->sql_freeresult($result);
     84
     85                $forum_id = (!$f_id) ? $forum_id : $f_id;
     86
    7787                $sql = 'SELECT f.*, t.*
    7888                        FROM ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . " f
    7989                        WHERE t.topic_id = $topic_id
    8090                                AND (f.forum_id = t.forum_id
    81                                         OR f.forum_id = $forum_id)";
     91                                        OR f.forum_id = $forum_id)" .
     92                        (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND t.topic_approved = 1');
    8293        break;
    8394
     
    90101                        trigger_error('NO_POST');
    91102                }
     103
     104                // Force forum id
     105                $sql = 'SELECT forum_id
     106                        FROM ' . POSTS_TABLE . '
     107                        WHERE post_id = ' . $post_id;
     108                $result = $db->sql_query($sql);
     109                $f_id = (int) $db->sql_fetchfield('forum_id');
     110                $db->sql_freeresult($result);
     111
     112                $forum_id = (!$f_id) ? $forum_id : $f_id;
    92113
    93114                $sql = 'SELECT f.*, t.*, p.*, u.username, u.username_clean, u.user_sig, u.user_sig_bbcode_uid, u.user_sig_bbcode_bitfield
     
    97118                                AND u.user_id = p.poster_id
    98119                                AND (f.forum_id = t.forum_id
    99                                         OR f.forum_id = $forum_id)";
     120                                        OR f.forum_id = $forum_id)" .
     121                                (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND p.post_approved = 1');
    100122        break;
    101123
     
    143165}
    144166
     167// Not able to reply to unapproved posts/topics
     168// TODO: add more descriptive language key
     169if ($auth->acl_get('m_approve', $forum_id) && ((($mode == 'reply' || $mode == 'bump') && !$post_data['topic_approved']) || ($mode == 'quote' && !$post_data['post_approved'])))
     170{
     171        trigger_error(($mode == 'reply' || $mode == 'bump') ? 'TOPIC_UNAPPROVED' : 'POST_UNAPPROVED');
     172}
     173
    145174if ($mode == 'popup')
    146175{
     
    150179
    151180$user->setup(array('posting', 'mcp', 'viewtopic'), $post_data['forum_style']);
     181
     182if ($config['enable_post_confirm'] && !$user->data['is_registered'])
     183{
     184        include($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx);
     185        $captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']);
     186        $captcha->init(CONFIRM_POST);
     187}
    152188
    153189// Use post_row values in favor of submitted ones...
     
    343379
    344380$post_data['post_edit_locked']  = (isset($post_data['post_edit_locked'])) ? (int) $post_data['post_edit_locked'] : 0;
     381$post_data['post_subject_md5']  = (isset($post_data['post_subject']) && $mode == 'edit') ? md5($post_data['post_subject']) : '';
    345382$post_data['post_subject']              = (in_array($mode, array('quote', 'edit'))) ? $post_data['post_subject'] : ((isset($post_data['topic_title'])) ? $post_data['topic_title'] : '');
    346383$post_data['topic_time_limit']  = (isset($post_data['topic_time_limit'])) ? (($post_data['topic_time_limit']) ? (int) $post_data['topic_time_limit'] / 86400 : (int) $post_data['topic_time_limit']) : 0;
     
    467504// HTML, BBCode, Smilies, Images and Flash status
    468505$bbcode_status  = ($config['allow_bbcode'] && $auth->acl_get('f_bbcode', $forum_id)) ? true : false;
    469 $smilies_status = ($bbcode_status && $config['allow_smilies'] && $auth->acl_get('f_smilies', $forum_id)) ? true : false;
     506$smilies_status = ($config['allow_smilies'] && $auth->acl_get('f_smilies', $forum_id)) ? true : false;
    470507$img_status             = ($bbcode_status && $auth->acl_get('f_img', $forum_id)) ? true : false;
    471508$url_status             = ($config['allow_post_links']) ? true : false;
    472509$flash_status   = ($bbcode_status && $auth->acl_get('f_flash', $forum_id) && $config['allow_post_flash']) ? true : false;
    473 $quote_status   = ($auth->acl_get('f_reply', $forum_id)) ? true : false;
     510$quote_status   = true;
    474511
    475512// Save Draft
     
    517554                        );
    518555
     556                        $hidden_fields = array(
     557                                'icon_id'                       => 0,
     558
     559                                'disable_bbcode'        => false,
     560                                'disable_smilies'       => false,
     561                                'disable_magic_url'     => false,
     562                                'attach_sig'            => true,
     563                                'lock_topic'            => false,
     564
     565                                'topic_type'            => POST_NORMAL,
     566                                'topic_time_limit'      => 0,
     567
     568                                'poll_title'            => '',
     569                                'poll_option_text'      => '',
     570                                'poll_max_options'      => 1,
     571                                'poll_length'           => 0,
     572                                'poll_vote_change'      => false,
     573                        );
     574
     575                        foreach ($hidden_fields as $name => $default)
     576                        {
     577                                if (!isset($_POST[$name]))
     578                                {
     579                                        // Don't include it, if its not available
     580                                        unset($hidden_fields[$name]);
     581                                        continue;
     582                                }
     583
     584                                if (is_bool($default))
     585                                {
     586                                        // Use the string representation
     587                                        $hidden_fields[$name] = request_var($name, '');
     588                                }
     589                                else
     590                                {
     591                                        $hidden_fields[$name] = request_var($name, $default);
     592                                }
     593                        }
     594
     595                        $s_hidden_fields .= build_hidden_fields($hidden_fields);
     596
    519597                        confirm_box(false, 'SAVE_DRAFT', $s_hidden_fields);
    520598                }
     
    565643}
    566644
    567 $solved_captcha = false;
    568645
    569646if ($submit || $preview || $refresh)
     
    579656        $post_data['topic_type']                = request_var('topic_type', (($mode != 'post') ? (int) $post_data['topic_type'] : POST_NORMAL));
    580657        $post_data['topic_time_limit']  = request_var('topic_time_limit', (($mode != 'post') ? (int) $post_data['topic_time_limit'] : 0));
    581         $post_data['icon_id']                   = request_var('icon', 0);
     658
     659        if ($post_data['enable_icons'] && $auth->acl_get('f_icons', $forum_id))
     660        {
     661                $post_data['icon_id'] = request_var('icon', (int) $post_data['icon_id']);
     662        }
    582663
    583664        $post_data['enable_bbcode']             = (!$bbcode_status || isset($_POST['disable_bbcode'])) ? false : true;
     
    647728                $post_data['poll_option_text']  = utf8_normalize_nfc(request_var('poll_option_text', '', true));
    648729                $post_data['poll_max_options']  = request_var('poll_max_options', 1);
    649                 $post_data['poll_vote_change']  = ($auth->acl_get('f_votechg', $forum_id) && isset($_POST['poll_vote_change'])) ? 1 : 0;
     730                $post_data['poll_vote_change']  = ($auth->acl_get('f_votechg', $forum_id) && $auth->acl_get('f_vote', $forum_id) && isset($_POST['poll_vote_change'])) ? 1 : 0;
    650731        }
    651732
     
    674755        $message_md5 = md5($message_parser->message);
    675756
     757        // If editing and checksum has changed we know the post was edited while we're editing
     758        // Notify and show user the changed post
     759        if ($mode == 'edit' && $post_data['forum_flags'] & FORUM_FLAG_POST_REVIEW)
     760        {
     761                $edit_post_message_checksum = request_var('edit_post_message_checksum', '');
     762                $edit_post_subject_checksum = request_var('edit_post_subject_checksum', '');
     763
     764                // $post_data['post_checksum'] is the checksum of the post submitted in the meantime
     765                // $message_md5 is the checksum of the post we're about to submit
     766                // $edit_post_message_checksum is the checksum of the post we're editing
     767                // ...
     768
     769                // We make sure nobody else made exactly the same change
     770                // we're about to submit by also checking $message_md5 != $post_data['post_checksum']
     771                if (($edit_post_message_checksum !== '' && $edit_post_message_checksum != $post_data['post_checksum'] && $message_md5 != $post_data['post_checksum'])
     772                 || ($edit_post_subject_checksum !== '' && $edit_post_subject_checksum != $post_data['post_subject_md5'] && md5($post_data['post_subject']) != $post_data['post_subject_md5']))
     773                {
     774                        if (topic_review($topic_id, $forum_id, 'post_review_edit', $post_id))
     775                        {
     776                                $template->assign_vars(array(
     777                                        'S_POST_REVIEW'                 => true,
     778
     779                                        'L_POST_REVIEW'                 => $user->lang['POST_REVIEW_EDIT'],
     780                                        'L_POST_REVIEW_EXPLAIN' => $user->lang['POST_REVIEW_EDIT_EXPLAIN'],
     781                                ));
     782                        }
     783
     784                        $submit = false;
     785                        $refresh = true;
     786                }
     787        }
     788
    676789        // Check checksum ... don't re-parse message if the same
    677790        $update_message = ($mode != 'edit' || $message_md5 != $post_data['post_checksum'] || $status_switch || strlen($post_data['bbcode_uid']) < BBCODE_UID_LEN) ? true : false;
     791
     792        // Also check if subject got updated...
     793        $update_subject = $mode != 'edit' || ($post_data['post_subject_md5'] && $post_data['post_subject_md5'] != md5($post_data['post_subject']));
    678794
    679795        // Parse message
     
    742858        if ($config['enable_post_confirm'] && !$user->data['is_registered'] && in_array($mode, array('quote', 'post', 'reply')))
    743859        {
    744                 $confirm_id = request_var('confirm_id', '');
    745                 $confirm_code = request_var('confirm_code', '');
    746 
    747                 $sql = 'SELECT code
    748                         FROM ' . CONFIRM_TABLE . "
    749                         WHERE confirm_id = '" . $db->sql_escape($confirm_id) . "'
    750                                 AND session_id = '" . $db->sql_escape($user->session_id) . "'
    751                                 AND confirm_type = " . CONFIRM_POST;
    752                 $result = $db->sql_query($sql);
    753                 $confirm_row = $db->sql_fetchrow($result);
    754                 $db->sql_freeresult($result);
    755 
    756                 if (empty($confirm_row['code']) || strcasecmp($confirm_row['code'], $confirm_code) !== 0)
    757                 {
    758                         $error[] = $user->lang['CONFIRM_CODE_WRONG'];
    759                 }
    760                 else
    761                 {
    762                         $solved_captcha = true;
     860                $captcha_data = array(
     861                        'message'       => utf8_normalize_nfc(request_var('message', '', true)),
     862                        'subject'       => utf8_normalize_nfc(request_var('subject', '', true)),
     863                        'username'      => utf8_normalize_nfc(request_var('username', '', true)),
     864                );
     865                $vc_response = $captcha->validate($captcha_data);
     866                if ($vc_response)
     867                {
     868                        $error[] = $vc_response;
    763869                }
    764870        }
     
    887993                                        $db->sql_freeresult($result);
    888994
    889                                         if ($forum_type != FORUM_POST || !$auth->acl_get('f_post', $to_forum_id))
     995                                        if ($forum_type != FORUM_POST || !$auth->acl_get('f_post', $to_forum_id) || (!$auth->acl_get('m_approve', $to_forum_id) && !$auth->acl_get('f_noapprove', $to_forum_id)))
    890996                                        {
    891997                                                $to_forum_id = 0;
     
    9991105                        }
    10001106
    1001                         $redirect_url = submit_post($mode, $post_data['post_subject'], $post_data['username'], $post_data['topic_type'], $poll, $data, $update_message);
    1002 
    1003                         // Check the permissions for post approval, as well as the queue trigger where users are put on approval with a post count lower than specified. Moderators are not affected.
    1004                         if ((($config['enable_queue_trigger'] && $user->data['user_posts'] < $config['queue_trigger_posts']) || !$auth->acl_get('f_noapprove', $data['forum_id'])) && !$auth->acl_get('m_approve', $data['forum_id']))
     1107                        // The last parameter tells submit_post if search indexer has to be run
     1108                        $redirect_url = submit_post($mode, $post_data['post_subject'], $post_data['username'], $post_data['topic_type'], $poll, $data, $update_message, ($update_message || $update_subject) ? true : false);
     1109
     1110                        if ($config['enable_post_confirm'] && !$user->data['is_registered'] && (isset($captcha) && $captcha->is_solved() === true) && ($mode == 'post' || $mode == 'reply' || $mode == 'quote'))
     1111                        {
     1112                                $captcha->reset();
     1113                        }
     1114
     1115                        // Check the permissions for post approval. Moderators are not affected.
     1116                        if ((!$auth->acl_get('f_noapprove', $data['forum_id']) && !$auth->acl_get('m_approve', $data['forum_id']) && empty($data['force_approved_state'])) || (isset($data['force_approved_state']) && !$data['force_approved_state']))
    10051117                        {
    10061118                                meta_refresh(10, $redirect_url);
     
    11291241if ($mode == 'quote' && !$submit && !$preview && !$refresh)
    11301242{
    1131         $message_parser->message = '[quote=&quot;' . $post_data['quote_username'] . '&quot;]' . censor_text(trim($message_parser->message)) . "[/quote]\n";
     1243        if ($config['allow_bbcode'])
     1244        {
     1245                $message_parser->message = '[quote=&quot;' . $post_data['quote_username'] . '&quot;]' . censor_text(trim($message_parser->message)) . "[/quote]\n";
     1246        }
     1247        else
     1248        {
     1249                $offset = 0;
     1250                $quote_string = "&gt; ";
     1251                $message = censor_text(trim($message_parser->message));
     1252                // see if we are nesting. It's easily tricked but should work for one level of nesting
     1253                if (strpos($message, "&gt;") !== false)
     1254                {
     1255                        $offset = 10;
     1256                }
     1257                $message = utf8_wordwrap($message, 75 + $offset, "\n");
     1258
     1259                $message = $quote_string . $message;
     1260                $message = str_replace("\n", "\n" . $quote_string, $message);
     1261                $message_parser->message =  $post_data['quote_username'] . " " . $user->lang['WROTE'] . " :\n" . $message . "\n";
     1262        }
    11321263}
    11331264
     
    11581289// Forum moderators?
    11591290$moderators = array();
    1160 get_moderators($moderators, $forum_id);
     1291if ($config['load_moderators'])
     1292{
     1293        get_moderators($moderators, $forum_id);
     1294}
    11611295
    11621296// Generate smiley listing
     
    12191353generate_forum_rules($post_data);
    12201354
    1221 if ($config['enable_post_confirm'] && !$user->data['is_registered'] && $solved_captcha === false && ($mode == 'post' || $mode == 'reply' || $mode == 'quote'))
    1222 {
    1223         // Show confirm image
    1224         $sql = 'DELETE FROM ' . CONFIRM_TABLE . "
    1225                 WHERE session_id = '" . $db->sql_escape($user->session_id) . "'
    1226                         AND confirm_type = " . CONFIRM_POST;
    1227         $db->sql_query($sql);
    1228 
    1229         // Generate code
    1230         $code = gen_rand_string(mt_rand(5, 8));
    1231         $confirm_id = md5(unique_id($user->ip));
    1232         $seed = hexdec(substr(unique_id(), 4, 10));
    1233 
    1234         // compute $seed % 0x7fffffff
    1235         $seed -= 0x7fffffff * floor($seed / 0x7fffffff);
    1236 
    1237         $sql = 'INSERT INTO ' . CONFIRM_TABLE . ' ' . $db->sql_build_array('INSERT', array(
    1238                 'confirm_id'    => (string) $confirm_id,
    1239                 'session_id'    => (string) $user->session_id,
    1240                 'confirm_type'  => (int) CONFIRM_POST,
    1241                 'code'                  => (string) $code,
    1242                 'seed'                  => (int) $seed)
    1243         );
    1244         $db->sql_query($sql);
     1355// Posting uses is_solved for legacy reasons. Plugins have to use is_solved to force themselves to be displayed.
     1356if ($config['enable_post_confirm'] && !$user->data['is_registered'] && (isset($captcha) && $captcha->is_solved() === false) && ($mode == 'post' || $mode == 'reply' || $mode == 'quote'))
     1357{
    12451358
    12461359        $template->assign_vars(array(
    12471360                'S_CONFIRM_CODE'                        => true,
    1248                 'CONFIRM_ID'                            => $confirm_id,
    1249                 'CONFIRM_IMAGE'                         => '<img src="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=confirm&amp;id=' . $confirm_id . '&amp;type=' . CONFIRM_POST) . '" alt="" title="" />',
    1250                 'L_POST_CONFIRM_EXPLAIN'        => sprintf($user->lang['POST_CONFIRM_EXPLAIN'], '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>'),
     1361                'CAPTCHA_TEMPLATE'                      => $captcha->get_template(),
    12511362        ));
    12521363}
     
    12561367$s_hidden_fields .= ($draft_id || isset($_REQUEST['draft_loaded'])) ? '<input type="hidden" name="draft_loaded" value="' . request_var('draft_loaded', $draft_id) . '" />' : '';
    12571368
     1369if ($mode == 'edit')
     1370{
     1371        $s_hidden_fields .= build_hidden_fields(array(
     1372                'edit_post_message_checksum'    => $post_data['post_checksum'],
     1373                'edit_post_subject_checksum'    => $post_data['post_subject_md5'],
     1374        ));
     1375}
     1376
    12581377// Add the confirm id/code pair to the hidden fields, else an error is displayed on next submit/preview
    1259 if ($solved_captcha !== false)
    1260 {
    1261         $s_hidden_fields .= build_hidden_fields(array(
    1262                 'confirm_id'            => request_var('confirm_id', ''),
    1263                 'confirm_code'          => request_var('confirm_code', ''))
    1264         );
     1378if (isset($captcha) && $captcha->is_solved() !== false)
     1379{
     1380        $s_hidden_fields .= build_hidden_fields($captcha->get_hidden_fields());
    12651381}
    12661382
     
    12871403        'SMILIES_STATUS'                => ($smilies_status) ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'],
    12881404        'URL_STATUS'                    => ($bbcode_status && $url_status) ? $user->lang['URL_IS_ON'] : $user->lang['URL_IS_OFF'],
     1405        'MAX_FONT_SIZE'                 => (int) $config['max_post_font_size'],
    12891406        'MINI_POST_IMG'                 => $user->img('icon_post_target', $user->lang['POST']),
    12901407        'POST_DATE'                             => ($post_data['post_time']) ? $user->format_date($post_data['post_time']) : '',
     
    13031420        'S_DISPLAY_USERNAME'            => (!$user->data['is_registered'] || ($mode == 'edit' && $post_data['poster_id'] == ANONYMOUS)) ? true : false,
    13041421        'S_SHOW_TOPIC_ICONS'            => $s_topic_icons,
    1305         'S_DELETE_ALLOWED'                      => ($mode == 'edit' && (($post_id == $post_data['topic_last_post_id'] && $post_data['poster_id'] == $user->data['user_id'] && $auth->acl_get('f_delete', $forum_id) && !$post_data['post_edit_locked'] && ($post_data['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time'])) || $auth->acl_get('m_delete', $forum_id))) ? true : false,
     1422        'S_DELETE_ALLOWED'                      => ($mode == 'edit' && (($post_id == $post_data['topic_last_post_id'] && $post_data['poster_id'] == $user->data['user_id'] && $auth->acl_get('f_delete', $forum_id) && !$post_data['post_edit_locked'] && ($post_data['post_time'] > time() - ($config['delete_time'] * 60) || !$config['delete_time'])) || $auth->acl_get('m_delete', $forum_id))) ? true : false,
    13061423        'S_BBCODE_ALLOWED'                      => $bbcode_status,
    13071424        'S_BBCODE_CHECKED'                      => ($bbcode_checked) ? ' checked="checked"' : '',
     
    13411458        $template->assign_vars(array(
    13421459                'S_SHOW_POLL_BOX'               => true,
    1343                 'S_POLL_VOTE_CHANGE'    => ($auth->acl_get('f_votechg', $forum_id)),
     1460                'S_POLL_VOTE_CHANGE'    => ($auth->acl_get('f_votechg', $forum_id) && $auth->acl_get('f_vote', $forum_id)),
    13441461                'S_POLL_DELETE'                 => ($mode == 'edit' && sizeof($post_data['poll_options']) && ((!$post_data['poll_last_vote'] && $post_data['poster_id'] == $user->data['user_id'] && $auth->acl_get('f_delete', $forum_id)) || $auth->acl_get('m_delete', $forum_id))),
    13451462                'S_POLL_DELETE_CHECKED' => (!empty($poll_delete)) ? true : false,
     
    13621479
    13631480// Output page ...
    1364 page_header($page_title);
     1481page_header($page_title, false);
    13651482
    13661483$template->set_filenames(array(
     
    13901507        ($forum_style) ? $user->setup('posting', $forum_style) : $user->setup('posting');
    13911508
    1392         page_header($user->lang['PROGRESS_BAR']);
     1509        page_header($user->lang['PROGRESS_BAR'], false);
    13931510
    13941511        $template->set_filenames(array(
     
    14151532
    14161533        // If moderator removing post or user itself removing post, present a confirmation screen
    1417         if ($auth->acl_get('m_delete', $forum_id) || ($post_data['poster_id'] == $user->data['user_id'] && $user->data['is_registered'] && $auth->acl_get('f_delete', $forum_id) && $post_id == $post_data['topic_last_post_id'] && !$post_data['post_edit_locked'] && ($post_data['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time'])))
     1534        if ($auth->acl_get('m_delete', $forum_id) || ($post_data['poster_id'] == $user->data['user_id'] && $user->data['is_registered'] && $auth->acl_get('f_delete', $forum_id) && $post_id == $post_data['topic_last_post_id'] && !$post_data['post_edit_locked'] && ($post_data['post_time'] > time() - ($config['delete_time'] * 60) || !$config['delete_time'])))
    14181535        {
    14191536                $s_hidden_fields = build_hidden_fields(array(
     
    14391556
    14401557                        $next_post_id = delete_post($forum_id, $topic_id, $post_id, $data);
     1558                        $post_username = ($post_data['poster_id'] == ANONYMOUS && !empty($post_data['post_username'])) ? $post_data['post_username'] : $post_data['username'];
    14411559
    14421560                        if ($next_post_id === false)
    14431561                        {
    1444                                 add_log('mod', $forum_id, $topic_id, 'LOG_DELETE_TOPIC', $post_data['topic_title']);
     1562                                add_log('mod', $forum_id, $topic_id, 'LOG_DELETE_TOPIC', $post_data['topic_title'], $post_username);
    14451563
    14461564                                $meta_info = append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id");
     
    14491567                        else
    14501568                        {
    1451                                 add_log('mod', $forum_id, $topic_id, 'LOG_DELETE_POST', $post_data['post_subject']);
     1569                                add_log('mod', $forum_id, $topic_id, 'LOG_DELETE_POST', $post_data['post_subject'], $post_username);
    14521570
    14531571                                $meta_info = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;p=$next_post_id") . "#p$next_post_id";
Note: See TracChangeset for help on using the changeset viewer.