Well, I've noticed a few people holding off upgrading to UBB.T7 due to a couple of mod's not being out, so I decided to tackle one myself...
Please note that I am no way saying that I know MySQL remotely well, and I'm not a PHP expert either... This script has 0 caching, and could verywell b0g your server, but hey, thats not why we're here now is it ...
Name: UBB.News Version: 0.1 Release Date: 10.11.2006 Install Instructions: Extract the zip and edit the inc.ubb_news.php file to reflect your settings. I've gone ahead and added the ability to specify the ammount of news stories you want to see as well as the forum you're relaying from via the URL you're loading the file from.
I recommend using a php include (well any type of include) to call the file from the web, I do not recommend calling it from your scripts via the file directly.
This file can have a potential for abuse, one thing I know can be done is it accessing private forums, so I wouldn't recommend allowing public access to it.
I don't doubt that the script can be streamlined and I will no doubt get flogged by Dave and Rick due to several db hits and no caching, but hey, I did do this for fun afterall ...
With some pointers from a friend I will be compressing the query down to one query vs the 3 (topic, user, and post); I'll be working on this later tonight and should have it done by the weekend...
I've already made several updates to the script, but all in all I'm satisfied with it for my v0.1 lol...
Also, I neglected to mention that you can just access the script through http://www.yoursite.tld/inc.news.php so long as you have set a default forum and a default value for max entries. You can also set it so people cannot specify a forum or the max ammount of stories...
A future version may allow for specifying a check for the max stories should it be of interest... It'd be a pain to have a user pull 5k posts afterall...
The dev version will be one db hit vs 3, but I'm having some issues dealing with it right now, like I said it'll probably be the weekend before I get that far lol
Absolutely 0 caching is done through this, as i haven't decided the best way to go about it; the data is pulled from the db on page load (as you can see from the code).
For note, Ian's working on a modification (versus my addon) which will support both user permissions and utilizes the cache; it looks very promising (ofcoarse i'd say that since it's using my html lol)...
It'll work much the same way as my addon for calling the news; only i've asked him to set it up to do headlines as well (so installing it twice to achieve a headline and a story in the same place won't be needed).
umm, it works? lol... I stopped development on it with the copy i'm runnign on my site; Ian's coming up wiht a better version that follows permissions and the like.
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.