|
From: FlorinCB <ory...@us...> - 2008-09-04 00:04:30
|
Update of /cvsroot/mxbb/core/includes/shared/phpbb3/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv10196 Modified Files: functions_posting.php Log Message: more replacements Index: functions_posting.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/shared/phpbb3/includes/functions_posting.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** functions_posting.php 4 Sep 2008 00:02:06 -0000 1.4 --- functions_posting.php 4 Sep 2008 00:04:27 -0000 1.5 *************** *** 23,27 **** function generate_smilies($mode, $forum_id) { ! global $phpbb_auth, $db, $user, $config, $template; global $phpEx, $phpbb_root_path; --- 23,27 ---- function generate_smilies($mode, $forum_id) { ! global $phpbb_auth, $db, $mx_user, $config, $template; global $phpEx, $phpbb_root_path; *************** *** 37,48 **** $db->sql_freeresult($result); ! $user->setup('posting', (int) $row['forum_style']); } else { ! $user->setup('posting'); } ! page_header($user->lang['SMILIES']); $template->set_filenames(array( --- 37,48 ---- $db->sql_freeresult($result); ! $mx_user->setup('posting', (int) $row['forum_style']); } else { ! $mx_user->setup('posting'); } ! page_header($mx_user->lang['SMILIES']); $template->set_filenames(array( *************** *** 248,255 **** function posting_gen_topic_icons($mode, $icon_id) { ! global $phpbb_root_path, $config, $template, $cache; // Grab icons ! $icons = $cache->obtain_icons(); if (!$icon_id) --- 248,255 ---- function posting_gen_topic_icons($mode, $icon_id) { ! global $phpbb_root_path, $config, $template, $mx_cache; // Grab icons ! $icons = $mx_cache->obtain_icons(); if (!$icon_id) *************** *** 287,291 **** function posting_gen_topic_types($forum_id, $cur_topic_type = POST_NORMAL) { ! global $phpbb_auth, $user, $template, $topic_type; $toggle = false; --- 287,291 ---- function posting_gen_topic_types($forum_id, $cur_topic_type = POST_NORMAL) { ! global $phpbb_auth, $mx_user, $template, $topic_type; $toggle = false; *************** *** 311,315 **** 'VALUE' => $topic_value['const'], 'S_CHECKED' => ($cur_topic_type == $topic_value['const'] || ($forum_id == 0 && $topic_value['const'] == POST_GLOBAL)) ? ' checked="checked"' : '', ! 'L_TOPIC_TYPE' => $user->lang[$topic_value['lang']] ); } --- 311,315 ---- 'VALUE' => $topic_value['const'], 'S_CHECKED' => ($cur_topic_type == $topic_value['const'] || ($forum_id == 0 && $topic_value['const'] == POST_GLOBAL)) ? ' checked="checked"' : '', ! 'L_TOPIC_TYPE' => $mx_user->lang[$topic_value['lang']] ); } *************** *** 321,325 **** 'VALUE' => POST_NORMAL, 'S_CHECKED' => ($topic_type == POST_NORMAL) ? ' checked="checked"' : '', ! 'L_TOPIC_TYPE' => $user->lang['POST_NORMAL'])), $topic_type_array --- 321,325 ---- 'VALUE' => POST_NORMAL, 'S_CHECKED' => ($topic_type == POST_NORMAL) ? ' checked="checked"' : '', ! 'L_TOPIC_TYPE' => $mx_user->lang['POST_NORMAL'])), $topic_type_array *************** *** 350,354 **** function upload_attachment($form_name, $forum_id, $local = false, $local_storage = '', $is_message = false, $local_filedata = false) { ! global $phpbb_auth, $user, $config, $db, $cache; global $phpbb_root_path, $phpEx; --- 350,354 ---- function upload_attachment($form_name, $forum_id, $local = false, $local_storage = '', $is_message = false, $local_filedata = false) { ! global $phpbb_auth, $mx_user, $config, $db, $mx_cache; global $phpbb_root_path, $phpEx; *************** *** 371,379 **** if (!$filedata['post_attach']) { ! $filedata['error'][] = $user->lang['NO_UPLOAD_FORM_FOUND']; return $filedata; } ! $extensions = $cache->obtain_attach_extensions((($is_message) ? false : (int) $forum_id)); $upload->set_allowed_extensions(array_keys($extensions['_allowed_'])); --- 371,379 ---- if (!$filedata['post_attach']) { ! $filedata['error'][] = $mx_user->lang['NO_UPLOAD_FORM_FOUND']; return $filedata; } ! $extensions = $mx_cache->obtain_attach_extensions((($is_message) ? false : (int) $forum_id)); $upload->set_allowed_extensions(array_keys($extensions['_allowed_'])); *************** *** 395,399 **** // If this error occurs a user tried to exploit an IE Bug by renaming extensions // Since the image category is displaying content inline we need to catch this. ! trigger_error($user->lang['ATTACHED_IMAGE_NOT_IMAGE']); } --- 395,399 ---- // If this error occurs a user tried to exploit an IE Bug by renaming extensions // Since the image category is displaying content inline we need to catch this. ! trigger_error($mx_user->lang['ATTACHED_IMAGE_NOT_IMAGE']); } *************** *** 422,426 **** } ! $file->clean_filename('unique', $user->data['user_id'] . '_'); // Are we uploading an image *and* this image being within the image category? Only then perform additional image checks. --- 422,426 ---- } ! $file->clean_filename('unique', $mx_user->data['user_id'] . '_'); // Are we uploading an image *and* this image being within the image category? Only then perform additional image checks. *************** *** 450,454 **** if ($config['upload_dir_size'] + $file->get('filesize') > $config['attachment_quota']) { ! $filedata['error'][] = $user->lang['ATTACH_QUOTA_REACHED']; $filedata['post_attach'] = false; --- 450,454 ---- if ($config['upload_dir_size'] + $file->get('filesize') > $config['attachment_quota']) { ! $filedata['error'][] = $mx_user->lang['ATTACH_QUOTA_REACHED']; $filedata['post_attach'] = false; *************** *** 464,468 **** if ($free_space <= $file->get('filesize')) { ! $filedata['error'][] = $user->lang['ATTACH_QUOTA_REACHED']; $filedata['post_attach'] = false; --- 464,468 ---- if ($free_space <= $file->get('filesize')) { ! $filedata['error'][] = $mx_user->lang['ATTACH_QUOTA_REACHED']; $filedata['post_attach'] = false; *************** *** 759,763 **** function posting_gen_attachment_entry($attachment_data, &$filename_data) { ! global $template, $config, $phpbb_root_path, $phpEx, $user; $template->assign_vars(array( --- 759,763 ---- function posting_gen_attachment_entry($attachment_data, &$filename_data) { ! global $template, $config, $phpbb_root_path, $phpEx, $mx_user; $template->assign_vars(array( *************** *** 784,788 **** } ! $download_link = append_sid("{$phpbb_root_path}download/file.$phpEx", 'mode=view&id=' . (int) $attach_row['attach_id'], true, ($attach_row['is_orphan']) ? $user->session_id : false); $template->assign_block_vars('attach_row', array( --- 784,788 ---- } ! $download_link = append_sid("{$phpbb_root_path}download/file.$phpEx", 'mode=view&id=' . (int) $attach_row['attach_id'], true, ($attach_row['is_orphan']) ? $mx_user->session_id : false); $template->assign_block_vars('attach_row', array( *************** *** 817,821 **** function load_drafts($topic_id = 0, $forum_id = 0, $id = 0) { ! global $user, $db, $template, $phpbb_auth; global $phpbb_root_path, $phpEx; --- 817,821 ---- function load_drafts($topic_id = 0, $forum_id = 0, $id = 0) { ! global $mx_user, $db, $template, $phpbb_auth; global $phpbb_root_path, $phpEx; *************** *** 838,842 **** FROM ' . DRAFTS_TABLE . ' d LEFT JOIN ' . FORUMS_TABLE . ' f ON (f.forum_id = d.forum_id) ! WHERE d.user_id = ' . $user->data['user_id'] . " $sql_and ORDER BY d.save_time DESC"; --- 838,842 ---- FROM ' . DRAFTS_TABLE . ' d LEFT JOIN ' . FORUMS_TABLE . ' f ON (f.forum_id = d.forum_id) ! WHERE d.user_id = ' . $mx_user->data['user_id'] . " $sql_and ORDER BY d.save_time DESC"; *************** *** 913,917 **** $template->assign_block_vars('draftrow', array( 'DRAFT_ID' => $draft['draft_id'], ! 'DATE' => $user->format_date($draft['save_time']), 'DRAFT_SUBJECT' => $draft['draft_subject'], --- 913,917 ---- $template->assign_block_vars('draftrow', array( 'DRAFT_ID' => $draft['draft_id'], ! 'DATE' => $mx_user->format_date($draft['save_time']), 'DRAFT_SUBJECT' => $draft['draft_subject'], *************** *** 932,936 **** function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id = 0, $show_quote_button = true) { ! global $user, $phpbb_auth, $db, $template, $bbcode, $cache; global $config, $phpbb_root_path, $phpEx; --- 932,936 ---- function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id = 0, $show_quote_button = true) { ! global $mx_user, $phpbb_auth, $db, $template, $bbcode, $mx_cache; global $config, $phpbb_root_path, $phpEx; *************** *** 999,1003 **** if ($has_attachments && $phpbb_auth->acl_get('u_download') && $phpbb_auth->acl_get('f_download', $forum_id)) { ! $extensions = $cache->obtain_attach_extensions($forum_id); // Get attachments... --- 999,1003 ---- if ($has_attachments && $phpbb_auth->acl_get('u_download') && $phpbb_auth->acl_get('f_download', $forum_id)) { ! $extensions = $mx_cache->obtain_attach_extensions($forum_id); // Get attachments... *************** *** 1068,1078 **** 'POST_SUBJECT' => $post_subject, ! 'MINI_POST_IMG' => $user->img('icon_post_target', $user->lang['POST']), ! 'POST_DATE' => $user->format_date($row['post_time']), 'MESSAGE' => $message, 'DECODED_MESSAGE' => $decoded_message, 'POST_ID' => $row['post_id'], 'U_MINI_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'p=' . $row['post_id']) . '#p' . $row['post_id'], ! 'U_MCP_DETAILS' => ($phpbb_auth->acl_get('m_info', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=post_details&f=' . $forum_id . '&p=' . $row['post_id'], true, $user->session_id) : '', 'POSTER_QUOTE' => ($show_quote_button && $phpbb_auth->acl_get('f_reply', $forum_id)) ? addslashes(get_username_string('username', $poster_id, $row['username'], $row['user_colour'], $row['post_username'])) : '') ); --- 1068,1078 ---- 'POST_SUBJECT' => $post_subject, ! 'MINI_POST_IMG' => $mx_user->img('icon_post_target', $mx_user->lang['POST']), ! 'POST_DATE' => $mx_user->format_date($row['post_time']), 'MESSAGE' => $message, 'DECODED_MESSAGE' => $decoded_message, 'POST_ID' => $row['post_id'], 'U_MINI_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'p=' . $row['post_id']) . '#p' . $row['post_id'], ! 'U_MCP_DETAILS' => ($phpbb_auth->acl_get('m_info', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=post_details&f=' . $forum_id . '&p=' . $row['post_id'], true, $mx_user->session_id) : '', 'POSTER_QUOTE' => ($show_quote_button && $phpbb_auth->acl_get('f_reply', $forum_id)) ? addslashes(get_username_string('username', $poster_id, $row['username'], $row['user_colour'], $row['post_username'])) : '') ); *************** *** 1094,1098 **** if ($mode == 'topic_review') { ! $template->assign_var('QUOTE_IMG', $user->img('icon_post_quote', $user->lang['REPLY_WITH_QUOTE'])); } --- 1094,1098 ---- if ($mode == 'topic_review') { ! $template->assign_var('QUOTE_IMG', $mx_user->img('icon_post_quote', $mx_user->lang['REPLY_WITH_QUOTE'])); } *************** *** 1105,1109 **** function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id, $topic_id, $post_id) { ! global $db, $user, $config, $phpbb_root_path, $phpEx, $phpbb_auth; $topic_notification = ($mode == 'reply' || $mode == 'quote') ? true : false; --- 1105,1109 ---- function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id, $topic_id, $post_id) { ! global $db, $mx_user, $config, $phpbb_root_path, $phpEx, $phpbb_auth; $topic_notification = ($mode == 'reply' || $mode == 'quote') ? true : false; *************** *** 1128,1132 **** $result = $db->sql_query($sql); ! $sql_ignore_users = ANONYMOUS . ', ' . $user->data['user_id']; while ($row = $db->sql_fetchrow($result)) { --- 1128,1132 ---- $result = $db->sql_query($sql); ! $sql_ignore_users = ANONYMOUS . ', ' . $mx_user->data['user_id']; while ($row = $db->sql_fetchrow($result)) { *************** *** 1208,1216 **** foreach ($phpbb_auth->acl_get_list(array_keys($notify_rows), 'f_read', $forum_id) as $forum_id => $forum_ary) { ! foreach ($forum_ary as $phpbb_auth_option => $user_ary) { ! foreach ($user_ary as $user_id) { ! $notify_rows[$user_id]['allowed'] = true; } } --- 1208,1216 ---- foreach ($phpbb_auth->acl_get_list(array_keys($notify_rows), 'f_read', $forum_id) as $forum_id => $forum_ary) { ! foreach ($forum_ary as $phpbb_auth_option => $mx_user_ary) { ! foreach ($mx_user_ary as $mx_user_id) { ! $notify_rows[$mx_user_id]['allowed'] = true; } } *************** *** 1220,1224 **** // Now, we have to do a little step before really sending, we need to distinguish our users a little bit. ;) $msg_users = $delete_ids = $update_notification = array(); ! foreach ($notify_rows as $user_id => $row) { if (!$row['allowed'] || !trim($row['user_email'])) --- 1220,1224 ---- // Now, we have to do a little step before really sending, we need to distinguish our users a little bit. ;) $msg_users = $delete_ids = $update_notification = array(); ! foreach ($notify_rows as $mx_user_id => $row) { if (!$row['allowed'] || !trim($row['user_email'])) *************** *** 1332,1336 **** function delete_post($forum_id, $topic_id, $post_id, &$data) { ! global $db, $user, $phpbb_auth; global $config, $phpEx, $phpbb_root_path; --- 1332,1336 ---- function delete_post($forum_id, $topic_id, $post_id, &$data) { ! global $db, $mx_user, $phpbb_auth; global $config, $phpEx, $phpbb_root_path; *************** *** 1540,1546 **** * Submit Post */ ! function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $update_message = true) { ! global $db, $phpbb_auth, $user, $config, $phpEx, $template, $phpbb_root_path; // We do not handle erasing posts here --- 1540,1546 ---- * Submit Post */ ! function submit_post($mode, $subject, $mx_username, $topic_type, &$poll, &$data, $update_message = true) { ! global $db, $phpbb_auth, $mx_user, $config, $phpEx, $template, $phpbb_root_path; // We do not handle erasing posts here *************** *** 1574,1578 **** // Collect some basic information about which tables and which rows to update/insert $sql_data = $topic_row = array(); ! $poster_id = ($mode == 'edit') ? $data['poster_id'] : (int) $user->data['user_id']; // Retrieve some additional information if not present --- 1574,1578 ---- // Collect some basic information about which tables and which rows to update/insert $sql_data = $topic_row = array(); ! $poster_id = ($mode == 'edit') ? $data['poster_id'] : (int) $mx_user->data['user_id']; // Retrieve some additional information if not present *************** *** 1602,1608 **** $sql_data[POSTS_TABLE]['sql'] = array( 'forum_id' => ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id'], ! 'poster_id' => (int) $user->data['user_id'], 'icon_id' => $data['icon_id'], ! 'poster_ip' => $user->ip, 'post_time' => $current_time, 'post_approved' => (!$phpbb_auth->acl_get('f_noapprove', $data['forum_id']) && !$phpbb_auth->acl_get('m_approve', $data['forum_id'])) ? 0 : 1, --- 1602,1608 ---- $sql_data[POSTS_TABLE]['sql'] = array( 'forum_id' => ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id'], ! 'poster_id' => (int) $mx_user->data['user_id'], 'icon_id' => $data['icon_id'], ! 'poster_ip' => $mx_user->ip, 'post_time' => $current_time, 'post_approved' => (!$phpbb_auth->acl_get('f_noapprove', $data['forum_id']) && !$phpbb_auth->acl_get('m_approve', $data['forum_id'])) ? 0 : 1, *************** *** 1611,1615 **** 'enable_magic_url' => $data['enable_urls'], 'enable_sig' => $data['enable_sig'], ! 'post_username' => (!$user->data['is_registered']) ? $username : '', 'post_subject' => $subject, 'post_text' => $data['message'], --- 1611,1615 ---- 'enable_magic_url' => $data['enable_urls'], 'enable_sig' => $data['enable_sig'], ! 'post_username' => (!$mx_user->data['is_registered']) ? $mx_username : '', 'post_subject' => $subject, 'post_text' => $data['message'], *************** *** 1649,1656 **** // If the person editing this post is different to the one having posted then we will add a log entry stating the edit // Could be simplified by only adding to the log if the edit is not tracked - but this may confuse admins/mods ! if ($user->data['user_id'] != $poster_id) { $log_subject = ($subject) ? $subject : $data['topic_title']; ! add_log('mod', $data['forum_id'], $data['topic_id'], 'LOG_POST_EDITED', $log_subject, (!empty($username)) ? $username : $user->lang['GUEST']); } --- 1649,1656 ---- // If the person editing this post is different to the one having posted then we will add a log entry stating the edit // Could be simplified by only adding to the log if the edit is not tracked - but this may confuse admins/mods ! if ($mx_user->data['user_id'] != $poster_id) { $log_subject = ($subject) ? $subject : $data['topic_title']; ! add_log('mod', $data['forum_id'], $data['topic_id'], 'LOG_POST_EDITED', $log_subject, (!empty($mx_username)) ? $mx_username : $mx_user->lang['GUEST']); } *************** *** 1669,1673 **** 'enable_magic_url' => $data['enable_urls'], 'enable_sig' => $data['enable_sig'], ! 'post_username' => ($username && $data['poster_id'] == ANONYMOUS) ? $username : '', 'post_subject' => $subject, 'post_checksum' => $data['message_md5'], --- 1669,1673 ---- 'enable_magic_url' => $data['enable_urls'], 'enable_sig' => $data['enable_sig'], ! 'post_username' => ($mx_username && $data['poster_id'] == ANONYMOUS) ? $mx_username : '', 'post_subject' => $subject, 'post_checksum' => $data['message_md5'], *************** *** 1694,1698 **** case 'post': $sql_data[TOPICS_TABLE]['sql'] = array( ! 'topic_poster' => (int) $user->data['user_id'], 'topic_time' => $current_time, 'forum_id' => ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id'], --- 1694,1698 ---- case 'post': $sql_data[TOPICS_TABLE]['sql'] = array( ! 'topic_poster' => (int) $mx_user->data['user_id'], 'topic_time' => $current_time, 'forum_id' => ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id'], *************** *** 1700,1705 **** 'topic_approved' => (!$phpbb_auth->acl_get('f_noapprove', $data['forum_id']) && !$phpbb_auth->acl_get('m_approve', $data['forum_id'])) ? 0 : 1, 'topic_title' => $subject, ! 'topic_first_poster_name' => (!$user->data['is_registered'] && $username) ? $username : (($user->data['user_id'] != ANONYMOUS) ? $user->data['username'] : ''), ! 'topic_first_poster_colour' => $user->data['user_colour'], 'topic_type' => $topic_type, 'topic_time_limit' => ($topic_type == POST_STICKY || $topic_type == POST_ANNOUNCE) ? ($data['topic_time_limit'] * 86400) : 0, --- 1700,1705 ---- 'topic_approved' => (!$phpbb_auth->acl_get('f_noapprove', $data['forum_id']) && !$phpbb_auth->acl_get('m_approve', $data['forum_id'])) ? 0 : 1, 'topic_title' => $subject, ! 'topic_first_poster_name' => (!$mx_user->data['is_registered'] && $mx_username) ? $mx_username : (($mx_user->data['user_id'] != ANONYMOUS) ? $mx_user->data['username'] : ''), ! 'topic_first_poster_colour' => $mx_user->data['user_colour'], 'topic_type' => $topic_type, 'topic_time_limit' => ($topic_type == POST_STICKY || $topic_type == POST_ANNOUNCE) ? ($data['topic_time_limit'] * 86400) : 0, *************** *** 1749,1753 **** 'topic_approved' => (!$phpbb_auth->acl_get('f_noapprove', $data['forum_id']) && !$phpbb_auth->acl_get('m_approve', $data['forum_id'])) ? 0 : $data['topic_approved'], 'topic_title' => $subject, ! 'topic_first_poster_name' => $username, 'topic_type' => $topic_type, 'topic_time_limit' => ($topic_type == POST_STICKY || $topic_type == POST_ANNOUNCE) ? ($data['topic_time_limit'] * 86400) : 0, --- 1749,1753 ---- 'topic_approved' => (!$phpbb_auth->acl_get('f_noapprove', $data['forum_id']) && !$phpbb_auth->acl_get('m_approve', $data['forum_id'])) ? 0 : $data['topic_approved'], 'topic_title' => $subject, ! 'topic_first_poster_name' => $mx_username, 'topic_type' => $topic_type, 'topic_time_limit' => ($topic_type == POST_STICKY || $topic_type == POST_ANNOUNCE) ? ($data['topic_time_limit'] * 86400) : 0, *************** *** 1838,1844 **** 'topic_last_post_id' => $data['post_id'], 'topic_last_post_time' => $current_time, ! 'topic_last_poster_id' => (int) $user->data['user_id'], ! 'topic_last_poster_name' => (!$user->data['is_registered'] && $username) ? $username : (($user->data['user_id'] != ANONYMOUS) ? $user->data['username'] : ''), ! 'topic_last_poster_colour' => $user->data['user_colour'], ); } --- 1838,1844 ---- 'topic_last_post_id' => $data['post_id'], 'topic_last_post_time' => $current_time, ! 'topic_last_poster_id' => (int) $mx_user->data['user_id'], ! 'topic_last_poster_name' => (!$mx_user->data['is_registered'] && $mx_username) ? $mx_username : (($mx_user->data['user_id'] != ANONYMOUS) ? $mx_user->data['username'] : ''), ! 'topic_last_poster_colour' => $mx_user->data['user_colour'], ); } *************** *** 2001,2005 **** WHERE ' . $db->sql_in_set('attach_id', array_keys($orphan_rows)) . ' AND is_orphan = 1 ! AND poster_id = ' . $user->data['user_id']; $result = $db->sql_query($sql); --- 2001,2005 ---- WHERE ' . $db->sql_in_set('attach_id', array_keys($orphan_rows)) . ' AND is_orphan = 1 ! AND poster_id = ' . $mx_user->data['user_id']; $result = $db->sql_query($sql); *************** *** 2050,2054 **** WHERE attach_id = ' . $attach_row['attach_id'] . ' AND is_orphan = 1 ! AND poster_id = ' . $user->data['user_id']; $db->sql_query($sql); } --- 2050,2054 ---- WHERE attach_id = ' . $attach_row['attach_id'] . ' AND is_orphan = 1 ! AND poster_id = ' . $mx_user->data['user_id']; $db->sql_query($sql); } *************** *** 2078,2084 **** $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_post_subject = '" . $db->sql_escape($subject) . "'"; $sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_post_time = ' . $current_time; ! $sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_poster_id = ' . (int) $user->data['user_id']; ! $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_poster_name = '" . $db->sql_escape((!$user->data['is_registered'] && $username) ? $username : (($user->data['user_id'] != ANONYMOUS) ? $user->data['username'] : '')) . "'"; ! $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_poster_colour = '" . $db->sql_escape($user->data['user_colour']) . "'"; } else if ($post_mode == 'edit_last_post' || $post_mode == 'edit_topic' || ($post_mode == 'edit_first_post' && !$data['topic_replies'])) --- 2078,2084 ---- $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_post_subject = '" . $db->sql_escape($subject) . "'"; $sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_post_time = ' . $current_time; ! $sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_poster_id = ' . (int) $mx_user->data['user_id']; ! $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_poster_name = '" . $db->sql_escape((!$mx_user->data['is_registered'] && $mx_username) ? $mx_username : (($mx_user->data['user_id'] != ANONYMOUS) ? $mx_user->data['username'] : '')) . "'"; ! $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_poster_colour = '" . $db->sql_escape($mx_user->data['user_colour']) . "'"; } else if ($post_mode == 'edit_last_post' || $post_mode == 'edit_topic' || ($post_mode == 'edit_first_post' && !$data['topic_replies'])) *************** *** 2226,2232 **** { $sql_data[TOPICS_TABLE]['stat'][] = 'topic_last_post_id = ' . (int) $data['post_id']; ! $sql_data[TOPICS_TABLE]['stat'][] = 'topic_last_poster_id = ' . (int) $user->data['user_id']; ! $sql_data[TOPICS_TABLE]['stat'][] = "topic_last_poster_name = '" . $db->sql_escape((!$user->data['is_registered'] && $username) ? $username : (($user->data['user_id'] != ANONYMOUS) ? $user->data['username'] : '')) . "'"; ! $sql_data[TOPICS_TABLE]['stat'][] = "topic_last_poster_colour = '" . (($user->data['user_id'] != ANONYMOUS) ? $db->sql_escape($user->data['user_colour']) : '') . "'"; $sql_data[TOPICS_TABLE]['stat'][] = "topic_last_post_subject = '" . $db->sql_escape($subject) . "'"; $sql_data[TOPICS_TABLE]['stat'][] = 'topic_last_post_time = ' . (int) $current_time; --- 2226,2232 ---- { $sql_data[TOPICS_TABLE]['stat'][] = 'topic_last_post_id = ' . (int) $data['post_id']; ! $sql_data[TOPICS_TABLE]['stat'][] = 'topic_last_poster_id = ' . (int) $mx_user->data['user_id']; ! $sql_data[TOPICS_TABLE]['stat'][] = "topic_last_poster_name = '" . $db->sql_escape((!$mx_user->data['is_registered'] && $mx_username) ? $mx_username : (($mx_user->data['user_id'] != ANONYMOUS) ? $mx_user->data['username'] : '')) . "'"; ! $sql_data[TOPICS_TABLE]['stat'][] = "topic_last_poster_colour = '" . (($mx_user->data['user_id'] != ANONYMOUS) ? $db->sql_escape($mx_user->data['user_colour']) : '') . "'"; $sql_data[TOPICS_TABLE]['stat'][] = "topic_last_post_subject = '" . $db->sql_escape($subject) . "'"; $sql_data[TOPICS_TABLE]['stat'][] = 'topic_last_post_time = ' . (int) $current_time; *************** *** 2286,2290 **** // Update forum stats ! $where_sql = array(POSTS_TABLE => 'post_id = ' . $data['post_id'], TOPICS_TABLE => 'topic_id = ' . $data['topic_id'], FORUMS_TABLE => 'forum_id = ' . $data['forum_id'], USERS_TABLE => 'user_id = ' . $user->data['user_id']); foreach ($sql_data as $table => $update_ary) --- 2286,2290 ---- // Update forum stats ! $where_sql = array(POSTS_TABLE => 'post_id = ' . $data['post_id'], TOPICS_TABLE => 'topic_id = ' . $data['topic_id'], FORUMS_TABLE => 'forum_id = ' . $data['forum_id'], USERS_TABLE => 'user_id = ' . $mx_user->data['user_id']); foreach ($sql_data as $table => $update_ary) *************** *** 2314,2318 **** $sql = 'DELETE FROM ' . DRAFTS_TABLE . " WHERE draft_id = $draft_id ! AND user_id = {$user->data['user_id']}"; $db->sql_query($sql); } --- 2314,2318 ---- $sql = 'DELETE FROM ' . DRAFTS_TABLE . " WHERE draft_id = $draft_id ! AND user_id = {$mx_user->data['user_id']}"; $db->sql_query($sql); } *************** *** 2346,2355 **** // Topic Notification, do not change if moderator is changing other users posts... ! if ($user->data['user_id'] == $poster_id) { if (!$data['notify_set'] && $data['notify']) { $sql = 'INSERT INTO ' . TOPICS_WATCH_TABLE . ' (user_id, topic_id) ! VALUES (' . $user->data['user_id'] . ', ' . $data['topic_id'] . ')'; $db->sql_query($sql); } --- 2346,2355 ---- // Topic Notification, do not change if moderator is changing other users posts... ! if ($mx_user->data['user_id'] == $poster_id) { if (!$data['notify_set'] && $data['notify']) { $sql = 'INSERT INTO ' . TOPICS_WATCH_TABLE . ' (user_id, topic_id) ! VALUES (' . $mx_user->data['user_id'] . ', ' . $data['topic_id'] . ')'; $db->sql_query($sql); } *************** *** 2357,2361 **** { $sql = 'DELETE FROM ' . TOPICS_WATCH_TABLE . ' ! WHERE user_id = ' . $user->data['user_id'] . ' AND topic_id = ' . $data['topic_id']; $db->sql_query($sql); --- 2357,2361 ---- { $sql = 'DELETE FROM ' . TOPICS_WATCH_TABLE . ' ! WHERE user_id = ' . $mx_user->data['user_id'] . ' AND topic_id = ' . $data['topic_id']; $db->sql_query($sql); *************** *** 2374,2382 **** // ! if ($config['load_db_lastread'] && $user->data['is_registered']) { $sql = 'SELECT mark_time FROM ' . FORUMS_TRACK_TABLE . ' ! WHERE user_id = ' . $user->data['user_id'] . ' AND forum_id = ' . $data['forum_id']; $result = $db->sql_query($sql); --- 2374,2382 ---- // ! if ($config['load_db_lastread'] && $mx_user->data['is_registered']) { $sql = 'SELECT mark_time FROM ' . FORUMS_TRACK_TABLE . ' ! WHERE user_id = ' . $mx_user->data['user_id'] . ' AND forum_id = ' . $data['forum_id']; $result = $db->sql_query($sql); *************** *** 2384,2393 **** $db->sql_freeresult($result); } ! else if ($config['load_anon_lastread'] || $user->data['is_registered']) { $f_mark_time = false; } ! if (($config['load_db_lastread'] && $user->data['is_registered']) || $config['load_anon_lastread'] || $user->data['is_registered']) { // Update forum info --- 2384,2393 ---- $db->sql_freeresult($result); } ! else if ($config['load_anon_lastread'] || $mx_user->data['is_registered']) { $f_mark_time = false; } ! if (($config['load_db_lastread'] && $mx_user->data['is_registered']) || $config['load_anon_lastread'] || $mx_user->data['is_registered']) { // Update forum info |