Your IP : 216.73.216.172


Current Path : /proc/thread-self/root/proc/thread-self/root/proc/1908984/root/proc/1147586/cwd/
Upload File :
Current File : //proc/thread-self/root/proc/thread-self/root/proc/1908984/root/proc/1147586/cwd/mod_unread.tar

tmpl/default.php000064400000001375152344470660007676 0ustar00<?php
/**
 * @version		$Id: default.php 20196 2011-01-09 02:40:25Z ian $
 * @package		Joomla.Administrator
 * @subpackage	mod_unread
 * @copyright	Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// No direct access.
defined('_JEXEC') or die;

// Set the inbox class.
$inboxClass = $unread ? 'unread-messages' : 'no-unread-messages';
?>
<?php if (!empty($inboxLink)) : ?>
	<span class="<?php echo $inboxClass;?>"><a href="<?php echo $inboxLink;?>"><?php echo JText::sprintf('MOD_UNREAD_MESSAGES', $unread);?></a></span>
<?php else : ?>
	<span class="<?php echo $inboxClass;?>"><?php echo JText::sprintf('MOD_UNREAD_MESSAGES', $unread);?></span>
<?php endif; ?>tmpl/index.html000064400000000035152344470660007526 0ustar00<html>
<body>
</body>
</html>helper.php000064400000002041152344470660006544 0ustar00<?php
/**
 * @version		$Id: helper.php 21097 2011-04-07 15:38:03Z dextercowley $
 * @copyright	Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// No direct access.
defined('_JEXEC') or die;

/**
 * @package		Joomla.Administrator
 * @subpackage	mod_unread
 * @since		1.6
 */
abstract class ModUnreadHelper
{
	/**
	 * Count the number of unread messages.
	 *
	 * @return	mixed	The number of unread messages, or false on error.
	 */
	public static function getCount()
	{
		// Initialise variables.
		$db		= JFactory::getDbo();
		$user	= JFactory::getUser();

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

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

		if ($error = $db->getErrorMsg()) {
			JError::raiseWarning(500, $error);
			return false;
		}

		return $result;
	}
}
index.html000064400000000035152344470660006552 0ustar00<html>
<body>
</body>
</html>mod_unread.php000064400000001277152344470660007414 0ustar00<?php
/**
 * @version		$Id: mod_unread.php 20196 2011-01-09 02:40:25Z ian $
 * @package		Joomla.Administrator
 * @subpackage	mod_unread
 * @copyright	Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// no direct access
defined('_JEXEC') or die;

// Include dependancies.
require_once dirname(__FILE__).'/helper.php';

$unread = ModUnreadHelper::getCount();

if ($unread !== false) {
	// Set the inbox link.
	$inboxLink = JRequest::getInt('hidemainmenu') ? null : JRoute::_('index.php?option=com_messages');

	require JModuleHelper::getLayoutPath('mod_unread', $params->get('layout', 'default'));
}
mod_unread.xml000064400000003073152344470660007421 0ustar00<?xml version="1.0" encoding="utf-8"?>
<extension
	type="module"
	version="1.6.0"
	client="administrator">
	<name>mod_unread</name>
	<author>Joomla! Project</author>
	<creationDate>Nov 2005</creationDate>
	<copyright>Copyright (C) 2005 - 2011 Open Source Matters. All rights reserved.</copyright>
	<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
	<authorEmail>admin@joomla.org</authorEmail>
	<authorUrl>www.joomla.org</authorUrl>
	<version>1.6.0</version>
	<description>MOD_UNREAD_XML_DESCRIPTION</description>
	<files>
		<filename module="mod_unread">mod_unread.php</filename>
		<filename>helper.php</filename>
		<filename>index.html</filename>
		<folder>tmpl</folder>
	</files>
	<languages>
		<language tag="en-GB">en-GB.mod_unread.ini</language>
		<language tag="en-GB">en-GB.mod_unread.sys.ini</language>	
	</languages>
	<help key="JHELP_EXTENSIONS_MODULE_MANAGER_ADMIN_UNREAD" />
	<config>
		<fields name="params">
			<fieldset name="advanced">
				<field
					name="layout"
					type="modulelayout"
					label="JFIELD_ALT_LAYOUT_LABEL"
					description="JFIELD_ALT_MODULE_LAYOUT_DESC" />

				<field
					name="moduleclass_sfx"
					type="text"
					label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL"
					description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" />

				<field
					name="cache"
					type="list"
					default="0"
					label="COM_MODULES_FIELD_CACHING_LABEL"
					description="COM_MODULES_FIELD_CACHING_DESC">
					<option
						value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option>
				</field>
			</fieldset>
		</fields>
	</config>
</extension>