Code: Select all
if( $board_config['cash_perpost'] )
{
$points = $board_config['cash_perreply'];
$sql = "UPDATE " . USERS_TABLE . "
SET user_points = user_points + $points
WHERE user_id = $iai_id";
if( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not update user points', '', __LINE__, __FILE__, $sql);
}
}
Code: Select all
//
// Update Stats for IAI: must be run AFTER update_post_stats() for original post
//
function iai_update_post_stats(&$forum_id, &$topic_id, &$iai_post_id, &$iai_id)
{
global $db, $board_config;
//This simply runs the 3 db updating functions (only used for IAI replies).
$sql = "UPDATE " . FORUMS_TABLE . "
SET forum_posts = forum_posts + 1, forum_last_post_id = $iai_post_id
WHERE forum_id = $forum_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
}
$sql = "UPDATE " . TOPICS_TABLE . "
SET topic_last_post_id = $iai_post_id, topic_replies = topic_replies + 1
WHERE topic_id = $topic_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
}
$sql = "UPDATE " . USERS_TABLE . "
SET user_posts = user_posts + 1
WHERE user_id = $iai_id";
if ( !($result = $db->sql_query($sql, END_TRANSACTION)) )
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
}
if( $board_config['points_post'] )
{
$points = $board_config['points_reply'];
$sql = "UPDATE " . USERS_TABLE . "
SET user_points = user_points + $points
WHERE user_id = $iai_id";
if( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not update user points', '', __LINE__, __FILE__, $sql);
}
}
return;
}
Code: Select all
if( $board_config['points_post'] )
{
$points = $board_config['points_reply'];