When building a website with Joomla 1.5, you might need to hide content from registreted users and guests. When we were recently building a website with Joomla 1.5, we came across the 3 options: In this post we will be discussing the pros and cons of each of these plugins and explaining how to make RokAccess work in Joomla 1.5. Hiding content depending on whether a user is a registered member or a guest is a really useful feature to have. Fortunately, there are a number of different options available set content permissions in Joomla 1.5... JoomiHide How JoomiHide works This is the simplest plugin available for Joomla 1.5 to hide content. Although it's simple it works seamlessly for showing content either to registered members or guests. Content in an article can be restricted to be displayed to certain visitors by adding these tags: {reg} This content is only displayed to registered users logged in {/reg} {unreg} This content is only displayed to unregistered users or non-logged in users {/unreg} When content is restricted for non-members, this plugin replaces the restricted text with: "To view rest of this section, please login or register". This is a nice feature but a little annoying to have it displayed each time content is not displayed. To remove or edit this text, you can hack the plugin by changing the html code on line 108 of joomihide.php which is in /plugins/content/. Unlike content restricted for non-members, when content is not shown to registered users there is no text added. Pros Cons - Downloading this membership at HowIDid Academy which will set you back $10 for 3 months.
- Content can only be hidden to members and non-members: There is no option of showing content to administrators or other Joomla groups
- Need to hack the plugin to remove or change the text displayed when content restricted for guests
Click here to see what other people are saying about JoomiHide. Click here to download this plugin. Ninja Access How Ninja Access works Hide content using this plugin by surrounding the content you want to be seen by certain groups in a tag. Ninja Access uses numbers to specify which group the content includes: {njaccess 0} Shows this content only to guests {/njaccess} {njaccess 18,19,20,21,23,24,25} Shows this content to all users who are guests {/njaccess} {njaccess 24,25,30,31} Shows this content to administrators and 2 custom groups created in JACL {/njaccess} When content is not shown to a particular group, the text is simply hidden. As you can see from the examples above, you need to know the default Joomla GroupIDs: 0 - Guest, 18 - Registered, 19 - Author, 20 - Editor, 21 - Publisher, 23 - Manager, 24 - Administrator, 25 - Super Administrator. Pros - Very complete plugin for hiding content for specific groups including groups created with JACL
- Great support from the Ninjoomla team
Cons - You need to have the GroupIDs at hand when you use this plugin.
- Downloading this requires Silver Membership at NinJoomla which will set you back $30.
Find out more about Ninja Access here. RokAccess RokAccess is an extremely popular plugin for Joomla 1.0, but hasn't yet been updated for Joomla 1.5. Thanks to Lukas White, we managed to get RokAccess working in Joomla 1.5. How to get RokAccess working in Joomla 1.5 After installing the Joomla 1.0 RokAccess extension on your Joomla 1.5 website, you will need to change the rokaccess.php file which is located in /plugins/content/ There are 3 changes you need to make to this file: $_MAMBOTS->registerFunction( 'onPrepareContent', 'botRokAccess' ); Change to: $mainframe->registerEvent( 'onPrepareContent', 'botRokAccess' );
function botRokAccess( $published, &$row, &$params, $page=0 ) Change to: function botRokAccess( &$row, &$params, $page=0 ) {
Delete: if (!$published) { $row->text = preg_replace( $regex, '', $row->text ); return; }
How RokAccess works To hide content using the RokAccess plugin you add the RokAccess tag to the content you want to hide. Here are some examples: {rokaccess guest} Shows this content only to guest users {/rokaccess} {rokaccess !guest} Shows this content to all users who are not a guest {/rokaccess} {rokaccess registered} Shows this content to all users who are registered {/rokaccess} {rokaccess guest,!editor} Shows this content this to all guests and members who are not editors {/rokaccess} {rokaccess editor,special} Shows this content to editors, administrators, and superadministrators {/rokaccess} In similarity to Ninja Access, when content is not shown to a particular group, the text is simply hidden. Pros Cons - You need to hack the plugin files to get this working in Joomla 1.5
- No support
Click here to see what other people are saying about RokAccess. Click here to download this plugin. Which should plugin should you choose? It just depends on what your needs are. We recommend you choose the plugin you're comfortable using... If you don't want to hack any files and need support with getting the plugin to work, we recommend you use the Ninjoomla plugin. Do you have any experience with these plugins? We welcome your comments below. |