<?php
// Was there a new post since we hit the quick reply button?
if($mybb->get_input('lastpid', 1))
{
$query = $db->simple_select("posts", "pid", "tid = '{$tid}' AND pid != '{$pid}'", array("order_by" => "pid", "order_dir" => "desc"));
$new_post = $db->fetch_array($query);
if($new_post['pid'] != $mybb->get_input('lastpid', 1))
{
redirect(get_thread_link($tid, 0, "lastpost"));
}
}
<?php
// Was there a new post since we hit the quick reply button?
if($mybb->get_input('lastpid', 1))
{
$query = $db->simple_select("posts", "pid", "tid = '{$tid}' AND pid != '{$pid}'", array("order_by" => "pid", "order_dir" => "desc"));
$new_post = $db->fetch_array($query);
if($new_post['pid'] != $mybb->get_input('lastpid', 1))
{
redirect(get_thread_link($tid));
}
}