Hi, I discovered this topic from 3 years ago. I need to hide some things but the code write here isn't understandable for me that don't know php. I try to re-write the code, but this doesn't work for me. Can anybody correct it?
PS: the file is now at components/com_k2/templates/default/itemform.php i think. send me your feedback
<?php get user ID$user = &JFactory::getUser();$userId = $user->get('id'); get user Group$db =& JFactory::getDBO();$query = " SELECT ".$db->nameQuote('group')." FROM ".$db->nameQuote('jos_k2_users')." WHERE ".$db->nameQuote('userID')." = ".$db->quote($userId)."; ";$db->setQuery($query);$userGroup = $db->loadResult();?>
<?php if($userGroup == 2 OR $userGroup == 4) : ?> <div id="k2ToggleSidebarContainer"> <a href="#" id="k2ToggleSidebar"><?php echo JText::_('Toggle sidebar'); ?></a> </div> <?php endif; ?>