This topic is locked

change colour of detail table link

4/16/2008 4:48:36 AM
PHPRunner General questions
G
garethp authorDevClub member

Hi
I am following up from a previous topic posted (http://www.asprunner.com/forums/index.php?showtopic=8071) that has given me a thought.
I have added the following code to list page: after record processed event

global $conn;

$str = "select folder from `sonic folders` where `project`='".$data["project"]."'";

$rs = db_query($str,$conn);
if ($data = db_fetch_array($rs))

{

$row["1showdetail"] = true;

}

else

{

$row["1showdetail"] = false;

}


and also the changes in visual editor as described in other post. (I could not make the above work with count so changed slightly but achieves the same)
My question is...
instead of the link being visible if detail exists and invisible when detail does not exist can I change the colour. I would like a red font if there are details and gray is there are no details.
Many thanks for the great support.

J
Jane 4/17/2008

Hi,
you can use the same event code for thus purpose.

Just change detail link on the Visual Editor tab in the following way:

<A class=tablelinks2 {if $row.1showdetail}style="color:red;"{/if} {if !$row.1showdetail}style="color:grey;"{/if}href="DetailTableName_list.php?{$row.1DetailTableName_masterkeys}" {if $useAJAX} onmouseover="RollDetailsLink.showPopup(this,'DetailTableName_detailspreview.php'+this.href.substr(this.href.indexOf('?')));" onmouseout="RollDetailsLink.hidePopup();" {/if}>DetailTableName</A>