This topic is locked

Read more link in colour

10/28/2007 1:00:43 PM
PHPRunner General questions
O
osluk author

Guys any insight into this,
Looks like I need a different syntax in the custom code.
I tried to alter the colour of this cool new link but it trashed the PHP with the following error
Parse error: syntax error, unexpected '}' in /hsphere/local/home/bauduc-dev/bordeauxreport.com/db-2007/view/include/commonfunctions.php on line 376
This is the error generating code
{

global $data;

if (strlen($value)>180)

$value = substr($value,0,180)." <a href=\"Wine_Data_view.php?editid1=".$data["Ref"]."\"><b><font color="#00FF00"> .. read more ...</b></font></a>";
}
Do I need a different format to embed in the PHP?
I removed the font colour and it was fine!
Any help appreciated
Cheers Chris

J
Jane 10/30/2007

Chris,
here is the correct code:

{

global $data;

if (strlen($value)>180)

$value = substr($value,0,180)." <a href=\"Wine_Data_view.php?editid1=".$data["Ref"]."\"><b><font color=\"#00FF00\"> .. read more ...</b></font></a>";

}

O
osluk author 10/30/2007

Brilliant - here is the combined code for a coloured link and full version of the note in target page.
Thanks for your help really appreciated

Chris

{

global $data;

if (strlen($value)>180 && !@$_REQUEST["editid1"])

$value = substr($value,0,180)." <a href=\"Wine_Data_view.php?editid1=".$data["Ref"]."\"><font

color=\"#00FF00\"> ..<b>.. See Detail Page ..</b>.. </font></a>";

}


Chris,

here is the correct code: