vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Board Optimization - Plugin Based Template Cache (https://vborg.vbsupport.ru/showthread.php?t=121876)

MissKalunji 08-29-2006 02:50 PM

Quote:

Originally Posted by orban
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

Code:

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

Code:

/*$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/showthrea...=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

Code:

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

Code:

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

MissKalunji 08-29-2006 08:57 PM

Quote:

Originally Posted by orban
Oh sorry....try

Code:

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

Code:

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


same thing.....

orban 08-29-2006 10:44 PM

Last two lines of the plugin should look like:

Code:

/*$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

Quote:

Originally Posted by orban
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

Quote:

Originally Posted by orban
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

Quote:

Originally Posted by orban
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....50&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

Code:

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

with

Code:

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

Quote:

Originally Posted by hornstar1337
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

Quote:

Originally Posted by amcd
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..

Quote:

* 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:

Code:

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.


All times are GMT. The time now is 11:38 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01408 seconds
  • Memory Usage 1,823KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (10)bbcode_code_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete