This topic is locked

Php code snippet issue

10/20/2008 3:59:47 PM
PHPRunner General questions
J
jomppa10 author

Hi,
I am trying to use the php code snippet feature to hide some links (just like in a menu page). If put the following code
{begin table1_tablelink}
.. some code ...
{end table1_tablelink}
{begin table2_name_tablelink}
.. some code ...
{end table2_name_tablelink}
directly inside to html code using visual editor all works just fine.
But the following php code snippet
echo "{begin table1_tablelink}";
echo ".. some code ..";
echo "{end table1_tablelink}";
results just visually the begin and end characters in a list page. So how to put properly begin and end tags inside the php code snippets?
regards
Jouni I

J
jomppa10 author 10/21/2008

Hi,
this seems to work
global $allow_table1,$allow_table2;
if ($allow_table1} {
echo "some html code";

};

if ($allow_table2} {
echo "some html code";

};
I wonder if $allow_sometable variable is the correct way for phpr 5.O?
regards Jouni I
For edit, add and view pages I copied the following snippets from the list.php file:
$strPerm = GetUserPermissions("table1");

$allow_table1= (strpos($strPerm, "A")!==false || strpos($strPerm, "S")!==false);