Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Beta Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Offline Template Compressor Details »»
Offline Template Compressor
Version: 1.00, by Andreas Andreas is offline
Developer Last Online: Jan 2023 Show Printable Version Email this Page

Version: 3.0.0 Rating:
Released: 07-12-2004 Last Update: Never Installs: 5
Is in Beta Stage  
No support by the author.

This hack is similar to Logicians Realtime Template Compressor
(https://vborg.vbsupport.ru/showthread.php?t=56589), but uses
a slightly different approach:

Instead of doing the compression realtime when the pages are
generated, it compresses the templates right in the database when they
are being saved, so there will be zero overhead during normal operation.
The templates will still look normal when you edit them, just the
parsed versions will be compressed.

Currently this hack does not touch JavaScript, so there should be
no issues with that.
(JavaScript could also be compressed, but then there must be no
comments in it)

Results may vary, but this could reduce traffic approx. 5-10%,
even if you use GZip (recommended).

Details
-------
Difficulty: Easy
Files to modify: 1

Show Your Support

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

Comments
  #12  
Old 08-01-2004, 08:48 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you post your phpinclude_start template?
Reply With Quote
  #13  
Old 08-01-2004, 09:48 PM
tcs's Avatar
tcs tcs is offline
 
Join Date: Jun 2002
Posts: 130
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sure can,
PHP Code:
// Example of how to include a separate file:
// ob_start();
// require("yourheader.html");
// $header = ob_get_contents();
// ob_end_clean();

    
$hour vbdate("G");
    
$greeting "$vbphrase[goodevening] $bbuserinfo[username].";
    if( 
$hour 18 ) { $greeting "$vbphrase[goodafternoon] $bbuserinfo[username]."; }
    if( 
$hour 12 ) { $greeting "$vbphrase[goodmorning] $bbuserinfo[username]."; }

ob_start(); 
require(
"./forums/banner.php"); 
$banners ob_get_contents(); 
ob_end_clean();

include(
"./statistik_counter.php"); 
It works when I decompress but not while compressed.

I made a phpinclude.php file and then did and include('phpinclude.php') to my index.php but still not luck.

When I View Source of the main page the area where the banners come up is missing the code from the $banner it looks like this:
Code:
<td align="left" width="468" height="60"></td>
I should add that the greeting hack quits working while the templates are in compression.
Reply With Quote
  #14  
Old 08-01-2004, 10:10 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm, I don't know why vBulletin does call compile_template() on phpinclude_start as there should be nothing to do in this template ...

Anyway, try to remove
PHP Code:
// Example of how to include a separate file:
// ob_start();
// require("yourheader.html");
// $header = ob_get_contents();
// ob_end_clean(); 
I couldn't test the banner & statistics stuff as I don't have the files, but the greeting seems to work then.
Reply With Quote
  #15  
Old 08-01-2004, 11:09 PM
tcs's Avatar
tcs tcs is offline
 
Join Date: Jun 2002
Posts: 130
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That did it, very odd but dosent' matter as long as it work,, right. lol
Reply With Quote
  #16  
Old 08-01-2004, 11:12 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It's not thaaat odd:

As vBulletin calls compile_template() your phpinclude_start template will be compress, so afterwards it will look similar to this:

PHP Code:
// Example of how to include a separate file: // ob_start(); // require("yourheader.html"); // $header = ob_get_contents(); // ob_end_clean(); $hour = vbdate("G"); $greeting = "$vbphrase[goodevening] $bbuserinfo[username]."; if( $hour < 18 ) { $greeting = "$vbphrase[goodafternoon] $bbuserinfo[username]."; } if( $hour < 12 ) { $greeting = "$vbphrase[goodmorning] $bbuserinfo[username]."; } ob_start(); require("./forums/banner.php"); $banners = ob_get_contents(); ob_end_clean(); include("./statistik_counter.php"); 
eg. one line - which is commented out (and thus will not be executed)
Reply With Quote
  #17  
Old 08-02-2004, 01:34 AM
Tailfeathers's Avatar
Tailfeathers Tailfeathers is offline
 
Join Date: Sep 2002
Location: Utah, USA
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice
Reply With Quote
  #18  
Old 08-11-2004, 03:43 PM
vau7 vau7 is offline
 
Join Date: Mar 2004
Posts: 199
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very nice. I feel an Performance +
Reply With Quote
  #19  
Old 08-11-2004, 03:56 PM
vau7 vau7 is offline
 
Join Date: Mar 2004
Posts: 199
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

HELP!

I upped the master-style again.
And if i reply now on a Thread it looks like here. This failure only comes with every Browser.
Everything else went fine. It comes only if your logged in, isnt that strange?

Thank you in advance!!

##edit##
Here is my newreply template:

Code:
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head><title>$vboptions[bbtitle] - $vbphrase[reply_to_topic]</title>
$headinclude
</head>
<body$onload>
$header
$navbar

<form action="newreply.php" name="vbform" method="post"<if condition="!is_browser('webtv')"> onsubmit="return validatePost(this, 0, $vboptions[postminchars], $vboptions[postmaxchars]);" onreset="vB_RESET(this);"</if>>

$postpreview

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
	<td class="tcat">
		<span class="smallfont" style="float:$stylevar[right]"><strong>$vbphrase[thread]</strong>: <a href="showthread.php?$session[sessionurl]t=$threadinfo[threadid]">$threadinfo[title]</a></span>
		$vbphrase[reply_to_thread]
	</td>
</tr>
<tr>
	<td class="panelsurround" align="center">
	<div class="panel">
		<div style="width:$stylevar[formwidth]" align="$stylevar[left]">		
	
		$usernamecode

		<!-- subject field -->
		<table cellpadding="0" cellspacing="0" border="0" class="fieldset">
		<tr>
			<td class="smallfont" colspan="3">$vbphrase[title]:</td>
		</tr>
		<tr>
			<td><input type="text" class="bginput" name="title" value="$title" size="50" maxlength="85" tabindex="1" title="$vbphrase[optional]" /></td>
			<td>&nbsp;&nbsp;</td>
			<td><img id="display_posticon" src="$selectedicon[src]" alt="$selectedicon[alt]" /></td>
		</tr>
		</table>
		<!-- / subject field -->
		
		<table cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td>
			
		<!-- message area -->
		<div class="smallfont">$vbphrase[message]:</div>		
		$messagearea
		<!-- / message area -->

		$posticons
		
			</td>
		</tr>
		</table>
		
		
		</div>		
	</div>
			
	<div style="margin-top:$stylevar[cellpadding]px">
		<input type="hidden" name="s" value="$session[sessionhash]" />
		<input type="hidden" name="do" value="postreply" />
		<input type="hidden" name="t" value="$threadid" />
		<input type="hidden" name="p" value="$postid" />
		<input type="hidden" name="posthash" value="$posthash" />
		<input type="hidden" name="poststarttime" value="$poststarttime" />
		<input type="submit" class="button" name="sbutton" value="$vbphrase[submit_reply]" accesskey="s" tabindex="1" />
		<input type="submit" class="button" name="preview" value="$vbphrase[preview_post]" accesskey="p" tabindex="1" />
	</div>
	</td>
</tr>
</table>

<br />

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<thead>
	<tr>
		<td class="tcat">
			<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('newpost_options')"><img id="collapseimg_newpost_options" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_newpost_options].gif" alt="" border="0" /></a>
			$vbphrase[additional_options]
		</td>
	</tr>
</thead>
<tbody id="collapseobj_newpost_options" style="$vbcollapse[collapseobj_newpost_options]">	
	<tr valign="top">
		<td class="panelsurround" align="center">
		<div class="panel">
			<div style="width:$stylevar[formwidth]" align="$stylevar[left]">
							
				<fieldset class="fieldset">
					<legend>$vbphrase[miscellaneous_options]</legend>
					<div style="padding:$stylevar[formspacer]px">
						<if condition="$bbuserinfo['signature'] != ''"><div><label for="cb_signature"><input type="checkbox" name="signature" value="1" id="cb_signature" tabindex="1" $checked[signature] />$vbphrase[show_your_signature]</label></div></if>
						<div><label for="cb_parseurl"><input type="checkbox" name="parseurl" value="1" id="cb_parseurl" tabindex="1" $checked[parseurl] />$vbphrase[automatically_parse_links_in_text]</label></div>
						$disablesmiliesoption
					</div>
				</fieldset>
	
				$attachmentoption
						
				<fieldset class="fieldset">
					<legend>$vbphrase[thread_subscription]</legend>
					<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
					<tr>
						<td>$vbphrase[notification_type]:<br /><select name="emailupdate" tabindex="1">
							<option value="9999" $emailchecked[9999]>$vbphrase[do_not_subscribe]</option>
							<option value="0" $emailchecked[0]>$vbphrase[no_email_notification]</option>
							<option value="1" $emailchecked[1]>$vbphrase[instant_email_notification]</option>
							<option value="2" $emailchecked[2]>$vbphrase[daily_email_notification]</option>
							<option value="3" $emailchecked[3]>$vbphrase[weekly_email_notification]</option>
						</select></td>
						<if condition="$show['subscribefolders']"><td>$vbphrase[folder]:<br /><select name="folderid" tabindex="1">$folderbits</select></td></if>
					</tr>
					</table>
				</fieldset>
				
				<if condition="$show['threadrating']">
				<fieldset class="fieldset">
					<legend>$vbphrase[rate_thread]</legend>
					<div style="padding:$stylevar[formspacer]px">
						<div>$vbphrase[can_add_a_score_for_thread]</div>
						<div>
							<select name="rating" tabindex="1">
								<option value="0"$rate[0]>$vbphrase[choose_a_rating]</option>
								<optgroup>
									<option value="5"$rate[5]>5 : $vbphrase[excellent]</option>
									<option value="4"$rate[4]>4 : $vbphrase[good]</option>
									<option value="3"$rate[3]>3 : $vbphrase[average]</option>
									<option value="2"$rate[2]>2 : $vbphrase[bad]</option>
									<option value="1"$rate[1]>1 : $vbphrase[terrible]</option>
								</optgroup>
							</select>
						</div>						
					</div>
				</fieldset>
				</if>
				
				$threadmanagement
				
				</div>
			</div>
			
			<div style="margin-top:$stylevar[cellpadding]px">
				<input type="submit" class="button" name="sbutton" value="$vbphrase[submit_reply]" accesskey="s" tabindex="1" />
				<input type="submit" class="button" name="preview" value="$vbphrase[preview_post]" accesskey="p" tabindex="1" />			
			</div>
		</td>
	</tr>
</tbody>
</table>

</form>

<br />


<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
	<td class="tcat">
		<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('threadreview')"><img id="collapseimg_threadreview" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_threadreview].gif" alt="" border="" /></a>
		$vbphrase[topic_review_newest_first]
	</td>
</tr>
</table>

$spacer_close
$spacer_open

<div id="collapseobj_threadreview" style="$vbcollapse[collapseobj_threadreview]">

	<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
	
	$threadreviewbits
	
	<if condition="$show['reviewmore']">
	<tr>
		<td class="tfoot" align="center" colspan="2"><span class="smallfont">
			<phrase 1="$vboptions[maxposts]" 2="showthread.php?$session[sessionurl]t=$threadid">$vbphrase[thread_has_more_than_x_review]</phrase>
		</span></td>
	</tr>
	</if>
	
	</table>
	
</div>

$spacer_close
$spacer_open

<br />

$forumrules

$footer

</body>
</html>
##edit##

And if i want to start a new Thread it comes up, too.
It's really mystical that not all Usergroups are affected by this ( Every Group but not the Guests) Curios.
Reply With Quote
  #20  
Old 08-12-2004, 12:54 PM
vau7 vau7 is offline
 
Join Date: Mar 2004
Posts: 199
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Uninstalled now. Sorry.
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:55 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.05415 seconds
  • Memory Usage 2,337KB
  • Queries Executed 26 (?)
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
  • (3)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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_postinfo_query
  • fetch_postinfo
  • 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