Добавлено спустя 14 секунд:

Код: Выделить всё
if ( ( time() - $karma_time > $board_config['time_between_karma'] * 3600 ) || ( ( $board_config['admin_karma'] == 1 ) && ( $userdata['user_level'] == ADMIN ) ) )
{
$sql = ( $HTTP_GET_VARS['k'] == 'p' ) ? "UPDATE " . USERS_TABLE . " SET karma_plus = karma_plus + 1 WHERE user_id = '" . intval($HTTP_GET_VARS[POST_USERS_URL]) . "'" : "UPDATE " . USERS_TABLE . " SET karma_minus = karma_minus + 1 WHERE user_id = '" . intval($HTTP_GET_VARS[POST_USERS_URL]) . "'" ;
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not update user karma', '', __LINE__, __FILE__, $sql);
}
$db->sql_freeresult($result);
Код: Выделить всё
#
#-----[ COPY ]------------------------------------------
#
templates/subSilver/images/icon_plus.gif to forum_root/templates/subSilver/images/icon_plus.gif
templates/subSilver/images/icon_minus.gif to forum_root/templates/subSilver/images/icon_plus.gif
Код: Выделить всё
#
#-----[ COPY ]------------------------------------------
#
copy templates/subSilver/images/icon_plus.gif to templates/subSilver/images/icon_plus.gif
copy templates/subSilver/images/icon_minus.gif to templates/subSilver/images/icon_plus.gif
Код: Выделить всё
$lang['Lag_Karmer'] = 'Lag the person who gives karma points';
$lang['Lag_Karmer_explain'] = 'Give time lag to a person who gives karma points. If set to no the person who receives the points will be lagged';
меня в свое время кто-то просил, поэтому сделал, есть и есть, от этого ни тепло, ни холодно...галочку он офф наверно сделаюDanZer писал(а):Попутно вопрос - зачем вот это надо? Имхо, тоже штука бесполезная.
Код:
$lang['Lag_Karmer'] = 'Lag the person who gives karma points';
$lang['Lag_Karmer_explain'] = 'Give time lag to a person who gives karma points. If set to no the person who receives the points will be lagged';
Код: Выделить всё
//
// Advanced Karma Mod
//
if ( $userdata['session_logged_in'] && isset($HTTP_GET_VARS['k']) && isset($HTTP_GET_VARS[POST_USERS_URL]) )
{
if ( $HTTP_GET_VARS['k'] == 'p' || $HTTP_GET_VARS['k'] == 'm' )
{
if ( $userdata['user_posts'] >= $board_config['min_post_karma'] || ( $board_config['admin_karma'] == 1 && $userdata['user_level'] == ADMIN ) )
{
$karma_time = $userdata['karma_time'];
if ( $board_config['lag_karmer'] == 0 )
{
$sql = "SELECT karma_time FROM " . USERS_TABLE . " WHERE user_id = '" . intval($HTTP_GET_VARS[POST_USERS_URL]) . "'";
if ($result = $db->sql_query($sql))
{
while ($row = $db->sql_fetchrow($result))
{
$db->sql_freeresult($result);
$karma_time = $row['karma_time'];
}
}
$db->sql_freeresult($result);
}
if ( ( time() - $karma_time > $board_config['time_between_karma'] * 3600 ) || ( ( $board_config['admin_karma'] == 1 ) && ( $userdata['user_level'] == ADMIN ) ) )
{
$sql = ( $HTTP_GET_VARS['k'] == 'p' ) ? "UPDATE " . USERS_TABLE . " SET karma_plus = karma_plus + 1 WHERE user_id = '" . intval($HTTP_GET_VARS[POST_USERS_URL]) . "'" : "UPDATE " . USERS_TABLE . " SET karma_minus = karma_minus + 1 WHERE user_id = '" . intval($HTTP_GET_VARS[POST_USERS_URL]) . "'" ;
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not update user karma', '', __LINE__, __FILE__, $sql);
}
$db->sql_freeresult($result);
$sql = ( $board_config['lag_karmer'] == 1 ) ? "UPDATE " . USERS_TABLE . " SET karma_time = '" . time() . "' WHERE user_id = '" . $userdata['user_id'] . "'" : "UPDATE " . USERS_TABLE . " SET karma_time = '" . time() . "' WHERE user_id = '" . intval($HTTP_GET_VARS[POST_USERS_URL]) . "'";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not update user karma time', '', __LINE__, __FILE__, $sql);
}
$db->sql_freeresult($result);
$temp_url = append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=" . $HTTP_GET_VARS[POST_POST_URL] . "&start=" . $start) . "#" . $HTTP_GET_VARS[POST_POST_URL];
header("Location: " . $temp_url);
}
}
}
}
Код: Выделить всё
//
// Advanced Karma Mod
//
if ( $userdata['session_logged_in'] && isset($HTTP_GET_VARS['k']) && isset($HTTP_GET_VARS[POST_USERS_URL]) )
{
if ( $HTTP_GET_VARS['k'] == 'p' || $HTTP_GET_VARS['k'] == 'm' )
{
if ( $userdata['user_posts'] >= $board_config['min_post_karma'] || ( $board_config['admin_karma'] == 1 && $userdata['user_level'] == ADMIN ) )
{
$karma_time = $userdata['karma_time'];
if ( $board_config['lag_karmer'] == 0 )
{
$sql = "SELECT karma_time FROM " . USERS_TABLE . " WHERE user_id = '" . intval($HTTP_GET_VARS[POST_USERS_URL]) . "'";
if ($result = $db->sql_query($sql))
{
while ($row = $db->sql_fetchrow($result))
{
$db->sql_freeresult($result);
$karma_time = $row['karma_time'];
}
}
$db->sql_freeresult($result);
}
if ( ( time() - $karma_time > $board_config['time_between_karma'] * 3600 ) || ( ( $board_config['admin_karma'] == 1 ) && ( $userdata['user_level'] == ADMIN ) ) )
{
$sql = ( $HTTP_GET_VARS['k'] == 'p' ) ? "UPDATE " . USERS_TABLE . " SET karma_plus = karma_plus + 1 WHERE user_id = '" . intval($HTTP_GET_VARS[POST_USERS_URL]) . "'" : "UPDATE " . USERS_TABLE . " SET karma_minus = karma_minus + 1 WHERE user_id = '" . intval($HTTP_GET_VARS[POST_USERS_URL]) . "'" ;
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not update user karma', '', __LINE__, __FILE__, $sql);
}
$sql = ( $board_config['lag_karmer'] == 1 ) ? "UPDATE " . USERS_TABLE . " SET karma_time = '" . time() . "' WHERE user_id = '" . $userdata['user_id'] . "'" : "UPDATE " . USERS_TABLE . " SET karma_time = '" . time() . "' WHERE user_id = '" . intval($HTTP_GET_VARS[POST_USERS_URL]) . "'";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not update user karma time', '', __LINE__, __FILE__, $sql);
}
$temp_url = append_sid("viewtopic.$phpEx?t=" . $topic_id . "&start=" . $start . '#' . $post_id);
header("Location: " . $temp_url);
}
}
}
}
Код: Выделить всё
$temp_url = append_sid("viewtopic.$phpEx?t=" . $topic_id . "&start=" . $start . '#' . $post_id);
Код: Выделить всё
$temp_url = append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=" . $HTTP_GET_VARS[POST_POST_URL] . "&start=" . $start) . "#" . $HTTP_GET_VARS[POST_POST_URL];
Код: Выделить всё
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in z:\home\123\www\forum\db\mysql4.php on line 318
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in z:\home\123\www\forum\db\mysql4.php on line 318
Warning: Cannot modify header information - headers already sent by (output started at z:\home\123\www\forum\db\mysql4.php:318) in z:\home\123\www\forum\viewtopic.php on line 242
Warning: Cannot modify header information - headers already sent by (output started at z:\home\123\www\forum\db\mysql4.php:318) in z:\home\123\www\forum\viewtopic.php on line 612
Warning: Cannot modify header information - headers already sent by (output started at z:\home\123\www\forum\db\mysql4.php:318) in z:\home\123\www\forum\includes\page_header.php on line 483
Warning: Cannot modify header information - headers already sent by (output started at z:\home\123\www\forum\db\mysql4.php:318) in z:\home\123\www\forum\includes\page_header.php on line 485
Warning: Cannot modify header information - headers already sent by (output started at z:\home\123\www\forum\db\mysql4.php:318) in z:\home\123\www\forum\includes\page_header.php on line 486