[ Index ]
 

Code source de XOOPS 2.0.17.1

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/htdocs/class/smarty/xoops_plugins/ -> function.xoInboxCount.php (source)

   1  <?php
   2  
   3  
   4  
   5  function smarty_function_xoInboxCount( $params, &$smarty ) {
   6      global $xoopsUser;
   7      
   8      if ( !isset($xoopsUser) || !is_object($xoopsUser) ) {
   9          return;
  10      }
  11      $time = time();
  12      if ( isset( $_SESSION['xoops_inbox_count'] ) && @$_SESSION['xoops_inbox_count_expire'] > $time ) {
  13          $count = intval( $_SESSION['xoops_inbox_count'] );
  14      } else {
  15          $pm_handler =& xoops_gethandler( 'privmessage' );
  16          $criteria = new CriteriaCompo( new Criteria('read_msg', 0) );
  17          $criteria->add( new Criteria( 'to_userid', $xoopsUser->getVar('uid') ) );
  18          $count = intval( $pm_handler->getCount($criteria) );
  19          $_SESSION['xoops_inbox_count'] = $count;
  20          $_SESSION['xoops_inbox_count_expire'] = $time + 60;
  21      }
  22      if ( !@empty( $params['assign'] ) ) {
  23          $smarty->assign( $params['assign'], $count );
  24      } else {
  25          echo $count;
  26      }
  27  }
  28  
  29  ?>


Généré le : Sun Nov 25 11:44:32 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics