Code: Alles auswählen
if (($board_config['stop_bumping'] == 1 || $forum_bumping == 1) && $userdata['user_level'] == USER && ($mode == 'reply' || $mode == 'quote'))
{
$sql = "SELECT p.poster_id FROM " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t
WHERE t.topic_id = " . $topic_id . "
AND t.topic_last_post_id = p.post_id";
if (!($result = $db->sql_query($sql)))
{
message_die(GENERAL_ERROR, 'Could not check last poster id', '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
$checked_user = $row['poster_id'];
if ($checked_user == $userdata['user_id'])
{
message_die(GENERAL_ERROR, $lang['Rules_bump_cannot']);
}
$db->sql_freeresult($result);
}
// END Stop Bumping Mod
Code: Alles auswählen
if (($board_config['stop_bumping'] == 1 || $forum_bumping == 1) && $userdata['user_level'] == USER && ($mode == 'reply' || $mode == 'quote'))
{
$sql = "SELECT p.poster_id, p.post_time FROM " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t
WHERE t.topic_id = " . $topic_id . "
AND t.topic_last_post_id = p.post_id";
if (!($result = $db->sql_query($sql)))
{
message_die(GENERAL_ERROR, 'Could not check last poster id', '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
$checked_user = $row['poster_id'];
$time_post = $row['post_time'];
$time_now = time();
// 86400 = 24 hours
$time_bumping = ($time_now - $time_post > 86400) ? TRUE : FALSE;
if ($checked_user == $userdata['user_id'] && $time_bumping == FALSE )
{
message_die(GENERAL_ERROR, $lang['Rules_bump_cannot']);
}
$db->sql_freeresult($result);
}
// END Stop Bumping Mod