Buy Now
Sign in

joomla user id in condition list of ccv5

teldrive , March 19 2014, 08:52
teldrive 520
March 19 2014, 08:52 #326878
I apreciate i someone can help
i need insert a condition in ccv5 form that show only records of table that allow to one user
I did it statically with
<?php
return array(
"nif" =>"12",
"nombre" =>"88"
);
?>

But my purpose is do it dinamically with user id of joomla, but I don't know how can i get it from enviroment of joomla
regards
Teldrive
GreyHead 64
March 19 2014, 10:37 #326888
Hi teldrive,

Please see this FAQ

Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
teldrive 520
March 19 2014, 23:20 #326946
Hi Bob , thanks by reply, i am untrained in CCv5,

but I have tried with this in order to debug it

<?php
$user = & JFactory::getUser();
$login=$user->username;

print "-> $login es el username ";
print "-> $user es el array ";

/*return array('nif' =>$user->name);*/

return array('nif' =>"seden");
?>

the results are:
no value for $login
$user value = JUser

and list works because "seden· is constant, so can you help me, what am I missing?
Attachments
Captura.JPG
Captura.JPG
(19.63 KiB)
774 Downloads/Views
Teldrive
teldrive 520
March 20 2014, 07:08 #326950
Sorry Bob is working
is working, my failure was that I have to register as user to get it works, because from backend there is not registered users
Teldrive
teldrive 520
March 20 2014, 07:09 #326951
here is the screen
Attachments
Captura.JPG
Captura.JPG
(15.53 KiB)
744 Downloads/Views
Teldrive
admin 28
March 22 2014, 09:01 #327085
 Answer
Hi Teldrive,

You need to use this to get the user's id:
$user->get("id")


Regards,
Max
Max
If your main question got answered then please mark the answer using the button!
Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!