コード例 #1
0
ファイル: archiveadd.php プロジェクト: polarlight1989/08cms
                $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) {
                    if (!$v['self_reg'] && empty($v['asmode']) && in_array($k, $coidscp) && (${"cpccids{$k}"} = array_filter(explode(',', $archiveadd["cpccids{$k}"])))) {
                        foreach (${"cpccids{$k}"} as $k1) {
                            $aedit->addcopy($k, $k1);
                        }
                    }
                }
            }
            unset($aedit);
            if ($channel['autostatic']) {
                include_once M_ROOT . "./include/arc_static.fun.php";
                arc_static($aid);
                unset($arc);
            }
        }
        $c_upload->saveuptotal(1);
        mcmessage('arcaddfinish', axaction(10, $forward));
    }
} else {
    include M_ROOT . $channel['ucadd'];
}
mexit();
?>

コード例 #2
0
ファイル: static.inc.php プロジェクト: polarlight1989/08cms
     }
 }
 if (!$staticmode) {
     include_once M_ROOT . "./include/archive.cls.php";
     $arc = new cls_archive();
     foreach ($selectid as $aid) {
         $arc->arcid($aid);
         $arc->update_needstatic($ptypes);
     }
     unset($arc);
 } elseif ($staticmode == 1) {
     include_once M_ROOT . "./include/archive.cls.php";
     include_once M_ROOT . "./include/arc_static.fun.php";
     foreach ($selectid as $aid) {
         foreach ($ptypes as $k) {
             arc_static($aid, $k, 0);
         }
         $arc->update_needstatic($ptypes, 1);
     }
     unset($arc);
 } elseif ($staticmode == 2) {
     //修复静态链接
     include_once M_ROOT . "./include/arcedit.cls.php";
     $aedit = new cls_arcedit();
     foreach ($selectid as $aid) {
         $aedit->set_aid($aid);
         $aedit->set_arcurl();
         $aedit->init();
     }
     unset($aedit);
 }
コード例 #3
0
ファイル: arcedit.cls.php プロジェクト: polarlight1989/08cms
 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;
 }
コード例 #4
0
ファイル: gather.cls.php プロジェクト: polarlight1989/08cms
 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;
 }
コード例 #5
0
ファイル: static.php プロジェクト: polarlight1989/08cms
include_once M_ROOT . './include/common.fun.php';
if ($mode == 'arc') {
    include_once M_ROOT . './include/arc_static.fun.php';
    if (!($aid = max(0, intval(@$aid)))) {
        mexit();
    }
    $addno = empty($addno) ? 0 : max(0, intval($addno));
    if (!$debugtag) {
        if (!($needstatics = $db->result_one("SELECT needstatics FROM {$tblprefix}archives_sub WHERE aid='{$aid}'"))) {
            mexit();
        }
        if (!($needstatics = explode(',', $needstatics)) || empty($needstatics[$addno]) || $needstatics[$addno] > $timestamp) {
            mexit();
        }
    }
    arc_static($aid, $addno, 1);
} elseif ($mode == 'cnindex') {
    include_once M_ROOT . './include/cn_static.fun.php';
    parse_str($_SERVER['QUERY_STRING'], $temparr);
    $cnstr = cnstr($temparr);
    $addno = max(0, intval(@$addno));
    if (!$debugtag) {
        if ($cnstr) {
            if (!($needstatics = $db->result_one("SELECT needstatics FROM {$tblprefix}cnodes WHERE ename='{$cnstr}' AND sid='{$sid}'"))) {
                mexit();
            }
            if (!($needstatics = explode(',', $needstatics)) || empty($needstatics[$addno]) || $needstatics[$addno] > $timestamp) {
                mexit();
            }
        } elseif ($sid) {
            if (!($needstatic = $db->result_one("SELECT ineedstatic FROM {$tblprefix}subsites WHERE sid='{$sid}'"))) {