Thank you for your reply. I am calling it from event detail page, but it doesn´t work. Maybe something is wrong in my code. I am trying to print the id at first, in order to check the script. This is what I have in my custom layout:
<span>Joomla user ID: </span>
{source}
<?php
$user = JFactory::getUser();
$id = $user->id;
print_r($id);
?>
{/source}
<br/>
<span>Event ID: </span>
{source}
<?php
$eventID = $row->ev_id();
print_r($eventID);
?>
{source}{/source} are tags from the sourcerer plugin, used to insert php in joomla articles and modules. Joomla user ID is showing, but Event ID is not working. This is the error: "Call to a member function ev_id() on null". Same result with function id(). what could be wrong?
Thanks