[ Index ]

PHP Cross Reference of Joomla 1.5.26 DE

title

Body

[close]

/administrator/modules/mod_unread/ -> mod_unread.php (source)

   1  <?php
   2  /**
   3  * @version        $Id: mod_unread.php 14401 2010-01-26 14:10:00Z louis $
   4  * @package        Joomla
   5  * @copyright    Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
   6  * @license        GNU/GPL, see LICENSE.php
   7  * Joomla! is free software. This version may have been modified pursuant
   8  * to the GNU General Public License, and as distributed it includes or
   9  * is derivative of works licensed under the GNU General Public License or
  10  * other free or open source software licenses.
  11  * See COPYRIGHT.php for copyright notices and details.
  12  */
  13  
  14  // no direct access
  15  defined( '_JEXEC' ) or die( 'Restricted access' );
  16  
  17  $db =& JFactory::getDBO();
  18  $user =& JFactory::getUser();
  19  
  20  $query = 'SELECT COUNT(*)'
  21  . ' FROM #__messages'
  22  . ' WHERE state = 0'
  23  . ' AND user_id_to = '.(int) $user->get('id')
  24  ;
  25  $db->setQuery( $query );
  26  $unread = $db->loadResult();
  27  
  28  if ($unread) {
  29      echo "<a href=\"index.php?option=com_messages\" style=\"color: red; text-decoration: none;  font-weight: bold\">$unread <img src=\"images/mail.png\" align=\"middle\" border=\"0\" alt=\"". JText::_( 'Mail' ) ."\" /></a>";
  30  } else {
  31      echo "<a href=\"index.php?option=com_messages\" style=\"color: black; text-decoration: none;\">$unread <img src=\"images/nomail.png\" align=\"middle\" border=\"0\" alt=\"". JText::_( 'Mail' ) ."\" /></a>";
  32  }


Generated: Wed Mar 28 15:54:07 2012 Cross-referenced by PHPXref 0.7.1