function save_nums($aid = 0, $mode = 'down') { //统计文档的下载数或播放数 global $sid; include_once M_ROOT . './include/arcedit.cls.php'; $aedit = new cls_arcedit(); $aedit->set_aid($aid); $aedit->basic_data(); $aedit->arc_nums($mode == 'down' ? 'downs' : 'plays', 1, 1); unset($aedit); }
foreach (array('filters', 'lists', 'operates') as $var) { if (!empty($u_url['setting'][$var])) { ${'u_' . $var} = explode(',', $u_url['setting'][$var]); } } } empty($u_lists) && ($u_lists = array('mname', 'check', 'adddate', 'edit')); if (empty($u_tplname) || !empty($u_onlyview)) { include_once M_ROOT . "./include/parse.fun.php"; include_once M_ROOT . "./include/arcedit.cls.php"; include_once M_ROOT . "./include/cuedit.cls.php"; include_once M_ROOT . "./include/commu.fun.php"; $aid = empty($aid) ? 0 : max(0, intval($aid)); $aedit = new cls_arcedit(); $aedit->set_aid($aid); $aedit->basic_data(0); $channel =& $aedit->channel; if (!$aedit->aid || $aedit->archive['mid'] != $memberid) { mcmessage('confchoosarchi'); } $commu = read_cache('commu', $channel['cuid']); $page = !empty($page) ? max(1, intval($page)) : 1; submitcheck('bfilter') && ($page = 1); $checked = isset($checked) ? $checked : '-1'; $keyword = empty($keyword) ? '' : $keyword; $wheresql = "a.aid='{$aid}'"; $fromsql = "FROM {$tblprefix}replys cu LEFT JOIN {$tblprefix}archives a ON a.aid=cu.aid"; //审核状态范围 if ($checked != -1) { if ($u_checked != -1 && $checked != $u_checked) { $no_list = true;
if (empty($arcdeal)) { mcmessage('selectoperateitem', M_REFERER); } if (empty($selectid)) { mcmessage('selectarchive', M_REFERER); } $aedit = new cls_arcedit(); foreach ($selectid as $aid) { $aedit->init(); $aedit->set_aid($aid); if (!empty($arcdeal['delete'])) { $aedit->arc_delete(1); continue; } if (!empty($arcdeal['need']) && $issueupdatecheck) { $aedit->basic_data(); $aedit->archive['checked'] && $aedit->updatefield('needupdate', $timestamp, 'sub'); } if (!empty($arcdeal['unneed'])) { $aedit->basic_data(); $aedit->archive['checked'] && $aedit->archive['needupdate'] && $aedit->updatefield('needupdate', 0, 'sub'); } if (!empty($arcdeal['readd'])) { //重发布 $aedit->readd(); } if (!empty($arcdeal['abover'])) { $aedit->updatefield('abover', 1, 'main'); } if (!empty($arcdeal['unabover'])) { $aedit->updatefield('abover', 0, 'main');
function avg_price() { global $db, $tblprefix, $timestamp; if ($this->cclass != 'offer' || !isset($this->updatearr['oprice']) || !$this->info['checked'] || empty($this->commu['setting']['average']) || empty($this->commu['setting']['ptable']) || empty($this->commu['setting']['pename'])) { return; } $aedit = new cls_arcedit(); $aedit->set_aid($this->aid); $aedit->basic_data(0); $average = $db->result_one("SELECT AVG(oprice) FROM {$tblprefix}offers WHERE aid='" . $this->aid . "' AND checked='1' AND (enddate='0' OR enddate>'{$timestamp}')"); $aedit->updatefield($this->commu['setting']['pename'], $average, $this->commu['setting']['ptable']); $aedit->updatedb(); }