I am using Joomla 1.5 and the latest Chronoforms. I am not able to access the joomla user fields as I understand it should work from other posts I have read. I have tried the following as the first items in the form HTML code block as well as the OnSubmit after email code blocks:
<?php
global $my;
echo "Id=" . $my->id;
echo "<br>Name=" . $my->name . "<br>";
?>
In neither case do I get an error nor do I get the id or name values. It is late and I must be missing something simple.
Turned up error messages to maximum and received this on the form page:
Notice: Undefined variable: imver in /home/palmer/www/playersgolfcc.com/components/com_chronocontact/chronocontact.php on line 152
Notice: Trying to get property of non-object in /home/palmer/www/playersgolfcc.com/components/com_chronocontact/chronocontact.html.php(55) : eval()'d code on line 3
Id=
Notice: Trying to get property of non-object in /home/palmer/www/playersgolfcc.com/components/com_chronocontact/chronocontact.html.php(55) : eval()'d code on line 4
Name=
Thanks,
Darryl
Post edited by: drouse, at: 2008/03/11 04:04<br><br>Post edited by: drouse, at: 2008/03/11 04:06
<?php
global $my;
echo "Id=" . $my->id;
echo "<br>Name=" . $my->name . "<br>";
?>
In neither case do I get an error nor do I get the id or name values. It is late and I must be missing something simple.
Turned up error messages to maximum and received this on the form page:
Notice: Undefined variable: imver in /home/palmer/www/playersgolfcc.com/components/com_chronocontact/chronocontact.php on line 152
Notice: Trying to get property of non-object in /home/palmer/www/playersgolfcc.com/components/com_chronocontact/chronocontact.html.php(55) : eval()'d code on line 3
Id=
Notice: Trying to get property of non-object in /home/palmer/www/playersgolfcc.com/components/com_chronocontact/chronocontact.html.php(55) : eval()'d code on line 4
Name=
Thanks,
Darryl
Post edited by: drouse, at: 2008/03/11 04:04<br><br>Post edited by: drouse, at: 2008/03/11 04:06
Solved it with access via JFactory in Joomla 1.5.
e.g.
<?php
$user = &JFactory::getUser();
echo "Id=" . $user->id;
echo "<br>Name=" . $user->name . "<br>";
?>
e.g.
<?php
$user = &JFactory::getUser();
echo "Id=" . $user->id;
echo "<br>Name=" . $user->name . "<br>";
?>
This topic is locked and no more replies can be posted.