Mobile website
Web Design by Web Design by Web Design by
Web Design Packages - Celtic Web Design - Cornwall Web Design - Web Development - Web Hosting - Domain Name Registration

Web Design Articles

Web Design

Website Packages
Mobile Websites
Custom Web Design

Latest Clients

Klick Technology
Sybilla Davis Designs
Talybont Energy
St.Ives Holiday Lets
Bavarian Forest Holidays
Summers Gardens
Photocopiers Direct
Gamrie Lodge


Contact Celtic Web Design today to discuss your future website.

Tel 01736 757734
Mob 07906 071 028
Joomla - How to check if a user is logged in

I recently came across a requirement within a Joomla site for an in-page user verifier to check if a user is logged into the website or not.

This type of facility allows the website to grant registered joomla users the ability to easily download a pdf documents through the docman extension whereas joomla guest users will be shown login or registration details.

The first part of the solution is to download and install the Jumi component for Joomla, the installation will also automatically install the Jumi module.

I won't go into the installation process here as it is documented online, but once installed, in the Jumi component, add a new code listing from the main Jumi application manager page.

Enter this code into the Custom Script field:

if(JFactory::getUser()->guest) {
        //do user logged out stuff
        echo "you are NOT logged in";
else {
        //do user logged in stuff
        echo "you are logged in";

Then with some knowledge of PHP add your own display code, see the example above where I have added the 'echo' tags.
Once you have added you ow code, save this Jumi details page and then take a note of the ID of the new code listing on the main Jumi applications manager page.

Now go to the Module Manager, and click the "+" button upper right to open a new module, select Jumi as the module.
Once in the Jumi module page, enter a name for the module and in the right hand parameters Basic Options, add the Jumi ID number from the components screen preceded with *, there:
On the same page in the Position field, write your own position, make sure it is not already used by the template, for instance:
Save & Close.

Now make your way to the K2 item you want the logged in / out code to be inserted into.
Within the K2 item, coding level, add this code:
{loadposition jumi_k2_in_item_module}
Make sure you include the curly brackets.
Save the K2 item and preview the page.

You should now see text either for logged in users or logged out users depending on whether you are logged in to not. Try changing your login status to see what text is displayed within the K2 item.

I have used this exact same technique to place a pdf download button within the K2 item if the user is logged in, if the user is not logged in then they are presented with a request to login or register.

A very simple technique that should help you to designate content for different user levels.

  • Login to your Joomla installation
  • Site menu
  • Global Configuration
  • Server tab
  • Server Settings
  • Now set the Error Reporting to 'None'.

This removes any php errors from now being displayed on your Joomla sites!

A very simple solution which I just could not find anywhere.

Web Design Articles

The top 15 Joomla Extensions
What is Joomla? Joomla for Dummies
Joomla - How to check if a user is logged in
Joomla - how to turn off Display Errors

Please contact us if you have any questions you would like to ask.
Great web design books
Joomla! Explained: Your Step-by-Step Guide
Master Joomla! hands-on, step-by-step, through easy, practical examples!

Facebook For Dummies
The perennial bestseller—now updated to cover the latest features of Facebook
Buy your panoramic photographs of St.Ives Cornwall