Just edit this section of code in the functions.php to get it the way you want it:
Code: Select all
if( sizeof($forum_from) )
{
$disallow_access = array_diff($forum_from, $disallow_access);
if( !sizeof($disallow_access) )
{
return array();
}
foreach( $disallow_access as $acc_id)
{
$acc_id = (int) $acc_id;
$str_where .= "t.forum_id = $acc_id OR ";
if( $type == 'announcements' && $global_f < 1 && $acc_id > 0 )
{
$global_f = $acc_id;
}
}
}
else
{
foreach( $disallow_access as $acc_id )
{
$acc_id = (int) $acc_id;
$str_where .= "t.forum_id <> $acc_id AND ";
}
}
switch( $type )
{
case "announcements":
$topic_type = '(( t.topic_type = ' . POST_ANNOUNCE . ') OR ( t.topic_type = ' . POST_GLOBAL . '))';
$str_where = ( strlen($str_where) > 0 ) ? 'AND (t.forum_id = 0 OR (' . trim(substr($str_where, 0, -4)) . '))' : '';
$user_link = 't.topic_poster = u.user_id';
$post_link = 't.topic_first_post_id = p.post_id';
$topic_order = 't.topic_time DESC';
break;
case "news":
$topic_type = 't.topic_type = ' . POST_NORMAL;
$str_where = ( strlen($str_where) > 0 ) ? 'AND (' . trim(substr($str_where, 0, -4)) . ')' : '';
$user_link = ( $portal_config['portal_news_style'] ) ? 't.topic_poster = u.user_id' : (( $portal_config['portal_news_show_last'] ) ? 't.topic_last_poster_id = u.user_id' : 't.topic_poster = u.user_id' ) ;
$post_link = ( $portal_config['portal_news_style'] ) ? 't.topic_first_post_id = p.post_id' : (( $portal_config['portal_news_show_last'] ) ? 't.topic_last_post_id = p.post_id' : 't.topic_first_post_id = p.post_id' ) ;
$topic_order = ( $portal_config['portal_news_show_last'] ) ? 't.topic_last_post_time DESC' : 't.topic_time DESC' ;
break;
case "news_all":
$topic_type = '( t.topic_type <> ' . POST_ANNOUNCE . ' ) AND ( t.topic_type <> ' . POST_GLOBAL . ')';
$str_where = ( strlen($str_where) > 0 ) ? 'AND (' . trim(substr($str_where, 0, -4)) . ')' : '';
$user_link = ( $portal_config['portal_news_style'] ) ? 't.topic_poster = u.user_id' : (( $portal_config['portal_news_show_last'] ) ? 't.topic_last_poster_id = u.user_id' : 't.topic_poster = u.user_id' ) ;
$post_link = ( $portal_config['portal_news_style'] ) ? 't.topic_first_post_id = p.post_id' : (( $portal_config['portal_news_show_last'] ) ? 't.topic_last_post_id = p.post_id' : 't.topic_first_post_id = p.post_id' ) ;
$topic_order = ( $portal_config['portal_news_show_last'] ) ? 't.topic_last_post_time DESC' : 't.topic_time DESC' ;
break;
}
if( $type == 'announcements' && $global_f < 1 )
{
$sql = 'SELECT
forum_id
FROM
' . FORUMS_TABLE . '
WHERE
forum_type = ' . FORUM_POST . '
' . str_replace('t.', '', $str_where) . '
ORDER BY
forum_id';
$result = $db->sql_query_limit($sql, 1);
$row = $db->sql_fetchrow($result);
if( !sizeof( $row ) )
{
return array();
}
$global_f = $row['forum_id'];
}
$sql_array = array(
'SELECT' => 't.forum_id,
t.topic_id,
t.topic_last_post_id,
t.topic_last_post_time,
t.topic_time,
t.topic_title,
t.topic_attachment,
t.topic_views,
t.poll_title,
t.topic_replies,
t.topic_replies_real,
t.topic_poster,
t.topic_type,
t.topic_status,
t.topic_last_poster_name,
t.topic_last_poster_id,
t.topic_last_poster_colour,
t.icon_id,
u.username,
u.user_id,
u.user_type,
u.user_colour,
p.post_id,
p.poster_id,
p.post_time,
p.post_text,
p.post_attachment,
p.post_username,
p.enable_smilies,
p.enable_bbcode,
p.enable_magic_url,
p.bbcode_bitfield,
p.bbcode_uid,
f.forum_name,
f.enable_icons',
'FROM' => array(
TOPICS_TABLE => 't',
),
'LEFT_JOIN' => array(
array(
'FROM' => array(USERS_TABLE => 'u'),
'ON' => $user_link,
),
array(
'FROM' => array(FORUMS_TABLE => 'f'),
'ON' => 't.forum_id=f.forum_id',
),
array(
'FROM' => array(POSTS_TABLE => 'p'),
'ON' => $post_link,
),
),
'WHERE' => $topic_type . '
' . $post_time . '
AND t.topic_status <> ' . ITEM_MOVED . '
AND t.topic_approved = 1
AND t.topic_moved_id = 0
' . $str_where,
'ORDER_BY' => $topic_order,
);