CoreFiles by mySites.guru
mod_status.php63 lines, 1,572 bytes, from Joomla_3.1.0-Stable-Full_Package.zip
Raw History Compare with 3.0.4
md5
4b9ee9b8fe19feb6c0e7497f65562b7f
sha1
bece3e6bd86e517c54168cdd3c2e6a4ae31648e6
sha256
61bed73ef999cc3b5840840562735dcf0e4a6a4fded39a82bfe8a1e0fa97a747
<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  mod_status
 *
 * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

$config	= JFactory::getConfig();
$user   = JFactory::getUser();
$db     = JFactory::getDbo();
$lang   = JFactory::getLanguage();
$input  = JFactory::getApplication()->input;

// Get the number of unread messages in your inbox.
$query	= $db->getQuery(true)
	->select('COUNT(*)')
	->from('#__messages')
	->where('state = 0 AND user_id_to = '.(int) $user->get('id'));

$db->setQuery($query);
$unread = (int) $db->loadResult();

// Get the number of back-end logged in users.
$query->clear()
	->select('COUNT(session_id)')
	->from('#__session')
	->where('guest = 0 AND client_id = 1');

$db->setQuery($query);
$count = '<span class="badge">' . (int) $db->loadResult() . '</span>';

// Set the inbox link.
if ($input->getBool('hidemainmenu'))
{
	$inboxLink = '';
}
else
{
	$inboxLink = JRoute::_('index.php?option=com_messages');
}

// Set the inbox class.
if ($unread)
{
	$inboxClass = 'unread-messages';
} else {
	$inboxClass = 'no-unread-messages';
}

// Get the number of frontend logged in users.
$query->clear()
	->select('COUNT(session_id)')
	->from('#__session')
	->where('guest = 0 AND client_id = 0');

$db->setQuery($query);
$online_num = '<span class="badge">' . (int) $db->loadResult() . '</span>';

require JModuleHelper::getLayoutPath('mod_status', $params->get('layout', 'default'));

The same content is in 2 releases, Joomla 3.1.0 to 3.1.1. See them all, or every version of this file.