Zikula_Value_Addons
[ class tree: Zikula_Value_Addons ] [ index: Zikula_Value_Addons ] [ all elements ]

Source for file pnuser.php

Documentation is available at pnuser.php

  1. <?php
  2. /**
  3.  * Zikula Application Framework
  4.  *
  5.  * @copyright (c) 2002, Zikula Development Team
  6.  * @link http://www.zikula.org
  7.  * @version $Id: pnuser.php 24342 2008-06-06 12:03:14Z markwest $
  8.  * @license GNU/GPL - http://www.gnu.org/copyleft/gpl.html
  9.  * @package Zikula_Value_Addons
  10.  * @subpackage HitCount
  11.  */
  12.  
  13. /**
  14.  * the main user function (nothing interesting here - might be removed)
  15.  */
  16. function hitcount_user_main()
  17. {
  18.     // Security check
  19.     if (!SecurityUtil::checkPermission'HitCount::''::'ACCESS_OVERVIEW)) {
  20.         return LogUtil::registerPermissionError();
  21.     }
  22.  
  23.     // Create output object
  24.     $pnRender pnRender::getInstance('HitCount');
  25.  
  26.     $moditems array();
  27.     $modlist pnModAPIFunc('hitcount','user','getmodules');
  28.     foreach ($modlist as $modid => $numitems{
  29.         $modinfo pnModGetInfo($modid);
  30.         $moditem array();
  31.         $moditem['name'$modinfo['name'];
  32.         $moditem['numitems'$numitems;
  33.         $moditem['link'pnModURL($modinfo['name'],'user','main');
  34.         $moditem['tophits'pnModAPIFunc('hitcount','user','tophits'array('modname' => $modinfo['name']));
  35.         $moditems[$moditem;
  36.     }
  37.     $pnRender->assign('moditems'$moditems);
  38.  
  39.     // Return output
  40.     return $pnRender->fetch('hitcount_user_main.htm');
  41. }
  42.  
  43. /**
  44.  * add a hit for a specific item, and display the hitcount (= display hook)
  45.  *
  46.  * (use pnVarSetCached('Hooks.hitcount','save', 1) to tell hitcount *not*
  47.  * to display the hit count, but to save it in 'Hooks.hitcount', 'value')
  48.  *
  49.  * @param $args['objectid'] ID of the item this hitcount is for
  50.  * @param $args['extrainfo'] not particularly relevant here
  51.  * @return string output with hitcount information
  52.  */
  53. function hitcount_user_display($args)
  54. {
  55.     extract($args);
  56.  
  57.     // Run API function
  58.     $hitcount pnModAPIFunc('hitcount''admin''update'$args);
  59.  
  60. //    if (isset($hitcount)) {
  61.         // Display current hitcount or set the cached variable
  62. //        if (!pnVaris_cached('Hooks.hitcount','save') ||
  63. //            pnVarGetCached('Hooks.hitcount','save') == false ) {
  64. //            return '(' . $hitcount . ' ' . pnML('Reads') . ')';
  65. //        } else {
  66. //            pnVarSetCached('Hooks.hitcount','value',$hitcount);
  67. //        }
  68. //    }
  69.  
  70.     return '';
  71. }

Documentation generated on Fri, 18 Jul 2008 21:55:25 +0200 by phpDocumentor 1.4.1