Quote:
Originally Posted by kh99
It seems to me that if you are doing it in a plugin that will be run every page access, then maybe the easiest thing would be to just create a global variable to hold the answer and change the templates to use it instead of the phrase (or in addition to a phrase). I think you can just add to $vbulletin by making up a unique key, but to be honest I'm not sure if that's the "accepted" practice.
|
That's what I thought... that someone would advise to use a Global Variable. I agree, but now I think I should not use a plugin (for performance reasons).
I think it is also better to simply run the script in a crontab file every 5 minutes, instead of with every page in a plugin.
In that case, a plug-in might not be the best way to go; better to simply write a script for cron and use a MySQL call to update $vbphrase[image_server] in the dB?
Code:
mysql_query("UPDATE phrase SET text='myfastserver.com' WHERE varname='image_server'")
or die(mysql_error());