Front Page News Syndication

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in the Customisations Database.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTICE: This forum is only for the announcement of new releases and/or updates of MODs. Any MOD support should be obtained through the Customisations Database in the support area designated for each MOD.

A direct link to support for each MOD is in the first post of the respective topic.
Locked
haywarc
Registered User
Posts: 10
Joined: Sun Feb 15, 2009 5:50 am
Contact:

Re: Front Page News Syndication

Post by haywarc »

ge_rpger wrote:I followed the edit in basra's latest post http://www.phpbb.com/community/posting. ... #pr8755605 but I'm getting the following error.

Code: Select all

Fatal error: Class 'bbcode' not found in /public_html/phpBB3/news.php on line 94
And line 94 or there about is the following code

Code: Select all

        // Instantiate BBCode
        if ($bbcode_bitfield !== '')
        {
           $bbcode = new bbcode(base64_encode($bbcode_bitfield));
        }
I'm trying to place this "news" on my home.php page and that's the error I'm getting.

Do you have the following line at the top of your file?

Code: Select all

include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
If not add the above line after

Code: Select all

define('PHPBB_ROOT_PATH', './forum/');   // Path to phpBB (including trailing /)
ge_rpger
Registered User
Posts: 81
Joined: Sat Jul 24, 2004 2:20 pm

Re: Front Page News Syndication

Post by ge_rpger »

Yeah, it's in there, but its down further in the file. I tried removing from where it was and then placing it where you said, and it didn't change anything.

Here's a partial of my file...

Code: Select all

        /** Notes:
        *
        * - Attachments haven't been handled properly.
        * - Starts a forum session as Guest user, taking all the default values for time, bbcode style (from theme), etc
        * - While viewing this page, users will appear to be viewing the Forum Index on viewonline.php.
        *   This can't be helped without modifying other code which is beyond this
        *
        */


        //////////////////////////////////////
        //

        define('FORUM_ID', 61);                    // Forum ID to get data from
        define('POST_LIMIT', 7);                  // How many to get
        define('PHPBB_ROOT_PATH', 'http://drtfa.com/phpBB3/');   // Path to phpBB (including trailing /)
		
        define('PRINT_TO_SCREEN', true);         

                 // If set to true, it will print the posts out
                 // If set to false it will create an array $news[] with all the following info
                 //
                 //   'topic_id'         eg. 119
                 //   
                 //   'topic_time'      eg. 06 June, 07 (uses board default)
                 //   'topic_replies'      eg. 26
                 //   
                 //   'username'         eg. chAos
                 //   'topic_title'      eg. "News Post"
                 //   
                 //   'post_text'         eg. just the text (formatted w/ smilies, bbcode, etc)

        //
        //////////////////////////////////////

        define('IN_PHPBB', true);
        $phpbb_root_path = PHPBB_ROOT_PATH;
        $phpEx = substr(strrchr(__FILE__, '.'), 1);
        include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
        include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
        global $db;

        // Grab user preferences
        $user->setup();
alienbabeltech
Registered User
Posts: 415
Joined: Mon Sep 17, 2007 12:54 pm

Re: Front Page News Syndication

Post by alienbabeltech »

does this work wit ha Wordpress Blog ?
This is the best and most helpful community I have been on. You are some of the best people I have met. GOD Bless You ALL !
My Forum - http://alienbabeltech.com/abt/index.php
User avatar
Valace
Registered User
Posts: 177
Joined: Sat Sep 20, 2008 9:40 pm

Re: Front Page News Syndication

Post by Valace »

Any ideas if this works for phpBB 3.0.2?

Reason I say is I installed and I am getting blank page :(
Image - Help look after the Earth and get green hosting
Free Domain: http://www.co.cc
User avatar
Valace
Registered User
Posts: 177
Joined: Sat Sep 20, 2008 9:40 pm

Re: Front Page News Syndication

Post by Valace »

ok fixed and yes it does work for that version :D

Is it possable for it to list only the subject line and not the contents with it or the date and comment part?

This way it can be just a news box :)
Image - Help look after the Earth and get green hosting
Free Domain: http://www.co.cc
ge_rpger
Registered User
Posts: 81
Joined: Sat Jul 24, 2004 2:20 pm

Re: Front Page News Syndication

Post by ge_rpger »

OK, I can get this to "work", but it doesn't appear to be pulling stuff from more than one forum ID? I changed the parameters, and it is still showing the "old" forum. I've purged the cache, but still nothing different. I've altered the following lines

Code: Select all

define('FORUM_ID', 61);
to

Code: Select all

define('FORUM_ID', 69);
but it is still showing forum 61... and

Code: Select all

    AND t.forum_id = ".FORUM_ID." 
to

Code: Select all

    AND t.forum_id IN (23,69,82)
or

Code: Select all

AND (t.forum_id = 23 OR t.forum_id = 69 OR t.forum_id = 82)
and it's still only showing forum 61.

As I said, I've refreshed the templates, and purged the cache, even closed my browsers and restarted them and still it's not showing anything other than my original forum ID and no others.

Any ideas?
ge_rpger
Registered User
Posts: 81
Joined: Sat Jul 24, 2004 2:20 pm

Re: Front Page News Syndication

Post by ge_rpger »

OK, well I figured something out.

In the lines of code

Code: Select all

define('FORUM_ID', 61);
Whatever you change that number to, is the forum it says you will be replying in, not the actual forum where the post really is. However, after you post, it shows up in the right spot.

in the secondary lines of code

Code: Select all

AND (t.forum_id = 23 OR t.forum_id = 69 OR t.forum_id = 82 OR t.forum_id = 61)
ALL of the forums that you want your information from must be on that line.

So, my question is, how do we fix that first line of coding? Because, if a post comes from forum 23, I'd like it to say, that's where you're going. I mean, everything works just fine, I was just wondering if it's a potential issue.
User avatar
chAos
Former Team Member
Posts: 4032
Joined: Wed Jan 16, 2002 7:05 am
Location: Seattle, WA, US

Re: Front Page News Syndication

Post by chAos »

Appologies, I've been busy with semester just starting up again.
ge_rpger wrote:So, my question is, how do we fix that first line of coding? Because, if a post comes from forum 23, I'd like it to say, that's where you're going. I mean, everything works just fine, I was just wondering if it's a potential issue.
If I'm understanding you correctly, then you're talking about the post subject link directing you always to the forum specified by FORUM_ID?

If yes, then look at around line 126

Code: Select all

      echo "\n<h4 class=\"postinfo\">".$user->format_date($m['topic_time'])." // <a href=\"".PHPBB_ROOT_PATH."viewtopic.php?f=".FORUM_ID."&t={$m['topic_id']}\">{$m['topic_replies']} {$comment}</a> // {$m['username']}</h4>"; 
Change that to

Code: Select all

      echo "\n<h4 class=\"postinfo\">".$user->format_date($m['topic_time'])." // <a href=\"".PHPBB_ROOT_PATH."viewtopic.php?f={$m['forum_id']}&t={$m['topic_id']}\">{$m['topic_replies']} {$comment}</a> // {$m['username']}</h4>"; 
slxception wrote:I noticed a serious flaw with this mod, and I'm hoping this can be addressed:

The file says it starts a session as a Guest user. But the forum I have used to pull the topics from requires login to see. (Mind you, I'm just testing right now.) Even when I'm logged out, it will show posts from this forum. If it can pull settings as if a guest, but show protected forums, that's like circumventing security rules, and can be a serious issue. Is this behavior intentional?
That's correct in that it'll display posts from a protected forum even if a login is normally required, but an end user cannot change which forum is being shown - that's totally in your control. If you want it to only display the news if the user is logged in, then that'll require a bit of extra code. Off the top of my head...

Code: Select all

if(!$user->data['is_registered'])
{
      // user isn't logged in, do something
      exit();
} 
wolf2009 wrote:does this work wit ha Wordpress Blog ?
Nope, it's a single script that depends on phpBB.
Valace wrote:ok fixed and yes it does work for that version :D

Is it possable for it to list only the subject line and not the contents with it or the date and comment part?

This way it can be just a news box :)
If you find this block of code (near line 124):

Code: Select all

      echo "\n\n<h3>{$m['topic_title']}</h3>";
      echo "\n<h4 class=\"postinfo\">".$user->format_date($m['topic_time'])." // <a href=\"".PHPBB_ROOT_PATH."viewtopic.php?f=".FORUM_ID."&t={$m['topic_id']}\">{$m['topic_replies']} {$comment}</a> // {$m['username']}</h4>";
      echo "\n<p>{$message}</p>"; 
change it to just

Code: Select all

       echo "\n<p>{$m['topic_title']}</p>"; 
Last edited by chAos on Tue Mar 10, 2009 1:27 pm, edited 1 time in total.
ge_rpger
Registered User
Posts: 81
Joined: Sat Jul 24, 2004 2:20 pm

Re: Front Page News Syndication

Post by ge_rpger »

chAos, you're awesome thank you so very much!!!
Ixzion
Registered User
Posts: 7
Joined: Mon Mar 09, 2009 10:52 pm

Re: Front Page News Syndication

Post by Ixzion »

Valace wrote:Any ideas if this works for phpBB 3.0.2?

Reason I say is I installed and I am getting blank page :(
I am using 3.0.4 fresh install but I'm getting the same blank page. Can you tell me what you did to fix that?
IexcelU
Registered User
Posts: 22
Joined: Wed Mar 25, 2009 2:20 pm

Re: Front Page News Syndication

Post by IexcelU »

i must be an idiot or im completly missing something

Code: Select all

Warning: main(./forums/common.php) [function.main]: failed to open stream: No such file or directory in /home/freepatr/public_html/forums/news.php on line 50

Warning: main(./forums/common.php) [function.main]: failed to open stream: No such file or directory in /home/freepatr/public_html/forums/news.php on line 50

Warning: main(./forums/common.php) [function.main]: failed to open stream: No such file or directory in /home/freepatr/public_html/forums/news.php on line 50

Warning: main() [function.include]: Failed opening './forums/common.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/freepatr/public_html/forums/news.php on line 50

Warning: main(./forums/includes/functions_display.php) [function.main]: failed to open stream: No such file or directory in /home/freepatr/public_html/forums/news.php on line 51

Warning: main(./forums/includes/functions_display.php) [function.main]: failed to open stream: No such file or directory in /home/freepatr/public_html/forums/news.php on line 51

Warning: main(./forums/includes/functions_display.php) [function.main]: failed to open stream: No such file or directory in /home/freepatr/public_html/forums/news.php on line 51

Warning: main() [function.include]: Failed opening './forums/includes/functions_display.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/freepatr/public_html/forums/news.php on line 51

Warning: main(./forums/includes/bbcode.php) [function.main]: failed to open stream: No such file or directory in /home/freepatr/public_html/forums/news.php on line 52

Warning: main(./forums/includes/bbcode.php) [function.main]: failed to open stream: No such file or directory in /home/freepatr/public_html/forums/news.php on line 52

Warning: main(./forums/includes/bbcode.php) [function.main]: failed to open stream: No such file or directory in /home/freepatr/public_html/forums/news.php on line 52

Warning: main() [function.include]: Failed opening './forums/includes/bbcode.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/freepatr/public_html/forums/news.php on line 52

Fatal error: Call to a member function on a non-object in /home/freepatr/public_html/forums/news.php on line 55
my website's forums are located at url.com/forums i also have them setup in forums.url.com subdomain form as well....

news section i edited

Code: Select all

define('FORUM_ID', 5);                    // Forum ID to get data from
define('POST_LIMIT', 2);                  // How many to get
define('PHPBB_ROOT_PATH', './forums/');   // Path to phpBB (including trailing /)
lines 25,26,27 respectively

Code: Select all

AND t.forum_id IN (4,12,5)
Line 68

I'm trying to get the top two news posts from each forum section and seperate them into 3 seperate news area's on the same webpage...

if that makes any sense...

Basically it goes like


NAV US NEWS NAV
NAV US NEWS NAV
NAV World News NAV
NAV World News NAV
NAV Site News NAV
NAV Site News NAV

Thats how i want it basically... thanks for any help you can give ahead of time
User avatar
w00t!
Registered User
Posts: 179
Joined: Thu Feb 12, 2009 12:33 am
Location: Santiago, Chile

Re: Front Page News Syndication

Post by w00t! »

Hey again guys:

I was checking my site with IE (which I barely use) and I noticed the linked images I have within the news are with a blue border, while in Firefox and other browser they are displayed correctly in red (matching the links and theme of my site). Many people who visit my site still uses IE (I wonder why? haha) so I'd like to eliminate the only difference seen in my site when displayed on different browsers. Any help on it?

Thanks!
User avatar
chAos
Former Team Member
Posts: 4032
Joined: Wed Jan 16, 2002 7:05 am
Location: Seattle, WA, US

Re: Front Page News Syndication

Post by chAos »

w00t! wrote:Hey again guys:

I was checking my site with IE (which I barely use) and I noticed the linked images I have within the news are with a blue border, while in Firefox and other browser they are displayed correctly in red (matching the links and theme of my site). Many people who visit my site still uses IE (I wonder why? haha) so I'd like to eliminate the only difference seen in my site when displayed on different browsers. Any help on it?

Thanks!
That'd be a CSS issue.

Code: Select all

a img, a img:visited { border-color: red; }
User avatar
w00t!
Registered User
Posts: 179
Joined: Thu Feb 12, 2009 12:33 am
Location: Santiago, Chile

Re: Front Page News Syndication

Post by w00t! »

Thanks for the reply, that worked! :)

I tried with a:link { color: red } but never worked because it didn't affect the link but the linked images only.
User avatar
nicke157
Registered User
Posts: 48
Joined: Sun Nov 09, 2008 11:02 pm
Contact:

Re: Front Page News Syndication

Post by nicke157 »

EDIT: Now i see :D
Locked

Return to “[3.0.x] MOD Database Releases”