Second news block / zweiter News Block

Forum rules
This forum is not for support requests.

Only post Modifications for Board3 Portal 1.0.x in this forum.
User avatar

Topic author
Kevin
Site Admin
Posts: 2989
Joined: 7. January 2006 20:11
phpBB.de User: Saint
phpBB.com User: Saint_hh
Location: Hamburg
Contact:

Second news block / zweiter News Block

Post by Kevin »

In der Vergangenheit wurde häufiger mal nachgefragt, ob man einen zweiten Newsblock (aktuelle Beiträge) einbinden kann, der aus einem gewählten Forum die Beiträge anzeigt.
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:
additional_news_block_files.zip
(5.76 KiB) Downloaded 1704 times
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)    
Der Name des Blocks kann in dieser Zeile in der faq.html geändert werden (ändere Harmony FAQ )
-------------------------------------
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']) 
füge davor ein / add before:

Code: Select all

include($phpbb_root_path . 'portal/block/faq.'.$phpEx); 
root/portal/includes/functions.php

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; 
füge danach ein / add after:

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; 
suche / search:

Code: Select all

case "news_all":
             $pagination_type = 'np';
             $anker = '#n';
          break; 
füge danach ein / add after

Code: Select all

          case "faq":
             $pagination_type = 'faq_page';
             $anker = '#faq';
          break; 
~~~ They say the definition of madness is doing the same thing and expecting a different result ~~~

Kein Support per PN / No support via PM!

kitkat
Active Member
Posts: 2
Joined: 3. September 2009 23:47

Re: Second news block / zweiter News Block

Post by kitkat »

Hi,
Thanks for guide but can you add for based on subsilver2 theme?
i tried this, but nothing changed
User avatar

Topic author
Kevin
Site Admin
Posts: 2989
Joined: 7. January 2006 20:11
phpBB.de User: Saint
phpBB.com User: Saint_hh
Location: Hamburg
Contact:

Re: Second news block / zweiter News Block

Post by Kevin »

I'm sorry, I have absolutely no free time at the moment to do it.
Merge the changes (variable names) in the prosilver template with a original one (e.g. with WinMerge), see how the variable names have been changed and adapt it to subsilver2.
And share the result. ;)
~~~ They say the definition of madness is doing the same thing and expecting a different result ~~~

Kein Support per PN / No support via PM!

Kharon
Active Member
Posts: 28
Joined: 18. May 2008 10:01

Re: Second news block / zweiter News Block

Post by Kharon »

? don't understand ..

archive feature does not work .. How can I run the news archive ?


archive feature works here
Demo: http://www.harmony-remote-forum.de --> Block Harmony FAQ



Image
sorry my english
User avatar

Topic author
Kevin
Site Admin
Posts: 2989
Joined: 7. January 2006 20:11
phpBB.de User: Saint
phpBB.com User: Saint_hh
Location: Hamburg
Contact:

Re: Second news block / zweiter News Block

Post by Kevin »

This is the responsible part for the archive (in root/portal/includes/functions.php):
Kevin wrote:suche / search:

Code: Select all

case "news_all":
             $pagination_type = 'np';
             $anker = '#n';
          break;  
füge danach ein / add after

Code: Select all

          case "faq":
             $pagination_type = 'faq_page';
             $anker = '#faq';
          break;  
~~~ They say the definition of madness is doing the same thing and expecting a different result ~~~

Kein Support per PN / No support via PM!

Kharon
Active Member
Posts: 28
Joined: 18. May 2008 10:01

Re: Second news block / zweiter News Block

Post by Kharon »

okay,I understand

I add this code block .. but it is not working (archive) ?

How will archive be active ?

e.g.
Enable the news archive system:
If enabled the news archive system / page numbers will be displayed.
thank you
sorry my english
User avatar

Topic author
Kevin
Site Admin
Posts: 2989
Joined: 7. January 2006 20:11
phpBB.de User: Saint
phpBB.com User: Saint_hh
Location: Hamburg
Contact:

Re: Second news block / zweiter News Block

Post by Kevin »

There is no option in the ACP implemented.

Link to your side?
~~~ They say the definition of madness is doing the same thing and expecting a different result ~~~

Kein Support per PN / No support via PM!

Kharon
Active Member
Posts: 28
Joined: 18. May 2008 10:01

Re: Second news block / zweiter News Block

Post by Kharon »

sorry,kevin.. :oops:

it is working :)


Thank you for block
User avatar

Topic author
Kevin
Site Admin
Posts: 2989
Joined: 7. January 2006 20:11
phpBB.de User: Saint
phpBB.com User: Saint_hh
Location: Hamburg
Contact:

Re: Second news block / zweiter News Block

Post by Kevin »

Fine, glad to hear it's working! :)
~~~ They say the definition of madness is doing the same thing and expecting a different result ~~~

Kein Support per PN / No support via PM!

Kharon
Active Member
Posts: 28
Joined: 18. May 2008 10:01

Re: Second news block / zweiter News Block

Post by Kharon »

I have a question.. How do I make multi-forum (ID's)

// Customize
$faq_forum = 5,7,9; // Forum we get the FAQ from


thank you
User avatar

Topic author
Kevin
Site Admin
Posts: 2989
Joined: 7. January 2006 20:11
phpBB.de User: Saint
phpBB.com User: Saint_hh
Location: Hamburg
Contact:

Re: Second news block / zweiter News Block

Post by Kevin »

Kharon wrote:I have a question.. How do I make multi-forum (ID's)
Just like this:

Code: Select all

// Customize
$faq_forum = '5,7,9'; // Forum we get the FAQ from    
~~~ They say the definition of madness is doing the same thing and expecting a different result ~~~

Kein Support per PN / No support via PM!

Kharon
Active Member
Posts: 28
Joined: 18. May 2008 10:01

Re: Second news block / zweiter News Block

Post by Kharon »

How can I do by topic ID

// Customize
$faq_topic_ID = '5,7,9'; // Forum we get the FAQ from

thanks

Kharon
Active Member
Posts: 28
Joined: 18. May 2008 10:01

Re: Second news block / zweiter News Block

Post by Kharon »

bump

viewtopic.php?p=19594#p19594

edit: I changed the above post

Mess
Active Member
Posts: 32
Joined: 10. September 2009 15:08
phpBB.com User: Mess

Re: Second news block / zweiter News Block

Post by Mess »

Hmm... I can't seem to get this working. Should it work with the latest portal and 3.0.8?
Would having portal.php outside phpbb's root directory break it?

bayer04forum
Active Member
Posts: 2
Joined: 14. June 2011 21:16
phpBB.com User: bayer04forum

Re: Second news block / zweiter News Block

Post by bayer04forum »

Kevin wrote:
root/portal.php

suche / search:

Code: Select all

if ($portal_config['portal_poll_topic']) 
füge davor ein / add before:

Code: Select all

include($phpbb_root_path . 'portal/block/faq.'.$phpEx); 
I also can't get it working (Phpbb 3.08 + Board3 1.6).

All the "includes" of the blocks in the current 1.6 portal.php file are written differently (with a space in the file extension)

Code: Select all

include($phpbb_root_path . 'portal/block/mini_cal.'[b] . [/b]$phpEx);
I tried to adapt that, but it didn't work.

I guess other Variables could have changed too.

Can any expert around here confirm if this is still working or not? Thanks! ;)
Locked

Return to “board3 Portal v1.0.x - Modifications in Dev”