This topic is locked
[SOLVED]

 A link with search ability

4/23/2010 1:41:43 AM
PHPRunner General questions
N
Nelson author

Hi,
I'm trying to create a link from the list page that when the users click on it...it search for them as well!
This is what I put in the field(Category) in the custom mode:
http://sitename.com/subsite/subsite_list.php?ctlSearchFor=&simpleSrchTypeComboNot=&a=integrated&id=1&criteria=and&type1=&value11=".$data["Category"]."&field1=Category&option1=Equals&not1=&type2=&value21=".$data["State"]."&field2=State&option2=Equals&not2=
as you can see I have two $data
$data["Category"]

$data["State"]
The problem is sometimes the categories and states are seperate words...like (san francisco) and so on...and search engins can't search words without putting a '+' between them!
I need a code that can do what below code does...(this was from another function in events)..
$CategoryName = str_Replace(" ","+",$data["Category"]);
But I don't know how to integrate the two...and how to create a correct code for this
Any help would be welcomed...thanks!

F
frocco 4/23/2010

I had a similar problem.
On your list page, replace the link with a template field.



{link1}


in the List events, choose Occurs after record is processed



$cat = str_Replace(" ","+",$data["Category"]);

$st = str_Replace(" ","+",$data["State"]);
$record["link1"] = "<a href='http://sitename...?value11?"; . $cat . "&value12=" . $st ."'" . " target='_blank'>Link Name</a>";



Hope you get the idea.
Frank

N
Nelson author 4/23/2010



I had a similar problem.
On your list page, replace the link with a template field.



{link1}


in the List events, choose Occurs after record is processed



$cat = str_Replace(" ","+",$data["Category"]);

$st = str_Replace(" ","+",$data["State"]);
$record["link1"] = "<a href='http://sitename...?value11?"; . $cat . "&value12=" . $st ."'" . " target='_blank'>Link Name</a>";



Hope you get the idea.
Frank


Hi Frank,
I wonder how to create a 'template field' on PHPR 5.2?..I'm trying but can't figure it out..

F
frocco 4/23/2010

just use brackets.
{fieldname}
You can switch to html mode in the editor and add this.
HTH
Frank

J
Jane 4/23/2010

Nelson,
here is the correct syntax for the variable in the template:

{$fieldname}

F
frocco 4/23/2010

Thanks Jane, forgot the $

N
Nelson author 4/23/2010

Thanks beautiful people , problem solved <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=49342&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />