I have browsed through the forums and got some basic directions as to how to accomplish this. For some reason I am missing something, and I know it is a simple answer. I am not very proficient with php and still learning. Here is my code:
$userid = $user->id;
$sql = "SELECT * FROM `jos_k2_users` WHERE `userID` = $userid";
$db =& JFactory::getDBO();
$db->setQuery($sql);
$result = $db->loadObject();
$k2group = $result->group;
return ($k2group==1);
I am using this in the PHP field under exclude selected. There is a menu that I want only k2 users with k2 id > 1 to be able to see, and it is set as registered so non-registered users cannot see using joomla permissions & default k2 group is 1. I also need to do the same for regular users, so basically only show where k2 id = 1.
I know its simple, just can't seem to get it to work the right way in advanced module manager. It displays the module regardless of k2 user group. The code works with a simple text link in the middle of the page, where it returns i have an if statement that I have tested and works.
any help is greatly appreciated, and I thank whoever has a few minutes to reply in advance
