--- functions_post.php.1 2005-08-12 13:09:13.000000000 +0400
+++ functions_post.php 2005-08-12 13:08:41.000000000 +0400
@@ -36,11 +36,18 @@
function submit_merged_post($post_id, $forum_id, $subject, $message, &$return_message, &$return_meta)
{
global $board_config, $db, $lang, $phpEx, $phpbb_root_path;
+ global $userdata;
include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_merge.' . $phpEx);
include($phpbb_root_path . 'includes/functions_search.'.$phpEx);
$current_time = time();
+ //
+ // MOD: No Flood Control For Mods And Admins by Berend Dekens
+ // Retreive authentication info to determine if this user has moderator status
+ //
+ $is_auth = auth(AUTH_ALL, $forum_id, $userdata);
+ $is_mod = $is_auth['auth_mod'];
// Check message
if ( empty($message) )
@@ -57,7 +64,7 @@
$last_post_data = $db->sql_fetchrow($result);
// Flood control
- if ( ($current_time - intval($last_post_data['post_time'])) < intval($board_config['merge_flood_interval']) )
+ if (( ($current_time - intval($last_post_data['post_time'])) < intval($board_config['merge_flood_interval']) ) && (!$is_mod))
{
message_die(GENERAL_MESSAGE, $lang['Flood_Error']);
}
@@ -316,8 +323,14 @@
include($phpbb_root_path . 'includes/functions_search.'.$phpEx);
$current_time = time();
+ //
+ // MOD: No Flood Control For Mods And Admins by Berend Dekens
+ // Retreive authentication info to determine if this user has moderator status
+ //
+ $is_auth = auth(AUTH_ALL, $forum_id, $userdata);
+ $is_mod = $is_auth['auth_mod'];
- if ($mode == 'newtopic' || $mode == 'reply' || $mode == 'editpost')
+ if (($mode == 'newtopic' || $mode == 'reply' || $mode == 'editpost') && (!$is_mod))
{
//
// Flood control
$merge = false;
$time2merge = intval($board_config['time_to_merge']) * 3600;
if ( ($mode == 'reply') && ($userdata['user_id'] != ANONYMOUS) )
{--- posting.php (revision 85)
+++ posting.php (working copy)
@@ -602,15 +602,16 @@
if ( ($mode == 'reply') && ($userdata['user_id'] != ANONYMOUS) )
{
- $sql = "SELECT post_id, poster_id, post_created FROM " . POSTS_TABLE . " WHERE topic_id = $topic_id ORDER BY post_time DESC LIMIT 1";
+ $sql = "SELECT post_id, poster_id, post_created, post_attachment FROM " . POSTS_TABLE . " WHERE topic_id = $topic_id ORDER BY post_time DESC LIMIT 1";
$result = $db->sql_query($sql) or message_die(GENERAL_ERROR, 'Could not obtain last post information', '', __LINE__, __FILE__, $sql);
$last_post_data = $db->sql_fetchrow($result);
$last_post_id = $last_post_data['post_id'];
$last_poster = $last_post_data['poster_id'];
$last_post_created = $last_post_data['post_created'];
+ $last_post_attachment = $last_post_data['post_attachment'];
- if ( ($last_poster == $userdata['user_id']) && ((time() - $last_post_created) < $time2merge) )
+ if ( ($last_poster == $userdata['user_id']) && ((time() - $last_post_created) < $time2merge) && ($last_post_attachment == 0) )
{
$merge = true;
}
#
#-----[ OPEN ]------------------------------------------
#
posting.php
#
#-----[ FIND ]------------------------------------------
#
$attachment_mod['posting']->insert_attachment($post_id);
#
#-----[ REPLACE WITH ]------------------------------------------
#
$attachment_mod['posting']->insert_attachment( ($merge) ? $last_post_id : $post_id );
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
Xpert писал(а):И про флуд-контроль в теме есть, и про аттач. Вам свое милее?
IGO писал(а):В теме несколько постов одного пользователя идут с вложенными файлами.
Xpert писал(а):Обычно склеит.
А как ты это сделал?Гога писал(а):Можно, конечно, исследовать этот вопрос, но это утомительно, поэтому-то я и сделал так, чтоб не приклеивать в предыдущему сообщению, если в нём есть вложение.
IGO писал(а):А как ты это сделал?Гога писал(а):Можно, конечно, исследовать этот вопрос, но это утомительно, поэтому-то я и сделал так, чтоб не приклеивать в предыдущему сообщению, если в нём есть вложение.
$sql = "SELECT post_id, poster_id, post_created FROM " . POSTS_TABLE . " WHERE topic_id = $topic_id ORDER BY post_time DESC LIMIT 1";
$sql = "SELECT post_id, poster_id, post_created, post_attachment FROM " . POSTS_TABLE . " WHERE topic_id = $topic_id ORDER BY post_time DESC LIMIT 1";
$last_post_created = $last_post_data['post_created'];
$last_post_attachment = $last_post_data['post_attachment'];
if ( ($last_poster == $userdata['user_id']) && ((time() - $last_post_created) < $time2merge) )
if ( ($last_poster == $userdata['user_id']) && ((time() - $last_post_created) < $time2merge) && ($last_post_attachment == 0) )
Вернуться в Анонсы и поддержка модов для phpBB 2.0.x
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 0