コード例 #1
0
ファイル: default.php プロジェクト: jeprodev/jeprovisitors
    echo $statistics;
    ?>
        </table>
    </div>
    <?php 
}
?>
    <?php 
if ($jvcshowdigit) {
    ?>
    <div id="jvcounterdigit">
        <?php 
    $arr = modJVCounterHelper::getDigits($allvisitors, $jvcnumberofdigits);
    $digit_img = '';
    foreach ($arr as $digit) {
        $digit_img .= modJVCounterHelper::showDigitImage($jvcdigittype, $digit);
    }
    echo $digit_img;
    ?>
    </div>
    <?php 
}
?>
    <?php 
if ($showhrline) {
    ?>
    <hr />
    <?php 
}
?>
    <?php 
コード例 #2
0
$jvcnumberofdigits = $params->get('jvcnumberofdigits', 6);
$jvcdigittype = $params->get('jvcdigittype', 'default');
$jvcshowonlinevisitors = $params->get('jvcshowonlinevisitors', 1);
$jvcstatstype = $params->get('jvcstatstype', 'default');
$jvccachetime = (int) $params->get('jvccachetime', 1);
/** Get time offset from global configuration **/
$config = JFactory::getConfig();
$offset = $config->get('offset');
$iscache = JFactory::getCache();
$jvccachetime *= 60;
if ($jvccachetime < 0 || $jvccachetime > 3600) {
    $jvccachetime = DEFAULT_CACHE_TIMEOUT * 60;
}
$iscache->setLifeTime($jvccachetime);
$now = time();
$datetime = modJVCounterHelper::getDateTime($offset, $jvcissunday, $now);
/** computing visitors numbers */
// today's visits
$visitorsarray = JvcounterModelJvcounter::getVisits();
$todayvisitors = $visitorsarray['visits'];
if ($jvcshowyesterday) {
    if ($iscache) {
        $visitorsarray = $iscache->call(array('JvcounterModelJvcounter', 'getVisits'), $datetime["localyesterdaystart"], $datetime["localdaystart"]);
    } else {
        $visitorsarray = JvcounterModelJvcounter::getVisits($datetime["localyesterdaystart"], $datetime["localdaystart"]);
    }
    $yesterdayvisitors = $visitorsarray['visits'];
}
if ($jvcshowthisweek) {
    if ($iscache) {
        $visitorsarray = $iscache->call(array('JvcounterModelJvcounter', 'getVisits'), $datetime["localweekstart"], $datetime["localdaystart"]);
コード例 #3
0
 function getTimeStart($options){
     
     $timestart['online']    = $options['onlinestarttime'];
     $timestart['today']     = $options['now']['unix'] - ($options['now']['unix'] % $options['durationDay']);
     $timestart['yesterday'] = $timestart['today'] - $options['durationDay'];
     
     $nameToday     = modJVCounterHelper::getNameOfDay($options['now']['daymonthyear'][0],$options['now']['daymonthyear'][1],$options['now']['daymonthyear'][2]);
     $positionToday = modJVCounterHelper::getPositionOfDay($nameToday);
     $timestart['thisweek']  = $timestart['today'] - $positionToday*$options['durationDay'];
     $timestart['lastweek']  = $timestart['thisweek'] - 7*$options['durationDay'];
     $timestart['thismonth'] = $timestart['today'] - ((int)$options['now']['daymonthyear'][0] - 1)*$options['durationDay'];
     
     $daysoflastmonth = modJVCounterHelper::getDaysofMonth((int)$options['now']['daymonthyear'][1] - 1,$options['now']['daymonthyear'][2]);
     $timestart['lastmonth'] = $timestart['thismonth'] - $daysoflastmonth*$options['durationDay'];
     
     
     return $timestart;
 }
コード例 #4
0
<?php
/**
 # mod_jvcounter - Module JV Counter
 # @version		1.x.1
 # ------------------------------------------------------------------------
 # author    Open Source Code Solutions Co
 # copyright Copyright (C) 2011 joomlavi.com. All Rights Reserved.
 # @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL or later.
 # Websites: http://www.joomlavi.com
 # Technical Support:  http://www.joomlavi.com/my-tickets.html
-------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

if(class_exists('plgSystemJVCounter')){
    require_once dirname(__FILE__).'/helper.php';

    $visits = modJVCounterHelper::getVisits($params);
    $totalImage = modJVCounterHelper::getTotalImage($params,(int)$visits['total']);
    
    $template = $params->get('template','default');
    require JModuleHelper::getLayoutPath('mod_jvcounter',$template);
}else{
    echo 'Please install plugin JVCounter!';
}

?>