Hello,
I need to display some information via CCv6.
The informations are differents if the user is logged in, is a special logged in user or is not logged.
So I've got 3 different tables :
table 1 : access public allowed
table 2 : access registred allowed
table 3 : access only few registred users according to the user_id
I would like to use a php function in order to display the wanted table, but I don't know how to access the user's information in the php function.
I've tried $this->get('user') or echo "{user:id}" without success.
Could someone help me with the syntax please?
Florence
I need to display some information via CCv6.
The informations are differents if the user is logged in, is a special logged in user or is not logged.
So I've got 3 different tables :
table 1 : access public allowed
table 2 : access registred allowed
table 3 : access only few registred users according to the user_id
I would like to use a php function in order to display the wanted table, but I don't know how to access the user's information in the php function.
I've tried $this->get('user') or echo "{user:id}" without success.
Could someone help me with the syntax please?
Florence
I have managed to retreive the user's informations with
However, I can't have the table displayed because the {fn:read_data2}{view:table1} below isn't "translated" when I access the event :
Events
Index
Views
table1 : to display the read_data2 informations
Functions
read_data1 : to find the user_id for wich the table 1 should be visible
read_data2 : to find the informations displayed in the table1
php1 :
The php1 function is working well because the index event shows either "{fn:read_data2} {view:table1}" or the other informations, but instead of reading "{fn:read_data2} {view:table1}", I would have the table1 displayed...
Thanks for the help,
CCv6 is really amazing, but quite different from CCv5π
$user = \JFactory::getUser();
However, I can't have the table displayed because the {fn:read_data2}{view:table1} below isn't "translated" when I access the event :
Events
Index
{fn:read_data1}
{fn:php1}
{var:php1}
Views
table1 : to display the read_data2 informations
Functions
read_data1 : to find the user_id for wich the table 1 should be visible
read_data2 : to find the informations displayed in the table1
php1 :
$user = \JFactory::getUser();
$list_userid=$this->get('read_data1');
if(in_array($user->id,$list_userid){
return "{fn:read_data2} {view:table1}";
}else{
//other informations
}
The php1 function is working well because the index event shows either "{fn:read_data2} {view:table1}" or the other informations, but instead of reading "{fn:read_data2} {view:table1}", I would have the table1 displayed...
Thanks for the help,
CCv6 is really amazing, but quite different from CCv5π
Hi FloB,
Glad you like v6π
In order to process shortcodes inside PHP code you need to use the following syntax:
Glad you like v6π
In order to process shortcodes inside PHP code you need to use the following syntax:
return $this->Parser->parse("{view:table1}");Best regards
This topic is locked and no more replies can be posted.