PDA

View Full Version : Board Optimization - Plugin Based Template Cache


Pages : [1] 2

orban
07-22-2006, 10:00 PM
Removed on author's request.

orban
07-23-2006, 09:29 AM
Old 3.5 thread: https://vborg.vbsupport.ru/showthread.php?t=113002

Snake
07-23-2006, 11:43 AM
Thank you, works like a charm! I find this very useful though. :)

marksman1
07-23-2006, 06:11 PM
Installed. I did not have a chance to use an old version, but installed and working fine. Thanks for the great mod.

Just a minor nit, but I noticed "seperately" mis-spelled a few times on the configuration screen as "seperatly". Just thought I would let you know.

Anyways again great job. Working with eaccelerator here.

SnickersTK
07-23-2006, 08:25 PM
So what difference does this do? Make it use less resources?

marksman1
07-23-2006, 11:50 PM
By the way I did run into a small problem with this and VBAdvanced. With VBAdvanced, my navbar links would not work properly on the vba home page. I could just exclude the navbar, but I didn't want to do that, so I just put in full urls for my links in the navbar, and it is all working well.

Snickers, it uses less queries, or query at least, but also serves it up faster, especially if you server has some kind of php cache enabled. Normally the templates are served out of the database.

orban
07-24-2006, 10:31 AM
Yes, it saves 1 query on each page and if you have a PHP cache and use the option to save template seperately it saves eval() calls.

Just a minor nit, but I noticed "seperately" mis-spelled a few times on the configuration screen as "seperatly". Just thought I would let you know.

Argh! :D Fixed it in the .xml :)

By the way I did run into a small problem with this and VBAdvanced. With VBAdvanced, my navbar links would not work properly on the vba home page. I could just exclude the navbar, but I didn't want to do that, so I just put in full urls for my links in the navbar, and it is all working well.

Wow, that's wierd. What vBAdvanced version? So I can download and debug.

ahmed-samara
07-25-2006, 05:03 AM
Thank you

rob30UK
07-26-2006, 08:02 AM
nice little speed boost here.... very welcome!

Nice hack, cheers.

Mudvayne
07-29-2006, 07:44 PM
Got error on RC3..
XML Error: Empty document at Line 55

orban
07-29-2006, 07:49 PM
When doing what?

Works just fine for me.

Mudvayne
07-29-2006, 09:05 PM
Sorry.. My bad.. I enabled overwrite option :( damn me! Now works fine for me :D.. Thnx..

h_kakashi
08-02-2006, 02:08 PM
I get the following Error :

Warning: Unknown(template_cache.php): failed to open stream: No such file or directory in /admincp/options.php(1025) : eval()'d code on line 15

Warning: (null)(): Failed opening 'template_cache.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /admincp/options.php(1025) : eval()'d code on line 15

Fatal error: Call to undefined function: clear_template_cache() in /home/kakashi/public_html/forums/admincp/options.php(1025) : eval()'d code on line 16

When I attempt to enable it via vbuleltin options. I attempted to enter in the path to the template folder but no joy.

The forums , templates and files in the templates directory are all set to 777. So I really can't see the problem :S

orban
08-02-2006, 02:10 PM
You most likely uploaded template_cache.php to the wrong place.

h_kakashi
08-02-2006, 02:22 PM
template_cache.php is in the correct place :)

/public_html/forums/templates/

Mudvayne
08-02-2006, 02:49 PM
Nop it shud b in /forums directory :).. Not in /forums/templates directory..

h_kakashi
08-02-2006, 02:55 PM
Silly Silly me XD thats what I get for staying up all night :}

orban
08-02-2006, 05:42 PM
I even made it bold! Sheesh! :(

SVZ
08-04-2006, 12:40 AM
Will this work with vBulletin 3.6 Gold? And also with VBSeo?

SVZ
08-04-2006, 12:51 AM
OK, I have it running on vBulletin 3.6 Gold here with VBSeo and it looks fine so far.

http://www.gossiprocks.com/forum/

Anyone want to bug test? I don't really know what I'm doing in that field :(

Mudvayne
08-04-2006, 12:52 AM
Will this work with vBulletin 3.6 Gold? And also with VBSeo?
I'm not sure since I'm using it with vB 3.6.0 & vBSEO last few hours.. But I can guarantee u that I got no error yet..

SVZ
08-04-2006, 12:55 AM
Looks clean from my end so far, been using it for a few minutes lol

orban
08-04-2006, 09:10 AM
I don't have vbSEO nor does there seem to be a test version available.

It definitely works with 3.6.0 Gold.

orban
08-04-2006, 10:43 AM
OK, I have it running on vBulletin 3.6 Gold here with VBSeo and it looks fine so far.

http://www.gossiprocks.com/forum/

Anyone want to bug test? I don't really know what I'm doing in that field :(

If files are created then it should be working.

By the way your website has an awesome header, one of the best I've ever seen! Loving it.

jw00dy
08-17-2006, 09:36 AM
I have it installed and it's pretty cool, but I've got to figure out what templates to not cache since some of my hacks now don't work.

Is it the actual names of the templates listed in the plugin manager page?

Nice work BTW, this will be very nice if I don't end up having to exclude all my templates :D

orban
08-17-2006, 09:40 AM
No, you need to look in the source codes of the plugins for template names.

SVZ
08-20-2006, 02:42 AM
Just like to report a bug, if you use the moderation features (the drop down) and go to delete, and select Physically remove it doesn't work. It prompts you to download inlinemod.php instead of runnning it. i disabled this plugin and it works.

i dont know what template that uses...

nix
08-20-2006, 03:20 AM
Doesn't do that on mine. Works just fine.

orban
08-20-2006, 08:08 AM
Are you using any products/plugins SVZ that modifies that behaviour?

MissKalunji
08-22-2006, 04:26 AM
I'm not sure since I'm using it with vB 3.6.0 & vBSEO last few hours.. But I can guarantee u that I got no error yet..


i second and third that :)

Mickie D
08-26-2006, 07:21 AM
this would be good if we could make a fix for vbshout because i dont think that putting forumhome in the uncached list is a good idea its probably the most important template to cache and probably the largest and most called upon ?

Regards
Mickie D

orban
08-27-2006, 01:33 AM
Good point.

Basically all you have to do is replace the line where vBShout modifies the template and manually edit the FORUMHOME template and add a little variable.

I'll have a look later.

Kihon Kata
08-28-2006, 01:18 PM
Hi Orban! I updated mine! templates directory building nicely!

orban
08-28-2006, 01:23 PM
Glad to hear!

-----

vBShout:

https://vborg.vbsupport.ru/showthread.php?t=93097&highlight=vbshout

I assume you mean this vBShout version.

Edit the plugin "vBShout [Template Alteration]" and comment out this line:

$vbulletin->templatecache['FORUMHOME'] = str_replace($Position, $Position . ' $Shoutbox', $vbulletin->templatecache['FORUMHOME']);

/*$vbulletin->templatecache['FORUMHOME'] = str_replace($Position, $Position . ' $Shoutbox', $vbulletin->templatecache['FORUMHOME']);*/

Then modify the template "FORUMHOME" and add

$Shoutbox

where you want to have the shoutbox.

This of course disables the placement using the "vBShout Position" option in the admincp.

MissKalunji
08-28-2006, 03:05 PM
what about the WELCOME PANEL by inferno?

MissKalunji
08-28-2006, 03:06 PM
"The use of the code modification "Vbulletin Plugin Accelerator" is not recommended when using this plugin (and I recommend not using it AT ALL)!
"

Why not? im using it i didnt see anything wrong yet?

orban
08-28-2006, 03:12 PM
"The use of the code modification "Vbulletin Plugin Accelerator" is not recommended when using this plugin (and I recommend not using it AT ALL)!
"

Why not? im using it i didnt see anything wrong yet?

If it works, then good :)

But the problem with that plugin is that if there's a plugin that doesn't work it can make you vBulletin unaccessible.

what about the WELCOME PANEL by inferno?

Mmmm...try the following:

Edit the plugin "Welcome Panel - Main".

Replace

$vbulletin->templatecache['FORUMHOME'] = str_replace('$navbar','$navbar ' . $vbulletin->templatecache[forumhome_welcomepanel],$vbulletin->templatecache['FORUMHOME']);

with

/*$vbulletin->templatecache['FORUMHOME'] = str_replace('$navbar','$navbar ' . $vbulletin->templatecache[forumhome_welcomepanel],$vbulletin->templatecache['FORUMHOME']);*/
$welcomepanel = $vbulletin->templatecache['forumhome_welcomepanel'];

And then edit the template "FORUMHOME" and add "$welcomepanel" after "$navbar".

EDIT: That's for https://vborg.vbsupport.ru/showthread.php?t=83124&highlight=welcome+panel, which one do you use? Couldn't fine one by Inferno.

amcd
08-29-2006, 08:04 AM
i have been using this product for few months now on my 3.5.x forum and it works great

a good enhancement to this would be if the templates are compressed before adding to the cache. templates without comments and white space wud be so much smaller and faster.

orban
08-29-2006, 10:29 AM
I think if you are using gzip compression it doesn't matter at all, but correct me if I'm wrong.

amcd
08-29-2006, 11:19 AM
I think if you are using gzip compression it doesn't matter at all, but correct me if I'm wrong.
it matters less, but it does matter

MissKalunji
08-29-2006, 02:50 PM
If it works, then good :)

But the problem with that plugin is that if there's a plugin that doesn't work it can make you vBulletin unaccessible.



Mmmm...try the following:

Edit the plugin "Welcome Panel - Main".

Replace

$vbulletin->templatecache['FORUMHOME'] = str_replace('$navbar','$navbar ' . $vbulletin->templatecache[forumhome_welcomepanel],$vbulletin->templatecache['FORUMHOME']);

with

/*$vbulletin->templatecache['FORUMHOME'] = str_replace('$navbar','$navbar ' . $vbulletin->templatecache[forumhome_welcomepanel],$vbulletin->templatecache['FORUMHOME']);*/
$welcomepanel = $vbulletin->templatecache['forumhome_welcomepanel'];

And then edit the template "FORUMHOME" and add "$welcomepanel" after "$navbar".

EDIT: That's for https://vborg.vbsupport.ru/showthread.php?t=83124&highlight=welcome+panel, which one do you use? Couldn't fine one by Inferno.

Yeah thats what i was talking about Zero lol sorry im gon try that now!


Not working instead it shows all the codes like $welcome .......but nothing else

orban
08-29-2006, 08:07 PM
Oh sorry....try

eval('$welcomepanel = "' . fetch_template('forumhome_welcomepanel') . '";');

instead of

$welcomepanel = $vbulletin->templatecache['forumhome_welcomepanel'];

MissKalunji
08-29-2006, 08:57 PM
Oh sorry....try

eval('$welcomepanel = "' . fetch_template('forumhome_welcomepanel') . '";');

instead of

$welcomepanel = $vbulletin->templatecache['forumhome_welcomepanel'];


same thing.....

orban
08-29-2006, 10:44 PM
Last two lines of the plugin should look like:

/*$vbulletin->templatecache['FORUMHOME'] = str_replace('$navbar','$navbar ' . $vbulletin->templatecache[forumhome_welcomepanel],$vbulletin->templatecache['FORUMHOME']);*/
eval('$welcomepanel = "' . fetch_template('forumhome_welcomepanel') . '";');

Is that the case?

MissKalunji
08-29-2006, 11:05 PM
arf go figure :-/ it works now!

Thanks! ur a lot of help!

orban
08-29-2006, 11:08 PM
Really?

Woot!

I can't even get that thing to work on my vB 3.6 so sorry about this rather awful support because I basically had to figure it out without being able to test it ;)

If it runs, sweet!!!

MissKalunji
08-29-2006, 11:10 PM
Really?

Woot!

I can't even get that thing to work on my vB 3.6 so sorry about this rather awful support because I basically had to figure it out without being able to test it ;)

If it runs, sweet!!!

Bah its fine! thanks for your help!!!!

www.dancehallareaz.com/forum

orban
08-29-2006, 11:14 PM
Sweet! :) Nice boards!

MissKalunji
08-30-2006, 12:08 AM
Thanks!

Jaxel
08-30-2006, 01:13 PM
Script works perfect here...
http://www.crookedjester.com

Didnt even need to include any templates; doesnt appear to break ANY of my other plugins.

Cybertims
08-30-2006, 08:35 PM
Is there any reason why the files it creates are being mae in the root folder and not in templates dir.....??

Cheers.

orban
08-30-2006, 08:42 PM
Can you try to the set the path manually in the options?

Cybertims
08-30-2006, 08:47 PM
Can you try to the set the path manually in the options?

Tried that too......has no effect I'm afraid.

I'm running 3.5.5 on a windows server if that helps any.

Cheers

orban
08-30-2006, 08:50 PM
Don't exactly know how paths on windows in PHP, maybe try \templates instead of /templates?

amcd
08-31-2006, 07:26 AM
I think if you are using gzip compression it doesn't matter at all, but correct me if I'm wrong.
orban, please think about my suggestion. gzip helps, but leaner templates are still desirable.

There are already a few plugins available here on vb.org for template compression, but i dont know how to integrate them with your product.

The drawback of those other plugins is that they try to compress the templates on every pageload, which means a lot of CPU cycles. If the same thing is implemented in your plug-in, the compression will happen only once when the template is added to the cache.

see what andreas has to say about compression:
https://vborg.vbsupport.ru/showpost.php?p=668050&postcount=7

a few of the existing template compression threads:
https://vborg.vbsupport.ru/showthread.php?t=106333
https://vborg.vbsupport.ru/showthread.php?t=107615
https://vborg.vbsupport.ru/showthread.php?t=83248
https://vborg.vbsupport.ru/showthread.php?t=79923
https://vborg.vbsupport.ru/showthread.php?t=69787
https://vborg.vbsupport.ru/showthread.php?t=56589
https://vborg.vbsupport.ru/showthread.php?t=67142

orban
08-31-2006, 10:55 AM
https://vborg.vbsupport.ru/showthread.php?t=107615 (vB 3.5)
https://vborg.vbsupport.ru/showthread.php?t=67142 (vB 3.0)

Those two compress the templates and save them to the database (instead of realtime). So they will work with this plugin.

You just have to manually clear the templates/ cache folder after you compress them I think.

Bulent Tekcan
09-03-2006, 02:33 PM
Hello orban

Sometimes forumdisplay not open,only blank page.But other thread is working without any problem.

When I clear completely template directory this problem gone.

Any idea for that ?

orban
09-03-2006, 02:49 PM
Hmm, that's a tough one.

Is the server load okay?

Are you using APC/eAccelerator?

Did you change the template?

Next time it happens make a copy of the template directory and manually look for empty/corrupt files. (You could send me a zip of the folder too so I can have a look).

Bulent Tekcan
09-03-2006, 02:59 PM
My server load sometimes peak,but my forum online normaly 1400-1800 (cookie timeout 900) :)

Yes I'm using APC cache.

Yes....when I change some template after this problem occured.Or when I enter censor words occured again.

Thanks

orban
09-03-2006, 03:45 PM
Does it ONLY happen after changing censor words/templates? It might be a problem with too many requests so the file creation gets messed up.

Bulent Tekcan
09-03-2006, 04:10 PM
Yes....Only after changing censor words/templates.But not everytime....

orban
09-03-2006, 04:25 PM
You could try to replace

$fp = fopen($templatefile, 'w+');
if ($fp && flock($fp, LOCK_EX))
{
fwrite($fp, '<?php '.$cache_to_save.' ?>');
flock($fp, LOCK_UN);
fclose($fp);
}

with

if (rand() < 0.1)
{
$fp = fopen($templatefile, 'w+');
if ($fp && flock($fp, LOCK_EX))
{
fwrite($fp, '<?php '.$cache_to_save.' ?>');
flock($fp, LOCK_UN);
fclose($fp);
}
}

So basically a protection that only every 10th page call tries to write out the page.

Bulent Tekcan
09-03-2006, 05:18 PM
Himmmm

I changed these lines.And I'll test..

orban
09-03-2006, 05:21 PM
Cool, let me know.

It might be a totally different problem of course...but it's hard to troubleshoot this.

Bulent Tekcan
09-03-2006, 05:34 PM
Troubleshott easy for me :) Because I have Threads: 211,191, Posts: 2,463,124, Members: 217,685 and also online is very high 1400-1800.In winter 2000-2500 online.

High traffic board easy troubleshooting ;)

Anyway....

I tried 20-25 times change templates and censor words without any problem.

I think this problem is gone.

orban
09-03-2006, 05:38 PM
Cool.

Are the files still being created in the template folder? Double check for that.

Bulent Tekcan
09-03-2006, 05:40 PM
Yes these files already created in that folder ;)

orban
09-03-2006, 05:41 PM
Awesome. :)

Bulent Tekcan
09-03-2006, 05:48 PM
Thanks for faster support :) This is really very good plugin for bigboards.

Cheers

orban
09-03-2006, 06:26 PM
Glad to hear, thanks for the feedback! :D

Hornstar
09-15-2006, 02:48 AM
This probably has been answered, but does this save on bandwidth or load pages faster or both?

Thanks.

amcd
09-15-2006, 06:07 AM
This probably has been answered, but does this save on bandwidth or load pages faster or both?

Thanks.
it doesnt change the size of pages, so bandwidth is not saved

it helps to load pages faster. it also helps to reduce the load on MySQL

Hornstar
09-16-2006, 11:10 PM
it doesnt change the size of pages, so bandwidth is not saved

it helps to load pages faster. it also helps to reduce the load on MySQL

I see, well that is good then. I think ill give this ago then.

Zia
10-05-2006, 02:36 AM
Helo Orban..

REgarding this modification..we r facing some probs..

* Removed Plugin Based Template Cache.. Worst addons I have ever use..

-> Negative side - Doesn't update the page.. I found each time I have to refresh the page to see new posts.. So whats the point to using it? If I have to browse a page twice to getting new post!!

any idea how to solve this issue?

Note: atm we uninstaled it after uninstall probs solved.

orban
10-05-2006, 07:30 AM
Can you give me a list of other addons you're using?

psico
10-06-2006, 01:03 AM
I have a problem with vbSEO. I receive this error when I tried to open a thread:


Warning: Invalid argument supplied for foreach() in /template_cache.php on line 32

Warning: Cannot modify header information - headers already sent by (output started at /www/psicofxp.com.ar/htdocs/forums/includes/class_core.php:3023) in /includes/functions_vbseo.php on line 391


Any ideas?

orban
10-06-2006, 01:09 AM
I don't have access to vBSEO (it costs moneys and I don't own a copy or intend to buy one) so I can't support that. I'm sorry.

Ask in their forums, I'm happy to talk to a developer of theirs...

psico
10-06-2006, 01:21 AM
tnx a lot, I´m asking them right now.

psico
10-06-2006, 10:59 PM
I´ve tested again without vbseo and I have the same error, so the problem is with another plugin maybe?

I receive this error only:
Warning: Invalid argument supplied for foreach() in /template_cache.php on line 32

orban
10-06-2006, 11:07 PM
Can you try clearing your forums/templates/ folder? (Not the index.html, though).

Are there even any files in it? It looks like you get empty cache files.

Kihon Kata
10-06-2006, 11:15 PM
I?ve tested again without vbseo and I have the same error, so the problem is with another plugin maybe?

I receive this error only:
Warning: Invalid argument supplied for foreach() in /template_cache.php on line 32 psico, I have both orban's template cacher AND vbSEO installed right here: Talk Makeup and Cosmetics (http://www.MakeupTalk.com/forums).

Visit vbulletin modficataions (http://www.vbmodder.com) and ask JumpD (Code Monkey) what he did to fix mine. I paid him to install it for me and he fixed this issue(I think)

Hope this helps!

orban
10-06-2006, 11:16 PM
Can you tell me what he fixed? I can include that fix then in the installation info.

psico
10-06-2006, 11:27 PM
orban,
I cleared the template folder and after that, it generated new files but most of them with 0 bytes... and I'm still getting the same error ( Invalid argument supplied for foreach() in /template_cache.php on line 32)

Any other ideas? Thanks in advance,

orban
10-06-2006, 11:32 PM
Yeah that's what I thought, somehow vBSEO changes some variables, I'd have to have a look at an existing vBSEO installation to fix this issue, but I don't have access to one.

psico
10-07-2006, 12:27 AM
No, I disabled VBSEO completely and that is what happened. The problem is not vbseo.

orban
10-07-2006, 12:32 AM
vBSEO will create empty template cache files, which will still be there even when you disable vBSEO. Clear your forums/templates/ folder and the problem will be gone.

psico
10-07-2006, 12:48 AM
Nope, the problem still there.

The people from vbseo also tried it and it works for them:
http://www.vbseo.com/f77/vbseo-plugin-based-template-cache-8467/#post51174

Kihon Kata
10-07-2006, 02:09 AM
Orban, You'll have to ask JumpD :)

psico, did you take my rec and ask him? ;)

Guys, all I know is that I am running vB3.6.2 w/ vbSEO 3.0 RC5 and Orban's Template cacher here: www.MakeupTalk.com/forums and www.vbModder.com installed it.

orban
10-07-2006, 09:52 AM
Can you follow the steps to uninstall the plugin, then reinstall it WITHOUT vBSEO. Does that work?

If not, give me a list of all your addons please. And what vB are you running? 3.6?

If you want me to have a look easiest would be to give me admincp/ssh access but I completely understand if you don't want that.

MissKalunji
10-07-2006, 12:14 PM
Nope, the problem still there.

The people from vbseo also tried it and it works for them:
http://www.vbseo.com/f77/vbseo-plugin-based-template-cache-8467/#post51174

i have vbseo and its working fine as well

psico
10-07-2006, 12:24 PM
I did it and the same problem appears...

I?m running 3.6.1, I cannot give you acces to the server or Admincp, sorry about that.

This is the list of plugins:


Auto-PM Staff on User Ban 1.0 This will automaticly send a PM to all Administrators and Moderators when a member is banned

Digital Point Co-Op Ad Network 1.0 Allows you to run ads for the Digital Point <a href="http://www.digitalpoint.com/tools/ad-network/" target="_blank">Co-Op Ad Network</a>

DownloadsII 5.0.2 A Download Database for vB

FlashChat Integration 3.07 Integration of Flashchat and vBulletin 3.6

GARS 2.0.0 RC 4 Geek Article and Review System

Google Talk IM Icon 1.0 Adds the IM icons.

ibProArcade for vBulletin 2.5.6 ibProArcade - professional Arcade System for vBulletin

Infraction Moderation 0.9 Only allows moderators to give infractions in forums they have moderation privlages to.

iTrader 2.0.1 Trader Feedback System

Members who are using flashchat 4.32 Display members who are currently chatting in Flashchat.

Members who have visited the forum 4.31 Display members who have visited the forum.

Mini Navbar 1.0.4 Places a breadcrumb from the navbar on the bottom of a thread

Moderation Auto-PM 2.0.1 Automaticly PMs a user when their thread is moderated

Plugin Based Template Cache 1.0.3 Plugin based Template-to-File cache without file modification

Prevent Doubleposts 1.0 Beta 4 This Modification prevents doubleposts by merging post together, if the last poster of a thread tries to post again.

Rules and User Agreement Hack 1.1.5 Agreement Rules Systems

Separate Sticky and Normal Threads 1.0.5 Separate Sticky and Normal Threads

Show Itrader In Profile 1.00 This product allows you to show a user's itrader info in his/her profile.

Spam Decimator 1.0.5 Spam Killing Extension

Sub-Forums Arranger 1.7 Cyb - Sub-Forums Arranger

Thread Prefixes 1.6.1 This product allows your users to choose a thread prefix for each thread which will be displayed in front of the thread title.

Usergroup Allow HTML 3.5.0 Specify usergroups whose HTML posts will be parsed

vBSEO 3.0.0 RC6 vBulletin SEO

vBSEO :: Sitemap Generator 1.7 Generate a Google & Yahoo Sitemap for your Forums

Welcome Headers 4.1.1 Boost registration and activity rates with more visible guest welcome and member status messages.

Yet Another Award System 3.5 2.1.2 https://vborg.vbsupport.ru/showthread.php?t=94836

[APM] Advanced Product Management 3.0.0 A powerful tool to manage product. All (codes/plugins/templates/phrases/settings) in one!

orban
10-07-2006, 12:27 PM
Are there still empty files being created?

psico
10-07-2006, 12:35 PM
YES.

Forget abot VBSEO, other people are using it and don?t have any problems at all, vbseo is just another plugin, very simple.

Read this:http://www.vbseo.com/f77/vbseo-plugin-based-template-cache-8467/#post51174

This is one of the developers of VBSEO.

orban
10-07-2006, 12:42 PM
Try to change the Execution Order to 99 for the plugin "Template Cache".

psico
10-07-2006, 12:56 PM
Done.

The error continues: Warning: Invalid argument supplied for foreach() in /template_cache.php on line 32

Some part of the site is working, but the threads and forumhome it's all blank with the error above.

The template directory continues with too many files with 0 bytes.

orban
10-08-2006, 03:10 PM
Sorry I didn't get email notification.

Can you list me all plugins from the following hooks:

"style_fetch" and "cache_templates"? The full plugins, with code. If possible here, if not in a PM works too.

psico
10-08-2006, 11:54 PM
No problem! Tnx a lot for your support, here is the list and the codes:


Hook Location : style_fetch
Include template_cache.php --> your plugin

Hook Location : cache_templates


Cache Separate Sticky Template Separate Sticky and Normal Threads




$globaltemplates = array_merge($globaltemplates, array('FORUMDISPLAY_Separate'));

$globaltemplates = array_merge($globaltemplates, array('FORUMDISPLAY_Separate2'));
$globaltemplates = array_merge($globaltemplates, array('FORUMDISPLAY_Separate_top'));




Cache The Templates Show Itrader In Profile



if (THIS_SCRIPT == "member")
{global $globaltemplates;
$globaltemplates = array_merge($globaltemplates, array('itrader_profile'));}



Change headinclude "clientscript" path Rules and User Agreement Hack



if (THIS_SCRIPT!='portada' && THIS_SCRIPT!='ayuda' && THIS_SCRIPT!='enlazate' && THIS_SCRIPT!='institucional' && THIS_SCRIPT!='reglamento' && THIS_SCRIPT!='terminos-legales' && THIS_SCRIPT!='porque-registrarme') {
$style['css'] = str_replace('clientscript', $vbulletin->options['bburl'] . '/clientscript', $style['css']);
}


Cyb - Sub-Forums Arranger CT Sub-Forums Arranger


if ($vbulletin->options['cybsfa_enable'])
{
$globaltemplates = array_merge($globaltemplates, array('cyb_subforum_arranger'));
}


downloads_cache_templates DownloadsII


if (THIS_SCRIPT == 'member')
{
$globaltemplates = array_merge($globaltemplates, array('downloads_memberfiles', 'downloads_memberfiles_bit', 'downloads_memberfiles', 'downloads_memberinfo_profile'));
}
if (THIS_SCRIPT == 'showpost' || THIS_SCRIPT == 'showthread' || THIS_SCRIPT == 'private')
{
$globaltemplates = array_merge($globaltemplates, array('downloads_memberinfo_postbit'));
}



FlashChat Integration (5) FlashChat Integration


$globaltemplates[] = 'Flashchat' ;


GARS - Startup GARS


require_once('./geek/gars/includes/gars_ignition.php');


Google Talk: [Template Cache] Google Talk IM Icon



$globaltemplates = array_merge($globaltemplates, array('im_gt','im_send_gt'));



ibProArcade: ARCADE Template Cache ibProArcade for vBulletin


if(THIS_SCRIPT == 'index')
{
$globaltemplates = array_merge($globaltemplates, array('ARCADE'));
}


INI: Global Templates Psicofxp.com CMS



$globaltemplates = array_merge($globaltemplates, array(
'CMS_ads_468x60_header',
'CMS_lateral_derecho',
'CMS_portada_afiliados',
'CMS_portada_anuncios',

));

if (THIS_SCRIPT=="portada")
{
$globaltemplates = array_merge($globaltemplates, array(
'CMS_ads_468x60',
'CMS_portada_videoteca',
'CMS_portada_galeria',
'CMS_portada_arcade',
'CMS_portada_arcade_bit',
'CMS_portada_descargas',
'CMS_portada_descargas_bit',
'CMS_portada_websemana',
'CMS_portada_buscador',
'CMS_forumtags',
));

}
else
{
$globaltemplates = array_merge($globaltemplates, array(
'CMS_ads_728x90_sup',
'CMS_buscador',
'CMS_ads_lateral_derecho1',
'CMS_hoyenportada',
'CMS_hoyenportada_articulo',
'CMS_maspsicofxp',
'CMS_maspsicofxp_descargas',
'CMS_portada_descargas_bit',
'CMS_maspsicofxp_arcade',
'CMS_portada_arcade_bit',
'CMS_maspsicofxp_galeria',
'CMS_maspsicofxp_noticias',
'CMS_maspsicofxp_noticias_bit',
'CMS_zonas',
));
}



Members in Flashchat (1) Members who are using flashchat


if ($vbulletin->options['wic'])
{
$groups = explode(',',$vbulletin->options['wicgrps']);
if (is_member_of($vbulletin->userinfo,$groups) OR $groups[0] == 0)
{
$show['wic'] = true;
$globaltemplates[] = 'Display_Chatters' ;
}
else
{
$show['wic']= false;
}
}
else
{
$show['wic']= false;
}



Members who have visited (1) Members who have visited the forum



if ($vbulletin->options['wvt'])
{
$groups = explode(',',$vbulletin->options['wvtgrps']);
if (is_member_of($vbulletin->userinfo,$groups) OR $groups[0] == 0)
{
$show['wvt'] = true;
$globaltemplates[] = 'Display_Visitors' ;
}
else
{
$show['wvt']= false;
}
}
else
{
$show['wvt']= false;
}



Mini Navbar: Cache template Mini Navbar


$globaltemplates[] = 'navbar_mini';


Rules And User Agreement Rules and User Agreement Hack


if ($show['member']) {
$globaltemplates = array_merge($globaltemplates, array('ruleshack_rules', 'ruleshack_rulesbit'));
}


Template Cache Plugin Based Template Cache


if ($vbulletin->options['pbtc_enable'])
{
cache_templates_with_file_cache($globaltemplates, $style['templatelist']);
$globaltemplates = array();
}


vBSEO Cache Templates vBSEO


if(@include_once('includes/functions_vbseo.php'))
vbseo_complete_sec('cache_templates');


Welcome Headers [Template Cache] Welcome Headers


$globaltemplates[] = 'welcome_headers';



YAAS - cache templates Yet Another Award System 3.5



if ((THIS_SCRIPT == 'showpost') OR (THIS_SCRIPT == 'private') OR (THIS_SCRIPT == 'announcement') OR (THIS_SCRIPT == 'memberlist') OR (THIS_SCRIPT == 'showthread'))
{
$globaltemplates = array_merge($globaltemplates, array('awards_bit'));
}

if (THIS_SCRIPT == 'member')
{
$globaltemplates = array_merge($globaltemplates, array('awards_bit','awards_userawards_bit','awards _showcase'));
}

orban
10-09-2006, 12:03 AM
As you can see, half of them modify $globaltemplates, because of this it is crucial that my plugin gets executed last (because it uses that variable to build the cache).

What is the highest "Execution Order" you got from these? And you tried setting mine higher than all others?

psico
10-09-2006, 01:11 AM
As you can see, half of them modify $globaltemplates, because of this it is crucial that my plugin gets executed last (because it uses that variable to build the cache).

What is the highest "Execution Order" you got from these? And you tried setting mine higher than all others?
The execution order for ALL the plugins is 5, except for your plugin that have 99.

orban
10-09-2006, 01:22 AM
I don't know. It works for 100 other people even with vBSEO. It must be something with your installation. All those plugins you listed just modify the variable, there is no reason this will break anything.

I had a look at http://www.psicofxp.com/ and that site is heavily customized.

If you want me to have a look I need some sort of access.

You can also wrap the plugin in a userid test (so it only is enable for yourself) and print_r on all variables to find out what's going wrong. This requires PHP knowledge tho, but that's what I'd do.

1.

Change the "Template Cache" plugin to:


if ($vbulletin->userinfo['userid'] == 1)
if ($vbulletin->options['pbtc_enable'])
{
cache_templates_with_file_cache($globaltemplates, $style['templatelist']);
$globaltemplates = array();
}}

Upload the attached file instead of the one you can download up here.

Go to your forum home, and a lot of text will appear on top of the page (and probably errors, too). Post me the whole output (please view the source code and past it in [code]).

Also, are the 6578sdas7687sd86asd.php files empty or the 2132.php ones?

psico
10-09-2006, 02:52 AM
There some 6578sdas7687sd86asd.php files in 0 bytes and some 2132.php too.


Array
(
[0] => CMS_zonas
[1] => FORUMHOME
[2] => forumhome_event
[3] => forumhome_forumbit_level1_nopost
[4] => forumhome_forumbit_level1_post
[5] => forumhome_forumbit_level2_nopost
[6] => forumhome_forumbit_level2_post
[7] => forumhome_lastpostby
[8] => forumhome_loggedinuser
[9] => forumhome_moderator
[10] => forumhome_subforumbit_nopost
[11] => forumhome_subforumbit_post
[12] => forumhome_subforumseparator_nopost
[13] => forumhome_subforumseparator_post
[14] => forumhome_markread_script
[15] => header
[16] => footer
[17] => headinclude
[18] => pm_popup_script
[19] => navbar
[20] => navbar_link
[21] => forumjump
[22] => gobutton
[23] => option
[24] => pagenav
[25] => pagenav_curpage
[26] => pagenav_pagelink
[27] => pagenav_pagelinkrel
[28] => threadbit_pagelink
[29] => spacer_open
[30] => spacer_close
[31] => STANDARD_ERROR
[32] => STANDARD_REDIRECT
[33] => CMS_ads_468x60_header
[34] => CMS_lateral_derecho
[35] => CMS_portada_afiliados
[36] => CMS_portada_anuncios
[37] => CMS_ads_728x90_sup
[38] => CMS_buscador
[39] => CMS_ads_lateral_derecho1
[40] => CMS_hoyenportada
[41] => CMS_hoyenportada_articulo
[42] => CMS_maspsicofxp
[43] => CMS_maspsicofxp_descargas
[44] => CMS_portada_descargas_bit
[45] => CMS_maspsicofxp_arcade
[46] => CMS_portada_arcade_bit
[47] => CMS_maspsicofxp_galeria
[48] => CMS_maspsicofxp_noticias
[49] => CMS_maspsicofxp_noticias_bit
[50] => CMS_zonas
[51] => FORUMDISPLAY_Separate
[52] => FORUMDISPLAY_Separate2
[53] => FORUMDISPLAY_Separate_top
[54] => im_gt
[55] => im_send_gt
[56] => cyb_subforum_arranger
[57] => ARCADE
[58] => welcome_headers
[59] => Display_Chatters
[60] => Display_Visitors
[61] => navbar_mini
[62] => Flashchat
)
Array
(
[.alt1, .alt1Active] => 399
[.alt2, .alt2Active] => 400
[.alt3] => 806
[.button] => 401
[.fjdpth0] => 402
[.fjdpth1] => 809
[.fjdpth2] => 810
[.fjdpth3] => 811
[.fjdpth4] => 812
[.fjsel] => 403
[.highlight] => 814
[.navbar] => 815
[.page] => 404
[.panel] => 405
[.panelsurround] => 406
[.smallfont] => 819
[.tborder] => 407
[.tcat] => 408
[.tfoot] => 409
[.thead] => 410
[.time] => 411
[.vbmenu_control] => 412
[.vbmenu_hilite] => 413
[.vbmenu_option] => 414
[.vbmenu_popup] => 415
[.wysiwyg] => 416
[activateform] => 584
[activate_requestemail] => 585
[adv_portal_ecdownloads] => 723
[announcement] => 586
[announcement_edit] => 1203
[ARCADE] => 720
[attachmentbit] => 1173
[ATTACHMENTS] => 1174
[AWARDS] => 1242
[awards_awardbit] => 1244
[awards_awardusers_bit] => 1233
[awards_bit] => 1234
[awards_category] => 1243
[awards_categorybit] => 1236
[awards_request_form] => 1237
[awards_request_formanswers] => 1238
[awards_showcase] => 1245
[awards_userawards_bit] => 1246
[awards_viewaward] => 1253
[bbcode_code] => 778
[bbcode_code_styleid] => 2
[bbcode_code_printable] => 872
[bbcode_html] => 777
[bbcode_html_styleid] => 2
[bbcode_html_printable] => 874
[bbcode_php] => 776
[bbcode_php_styleid] => 2
[bbcode_php_printable] => 876
[bbcode_quote] => 774
[bbcode_quote_styleid] => 2
[bbcode_quote_printable] => 878
[board_inactive_warning] => 1175
[body] => 417
[BUDDYLIST] => 879
[buddylistbit] => 880
[CALENDAR] => 881
[calendarjump] => 882
[calendarjumpbit] => 883
[calendar_edit] => 884
[calendar_edit_customfield] => 885
[calendar_edit_recurrence] => 886
[calendar_manage] => 887
[calendar_monthly] => 888
[calendar_monthly_birthday] => 889
[calendar_monthly_day] => 890
[calendar_monthly_day_other] => 891
[calendar_monthly_event] => 892
[calendar_monthly_header] => 893
[calendar_monthly_week] => 894
[CALENDAR_REMINDER] => 895
[calendar_reminder_choosetype] => 896
[calendar_reminder_eventbit] => 897
[calendar_showbirthdays] => 898
[calendar_showevents] => 899
[calendar_showeventsbit] => 900
[calendar_showeventsbit_customfield] => 901
[calendar_smallmonth_day] => 902
[calendar_smallmonth_day_other] => 903
[calendar_smallmonth_header] => 904
[calendar_smallmonth_week] => 905
[calendar_weekly] => 906
[calendar_weekly_day] => 907
[calendar_weekly_event] => 908
[calendar_yearly] => 909
[cellpadding] => 838
[cellspacing] => 839
[closedthreadimage] => 840
[codeblockwidth] => 841
[contactus] => 588
[contactus_option] => 1177
[contenttype] => 842
[cyb_subforum_arranger] => 595
[decimator_main] => 1226
[Display_Chatters] => 1249
[Display_Visitors] => 1251
[Display_Visitors_Newpage] => 1254
[DOWNLOADS] => 764
[downloadsbuddy_assign_user] => 725
[downloads_cat] => 726
[downloads_cat_filebit] => 773
[downloads_cat_files] => 728
[downloads_cat_subbit] => 729
[downloads_cat_subs] => 730
[downloads_file] => 772
[downloads_file_addit] => 732
[downloads_file_comment] => 770
[downloads_main] => 758
[downloads_main_catbit] => 757
[downloads_man] => 736
[downloads_man_bit] => 737
[downloads_memberfiles] => 738
[downloads_memberfiles_bit] => 739
[downloads_memberinfo_postbit] => 740
[downloads_memberinfo_profile] => 741
[downloads_my] => 742
[downloads_my_bit] => 743
[downloads_panel_bit] => 769
[downloads_panel_side] => 768
[downloads_panel_top] => 746
[downloads_search] => 747
[downloads_search_result] => 748
[downloads_search_result_bit] => 749
[downloads_stats] => 750
[downloads_stats_bit] => 751
[downloads_tree] => 752
[downloads_warning] => 753
[downloads_wrapper_none] => 771
[downloads_wrapper_side] => 767
[downloads_wrapper_top] => 756
[editor_clientscript] => 910
[editor_jsoptions_font] => 911
[editor_jsoptions_size] => 912
[editor_smilie] => 913
[editor_smiliebox] => 914
[editor_smiliebox_category] => 915
[editor_smiliebox_row] => 916
[editor_smiliebox_straggler] => 917
[editor_styles_button_down] => 538
[editor_styles_button_hover] => 537
[editor_styles_button_normal] => 536
[editor_styles_button_selected] => 921
[editor_styles_menu_down] => 541
[editor_styles_menu_hover] => 540
[editor_styles_menu_normal] => 539
[editor_styles_popup_down] => 542
[editor_toolbar_off] => 926
[editor_toolbar_on] => 1230
[editpoll] => 579
[editpost] => 1204
[EXTRA] => 831
[EXTRA2] => 418
[FAQ] => 589
[faqbit] => 929
[faqbit_link] => 930
[Flashchat] => 1227
[footer] => 526
[formspacer] => 843
[formwidth] => 844
[formwidth_usercp] => 845
[FORUMDISPLAY] => 1205
[forumdisplay_loggedinuser] => 932
[forumdisplay_moderator] => 933
[FORUMDISPLAY_Separate] => 563
[FORUMDISPLAY_Separate2] => 467
[FORUMDISPLAY_Separate_top] => 468
[forumdisplay_sortarrow] => 934
[FORUMHOME] => 543
[forumhome_event] => 936
[forumhome_forumbit_level1_nopost] => 544
[forumhome_forumbit_level1_post] => 545
[forumhome_forumbit_level2_nopost] => 546
[forumhome_forumbit_level2_post] => 547
[forumhome_lastpostby] => 941
[forumhome_loggedinuser] => 942
[forumhome_markread_script] => 943
[forumhome_moderator] => 944
[forumhome_subforumbit_nopost] => 945
[forumhome_subforumbit_post] => 946
[forumhome_subforumseparator_nopost] => 947
[forumhome_subforumseparator_post] => 948
[forumjump] => 1181
[forumrules] => 1182
[GARS_alphabar] => 661
[GARS_attachments] => 662
[GARS_comment] => 663
[GARS_custom_container] => 664
[GARS_custom_date] => 665
[GARS_custom_input] => 666
[GARS_custom_row] => 667
[GARS_custom_text] => 668
[GARS_custom_textarea] => 669
[GARS_custom_thumbnail] => 670
[GARS_custom_thumb_row] => 682
[GARS_editpost] => 671
[GARS_forumdisplay] => 656
[GARS_forumdisplay_2] => 673
[GARS_forumdisplay_tips] => 1299
[GARS_forumdisplay_videoteca] => 1298
[GARS_forumdisplay_websemana] => 1255
[GARS_gallery] => 674
[GARS_gallery_bit] => 675
[gars_marked_main] => 676
[gars_marked_row] => 677
[GARS_mod_container] => 658
[GARS_navigation] => 678
[GARS_newthread] => 679
[GARS_options] => 680
[GARS_pb] => 659
[GARS_pb_videoteca] => 1247
[GARS_pb_websemana] => 1248
[GARS_preview_pb] => 683
[GARS_ratings] => 713
[GARS_rating_bit] => 685
[GARS_rating_result_bit] => 712
[GARS_rating_result_bits0] => 716
[GARS_rating_result_bits1] => 714
[GARS_rating_result_bits2] => 715
[GARS_rating_result_percent_bit] => 717
[GARS_references] => 691
[GARS_release_forumdisplay] => 692
[GARS_simple_forumdisplay] => 693
[GARS_simple_pb] => 694
[GARS_simple_threadbit] => 695
[GARS_threadbit] => 657
[GARS_threadbit_2] => 697
[GARS_threadbit_deleted] => 698
[GARS_threadbit_videoteca] => 708
[GARS_threadbit_websemana] => 710
[GARS_tools] => 699
[GARS_userinfo] => 700
[GARS_userrating] => 701
[GENERIC_SHELL] => 1183
[gobutton] => 1184
[header] => 525
[headinclude] => 552
[help_avatars] => 1256
[help_avatars_avatar] => 950
[help_avatars_category] => 951
[help_avatars_row] => 952
[help_bbcodes] => 1257
[help_bbcodes_bbcode] => 954
[help_bbcodes_link] => 955
[help_smilies] => 1258
[help_smilies_category] => 957
[help_smilies_smilie] => 958
[htmldoctype] => 846
[htmlextrasfolder] => 847
[imagereg] => 1187
[imagesfolder] => 848
[imgdir_attach] => 1304
[imgdir_button] => 1305
[imgdir_editor] => 1306
[imgdir_misc] => 1307
[imgdir_poll] => 1308
[imgdir_rating] => 1309
[imgdir_reputation] => 1310
[imgdir_statusicon] => 1311
[im_aim] => 959
[im_gt] => 571
[im_icq] => 960
[im_message] => 961
[im_msn] => 962
[im_send_aim] => 963
[im_send_gt] => 572
[im_send_icq] => 964
[im_send_msn] => 965
[im_send_skype] => 966
[im_send_yahoo] => 967
[im_skype] => 968
[im_yahoo] => 969
[itrader_detail] => 792
[itrader_detail_commentbits] => 786
[itrader_detail_feedback] => 793
[itrader_feedback] => 794
[itrader_profile] => 798
[itrader_reportbadrating] => 795
[itrader_user] => 796
[itrader_userbits] => 791
[JOINREQUESTS] => 1188
[joinrequestsbit] => 1189
[legend] => 419
[lostpw] => 1259
[mailform] => 590
[MEMBERINFO] => 1206
[memberinfo_customfields] => 971
[memberinfo_membergroupbit] => 972
[memberlist] => 591
[memberlist_letter] => 974
[memberlist_resultsbit] => 975
[memberlist_resultsbit_field] => 976
[memberlist_results_header] => 977
[memberlist_search] => 592
[memberlist_search_optional_input] => 979
[memberlist_search_radio] => 980
[memberlist_search_select] => 981
[memberlist_search_select_multiple] => 982
[memberlist_search_textbox] => 983
[messagewidth] => 423
[messagewidth_usercp] => 858
[moderation_posts] => 984
[moderation_threads] => 985
[modifyattachments] => 986
[modifyattachmentsbit] => 987
[modifyavatar] => 988
[modifyavatarbit] => 989
[modifyavatarbit_custom] => 990
[modifyavatarbit_noavatar] => 991
[modifyavatar_category] => 992
[modifylist] => 993
[modifylistbit] => 994
[modifyoptions] => 995
[modifyoptions_timezone] => 996
[modifypassword] => 997
[modifyprofile] => 573
[modifyprofilepic] => 999
[modifyprofile_birthday] => 1000
[modifysignature] => 1207
[modifyusergroups] => 1002
[modifyusergroups_displaybit] => 1003
[modifyusergroups_groupleader] => 1004
[modifyusergroups_joinrequestbit] => 1005
[modifyusergroups_memberbit] => 1006
[modifyusergroups_nonmemberbit] => 1007
[modifyusergroups_requesttojoin] => 1008
[navbar] => 1208
[navbar_link] => 556
[navbar_mini] => 1324
[newattachment] => 1011
[newattachmentbit] => 1012
[newattachment_errormessage] => 1013
[newattachment_keybit] => 1014
[newpoll] => 580
[newpost_attachment] => 1016
[newpost_attachmentbit] => 1017
[newpost_disablesmiliesoption] => 1018
[newpost_errormessage] => 1019
[newpost_preview] => 1020
[newpost_quote] => 1021
[newpost_threadmanage] => 1022
[newpost_usernamecode] => 1023
[newreply] => 581
[newreplyimage] => 859
[newreply_reviewbit] => 1025
[newreply_reviewbit_ignore] => 1026
[newreply_reviewbit_ignore_global] => 1027
[newthread] => 1209
[newthreadimage] => 860
[optgroup] => 1192
[option] => 1193
[outerborderwidth] => 861
[outertablewidth] => 424
[pagenav] => 702
[pagenav_curpage] => 703
[pagenav_pagelink] => 704
[pagenav_pagelinkrel] => 705
[pm_editfolderbit] => 1033
[pm_editfolders] => 1034
[pm_emptyfolder] => 1035
[pm_messagelist] => 1210
[pm_messagelistbit] => 1037
[pm_messagelistbit_ignore] => 1038
[pm_messagelistbit_user] => 1039
[pm_messagelist_periodgroup] => 1040
[pm_movepm] => 1041
[pm_newpm] => 578
[pm_popup_script] => 1043
[pm_receipts] => 1044
[pm_receiptsbit] => 1045
[pm_showpm] => 1046
[pm_trackpm] => 1047
[polleditbit] => 1048
[pollnewbit] => 1049
[polloption] => 1050
[polloptions_table] => 1051
[polloption_multiple] => 1052
[pollpreview] => 1053
[pollresult] => 596
[pollresults] => 594
[pollresults_table] => 1056
[postbit] => 1057
[postbit_attachment] => 1058
[postbit_attachmentimage] => 1059
[postbit_attachmentmoderated] => 1060
[postbit_attachmentthumbnail] => 1272
[postbit_deleted] => 1062
[postbit_external] => 1063
[postbit_ignore] => 1064
[postbit_ignore_global] => 1065
[postbit_ip] => 1066
[postbit_legacy] => 1211
[postbit_onlinestatus] => 1068
[postbit_quickedit] => 1069
[postbit_reputation] => 1070
[postbit_wrapper] => 1071
[posticonbit] => 1072
[posticons] => 1073
[printthread] => 1228
[printthreadbit] => 1075
[printthreadbit_ignore] => 1076
[register] => 1212
[register_coppaform] => 1078
[register_rules] => 1079
[register_verify_age] => 1080
[reportbadpost] => 1260
[reputation] => 1081
[reputationbit] => 1082
[reputation_ajax] => 1083
[reputation_reasonbits] => 1084
[reputation_yourpost] => 1085
[ruleshack_rules] => 1270
[ruleshack_rulesbit] => 1271
[search_forums] => 1213
[search_results] => 1214
[search_results_postbit] => 1088
[search_results_postbit_lastvisit] => 1089
[select] => 420
[sendtofriend] => 1261
[shell_blank] => 1262
[SHOWGROUPS] => 593
[showgroups_forumbit] => 1091
[showgroups_usergroup] => 1092
[showgroups_usergroupbit] => 1093
[SHOWTHREAD] => 1215
[showthread_list] => 1095
[showthread_quickreply] => 566
[SHOWTHREAD_SHOWPOST] => 1097
[showthread_similarthreadbit] => 1098
[showthread_similarthreads] => 1099
[smiliepopup] => 1100
[smiliepopup_category] => 1101
[smiliepopup_row] => 1102
[smiliepopup_smilie] => 1103
[smiliepopup_straggler] => 1104
[spacersize] => 425
[spacer_close] => 1197
[spacer_open] => 527
[STANDARD_ERROR] => 1216
[STANDARD_ERROR_LITE] => 608
[STANDARD_ERROR_LOGIN] => 609
[STANDARD_REDIRECT] => 1202
[SUBSCRIBE] => 1217
[subscribe_choosetype] => 1106
[subscribe_folderbit] => 1107
[subscribe_move] => 1108
[subscribe_showfolders] => 1109
[subscription] => 1110
[subscription_activebit] => 1111
[subscription_availablebit] => 1112
[subscription_payment] => 1113
[subscription_paymentbit] => 1114
[subscription_payment_2checkout] => 1115
[subscription_payment_authorizenet] => 1116
[subscription_payment_ccbill] => 1117
[subscription_payment_moneybookers] => 1118
[subscription_payment_nochex] => 1119
[subscription_payment_paypal] => 1120
[subscription_payment_worldpay] => 1121
[tablewidth] => 864
[td, th, p, li] => 421
[td.inlinemod] => 836
[textarea, .bginput] => 422
[textareacols_ie4] => 865
[textareacols_ns4] => 866
[textareacols_ns6] => 867
[THREADADMIN] => 1122
[threadadmin_copyposts] => 1123
[threadadmin_deleteposts] => 1124
[threadadmin_deletethread] => 1125
[threadadmin_deletethreads] => 1126
[threadadmin_editthread] => 1218
[threadadmin_imod_menu_post] => 1128
[threadadmin_imod_menu_thread] => 1129
[threadadmin_logbit] => 1130
[threadadmin_managepost] => 1131
[threadadmin_mergeposts] => 1132
[threadadmin_mergethread] => 1133
[threadadmin_mergethreads] => 1134
[threadadmin_moveposts] => 1135
[threadadmin_movethread] => 1221
[threadadmin_movethreads] => 1220
[threadadmin_postbit] => 1138
[threadadmin_splitthread] => 1139
[threadbit] => 564
[threadbit_announcement] => 553
[threadbit_deleted] => 781
[threadbit_lastvisit] => 1143
[threadbit_pagelink] => 1144
[threadprefix_listbit] => 721
[threadprefix_modify] => 722
[titleimage] => 1312
[USERCP] => 600
[usercp_nav_folderbit] => 1146
[usercp_reputationbits] => 1147
[USERCP_SHELL] => 1222
[userfield_checkbox_option] => 1149
[userfield_optional_input] => 1150
[userfield_radio] => 1151
[userfield_radio_option] => 1152
[userfield_select] => 1153
[userfield_select_multiple] => 1154
[userfield_select_option] => 1155
[userfield_textarea] => 1156
[userfield_textbox] => 1157
[userinfraction] => 1223
[userinfractionbit] => 1325
[userinfraction_banbit] => 1160
[userinfraction_groupbit] => 1161
[userinfraction_infobit] => 599
[userinfraction_view] => 570
[usernote] => 1164
[usernote_note] => 1165
[vbseo_help_linkback] => 1322
[vbseo_linkbackbit] => 1320
[vbseo_linkbackmenu] => 1318
[vbseo_linkbackmenu_entry] => 1319
[vbseo_linkbacks] => 1321
[welcome_headers] => 1275
[WHOPOSTED] => 1166
[whopostedbit] => 1167
[WHOSONLINE] => 1264
[whosonlinebit] => 1169
[whosonline_resolveip] => 1265
[CMS_ads_468x60] => 427
[CMS_ads_468x60_header] => 428
[CMS_ads_728x90_sup] => 429
[CMS_ads_lateral_derecho1] => 1281
[CMS_ads_lateral_izquierdo] => 430
[CMS_ayuda] => 1291
[CMS_buscador] => 783
[CMS_enlazate] => 1280
[CMS_forumtags] => 1276
[CMS_hoyenportada] => 1282
[CMS_hoyenportada_articulo] => 1283
[CMS_institucional] => 784
[CMS_lateral_derecho] => 431
[CMS_lateral_izquierdo] => 432
[CMS_maspsicofxp] => 1284
[CMS_maspsicofxp_arcade] => 1288
[CMS_maspsicofxp_descargas] => 1285
[CMS_maspsicofxp_galeria] => 1290
[CMS_maspsicofxp_noticias] => 1287
[CMS_maspsicofxp_noticias_bit] => 1286
[CMS_porque_registrarme] => 1277
[CMS_portada] => 433
[CMS_portada_afiliados] => 434
[CMS_portada_anuncios] => 435
[CMS_portada_arcade] => 436
[CMS_portada_arcade_bit] => 437
[CMS_portada_articulos] => 438
[CMS_portada_articulo_principal] => 439
[CMS_portada_articulo_secundario1] => 440
[CMS_portada_articulo_secundario2] => 441
[CMS_portada_buscador] => 1224
[CMS_portada_descargas] => 442
[CMS_portada_descargas_bit] => 443
[CMS_portada_encuesta] => 444
[CMS_portada_encuesta_opcion] => 445
[CMS_portada_encuesta_opcion_multiple] => 446
[CMS_portada_encuesta_resultado] => 447
[CMS_portada_galeria] => 448
[CMS_portada_horario] => 449
[CMS_portada_registrate] => 450
[CMS_portada_unoticias] => 451
[CMS_portada_unoticias_bit] => 452
[CMS_portada_utemas] => 453
[CMS_portada_utemas_bit] => 454
[CMS_portada_videoteca] => 455
[CMS_portada_websemana] => 456
[CMS_reglamento] => 1279
[CMS_terminos_legales] => 1278
[CMS_zonas] => 603
[forumdisplay_announcement] => 466
)
Array
(
[0] => 603
[1] => 543
[2] => 936
[3] => 544
[4] => 545
[5] => 546
[6] => 547
[7] => 941
[8] => 942
[9] => 944
[10] => 945
[11] => 946
[12] => 947
[13] => 948
[14] => 943
[15] => 525
[16] => 526
[17] => 552
[18] => 1043
[19] => 1208
[20] => 556
[21] => 1181
[22] => 1184
[23] => 1193
[24] => 702
[25] => 703
[26] => 704
[27] => 705
[28] => 1144
[29] => 527
[30] => 1197
[31] => 1216
[32] => 1202
[33] => 428
[34] => 431
[35] => 434
[36] => 435
[37] => 429
[38] => 783
[39] => 1281
[40] => 1282
[41] => 1283
[42] => 1284
[43] => 1285
[44] => 443
[45] => 1288
[46] => 437
[47] => 1290
[48] => 1287
[49] => 1286
[50] => 603
[51] => 563
[52] => 467
[53] => 468
[54] => 571
[55] => 572
[56] => 595
[57] => 720
[58] => 1275
[59] => 1249
[60] => 1251
[61] => 1324
[62] => 1227
)

orban
10-09-2006, 09:46 AM
Okay, can you upload the original template_cache.php again BUT keep the

if ($vbulletin->userinfo['userid'] == 1)
if ($vbulletin->options['pbtc_enable'])
{
cache_templates_with_file_cache($globaltemplates, $style['templatelist']);
$globaltemplates = array();
}}

plugin? And browse a few pages. Still blank pages?

Are you running on a shared server?

This might be happening because there are too many users trying to write the cache files....and then sometimes empty files are being created.

GlitterKill
10-10-2006, 12:07 AM
On pages outside of the forums I am getting this error... when I disable the feature it works fine again... Any idea?
Fatal error: Cannot redeclare cache_templates_with_file_cache() in /home/virtual/site2/fst/var/www/html/forums/template_cache.php on line 2

GlitterKill
10-10-2006, 01:13 AM
This is probably where the trouble is coming from... I use this code as part of a form to allow my users to login to the forum from other pages outside of the forum:

<?php
//Change chdir to fit where your forum is.
chdir("/home/virtual/site2/fst/var/www/html/forums");
require('/home/virtual/site2/fst/var/www/html/forums/global.php');
include('/home/virtual/site2/fst/var/www/html/forums/includes/functions_user.php');
?>

So how can I get this to work correctly?

psico
10-10-2006, 02:29 AM
Same problem. All files in zero.

I have 4 servers dedicated, I have a Big Board, it?s impossible to run on a shared server ;)

I have 2 webservers, all the files are on NFS on a 3rd server, this server have a Slave DB and the last server is the Master DB.

orban
10-10-2006, 08:29 AM
On pages outside of the forums I am getting this error... when I disable the feature it works fine again... Any idea?
Fatal error: Cannot redeclare cache_templates_with_file_cache() in /home/virtual/site2/fst/var/www/html/forums/template_cache.php on line 2

Try to change the "Include template_cache.php" plugin to "include_once" instead of "include".

I have 2 webservers, all the files are on NFS on a 3rd server

I have no idea about NFS. Is there even a way to create files on the webserver then? You have to adjust this addon to make it work with your setup if you are running so many special things.

Are the template files being created on that 3rd server or the webservers?

Have you compiled NFS with lock files support?

Try (still keeping the userd==1 plugin) the attached file.

GlitterKill
10-10-2006, 03:42 PM
Try to change the "Include template_cache.php" plugin to "include_once" instead of "include".

That fixed it! Thanks for the great hack and quick support!

orban
10-10-2006, 04:05 PM
You should find out though why that hook gets executed twice. Maybe you include global.php twice?

GlitterKill
10-10-2006, 09:03 PM
Thanks i will look into that. I ran into a wierd conflict with this mod and the Mood Manager Mod (https://vborg.vbsupport.ru/showthread.php?t=127220). The moods appear in the post bit like they should but the drop-down for selecting the mood does not appear under the Private Messages count in the navbar like it should. When I disable the cache plug-in it works again.

orban
10-10-2006, 09:08 PM
Exclude the template in question?

psico
10-11-2006, 10:55 AM
Try to change the "Include template_cache.php" plugin to "include_once" instead of "include".



I have no idea about NFS. Is there even a way to create files on the webserver then? You have to adjust this addon to make it work with your setup if you are running so many special things.

Are the template files being created on that 3rd server or the webservers?

Have you compiled NFS with lock files support?

Try (still keeping the userd==1 plugin) the attached file.
It WORKS!!!!!!!!! You re DA MAN! ;)

Works perfectly, no more 0 bytes files and errors. What was the problem?

orban
10-11-2006, 11:00 AM
Your NFS doesn't have file locking support.

The template_cache.php you're running now is lacking file locking so you might run into empty files again when there's a lot of requests on the server.

To make this 100% sure I'd advise you to try to compile your NFS with file locking support. (Or add some sort of protection with a if (rand()<0.2) before writing the file. Just give it a try..).

psico
10-11-2006, 11:10 AM
OK, i'll talk with the hosting.

GlitterKill
10-11-2006, 02:58 PM
Exclude the template in question?

How might I do that? The drop down appears in the "navbar" template.

orban
10-11-2006, 03:08 PM
Go to the forum options and select the option group "Plugin Based Template Cache". Then add navbar to "Exclude Templates". See if that fixes it. Can you link me the addon that causes problems?

GlitterKill
10-11-2006, 03:24 PM
Excellent. Thanks for the help again. That fixed it by adding navbar to the exclude area. :)

The add-on is Mood Manager (https://vborg.vbsupport.ru/showthread.php?t=127220).

orban
10-11-2006, 03:29 PM
You can turn off the "Auto Edit Navbar" setting of Mood Manager (in your forum options again) and manually place the mood selector in the navbar template (follow the install.txt in the mood manager zip). If you do that you can cache the navbar too...

GlitterKill
10-11-2006, 03:30 PM
I'll give it a shot. :)

Edit: It worked, btw. :)

GlitterKill
10-12-2006, 01:43 PM
I hope you are eventually able to find a way to get your mod to work with auto-edits from other mods... In order to get all of the functionality of VBSEO that I had before and to get VBSpell to work I had to exclude these templates:

showthread_quickreply
editor_toolbar_on
postbit_quickedit
SHOWTHREAD
postbit_legacy

orban
10-12-2006, 01:46 PM
It will never work. Those addons have to change their behaviour and allow a switch back to template edititing like Mood Manager.

Those addons do a str_replace on the template, but the template is actually a "filename", so you can't ever replace it's contents with str_replace.

Sorry... it's the way this addon works I thought a lot about it, but it is just not possible.

mrcrx
10-12-2006, 04:00 PM
Im very new at this so how do I chmod 777 a folder since my host said I have to do it. thanks.

orban
10-12-2006, 04:04 PM
Do you have FTP or SSH access to your server?

FTP: Right click on the folder and select something like "Properties", "Options", "Permission" and set it to 777.

SSH: chmod 777 /path/to/the/folder

mrcrx
10-12-2006, 04:22 PM
ok I did that and everything is working but the shoutbox. I did the mod to it but I dont understand where to put the shoutbox code within the forumhome templete. I would like it where it was on the top. thanks for the quick responce.

orban
10-12-2006, 04:25 PM
Ask in the shoutbox thread I didn't make that mod :)

mrcrx
10-12-2006, 04:28 PM
LOL thats not good. Whats the reason in post 34 to mod it? should I put it back or is this worth it to try and figure it out.

orban
10-12-2006, 04:39 PM
Pardon?

mrcrx
10-12-2006, 04:44 PM
Glad to hear!

-----

vBShout:

https://vborg.vbsupport.ru/showthread.php?t=93097&highlight=vbshout

I assume you mean this vBShout version.

Edit the plugin "vBShout [Template Alteration]" and comment out this line:

$vbulletin->templatecache['FORUMHOME'] = str_replace($Position, $Position . ' $Shoutbox', $vbulletin->templatecache['FORUMHOME']);

/*$vbulletin->templatecache['FORUMHOME'] = str_replace($Position, $Position . ' $Shoutbox', $vbulletin->templatecache['FORUMHOME']);*/

Then modify the template "FORUMHOME" and add

$Shoutbox

where you want to have the shoutbox.

This of course disables the placement using the "vBShout Position" option in the admincp.


sorry my questions is, Is the above needed? Right now im running your code without it.

orban
10-12-2006, 04:47 PM
If it works then you don't need it...?

Bulent Tekcan
10-16-2006, 07:55 PM
Sometimes I received this error

Warning: include(/home/xxxx/public_html/satforum/templates/8808.php) [function.include]: failed to open stream: No such file or directory in /includes/class_postbit.php(300) : eval()'d code(1) : eval()'d code on line 1

Warning: include() [function.include]: Failed opening '/home/xxxxx/public_html/satforum/templates/8808.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /includes/class_postbit.php(300) : eval()'d code(1) : eval()'d code on line 1


This error also create segfault in my system than after this error load goes high load.When this error occured manualy delete include /templates folder.

Normaly this error occured showthread pages...

Thanks

orban
10-16-2006, 07:57 PM
Can you try to add a "slam protection"? Like a if (rand()<0.1) or something before locking and creating the file. Let me know if you want me to add it ;)

Might be too many users trying to create the file and/or users accessing parts of template cache when not all files are yet created.

This is of course not a real solution but will just lower the chance it will happen...

For a real solution...m..that's tough.

An option would be to limit the creating of template files to a certain userid, and then you just browse all the pages, so the cache gets created, and only then it will be available for all users....but it's kinda hard to browse all pages. I dunno :(

Line 51 to:

if (rand() < 0.1 && $vbulletin->options['pbtc_seperate'] && strlen($temp['template']) > intval($vbulletin->options['pbtc_limit']) && !in_array($temp['title'], $exclude)) {

Line 75-81:


if (rand() < 0.1)
{
$fp = fopen($templatefile, 'w+');
if ($fp && flock($fp, LOCK_EX))
{
fwrite($fp, '<?php '.$cache_to_save.' ?>');
flock($fp, LOCK_UN);
fclose($fp);
}
}

Bulent Tekcan
10-16-2006, 08:18 PM
Is this slam protection for APC (apc.slam_defense) ?

orban
10-16-2006, 08:20 PM
No, for the template_cache.php, you have to modify it, see my edited post above. Can you apply those changes? If not I can upload you a new template_cache.php just for you.

Bulent Tekcan
10-16-2006, 08:28 PM
OK...I'll test this code.

Thanks

rootnik
11-01-2006, 01:53 AM
Just installed. I can not believe how well this works with eaccelerator. Thanks orban!

Kihon Kata
11-01-2006, 02:40 AM
Just installed. I can not believe how well this works with eaccelerator. Thanks orban!
amen! It even worked on things outside my forums.

jyajay
11-01-2006, 08:56 PM
In the config.php there is datastore variable, should I put something in there If APC and your hack is installed?

// $config['Datastore']['class'] = 'vB_Datastore_Filecache';

orban
11-01-2006, 08:57 PM
It automatically gets filled. Or at least it should.

jyajay
11-02-2006, 11:09 AM
The line is like this in my config.php, it is excluded. What should I put in there?

Paul Janowitz
11-07-2006, 04:52 PM
Hello! Thanks for the great work!
Will this Hack work for a large board with a cluster of servers?
I have a load balancer with 1 server for MySQL and 3 Apache clients for the output, on each server located the vBulletin files.
Will this hack work for me, too?

orban
11-07-2006, 04:56 PM
If the vBulletin files are located on each of the three Apache servers, and they got seperate file systems it should work without any problems. I don't know how well it works with shared file systems (it for example has to support file locking)....

Paul Janowitz
11-07-2006, 08:44 PM
If the vBulletin files are located on each of the three Apache servers, and they got seperate file systems it should work without any problems.
Will the cached files then be created on every server simultaneuously or will the cached files be created on each system on its own when the specific file is called on this system (what I suppose but want to be sure...)?

amcd
11-08-2006, 05:37 AM
Will the cached files then be created on every server simultaneuously or will the cached files be created on each system on its own when the specific file is called on this system (what I suppose but want to be sure...)?
each server will have its own set of cached files in the forums/templates directory

amcd
11-08-2006, 05:39 AM
If the vBulletin files are located on each of the three Apache servers, and they got seperate file systems it should work without any problems. I don't know how well it works with shared file systems (it for example has to support file locking)....
i haven't tried it but it should work with shared file systems also.

i use php-fcgi with lighttpd and have multiple instances of xcache running. earlier i was using APC. they share the files without any problems. so by extension, NFS should also work.

Anomalies
11-08-2006, 11:27 PM
vbseo user here, this may very well come in handy.

dellow
11-11-2006, 11:38 PM
Hello,

i just installed , but i recive this error :

Warning: fopen(/home/oni/public_html/363/templates1e2137b2098c25afd2ad803c81e66123.php) [function.fopen]: failed to open stream: Permission denied in /template_cache.php on line 75

the folder /templates is already 777

orban
11-11-2006, 11:42 PM
Is PHP running in safe mode?

And why is the file in /363/templates1e2137b2098c25afd2ad803c81e66123.php and not /forums/templates/1e2137b2098c25afd2ad803c81e66123.php ?

Did you set a path in the options and forgot to add a trailing /?

dellow
11-11-2006, 11:46 PM
ohh

i just fix it ,

actualy i was put the path (/home/oni/public_html/363/templates)

i just modify it by adding slash after templates/


Thank you problem resolved :)

orban
11-11-2006, 11:47 PM
No problem.

nix
11-12-2006, 11:12 PM
In the config.php there is datastore variable, should I put something in there If APC and your hack is installed?
Any answer to this one? Like he said its commented out right now. Should we uncomment this? Or is this basically what the hack does?

Milez
11-12-2006, 11:33 PM
This hack is giving me hope as my very large board often succumbs to slow page loads during very busy times. I just read thru every post in this thread as well as the old 3.5.x thread and there is not a whole lot of success stories listed.

Has anyone noticed significant speed ups on big boards? I would love to hear some specifics on this before I install. I am currently running eAccel so this hack might be a good fit for me.

BTW the support from orban is phenomenal. Props.

Milez
11-12-2006, 11:43 PM
This hack is giving me hope as my very large board often succumbs to slow page loads during very busy times. I just read thru every post in this thread as well as the old 3.5.x thread and there is not a whole lot of success stories listed.

Has anyone noticed significant speed ups on big boards? I would love to hear some specifics on this before I install. I am currently running eAccel so this hack might be a good fit for me.

BTW the support from orban is phenomenal. Props.

orban
11-13-2006, 04:37 AM
This hack is giving me hope as my very large board often succumbs to slow page loads during very busy times. I just read thru every post in this thread as well as the old 3.5.x thread and there is not a whole lot of success stories listed.

Has anyone noticed significant speed ups on big boards? I would love to hear some specifics on this before I install. I am currently running eAccel so this hack might be a good fit for me.

BTW the support from orban is phenomenal. Props.

I'm running a (rather) big board myself (1.5 million posts) and I did/do notice a huge performance improvement.

Any answer to this one? Like he said its commented out right now. Should we uncomment this? Or is this basically what the hack does?

The datastore value in config.php has nothing to do with templates or this addon.

nix
11-13-2006, 04:55 AM
The datastore value in config.php has nothing to do with templates or this addon.
Do you think it would help/hurt to turn that on also?

amcd
11-13-2006, 05:34 AM
Do you think it would help/hurt to turn that on also?
it would certainly help

beano33
11-15-2006, 01:44 PM
Has anyone noticed significant speed ups on big boards? I would love to hear some specifics on this before I install. I am currently running eAccel so this hack might be a good fit for me.

VERY nice, people. :) We run an extremely busy board, with 6 load-balanced webservers and frequently 2000+ visitors... Watching the slow query log on the MySQL server was painful, since the template query often took more than 6 seconds on a very fast server, and of course, that slowed things down significantly, even causing the SQL server to drop other connections, etc.

This "hack" has made our board a LOT faster, and it's really appreciated. We're running it over NFS, and at first, since NFS doesn't support file locks, we were having some problems, since 0-byte files were being created. However, I found that a crude hack to fix that problem worked well... And for others who have the same problem, here's the crude hack that will fix it:

Replace the following line (around line 29 in 1.03):

if (file_exists($templatefile))

with

if (file_exists($templatefile) && filesize($templatefile) != 0)


Pretty simple, but it works. Basically, if the file is a zero-byte file, it will recreate it. If it's not... It won't. :)

Anyhow, that will fix the little problem created by file-locking if you're running NFS and getting zero-byte files.

And I'd HIGHLY recommend this to anyone who's been watching their slow-query log on their SQL server and getting frustrated with how that damn "SELECT title, template" keeps showing up in their logs. Get it, install it, your worries are over.

As for the datastore, I'd highly recommend that you get memcached set up and installed, that will provide a HUGE boost as well. :)

Kihon Kata
11-15-2006, 01:58 PM
VERY nice, people. :) We run an extremely busy board, with 6 load-balanced webservers and frequently 2000+ visitors... Watching the slow query log on the MySQL server was painful, since the template query often took more than 6 seconds on a very fast server, and of course, that slowed things down significantly, even causing the SQL server to drop other connections, etc.

This "hack" has made our board a LOT faster, and it's really appreciated. We're running it over NFS, and at first, since NFS doesn't support file locks, we were having some problems, since 0-byte files were being created. However, I found that a crude hack to fix that problem worked well... And for others who have the same problem, here's the crude hack that will fix it:

Replace the following line (around line 29 in 1.03):

if (file_exists($templatefile))

with

if (file_exists($templatefile) && filesize($templatefile) != 0)


Pretty simple, but it works. Basically, if the file is a zero-byte file, it will recreate it. If it's not... It won't. :)

Anyhow, that will fix the little problem created by file-locking if you're running NFS and getting zero-byte files.

And I'd HIGHLY recommend this to anyone who's been watching their slow-query log on their SQL server and getting frustrated with how that damn "SELECT title, template" keeps showing up in their logs. Get it, install it, your worries are over.

As for the datastore, I'd highly recommend that you get memcached set up and installed, that will provide a HUGE boost as well. :)
Thanks Beano..

Orban, can you comment on this? ^^

orban
11-15-2006, 02:16 PM
What you wanna know :)

The file_exist problem is just with NFS because it often doesn't support file locking.

The memcached datastore has nothing to do with this addon, but I'd recommend it, too.

ElForro
11-28-2006, 09:48 AM
Ths is nice... I have only one problem... I use this: https://vborg.vbsupport.ru/showthread.php?t=122594

But with the PLugin Based Template Cache on, the table with the "users who read the thread" doesn't shows. Does anybody knows how could I use both plugins at the same time?

orban
11-28-2006, 11:27 AM
You have to exclude SHOWTHREAD from being cached (in the options)

OR

edit the "showthread_getinfo [Display Thread Readers (3)]" plugin and change

$vbulletin->templatecache['SHOWTHREAD'] = str_replace($vbulletin->options['text_wrt'], $vbulletin->options['text_wrt'].$vbulletin->templatecache['Display_Readers'],$vbulletin->templatecache['SHOWTHREAD']);

to

eval('$wrt_template = "' . fetch_template('Display_Readers') . '";');

and then edit the "SHOWTHREAD" template and add

$wrt_template after

"<!-- end currently active users -->"

so you end up with

"<!-- end currently active users --> $wrt_template"

The second part is untested and if you don't know PHP/vB template system don't try this, but the performance will be a lot better.

ElForro
11-28-2006, 12:04 PM
Thanks! I edited the plugin and SHOWTHREAD and works fine!

orban
11-28-2006, 12:07 PM
Glad to hear.

ElForro
11-28-2006, 12:48 PM
I realized that I had some other modifications that work in a similar way, and they are not working now. Like "Who has visited today" or "Users registered today".

Is there some pattern in what should I need to change in every plugin in order to get them working without exclude SHOWTHREAD or any template? I would like to use this without exclusions, and modify the other ones in order to get all working.

Thanks!

Kihon Kata
11-28-2006, 01:24 PM
I still believe that this is probably one of the best hacks available for larger boards. It improved my speed massively. I continue to watch this hack.

Thanks again ORban

Milez
11-28-2006, 06:00 PM
Well I'm convinced. Thanks for the input guys. I will install this now. /me clicks install.

Update: Install was simple. I see the cache file being created and I selected to cache any template with more than 4500 chars.

Bulent Tekcan
11-29-2006, 07:53 AM
Hello orban

This error from my error_log.And sometimes occured.Any idea for this error ?

[apc-warning] GC cache entry '/home/xxxx/public_html/templates/10458.php' (dev=2051 ino=6258762) was on gc-list for 4889 seconds

Thanks

Amenadiel
11-29-2006, 11:19 AM
I'm running 3.6.4 and can't seem to activate the product. I install it normally, go to the options, set the "Enable/Disable Plugin Based Template Cache" to yes, press "save" and nothing happens.

Is there a way to enable this via the database or a config file?

Edit: heh, solved. I had uploaded the php file to the templates subdir instead of forum root.

Anyway, I found out that enabling this mod disables the Zoints Thread Tags.

SaN-DeeP
12-03-2006, 04:48 AM
I am using the Zoints Tags System as well for vb 3.6.4
Further investagating found if Cache Templates Seperately is set to yes this disables zoints tag system.

Have another question on our server GZIP is set to 1, do we require to enable Cache Templates Seperately ?

Thanks for the cool modification.

orban
12-03-2006, 08:53 AM
Why is vBulletin.org not sending email notification, it's a ++++ing pain in the ass.

I realized that I had some other modifications that work in a similar way, and they are not working now. Like "Who has visited today" or "Users registered today".

Is there some pattern in what should I need to change in every plugin in order to get them working without exclude SHOWTHREAD or any template? I would like to use this without exclusions, and modify the other ones in order to get all working.

Well, it's addons that modify templates on run time, for example with str_replace('...', '...', $template).

You can post me a list of templates and I will try to help you out with them.

I am using the Zoints Tags System as well for vb 3.6.4
Further investagating found if Cache Templates Seperately is set to yes this disables zoints tag system.

Have another question on our server GZIP is set to 1, do we require to enable Cache Templates Seperately ?

Thanks for the cool modification.

I will contact the Zoints Tags System author and try to work on a solution.

GZIP has nothing to do with this addon and you can enable or disable Cache Templates Seperately if you want. Or did you encounter any problems.?

Sorry about the slow support again, I wasn't aware that there were new replies.

SaN-DeeP
12-03-2006, 09:24 AM
I am having a serious issue with this plugin, if plugin is enabled guests/end-users are unable to view Google Adsense.. ??

orban
12-03-2006, 09:31 AM
Are you using an addon to add Adsense to your forums?

amcd
12-03-2006, 01:11 PM
Why is vBulletin.org not sending email notification, it's a ++++ing pain in the ass.i am getting email notification quite regularly

SaN-DeeP
12-04-2006, 08:36 AM
Are you using an addon to add Adsense to your forums?
nope not using any addons for adsense.

Bulent Tekcan
12-04-2006, 08:47 AM
Hello orban

This error from my error_log.And sometimes occured.Any idea for this error ?

[apc-warning] GC cache entry '/home/xxxx/public_html/templates/10458.php' (dev=2051 ino=6258762) was on gc-list for 4889 seconds

Thanks


Any idea ???

orban
12-04-2006, 12:25 PM
http://64.233.183.104/search?q=cache:ymSnlhzvQmwJ:pecl.php.net/bugs/5111+%22was+on+gc-list+for%22+%22GC+cache+entry%22&hl=en&gl=ch&ct=clnk&cd=1&client=firefox-a

I found this in Google.

I'm using xcache myself (http://trac.lighttpd.net/xcache/wiki/) so I can't really help you out sorry....

I think it might be a problem of too many files getting accessed at the same time.

I gave you a modified version of template_cache.php to use on your high traffic site didn't I?

nope not using any addons for adsense.

How are you adding Adsense then? With a template edit? Can you send me the edited template (without your ID and stuff of course) so I can debug this?

SaN-DeeP
12-04-2006, 09:22 PM
I am adding adsense on last line of my navbar template.

Only using a
<center>My adsense code here:</script>
no more tweaks or edits.

orban
12-04-2006, 09:36 PM
Tried to exclude navbar?

SaN-DeeP
12-04-2006, 09:53 PM
yeah, I tried to individually add the above code to my forumdisplay, forumhome and showthread pages but no luck..

I tried to delete the templates created inside my /forums/templates/ folder as well, but unsure why it was not working..

tested this from other proxy sites too but the adsense code appear nowhere in the code.

Bulent Tekcan
12-05-2006, 06:10 PM
http://64.233.183.104/search?q=cache:ymSnlhzvQmwJ:pecl.php.net/bugs/5111+%22was+on+gc-list+for%22+%22GC+cache+entry%22&hl=en&gl=ch&ct=clnk&cd=1&client=firefox-a

I found this in Google.

I'm using xcache myself (http://trac.lighttpd.net/xcache/wiki/) so I can't really help you out sorry....

I think it might be a problem of too many files getting accessed at the same time.

I gave you a modified version of template_cache.php to use on your high traffic site didn't I?



Yes I'm already using modified versions but still I have a problem.

orban
12-05-2006, 09:32 PM
yeah, I tried to individually add the above code to my forumdisplay, forumhome and showthread pages but no luck..

I tried to delete the templates created inside my /forums/templates/ folder as well, but unsure why it was not working..

tested this from other proxy sites too but the adsense code appear nowhere in the code.

Can you give me the html code you insert without your adsense id?

Thanks.

Yes I'm already using modified versions but still I have a problem.

What file system are you using and how many hits/second does your webserver have?

Bulent Tekcan
12-06-2006, 08:52 AM
What file system are you using and how many hits/second does your webserver have?


I'm using Ext3 system in my server...

Ad this is my report..
File Cache Information

Cached Files 305 ( 42.5 MBytes)
Hits 4847068
Misses 987
Request Rate (hits, misses) 384.31 cache requests/second\
Hit Rate 384.28 cache requests/second
Miss Rate 0.03 cache requests/second
Insert Rate 0.01 cache requests/second
Cache full count 0

orban
12-06-2006, 11:40 AM
Can you try to use

apc.slam_defense, try 80 or 90 maybe.

and

apc.file_update_protection = 5

apc.slam_defense On very busy servers whenever you start the server or
modify files you can create a race of many processes
all trying to cache the same file at the same time.
This option sets the percentage of processes that will
skip trying to cache an uncached file. Or think of it
as the probability of a single process to skip caching.
For example, setting this to 75 would mean that there is
a 75% chance that the process will not cache an uncached
file. So the higher the setting the greater the defense
against cache slams. Setting this to 0 disables this
feature.
(Default: 0)


apc.file_update_protection
When you modify a file on a live web server you really
should do so in an atomic manner. That is, write to a
temporary file and rename (mv) the file into its permanent
position when it is ready. Many text editors, cp, tar and
other such programs don't do this. This means that there
is a chance that a file is accessed (and cached) while it
is still being written to. This file_update_protection
setting puts a delay on caching brand new files. The
default is 2 seconds which means that if the modification
timestamp (mtime) on a file shows that it is less than 2
seconds old when it is accessed, it will not be cached.
The unfortunate person who accessed this half-written file
will still see weirdness, but at least it won't persist.
If you are certain you always atomically update your files
by using something like rsync which does this correctly, you
can turn this protection off by setting it to 0. If you
have a system that is flooded with io causing some update
procedure to take longer than 2 seconds, you may want to
increase this a bit.
(Default: 2)

Are you using NFS?

Bulent Tekcan
12-15-2006, 05:34 PM
Hello orban

I tried this but same problem occured,and also load problem in my server since 1-2 month.Every 1-2 days server load jumping 150-160 than my mysql table is full,and a lot of error occured.Many ticket to my host and also report vbulletin.But since 1 week I had never problem,because uninstalled this product,load max 5-6 now.

I don't know why but this product not good idea very high traffic board and big boards.I think some files or script hang in system.

Thanks

orban
12-15-2006, 08:39 PM
Hello orban

I tried this but same problem occured,and also load problem in my server since 1-2 month.Every 1-2 days server load jumping 150-160 than my mysql table is full,and a lot of error occured.Many ticket to my host and also report vbulletin.But since 1 week I had never problem,because uninstalled this product,load max 5-6 now.

I don't know why but this product not good idea very high traffic board and big boards.I think some files or script hang in system.

Thanks

Well, this modification has nothing to do with mysql at all. (So a mysql table lock can not possible come from this addon.)

Files don't "hang", there is a file lock protection in place. You can have a look at the code, there is nothing that can possibly go wrong. (Unless you use special file systems that don't support file locking, like NFS.)

I was running this addon with a board with 3000 users online on a single server (250 requests/second, 150gb traffic on that day I think) load was between 10 and 20. Also on daily use with 400-1000 users online with a load between 0.5 and 2.

I am using this with great success and as you can see a lot of people use it without any problems too.

I would advise you to try xcache instead of APC or install the newest APC version if you don't have already.

This must be a misconfiguration on your side or a particular bug on your server.

Bulent Tekcan
12-17-2006, 04:53 PM
I'm using APC 3.0.13 Development series,is xcache support PHP 5.2.0 and 64bit OS ?

orban
12-17-2006, 05:11 PM
I don't know, maybe try to ask their irc channel. (irc://irc.freenode.net/lighttpd)

Also if you are using APC-dev it might be a bug.

Kihon Kata
12-17-2006, 05:54 PM
I'm running Fedora Core64 w/ PHP5 on my dedicated server AND running this. Works well.



I'm using APC 3.0.13 Development series,is xcache support PHP 5.2.0 and 64bit OS ?

amcd
12-17-2006, 06:06 PM
i am running FreeBSD 6 RELEASE with lighttpd and xcache and running this plugin and it works great

dadimes
12-17-2006, 11:13 PM
thanks, just installed on 3.6.3, and it works great :)

EDIT: problem :-/ when i go to the page without index.php at the end, it just ends at a blank
EDIT2: I got rid of that by deleting the index.html page, is that ok?

Bulent Tekcan
12-18-2006, 05:19 AM
I'm running Fedora Core64 w/ PHP5 on my dedicated server AND running this. Works well.

Which version, xcache 1.0.3 or 1.2.0 (unstable)

orban
12-18-2006, 08:45 AM
thanks, just installed on 3.6.3, and it works great :)

EDIT: problem :-/ when i go to the page without index.php at the end, it just ends at a blank
EDIT2: I got rid of that by deleting the index.html page, is that ok?

What exactly was your problem? When going to what page it was blank?

Viper007Bond
12-18-2006, 09:52 AM
Runs awesome here. :)

dadimes
12-19-2006, 03:04 AM
What exactly was your problem? When going to what page it was blank?

when i type in just the domain name eg www.myforum.com it directed to a blank page.

when i typed in www.myforum.com/index.php it displayed the forum

i simply deleted the blank index.html page, and theres no issues so far, n the sites sped up a bit

orban
12-19-2006, 04:51 AM
Wow, that's really weird.

Are you sure you created the folder templates/ and the temporary files are actually created in there?

amcd
12-19-2006, 05:03 AM
in the webserver configuration there is a list of files which the webserver recognises as index files. if that list contains index.html before index.php, then giving the url without filename will show index.html as that is the preferred index file.

i dont think your problem has anything to do with this plugin. the only connection may be that while installing this, you inadvertently created an index.html file in the forum root directory.

orban
12-19-2006, 11:24 AM
Ohhh, right. That's the explanation. :)

I didn't realize that he probably created it in the wrong folder...

Thanks!

RS_Jelle
12-19-2006, 05:04 PM
I get the following Error :

Warning: Unknown(template_cache.php): failed to open stream: No such file or directory in /admincp/options.php(1025) : eval()'d code on line 15

Warning: (null)(): Failed opening 'template_cache.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /admincp/options.php(1025) : eval()'d code on line 15

Fatal error: Call to undefined function: clear_template_cache() in /home/kakashi/public_html/forums/admincp/options.php(1025) : eval()'d code on line 16

When I attempt to enable it via vbuleltin options. I attempted to enter in the path to the template folder but no joy.

The forums , templates and files in the templates directory are all set to 777. So I really can't see the problem :S
I've got the same problem ... but I uploaded it to the correct folder, my forums folder. I can't give an url cause it's currently on our test site. When I uploaded the php file also to the AdminCP directory, the problem was solved (and options.php could find it, in the AdminCP directory, but the file should be normally only in the forums folder).

Edit: I could fix it easily by correcting the product file:
Change the include of the two admin plugins (admin_global and admin_options_processing) to:
include_once('./template_cache.php');
instead of
include_once('template_cache.php');
Note: a require_once function would be better instead of a include_once (also just to follow the vBulletin coding standards).

Edit 2: I discovered a new bug, the archive isn't working any more, you need to add a plugin there too.

Amenadiel
12-23-2006, 07:33 PM
I am using the Zoints Tags System as well for vb 3.6.4
Further investagating found if Cache Templates Seperately is set to yes this disables zoints tag system.

Have another question on our server GZIP is set to 1, do we require to enable Cache Templates Seperately ?

Thanks for the cool modification.

You were right, I disabled the "Cache Templates Seperately" option and now it works fine with Zoints Thread Tags

orban
12-23-2006, 07:40 PM
If you don't use the "Cache Templates Seperately" option then the performance improvement is tiny. I strongly recommend using "Cache Templates Seperately" and a PHP opcode cache to get the best results.

I guess Zoints dynamically replaces templates at runtime, that's why it doesn't work.

da420
12-23-2006, 07:51 PM
How do I know if I am using a "PHP opcode cache" ?

Thanks.

amcd
12-23-2006, 07:57 PM
search for APC / xcache / eaccelerator in your phpinfo page. there should be a separate section for one of these.

also, you will see something similar to
This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
with XCache v1.0.2, Copyright (c) 2005-2006, by mOo

turck mmcache was also popular some years ago, but its not updated and hardly used any more. ioncube also has a opcode cache i believe.

Kihon Kata
12-24-2006, 05:07 PM
Hi Orban! Merry Christmas.

Question: Does this hack automatically delete the cached template when the template is changed or updated? Mine is doing something strange. The only way I can view an updated template in the browser is to turn off your cacher, update the template, load the page.

Then I turn the cacher back on.

It seems as if the cache is still there until I turn the cacher off.

LMK what this means.

Thanks!

orban
12-24-2006, 08:53 PM
I've got the same problem ... but I uploaded it to the correct folder, my forums folder. I can't give an url cause it's currently on our test site. When I uploaded the php file also to the AdminCP directory, the problem was solved (and options.php could find it, in the AdminCP directory, but the file should be normally only in the forums folder).

Edit: I could fix it easily by correcting the product file:
Change the include of the two admin plugins (admin_global and admin_options_processing) to:
include_once('./template_cache.php');instead of
include_once('template_cache.php');Note: a require_once function would be better instead of a include_once (also just to follow the vBulletin coding standards).

Edit 2: I discovered a new bug, the archive isn't working any more, you need to add a plugin there too.

I don't know, the plugin works for as distributed (archive works too). Do you have any special settings? Plugins that modify the archive?

Hi Orban! Merry Christmas.

Question: Does this hack automatically delete the cached template when the template is changed or updated? Mine is doing something strange. The only way I can view an updated template in the browser is to turn off your cacher, update the template, load the page.

Then I turn the cacher back on.

It seems as if the cache is still there until I turn the cacher off.

LMK what this means.

Thanks!

Yes, it should automatically deleted all cached templates when a template is edited/removed/added.

RS_Jelle
12-24-2006, 09:02 PM
I don't know, the plugin works for as distributed (archive works too). Do you have any special settings? Plugins that modify the archive?
Not that I'm aware of and no plugins for the archive. I don't have any mods that modify vBulletin a lot, only general things like vBadvanced, DownloadsII, glossary, v3 Arcade, Photoplog, ...

Just like Kihon Kata said, changes aren't saved in the template cache on my site also and I need to turn it off and on again for that.

orban
12-24-2006, 09:05 PM
Most of those plugins modify vB quite a lot (use a lot of hooks). So it's quite easy for them to mess something up. Can you try to enable them 1 by 1 on a dev board so we can track down the culprit? I can then maybe give you a fix.

RS_Jelle
12-24-2006, 09:30 PM
I disabled all products, still the same two problems (and there are no file edits).

But I think it's just the same problem like I had after enabling the mod in the options, the include statement is wrong (I posted a fix for the Admin/options problem).

I changed the third instance of the include statement too and the archive was fixed (without creating new errors on other parts of the site) :)
The template saving bug isn't solved with it.

Kihon Kata
12-25-2006, 02:16 AM
Yes, it should automatically deleted all cached templates when a template is edited/removed/added.Based on my description, is it doing that? I don't think it is.

orban
12-25-2006, 08:53 AM
I downloaded a fresh 3.6.4 just now and it seems they changed the header of their files.

You have to change template_cache.php:99 (or download the new template_cache.php)

from

if (strpos(CVS_REVISION, 'template.php') OR $settings_changed)

to

if (strpos($_SERVER['SCRIPT_NAME'], 'template.php') OR $settings_changed)

This fixes the clearing of the templates/ folder when a template is edited/added.

I still can't reproduce the errors RS_Jelle is encountering.

Both include('template_cache.php') and require_once('./template_cache.php') work fine for me.

RS_Jelle
12-25-2006, 09:29 AM
Indeed, I think:
include_once('./template_cache.php');
or better (vBulletin coding standards):
require_once('./template_cache.php');
works on all servers, but it seems that the current one (without ./) is being picky for some servers. I don't know why also, but all vBulletin includes are like this.

Why not change it also if it works like that for everyone :)
Thanks for the clear cache update, it works fine now.

orban
12-25-2006, 09:37 AM
So, switching to "require_once('./template_cache.php');" and using the new template_cache fixed all your problems?

My idea is that include() is weaker. If you upgrade your board, move to a new server, and forget template_cache.php, it won't break anything if you miss the file, because include() will just complain about a missing file then. Require will stop the execution.

RS_Jelle
12-25-2006, 01:06 PM
Include also works if you add ./, I understand your opinion about moving servers etc.

So it would become:
include_once('./template_cache.php');

Another small suggestion: add the version check system (https://vborg.vbsupport.ru/showthread.php?t=124679) and an url (https://vborg.vbsupport.ru/showpost.php?p=1065771&postcount=13) to the product xml, that's easier to manage the products on your site.

Kihon Kata
12-25-2006, 01:07 PM
Orban, you rock. Thanks for the updated template_cache.php. I have tested this on two template changes and it worked fine. I even tested it on Locigian's webTemplates (https://vborg.vbsupport.ru/showthread.php?t=103076) and it worked fine after I updated them.

Thanks for working on Christmas Day and Merry Christmas to you

orban
12-25-2006, 03:17 PM
Include also works if you add ./, I understand your opinion about moving servers etc.

So it would become:
include_once('./template_cache.php');

The product.xml has "include_once" in the two admin_ hooks and just a single "include" in the style_fetch which shouldn't be called twice in any occasion anyway...hmmm...


Another small suggestion: add the version check system (https://vborg.vbsupport.ru/showthread.php?t=124679) and an url (https://vborg.vbsupport.ru/showpost.php?p=1065771&postcount=13) to the product xml, that's easier to manage the products on your site.

Gonna have a look. Maybe. :)

gothicuser
12-26-2006, 06:02 AM
Orban, did you have a chance to look into the vBAdvanced problem mentioned HERE? (https://vborg.vbsupport.ru/showpost.php?p=1036223&postcount=6)
This mod is really great, but because we use vBA is untennable at the moment.
Works perfectly from within the 'forum' folder, and has no problem whatever with the few other hacks we have installed (Zoints local/DownloadsII/VBSEO Sitemapper/GARS/GAL)

Thankyou for your time

orban
12-26-2006, 08:37 AM
Did you try to set the "Full Path to the Template/ Folder" option? Enter an absolute path.

gothicuser
12-26-2006, 10:10 AM
Did you try to set the "Full Path to the Template/ Folder" option? Enter an absolute path.
Yes, I did that. One question though, does it need the trailing slash (as in /home/public_html/fred/forum/ ?)

I also notice that it is falling over only on the 'Header/Navbar' replacements that are entered into the vBAdvanced settings. e.g. I have entered replacements for obvious files such as login.php, private.php, memberlist.php etc. and when the template_cache is enabled these links do NOT function (they try to use the 'root' path). I have NOT entered replacements for the gallery or external FAQ installations, but these links DO work.

Clear as mud?? tell me about it :confused:

Thankyou very much for your prompt reply.

orban
12-26-2006, 10:24 AM
Yes, I did that. One question though, does it need the trailing slash (as in /home/public_html/fred/forum/ ?)

I also notice that it is falling over only on the 'Header/Navbar' replacements that are entered into the vBAdvanced settings. e.g. I have entered replacements for obvious files such as login.php, private.php, memberlist.php etc. and when the template_cache is enabled these links do NOT function (they try to use the 'root' path). I have NOT entered replacements for the gallery or external FAQ installations, but these links DO work.

Clear as mud?? tell me about it :confused:

Thankyou very much for your prompt reply.

It's because many addons use run-time str_replace of templates (don't ask me why).
Yes, trailing slash.

/home/public_html/fred/forum/templates/

Brew
01-01-2007, 09:58 PM
Is there a way to get this mod to work with mods that change messages posts?

Specifically this mod:

BBcode Manager 1.32 : New looks for your quote, html, php and code bbcodes !
https://vborg.vbsupport.ru/showthread.php?t=120073

The author of that mod has left it orphaned so I won't get any help there....so I am hoping that something can be done through this mod to make it compatible.

(crossing my fingers)

The problem seems to be that because the message is getting cached it won't allow the new graphics in the above mentioned mod. I'm not really sure why though.

Thanks!

orban
01-02-2007, 07:43 AM
Exclude the following templates in the template cache settings:

bbcode_quote
bbcode_code
bbcode_highlight
bbcode_php
bbcode_html

Brew
01-02-2007, 01:51 PM
Exclude the following templates in the template cache settings:

bbcode_quote
bbcode_code
bbcode_highlight
bbcode_php
bbcode_html

Thank you for going through the hassle for this Orban :)

I tried butting the above in the "Exclude Templates" box in the template cache system but the image quotes still are not displayed.

Again, thanks!

Brew
01-02-2007, 05:17 PM
There's another incompatibility :(

After enabling your template cache the "Count of unread posts in the welcome box" stopped working....The hack is here:
https://vborg.vbsupport.ru/showthread.php?p=1149261

Thanks again for your help!

orban
01-02-2007, 05:22 PM
navbar

is the template to be excluded.

Brew
01-02-2007, 05:42 PM
navbar

is the template to be excluded.

Naw....that didn't do it.

When looking at the source there is this:

<!-- breadcrumb, login, pm info -->

Should I include those? (each seperately?)

Or would that defeat the caching too much?

DementedMindz
01-02-2007, 05:46 PM
There's another incompatibility :(

After enabling your template cache the "Count of unread posts in the welcome box" stopped working....The hack is here:
https://vborg.vbsupport.ru/showthread.php?p=1149261

Thanks again for your help!

i have both installed and they work together

Brew
01-02-2007, 05:56 PM
i have both installed and they work together

Thanks for your reply DementedMindz!

I got it to work but only after I disabled "Cache Templates Seperately".

Now off to figure out why :/

Brew
01-02-2007, 06:46 PM
Exclude the following templates in the template cache settings:

bbcode_quote
bbcode_code
bbcode_highlight
bbcode_php
bbcode_html

This doesn't work when I use NO to Cache Templates Separately also. I don't think APC is installed atm anyway so it's better to be turned off.

I've looked all over and can't find other templates that other mod uses. Any ideas?

In case anyone is wondering....there are two issues I'm talking about...one is with the bbcode_quote mod and the other is the "Count of unread posts in the welcome box". The message here is the one about the bbcode_quote.

orban
01-03-2007, 03:00 PM
I don't know then sorry :/

thincom2000
01-06-2007, 05:11 PM
I also notice that it is falling over only on the 'Header/Navbar' replacements that are entered into the vBAdvanced settings. e.g. I have entered replacements for obvious files such as login.php, private.php, memberlist.php etc. and when the template_cache is enabled these links do NOT function (they try to use the 'root' path).

You could modify the navbar to use variables and just set them in the page's code itself (to save a query). This way you can avoid the str_replace, and you don't have to exclude your navbar.

I actually installed this product just to cache my navbar, because it was slowing everything down.

Also, @orban, how would I go about adding templates to this template cache?
I have a number of custom templates that I'm using and I'm tired of seeing the message "4 queries for uncached templates" flash quickly just before the page loads.

I tried creating a plugin that adds the templates to $globaltemplates, but it ... oh, I forgot a closing ')'

This dramatically increases my page load time -- I had been getting complaints about 8 - 16 second page request times, followed by about another 3 - 4 for loading. Now most pages load in 1-2 seconds. XD

orban
01-07-2007, 01:10 AM
You could modify the navbar to use variables and just set them in the page's code itself (to save a query). This way you can avoid the str_replace, and you don't have to exclude your navbar.

I actually installed this product just to cache my navbar, because it was slowing everything down.

Also, @orban, how would I go about adding templates to this template cache?
I have a number of custom templates that I'm using and I'm tired of seeing the message "4 queries for uncached templates" flash quickly just before the page loads.

I tried creating a plugin that adds the templates to $globaltemplates, but it ... oh, I forgot a closing ')'

This dramatically increases my page load time -- I had been getting complaints about 8 - 16 second page request times, followed by about another 3 - 4 for loading. Now most pages load in 1-2 seconds. XD

All sorted?

You have to add your custom templates to $globaltemplates that's correct.

thincom2000
01-07-2007, 07:40 AM
My custom templates were cached for about an hour, then they weren't cached anymore.

Don't know what to do now... Didn't change anything. Back up to 5 second load times.

Okay, so even though my setting for $vboptions[forumhome] is home.php, my navbar is attempting to go to index.php. And what do you know? Over half my templates folder vanished...

orban
01-07-2007, 09:38 AM
That's really weird. Files don't usually just disappear.

Have you tried to manually clear our your template cache folder?

thincom2000
01-07-2007, 05:58 PM
Yes. They seem to be coming back now though. The weird thing is that my $vboptions[forumhome] in the navbar is still eval-ing to 'index' even though in vBulletin Options it's set to 'home'

I don't see how it could be an str_replace issue, since it says $vboptions[forumhome] and not 'index' in the template.

Edit:
For some reason my forum had switched to using an older version of my current style that didn't have any updates from the past month.

Everything's working beautifully again.

Brew
01-08-2007, 01:32 PM
Man I have been fiddling with this for days and I'm beginning to think this mod isn't working at all....on my site anyway.

If I turn on the cache and go to the following address it reads the same as if the cache were turned off.

http://www.websiteoptimization.com/services/analyze/

Shouldn't the load times change with this mod turned on?

amcd
01-08-2007, 01:39 PM
Page load times will change only if your server is creaking under heavy load. If your server is only moderately busy, you may not see any change.

You should see new files being written to the templates directory. If that happens, be assured that it is working.

Also, the benefit will be minimal (or maybe none) unless you have a good php opcode cache along with this hack.

orban
01-08-2007, 02:36 PM
This mod is for bigger boards, you usually won't notice any difference on your small board with just a handful people online (if that is your board: http://www.politicalforums.net/).

Brew
01-08-2007, 02:57 PM
Well...It's really not a problem for me, load time I mean. I have a 3mb connection.

But there are a couple people complaining about access times to the site.

So I'm trying to make em happy ya know.

orban
01-08-2007, 02:59 PM
The template cache doesn't not decrease your page size.

Your site is already gzipped, that's about as good as it can get.

Brew
01-08-2007, 03:06 PM
I tried the template compression mod you mentioned earlier in this thread. But I really don't see a difference there either.

But...thanks for your help...

Keep up the good work!

orban
01-09-2007, 09:02 AM
yeah it makes basically no difference if your site is gzipped

RobParker
01-09-2007, 12:35 PM
Is there any reason why this mod would stop the "Who's been online today" mod from working?

With this enabled it doesn't display. When I disable this, it works fine.

I cleared my template cache directory so it's definitely not just finding an old file.

AzzidReign
01-10-2007, 04:01 AM
Question for ya. I used this mod (an earlier version for 3.5.x) and when this cache mod is enabled, I could only use 1 style and the others would come up as white pages. My site has 3 styles and I'm wondering if it has changed so you can have multiple styles and still use this hack.

orban
01-10-2007, 07:43 AM
I am using this with 3 styles.

Do you get any php errors when switching styles? Check your logs :) White page usually means errors.

orban
01-12-2007, 04:25 PM
Removed this post on author's request.

amcd
01-12-2007, 04:35 PM
orban, can you briefly explain how/why this new experimental one is better than the released product?

orban
01-12-2007, 04:42 PM
Well, the old one used the following "hack" for the template evals:

eval('$navbar = include("templates/1234.php");');

And that only for larger templates. Smaller ones (default setting 4500 bytes I think) were still executed the old way (even if stored in a file).

This one, however, takes a different approach.

eval('$navbar = template_1234($spacer_open, $stylevar, $GLOBALS, $welcomeheaders)');

All templates are parsed and stored in functions, and all "template function" for one page are stored in a file.

So basically all eval()s only execute a function call. This means all eval calls are nearly completely avoided, and there is just one file for every page. The files aren't too big on disk (40-100kb) but up to 2.5mb in xcache which isn't an issue though so far (I think this is because vB compiles all templates as one very long string with <if> calls being ternary conditionals).

thincom2000
01-12-2007, 09:37 PM
Yeah, I noticed coding one of my plugins that using a bunch of eval()s really slows things down. I ended up rewriting the code 3 times before I came up with a way that didn't use a more than one eval() on runtime.

Thanks for the update!

thincom2000
01-18-2007, 11:41 AM
What could be causing fatal undefined function errors when using the experimental code?

orban
01-18-2007, 11:46 AM
That the file doesn't get included, have you created a writable cache/ folder?

amcd
01-18-2007, 12:47 PM
That's really great thinking, orban. What is stopping you from making this the default method?

orban
01-18-2007, 02:22 PM
Well, you can't easily "exclude" templates like in the default method so all addons that dynamically modify templates on run time will break and it's mostly untested. :)

But yeah I might release it as a second option.

thincom2000
01-18-2007, 02:58 PM
That the file doesn't get included, have you created a writable cache/ folder?

Yes, it is only happening on some pages. I am thinking it is an issue with those pages, but I don't really know what to look for.

I reverted to the default method to "fix" the issue.