Clan Adverts

Sponsors

CT on Facebook

Latest Product

User Box

Anonymous
38.107.179.217
Nickname:

Password:

Security Code
Security Code
Type Security Code


PND Downloads Feed

Phpnuke Downloads
How to Delete or Reset yo...
How to Delete or Reset your PHPNuke Admin Account
Lost your admin password ?  Cant login to your admin account ?This sh...
Back Online & Stuff
Back Online & Stuff
Look at us with our nifty website back up and running… Seriousl...
How to edit the admins in...
How to edit the admins in the forums
Here is a way to make someone admin in your forums on your Evo site. I...
Demo Splash Screen
Demo Splash Screen
Ped @ Clan Themes has released a simple splash screen entrance hack. ...
Free Phpnuke Business The...
Free Phpnuke Business Theme 6
This is the 6th Business theme for Phpnuke that Clan Themes has releas...
Tricked Out Slider
Tricked Out Slider
We have seen some great new things come out of Tricked Out News and th...

Custom Work

PHP Nuke Custom Work

www.clanthemes.com :: View topic - Minifie the output of the page and reduce memory usage
Minifie the output of the page and reduce memory usage

0 Replies / 504 Views


Post new topic   Reply to topic  

   www.clanthemes.com Forum Index » Hacks n Mods

View previous topic :: View next topic


gazj
Reputation: 495.8 Add RepSubtract Rep
votes: 1
Local time: 10:16 AM

uk.gif

Tree Hugger
Tree Hugger

0.04 posts per day
Medals: 0

Joined: Mar 12, 2007
Last Visit: 15 Oct 2009
Posts: 64
Points: 3224 

Post Minifie the output of the page and reduce memory usage Posted: Wed Aug 26, 2009 7:54 am

hey guys i came accross this result by mistake after using this method to compress my html includes in my theme i noticed that the memory usage dropped upta 40% on my site by the time i finished adding it to various places.

Right lets begin

first the function to place in the mainfile.php
Code:
function minit($min) {
   // remove comments
   $min = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $min);
   // remove tabs, spaces, newlines, etc.
   $min = str_replace(array("\r\n", "\r", "\n", "\t", '  ', '    ', '    '), '', $min);
   return $min;
}


stay in mainfile and find the function blockfileinc
find:
Code:
    if (empty($content)) {
   $content = _BLOCKPROBLEM2;
    }

below add:
Code:
$content = minit($content);

save and close

open the theme.php and on all the inclides for the html files using this method
Code:
    $tmpl_file = 'themes/'.$ThemeSel.'/story_page.htm';
    $thefile = implode('', file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    echo $r_file;


above the last line the echo add:
Code:
$r_file = minit($r_file);


all comments and lines are removed reducing the number of lines outputted from these parts edited someone give it a try
 

i say lol to much but what the hey!  
View user's profileSend private messageVisit poster's website Reply with quote
Post new topic   Reply to topic  
   www.clanthemes.com Forum Index » Hacks n Mods


 
0 Replies / 504 Views
Page 1 of 1
All times are GMT
Display posts from previous:   
 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum