コード例 #1
0
ファイル: archive.inc.php プロジェクト: polarlight1989/08cms
     $u_onlyview = empty($u_url['onlyview']) ? 0 : 1;
     $u_mtitle = $u_url['mtitle'];
     $u_guide = $u_url['guide'];
     $vars = array('lists');
     foreach ($vars as $var) {
         if (!empty($u_url['setting'][$var])) {
             ${'u_' . $var} = explode(',', $u_url['setting'][$var]);
         }
     }
 }
 if (empty($u_tplname) || !empty($u_onlyview)) {
     include_once M_ROOT . "./include/fields.cls.php";
     include_once M_ROOT . "./include/upload.cls.php";
     include_once M_ROOT . "./include/arcedit.cls.php";
     include_once M_ROOT . "./include/commu.fun.php";
     $aedit = new cls_arcedit();
     $aedit->set_aid($aid);
     $aedit->detail_data();
     !$aedit->aid && mcmessage('choosearchive');
     $aedit->archive['mid'] != $memberid && mcmessage('chooseyourarchive');
     if ($sid != $aedit->archive['sid']) {
         switch_cache($aedit->archive['sid']);
         $sid = $aedit->archive['sid'];
     }
     //模型与合辑信息是不会变化的
     $chid = $aedit->archive['chid'];
     $forward = empty($forward) ? M_REFERER : $forward;
     $forwardstr = '&forward=' . urlencode($forward);
     $freeupdate = $curuser->check_allow('freeupdatecheck') || !$aedit->archive['checked'];
     $channel =& $aedit->channel;
     $fields = read_cache('fields', $chid);
コード例 #2
0
ファイル: archives.inc.php プロジェクト: polarlight1989/08cms
         if (empty($u_operates) || in_array('valid', $u_operates)) {
             trbasic("<input class=\"checkbox\" type=\"checkbox\" name=\"arcdeal[validperiod]\" value=\"1\">&nbsp;" . lang('resetvalidperiod'), 'arcvalidperiod', '', 'text');
         }
         tabfooter('barcsedit');
         m_guide(@$u_guide);
     } else {
         include M_ROOT . $u_tplname;
     }
 } else {
     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');
         }
コード例 #3
0
ファイル: arcview.inc.php プロジェクト: polarlight1989/08cms
<?php

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')) . '&nbsp;&nbsp;/&nbsp;&nbsp;' . ($aedit->archive['editor'] ? $aedit->archive['editor'] : '-'), '');
trbasic(lang('clickcomment'), '', $aedit->archive['clicks'] . '&nbsp;&nbsp;/&nbsp;&nbsp;' . $aedit->archive['comments'], '');
tabfooter();
tabheader(lang('othermessage'));
trbasic(lang('channel'), '', $aedit->archive['chid'] ? $channels[$aedit->archive['chid']]['cname'] : '-', '');
コード例 #4
0
ファイル: answer.inc.php プロジェクト: polarlight1989/08cms
<?php

!defined('M_COM') && exit('No Permission');
include_once M_ROOT . "./include/arcedit.cls.php";
load_cache('currencys,acatalogs');
$cid = empty($cid) ? 0 : max(0, intval($cid));
$cuid = $db->result_one("SELECT cuid FROM {$tblprefix}mcomments WHERE cid='{$cid}'");
if (!$cuid || !($commu = read_cache('commu', $cuid))) {
    mcmessage('setcommuitem');
}
if (empty($commu['umdetail'])) {
    $amode = empty($amode) ? 0 : max(0, intval($amode));
    if (!($answer = $db->fetch_one("SELECT * FROM {$tblprefix}answers WHERE cid=" . $cid))) {
        mcmessage('chooseanswer');
    }
    $aedit = new cls_arcedit();
    $aedit->set_aid($answer['aid']);
    $aedit->basic_data();
    if (!$aedit->aid) {
        mcmessage('choosearchive');
    }
    if ($memberid != ($amode ? $aedit->archive['mid'] : $answer['mid'])) {
        mcmessage('chooseanswer');
    }
    $forward = empty($forward) ? M_REFERER : $forward;
    $forwardstr = '&forward=' . rawurlencode($forward);
    if (!submitcheck('banswerdetail')) {
        tabheader(lang('editanswer'), 'answerdetail', "?action=answer&cid={$cid}{$forwardstr}");
        trbasic(lang('questiontitle'), '', $aedit->archive['subject'], '');
        trbasic(lang('answercontent'), 'answernew[answer]', br2nl($answer['answer']), 'btextarea');
        tabfooter($amode ? '' : 'banswerdetail');
コード例 #5
0
ファイル: reports.inc.php プロジェクト: polarlight1989/08cms
            }
        }
        adminlog(lang('reportsetsucceed'), lang('reportsetsucceed'));
        amessage('contentsetsucceed', "?entry=reports&action=reportsedit{$param_suffix}&page={$page}{$filterstr}");
    }
} elseif ($action == 'reportdetail') {
    load_cache('bfields,ucotypes');
    $forward = empty($forward) ? M_REFERER : $forward;
    $forwardstr = '&forward=' . rawurlencode($forward);
    if (!($report = $db->fetch_one("SELECT * FROM {$tblprefix}reports WHERE cid='{$cid}'"))) {
        amessage('choosereport');
    }
    $commu = read_cache('commu', $report['cuid']);
    //$fieldsarr = empty($commu['setting']['fields']) ? array() : explode(',',$commu['setting']['fields']);
    $citems = empty($commu['setting']['citems']) ? array() : explode(',', $commu['setting']['citems']);
    $aedit = new cls_arcedit();
    $aedit->set_aid($report['aid']);
    $aedit->detail_data();
    if (!submitcheck('newcommu')) {
        tabheader($commu['cname'] . '&nbsp; -&nbsp; ' . lang('based_msg'), 'commudetail', "?entry=reports&action=reportdetail&cid={$cid}{$param_suffix}{$forwardstr}", 2, 1, 1);
        $archive = $db->fetch_one("SELECT * FROM {$tblprefix}archives WHERE aid='{$report['aid']}'");
        trbasic(lang('lookrelatedsource'), '', "<a href=\"" . view_arcurl($aedit->archive) . "\" target=\"_blank\">>>&nbsp; " . $aedit->archive['subject'] . "</a>", '');
        trbasic(lang('add_time'), '', date('Y-m-d H:i', $report['createdate']), '');
        tabfooter();
        $a_field = new cls_field();
        tabheader($commu['cname'] . '&nbsp; -&nbsp; ' . lang('submitmessage'));
        $submitstr = '';
        foreach ($ucotypes as $k => $v) {
            if (in_array('uccid' . $k, $citems) && $v['umode'] != 1) {
                trbasic($v['cname'], '', mu_cnselect("communew[uccid{$k}]", $report["uccid{$k}"], $k, lang('p_choose'), $v['emode'], "communew[uccid{$k}date]", @$report["uccid{$k}date"] ? date('Y-m-d', $report["uccid{$k}date"]) : ''), '');
                $submitstr .= makesubmitstr("communew[uccid{$k}]", $v['notblank'], 0, 0, 0, 'common');
コード例 #6
0
ファイル: reply.php プロジェクト: polarlight1989/08cms
 //数据处理
 load_cache('rfields,ucotypes');
 include_once M_ROOT . "./include/fields.cls.php";
 include_once M_ROOT . "./include/upload.cls.php";
 include_once M_ROOT . "./include/arcedit.cls.php";
 include_once M_ROOT . "./include/cuedit.cls.php";
 include_once M_ROOT . "./include/cheader.inc.php";
 $inajax ? aheader() : _header();
 if (!regcode_pass('reply', empty($regcode) ? '' : trim($regcode))) {
     mcmessage('regcodeerror', axaction(2, M_REFERER));
 }
 if (!$curuser->checkforbid('reply')) {
     mcmessage('userisforbid', axaction(2, M_REFERER));
 }
 //屏蔽组
 $aedit = new cls_arcedit();
 $aedit->set_aid($aid);
 $aedit->basic_data();
 if (!$aedit->aid) {
     mcmessage('choosereplyobject', axaction(2, M_REFERER));
 }
 if (!$aedit->archive['checked']) {
     mcmessage('poinarcnoche');
 }
 if (!$aedit->channel['reply'] || !($commu = read_cache('commu', $aedit->channel['reply']))) {
     mcmessage('setcomitem', axaction(2, M_REFERER));
 }
 if (!$curuser->pmbypmids('cuadd', $commu['setting']['apmid'])) {
     mcmessage('younoitempermis', axaction(2, M_REFERER));
 }
 if (empty($commu['setting']['repeat']) || !empty($commu['setting']['repeattime'])) {
コード例 #7
0
ファイル: inreplys.inc.php プロジェクト: polarlight1989/08cms
    $u_guide = @$u_url['guide'];
    $u_checked = $u_url['setting']['checked'];
    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) {
コード例 #8
0
ファイル: archives.inc.php プロジェクト: polarlight1989/08cms
     $selectid = array();
     $npage = empty($npage) ? 1 : $npage;
     if (empty($pages)) {
         $counts = $db->result_one("SELECT count(*) {$fromsql} {$wheresql}");
         $pages = @ceil($counts / $atpp);
     }
     if ($npage <= $pages) {
         $fromstr = empty($fromid) ? "" : "a.aid<{$fromid}";
         $nwheresql = !$wheresql ? $fromstr ? "WHERE {$fromstr}" : "" : $wheresql . ($fromstr ? " AND " : "") . $fromstr;
         $query = $db->query("SELECT a.aid {$fromsql} {$nwheresql} ORDER BY a.aid DESC LIMIT 0,{$atpp}");
         while ($item = $db->fetch_array($query)) {
             $selectid[] = $item['aid'];
         }
     }
 }
 $aedit = new cls_arcedit();
 foreach ($selectid as $aid) {
     $aedit->set_aid($aid);
     $aedit->basic_data();
     if (!empty($arcdeal['checkneed'])) {
         $aedit->archive['needupdate'] && $aedit->arc_check(0);
     } elseif (!empty($arcdeal['uncheckneed']) && !$aedit->archive['overupdate']) {
         $aedit->archive['checked'] || $aedit->arc_check(1);
         $aedit->updatefield('needupdate', 0, 'sub');
     }
     if ($aedit->archive['overupdate']) {
         if (!empty($arcdeal['checkupdate'])) {
             $aedit->arc_check(1);
             $aedit->updatefield('needupdate', 0, 'sub');
             $aedit->updatefield('overupdate', 0, 'sub');
         } elseif (!empty($arcdeal['uncheckupdate'])) {
コード例 #9
0
    $u_mtitle = @$u_url['mtitle'];
    $u_guide = @$u_url['guide'];
    $u_checked = $u_url['setting']['checked'];
    foreach (array('filters', 'lists') 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/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}answers cu LEFT JOIN {$tblprefix}archives a ON a.aid=cu.aid";
    //审核状态范围
    if ($checked != -1) {
コード例 #10
0
ファイル: answer.php プロジェクト: polarlight1989/08cms
         @(include M_ROOT . "template/{$templatedir}/pcache/{$tplname}.php");
         $_content = ob_get_contents();
         ob_clean();
         mexit($_content);
     }
 } else {
     include_once M_ROOT . './include/arcedit.cls.php';
     include_once M_ROOT . "./include/cheader.inc.php";
     $inajax ? aheader() : _header();
     !$memberid && mcmessage('nousernooperatepermis', axaction(2, M_REFERER));
     if (!regcode_pass('answer', empty($regcode) ? '' : trim($regcode))) {
         mcmessage('regcodeerror', axaction(2, M_REFERER));
     }
     !$curuser->checkforbid('answer') && mcmessage('userisforbid', axaction(2, M_REFERER));
     //屏蔽组
     $aedit = new cls_arcedit();
     $aedit->set_aid($aid);
     $aedit->basic_data();
     !$aedit->aid && mcmessage('choosearchive');
     !($commu = read_cache('commu', $aedit->channel['cuid'])) && mcmessage('setcomitem', axaction(2, M_REFERER));
     !$curuser->pmbypmids('cuadd', $commu['setting']['apmid']) && mcmessage('younoitempermis', axaction(2, M_REFERER));
     ($aedit->archive['closed'] || $aedit->archive['finishdate'] < $timestamp) && mcmessage('questionclosed', axaction(2, M_REFERER));
     $communew['answer'] = empty($communew['answer']) ? '' : trim($communew['answer']);
     empty($communew['answer']) && mcmessage('inputanswercontent', axaction(2, M_REFERER));
     !empty($commu['setting']['minlength']) && strlen($communew['answer']) < $commu['setting']['minlength'] && mcmessage('answeroverminlength');
     !empty($commu['setting']['maxlength']) && ($communew['answer'] = cutstr($communew['answer'], $commu['setting']['maxlength']));
     $db->query("INSERT INTO {$tblprefix}answers SET\n\t\t\t\t\t\t aid='{$aid}', \n\t\t\t\t\t\t answer='{$communew['answer']}', \n\t\t\t\t\t\t crid='" . $aedit->archive['crid'] . "', \n\t\t\t\t\t\t cuid='" . $commu['cuid'] . "', \n\t\t\t\t\t\t mid='" . $curuser->info['mid'] . "', \n\t\t\t\t\t\t mname='" . $curuser->info['mname'] . "', \n\t\t\t\t\t\t createdate='{$timestamp}'\n\t\t\t\t\t\t ");
     if ($cid = $db->insert_id()) {
         $aedit->arc_nums('answers', 1, 1);
         $curuser->basedeal('answer', 1, 1, 1);
     }
コード例 #11
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;
 }
コード例 #12
0
ファイル: comment.php プロジェクト: polarlight1989/08cms
 //数据处理
 load_cache('cfields,ucotypes');
 include_once M_ROOT . "./include/fields.cls.php";
 include_once M_ROOT . "./include/upload.cls.php";
 include_once M_ROOT . "./include/arcedit.cls.php";
 include_once M_ROOT . "./include/cuedit.cls.php";
 include_once M_ROOT . "./include/cheader.inc.php";
 $inajax ? aheader() : _header();
 if (!regcode_pass('comment', empty($regcode) ? '' : trim($regcode))) {
     mcmessage('regcodeerror', axaction(2, M_REFERER));
 }
 if (!$curuser->checkforbid('comment')) {
     mcmessage('userisforbid', axaction(2, M_REFERER));
 }
 //屏蔽组
 $aedit = new cls_arcedit();
 $aedit->set_aid($aid);
 $aedit->basic_data();
 if (!$aedit->aid) {
     mcmessage('choosecommentobject', axaction(2, M_REFERER));
 }
 if (!$aedit->archive['checked']) {
     mcmessage('poinarcnoche');
 }
 if (!$aedit->channel['comment'] || !($commu = read_cache('commu', $aedit->channel['comment']))) {
     mcmessage('setcomitem', axaction(2, M_REFERER));
 }
 if (!$curuser->pmbypmids('cuadd', $commu['setting']['apmid'])) {
     mcmessage('younoitempermis', axaction(2, M_REFERER));
 }
 if (empty($commu['setting']['repeat']) || !empty($commu['setting']['repeattime'])) {
コード例 #13
0
 $naid = $aid;
 if (!empty($albumsnew)) {
     foreach ($albumsnew as $k => $v) {
         $db->query("UPDATE {$tblprefix}albums SET vieworder='" . max(0, intval($v['vieworder'])) . "' WHERE abid='{$k}'");
     }
 }
 if (!empty($selectid)) {
     //合辑内的退出合辑,辑内审核,辑内解审
     if (!empty($arcdeal['inclear'])) {
         $db->query("DELETE FROM {$tblprefix}albums WHERE abid " . multi_str(array_keys($selectid)), 'UNBUFFERED');
     } elseif (!empty($arcdeal['incheck'])) {
         $db->query("UPDATE {$tblprefix}albums SET checked='1' WHERE abid " . multi_str(array_keys($selectid)));
     } elseif (!empty($arcdeal['inuncheck'])) {
         $db->query("UPDATE {$tblprefix}albums SET checked='0' WHERE abid " . multi_str(array_keys($selectid)));
     }
     $aedit = new cls_arcedit();
     foreach ($selectid as $abid => $aid) {
         $aedit->set_aid($aid);
         $aedit->basic_data();
         if (!empty($arcdeal['delete'])) {
             $aedit->arc_delete(1);
             continue;
         }
         if (!empty($arcdeal['readd'])) {
             //重发布
             $aedit->readd(0);
         }
         if (!empty($arcdeal['abover'])) {
             $aedit->updatefield('abover', 1, 'main');
         } elseif (!empty($arcdeal['unabover'])) {
             $aedit->updatefield('abover', 0, 'main');
コード例 #14
0
ファイル: pay_base.php プロジェクト: polarlight1989/08cms
 function setStatus($status, $remark = '')
 {
     global $db, $tblprefix, $timestamp, $onlineautosaving;
     switch ($this->status = $status) {
         case PAY_FINISHED:
             //交易完成
             $remark || ($remark = '交易完成');
             break;
         case PAY_FAIL:
             //交易失败
             $remark || ($remark = '交易失败');
             break;
         case PAY_WAIT_PAY:
             //等待付款
             $remark || ($remark = '等待付款');
             break;
         case PAY_WAIT_GOODS:
             //等待发货
             $remark || ($remark = '等待发货');
             break;
         case PAY_CONFIRM_GOODS:
             //等待买家确认收货
             $remark || ($remark = '等待买家确认收货');
             break;
         default:
             $this->message(array('title' => '调用错误', 'content' => "未定义的交易状态 “{$status”!}"));
     }
     switch ($this->by) {
         case 'orders':
             $upsql = ",remark='" . addslashes($remark) . "'";
             ($status == PAY_WAIT_GOODS || $status == PAY_FINISHED && !$this->totalfee) && ($upsql .= ",payed=totalfee");
             $db->query("UPDATE {$tblprefix}orders SET state={$status},updatedate={$timestamp}{$upsql} WHERE ({$status}<0 OR state<{$status}) AND oid='{$this->order_id}'");
             if ($ret = $db->affected_rows()) {
                 $query = $db->query("SELECT aid,tocid as cid,price,nums FROM {$tblprefix}purchases WHERE oid='{$this->order_id}'");
                 $nums = 0;
                 $aedit = new cls_arcedit();
                 while ($row = $db->fetch_array($query)) {
                     $nums += $row['nums'];
                     if ($row['cid']) {
                         //商家商品
                     } else {
                         //网站商品
                         $aedit->init();
                         $aedit->set_aid($row['aid']);
                         $aedit->arc_nums('orders', $row['nums']);
                         $aedit->arc_nums('ordersum', $row['price'] * $row['nums'], 1);
                     }
                 }
                 $user = new cls_userinfo();
                 $user->activeuser($this->mid, 1);
                 $user->basedeal('purchase', 1, $nums, 1);
             }
             break;
         case 'pays':
             $upsql = $onlineautosaving ? ",transdate={$timestamp}" : '';
             $db->query("UPDATE {$tblprefix}pays SET receivedate={$timestamp}{$upsql} WHERE receivedate=0 AND pid='{$this->order_id}'");
             $ret = $db->affected_rows();
             if ($ret && $upsql) {
                 $user = new cls_userinfo();
                 $user->activeuser($this->mid);
                 $user->updatecrids(array(0 => $this->totalfee), 1);
             }
             break;
         default:
             $this->message(array('title' => '调用错误', 'content' => "未定义的交易!"));
     }
     return $ret;
 }
コード例 #15
0
ファイル: comments.inc.php プロジェクト: polarlight1989/08cms
     $npage = empty($npage) ? 1 : $npage;
     if (empty($pages)) {
         $counts = $db->result_one("SELECT count(*) {$fromsql} {$wheresql}");
         $pages = @ceil($counts / $atpp);
     }
     if ($npage <= $pages) {
         $fromstr = empty($fromid) ? "" : "cu.cid<{$fromid}";
         $nwheresql = !$wheresql ? $fromstr ? "WHERE {$fromstr}" : "" : $wheresql . ($fromstr ? " AND " : "") . $fromstr;
         $query = $db->query("SELECT cu.cid {$fromsql} {$nwheresql} ORDER BY cu.cid DESC LIMIT 0,{$atpp}");
         while ($item = $db->fetch_array($query)) {
             $selectid[] = $item['cid'];
         }
     }
 }
 if (!empty($arcdeal['delete'])) {
     $aedit = new cls_arcedit();
     $actuser = new cls_userinfo();
     $query = $db->query("SELECT aid,mid FROM {$tblprefix}comments WHERE cid " . multi_str($selectid));
     while ($row = $db->fetch_array($query)) {
         $aedit->set_aid($row['aid']);
         $aedit->arc_nums('comments', -1, 1);
         $aedit->init();
         $actuser->activeuser($row['mid']);
         $actuser->basedeal('comment', 0, 1, 1);
         $actuser->init();
     }
     $db->query("DELETE FROM {$tblprefix}comments WHERE cid " . multi_str($selectid), 'UNBUFFERED');
 } else {
     if (!empty($arcdeal['check'])) {
         $db->query("UPDATE {$tblprefix}comments SET checked='1' WHERE cid " . multi_str($selectid));
     }
コード例 #16
0
ファイル: cuedit.cls.php プロジェクト: polarlight1989/08cms
 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();
 }
コード例 #17
0
ファイル: score.php プロジェクト: polarlight1989/08cms
!($commu = read_cache('commu', 2)) && cumessage('choosecommuitem');
if (empty($commu['ucadd'])) {
    !$curuser->pmbypmids('cuadd', $commu['setting']['apmid']) && cumessage('younoscorepermis');
    $score = empty($score) ? 0 : max(0, intval($score));
    $scorearr = empty($commu['setting']['scorestr']) ? array() : array_filter(explode(',', $commu['setting']['scorestr']));
    if (!in_array($score, $scorearr)) {
        cumessage('scoreoptionerr');
    }
    if (empty($commu['setting']['repeat']) || !empty($commu['setting']['repeattime'])) {
        if (empty($m_cookie['08cms_cuid_' . $commu['cuid'] . '_' . $aid])) {
            msetcookie('08cms_cuid_' . $commu['cuid'] . '_' . $aid, '1', empty($commu['setting']['repeat']) ? 365 * 24 * 3600 : $commu['setting']['repeattime'] * 60);
        } else {
            cumessage(empty($commu['setting']['repeat']) ? 'norepeatoper' : 'overquick', $forward);
        }
    }
    $aedit = new cls_arcedit();
    $aedit->set_aid($aid);
    $aedit->basic_data();
    !$aedit->aid && cumessage('choosearchive');
    !$aedit->archive['checked'] && cumessage('poinarcnoche');
    $aedit->updatefield('avgscore', round(($aedit->archive['avgscore'] * $aedit->archive['scores'] + $score) / ($aedit->archive['scores'] + 1), 2), 'main');
    //平均分
    if (!empty($commu['setting']['pics']) && isset($aedit->archive['score_' . $score])) {
        $aedit->updatefield('score_' . $score, $aedit->archive['score_' . $score] + 1, 'main');
    }
    $aedit->arc_nums('scores', 1, 1);
    //文档统计
    $curuser->basedeal('score', 1, 1, 1);
    //会员统计及积分
    cumessage($inajax ? 'succeed' : 'scoresucceed');
} else {
コード例 #18
0
    }
    $counts = $db->result_one("SELECT COUNT(*) FROM {$tblprefix}favorites f LEFT JOIN {$tblprefix}archives a ON a.aid=f.aid {$wheresql}");
    $multi = multi($counts, $mrowpp, $page, "?action=favorites{$filterstr}");
    tabheader(lang('favoritearchivelist'), '', '', 8);
    trcategory(array("<input class=\"checkbox\" type=\"checkbox\" name=\"chkall\" onclick=\"checkall(this.form, 'selectid', 'chkall')\">", lang('title'), lang('catalog'), lang('author'), lang('favoritedate')));
    echo $itemstr;
    tabfooter();
    echo $multi;
    echo "<input class=\"button\" type=\"submit\" name=\"barcsedit\" value=\"" . lang('delete') . "\"></form>";
} else {
    empty($selectid) && mcmessage('selectfavoritearc', $forward);
    $query = $db->query("SELECT * FROM {$tblprefix}favorites WHERE mid={$memberid} AND aid " . multi_str($selectid) . " ORDER BY aid DESC");
    while ($item = $db->fetch_array($query)) {
        $items[$item['aid']] = $item;
    }
    $aedit = new cls_arcedit();
    foreach ($items as $item) {
        $aedit->set_aid($item['aid']);
        $aedit->arc_nums('favorites', -1, 1);
        $aedit->init();
        $curuser->basedeal('favorite', 0, 1);
    }
    $curuser->updatedb();
    $db->query("DELETE FROM {$tblprefix}favorites WHERE aid " . multi_str(array_keys($items)), 'UNBUFFERED');
    unset($aedit);
    if (!empty($select_all)) {
        $npage++;
        if ($npage <= $pages) {
            $fromid = min(array_keys($items));
            $transtr = '';
            $transtr .= "&select_all=1";
コード例 #19
0
ファイル: loadold.inc.php プロジェクト: polarlight1989/08cms
                }
                if (in_array('subsite', $u_lists)) {
                    $itemstr .= "<td class=\"item\">{$subsitestr}</td>\n";
                }
                $itemstr .= "</tr>\n";
            }
            $counts = $db->result_one("SELECT count(*) {$fromsql} {$wheresql}");
            $multi = multi($counts, $mrowpp, $page, "?action=loadold&aid={$aid}{$param_suffix}{$filterstr}");
            echo $itemstr;
            tabfooter();
            echo $multi;
            echo '<br><br>' . strbutton('bloadold', lang('load')) . '</form>';
            m_guide(@$u_guide);
        } else {
            include M_ROOT . $u_tplname;
        }
    } else {
        if (empty($selectid)) {
            mcmessage('selectalbum');
        }
        $aedit = new cls_arcedit();
        foreach ($selectid as $k) {
            $aedit->set_aid($k);
            $aedit->set_album($aid, 1);
            $aedit->init();
        }
        mcmessage('setalbumfinish', "?action=loadold&aid={$aid}{$param_suffix}&page={$page}{$filterstr}");
    }
} else {
    include M_ROOT . $u_tplname;
}
コード例 #20
0
ファイル: static.inc.php プロジェクト: polarlight1989/08cms
     }
     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);
 }
 $npage++;
 if ($npage <= $pages) {
     $fromid = min($selectid);
     $transtr = "&pages={$pages}";
     $transtr .= "&npage={$npage}";
     $transtr .= "&barchives=1";
     $transtr .= "&fromid={$fromid}";
     amessage('operating', "?entry={$entry}&action={$action}{$param_suffix}{$filterstr}{$transtr}", $pages, $npage, "<a href=\"?entry={$entry}&action={$action}{$filterstr}\">", '</a>');
コード例 #21
0
ファイル: offer.php プロジェクト: polarlight1989/08cms
    $aid = empty($aid) ? 0 : max(0, intval($aid));
    if (!$aid) {
        cumessage('chooseproduct');
    }
    $cuid = $db->result_one("SELECT c.offer FROM {$tblprefix}archives a LEFT JOIN {$tblprefix}channels c ON c.chid=a.chid WHERE a.aid='{$aid}'");
    if (!$cuid || !($commu = read_cache('commu', $cuid))) {
        message('setcomitem');
    }
    if (empty($commu['ucadd'])) {
        if (!$memberid) {
            cumessage('nousernoofferpermis');
        }
        if ($cid = $db->result_one("SELECT cid FROM {$tblprefix}offers WHERE mid='{$memberid}' AND aid='{$aid}'")) {
            cumessage('offerexist', "adminm.php?action=offers");
        }
        $aedit = new cls_arcedit();
        $aedit->set_aid($aid);
        if ($retmsg = $aedit->newoffer()) {
            cumessage($retmsg);
        }
        cumessage($inajax ? 'succeed' : 'offersubmitsucceed', "adminm.php?action=offers");
    } else {
        include M_ROOT . $commu['ucadd'];
    }
} elseif ($action == 'vote') {
    $inajax = empty($inajax) ? 0 : 1;
    $cid = empty($cid) ? 0 : max(0, intval($cid));
    if (!$cid) {
        cumessage('choosevoteobject');
    }
    if (!($row = $db->fetch_one("SELECT * FROM {$tblprefix}offers WHERE cid='{$cid}'"))) {
コード例 #22
0
ファイル: arcs.php プロジェクト: polarlight1989/08cms
 if ($niuid && ($u_url = read_cache('inurl', $niuid))) {
     $u_tplname = $u_url['tplname'];
     $u_onlyview = empty($u_url['onlyview']) ? 0 : 1;
     $u_mtitle = $u_url['mtitle'];
     $u_guide = $u_url['guide'];
     $vars = array('lists');
     foreach ($vars as $var) {
         if (!empty($u_url['setting'][$var])) {
             ${'u_' . $var} = explode(',', $u_url['setting'][$var]);
         }
     }
 }
 if (empty($u_tplname) || !empty($u_onlyview)) {
     $forward = empty($forward) ? M_REFERER : $forward;
     $forwardstr = '&forward=' . rawurlencode($forward);
     $aedit = new cls_arcedit();
     $aedit->set_aid($aid);
     $aedit->detail_data();
     $chid = $aedit->archive['chid'];
     $channel =& $aedit->channel;
     if (!array_intersect(array(-1, $aedit->archive['caid']), $a_caids)) {
         amessage('fbd_caids');
     }
     //管理后台对该栏目的限制
     $fields = read_cache('fields', $chid);
     foreach (array('acoids', 'aitems', 'coidscp', 'cpkeeps') as $var) {
         ${$var} = $channel[$var] ? explode(',', $channel[$var]) : array();
     }
     if (!submitcheck('barchivedetail')) {
         if (empty($u_tplname)) {
             $submitstr = '';
コード例 #23
0
         }
         $counts = $db->result_one("SELECT count(*) {$fromsql} {$wheresql}");
         $multi = multi($counts, $atpp, $page, "?entry=inarchive&action=answers&aid={$aid}{$param_suffix}{$filterstr}");
         echo $itemstr;
         tabfooter();
         echo $multi;
         echo '<br><br>' . strbutton('barcsedit', lang('delete')) . '</form>';
         a_guide('answersedit');
     } else {
         include M_ROOT . $u_tplname;
     }
 } else {
     if (empty($selectid)) {
         amessage('pchoosecontent', M_REFERER);
     }
     $aedit = new cls_arcedit();
     $actuser = new cls_userinfo();
     $query = $db->query("SELECT aid,mid,checked FROM {$tblprefix}answers WHERE cid " . multi_str($selectid));
     while ($row = $db->fetch_array($query)) {
         $aedit->set_aid($row['aid']);
         $row['checked'] && $aedit->arc_nums('adopts', -1, 0);
         $aedit->arc_nums('answers', -1, 1);
         $aedit->init();
         $actuser->activeuser($row['mid']);
         $actuser->basedeal('answer', 0, 1, 1);
         $actuser->init();
     }
     $db->query("DELETE FROM {$tblprefix}answers WHERE cid " . multi_str($selectid), 'UNBUFFERED');
     adminlog(lang('answersetsucceed'), lang('answersetsucceed'));
     amessage('contentsetsucceed', "?entry=inarchive&action=answers&aid={$aid}{$param_suffix}&page={$page}{$filterstr}");
 }
コード例 #24
0
ファイル: debase.php プロジェクト: polarlight1989/08cms
<?php

include_once dirname(dirname(__FILE__)) . '/include/general.inc.php';
include_once M_ROOT . './include/common.fun.php';
include_once M_ROOT . './include/arcedit.cls.php';
$forward = empty($forward) ? M_REFERER : $forward;
$inajax = empty($inajax) ? 0 : 1;
$aid = empty($aid) ? 0 : max(0, intval($aid));
!$aid && cumessage('choosearchive');
!($commu = read_cache('commu', 1)) && cumessage('choosecommuitem');
if (empty($commu['ucadd'])) {
    !$curuser->pmbypmids('cuadd', $commu['setting']['apmid']) && cumessage('younoitempermis', $forward);
    if (empty($commu['setting']['repeat']) || !empty($commu['setting']['repeattime'])) {
        if (empty($m_cookie['08cms_cuid_' . $commu['cuid'] . '_' . $aid])) {
            msetcookie('08cms_cuid_' . $commu['cuid'] . '_' . $aid, '1', empty($commu['setting']['repeat']) ? 365 * 24 * 3600 : $commu['setting']['repeattime'] * 60);
        } else {
            cumessage(!empty($commu['setting']['repeat']) ? 'overquick' : 'norepeatoper', $forward);
        }
    }
    $aedit = new cls_arcedit();
    $aedit->set_aid($aid);
    $aedit->basic_data();
    !$aedit->aid && cumessage('choosearchive');
    !$aedit->archive['checked'] && cumessage('poinarcnoche');
    $aedit->arc_nums('debases', 1, 1);
    $curuser->basedeal('commu', 1, 1, 1);
    cumessage($inajax ? 'succeed' : 'operatesucceed', $forward);
} else {
    include M_ROOT . $commu['ucadd'];
}
コード例 #25
0
ファイル: archiveadd.php プロジェクト: polarlight1989/08cms
     $c_upload->closure(1);
     mcmessage('arcsaveerr', axaction(2, M_REFERER));
 } else {
     $c_upload->closure(1, $aid);
     $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);
     $aedit = new cls_arcedit();
     $aedit->set_aid($aid);
     $aedit->set_arcurl();
     $aedit->set_cpid($aid);
     if ($fields['keywords']['available'] && $channel['autokeyword'] && empty($aedit->archive['keywords'])) {
         include_once M_ROOT . "./include/splitword.cls.php";
         $a_split = new SplitWord();
         $aedit->autokeyword();
         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']));
     }
コード例 #26
0
ファイル: favorite.php プロジェクト: polarlight1989/08cms
<?php

include_once dirname(dirname(__FILE__)) . '/include/general.inc.php';
include_once M_ROOT . './include/common.fun.php';
include_once M_ROOT . './include/arcedit.cls.php';
$forward = empty($forward) ? M_REFERER : $forward;
$aid = empty($aid) ? 0 : max(0, intval($aid));
!$aid && cumessage('choosearchive');
!$memberid && cumessage('nousernofavoritepermis', $forward);
!($commu = read_cache('commu', 4)) && cumessage('choosecommuitem');
if (empty($commu['ucadd'])) {
    !$curuser->pmbypmids('cuadd', $commu['setting']['apmid']) && cumessage('younoitempermis', $forward);
    $aedit = new cls_arcedit();
    $aedit->set_aid($aid);
    $aedit->basic_data();
    !$aedit->aid && cumessage('choosearchive');
    !$aedit->archive['checked'] && cumessage('poinarcnoche', $forward);
    $curuser->sub_data();
    if (!empty($commu['setting']['max']) && $curuser->info['favorites'] >= $commu['setting']['max']) {
        cumessage('favoriteamooverlimit', $forward);
    }
    if ($db->result_one("SELECT COUNT(*) FROM {$tblprefix}favorites WHERE mid='{$memberid}' AND aid='{$aid}'")) {
        cumessage('archivealreadyfavorite', $forward);
    }
    $abnew = empty($a_edit->archive['abnew']) ? 0 : $a_edit->archive['abnew'];
    $db->query("INSERT INTO {$tblprefix}favorites SET mid='{$memberid}',aid='{$aid}',createdate='{$timestamp}',abnew='{$abnew}'", 'SILENT');
    //加入收藏记录
    $aedit->arc_nums('favorites', 1, 1);
    $curuser->basedeal('favorite', 1, 1, 1);
    cumessage($inajax ? 'succeed' : 'favoritesucceed', $forward);
} else {
コード例 #27
0
ファイル: follow.fun.php プロジェクト: polarlight1989/08cms
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);
}
コード例 #28
0
ファイル: sitemap.inc.php プロジェクト: polarlight1989/08cms
    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>";
}
コード例 #29
0
ファイル: orders.inc.php プロジェクト: polarlight1989/08cms
 //确认付款
 $order['state'] == 1 || !$order['state'] && $cfg_ordermode || mcmessage('cheordcanmod', $forward);
 empty($ordernew['paymode']) && @$ordernew['paymode'] !== '0' && mcmessage('paymodecerr', M_REFERER);
 empty($pmodearr[$ordernew['paymode']]) && mcmessage('paymodeerr', M_REFERER);
 $sqlstr = "state=-1,paymode={$ordernew['paymode']}";
 //-1为订单完成状态
 if ($ordernew['paymode'] == 1) {
     //现金帐户
     $curuser->info['currency0'] < $order['totalfee'] && mcmessage('pay_no_money');
     $curuser->updatecrids(array(0 => -$order['totalfee']), 1, lang('log_order_pay', $order['ordersn']));
     $order['tomid'] && $user->updatecrids(array(0 => $order['totalfee']), 1, lang('log_order_rev', $order['ordersn']));
     $sqlstr .= ",payed={$order['totalfee']}";
     $db->query("UPDATE {$tblprefix}orders SET {$sqlstr},updatedate='{$timestamp}' WHERE oid='{$oid}'");
     $query = $db->query("SELECT aid,tocid as cid,price,nums FROM {$tblprefix}purchases WHERE oid='{$oid}'");
     $nums = 0;
     $aedit = new cls_arcedit();
     while ($row = $db->fetch_array($query)) {
         $nums += $row['nums'];
         if ($row['cid']) {
             //商家商品
         } else {
             //网站商品
             //				$db->query("UPDATE {$tblprefix}archives SET orders=$row[nums],ordersum=$sum WHERE aid=$row[aid]");
             $aedit->init();
             $aedit->set_aid($row['aid']);
             $aedit->arc_nums('orders', $row['nums']);
             $aedit->arc_nums('ordersum', $row['price'] * $row['nums'], 1);
         }
     }
     $curuser->basedeal('purchase', 1, $nums, 1);
     mcmessage('orderpayfinish');
コード例 #30
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;
 }