Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-01-31 17:28:05

jim_01
Member
Registered: 2008-01-17
Posts: 35

Change $ to £ !?!

Hi,

I;m not much of a PHP person and I need to change the dollar sign to a pound £ sign on my code. I think its this bit ‘</strong> $’ (see below for complete line), but if I change it to ‘</strong>£’ textpattern goes nuts!

Any ideas?

The complete line:

$cart_display .= '<li class="subtotal"><strong>' . $subtotal_label . '</strong> $' . number_format($cart->total,2) . '</li>';

Last edited by ruud (2008-01-31 17:33:33)

Offline

#2 2008-01-31 17:34:18

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Change $ to £ !?!

Can you give some details on the ‘going nuts’ part?

Offline

#3 2008-01-31 18:10:08

jim_01
Member
Registered: 2008-01-17
Posts: 35

Re: Change $ to £ !?!

This is what it spits out:

Warning: Unexpected character in input: ‘’‘ (ASCII=39) state=1 in /home/.zion/surfacemedia/ohthewoe.com/staging/textpattern/lib/txplib_misc.php(534) : eval()’d code on line 70

Parse error: syntax error, unexpected ‘<’ in /home/.zion/surfacemedia/ohthewoe.com/staging/textpattern/lib/txplib_misc.php(534) : eval()’d code on line 70

Offline

#4 2008-01-31 19:02:28

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Change $ to £ !?!

Looks like textile somehow messed your quotes. This should work as I see it:

$cart_display .= '<li class="subtotal"><strong>' . $subtotal_label . '</strong> &#163;' . number_format($cart->total,2) . '</li>';

Cheers!

Offline

#5 2008-01-31 19:16:29

jim_01
Member
Registered: 2008-01-17
Posts: 35

Re: Change $ to £ !?!

I really thought that would work. But It just turns it into a squiggle and also cuts into the price.

Offline

#6 2008-01-31 19:36:09

jim_01
Member
Registered: 2008-01-17
Posts: 35

Re: Change $ to £ !?!

You were close though! The code needed to be &pound;

Thanks for the help!

Offline

Board footer

Powered by FluxBB