Hi,
I'd like to insert a piece of php code in the body section like the following
<?php
if('{NameOfField}'==2)
echo 'Important';
?>
but it seems that in the if statement, the field value is null; this is not the case for echo. I tried for other functions, like strcmp, they have the same problem. It seems that when the php code is run, the database is not imported (maybe?).
The other problem which is similar is that I'd like to show the user info based on {cf_user_id} value. My php code in the body section looks like:
<?php
$user =&JFactory::getUser('{cf_user_id}');
echo $user->name;
?>
This has the same problem and the input of getUser function is null. I would appreciate if you help me out.
Thanks.
I'd like to insert a piece of php code in the body section like the following
<?php
if('{NameOfField}'==2)
echo 'Important';
?>
but it seems that in the if statement, the field value is null; this is not the case for echo. I tried for other functions, like strcmp, they have the same problem. It seems that when the php code is run, the database is not imported (maybe?).
The other problem which is similar is that I'd like to show the user info based on {cf_user_id} value. My php code in the body section looks like:
<?php
$user =&JFactory::getUser('{cf_user_id}');
echo $user->name;
?>
This has the same problem and the input of getUser function is null. I would appreciate if you help me out.
Thanks.