代碼: 選擇全部
#
#-----[ OPEN ]------------------------------------------
#
includes/functions_post.php
#
#-----[ FIND ]------------------------------------------
#
global $userdata, $user_ip;
#
#-----[ IN-LINE FIND ]------------------------------------------
#
$user_ip
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, $post_info
#
#-----[ FIND ]------------------------------------------
#
$meta = '<meta http-equiv="refresh" content="3;url=' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=" . $post_id) . '#' . $post_id . '">';
$message = $lang['Stored'] . '<br /><br />' . sprintf($lang['Click_view_message'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=" . $post_id) . '#' . $post_id . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_forum'], '<a href="' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">', '</a>');
#
#-----[ BEFORE, ADD ]------------------------------------------
#
if ($board_config['points_post'] && !$post_info['points_disabled'] && (($mode == 'newtopic') || ($mode == 'reply')) )
{
$points = abs(($mode == 'newtopic') ? $board_config['points_topic'] : $board_config['points_reply']);
if (($userdata['user_id'] != ANONYMOUS) && ($userdata['admin_allow_points']))
{
add_points($userdata['user_id'], $points);
}
}
#
#-----[ FIND ]------------------------------------------
#
if ($mode == 'delete' && $post_data['first_post'] && $post_data['last_post'])
{
$meta = '<meta http-equiv="refresh" content="3;url=' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . '=' . $forum_id) . '">';
$message = $lang['Deleted'];
}
else
{
$meta = '<meta http-equiv="refresh" content="3;url=' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . '=' . $topic_id) . '">';
$message = (($mode == 'poll_delete') ? $lang['Poll_delete'] : $lang['Deleted']) . '<br /><br />' . sprintf($lang['Click_return_topic'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">', '</a>');
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
if ($board_config['points_post'] && !$post_info['points_disabled'] && ($mode == 'delete' || $mode == 'poll_delete') )
{
if (($userdata['user_id'] == $post_data['first_post']) && (($userdata['user_id'] != ANONYMOUS) && ($userdata['admin_allow_points'])))
{
}
else if (($userdata['user_id'] != ANONYMOUS) && ($userdata['admin_allow_points']))
{
subtract_points($userdata['user_id'], $board_config['points_reply']);
}
}
if (($userdata['user_id'] == $post_data
和執行句\r
subtract_points($userdata['user_id'], $board_config['points_topic']);
都是以 $userdata 作爲對象的,但是如果是版主做刪除操作的話,這裡的$userdata代表的是版主id而非發帖人本人的id。因此造成上述的問題出現。於是在下對其稍微做了修正:
代碼: 選擇全部
打開 functions_post.php
找到\r
if ($board_config['points_post'] && !$post_info['points_disabled'] && ($mode == 'delete' || $mode == 'poll_delete') )
{
if (($userdata['user_id'] == $post_data['first_post']) && (($userdata['user_id'] != ANONYMOUS) && ($userdata['admin_allow_points'])))
{
}
else if (($userdata['user_id'] != ANONYMOUS) && ($userdata['admin_allow_points']))
{
subtract_points($userdata['user_id'], $board_config['points_reply']);
}
}
替換為\r
if ($mode == 'delete' && $board_config['points_post'] && !$post_info['points_disabled'])
{
$posterid = $post_data['poster_id'];
if (($posterid == $post_data['first_post']))
{
subtract_points($posterid, $board_config['points_topic']);
}
else
{
subtract_points($posterid, $board_config['points_reply']);
}
}
