Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod
- » MetaMod General Support
- » Metamod not detecting logged in users
Metamod not detecting logged in users
Metamod not detecting logged in users
With debug mode on, it looks like metamod is unable to detect the logged in user details. so the PHP code is not working:
Settings are:
Show Title: No
Enabled: Yes
Position: User3
Access Level: public
Menu Assignment
Menus: All
Caching : Use Global
Cache Time : 900
Debug : On
Module Class Suffix : "Blank"
Start date/time : "Blank"
End date/time : "Blank"
Show Quick module(s) to : All users
$language handling : Browsers preferred language : Browsers preferred language
Strict language comparison: Off
Style for included modules : In a table (default) - user <h> for title
Auto-enable included modules? : All included modules
PHP
if ( $$user->id == "2") return "32";
if ( $$user->id == "13") return "33";
Re: Metamod not detecting logged in users
Hi indrajitch,
Just a slight problem with the PHP -- too many $ symbols!
Try it this way:
if ( $user->id == "2") return "32";
if ( $user->id == "13") return "33";
Cheers,
Stephen
Re: Metamod not detecting logged in users
Hi Stephen !
Sorry those extra $-s came while putting it on the forum (silly me!)
But the problem is stiff there even after copying the same code you gave...
its not picking up the logged in user details to show the module !!
Here is the metamod debug info (guess it might help!)
MetaMod debug info:
Module ID: 29
$option: com_huruhelpdesk
$view: cpanel
$id:
$Itemid: 2
$timezone: default
$language: en-us
$language_code: en
$language_region: us
Including modules:
btw.. what does it identify as "$id" - ?
Re: Metamod not detecting logged in users
Sorry Stephen!
Again a silly error! problem solved - was picking up wrong user ID details from a different module instead of core Joomla
Used this before and worked fine - thats why I was surprised finding it not working this time around!
Re: Metamod not detecting logged in users
Hi indrajitch,
$id comes from the URL (when SEF URLs are turned off) or from the SEF system if they are turned on. It's usually used by components to identify the main "thing" you are viewing - e.g. the article id when you are viewing articles, or the category id when you are viewing categories, etc.
To find out what's going on with the $user variable, can you please try this:
1 - make sure you are actually logged in as a user on the front end of the site! Being logged in on the back end doesn't count!
2 - try putting the following into the PHP box and see what it outputs:
echo "User: <pre>";
print_r( $user );
echo "</pre> (end user info)";
You should see some information from the user object displayed. If you don't see that, and you are definitely logged in on the front end of the site, then there's something bad going on.
Cheers,
Stephen
- Index
- » MetaMod
- » MetaMod General Support
- » Metamod not detecting logged in users
Board Info
- Board Stats:
- Total Topics:
- 1699
- Total Polls:
- 6
- Total Posts:
- 5967
- Total Posts Today:
- 2
- User Info:
- Total Users:
- 8027
- Newest User:
- henley7346
- Members Online:
- 1
- Guests Online:
- 173
- Online:
- henley7346
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked