Page 3 of 3

Re: Tab based Latest News Block - advance skills needed!

Posted: 7. December 2008 19:40
by Dyo
Ähmmmmm derkubi,

genau kann ich's dir nicht sagen, weil ichs nicht installiert habe, aber wenn du ne recht neue MySQL fährst, dann musste mal die Join-Befehle nachgehen.
Habs bei mir mit MySQL 5.1 gehabt, dass einige Joins nicht mehr gingen, weil die DB (zurecht) sagt ohne eindeutig Schlüssel kein Join.
Die Teile über die also der Join läuft als Bedingung ( WHERE a.x = b.y ), das sollte je nach Richtung des Join in der zugehörigen Tabelle als Key definiert sein.

Könnte also gut daran liegen. Ansonsten mach dir phpMyAdmin auf und teste mit der query in der Queryeingabe aus was nicht stimmt.
Was dort läuft, läuft auch im Board.

Re: Tab based Latest News Block - advance skills needed!

Posted: 7. December 2008 20:10
by frold
I HOPE THIS WILL HELP!! HAVE A NICE X-MAS

I cant see what is wrong in my example!!

Well here you get the code I use on my site. Remember to modify it to your needs:

CREATE
styles/prosilver/template/portal/block/nyheder.html

Code: Select all

<script type="text/javascript">
<!--
	var panels = new Array('alle-panel', 'studmed-panel', 'candmed-panel', 'pda-panel', 'bog-panel', 'salg-panel', 'lasemakker-panel');
	var show_panel = 'alle-panel';		
//-->
</script>

<div id="tabs1">
	<ul>
		<li class="activetab" id="alle-panel-tab"><a href="#tabs" onclick="subPanels('alle-panel'); return false;"><span>Alle</span></a></li>
		<li class="" id="studmed-panel-tab"><a href="#tabs1" onclick="subPanels('studmed-panel'); return false;"><span>Studmed</span></a></li>
		<li class="" id="candmed-panel-tab"><a href="#tabs1" onclick="subPanels('candmed-panel'); return false;"><span>Candmed</span></a></li>
		<li class="" id="pda-panel-tab"><a href="#tabs1" onclick="subPanels('pda-panel'); return false;"><span>PDA</span></a></li>
		<li class="" id="bog-panel-tab"><a href="#tabs1" onclick="subPanels('bog-panel'); return false;"><span>B&oslash;ger</span></a></li>
		<li class="" id="salg-panel-tab"><a href="#tabs1" onclick="subPanels('salg-panel'); return false;"><span>K&oslash;b&Salg</span></a></li>	
		<li class="" id="lasemakker-panel-tab"><a href="#tabs1" onclick="subPanels('lasemakker-panel'); return false;"><span>L&aelig;semakker</span></a></li>	
	</ul>
</div>

<div class="forabg" style="margin: auto;">
	<div class="inner" style="text-align:left;">
		<span class="corners-top"><span></span></span>
		<ul class="topiclist">
			<li class="header"><dl><dt></dt></dl></li>
		</ul>
		<div class="forums" >

		<div style="display: block;" class="panel bg1" id="alle-panel">
			<dl>
				<dd class="posts_portal"  style="border-left:0px">
				<ul class="news">
					<!-- BEGIN news_row_alle -->
					<!-- IF news_row_alle.S_NO_TOPICS -->
					<li>
					<span class="gensmall" style="text-align: center; margin: 0 0 0 5px;"><strong>{L_NO_NEWS}</strong></span>
					</li>
					<!-- ELSE -->
					<li>
						<span style="float: left; margin: 0 0 0 5px;"><img src="{T_THEME_PATH}/images/arrow_right.gif" alt=""/> 
						<!-- IF news_row_alle.S_UNREAD_INFO -->{NEWEST_POST_IMG}<!-- ELSE -->{READ_POST_IMG}<!-- ENDIF --> {news_row_alle.ATTACH_ICON_IMG}  <!-- IF news_row_alle.S_POLL --><strong>{L_POLL}: </strong><!-- ENDIF --><a href="{news_row_alle.U_LAST_COMMENTS}" title="{L_JUMP_NEWEST}"><strong style="font-size:1.1em;">{news_row_alle.TITLE}</strong></a></span>
						<span style="float: right; margin: 0 5px 0 0;">{L_LAST_POST} {L_POST_BY_AUTHOR}: <strong><a href="{news_row_alle.U_USER_PROFILE}">{news_row_alle.POSTER}</a></strong></span>
						<br style="clear:both" />
						<!-- IF news_row_alle.FORUM_NAME -->
						<span style="float: left; font-size:1.0em; margin: 2px 0 0 28px;">{L_FORUM}: <strong><a href="{news_row_alle.U_VIEWFORUM}">{news_row_alle.FORUM_NAME}</a></strong></span>
						<!-- ENDIF -->
						<span style="float: right; margin: 0 5px 0 0;">{L_POSTED_ON_DATE} <strong>{news_row_alle.TIME}</strong></span>
						<br style="clear:both" />
						<span style="float: left; margin: 0 0 0 28px;">
							<a href="{news_row_alle.U_VIEW_COMMENTS}" title="{L_JUMP_FIRST}"><span style="font-size:0.9em;"><em>{L_COMMENTS}: {news_row_alle.REPLIES}</em></span></a>
							<span style="font-size:0.9em;"><em>{L_TOPIC_VIEWS}: {news_row_alle.TOPIC_VIEWS}</em></span>
						</span>
						<!-- IF news_row_alle.S_NOT_LAST --><hr style="margin: 0px 0px 3px 0px;" /><!-- ENDIF -->						
					</li>
					<!-- ENDIF -->
					<!-- END news_row_alle -->
				</ul>
				</dd>
			</dl>
			<br style="clear:both" />		
		</div>

		<div style="display: none;" class="panel bg1" id="studmed-panel">
			<dl>
				<dd class="posts_portal"  style="border-left:0px">
				<ul class="news">
					<!-- BEGIN news_row_studmed -->
					<!-- IF news_row_studmed.S_NO_TOPICS -->
					<li>
					<span class="gensmall" style="text-align: center; margin: 0 0 0 5px;"><strong>{L_NO_NEWS}</strong></span>
					</li>
					<!-- ELSE -->
					<li>
						<span style="float: left; margin: 0 0 0 5px;"><img src="{T_THEME_PATH}/images/arrow_right.gif" alt=""/> 
						<!-- IF news_row_studmed.S_UNREAD_INFO -->{NEWEST_POST_IMG}<!-- ELSE -->{READ_POST_IMG}<!-- ENDIF --> {news_row_studmed.ATTACH_ICON_IMG}  <!-- IF news_row_studmed.S_POLL --><strong>{L_POLL}: </strong><!-- ENDIF --><a href="{news_row_studmed.U_LAST_COMMENTS}" title="{L_JUMP_NEWEST}"><strong style="font-size:1.1em;">{news_row_studmed.TITLE}</strong></a></span>
						<span style="float: right; margin: 0 5px 0 0;">{L_LAST_POST} {L_POST_BY_AUTHOR}: <strong><a href="{news_row_studmed.U_USER_PROFILE}">{news_row_studmed.POSTER}</a></strong></span>
						<br style="clear:both" />
						<!-- IF news_row_studmed.FORUM_NAME -->
						<span style="float: left; font-size:1.0em; margin: 2px 0 0 28px;">{L_FORUM}: <strong><a href="{news_row_studmed.U_VIEWFORUM}">{news_row_studmed.FORUM_NAME}</a></strong></span>
						<!-- ENDIF -->
						<span style="float: right; margin: 0 5px 0 0;">{L_POSTED_ON_DATE} <strong>{news_row_studmed.TIME}</strong></span>
						<br style="clear:both" />
						<span style="float: left; margin: 0 0 0 28px;">
							<a href="{news_row_studmed.U_VIEW_COMMENTS}" title="{L_JUMP_FIRST}"><span style="font-size:0.9em;"><em>{L_COMMENTS}: {news_row_studmed.REPLIES}</em></span></a>
							<span style="font-size:0.9em;"><em>{L_TOPIC_VIEWS}: {news_row_studmed.TOPIC_VIEWS}</em></span>
						</span>
						<!-- IF news_row_studmed.S_NOT_LAST --><hr style="margin: 0px 0px 3px 0px;" /><!-- ENDIF -->						
					</li>
					<!-- ENDIF -->
					<!-- END news_row_studmed -->
				</ul>
				</dd>
			</dl>
			<br style="clear:both" />		
		</div>
		
		<div style="display: none;" class="panel bg1" id="candmed-panel">
			<dl>
				<dd class="posts_portal"  style="border-left:0px">
				<ul class="news">
					<!-- BEGIN news_row_candmed -->
					<!-- IF news_row_candmed.S_NO_TOPICS -->
					<li>
					<span class="gensmall" style="text-align: center; margin: 0 0 0 5px;"><strong>{L_NO_NEWS}</strong></span>
					</li>
					<!-- ELSE -->
					<li>
						<span style="float: left; margin: 0 0 0 5px;"><img src="{T_THEME_PATH}/images/arrow_right.gif" alt=""/> 
						<!-- IF news_row_candmed.S_UNREAD_INFO -->{NEWEST_POST_IMG}<!-- ELSE -->{READ_POST_IMG}<!-- ENDIF --> {news_row_candmed.ATTACH_ICON_IMG}  <!-- IF news_row_candmed.S_POLL --><strong>{L_POLL}: </strong><!-- ENDIF --><a href="{news_row_candmed.U_LAST_COMMENTS}" title="{L_JUMP_NEWEST}"><strong style="font-size:1.1em;">{news_row_candmed.TITLE}</strong></a></span>
						<span style="float: right; margin: 0 5px 0 0;">{L_LAST_POST} {L_POST_BY_AUTHOR}: <strong><a href="{news_row_candmed.U_USER_PROFILE}">{news_row_candmed.POSTER}</a></strong></span>
						<br style="clear:both" />
						<!-- IF news_row_candmed.FORUM_NAME -->
						<span style="float: left; font-size:1.0em; margin: 2px 0 0 28px;">{L_FORUM}: <strong><a href="{news_row_candmed.U_VIEWFORUM}">{news_row_candmed.FORUM_NAME}</a></strong></span>
						<!-- ENDIF -->
						<span style="float: right; margin: 0 5px 0 0;">{L_POSTED_ON_DATE} <strong>{news_row_candmed.TIME}</strong></span>
						<br style="clear:both" />
						<span style="float: left; margin: 0 0 0 28px;">
							<a href="{news_row_candmed.U_VIEW_COMMENTS}" title="{L_JUMP_FIRST}"><span style="font-size:0.9em;"><em>{L_COMMENTS}: {news_row_candmed.REPLIES}</em></span></a>
							<span style="font-size:0.9em;"><em>{L_TOPIC_VIEWS}: {news_row_candmed.TOPIC_VIEWS}</em></span>
						</span>
						<!-- IF news_row_candmed.S_NOT_LAST --><hr style="margin: 0px 0px 3px 0px;" /><!-- ENDIF -->						
					</li>
					<!-- ENDIF -->
					<!-- END news_row_candmed -->
				</ul>
				</dd>
			</dl>
			<br style="clear:both" />		
		</div>
		
		<div style="display: none;" class="panel bg1" id="pda-panel">
			<dl>
				<dd class="posts_portal"  style="border-left:0px">
				<ul class="news">
					<!-- BEGIN news_row_pda -->
					<!-- IF news_row_pda.S_NO_TOPICS -->
					<li>
					<span class="gensmall" style="text-align: center; margin: 0 0 0 5px;"><strong>{L_NO_NEWS}</strong></span>
					</li>
					<!-- ELSE -->
					<li>
						<span style="float: left; margin: 0 0 0 5px;"><img src="{T_THEME_PATH}/images/arrow_right.gif" alt=""/> 
						<!-- IF news_row_pda.S_UNREAD_INFO -->{NEWEST_POST_IMG}<!-- ELSE -->{READ_POST_IMG}<!-- ENDIF --> {news_row_pda.ATTACH_ICON_IMG}  <!-- IF news_row_pda.S_POLL --><strong>{L_POLL}: </strong><!-- ENDIF --><a href="{news_row_pda.U_LAST_COMMENTS}" title="{L_JUMP_NEWEST}"><strong style="font-size:1.1em;">{news_row_pda.TITLE}</strong></a></span>
						<span style="float: right; margin: 0 5px 0 0;">{L_LAST_POST} {L_POST_BY_AUTHOR}: <strong><a href="{news_row_pda.U_USER_PROFILE}">{news_row_pda.POSTER}</a></strong></span>
						<br style="clear:both" />
						<!-- IF news_row_pda.FORUM_NAME -->
						<span style="float: left; font-size:1.0em; margin: 2px 0 0 28px;">{L_FORUM}: <strong><a href="{news_row_pda.U_VIEWFORUM}">{news_row_pda.FORUM_NAME}</a></strong></span>
						<!-- ENDIF -->
						<span style="float: right; margin: 0 5px 0 0;">{L_POSTED_ON_DATE} <strong>{news_row_pda.TIME}</strong></span>
						<br style="clear:both" />
						<span style="float: left; margin: 0 0 0 28px;">
							<a href="{news_row_pda.U_VIEW_COMMENTS}" title="{L_JUMP_FIRST}"><span style="font-size:0.9em;"><em>{L_COMMENTS}: {news_row_pda.REPLIES}</em></span></a>
							<span style="font-size:0.9em;"><em>{L_TOPIC_VIEWS}: {news_row_pda.TOPIC_VIEWS}</em></span>
						</span>
						<!-- IF news_row_pda.S_NOT_LAST --><hr style="margin: 0px 0px 3px 0px;" /><!-- ENDIF -->						
					</li>
					<!-- ENDIF -->
					<!-- END news_row_pda -->
				</ul>
				</dd>
			</dl>
			<br style="clear:both" />		
		</div>
		
		<div style="display: none;" class="panel bg1" id="bog-panel">
			<dl>
				<dd class="posts_portal"  style="border-left:0px">
				<ul class="news">
					<!-- BEGIN news_row_bog -->
					<!-- IF news_row_bog.S_NO_TOPICS -->
					<li>
					<span class="gensmall" style="text-align: center; margin: 0 0 0 5px;"><strong>{L_NO_NEWS}</strong></span>
					</li>
					<!-- ELSE -->
					<li>
						<span style="float: left; margin: 0 0 0 5px;"><img src="{T_THEME_PATH}/images/arrow_right.gif" alt=""/> 
						<!-- IF news_row_bog.S_UNREAD_INFO -->{NEWEST_POST_IMG}<!-- ELSE -->{READ_POST_IMG}<!-- ENDIF --> {news_row_bog.ATTACH_ICON_IMG}  <!-- IF news_row_bog.S_POLL --><strong>{L_POLL}: </strong><!-- ENDIF --><a href="{news_row_bog.U_LAST_COMMENTS}" title="{L_JUMP_NEWEST}"><strong style="font-size:1.1em;">{news_row_bog.TITLE}</strong></a></span>
						<span style="float: right; margin: 0 5px 0 0;">{L_LAST_POST} {L_POST_BY_AUTHOR}: <strong><a href="{news_row_bog.U_USER_PROFILE}">{news_row_bog.POSTER}</a></strong></span>
						<br style="clear:both" />
						<!-- IF news_row_bog.FORUM_NAME -->
						<span style="float: left; font-size:1.0em; margin: 2px 0 0 28px;">{L_FORUM}: <strong><a href="{news_row_bog.U_VIEWFORUM}">{news_row_bog.FORUM_NAME}</a></strong></span>
						<!-- ENDIF -->
						<span style="float: right; margin: 0 5px 0 0;">{L_POSTED_ON_DATE} <strong>{news_row_bog.TIME}</strong></span>
						<br style="clear:both" />
						<span style="float: left; margin: 0 0 0 28px;">
							<a href="{news_row_bog.U_VIEW_COMMENTS}" title="{L_JUMP_FIRST}"><span style="font-size:0.9em;"><em>{L_COMMENTS}: {news_row_bog.REPLIES}</em></span></a>
							<span style="font-size:0.9em;"><em>{L_TOPIC_VIEWS}: {news_row_bog.TOPIC_VIEWS}</em></span>
						</span>
						<!-- IF news_row_bog.S_NOT_LAST --><hr style="margin: 0px 0px 3px 0px;" /><!-- ENDIF -->						
					</li>
					<!-- ENDIF -->
					<!-- END news_row_bog -->
				</ul>
				</dd>
			</dl>
			<br style="clear:both" />				
		</div>		
		
		<div style="display: none;" class="panel bg1" id="salg-panel">
			<dl>
				<dd class="posts_portal"  style="border-left:0px">
				<ul class="news">
					<!-- BEGIN news_row_salg -->
					<!-- IF news_row_salg.S_NO_TOPICS -->
					<li>
					<span class="gensmall" style="text-align: center; margin: 0 0 0 5px;"><strong>{L_NO_NEWS}</strong></span>
					</li>
					<!-- ELSE -->
					<li>
						<span style="float: left; margin: 0 0 0 5px;"><img src="{T_THEME_PATH}/images/arrow_right.gif" alt=""/> 
						<!-- IF news_row_salg.S_UNREAD_INFO -->{NEWEST_POST_IMG}<!-- ELSE -->{READ_POST_IMG}<!-- ENDIF --> {news_row_salg.ATTACH_ICON_IMG}  <!-- IF news_row_salg.S_POLL --><strong>{L_POLL}: </strong><!-- ENDIF --><a href="{news_row_salg.U_LAST_COMMENTS}" title="{L_JUMP_NEWEST}"><strong style="font-size:1.1em;">{news_row_salg.TITLE}</strong></a></span>
						<span style="float: right; margin: 0 5px 0 0;">{L_LAST_POST} {L_POST_BY_AUTHOR}: <strong><a href="{news_row_salg.U_USER_PROFILE}">{news_row_salg.POSTER}</a></strong></span>
						<br style="clear:both" />
						<!-- IF news_row_salg.FORUM_NAME -->
						<span style="float: left; font-size:1.0em; margin: 2px 0 0 28px;">{L_FORUM}: <strong><a href="{news_row_salg.U_VIEWFORUM}">{news_row_salg.FORUM_NAME}</a></strong></span>
						<!-- ENDIF -->
						<span style="float: right; margin: 0 5px 0 0;">{L_POSTED_ON_DATE} <strong>{news_row_salg.TIME}</strong></span>
						<br style="clear:both" />
						<span style="float: left; margin: 0 0 0 28px;">
							<a href="{news_row_salg.U_VIEW_COMMENTS}" title="{L_JUMP_FIRST}"><span style="font-size:0.9em;"><em>{L_COMMENTS}: {news_row_salg.REPLIES}</em></span></a>
							<span style="font-size:0.9em;"><em>{L_TOPIC_VIEWS}: {news_row_salg.TOPIC_VIEWS}</em></span>
						</span>
						<!-- IF news_row_salg.S_NOT_LAST --><hr style="margin: 0px 0px 3px 0px;" /><!-- ENDIF -->						
					</li>
					<!-- ENDIF -->
					<!-- END news_row_salg -->
				</ul>
				</dd>
			</dl>
			<br style="clear:both" />		
		</div>
		
		<div style="display: none;" class="panel bg1" id="lasemakker-panel">
			<dl>
				<dd class="posts_portal"  style="border-left:0px">
				<ul class="news">
					<!-- BEGIN news_row_lasemakker -->
					<!-- IF news_row_lasemakker.S_NO_TOPICS -->
					<li>
					<span class="gensmall" style="text-align: center; margin: 0 0 0 5px;"><strong>{L_NO_NEWS}</strong></span>
					</li>
					<!-- ELSE -->
					<li>
						<span style="float: left; margin: 0 0 0 5px;"><img src="{T_THEME_PATH}/images/arrow_right.gif" alt=""/> 
						<!-- IF news_row_lasemakker.S_UNREAD_INFO -->{NEWEST_POST_IMG}<!-- ELSE -->{READ_POST_IMG}<!-- ENDIF --> {news_row_lasemakker.ATTACH_ICON_IMG}  <!-- IF news_row_lasemakker.S_POLL --><strong>{L_POLL}: </strong><!-- ENDIF --><a href="{news_row_lasemakker.U_LAST_COMMENTS}" title="{L_JUMP_NEWEST}"><strong style="font-size:1.1em;">{news_row_lasemakker.TITLE}</strong></a></span>
						<span style="float: right; margin: 0 5px 0 0;">{L_LAST_POST} {L_POST_BY_AUTHOR}: <strong><a href="{news_row_lasemakker.U_USER_PROFILE}">{news_row_lasemakker.POSTER}</a></strong></span>
						<br style="clear:both" />
						<!-- IF news_row_lasemakker.FORUM_NAME -->
						<span style="float: left; font-size:1.0em; margin: 2px 0 0 28px;">{L_FORUM}: <strong><a href="{news_row_lasemakker.U_VIEWFORUM}">{news_row_lasemakker.FORUM_NAME}</a></strong></span>
						<!-- ENDIF -->
						<span style="float: right; margin: 0 5px 0 0;">{L_POSTED_ON_DATE} <strong>{news_row_lasemakker.TIME}</strong></span>
						<br style="clear:both" />
						<span style="float: left; margin: 0 0 0 28px;">
							<a href="{news_row_lasemakker.U_VIEW_COMMENTS}" title="{L_JUMP_FIRST}"><span style="font-size:0.9em;"><em>{L_COMMENTS}: {news_row_lasemakker.REPLIES}</em></span></a>
							<span style="font-size:0.9em;"><em>{L_TOPIC_VIEWS}: {news_row_lasemakker.TOPIC_VIEWS}</em></span>
						</span>
						<!-- IF news_row_lasemakker.S_NOT_LAST --><hr style="margin: 0px 0px 3px 0px;" /><!-- ENDIF -->						
					</li>
					<!-- ENDIF -->
					<!-- END news_row_lasemakker -->
				</ul>
				</dd>
			</dl>
			<br style="clear:both" />		
		</div>
		
		</div>
		<span class="corners-bottom"><span></span></span>
	</div>
</div>
<br style="clear:both" />
OPEN
styles/prosilver/template/portal/portal_body.html

FIND

Code: Select all

		<!-- IF S_DISPLAY_ANNOUNCEMENTS -->
		<!-- IF S_ANNOUNCE_COMPACT -->
			<!-- INCLUDE portal/block/announcements_compact.html -->
		<!-- ELSE -->
			<!-- INCLUDE portal/block/announcements.html -->
		<!-- ENDIF -->
		<!-- ENDIF -->
AFTER ADD

Code: Select all

		<!-- INCLUDE portal/block/nyheder.html -->
OPEN
portal.php

FIND

Code: Select all

$template->assign_vars(array(
	'S_DISPLAY_JUMPBOX' 	=> $load_center,
	'PORTAL_LEFT_COLLUMN' 	=> $portal_config['portal_left_collumn_width'],
	'PORTAL_RIGHT_COLLUMN' 	=> $portal_config['portal_right_collumn_width'],
));
BEFORE ADD

Code: Select all

include($phpbb_root_path . 'portal/block/nyheder.'.$phpEx);
CREATE
portal/block/nyheder.php

PASTE IN

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,
			));
		}
	}
?>
SEE THIS TOPIC FOR EXPLAINATION OFF HOW TO ADD YOUR OWN CHANGES!!
viewtopic.php?f=9&t=604#p4293

Re: Tab based Latest News Block - advance skills needed!

Posted: 7. December 2008 20:23
by derkubi
Dyo wrote:Ähmmmmm derkubi,

genau kann ich's dir nicht sagen, weil ichs nicht installiert habe, aber wenn du ne recht neue MySQL fährst, dann musste mal die Join-Befehle nachgehen.
Habs bei mir mit MySQL 5.1 gehabt, dass einige Joins nicht mehr gingen, weil die DB (zurecht) sagt ohne eindeutig Schlüssel kein Join.
Die Teile über die also der Join läuft als Bedingung ( WHERE a.x = b.y ), das sollte je nach Richtung des Join in der zugehörigen Tabelle als Key definiert sein.

Könnte also gut daran liegen. Ansonsten mach dir phpMyAdmin auf und teste mit der query in der Queryeingabe aus was nicht stimmt.
Was dort läuft, läuft auch im Board.
1 . Die Fehlermeldung war für frold bestimmt ( @frold )

2 . Von dem was Du da erklärst weiß ich nicht mal die Hälfte vovon Du sprichst :D still beginner ....

Re: Tab based Latest News Block - advance skills needed!

Posted: 7. December 2008 20:31
by frold
I dont understand german!

Re: Tab based Latest News Block - advance skills needed!

Posted: 17. December 2008 10:56
by Kharon
I tested tab block five minutes ago,it is not working
viewtopic.php?p=9091#p9091

my phpBB version 3.0.4
my portal version 1.0.2

thank you

Code: Select all

[phpBB Debug] PHP Notice: in file /portal/includes/functions.php on line 74: Missing argument 6 for phpbb_fetch_posts(), called in /portal/block/nyheder.php on line 36 and defined
[phpBB Debug] PHP Notice: in file /portal/includes/functions.php on line 111: Undefined variable: type
[phpBB Debug] PHP Notice: in file /portal/includes/functions.php on line 128: Undefined variable: type
[phpBB Debug] PHP Notice: in file /portal/includes/functions.php on line 137: Undefined variable: type
[phpBB Debug] PHP Notice: in file /portal/includes/functions.php on line 147: Undefined variable: type
[phpBB Debug] PHP Notice: in file /portal/includes/functions.php on line 158: Undefined variable: type
[phpBB Debug] PHP Notice: in file /portal/includes/functions.php on line 226: Undefined variable: user_link
[phpBB Debug] PHP Notice: in file /portal/includes/functions.php on line 234: Undefined variable: post_link
[phpBB Debug] PHP Notice: in file /portal/includes/functions.php on line 239: Undefined variable: topic_type
[phpBB Debug] PHP Notice: in file /portal/includes/functions.php on line 245: Undefined variable: topic_order

Code: Select all

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') LEFT JOIN phpbb_forums f ON (t.forum_id=f.forum_id) LEFT JOIN phpbb_posts p ON' at line 35 [1064]
/portal/includes/functions.php on line 74

Code: Select all

function phpbb_fetch_posts($forum_from, $permissions, $number_of_posts, $text_length, $time, $type, $start = 0)

Re: Tab based Latest News Block - advance skills needed!

Posted: 20. August 2009 14:52
by quapor
any news :?:

Re: Tab based Latest News Block - advance skills needed!

Posted: 18. September 2009 22:12
by wascallywabbit
I just ran across this myself, and after messing with it for a bit, I get the error that most of the others have been dealing with. Has anyone, other than the author, had any luck getting it working right?