include_once M_ROOT . "./include/arcedit.cls.php"; include_once M_ROOT . "./include/commu.fun.php"; load_cache('permissions,vcps,channels,cotypes,acatalogs'); !defined('M_COM') && exit('No Permission'); $aid = empty($aid) ? 0 : max(0, intval($aid)); //关于文档的个人分类 $uclasses = loaduclasses($curuser->info['mid']); $ucidsarr = array(); foreach ($uclasses as $k => $v) { if (!$v['cuid']) { $ucidsarr[$k] = $v['title']; } } $aedit = new cls_arcedit(); $aedit->set_aid($aid); $aedit->detail_data(); $chid = $aedit->archive['chid']; tabheader(lang('basemessage')); trbasic(lang('archivetitle'), '', $aedit->archive['subject'], ''); trbasic(lang('membercname'), '', $aedit->archive['mname'], ''); trbasic(lang('addtime'), '', date("Y-m-d H:i:s", $aedit->archive['createdate']), ''); trbasic(lang('updatetime'), '', date("Y-m-d H:i:s", $aedit->archive['updatedate']), ''); trbasic(lang('retime'), '', date("Y-m-d H:i:s", $aedit->archive['refreshdate']), ''); trbasic(lang('endtime'), '', $aedit->archive['enddate'] ? date("Y-m-d H:i:s", $aedit->archive['enddate']) : '-', ''); trbasic(lang('checkstate'), '', ($aedit->archive['checked'] ? lang('check') : lang('uncheck')) . ' / ' . ($aedit->archive['editor'] ? $aedit->archive['editor'] : '-'), ''); trbasic(lang('clickcomment'), '', $aedit->archive['clicks'] . ' / ' . $aedit->archive['comments'], ''); tabfooter(); tabheader(lang('othermessage')); trbasic(lang('channel'), '', $aedit->archive['chid'] ? $channels[$aedit->archive['chid']]['cname'] : '-', ''); //trbasic(lang('browse archive deductvalue'),'',empty($aedit->archive['tax_price']) ? '-' : $aedit->archive['tax_price'],''); //trbasic(lang('browse archive saleprice'),'',empty($aedit->archive['sale_price']) ? '-' : $aedit->archive['sale_price'],'');
function updatedb() { global $db, $tblprefix, $timestamp; if ($this->func) { $aedit = new cls_arcedit(); $aedit->set_aid($this->aid); $aedit->detail_data(0); foreach ($this->fields as $k => $v) { if ($v['isfunc']) { $this->updatefield($k, field_func($v['func'], $this->info, $aedit->archive)); } } } if (!empty($this->updatearr)) { $this->updatearr['updatedate'] = $timestamp; $sqlstr = ''; foreach ($this->updatearr as $k => $v) { $sqlstr .= ($sqlstr ? "," : "") . $k . "='" . $v . "'"; } if ($sqlstr) { $db->query("UPDATE {$tblprefix}" . $this->cclass . "s SET {$sqlstr} WHERE cid={$this->cid}"); } $this->avg_price(); //平均价需要资料更改完成后写入 } if ($this->func) { if ($this->commu['func']) { field_func($this->commu['func'], $this->info, $aedit->archive); } unset($aedit); } $this->updatearr = array(); }
if (!empty($sitemap['setting']['indays'])) { $sqlstr .= " AND createdate>" . ($timestamp - 86400 * $sitemap['setting']['indays']); } if (empty($sitemap['setting']['chsource'])) { $sqlstr .= " AND chid " . multi_str($chids); } else { $sqlstr .= " AND chid " . multi_str($sitemap['setting']['chids']); } if (!empty($sitemap['setting']['casource'])) { $sqlstr .= " AND caid " . multi_str($sitemap['setting']['caids']); } foreach ($cotypes as $coid => $cotype) { if (!empty($sitemap['setting']['cosource' . $coid])) { if ($cnsql = cnsql($coid, $sitemap['setting']['ccids' . $coid], '')) { $sqlstr .= " AND {$cnsql}"; } } } $life = empty($sitemap['setting']['life']) ? 0 : $sitemap['setting']['life']; $datastr = "<?xml version=\"1.0\" encoding=\"{$mcharset}\"?>\n" . "<document>\n" . " <webSite>" . htmlspecialchars($cms_abs) . "</webSite>\n" . " <webMaster>{$adminemail}</webMaster>\n" . " <updatePeri>" . $life * 60 . "</updatePeri>\n"; $query = $db->query("SELECT aid FROM {$tblprefix}archives {$sqlstr} ORDER BY aid DESC LIMIT 0,100"); $aedit = new cls_arcedit(); while ($row = $db->fetch_array($query)) { $aid = $row['aid']; $aedit->init(); $aedit->set_aid($aid); $aedit->detail_data(0); $datastr .= " <item>\n" . " <title>" . htmlspecialchars($aedit->archive['subject']) . "</title>\n" . " <link>" . htmlspecialchars(view_arcurl($aedit->archive)) . "</link>\n" . " <text>" . htmlspecialchars($aedit->archive[$aedit->channel['baidu']]) . "</text>\n" . " <image>" . htmlspecialchars(view_atmurl($aedit->archive['thumb'])) . "</image>\n" . " <keywords>" . htmlspecialchars($aedit->archive['keywords']) . "</keywords>\n" . " <category>" . $catalogs[$aedit->archive['caid']]['title'] . "</category>\n" . " <author>" . htmlspecialchars($aedit->archive['author']) . "</author>\n" . " <source>" . htmlspecialchars($aedit->archive['source']) . "</source>\n" . " <pubDate>" . date('Y-m-d H:i:s', $aedit->archive['createdate']) . "</pubDate>\n" . " </item>\n"; } $datastr .= "</document>"; }
function updatecopy($mode = 0) { //当更新文档时,同时更新其它的副本。 global $cotypes, $timestamp, $db, $tblprefix, $arc; if (!$mode) { return false; } $cpids = array(); $naid = $this->aid; $query = $db->query("SELECT aid FROM {$tblprefix}archives WHERE aid != '{$naid}' AND cpid='" . $this->archive['cpid'] . "'"); while ($row = $db->fetch_array($query)) { $cpids[] = $row['aid']; } if (!$cpids) { return false; } $this->init(); $this->set_aid($naid); $this->detail_data(); $archivenew =& $this->archive; $archivenew = maddslashes($archivenew); $chid = $archivenew['chid']; $fields = read_cache('fields', $chid); $aedit = new cls_arcedit(); foreach ($cpids as $aid) { $aedit->set_aid($aid); $aedit->detail_data(); $aedit->updatefield('rpmid', $archivenew['rpmid'], 'main'); $aedit->updatefield('dpmid', $archivenew['dpmid'], 'main'); $aedit->updatefield('salecp', $archivenew['salecp'], 'main'); $aedit->updatefield('fsalecp', $archivenew['fsalecp'], 'main'); $aedit->sale_define(); $aedit->updatefield('arctpls', $archivenew['arctpls'], 'sub'); $aedit->updatefield('jumpurl', $archivenew['jumpurl'], 'sub'); foreach ($fields as $k => $v) { if ($v['available'] && !$v['isfunc'] && (!in_array($k, array('subject', 'keywords', 'thumb', 'abstract')) || $mode == 1)) { if (!empty($v['istxt'])) { $txtname = saveastxt(stripslashes($archivenew[$k]), $aedit->namepres[$k]); $aedit->updatefield($k, $txtname, $v['tbl']); } else { $aedit->updatefield($k, $archivenew[$k], $v['tbl']); if ($arr = multi_val_arr($archivenew[$k], $v)) { foreach ($arr as $x => $y) { $aedit->updatefield($k . '_' . $x, $y, $v['tbl']); } } } } } $aedit->updatedb(); if ($this->channel['autostatic']) { arc_static($aid); unset($arc); } $aedit->init(); } return true; }