#
#-----[ SQL ]------------------------------------------
#
INSERT INTO bb_config (config_name, config_value) VALUES ('join_interval', '18');
#
#-----[  ]------------------------------------------
#
posting.php
#
#-----[  ]------------------------------------------
#
	//
	// Submit post/vote (newtopic, edit, reply, etc.)
	//
#
#-----[   ]------------------------------------------
#
	// double_post eliminate start
	if ( $mode == 'reply' && $userdata['user_id'] != ANONYMOUS )
	{
		$poster_id = $userdata['user_id'];
		$sql = "SELECT post_id, poster_id, post_time, MAX(post_time) FROM " . POSTS_TABLE . " WHERE topic_id = $topic_id GROUP BY post_time ORDER BY post_time DESC LIMIT 1";
	
		if ( !($result = $db->sql_query($sql)) )
		{
			message_die(GENERAL_ERROR, 'Could not obtain forums information', '', __LINE__, __FILE__, $sql);
		}
		$post_id_last_row = $db->sql_fetchrow($result);
		$post_id = $post_id_last_row['post_id'];
		$difference_time = TIMENOW - $post_id_last_row['post_time'];
		$separator = ' \n\n[size=9][color=#999999]' . $lang['ADDED_LATER'] . ' ' . delta_time($post_id_last_row['post_time'], TIMENOW, 'seconds'). ':[/color][/size]\n\n ';

		if ( $post_id_last_row['poster_id'] == $poster_id && $post_info['topic_replies'] >= 1 && ( $difference_time < ( $bb_cfg['join_interval'] * 3600 ) ) )
		{			
			$mode = 'editpost';
			$sql = "SELECT post_text, bbcode_uid FROM " . POSTS_TEXT_TABLE . " WHERE post_id = $post_id";
			if ( !($result = $db->sql_query($sql)) )
				{
					message_die(GENERAL_ERROR, 'Could not obtain forums information', '', __LINE__, __FILE__, $sql);
				}
			$last_message_row = $db->sql_fetchrow($result);
			$bb_uid = ':' . $last_message_row['bbcode_uid'];
			
			// i don't know much about parsing the message, so it may well be that, there are some wrongs, anyway all seems to work fine
			$last_message = str_replace($bb_uid, '', $last_message_row['post_text']);
			$last_message = preg_replace('/\:[0-9a-z\:]+\]/si', ']', $last_message);
			$last_message = undo_htmlspecialchars(addslashes($last_message));
			
		}	
	}
	// double_post eliminate end
#
#-----[  ]------------------------------------------
#
$bbcode_uid = '';
#
#-----[   ]------------------------------------------
#
	
	// double_post eliminate start
	if ( !empty($last_message) )
	{
		$message = ( $last_message != $message ) ? $last_message . $separator . $message : $message;
		$added = 1;
	}
	// double_post eliminate end

#
#-----[  ]------------------------------------------
#
submit_post($mode, $post_data, $return_message, $return_meta, $forum_id, $topic_id, $post_id, $poll_id, $topic_type, $bbcode_on, $smilies_on, $attach_sig, $bbcode_uid, str_replace("\'", "''", $username), str_replace("\'", "''", $subject), str_replace("\'", "''", $message), str_replace("\'", "''", $poll_title), $poll_options, $poll_length, $update_post_time);
# 
# 
#-----[     ]------------------------------------------
# 
, $added
# 
#-----[  ]------------------------------------------
#  
includes\function_post.php
# 
#-----[  ]------------------------------------------
#  
function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$smilies_on, &$attach_sig, &$bbcode_uid, $post_username, $post_subject, $post_message, $poll_title, &$poll_options, &$poll_length, $update_post_time)
# 
# 
#-----[     ]------------------------------------------
# 
, &$added
# 
#-----[  ]------------------------------------------
#  
	if ($mode == 'editpost')  if ($mode == 'editpost' && $post_data['has_poll']) -   
# 
#-----[   ]------------------------------------------
# 

	if ( $added && $mode == 'editpost' )
	{
		$sql = "UPDATE " . POSTS_TABLE . " SET post_time = " . $current_time . " WHERE post_id = " . $post_id;
		if ( !($result = $db->sql_query($sql)) )
		{
			message_die(GENERAL_ERROR, 'Could not update last post time', '', __LINE__, __FILE__, $sql);
		}
	}

#
#-----[  ]------------------------------------------
#
admin\admin_board.php
#
#-----[  ]------------------------------------------
#
	"L_FLOOD_INTERVAL" => $lang['Flood_Interval'],
	"L_FLOOD_INTERVAL_EXPLAIN" => $lang['Flood_Interval_explain'], 
#
#-----[   ]------------------------------------------
#
	"L_JOIN_INTERVAL" => $lang['Join_Interval'],
	"L_JOIN_INTERVAL_EXPLAIN" => $lang['Join_Interval_explain'], 

#
#-----[  ]------------------------------------------
#
	"FLOOD_INTERVAL" => $new['flood_interval'],

#
#-----[   ]------------------------------------------
#
	"JOIN_INTERVAL" => $new['join_interval'],

#
#-----[  ]------------------------------------------
#
language\lang_english\lang_admin.php / language\lang_russian\lang_admin.php
#
#-----[  ]------------------------------------------
#
$lang['Flood_Interval'] = 'Flood Interval';

$lang['Flood_Interval_explain'] = 'Number of seconds a user must wait between posts'; 

#
#-----[ ,  ]------------------------------------------
#
$lang['Join_Interval'] = 'Join messages in: (hours)';
$lang['Join_Interval_explain'] = 'Join messages of the same poster if interval between them is less than this quantity in hours';
#
#    
$lang['Join_Interval'] = '  ';
$lang['Join_Interval_explain'] = '           ';
#
#-----[  ]------------------------------------------
#
templates\default\admin\admin_board.tpl
#
#-----[  ]------------------------------------------
#
	<tr>
	<td><h4>{L_FLOOD_INTERVAL}</h4><h6>{L_FLOOD_INTERVAL_EXPLAIN}</h6></td>
	<td><input class="post" type="text" size="3" maxlength="4" name="flood_interval" value="{FLOOD_INTERVAL}" /> sec</td>
	</tr>
#
#-----[ ,  ]------------------------------------------
#
	<tr>
	<td><h4>{L_JOIN_INTERVAL}</h4><h6>{L_JOIN_INTERVAL_EXPLAIN}</h6></td>
	<td><input class="post" type="text" size="3" maxlength="4" name="flood_interval" value="{JOIN_INTERVAL}" /> sec</td>
	</tr>

#-----[  ]------------------------------------------
/-----------      --------

language\lang_russian\lang_main.php  language\lang_english\lang_admin.php

// double_post eliminate start
$lang['ADDED_LATER'] = ' ';
// double_post eliminate end



// double_post eliminate start
$lang['ADDED_LATER'] = 'Added later';
// double_post eliminate end


# 
#-----[ E/   ]------------------------------------------ 
# 
#  :)