Page 1 of 1

Php fusion code

Posted: Thu Jan 17, 2008 10:19 am
by rkomen
Hello,

I'm working on some mod for php fusion. Here is the original code where I have a problem:

Code: Select all

else if ($_GET['search'] === "0" || $_GET['search'] === "1")
{
 
$tableString = ($_GET['search']== "1")?" ".$locale['sa130']." ":" ".$locale['sa131']." ";
if (isset($_GET['cat']) && $_GET['cat'] != "")
{
$tableString .= $_GET['cat_name'];
} 
 
opentable( $tableString );

In this code when the links are search=0 and search ="1" header text is .$locale['sa130'] and $locale['sa131']. That work ok. I want to make when search=3 text is $locale['sa174'] when the search=4 text is $locale['sa175'] and when the search=5 text is $locale['sa176']

I have do this:

Code: Select all

else if ($_GET['search'] === "0" || $_GET['search'] === "1" || $_GET['search'] === "3" || $_GET['search'] === "4" || $_GET['search'] === "5")
That is ok. But how to do similar here:

Code: Select all

$tableString = ($_GET['search']== "1")?" ".$locale['sa130']." ":" ".$locale['sa131']." ";
Is that possible? I'm not an expert for php.
Thanks

Re: Php fusion code

Posted: Thu Jan 17, 2008 2:19 pm
by Jade
I would think that would work. However, wouldn't it be easier to just check what search is and then set it to the appropriate value?

Code: Select all

if ($_GET['search'] == 1)
$tablestring = $locale['somenumber'];
 

Re: Php fusion code

Posted: Thu Jan 17, 2008 4:24 pm
by rkomen
Yes, that work. Thank you very much.
How do you mean easier? I'm not and expert for php.
But tlike this is also good because work.
Thanks.