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).'
'.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)."'";
$uvs = implode(',', $uv);
$pvs = implode(',', $pv);
$newthreads = implode(',', $newthread);
$replys = implode(',', $reply);
$shares = implode(',', $share);
$reflows = implode(',', $reflow);
$langarray = array('stat_newthread', 'stat_reply', 'stat_share', 'stat_reflow');
$lang = array();
foreach($langarray as $l) {
$lang[$l] = lang('plugin/wechat', $l);
}
echo <<
EOF;
$xa = array_reverse($xa, true);
showtableheader('');
showsubtitle(array('', 'UV', 'PV', $lang['stat_newthread'], $lang['stat_reply'], $lang['stat_share'], $lang['stat_reflow']));
foreach($xa as $key=>$value) {
showtablerow('', array(), array(
$key,
$uv[$key],
$pv[$key],
$newthread[$key],
$reply[$key],
$share[$key],
$reflow[$key]
));
}
showtablefooter();