Das brauchte ich nun selbst und stelle euch das mal zur Verfügung. Dieser Block ist als FAQ aufgebaut, der die FAQ Beiträge aus einem Forum zieht und gesondert auf dem Portal darstellt. Variable und Namen müsst ihr euch ggf selbst anpassen.
In diesem Block wird die Textansicht verwendet, nicht die kompakte Ansicht. Für die kompakte Ansicht könnt ihr diesen Block als Gedankenanstoß nehmen.
-------------------------------------
In the past some people have asked for an additional news block who is displaying news from a specific forum. Now i needed it myself and want to share the result. This block is build up as a FAQ block, who is getting the posts of a specific forum and display them in a seperate block. You may have to adapt the names and variables yourself.
This block is the textview of the news block - not the compact view. If you want to have the compact view, you may take this block as a "roadmap".
Demo: http://www.harmony-remote-forum.de --> Block Harmony FAQ
Template: prosilver
Benötigte Dateien / Needed files: Du kannst darin ein paar Parameter nach deinen Wünschen anpassen
-------------------------------------
You may adjust a few parameters to your needs in these files:
faq.php
Code: Select all
// Customize
$faq_forum = 35; // Forum we get the FAQ from
$faq_number = 1; // Number of FAQs to be displayed
$faq_length = 0; // Number of chars to be displayed (untill read all appears)
-------------------------------------
The name of the block can be changed in this line in the faq.html (change Harmony FAQ )
Code: Select all
{$C_BLOCK_H_L}<dl><dt>Harmony FAQ</dt></dl>{$C_BLOCK_H_R}
Benötigte Änderungen am Portal System:
-------------------------------------
Needed changes to the portal system:
root/portal.php
suche / search:
Code: Select all
if ($portal_config['portal_poll_topic'])
Code: Select all
include($phpbb_root_path . 'portal/block/faq.'.$phpEx);
suche / search:
Code: Select all
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;
Code: Select all
case "faq":
$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;
Code: Select all
case "news_all":
$pagination_type = 'np';
$anker = '#n';
break;
Code: Select all
case "faq":
$pagination_type = 'faq_page';
$anker = '#faq';
break;