Exemplo n.º 1
0
<?php

/**
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: wsq_stat.inc.php 35168 2014-12-25 02:29:36Z nemohou $
 */
if (!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
    exit('Access Denied');
}
require_once DISCUZ_ROOT . './source/plugin/wechat/wsq.class.php';
require_once DISCUZ_ROOT . './source/plugin/wechat/setting.class.php';
WeChatSetting::menu();
showtips(lang('plugin/wechat', 'discuzqr_tips'));
$data = wsq::stat();
$d = date('Ymd', TIMESTAMP);
if (!$data || $data->code != 0) {
    cpmsg_error('wechat:stat_failed');
}
$xa = $uv = $pv = $newthread = $reply = $share = $reflow = array();
foreach ($data->res as $d) {
    $xa[$d->ftime] = substr($d->ftime, 4, 2) . '<br/>' . substr($d->ftime, 6, 2);
    $uv[$d->ftime] = intval($uv[$d->ftime]) + intval($d->uv);
    $pv[$d->ftime] = intval($pv[$d->ftime]) + intval($d->pv);
    $newthread[$d->ftime] = intval($newthread[$d->ftime]) + intval($d->newthread_num);
    $reply[$d->ftime] = intval($reply[$d->ftime]) + intval($d->reply_num);
    $share[$d->ftime] = intval($share[$d->ftime]) + intval($d->share_num);
    $reflow[$d->ftime] = intval($reflow[$d->ftime]) + intval($d->reflow_num);
}
$xas = "'" . implode('\',\'', $xa) . "'";