PDA

View Full Version : What is the best way to fetch the 'x' latest articles in the CMS?


Yellow Slider
06-01-2010, 07:07 PM
I'm building a widget that will diaplay the 'x' latest articles on the forumhome.
for every article I need the following information -


title
url
preview text
one of the attachments (will be displayed)
STAMP (for the date)


I'm going to use the datastore and a cron that will build the datastore every 10 min' to update the information, so there won't be any "heavy" queries on the front page for every refresh, just fetching data from the datastore (is there a better solution?)

is there a manual of how I should use the datastore in vB4?

I'll be happy to hear your solution for that.

Carnage
06-03-2010, 02:40 PM
If you are making a forum block, the output is cached automatically.

I don't recall how to do this off the top of my head, but its also possible to use the vb_cache object to store your data. You can then listen for certain events which will automatically clear the cache (eg when a new article is posted)