View Full Version : Latest Posts Adjustment
chrisbr
01-30-2013, 08:27 PM
Hi All,
Wondering if anyone tehhnical can help, I have the following php script below to call the latest posts from my forum to my php based homepage.
However, as the eagle eyed upon you will notice, this script will exclue certain forums, nothing wrong with this BUT, i need to change the script so it will old check one forum ID
Can anyone point me in the right direction?
Thanks
cellarius
01-31-2013, 07:11 AM
$exclude = array('15','22');
That's the part that defines the forumids of the excluded forums. Add or remove ids there, it's a comma seperated list as you can see.
Amaury
01-31-2013, 07:22 AM
An easier way to get latest posts is to just use a forum block.
No work needs to be done and no scripts are needed. Just add it.
Admin CP -> Forums & Moderates -> Forum Blocks Manager -> Add Block
Select Block Type: New Forum Posts
Configure the options to your liking and click Save.
cellarius
01-31-2013, 09:15 AM
You can't use a forumblock on a non vB-Site, obviously. And that's what he's doing.
chrisbr
01-31-2013, 05:21 PM
Thanks for the reply all, Cellarius is right in saying that I want to be able to put the latest posts on a non VB page, however whilst I realise that $exclude = array('15','22'); is where I need to setup the forum excludes, I would have to enter ALL my forum ID's and remember to keep this updated whenever I see fit to add a new forum.
This is why I need to be able to change the code so that I can just select a single Forum ID as I only want the posts from a particular forum to be displayed.
I did wonder if I needed to change WHERE forumid NOT IN (" . $exclude_list . ")
but I am not a mysql/php expert so I have no idea where to start!
I have managed to solve this, Please can a moderator close!
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.