示例#1
0
     unset($a_split);
 }
 $curuser->pmautocheck($channel['autocheck']) && $aedit->arc_check(1, 0);
 $aedit->updatedb();
 $pids = array();
 if (!empty($archiveadd['pid'])) {
     $pids[] = max(0, intval($archiveadd['pid']));
 }
 foreach (array('ppids', 'opids') as $var) {
     if (!empty($archiveadd[$var])) {
         $pids = array_merge($pids, explode(',', $archiveadd[$var]));
     }
 }
 $pids = array_filter(array_unique($pids));
 foreach ($pids as $k) {
     $aedit->set_album($k);
 }
 //归辑设置,与文档数据库无关
 if (!empty($archiveadd['volid']) && !empty($archiveadd['pid'])) {
     $db->query("UPDATE {$tblprefix}albums SET volid='{$archiveadd['volid']}' WHERE aid={$aid} AND pid='{$archiveadd['pid']}'", 'SILENT');
 }
 //处理在类目中的复制及更新
 if (!in_array('copy', $citems) && !in_array('copy', $additems) && $coidscp) {
     $aedit->init();
     $aedit->set_aid($aid);
     if (in_array('caid', $coidscp) && ($cpcaids = explode(',', $archiveadd['cpcaids']))) {
         foreach ($cpcaids as $k1) {
             $aedit->addcopy(0, $k1);
         }
     }
     foreach ($cotypes as $k => $v) {
示例#2
0
 foreach ($cotypes as $k => $v) {
     if (!empty($arcdeal['ccid' . $k])) {
         $aedit->arc_ccid(empty(${'arcccid' . $k}) ? '' : ${'arcccid' . $k}, $k);
         if ($v['emode']) {
             $aedit->updatefield("ccid{$k}date", !isdate(${"arcccid{$k}date"}) || !$aedit->archive["ccid{$k}"] ? 0 : strtotime(${"arcccid{$k}date"}), 'main');
         }
     }
     if (!empty($arcdeal['cpccid' . $k])) {
         $ids = array_filter(explode(',', ${'arccpccid' . $k}));
         foreach ($ids as $id) {
             $aedit->addcopy($k, $id);
         }
     }
 }
 if (!empty($arcdeal['album'])) {
     $aedit->set_album($arcalbum);
 }
 if (!empty($arcdeal['validperiod'])) {
     $aedit->reset_validperiod($arcvalidperiod);
 }
 if (!empty($arcdeal['vieworder'])) {
     $aedit->updatefield('vieworder', $arcvieworder, 'main');
 }
 if (!empty($arcdeal['rpmid'])) {
     $aedit->updatefield('rpmid', $arcrpmid, 'main');
 }
 if (!empty($arcdeal['dpmid'])) {
     $aedit->updatefield('dpmid', $arcdpmid, 'main');
 }
 if (!empty($arcdeal['fsalecp'])) {
     $aedit->updatefield('fsalecp', $arcfsalecp, 'main');
示例#3
0
                $multi = multi($counts, $atpp, $page, "?entry=inarchive&action=loadold&aid={$aid}{$param_suffix}{$filterstr}");
                echo $itemstr;
                tabfooter();
                echo $multi;
                echo '<br><br>' . strbutton('bloadold', lang('load')) . '</form>';
            } else {
                include M_ROOT . $u_tplname;
            }
        } else {
            if (empty($selectid)) {
                amessage('selectalbum');
            }
            $aedit = new cls_arcedit();
            foreach ($selectid as $k) {
                $aedit->set_aid($k);
                $aedit->set_album($aid, 1);
                $aedit->init();
            }
            adminlog(lang('setalbum_admin'), lang('archive_setalbum'));
            amessage('setalbumfinish', "?entry=inarchive&action=loadold&aid={$aid}{$param_suffix}&page={$page}{$filterstr}");
        }
    } else {
        include M_ROOT . $u_tplname;
    }
} elseif ($action == 'comments') {
    //分析页面设置
    $niuid = empty($niuid) ? 0 : $niuid;
    $u_checked = -1;
    if ($niuid && ($u_url = read_cache('inurl', $niuid))) {
        $u_tplname = $u_url['tplname'];
        $u_onlyview = empty($u_url['onlyview']) ? 0 : 1;
示例#4
0
 function output_guid($guid = 0)
 {
     //禁止重复输出,未完结合辑需要输出辑内的内容
     global $db, $tblprefix, $gmodels, $curuser, $timestamp, $cotypes, $c_upload, $sid, $progress;
     if (!$guid || !($item = $db->fetch_one("SELECT * FROM {$tblprefix}gurls WHERE guid='{$guid}' AND gatherdate<>'0'"))) {
         return false;
     }
     if (!$item['outputdate']) {
         $archivenew = empty($item['contents']) ? array() : unserialize($item['contents']);
         unset($item['contents']);
         if (empty($this->fields)) {
             $this->gather_fields();
         }
         if (empty($this->oconfigs)) {
             $this->output_configs();
         }
         if (empty($this->fields) || empty($this->oconfigs)) {
             return false;
         }
         if (!empty($this->oconfigs['musts'])) {
             $mustsarr = explode(',', $this->oconfigs['musts']);
             foreach ($mustsarr as $k) {
                 if (empty($archivenew[$k])) {
                     return false;
                 }
                 //缺少必有字段内容,输出中止
             }
         }
         $c_upload->init();
         $aid = $item['aid'];
         $gmid = $this->gmission['gmid'];
         $chid = $gmodels[$gmid]['chid'];
         $channel = read_cache('channel', $chid);
         $fields = read_cache('fields', $chid);
         $sqlmain = "sid='{$item['sid']}',chid='{$chid}',mid='" . $curuser->info['mid'] . "',mname='" . $curuser->info['mname'] . "',createdate='{$timestamp}',refreshdate='{$timestamp}'";
         $sqlsub = $sqlcustom = '';
         empty($this->oconfigs['caid']) || ($sqlmain .= ",caid='" . $this->oconfigs['caid'] . "'");
         foreach ($cotypes as $k => $v) {
             $var = "ccid{$k}";
             empty($this->oconfigs[$var]) || ($sqlmain .= ",{$var}='" . $this->oconfigs[$var] . "'");
         }
         if ($fields['abstract']['available'] && !empty($this->oconfigs['autoabstract'])) {
             if (!empty($channel['autoabstract']) && !empty($archivenew[$channel['autoabstract']])) {
                 $sqlmain .= ($sqlmain ? ',' : '') . "abstract='" . addslashes(autoabstract($archivenew[$channel['autoabstract']])) . "'";
             }
         }
         if ($fields['thumb']['available'] && !empty($this->oconfigs['autothumb'])) {
             if (!empty($channel['autothumb']) && !empty($archivenew[$channel['autothumb']])) {
                 $sqlmain .= ($sqlmain ? ',' : '') . "thumb='" . $c_upload->thumb_pick($archivenew[$channel['autothumb']], $fields[$channel['autothumb']]['datatype'], $fields['thumb']['rpid']) . "'";
             }
         }
         if ($channel['autosize'] && !empty($archivenew[$channel['autosize']])) {
             include_once M_ROOT . '/include/fields.cls.php';
             $archivenew['atmsize'] = atm_size($archivenew[$channel['autosize']], $fields[$channel['autosize']]['datatype'], $channel['autosizemode']);
             $sqlmain .= ",atmsize='" . $archivenew['atmsize'] . "'";
         }
         if ($channel['autobyte'] && isset($archivenew[$channel['autobyte']])) {
             $archivenew['bytenum'] = atm_byte(stripslashes($archivenew[$channel['autobyte']]), $fields[$channel['autobyte']]['datatype']);
             $sqlmain .= ",bytenum='" . $archivenew['bytenum'] . "'";
         }
         foreach ($fields as $k => $v) {
             if ($v['available'] && isset($archivenew[$k])) {
                 if ($v['datatype'] == 'htmltext') {
                     $archivenew[$k] = addslashes($archivenew[$k]);
                     html_atm2tag($archivenew[$k]);
                     $archivenew[$k] = stripslashes($archivenew[$k]);
                 }
                 if (!empty($v['istxt'])) {
                     if ($aid) {
                         if (empty($oldval)) {
                             $oldval = $db->fetch_one("SELECT * FROM {$tblprefix}archives_{$chid} WHERE aid={$aid}");
                         }
                         saveastxt($archivenew[$k], $oldval[$k]);
                         continue;
                     } else {
                         $archivenew[$k] = saveastxt($archivenew[$k]);
                     }
                 }
                 ${'sql' . $v['tbl']} .= (${'sql' . $v['tbl']} ? ',' : '') . $k . "='" . addslashes($archivenew[$k]) . "'";
                 if ($arr = multi_val_arr($archivenew[$k], $v)) {
                     foreach ($arr as $x => $y) {
                         ${'sql' . $v['tbl']} .= (${'sql' . $v['tbl']} ? ',' : '') . $k . '_' . $x . "='{$y}'";
                     }
                 }
             }
         }
         unset($fields, $archivenew, $mustarr);
         if ($aid) {
             $sqlcustom && $db->query("UPDATE {$tblprefix}archives_{$chid} SET " . $sqlcustom);
         } else {
             $db->query("INSERT INTO {$tblprefix}archives SET {$sqlmain}");
             if (!($aid = $db->insert_id())) {
                 return false;
             } else {
                 $db->query("INSERT INTO {$tblprefix}archives_rec SET aid='{$aid}'");
                 $sqlsub = "aid='{$aid}'" . ($sqlsub ? ',' : '') . $sqlsub;
                 $needstatics = '';
                 for ($i = 0; $i <= $channel['addnum']; $i++) {
                     $needstatics .= $timestamp . ',';
                 }
                 $sqlsub .= ",needstatics='{$needstatics}'";
                 $db->query("INSERT INTO {$tblprefix}archives_sub SET " . $sqlsub);
                 $sqlcustom = "aid='{$aid}'" . ($sqlcustom ? ',' : '') . $sqlcustom;
                 $db->query("INSERT INTO {$tblprefix}archives_{$chid} SET " . $sqlcustom);
                 $curuser->basedeal('archive', 1, 1, 1);
             }
             $aedit = new cls_arcedit();
             $aedit->set_aid($aid);
             $aedit->set_arcurl();
             $aedit->set_cpid($aid);
             $curuser->pmautocheck($channel['autocheck']) && $aedit->arc_check(1, 0);
             $aedit->updatedb();
             //归辑设置,与文档数据库无关
             if (!empty($item['pid'])) {
                 $pid = $db->result_one("SELECT aid FROM {$tblprefix}gurls WHERE guid='{$item['pid']}'");
                 $pid && $aedit->set_album($pid);
             }
             if ($channel['autostatic']) {
                 arc_static($aid);
             }
             $ufids = $c_upload->ufids + explode(',', $item['ufids']);
             empty($ufids) || $db->query("UPDATE {$tblprefix}userfiles SET aid={$aid} WHERE ufid " . multi_str($ufids));
         }
         $db->query("UPDATE {$tblprefix}gurls SET aid='{$aid}',outputdate='{$timestamp}',contents='',ufids='' WHERE guid='{$item['guid']}'");
         $progress && $progress->output(1);
     }
     if ($this->gmission['sonid'] && !$item['abover']) {
         $this->output_sonid($guid, $this->gmission['sonid']);
     }
     //将合辑中的内容入库
     unset($aedit, $arc, $fields, $field, $item, $archivenew, $channel, $sqlmain, $sqlsub, $sqlcustom);
     return true;
 }