Task was changed by little but problem stays active.
I have code below this is responsible to display records of user with ID 164, but as you can see I have added ID of user manually into code. So it displays for everyone records from this user.
But I want to add variable on
line 6 where is written
164 which will display
ID of user who is viewing this module, so he will see own records and not users with ID 164.
if($params->get('view_what', 'all') == 'author')
{
$query = $db->getQuery(TRUE);
$query->select('id');
$query->from('#__js_res_record');
$query->where('user_id = 164');
$query->where('published = 1');
$query->where('hidden = 0');
$query->where('section_id = ' . $params->get('section_id'));
$db->setQuery($query);
$ids = $db->loadColumn();
if(empty($ids))
{
return;
}
$params->set('view_what', 'all');
}