This small MOD will add a warning if someone has posted a new message while you are posting yours.
If someone has, a warning will appear so you can see their post first before submitting yours.
It's very handy if you have a busy site.
Credit: this is CyberAlien's MOD for phpbbstyles.com --I just made a few tweaks and am posting it here.
Note: the instructions are for Aphrodite. If you need help for other styles, just say.
- Code: Select all
#
#-----[ OPEN ]------------------------------------------
#
includes/functions_post.php
#
#-----[ FIND ]------------------------------------------
#
else if ($mode != 'delete' && $mode != 'poll_delete')
{
$error_msg .= (!empty($error_msg)) ? '<br />' . $lang['Empty_message'] : $lang['Empty_message'];
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Check to see if there's a new post while the user is posting
global $HTTP_POST_VARS;
global $lang;
if(!empty($HTTP_POST_VARS['post_time']) && ($mode == 'reply' || $mode == 'quote'))
{
global $topic_id;
$last_post_time = intval($HTTP_POST_VARS['post_time']);
if(isset($topic_id) && $last_post_time)
{
$sql = "SELECT post_time FROM " . POSTS_TABLE . " WHERE topic_id = $topic_id ORDER BY post_time DESC LIMIT 0, 1";
global $db;
if(($result = $db->sql_query($sql)) !== false)
{
if( $row = $db->sql_fetchrow($result) )
{
$last_post_time2 = $row['post_time'];
if($last_post_time2 > $last_post_time)
{
$error_msg .= (empty($error_msg) ? '' : '<br />') . $lang['Warn_new_post'];
}
}
$db->sql_freeresult($result);
}
}
}
#
#-----[ OPEN ]------------------------------------------
#
templates/ca_aphrodite/posting_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<form action="{S_POST_ACTION}" method="post" name="post" onsubmit="return checkForm(this)" {S_FORM_ENCTYPE}>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<input type="hidden" name="post_time" value="<?php echo time(); ?>" />
#
#-----[ OPEN ]------------------------------------------
#
templates/ca_aphrodite/xs/xs_topic.tpl
#
#-----[ FIND ]------------------------------------------
#
{S_HIDDEN_FIELDS}
#
#-----[ AFTER, ADD ]------------------------------------------
#
<input type="hidden" name="post_time" value="<?php echo time(); ?>" />
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
$lang['Warn_new_post'] = 'There is at least one new reply in this thread. Please review new replies in topic review and resubmit your post.';




