Go Back   vb.org Archive > vBulletin Modifications > Archive > Modification Graveyard
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Plugin Based Template Cache Details »»
Plugin Based Template Cache
Version: 1.0.3, by orban orban is offline
Developer Last Online: Oct 2012 Show Printable Version Email this Page

Category: Board Optimization - Version: 3.6.0 Rating:
Released: 07-22-2006 Last Update: Never Installs: 153
Uses Plugins
Additional Files  
No support by the author.

Removed on author's request.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #202  
Old 12-24-2006, 05:07 PM
Kihon Kata Kihon Kata is offline
 
Join Date: Nov 2003
Posts: 763
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
Reply With Quote
  #203  
Old 12-24-2006, 08:53 PM
orban orban is offline
 
Join Date: Jan 2005
Posts: 445
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by RS_Jelle View Post
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:
PHP Code:
include_once('./template_cache.php'); 
instead of
PHP Code:
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?

Quote:
Originally Posted by Kihon Kata View Post
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.
Reply With Quote
  #204  
Old 12-24-2006, 09:02 PM
RS_Jelle RS_Jelle is offline
 
Join Date: Jul 2005
Posts: 1,276
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by orban View Post
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.
Reply With Quote
  #205  
Old 12-24-2006, 09:05 PM
orban orban is offline
 
Join Date: Jan 2005
Posts: 445
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #206  
Old 12-24-2006, 09:30 PM
RS_Jelle RS_Jelle is offline
 
Join Date: Jul 2005
Posts: 1,276
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #207  
Old 12-25-2006, 02:16 AM
Kihon Kata Kihon Kata is offline
 
Join Date: Nov 2003
Posts: 763
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by orban View Post
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.
Reply With Quote
  #208  
Old 12-25-2006, 08:53 AM
orban orban is offline
 
Join Date: Jan 2005
Posts: 445
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

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

Code:
	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.
Reply With Quote
  #209  
Old 12-25-2006, 09:29 AM
RS_Jelle RS_Jelle is offline
 
Join Date: Jul 2005
Posts: 1,276
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Indeed, I think:
PHP Code:
include_once('./template_cache.php'); 
or better (vBulletin coding standards):
PHP Code:
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.
Reply With Quote
  #210  
Old 12-25-2006, 09:37 AM
orban orban is offline
 
Join Date: Jan 2005
Posts: 445
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #211  
Old 12-25-2006, 01:06 PM
RS_Jelle RS_Jelle is offline
 
Join Date: Jul 2005
Posts: 1,276
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Include also works if you add ./, I understand your opinion about moving servers etc.

So it would become:
PHP Code:
include_once('./template_cache.php'); 
Another small suggestion: add the version check system and an url to the product xml, that's easier to manage the products on your site.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04601 seconds
  • Memory Usage 2,321KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (5)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete