I had to modify the function to get the $userid set based on session or cookie.
- Code: Select all
function get_user_id()
{
$userid = NULL;
if (!empty($_SESSION['memberId']))
{
$userid = $_SESSION['memberId'];
}
if (!empty($_COOKIE['memberId']))
{
$userid = preg_replace('#[^0-9]#','',$_COOKIE['memberId']);
}
return $userid;
}
If that is not the problem, perhaps the table is not set correctly to pull the userid?
Another thing I did was in the init.php file, I included my sites typical functions used for logging in and setting sessions/cookies. I then started the custom sec_session_start() function I built before setting the $userid:
- Code: Select all
include 'path-to/your-functions-file.php';
sec_session_start();
$userid = get_user_id();
The session would not be set otherwise and therefore the userid would be null.
I hope that makes sense. I'm still learning this system. :)
Cheers!