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
  #302  
Old 03-12-2007, 04:36 PM
dbirosel dbirosel is offline
 
Join Date: Feb 2007
Location: San Diego
Posts: 587
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

reserved!!
Reply With Quote
  #303  
Old 03-12-2007, 05:03 PM
orban orban is offline
 
Join Date: Jan 2005
Posts: 445
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by bluechris View Post
I have a problem since i installed it.... suddenly the forum index shows a strange error



the line 151 in forums.php is this



Forums.php is the normal index.php that vb has but i had renamed it and i have index the cmps.

The thing is that the code in the file is fine.... even though i had replaced it with the latest and i still getting the error.

I had also uninstalled the addon with no luck...... I am with IIS6 .. php 4.4.6 with apc and mysql 4.1.16.

Anyone has any clue?
Are you using the experimental version?

Quote:
Originally Posted by dbirosel View Post
reserved!!
Pardon?
Reply With Quote
  #304  
Old 03-13-2007, 04:28 AM
Zia's Avatar
Zia Zia is offline
 
Join Date: Dec 2005
Location: golpo.net
Posts: 931
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

helo orban,

here its ur experiemntal one ?
https://vborg.vbsupport.ru/showpost....&postcount=242

i got spaces for using it...but could u plese be more specific...or can u just make the function.php or whatever.php files here .. i want to go for it..if it give more output......

Looking for ur help.
Thnx.
Reply With Quote
  #305  
Old 03-16-2007, 12:19 PM
GrendelKhan{TSU's Avatar
GrendelKhan{TSU GrendelKhan{TSU is offline
 
Join Date: Jun 2005
Location: Boston | Seoul, S. Korea
Posts: 1,311
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

woot
Reply With Quote
  #306  
Old 03-18-2007, 12:33 AM
|Jordan|'s Avatar
|Jordan| |Jordan| is offline
 
Join Date: Nov 2004
Posts: 479
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Where can i get the opcode cache plugin?
Reply With Quote
  #307  
Old 03-18-2007, 06:22 AM
Zia's Avatar
Zia Zia is offline
 
Join Date: Dec 2005
Location: golpo.net
Posts: 931
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by |Jordan| View Post
Where can i get the opcode cache plugin?
do u have any opcode cacher installed ?
like Xcache /eAcc or APC ?

Orban's mod will boost cacher....


if ur on xcache u can also try IT
Reply With Quote
  #308  
Old 03-18-2007, 09:20 AM
orban orban is offline
 
Join Date: Jan 2005
Posts: 445
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by |Jordan| View Post
Where can i get the opcode cache plugin?
Sorry, what do you mean?

You don't need any vBulletin modification to run APC/aAccelerator/xcache.
Reply With Quote
  #309  
Old 03-18-2007, 12:24 PM
Zia's Avatar
Zia Zia is offline
 
Join Date: Dec 2005
Location: golpo.net
Posts: 931
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by orban View Post
EXPERIMENTAL (for your dev board)

This will NEVER work with plugins who modify templates on run time so don't even try

Place the function in a file & create forums/cache folder

Code:
function cache_templates_one_file($templates, $templateidlist)
{
	global $vbulletin, $templateassoc;

	if (empty($templateassoc))
	{
		$templateassoc = unserialize($templateidlist);
	}

	if ($vbulletin->options['legacypostbit'] AND in_array('postbit', $templates))
	{
		$templateassoc['postbit'] = $templateassoc['postbit_legacy'];
	}
	
	foreach ($templates AS $template)
	{
		$templateids[] = intval($templateassoc["$template"]);
	}

	/* THE ACTUAL PLUGIN */
	$templatefile = 'cache/'.md5(implode(',', $templateids)).'.php';
	if (file_exists($templatefile))
	{
		include($templatefile);
	}
	else
	{
		$templatecache = '';
	/* END ACTUAL PLUGIN */
		// run query
		$temps = $vbulletin->db->query_read("
			SELECT templateid, title, template
			FROM " . TABLE_PREFIX . "template
			WHERE templateid IN (" . implode(',', $templateids) . ")");
		// cache templates
		while ($temp = $vbulletin->db->fetch_array($temps))
		{
			/* START ACTUAL PLUGIN */
			preg_match_all('/\$[a-zA-Z][a-zA-Z\_0-9]+/', $temp['template'], $out);
			$vars = array_unique($out[0]);
			$templatecache .= '
				/* '.$temp['title'].' */ $template_vars['.$temp['templateid'].'] = \''.implode(', ', $vars).'\'; function template_'.$temp['templateid'].'('.implode(', ', $vars).') { return "'.$temp['template'].'"; } ';
			/* END ACTUAL PLUGIN */
		}
		$vbulletin->db->free_result($temps);
		/* START ACTUAL PLUGIN */
		$fp = fopen($templatefile, 'w+');
		if ($fp && flock($fp, LOCK_EX))
		{
			fwrite($fp, '<?php '.$templatecache.' ?>');
			flock($fp, LOCK_UN);
			fclose($fp);
		}
		include($templatefile);
		/* END ACTUAL PLUGIN */
	}

	foreach ($templates AS $template)
	{
		if (substr($template, 0, 17) == 'editor_jsoptions_' or substr($template, 0, 14) == 'editor_styles_')
		{
			$vbulletin->templatecache[$template] = call_user_func('template_'.intval($templateassoc["$template"]));
		}
		else $vbulletin->templatecache[$template] = '".template_'.intval($templateassoc["$template"]).'('.$template_vars[intval($templateassoc["$template"])].')."';
		#$vbulletin->templatecache[$template] = '';
	}
	
	$vbulletin->bbcode_style = array(
		'code'  => &$templateassoc['bbcode_code_styleid'],
		'html'  => &$templateassoc['bbcode_html_styleid'],
		'php'   => &$templateassoc['bbcode_php_styleid'],
		'quote' => &$templateassoc['bbcode_quote_styleid']
	);
}
And call it in "cache_templates" hook (adjust the path for the file with the function in it)

Code:
include('includes/functions_hooks.php');
cache_templates_one_file($globaltemplates, $style['templatelist']);
$globaltemplates = array();
does not delete cache when modifying templates and no options in it, please

ONLY USE THIS IF YOU KNOW WHAT YOU ARE DOING and understand the code

It basically reads all templates and creates a function for every template with all the variables in it passed as arguments so you can avoid scope issues.

Please note this takes up A LOT of space in xcache/APC (about 40mb for the cache/ files alone) so make sure you have enough space allocated (I'm using 128mb atm and that works fine).

Again please don't install this if you don't know PHP well and know what you're doing. Just sharing this because I've been using it for a few days successfully and maybe somebody can use it. This mod doesn't modify the database or any vB files (like the version you can download).
Orban,could u please help a bit more about it...
Reply With Quote
  #310  
Old 03-18-2007, 12:32 PM
orban orban is offline
 
Join Date: Jan 2005
Posts: 445
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just don't have the time right now to support this thing (I mean check the number of pages in this thread, and the experimental is indeed experimental and there's several issues to be worked out).
Reply With Quote
  #311  
Old 03-18-2007, 12:40 PM
Zia's Avatar
Zia Zia is offline
 
Join Date: Dec 2005
Location: golpo.net
Posts: 931
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ah ha..Okay..
just thought it might be good than the existing one...so wanted to give a try....

Okay....but like this existing mods "boost up php cache" for any opcode cacher...
is there any way to boost up var.cacher ?
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 04:14 PM.


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.07458 seconds
  • Memory Usage 2,330KB
  • 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_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
  • (1)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