Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Smarty.php Mod to Remove all UN-NECESSARY White Space

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #11  
Old 06-13-2004, 08:11 PM
 
Adian009 Adian009 is offline
 

Advanced Member
  
Join Date: Mar 2004
Location: Tiverton, RI, USA
Posts: 37
 

Default Measuring Impact of This

Does anyone have any ideas or interest in measuring the impact of triming the whitespaces?

Personally, I do - the only way I can think of to measure it would be to create a script that accesses specific pages in succession. Run the script with whitespaces then trimming them and compare the average Bandwidth and Response time.

Anyone have any other ideas? I am working full-time at a client site who is a large ASP so we I have access to sophisticated web testing/stress testing software...just don't know what to test.

--al
__________________
---------------------------------------------
Infosolv, LLC
A Professional Services Company
X-Cart v3.5.10 & 4.01
Find our MOD\'s at: Custom X-Cart MOD\'s, Add-On\'s & X-Cart Hosting!
Reply With Quote
  #12  
Old 06-15-2004, 03:53 AM
  TelaFirma's Avatar 
TelaFirma TelaFirma is offline
 

X-Adept
  
Join Date: Nov 2002
Location: North Carolina USA
Posts: 930
 

Default

Quote:
Originally Posted by NuAlpha
Some email templates are used for display in the browser.

I guess I will just stick with adding {strip} tags to various documents until I get this worked out.

What the addition to Smarty will do is change this:

Code:
<head> </head> <body> </body>

To this:

Code:
<head> </head> <body> </body>

It is not going to strip out the \n commands (New Line) like the {strip} tag does. So, it is not going to shove all the email data on one line.

As for measuring impact, that is easy. If you strip out the extra blank lines from an HTML file, then you decrease file size, thus making the download time of the HTML shorter.
Reply With Quote
  #13  
Old 06-15-2004, 07:23 AM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

So is this safe to use?

I am running 3.4.14 and most of my invoice templates are in html.

I've tried following this thread but the concensus isn't clear to me.
Reply With Quote
  #14  
Old 06-15-2004, 07:31 AM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

So I just went and added it in. Haven't tested my invoices yet, but this is like VIAGRA for your store. Big time.
Reply With Quote
  #15  
Old 06-15-2004, 11:08 AM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

UPDATE.

Still working great EXCEPT it isn't playing nice with my plain text emails. Particularily the company signature and the order template. All of the blank lines between product details are gone and the products have no spaces between them.

example

Quote:
SKU: 8801
Product: Blue Meteor Light Kit
Quantity: 1
Item price: $ 21.95
SKU: 3319
Product: 80mm Chrome Tribal Sun Laser Cut Fan Grill
Quantity: 1
Item price: $ 6.95

Should look like

Quote:
SKU: 8801
Product: Blue Meteor Light Kit
Quantity: 1
Item price: $ 21.95

SKU: 3319
Product: 80mm Chrome Tribal Sun Laser Cut Fan Grill
Quantity: 1
Item price: $ 6.95

and my email sig is just one run on line.
Reply With Quote
  #16  
Old 06-15-2004, 11:21 AM
 
Emerson Emerson is offline
 

X-Man
  
Join Date: Mar 2004
Location: Atlanta, GA
Posts: 2,209
 

Default

Quote:
Originally Posted by adpboss
...this is like VIAGRA for your store. Big time.

You ain't kidding

Thanks for the tip Adian009
__________________
Emerson
Total Server Solutions LLC- Quality X-Cart Hosting
Recommended X-Cart Hosting Provider - US and UK servers
Does your host backup your site? We do EVERY HOUR!!!
Shared Hosting | Managed Cloud | Dedicated Servers
Reply With Quote
  #17  
Old 06-15-2004, 04:05 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

Will this work for Smarty-2.5.0 ?
Reply With Quote
  #18  
Old 06-15-2004, 04:07 PM
 
Emerson Emerson is offline
 

X-Man
  
Join Date: Mar 2004
Location: Atlanta, GA
Posts: 2,209
 

Default

Quote:
Originally Posted by Jon
Will this work for Smarty-2.5.0 ?

Yes, that is what I have and it works!
__________________
Emerson
Total Server Solutions LLC- Quality X-Cart Hosting
Recommended X-Cart Hosting Provider - US and UK servers
Does your host backup your site? We do EVERY HOUR!!!
Shared Hosting | Managed Cloud | Dedicated Servers
Reply With Quote
  #19  
Old 06-15-2004, 04:09 PM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

If I enclose my email tpls in {literal} tags should I be ok?
Reply With Quote
  #20  
Old 06-17-2004, 11:05 PM
 
FX FX is offline
 

Member
  
Join Date: May 2004
Location: US
Posts: 12
 

Default

Well, here is what i get:

If i enclose my plain text email *.tpl in {strip}{/strip} the result is printed out in one line.

Enclosing email in {literal}{/literal} don't parse code and just prints it out all code included between {literal}

hmm
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 08:12 PM.

   

 
X-Cart forums © 2001-2020