userB must see userA record in userA's profile

samani

Member
Hi,

I want to add a prefilter. When i want everyuser to see their own data i know i can use {$my->id} and this works.

But this is NOT what i want. I use the CB and show the userA records in his profile . what i want is, when i look at the profile of userA, i want to see only his records and not mine. So how do i make a prefilter on his userid?
 
Is this userid an URL parameter, e.g. userid?
Then you can do
...your-user-element EQUALS
convert('{userid}' ,UNSIGNED) <-- this is for security to get only integers
Type: query
 
What I really need to do is update the Fabrik CB plugin to work with the latest version of CB. It's on my list ...

-- hugh
 
What's the non-SEF'ed form of the link?

You could probably do it the long way by using a PHP pre-filter, getting the username from J!'s input array, and looking up the userid of that.

WHERE
Field: userid
Condition: EQUALS
Value:
Code:
$username = JFactory::getApplication()->input->get('username', '');
if (!empty($username)) {
   return JUserHelper::getUserId($username);
}
return 0;
Type: PHP

You'll need to change that 'username' to whatever the query string name is for the username in the non-SEF'ed profile link.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top