Source for file function.pncountnewmessages.php
Documentation is available at function.pncountnewmessages.php
* Zikula Application Framework
* @copyright (c) 2004, Zikula Development Team
* @link http://www.zikula.org
* @version $Id: function.pncountnewmessages.php 24342 2008-06-06 12:03:14Z markwest $
* @license GNU/GPL - http://www.gnu.org/copyleft/gpl.html
* @package Zikula_Template_Plugins
* Smarty function to get the number of new messages for the user currently logged in
* - assign: If set, the results are assigned to the corresponding variable instead of printed out
* <!--[pncountnewmessages assign=newmessages]-->!
* @author Frank Schummertz
* @param array $params All attributes passed to this function from the template
* @param object &$smarty Reference to the Smarty object
$column = &$pntable['priv_msgs_column'];
$result = $dbconn->Execute("SELECT count(*) FROM $pntable[priv_msgs] WHERE $column[to_userid]='" . DataUtil::formatForStore(pnUserGetVar('uid')) . "' AND $column[read_msg]='0'");
list ($newmessages) = $result->fields; // new messages
$smarty->assign($assign, $newmessages);
|