Displaying posts on external page from selected forums only
Posted: Tue Jul 10, 2012 2:38 pm
Hi Battye,
My name's Stewart, I'm currently working on a website for a Scout group in the South West of England. I recently came across your post regarding displaying phpBB posts on an external page - a perfect solution for what I was wanting to do! However, there is just one small problem that I can't figure out - probably due to having no PHP knowledge whatsoever. If you could give some help, it would be very much appreciated!
I'm working with example 3, displaying the last 10 posts from specific forums only. If I use the code:
$forum_id = array(3);
$forum_id_where = create_where_clauses($forum_id, 'forum');
Then the error 'A list of topics/forums has not been created' is returned, which is correct (Forum 3 doesn't refer to any forum in existance on the board I'm using.) So, this shows me that the code is able to 'ignore' all non-relevant forums if an irrelevant number is selected in the array. I then try using the code:
$forum_id = array(19);
$forum_id_where = create_where_clauses($forum_id, 'forum');
This time, Forum 19 does exist. This is where the code runs into a problem for me - the script will select the relevant posts from Forum 19, which is fine, but it will also take the posts from the rest of the board too. It doesn't read solely from 19. On the upside, it does still adhere to only retrieving posts that the user is allowed to see (so it hides certain posts of the user isn't logged in.)
As I say, I don't have the knowledge to be able to scrutinise the code, I can only make the more obvious changes here and there. I can't see where the error is occuring, nor have I been able to find anyone with a similar problem online.
Any help would be great, though I appreciate you've probably got a lot of other things to do!
Kind regards,
Stewart Allan
My name's Stewart, I'm currently working on a website for a Scout group in the South West of England. I recently came across your post regarding displaying phpBB posts on an external page - a perfect solution for what I was wanting to do! However, there is just one small problem that I can't figure out - probably due to having no PHP knowledge whatsoever. If you could give some help, it would be very much appreciated!
I'm working with example 3, displaying the last 10 posts from specific forums only. If I use the code:
$forum_id = array(3);
$forum_id_where = create_where_clauses($forum_id, 'forum');
Then the error 'A list of topics/forums has not been created' is returned, which is correct (Forum 3 doesn't refer to any forum in existance on the board I'm using.) So, this shows me that the code is able to 'ignore' all non-relevant forums if an irrelevant number is selected in the array. I then try using the code:
$forum_id = array(19);
$forum_id_where = create_where_clauses($forum_id, 'forum');
This time, Forum 19 does exist. This is where the code runs into a problem for me - the script will select the relevant posts from Forum 19, which is fine, but it will also take the posts from the rest of the board too. It doesn't read solely from 19. On the upside, it does still adhere to only retrieving posts that the user is allowed to see (so it hides certain posts of the user isn't logged in.)
As I say, I don't have the knowledge to be able to scrutinise the code, I can only make the more obvious changes here and there. I can't see where the error is occuring, nor have I been able to find anyone with a similar problem online.
Any help would be great, though I appreciate you've probably got a lot of other things to do!
Kind regards,
Stewart Allan