PDA

View Full Version : Where should I store these variables?


JamesAB
11-22-2008, 01:07 AM
I am planning on creating some custom stats once per day and storing the results in a mySQL table.

I'd like to display the stats on FORUMHOME and a few other places.

I'm thinking that adding another query to each of these pages for information that is only updated every 24 hours may be a waste of resources.


Should I try to figure out a way to store each of the stats as a vBulletin phrase?

Should I store them in a flat file elsewhere?
Should I just get them from a mySQL query every time?
Or is there a better way to look at this?

I'm looking for the most efficient way to handle this on a busy forum.

Thanks,

James

Dismounted
11-22-2008, 08:00 AM
You can use the vBulletin datastore to store such data. I believe there is an article about this - look for it.

Antivirus
11-22-2008, 01:51 PM
Datastore is definitely the way to go. Have yur script run as a scheduled task once per day, storing the info in the datastore, then using a plugin in forumhome you can simply acces the data using $vbulletin->mydatastorefield. The article Dismounted mentions above is excellent. I think you can find it by searching the articles forum for the term cache or serialize

JamesAB
11-23-2008, 06:11 PM
Thanks for the replies Dismounted & Antivirus.

I didn't realize (until now) that the vBulletin datastore could be extended this way. It sounds like just the solution I need.

Thanks again,
James