If you have a field which contains a phone number, you may want to personalize it with the following code:
| Kód: |
$opts['fdd']['wmp_e'] = array(
'default' => '',
'input' => '',
'maxlen' => 75,
'name' => 'Teléfono móvil',
'options' => 'ACPVDX',
'select' => 'T',
'size|ACP' => 20,
'escape' => false,
'sql|V' => 'IF(wmp_e="","",CONCAT(wmp_e , " <a href=\"callto:",IF((left(wmp_e,3)="+34") or (left(wmp_e,5)="(+34)") or (left(wmp_e,4)="0034") or (left(wmp_e,6)="(0034)"),REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(wmp_e,"(0)",""),"(",""),")",""),"-","")," ",""),CONCAT("+34",REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(wmp_e,"(0)",""),"(",""),")",""),"-","")," ",""))),"\"><img src=\"images/call_pc.png\" style=\"border: none;\" title=\"Llamar (con el programa por defecto designado en su ordenador)\" /></a> <a href=\"skype:",IF((left(wmp_e,3)="+34") or (left(wmp_e,5)="(+34)") or (left(wmp_e,4)="0034") or (left(wmp_e,6)="(0034)"),REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(wmp_e,"(0)",""),"(",""),")",""),"-","")," ",""),CONCAT("+34",REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(wmp_e,"(0)",""),"(",""),")",""),"-","")," ",""))),"?sms\"><img src=\"images/sms_skype.png\" style=\"border: none;\" title=\"Enviar SMS (Skype)\" /></a>"))',
'sqlw' => 'TRIM("$val_as")',
'sort' => true
); |
It creates a button for calling and another one for sendind an SMS.
Comments:
There is a query that try to interpret "(0)", "-", "(", ")" and other signs.
It also adds a country prefix if needed. In the script it is "+34" for Spain. You may chainge it to suit your needs.
Screenshot:
Note: Contact details are mine. :-)
Icons:
Hope it is useful for somebody! :-)
|