nie wiem, czy to to ?
/**
* Show the "news" articles
*
* @return string HTML content to replace tag with
*/
public function latest_topics_main()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$attach_pids = array();
$attach_posts = array();
$forums = array();
$rows = array();
$output = array();
$where_clause = array();
$limit = $this->settings['latest_topics_main'] ? $this->settings['latest_topics_main'] : 3;
$posts = intval($this->memberData['posts']);
//-----------------------------------------
// Grab articles new/recent in 1 bad ass query
//-----------------------------------------
foreach( explode( ',', $this->settings['portal_latest_topics_forums'] ) as $forum_id )
{
if( !$forum_id )
{
continue;
}
$forums[] = intval($forum_id);
}
/* Loop through the forums and build a list of forums we're allowed access to */
$forumIdsOk = array();
foreach( $this->registry->class_forums->forum_by_id as $id => $data )
{
/* Allowing this forum? */
if ( count($forums) && !in_array( $id, $forums ) )
{
continue;
}
/* Can we read? */
if ( ! $this->registry->permissions->check( 'read', $data ) )
{
continue;
}
/* Can read, but is it password protected, etc? */
if ( ! $this->registry->class_forums->forumsCheckAccess( $id, 0, 'forum', array(), true ) )
{
continue;
}
if ( ! $data['can_view_others'] )
{
continue;
}
if ( $data['min_posts_view'] > $posts )
{
continue;
}
$forumIdsOk[] = $id;
}
if( !count($forumIdsOk) )
{
return '';
}
/* Add allowed forums */
$where_clause[] = "t.forum_id IN (" . implode( ",", $forumIdsOk ) . ")";