| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Smarty.php Mod to Remove all UN-NECESSARY White Space | ||||
|
|
Thread Tools | Search this Thread |
#21
|
|||||||
|
|||||||
For your plain emails, put all of your extra spaces and newlines in the literal tags. Not the whole template.
__________________
X-Cart Pro 4.5.5 Platinum X-Payments 1.0.6 PHP 5.3.14 MySQL 5.1.68 Apache 2.2.23 |
|||||||
#22
|
|||||||
|
|||||||
Does this remove the spaces between the vertmenu boxes as well, or just items within the main area? So will "Your Cart" be touching "Authentication", or will they still have a small space in between them?
__________________
xcart v3.5.8 (Unix) and xcart v4.0.13 |
|||||||
#23
|
|||||||||
|
|||||||||
Quote:
No, This doesn't relate to spacing vertical or horizontal that the browser will interrupt, to see what it does, disable the added code, view the source of your store, keep it open, then readd the code, and refresh your store, and view the source again. You'll see what it does
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart. |
|||||||||
#24
|
|||||||||
|
|||||||||
Quote:
What a PITA. I don't see me going through every single template for that. :P |
|||||||||
#25
|
|||||||
|
|||||||
Quote:
Well, then I suggest you do the sensible thing and switch to HTML email. :P What does PITA stand for anyway??
__________________
X-Cart Pro 4.5.5 Platinum X-Payments 1.0.6 PHP 5.3.14 MySQL 5.1.68 Apache 2.2.23 |
|||||||
#26
|
|||||||||
|
|||||||||
Pain in the @$$.
Not all of my customers can receive html mail. Do you recommend that I ignore them? |
|||||||||
#27
|
|||||||
|
|||||||
Hmm...maybe there should be an option for individual customers to receive the email in HTML or plain text when they sign-up. Anybody got an idea how to do this?
Use a text editor that supports regular expressions to wrap all of the newlines or spaces with literal tags. Use the following for the search: Code:
Use this for the replace: Code:
EditPad is really good for this. If you use PHP for the replacement, make sure you use \$1 instead of \1 Let me know if this works for you! PS: Don't forget to back-up those files first!
__________________
X-Cart Pro 4.5.5 Platinum X-Payments 1.0.6 PHP 5.3.14 MySQL 5.1.68 Apache 2.2.23 |
|||||||
#28
|
|||||||
|
|||||||
Update on that regular expression. Try using /([ ]{2,}|[\n\r\f\t]+)/ instead as this seems to actually work. The previous regex I posted fubars the plain text templates by putting {literal} tags inside other Smarty tags.
This new one should allow you to easily upgrade your plain text templates and still use the Smarty mod posted here.
__________________
X-Cart Pro 4.5.5 Platinum X-Payments 1.0.6 PHP 5.3.14 MySQL 5.1.68 Apache 2.2.23 |
|||||||
#29
|
|||||||
|
|||||||
NuAlpha,
I can't get your solution to work, so I tried various methods of your code, this is what I did with one of my mail templates: Code:
but this is what I ended up with: \1 Dear Mr.adsfe21 \1 \1 You have been registered at Your Company Name! Setting up a Your Company Name account entitles you to quick and easy online shopping. \1 With a Your Company Name account, you can easily track and manage your orders, update your information, add items to your wishlist and much more! \1 Below are your account details: \$1 Account Information: --------------------- Username: adsfe21@saol.net '/([\n\r\f\t ]+)/' Password: adsfe21 /([\n\r\f\t ]+)/ First Name: adsfe21 Last Name: adsfe21 /([ ]{2,}|[\n\r\f\t]+)/ E-Mail: adsfe21@saol.net |
|||||||
#30
|
|||||||
|
|||||||
I originally suggested using this and I guess people are benefiting - that is awesome!
I just want to interject - I have never had any issues using this script, even with my plain text emails?!? I just tested them again - still no problem...I wonder why? I will do more research to see if my implementation of this differs from everyone else's...I will let you all know, soon! --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! |
|||||||
|
|||
X-Cart forums © 2001-2020
|