Go Back   PHP Link Directory Forum > PHP Link Directory (phpLD) > Design

Design Discuss ways to change the layout and CSS to fit your site.

Reply
 
topic widgets
Old 01-23-2010   #1
ThankYou
Supporter
 
Join Date: Nov 2009
Posts: 25
Smile Formating phone number

Hi, currently my phone number output look like that:
Phone Number:1231231234

I would like to format it to look like that:
Phone Number:123-123-1234

I know how to change this in the database with a small php script but should I?

I was thinking that it may be better to format the output and only have number in the BD.

Thank you
ThankYou is offline   Reply With Quote
Old 01-23-2010   #2
James
:)
phpLD Support
phpLD Administrator
Supporter
Moderator
 
James's Avatar
 
Join Date: Aug 2006
Location: Nanaimo, BC , Canada
Posts: 24,019
Default

can do it with smarty

http://www.smarty.net/forums/viewtop...fa8a5055385000
__________________
Attention: For Support Please Read this thread.
IF the domain is not listed in your PhpLD users area and it is 3.x
You will have to list it before ANY questions are answered.

My paypal is rentawebmaster @ gmail.com
^^ if I have helped you help me I need a new laptop
PhpLD Recommended Hosting: Here
They work with you not against you
Live Directory
James is offline   Reply With Quote
Old 01-23-2010   #3
ThankYou
Supporter
 
Join Date: Nov 2009
Posts: 25
Talking

Thank for the quick reply.

Could you please tell me what pages I need to put that function fix on.

Sorry but I have very little experience with PHPLD.

Thanks
ThankYou is offline   Reply With Quote
Old 01-23-2010   #4
James
:)
phpLD Support
phpLD Administrator
Supporter
Moderator
 
James's Avatar
 
Join Date: Aug 2006
Location: Nanaimo, BC , Canada
Posts: 24,019
Default

make a new php file named

modifier.format_phone.php


in it place

Code:
Content visible to registered users only.
upload it to libs/smarty/plugins folder

then in the detail.php

find {$PHONE_NUMBER|escape|trim}

change it to {$PHONE_NUMBER|format_phone:'%s/%s.%s'}
__________________
Attention: For Support Please Read this thread.
IF the domain is not listed in your PhpLD users area and it is 3.x
You will have to list it before ANY questions are answered.

My paypal is rentawebmaster @ gmail.com
^^ if I have helped you help me I need a new laptop
PhpLD Recommended Hosting: Here
They work with you not against you
Live Directory
James is offline   Reply With Quote
Old 01-23-2010   #5
ThankYou
Supporter
 
Join Date: Nov 2009
Posts: 25
Default

Thank you so much. I will try it ASAP.
ThankYou is offline   Reply With Quote
Old 01-27-2010   #6
ThankYou
Supporter
 
Join Date: Nov 2009
Posts: 25
Default

This {$PHONE_NUMBER|escape|trim} doesn't exist on details.php
I replaced it in detail.tpl and the result was a phone number like this 239/643.5544
ThankYou is offline   Reply With Quote
Old 01-27-2010   #7
James
:)
phpLD Support
phpLD Administrator
Supporter
Moderator
 
James's Avatar
 
Join Date: Aug 2006
Location: Nanaimo, BC , Canada
Posts: 24,019
Default

change
%s/%s.%s

to
%s-%s-%s
__________________
Attention: For Support Please Read this thread.
IF the domain is not listed in your PhpLD users area and it is 3.x
You will have to list it before ANY questions are answered.

My paypal is rentawebmaster @ gmail.com
^^ if I have helped you help me I need a new laptop
PhpLD Recommended Hosting: Here
They work with you not against you
Live Directory
James is offline   Reply With Quote
Old 01-27-2010   #8
ThankYou
Supporter
 
Join Date: Nov 2009
Posts: 25
Default

It's working, thank you!
ThankYou is offline   Reply With Quote
Reply

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
topic widgets



All times are GMT +1. The time now is 05:42 PM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.