Code: Select all
AND t.forum_id = ".FORUM_ID."
Code: Select all
AND t.forum_id IN (4,5,6)
Code: Select all
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1006: Cannot modify header information - headers already sent by (output started at /blog.php:1)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1006: Cannot modify header information - headers already sent by (output started at /news.php:1)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1006: Cannot modify header information - headers already sent by (output started at /news.php:1)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3884: Cannot modify header information - headers already sent by (output started at /news.php:1)
The mod will only work if it's placed on the same server as your forums. It can't pull posts from another forum.globetrotting wrote:Sounds great!
Would FPNS help to display let's say the latest 5 thread titles on a foreign html-site?
If you're comfortable editing a bit of PHP code it should be rather straightforward to change that.c0le wrote:Great script, exactly what i was looking for. Just one question though, how would you modify this script to show data from multiple forum id's instead of just 1?
Code: Select all
AND t.forum_id = ".FORUM_ID."
Code: Select all
AND (t.forum_id = 5 OR t.forum_id = 3 OR t.forum_id = 16)
chAos wrote: If you're comfortable editing a bit of PHP code it should be rather straightforward to change that.
If you look at line 68:That controls which forums posts are taken from. If you replace it with something along the lines of:Code: Select all
AND t.forum_id = ".FORUM_ID."
that should do the trick (though I haven't tried it myself). You should be able to notice the pattern in the code above, just change the ID's to the actual ones you want. If you need to add more forums just append OR t.forum_id = ## to the part before the ).Code: Select all
AND (t.forum_id = 5 OR t.forum_id = 3 OR t.forum_id = 16)
Code: Select all
AND t.forum_id IN (4,5,6,7,8,9)
Hey,fealey wrote:Hi There,
I'm new to PHP and new to installing modifications.
I've followed the instructions for this mod to the letter and am getting the following error:
Fatal error: Call to a member function on a non-object in /homepages/11/d262789372/htdocs/The_Gig_Tree/phpBB3/news.php on line 55
any ideas?!
Many Thanks in advance.
Code: Select all
define('PHPBB_ROOT_PATH', './forums/'); // Path to phpBB (including trailing /)
Cool, I'll update the FAQ post at the top.c0le wrote:chAos wrote: If you're comfortable editing a bit of PHP code it should be rather straightforward to change that.
If you look at line 68:That controls which forums posts are taken from. If you replace it with something along the lines of:Code: Select all
AND t.forum_id = ".FORUM_ID."
that should do the trick (though I haven't tried it myself). You should be able to notice the pattern in the code above, just change the ID's to the actual ones you want. If you need to add more forums just append OR t.forum_id = ## to the part before the ).Code: Select all
AND (t.forum_id = 5 OR t.forum_id = 3 OR t.forum_id = 16)
i found out you can reduce what you wrote, makes it just a lil bit easier. =)Code: Select all
AND t.forum_id IN (4,5,6,7,8,9)
Code: Select all
AND (t.forum_id = /* forum id */)
Code: Select all
'WHERE' => '(' . $db->sql_in_set('t.forum_id', $fora_ids) . ' AND p.post_id = t.topic_first_post_id)',
Yeah, I'm guessing that should be used for compatability with non-mysql databases though I didn't really bother with that at the time since I had to write the query myself and I was using MySQL. When I get time I might look into using the in built methods for building queries.Desdenova wrote:Oh, nice. I spotted something you may want to change, though, chAos.
I think you may want to try changing the line regardingto something that is built exactly for this, $db->sql_in_set()Code: Select all
AND (t.forum_id = /* forum id */)
All you'll need to do to get $db->sql_in_set() is just provide a simple array of ID's and it will automatically build the set of "AND var = id" bits for you, like so..Mind you, I'm using $db->sql_build_query()'s syntax for my where clause. Alter it to what you need, and define $fora_ids as the forums to pull from. (like array(3, 5, 6))Code: Select all
'WHERE' => '(' . $db->sql_in_set('t.forum_id', $fora_ids) . ' AND p.post_id = t.topic_first_post_id)',