Niejasno to piszesz, nie jestem pewny, co masz na myśli.
Sprawdź to: admin/applications/forums/modules_public/forums/topics.php
else if ($this->request['view'] == 'getnewpost')
{
//-----------------------------------------
// Newest post
//-----------------------------------------
$st = 0;
$pid = "";
$markers = $this->memberData['members_markers'];
$last_time = $this->registry->classItemMarking->fetchTimeLastMarked( array( 'forumID' => $this->forum['id'], 'itemID' => $this->topic['tid'] ) );
$query = ' AND ' . $this->registry->class_forums->fetchPostHiddenQuery('visible');
/* Can we deal with hidden posts? */
if ( $this->registry->class_forums->canQueuePosts( $this->topic['forum_id'] ) )
{
if ( $this->permissions['softDeleteSee'] )
{
/* See queued and soft deleted */
$query = '';
}
else
{
/* Otherwise, see queued and approved */
$query = ' AND ' . $this->registry->class_forums->fetchPostHiddenQuery( array( 'visible', 'hidden' ) );
}
}
else
{
/* We cannot see hidden posts */
if ( $this->permissions['softDeleteSee'] )
{
/* See queued and soft deleted */
$query = ' AND ' . $this->registry->class_forums->fetchPostHiddenQuery( array('approved', 'sdeleted') );
}
}
$this->DB->build( array(
'select' => 'MIN(pid) as pid',
'from' => 'posts',
'where' => "topic_id={$this->topic['tid']} AND post_date > " . intval( $last_time ) . $query,
'limit' => array( 0,1 )
) );
$this->DB->execute();
$post = $this->DB->fetch();
if ( $post['pid'] )
{
$pid = "entry".$post['pid'];
$this->DB->build( array( 'select' => 'COUNT(*) as posts', 'from' => 'posts', 'where' => "topic_id={$this->topic['tid']} AND pid <= {$post['pid']}" ) );
$this->DB->execute();
$cposts = $this->DB->fetch();
if ( (($cposts['posts']) % $this->settings['display_max_posts']) == 0 )
{
$pages = ($cposts['posts']) / $this->settings['display_max_posts'];
}
else
{
$number = ( ($cposts['posts']) / $this->settings['display_max_posts'] );
$pages = ceil( $number);
}
$st = ($pages - 1) * $this->settings['display_max_posts'];
if( $this->settings['post_order_sort'] == 'desc' )
{
$st = (ceil(($this->topic['posts']/$this->settings['display_max_posts'])) - $pages) * $this->settings['display_max_posts'];
}
$this->registry->output->silentRedirect( $this->settings['base_url']."showtopic=".$this->topic['tid']."&pid={$post['pid']}&{$pre}={$st}".$pid, $this->topic['title_seo'] );
}
else
{
$this->returnLastPost();
}
}