| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | Mark Forums Read | User manuals | Login |
Smarty.php Mod to Remove all UN-NECESSARY White Space | ||||
|
|
Thread Tools | Search this Thread |
#31
|
|||||||
|
|||||||
xcell67, it looks as if spaces are literally being replaced by the regular expression itself!
If you are using PHP, please post the exact preg_replace() code that you are using including the regular expression and replacement in that code. If you are using EditPad, select the regular expressions option in the search box and use the regex ([ ]{2,}|[\n\r\f\t]+) with the replace {literal}\1{/literal}
__________________
X-Cart Pro 4.5.5 Platinum X-Payments 1.0.6 PHP 5.3.14 MySQL 5.1.68 Apache 2.2.23 |
|||||||
#32
|
|||||||
|
|||||||
I tried using dreamweaver to do it manually, I put {literal}, pressed enter twice to insert a blank line then ended it with {/literal}
I also tried your method with Editpad but still no luck =( One thing that did manage to work for me was putting <PRE> and ending with </PRE>. That allows the blank lines between text but I don't think its too customer friendly to have those tags in the mails. Can all you lucky people who have managed to get this to work post a sample tpl from your mail folder. Thanks. |
|||||||
#33
|
|||||||
|
|||||||
works well for me in 4.0.1
__________________
X-Cart v 4.7.8(live) |
|||||||
#34
|
|||||||
|
|||||||
You *must* place this call after $mail_smarty is instantiated - then it WILL NOT PARSE THE MAILS.
Here is my placement and all will be well! # # Smarty object for processing mail templates # $mail_smarty = $smarty; $smarty->load_filter("output","trimwhitespace"); # # WARNING : # Please ensure that you have no whitespaces / empty lines below this message. # Adding a whitespace or an empty line below this line will cause a PHP error. # ?>
__________________
--------------------------------------------- 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! |
|||||||
#35
|
|||||||
|
|||||||
WHOOOOOO! I finally got my mail tpls to work with your solution kind sir.
Thank you and thank you to NuAlpha for helping me with his solution. This is a sweet mod. |
|||||||
#36
|
|||||||
|
|||||||
Quote:
That's great - glad to know I could help out! I wish I was monitoring this thread actively - I am now...hopefully it wasn't too late! --al ponte
__________________
--------------------------------------------- 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! |
|||||||
#37
|
|||||||
|
|||||||
Works in 4.0.2, thank you.
__________________
-------------------- X-Cart Gold 4.1.11 Linux/Apache -------------------- |
|||||||
#38
|
|||||||
|
|||||||
Under PHP 4.3.10, I have found that unless I remove the line $smarty->load_filter('output','trimwhitespace'); from smarty.php then the entire Xcart load process will abort suddenly for some unknown reason.
Has anyone else experienced this?
__________________
X-Cart Pro 4.5.5 Platinum X-Payments 1.0.6 PHP 5.3.14 MySQL 5.1.68 Apache 2.2.23 |
|||||||
#39
|
|||||||
|
|||||||
This is a great MOD but any HTML invoices received by customers were blank.
Quote:
I tried adding $smarty->load_filter('output','trimwhitespace'); and it caused problems with images on the website. As a result I removed the mod for now until I can find a solution. Anyone have any ideas?
__________________
CopperB XCart Gold -> v4.0.11 PHP -> v4.3.10 MySQL -> v4.0.22 Apache -> v1.3.33 Smarty -> v2.6.3 |
|||||||
#40
|
|||||||
|
|||||||
Sweet
Thanks
__________________
Ron Eason http://www.heartsfireleathers.com webmaster@heartsfireleathers.com XCART 4.0.12 |
|||||||
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|