This topic is locked

Changing feild date to link

8/18/2008 9:12:24 AM
PHPRunner General questions
V
vipernet author

Good day,
I was wondering where i can edit the code to display a link for a result feild.
ex.
I have a table called computers

The record showing in the XX_list.php displays

<<computer name>>

I want to be able to change that to link to

<< http://computer name:5800>>
I hope i explained it well enough
Thanks in advanced.

V
vipernet author 8/19/2008

figured it out:
I edited the Code

<TD class=editshade_lb style="PADDING-LEFT: 10px" width=250>{$show_Computer_Name}&nbsp; </TD></TR>
Chnaged this to:
<TD class=editshade_lb style="PADDING-LEFT: 10px" width=250><a href="http://{$show_Computer_Name}:5800"$nbsp;>{$show_Computer_Name}</TD></TR>;

V
vipernet author 8/19/2008

I am now having an issue with creating the same effect withg the list.php files.

within the template files for a list record:
<TD class=borderbody vAlign=middle align=middle {$row.1Computer_Name_style}>{$row.1Computer_Name_value}&nbsp;

</TD>

can't seem to just add the:

<a href="http://{$row.1Computer_Name_style}:5800">{$row.1Computer_Name_style}
The link shows up like:

http://%3cspan%20id=/
any suggestions ideas would be great,
Thanks

J
Jane 8/19/2008

Hi,
I recommend you to change value of smarty variables in the List page: After record processes event on the Events tab.

Here is a sample:

$row["1Computer_Name_value"] = "<a href=\"http://".$data["Computer_Name"].":5800\">".$data["Computer_Name"]."</a>";;

V
vipernet author 8/19/2008

Hi,

I recommend you to change value of smarty variables in the List page: After record processes event on the Events tab.

Here is a sample:


Thank you for the responce Jane,
Is the Smart Variables within the HTM template or in the actually php code?
I found this within the PHP file

// Computer_Name -

$value="";

$value = ProcessLargeText(GetData($data,"Computer_Name", ""),"field=Computer%5FName".$keylink,"",MODE_LIST);

$row[$col."Computer_Name_value"]=$value;
V
vipernet author 8/19/2008

Ok i got it,
Thanks allot for the support Jane
Change that code to:

// Computer_Name -

$value="";

$value = ProcessLargeText(GetData($data,"Computer_Name", ""),"field=Computer%5FName".$keylink,"",MODE_LIST);

$row["1Computer_Name_value"] = "<a href=\"http://".$data["Computer_Name"].":5800\">".$data["Computer_Name"]."</a>";;