Well here you get the code I use on my site. Remember to modify it to your needs:
Code: Select all
<?php
/**
*
* @package - Board3portal
* @version $Id: news.php 96 2008-02-05 16:52:11Z IcedCold $
* @copyright (c) kevin / saint ( http://www.board3.de/ ), (c) Ice, (c) nickvergessen ( http://www.flying-bits.org/ ), (c) redbull254 ( http://www.digitalfotografie-foren.de )
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
if (!defined('IN_PHPBB'))
{
exit;
}
if (!defined('IN_PORTAL'))
{
exit;
}
//
// Fetch Posts for news from portal/includes/functions.php
//
$template->assign_vars(array(
'NEWEST_POST_IMG' => $user->img('icon_topic_newest', 'VIEW_NEWEST_POST'),
'READ_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_NEWEST_POST'),
'S_DISPLAY_NEWS' => true,
));
#if (!isset($HTTP_GET_VARS['article']))
$news = request_var('news', -1);
if($news < 0)
{
$fetch_news = phpbb_fetch_posts($portal_config['portal_news_forum'], $portal_config['portal_number_of_news'], $portal_config['portal_news_length'], 0, ($portal_config['portal_show_all_news']) ? 'news_all' : 'news');
if (count($fetch_news) == 0)
{
$template->assign_block_vars('news_row_alle', array(
'S_NO_TOPICS' => true,
'S_NOT_LAST' => false
));
}
else
{
for ($i = 0; $i < count($fetch_news); $i++)
{
if( isset($fetch_news[$i]['striped']) && $fetch_news[$i]['striped'] == true )
{
$open_bracket = '[ ';
$close_bracket = ' ]';
$read_full = $user->lang['READ_FULL'];
}
else
{
$open_bracket = '';
$close_bracket = '';
$read_full = '';
}
// unread?
$forum_id = $fetch_news[$i]['forum_id'];
$topic_id = $fetch_news[$i]['topic_id'];
$topic_tracking_info = get_complete_topic_tracking($forum_id, $topic_id, $global_announce_list = false);
$unread_topic = (isset($topic_tracking_info[$topic_id]) && $fetch_news[$i]['topic_last_post_time'] > $topic_tracking_info[$topic_id]) ? true : false;
$template->assign_block_vars('news_row_alle', array(
'ATTACH_ICON_IMG' => ($fetch_news[$i]['attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
'FORUM_NAME' => ( $forum_id ) ? $fetch_news[$i]['forum_name'] : '',
'TITLE' => $fetch_news[$i]['topic_title'],
'POSTER' => $fetch_news[$i]['username'],
'U_USER_PROFILE' => (($fetch_news[$i]['user_type'] == USER_NORMAL || $fetch_news[$i]['user_type'] == USER_FOUNDER) && $fetch_news[$i]['user_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $fetch_news[$i]['user_id']) : '',
'TIME' => $fetch_news[$i]['topic_time'],
'TEXT' => $fetch_news[$i]['post_text'],
'REPLIES' => $fetch_news[$i]['topic_replies'],
'TOPIC_VIEWS' => $fetch_news[$i]['topic_views'],
'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $fetch_news[$i]['forum_id']),
'U_LAST_COMMENTS' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $fetch_news[$i]['forum_id'] . '&p=' . $fetch_news[$i]['topic_last_post_id'] . '#p' . $fetch_news[$i]['topic_last_post_id']),
'U_VIEW_COMMENTS' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $fetch_news[$i]['forum_id'] . '&t=' . $fetch_news[$i]['topic_id']),
'U_POST_COMMENT' => append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=reply&f=' . $fetch_news[$i]['forum_id'] . '&t=' . $fetch_news[$i]['topic_id']),
'U_READ_FULL' => append_sid("{$phpbb_root_path}portal.$phpEx", 'news=' . $i),
'L_READ_FULL' => $read_full,
'OPEN' => $open_bracket,
'CLOSE' => $close_bracket,
'S_NOT_LAST' => ($i < count($fetch_news) - 1) ? true : false,
'S_POLL' => $fetch_news[$i]['poll'],
'S_UNREAD_INFO' => $unread_topic,
));
}
}
}
//N Y H E D E R F R A S T U D M E D
$portal_config['portal_news_forum_studmed'] = '48, 119, 41, 1118, 180, 1119, 1136, 118'; //Her er angivet forum id, hvorfra der hentes news indfra
$fetch_news_studmed = phpbb_fetch_posts($portal_config['portal_news_forum_studmed'], $portal_config['portal_number_of_news'], $portal_config['portal_news_length'], 0, ($portal_config['portal_show_all_news']) ? 'news_all' : 'news');
if (count($fetch_news_studmed) == 0)
{
$template->assign_block_vars('news_row_studmed', array(
'S_NO_TOPICS' => true,
'S_NOT_LAST' => false
));
}
else
{
for ($i = 0; $i < count($fetch_news_studmed); $i++)
{
if( isset($fetch_news_studmed[$i]['striped']) && $fetch_news_studmed[$i]['striped'] == true )
{
$open_bracket = '[ ';
$close_bracket = ' ]';
$read_full = $user->lang['READ_FULL'];
}
else
{
$open_bracket = '';
$close_bracket = '';
$read_full = '';
}
// unread?
$forum_id = $fetch_news_studmed[$i]['forum_id'];
$topic_id = $fetch_news_studmed[$i]['topic_id'];
$topic_tracking_info = get_complete_topic_tracking($forum_id, $topic_id, $global_announce_list = false);
$unread_topic = (isset($topic_tracking_info[$topic_id]) && $fetch_news_studmed[$i]['topic_last_post_time'] > $topic_tracking_info[$topic_id]) ? true : false;
$template->assign_block_vars('news_row_studmed', array(
'ATTACH_ICON_IMG' => ($fetch_news_studmed[$i]['attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
'FORUM_NAME' => ( $forum_id ) ? $fetch_news_studmed[$i]['forum_name'] : '',
'TITLE' => $fetch_news_studmed[$i]['topic_title'],
'POSTER' => $fetch_news_studmed[$i]['username'],
'U_USER_PROFILE' => (($fetch_news_studmed[$i]['user_type'] == USER_NORMAL || $fetch_news_studmed[$i]['user_type'] == USER_FOUNDER) && $fetch_news_studmed[$i]['user_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $fetch_news_studmed[$i]['user_id']) : '',
'TIME' => $fetch_news_studmed[$i]['topic_time'],
'TEXT' => $fetch_news_studmed[$i]['post_text'],
'REPLIES' => $fetch_news_studmed[$i]['topic_replies'],
'TOPIC_VIEWS' => $fetch_news_studmed[$i]['topic_views'],
'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $fetch_news_studmed[$i]['forum_id']),
'U_LAST_COMMENTS' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $fetch_news_studmed[$i]['forum_id'] . '&p=' . $fetch_news_studmed[$i]['topic_last_post_id'] . '#p' . $fetch_news_studmed[$i]['topic_last_post_id']),
'U_VIEW_COMMENTS' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $fetch_news_studmed[$i]['forum_id'] . '&t=' . $fetch_news_studmed[$i]['topic_id']),
'U_POST_COMMENT' => append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=reply&f=' . $fetch_news_studmed[$i]['forum_id'] . '&t=' . $fetch_news_studmed[$i]['topic_id']),
'U_READ_FULL' => append_sid("{$phpbb_root_path}portal.$phpEx", 'news=' . $i),
'L_READ_FULL' => $read_full,
'OPEN' => $open_bracket,
'CLOSE' => $close_bracket,
'S_NOT_LAST' => ($i < count($fetch_news_studmed) - 1) ? true : false,
'S_POLL' => $fetch_news_studmed[$i]['poll'],
'S_UNREAD_INFO' => $unread_topic,
));
}
}
//N Y H E D E R F R A C A N D M E D
$portal_config['portal_news_forum_candmed'] = '1113, 1115'; //Her er angivet forum id, hvorfra der hentes news indfra
$fetch_news_candmed = phpbb_fetch_posts($portal_config['portal_news_forum_candmed'], $portal_config['portal_number_of_news'], $portal_config['portal_news_length'], 0, ($portal_config['portal_show_all_news']) ? 'news_all' : 'news');
if (count($fetch_news_candmed) == 0)
{
$template->assign_block_vars('news_row_candmed', array(
'S_NO_TOPICS' => true,
'S_NOT_LAST' => false
));
}
else
{
for ($i = 0; $i < count($fetch_news_candmed); $i++)
{
if( isset($fetch_news_candmed[$i]['striped']) && $fetch_news_candmed[$i]['striped'] == true )
{
$open_bracket = '[ ';
$close_bracket = ' ]';
$read_full = $user->lang['READ_FULL'];
}
else
{
$open_bracket = '';
$close_bracket = '';
$read_full = '';
}
// unread?
$forum_id = $fetch_news_candmed[$i]['forum_id'];
$topic_id = $fetch_news_candmed[$i]['topic_id'];
$topic_tracking_info = get_complete_topic_tracking($forum_id, $topic_id, $global_announce_list = false);
$unread_topic = (isset($topic_tracking_info[$topic_id]) && $fetch_news_candmed[$i]['topic_last_post_time'] > $topic_tracking_info[$topic_id]) ? true : false;
$template->assign_block_vars('news_row_candmed', array(
'ATTACH_ICON_IMG' => ($fetch_news_candmed[$i]['attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
'FORUM_NAME' => ( $forum_id ) ? $fetch_news_candmed[$i]['forum_name'] : '',
'TITLE' => $fetch_news_candmed[$i]['topic_title'],
'POSTER' => $fetch_news_candmed[$i]['username'],
'U_USER_PROFILE' => (($fetch_news_candmed[$i]['user_type'] == USER_NORMAL || $fetch_news_candmed[$i]['user_type'] == USER_FOUNDER) && $fetch_news_candmed[$i]['user_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $fetch_news_candmed[$i]['user_id']) : '',
'TIME' => $fetch_news_candmed[$i]['topic_time'],
'TEXT' => $fetch_news_candmed[$i]['post_text'],
'REPLIES' => $fetch_news_candmed[$i]['topic_replies'],
'TOPIC_VIEWS' => $fetch_news_candmed[$i]['topic_views'],
'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $fetch_news_candmed[$i]['forum_id']),
'U_LAST_COMMENTS' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $fetch_news_candmed[$i]['forum_id'] . '&p=' . $fetch_news_candmed[$i]['topic_last_post_id'] . '#p' . $fetch_news_candmed[$i]['topic_last_post_id']),
'U_VIEW_COMMENTS' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $fetch_news_candmed[$i]['forum_id'] . '&t=' . $fetch_news_candmed[$i]['topic_id']),
'U_POST_COMMENT' => append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=reply&f=' . $fetch_news_candmed[$i]['forum_id'] . '&t=' . $fetch_news_candmed[$i]['topic_id']),
'U_READ_FULL' => append_sid("{$phpbb_root_path}portal.$phpEx", 'news=' . $i),
'L_READ_FULL' => $read_full,
'OPEN' => $open_bracket,
'CLOSE' => $close_bracket,
'S_NOT_LAST' => ($i < count($fetch_news_candmed) - 1) ? true : false,
'S_POLL' => $fetch_news_candmed[$i]['poll'],
'S_UNREAD_INFO' => $unread_topic,
));
}
}
//N Y H E D E R F R A P D A M E D
$portal_config['portal_news_forum_pda'] = '1082, 1091, 1133, 1134'; //Her er angivet forum id, hvorfra der hentes news indfra
$fetch_news_pda = phpbb_fetch_posts($portal_config['portal_news_forum_pda'], $portal_config['portal_number_of_news'], $portal_config['portal_news_length'], 0, ($portal_config['portal_show_all_news']) ? 'news_all' : 'news');
if (count($fetch_news_pda) == 0)
{
$template->assign_block_vars('news_row_pda', array(
'S_NO_TOPICS' => true,
'S_NOT_LAST' => false
));
}
else
{
for ($i = 0; $i < count($fetch_news_pda); $i++)
{
if( isset($fetch_news_pda[$i]['striped']) && $fetch_news_pda[$i]['striped'] == true )
{
$open_bracket = '[ ';
$close_bracket = ' ]';
$read_full = $user->lang['READ_FULL'];
}
else
{
$open_bracket = '';
$close_bracket = '';
$read_full = '';
}
// unread?
$forum_id = $fetch_news_pda[$i]['forum_id'];
$topic_id = $fetch_news_pda[$i]['topic_id'];
$topic_tracking_info = get_complete_topic_tracking($forum_id, $topic_id, $global_announce_list = false);
$unread_topic = (isset($topic_tracking_info[$topic_id]) && $fetch_news_pda[$i]['topic_last_post_time'] > $topic_tracking_info[$topic_id]) ? true : false;
$template->assign_block_vars('news_row_pda', array(
'ATTACH_ICON_IMG' => ($fetch_news_pda[$i]['attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
'FORUM_NAME' => ( $forum_id ) ? $fetch_news_pda[$i]['forum_name'] : '',
'TITLE' => $fetch_news_pda[$i]['topic_title'],
'POSTER' => $fetch_news_pda[$i]['username'],
'U_USER_PROFILE' => (($fetch_news_pda[$i]['user_type'] == USER_NORMAL || $fetch_news_pda[$i]['user_type'] == USER_FOUNDER) && $fetch_news_pda[$i]['user_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $fetch_news_pda[$i]['user_id']) : '',
'TIME' => $fetch_news_pda[$i]['topic_time'],
'TEXT' => $fetch_news_pda[$i]['post_text'],
'REPLIES' => $fetch_news_pda[$i]['topic_replies'],
'TOPIC_VIEWS' => $fetch_news_pda[$i]['topic_views'],
'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $fetch_news_pda[$i]['forum_id']),
'U_LAST_COMMENTS' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $fetch_news_pda[$i]['forum_id'] . '&p=' . $fetch_news_pda[$i]['topic_last_post_id'] . '#p' . $fetch_news_pda[$i]['topic_last_post_id']),
'U_VIEW_COMMENTS' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $fetch_news_pda[$i]['forum_id'] . '&t=' . $fetch_news_pda[$i]['topic_id']),
'U_POST_COMMENT' => append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=reply&f=' . $fetch_news_pda[$i]['forum_id'] . '&t=' . $fetch_news_pda[$i]['topic_id']),
'U_READ_FULL' => append_sid("{$phpbb_root_path}portal.$phpEx", 'news=' . $i),
'L_READ_FULL' => $read_full,
'OPEN' => $open_bracket,
'CLOSE' => $close_bracket,
'S_NOT_LAST' => ($i < count($fetch_news_pda) - 1) ? true : false,
'S_POLL' => $fetch_news_pda[$i]['poll'],
'S_UNREAD_INFO' => $unread_topic,
));
}
}
//N Y H E D E R F R A B O G F O R A
$portal_config['portal_news_forum_bog'] = '1112, 1110, 7, 8, 9, 10, 1111, 15, 16, 17, 18, 19, 20, 4, 22, 23, 24, 29, 27, 1109, 30, 31, 32, 13, 33, 34, 35, 14, 1137'; //Her er angivet forum id, hvorfra der hentes news indfra
$fetch_news_bog = phpbb_fetch_posts($portal_config['portal_news_forum_bog'], $portal_config['portal_number_of_news'], $portal_config['portal_news_length'], 0, ($portal_config['portal_show_all_news']) ? 'news_all' : 'news');
if (count($fetch_news_bog) == 0)
{
$template->assign_block_vars('news_row_bog', array(
'S_NO_TOPICS' => true,
'S_NOT_LAST' => false
));
}
else
{
for ($i = 0; $i < count($fetch_news_bog); $i++)
{
if( isset($fetch_news_bog[$i]['striped']) && $fetch_news_bog[$i]['striped'] == true )
{
$open_bracket = '[ ';
$close_bracket = ' ]';
$read_full = $user->lang['READ_FULL'];
}
else
{
$open_bracket = '';
$close_bracket = '';
$read_full = '';
}
// unread?
$forum_id = $fetch_news_bog[$i]['forum_id'];
$topic_id = $fetch_news_bog[$i]['topic_id'];
$topic_tracking_info = get_complete_topic_tracking($forum_id, $topic_id, $global_announce_list = false);
$unread_topic = (isset($topic_tracking_info[$topic_id]) && $fetch_news_bog[$i]['topic_last_post_time'] > $topic_tracking_info[$topic_id]) ? true : false;
$template->assign_block_vars('news_row_bog', array(
'ATTACH_ICON_IMG' => ($fetch_news_bog[$i]['attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
'FORUM_NAME' => ( $forum_id ) ? $fetch_news_bog[$i]['forum_name'] : '',
'TITLE' => $fetch_news_bog[$i]['topic_title'],
'POSTER' => $fetch_news_bog[$i]['username'],
'U_USER_PROFILE' => (($fetch_news_bog[$i]['user_type'] == USER_NORMAL || $fetch_news_bog[$i]['user_type'] == USER_FOUNDER) && $fetch_news_bog[$i]['user_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $fetch_news_bog[$i]['user_id']) : '',
'TIME' => $fetch_news_bog[$i]['topic_time'],
'TEXT' => $fetch_news_bog[$i]['post_text'],
'REPLIES' => $fetch_news_bog[$i]['topic_replies'],
'TOPIC_VIEWS' => $fetch_news_bog[$i]['topic_views'],
'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $fetch_news_bog[$i]['forum_id']),
'U_LAST_COMMENTS' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $fetch_news_bog[$i]['forum_id'] . '&p=' . $fetch_news_bog[$i]['topic_last_post_id'] . '#p' . $fetch_news_bog[$i]['topic_last_post_id']),
'U_VIEW_COMMENTS' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $fetch_news_bog[$i]['forum_id'] . '&t=' . $fetch_news_bog[$i]['topic_id']),
'U_POST_COMMENT' => append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=reply&f=' . $fetch_news_bog[$i]['forum_id'] . '&t=' . $fetch_news_bog[$i]['topic_id']),
'U_READ_FULL' => append_sid("{$phpbb_root_path}portal.$phpEx", 'news=' . $i),
'L_READ_FULL' => $read_full,
'OPEN' => $open_bracket,
'CLOSE' => $close_bracket,
'S_NOT_LAST' => ($i < count($fetch_news_bog) - 1) ? true : false,
'S_POLL' => $fetch_news_bog[$i]['poll'],
'S_UNREAD_INFO' => $unread_topic,
));
}
}
//N Y H E D E R F R A S A L G + A N N O N C E R
$portal_config['portal_news_forum_salg'] = '1135, 117'; //Her er angivet forum id, hvorfra der hentes news indfra
$fetch_news_salg = phpbb_fetch_posts($portal_config['portal_news_forum_salg'], $portal_config['portal_number_of_news'], $portal_config['portal_news_length'], 0, ($portal_config['portal_show_all_news']) ? 'news_all' : 'news');
if (count($fetch_news_salg) == 0)
{
$template->assign_block_vars('news_row_salg', array(
'S_NO_TOPICS' => true,
'S_NOT_LAST' => false
));
}
else
{
for ($i = 0; $i < count($fetch_news_salg); $i++)
{
if( isset($fetch_news_salg[$i]['striped']) && $fetch_news_salg[$i]['striped'] == true )
{
$open_bracket = '[ ';
$close_bracket = ' ]';
$read_full = $user->lang['READ_FULL'];
}
else
{
$open_bracket = '';
$close_bracket = '';
$read_full = '';
}
// unread?
$forum_id = $fetch_news_salg[$i]['forum_id'];
$topic_id = $fetch_news_salg[$i]['topic_id'];
$topic_tracking_info = get_complete_topic_tracking($forum_id, $topic_id, $global_announce_list = false);
$unread_topic = (isset($topic_tracking_info[$topic_id]) && $fetch_news_salg[$i]['topic_last_post_time'] > $topic_tracking_info[$topic_id]) ? true : false;
$template->assign_block_vars('news_row_salg', array(
'ATTACH_ICON_IMG' => ($fetch_news_salg[$i]['attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
'FORUM_NAME' => ( $forum_id ) ? $fetch_news_salg[$i]['forum_name'] : '',
'TITLE' => $fetch_news_salg[$i]['topic_title'],
'POSTER' => $fetch_news_salg[$i]['username'],
'U_USER_PROFILE' => (($fetch_news_salg[$i]['user_type'] == USER_NORMAL || $fetch_news_salg[$i]['user_type'] == USER_FOUNDER) && $fetch_news_salg[$i]['user_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $fetch_news_salg[$i]['user_id']) : '',
'TIME' => $fetch_news_salg[$i]['topic_time'],
'TEXT' => $fetch_news_salg[$i]['post_text'],
'REPLIES' => $fetch_news_salg[$i]['topic_replies'],
'TOPIC_VIEWS' => $fetch_news_salg[$i]['topic_views'],
'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $fetch_news_salg[$i]['forum_id']),
'U_LAST_COMMENTS' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $fetch_news_salg[$i]['forum_id'] . '&p=' . $fetch_news_salg[$i]['topic_last_post_id'] . '#p' . $fetch_news_salg[$i]['topic_last_post_id']),
'U_VIEW_COMMENTS' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $fetch_news_salg[$i]['forum_id'] . '&t=' . $fetch_news_salg[$i]['topic_id']),
'U_POST_COMMENT' => append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=reply&f=' . $fetch_news_salg[$i]['forum_id'] . '&t=' . $fetch_news_salg[$i]['topic_id']),
'U_READ_FULL' => append_sid("{$phpbb_root_path}portal.$phpEx", 'news=' . $i),
'L_READ_FULL' => $read_full,
'OPEN' => $open_bracket,
'CLOSE' => $close_bracket,
'S_NOT_LAST' => ($i < count($fetch_news_salg) - 1) ? true : false,
'S_POLL' => $fetch_news_salg[$i]['poll'],
'S_UNREAD_INFO' => $unread_topic,
));
}
}
//N Y H E D E R F R A L Æ S E M A K K E R
$portal_config['portal_news_forum_lasemakker'] = '1122'; //Her er angivet forum id, hvorfra der hentes news indfra
$fetch_news_lasemakker = phpbb_fetch_posts($portal_config['portal_news_forum_lasemakker'], $portal_config['portal_number_of_news'], $portal_config['portal_news_length'], 0, ($portal_config['portal_show_all_news']) ? 'news_all' : 'news');
if (count($fetch_news_lasemakker) == 0)
{
$template->assign_block_vars('news_row_lasemakker', array(
'S_NO_TOPICS' => true,
'S_NOT_LAST' => false
));
}
else
{
for ($i = 0; $i < count($fetch_news_lasemakker); $i++)
{
if( isset($fetch_news_lasemakker[$i]['striped']) && $fetch_news_lasemakker[$i]['striped'] == true )
{
$open_bracket = '[ ';
$close_bracket = ' ]';
$read_full = $user->lang['READ_FULL'];
}
else
{
$open_bracket = '';
$close_bracket = '';
$read_full = '';
}
// unread?
$forum_id = $fetch_news_lasemakker[$i]['forum_id'];
$topic_id = $fetch_news_lasemakker[$i]['topic_id'];
$topic_tracking_info = get_complete_topic_tracking($forum_id, $topic_id, $global_announce_list = false);
$unread_topic = (isset($topic_tracking_info[$topic_id]) && $fetch_news_lasemakker[$i]['topic_last_post_time'] > $topic_tracking_info[$topic_id]) ? true : false;
$template->assign_block_vars('news_row_lasemakker', array(
'ATTACH_ICON_IMG' => ($fetch_news_lasemakker[$i]['attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
'FORUM_NAME' => ( $forum_id ) ? $fetch_news_lasemakker[$i]['forum_name'] : '',
'TITLE' => $fetch_news_lasemakker[$i]['topic_title'],
'POSTER' => $fetch_news_lasemakker[$i]['username'],
'U_USER_PROFILE' => (($fetch_news_lasemakker[$i]['user_type'] == USER_NORMAL || $fetch_news_lasemakker[$i]['user_type'] == USER_FOUNDER) && $fetch_news_lasemakker[$i]['user_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $fetch_news_lasemakker[$i]['user_id']) : '',
'TIME' => $fetch_news_lasemakker[$i]['topic_time'],
'TEXT' => $fetch_news_lasemakker[$i]['post_text'],
'REPLIES' => $fetch_news_lasemakker[$i]['topic_replies'],
'TOPIC_VIEWS' => $fetch_news_lasemakker[$i]['topic_views'],
'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $fetch_news_lasemakker[$i]['forum_id']),
'U_LAST_COMMENTS' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $fetch_news_lasemakker[$i]['forum_id'] . '&p=' . $fetch_news_lasemakker[$i]['topic_last_post_id'] . '#p' . $fetch_news_lasemakker[$i]['topic_last_post_id']),
'U_VIEW_COMMENTS' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $fetch_news_lasemakker[$i]['forum_id'] . '&t=' . $fetch_news_lasemakker[$i]['topic_id']),
'U_POST_COMMENT' => append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=reply&f=' . $fetch_news_lasemakker[$i]['forum_id'] . '&t=' . $fetch_news_lasemakker[$i]['topic_id']),
'U_READ_FULL' => append_sid("{$phpbb_root_path}portal.$phpEx", 'news=' . $i),
'L_READ_FULL' => $read_full,
'OPEN' => $open_bracket,
'CLOSE' => $close_bracket,
'S_NOT_LAST' => ($i < count($fetch_news_lasemakker) - 1) ? true : false,
'S_POLL' => $fetch_news_lasemakker[$i]['poll'],
'S_UNREAD_INFO' => $unread_topic,
));
}
}
?>