The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Cache PHP widget separately for each language
I use different content output for each language in the my CMS PHP Direct Execution Widgets.
Code:
if ($vbulletin->userinfo['languageid']) == 1) { $output = "ENGLISH TEXT"; } else { $output = "ANOTHER LANGUAGE TEXT"; } |
#2
|
|||
|
|||
It doesn't seem to take in to account the language or style setting, as you found out. But I learned something about widgets (or at least php direct execution widgets), which is that there is a separate cached version per user. So if you switch the language setting you'll have to wait for the cache to expire, but if different users have different languages chosen, they should be OK.
If that doesn't work for you, I think you'd have to set the cache time to 0 and handle any caching yourself (see packages/vbcms/widget/execphp.php). |
Благодарность от: | ||
postoronnim |
#3
|
|||
|
|||
Thank you very much, Kevin!
I went back to this problem and I solved it with your advise. I have changed 'userid' to 'languageid' in the getHash function and now my widgets caches separately for each language and my pages loads much faster! Of course it is a very bad practice editing the vb-scripts, but I didn't see another way( |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|