Example #1
0
function arc_static($aid = 0, $addno = 0, $needwri = 1)
{
    //可能需要多个页面同时进行
    global $db, $tblprefix, $arc, $sid, $timestamp, $cms_abs, $enablestatic, $archivecircle, $templatedir, $G, $_no_dbhalt, $btags, $mconfigs, $_mp, $_actid, $_midarr, $_a_vars, $_a_var, $mpnav, $mptitle, $mpstart, $mpend, $mppre, $mpnext, $mppage, $mpcount, $mpacount;
    if ($aid) {
        $arc->arcid($aid);
    }
    if (empty($arc->aid) || $addno > $arc->channel['addnum']) {
        return false;
    }
    @extract($mconfigs, EXTR_SKIP);
    switch_cache($arc->archive['sid']);
    $sid = $arc->archive['sid'];
    @extract($btags);
    $tplname = arc_tplname($addno, $arc->archive['arctpls'], $arc->channel['arctpls']);
    $staticarr = empty($arc->channel['statics']) ? array() : explode(',', $arc->channel['statics']);
    $nenablestatic = empty($staticarr[$addno]) ? $enablestatic : ($staticarr[$addno] == 1 ? 0 : 1);
    if (!$nenablestatic || !arc_allowstatic($arc->archive) || !$tplname) {
        arc_un_static(0, $addno, $needwri, 1);
        return false;
    }
    $arc->detail_data();
    $surlpre = $arc->urlpre($addno, 1);
    $filepre = $arc->filepre($addno);
    $_da =& $arc->archive;
    arc_parse($_da);
    $_o_content = ob_get_contents();
    ob_clean();
    $_no_dbhalt = true;
    $pcount = 1;
    for ($_pp = 1; $_pp <= $pcount; $_pp++) {
        $_mp = $G = array();
        $_mp['surlpre'] = $surlpre;
        $_mp['static'] = 1;
        $_mp['nowpage'] = $_pp;
        _aenter($_da, 1);
        extract($_da, EXTR_OVERWRITE);
        tpl_refresh($tplname);
        @(include M_ROOT . "template/{$templatedir}/pcache/{$tplname}.php");
        $_content = ob_get_contents();
        ob_clean();
        $_content .= "<script language=\"javascript\" src=\"" . $cms_abs . "tools/static.php?mode=arc&aid={$aid}" . ($addno ? "&addno={$addno}" : '') . ($sid ? "&sid={$sid}" : '') . "\"></script>";
        $arcfile = m_parseurl($filepre, array('page' => $_pp));
        str2file($_content, M_ROOT . $arcfile);
        unset($_content);
        $pcount = @$_mp['pcount'];
    }
    echo $_o_content;
    unset($_o_content);
    $_no_dbhalt = false;
    if ($needwri) {
        $arc->update_needstatic($addno, 1);
    }
    return true;
}
Example #2
0
<?php

define('WAP_MODE', 1);
include dirname(dirname(__FILE__)) . '/include/general.inc.php';
include 'wap.fun.php';
parse_str(un_virtual($_SERVER['QUERY_STRING']), $temparr);
//处理子站id
$nsid = empty($temparr['sid']) ? 0 : max(0, intval($temparr['sid']));
if ($nsid && empty($subsites[$nsid])) {
    $nsid = 0;
}
switch_cache($nsid);
$sid = $nsid;
if_siteclosed($sid);
if (!$action) {
    wap_header(wap_lang('wap_login'), '', 0);
    $memberid && message('wap_login_re_ok', 'back');
    echo wap_lang('wap_username') . '<br/><input name="username" size="15" emptyok="false"/><br/>' . wap_lang('wap_password') . '<br/><input name="password" size="15" emptyok="false"/><br/>' . '<br/><a href="?action=submit' . $wap_string . '&amp;username=$(username)&amp;password=$(password)&amp;forward=' . M_REFERER . '">' . wap_lang('wap_justlogin') . '</a><br/>' . $link;
    wap_footer();
} elseif ($action == 'submit') {
    wap_header(wap_lang('wap_login'), '', 0);
    if (!$username || !$password) {
        message('wap_empty_input', 'back');
    }
    include M_ROOT . 'include/admin.fun.php';
    strlen($username = trim($username)) < 3 && message('wap_member_name_fail', 'back');
    if (!$password || $password != addslashes($password)) {
        message('wap_password_fail', 'back');
    }
    $guestexp = '\\xA1\\xA1|^Guest|^\\xD3\\xCE\\xBF\\xCD|\\xB9\\x43\\xAB\\xC8';
    preg_match("/^\\s*\$|^c:\\con\\con\$|[%,\\*\"\\s\t\\<\\>\\&]|{$guestexp}/is", $username) && message('wap_member_name_fail', 'back');
Example #3
0
function follow_dynamic($aid = 0, $mode = 'down', $temparr = array())
{
    global $db, $tblprefix, $arc, $sptpls, $memberid, $sid, $timestamp, $cms_abs, $cache1circle, $currencys, $curuser, $templatedir, $btags, $mconfigs, $_mp, $_actid, $_midarr, $_a_vars, $_a_var, $mpnav, $mptitle;
    @extract($mconfigs, EXTR_SKIP);
    $arc->arcid($aid);
    if (empty($arc->aid)) {
        message(lang('confchoosarchi'));
    }
    !$arc->archive['checked'] && message(lang('poinarchnoch'));
    switch_cache($arc->archive['sid']);
    $sid = $arc->archive['sid'];
    if_siteclosed($sid);
    if (!arc_allow($arc->archive, 'down')) {
        message(lang('noarchivbrowpermis'));
    }
    if ($crids = $arc->arc_crids(1)) {
        //需要对当前用户扣值
        $cridstr = '';
        foreach ($crids['total'] as $k => $v) {
            $cridstr .= ($cridstr ? ',' : '') . abs($v) . $currencys[$k]['unit'] . $currencys[$k]['cname'];
        }
        $commu = read_cache('commu', 8);
        if (empty($commu['setting']['autoatm'])) {
            //不自动扣值的情况:提示出订阅链接,选择是否订阅
            message(lang('subattachwanpaycur') . $cridstr . "<br><br><a href=\"{$cms_abs}tools/subscribe.php?aid={$aid}&isatm=1\">>>" . lang('subscribe') . "</a>");
        } else {
            //自动扣值,当前会员扣值及向出售者支付积分
            if (!$curuser->crids_enough($crids['total'])) {
                message(lang('subattachwanpaycur') . $cridstr . lang('younosuatwaencur'));
            }
            $curuser->updatecrids($crids['total'], 0, lang('subsattach'));
            $curuser->payrecord($arc->aid, 1, $cridstr, 1);
            if (!empty($crids['sale'])) {
                $actuser = new cls_userinfo();
                $actuser->activeuser($arc->archive['mid']);
                foreach ($crids['sale'] as $k => $v) {
                    $crids['sale'][$k] = -$v;
                }
                $actuser->updatecrids($crids['sale'], 1, lang('saleattach'));
                unset($actuser);
            }
        }
    }
    $arc->detail_data();
    $_da =& $arc->archive;
    arc_parse($_da);
    if (empty($temparr['tmode'])) {
        if ($temp = @unserialize($_da[$temparr['tname']])) {
            $temp = @$temp[$temparr['fid']];
        }
    } else {
        $temp = @explode('#', $arc->archive[$temparr['tname']]);
    }
    $_da['url'] = view_atmurl(@$temp['remote']);
    $_da['player'] = @$temp['player'];
    unset($temp);
    empty($_da['url']) && message(lang('noattach'));
    save_nums($aid, $mode);
    //统计下载或播放数
    if (!($tplname = $sptpls[$mode])) {
        follow_notpl($mode, $_da['url'], $_da['player']);
    }
    if ($mode == 'down') {
        $auth = authcode($memberid . "\t" . $aid . "\t" . $temparr['tname'] . "\t" . $temparr['tmode'] . "\t" . $temparr['fid'], 'ENCODE');
        $_da['trueurl'] = $cms_abs . "tools/down.php?auth={$auth}&aid=" . $arc->aid . "&tname={$temparr['tname']}&tmode={$temparr['tmode']}&fid={$temparr['fid']}";
        //真实下载地址
    } elseif ($cache1circle) {
        $auth = authcode($temparr['tname'] . "\t" . $temparr['tmode'] . "\t" . $temparr['fid'], 'ENCODE');
        $cachefile = htmlcac_dir('fw', date('Ym', $arc->archive['createdate']), 1) . cac_namepre($arc->aid, $arc->archive['createdate']) . '_' . $auth . '.php';
        if (is_file($cachefile) && filemtime($cachefile) > $timestamp - $cache1circle * 60) {
            mexit(read_htmlcac($cachefile));
        }
    }
    _aenter($_da, 1, array('url', 'player'));
    @extract($btags);
    extract($_da, EXTR_OVERWRITE);
    tpl_refresh($tplname);
    @(include M_ROOT . "template/{$templatedir}/pcache/{$tplname}.php");
    $_content = ob_get_contents();
    ob_clean();
    if ($cache1circle && $mode != 'down') {
        save_htmlcac($_content, $cachefile);
    }
    mexit($_content);
}
Example #4
0
$page = empty($page) ? 1 : max(1, intval($page));
empty($aid) && message('choosearchive');
$aid = max(0, intval($aid));
$arc = new cls_archive();
if (!$arc->arcid($aid)) {
    message('choosearchive');
}
if (!$arc->archive['checked'] && !$curuser->isadmin()) {
    message('poinarcnoche');
}
$addno = empty($addno) ? 0 : max(0, intval($addno));
if ($addno > $arc->channel['addnum']) {
    $addno = 0;
}
//分析所在子站
switch_cache($arc->archive['sid']);
$sid = $arc->archive['sid'];
if_siteclosed($sid);
//分析权限与扣积分,文章出售
$ispre = 0;
//是否启动前导页
$pretpl = $arc->channel['pretpl'];
if (!arc_allow($arc->archive, 'aread')) {
    //分析权限,如果有备用页,则进入备用页。
    if (!$pretpl) {
        message('noarchbrowspermis');
    }
    $ispre = 1;
}
if ($crids = $arc->arc_crids()) {
    //需要对当前用户扣值
Example #5
0
         tpl_refresh($tplname);
         @(include M_ROOT . "template/{$templatedir}/pcache/{$tplname}.php");
         $_content = ob_get_contents();
         ob_clean();
         mexit($_content);
     }
 } else {
     $inajax ? aheader() : _header();
     if (!regcode_pass('archive', empty($regcode) ? '' : trim($regcode))) {
         mcmessage('safecodeerr', axaction(2, M_REFERER));
     }
     if (empty($archiveadd['caid']) || !($catalog = @$acatalogs[$archiveadd['caid']])) {
         mcmessage('choosecatalog', axaction(2, M_REFERER));
     }
     if ($sid != $catalog['sid']) {
         switch_cache($catalog['sid']);
         $sid = $catalog['sid'];
     }
     $sqlmain = "sid='{$sid}',\n\t\tcaid='{$archiveadd['caid']}',\n\t\tchid='{$chid}',\n\t\tmid='{$memberid}',\n\t\tmname='" . $curuser->info['mname'] . "',\n\t\tcreatedate='{$timestamp}',\n\t\trefreshdate='{$timestamp}'";
     $pre_cns = array();
     $pre_cns['caid'] = $archiveadd['caid'];
     //分析分类的定义及权限
     foreach ($cotypes as $k => $v) {
         if (!$v['self_reg'] && !in_array($k, $ccoids) && !in_array("ccid{$k}", $additems)) {
             $archiveadd["ccid{$k}"] = empty($archiveadd["ccid{$k}"]) ? '' : $archiveadd["ccid{$k}"];
             if ($v['notblank'] && !$archiveadd["ccid{$k}"]) {
                 mcmessage('setcoclass', axaction(2, M_REFERER), $v['cname']);
             }
             //必选类系
             $sqlmain .= ",ccid{$k} = '" . $archiveadd["ccid{$k}"] . "'";
             if ($archiveadd["ccid{$k}"]) {
Example #6
0
    _aenter($_da, 1);
    tpl_refresh($tplname);
    @(include M_ROOT . "template/{$templatedir}/pcache/{$tplname}.php");
    $_content = ob_get_contents();
    ob_clean();
    $cache1circle && save_htmlcac($_content, $cachefile);
    mexit($_content);
} elseif ($fid) {
    //独立页的页面
    $addid = empty($addid) ? '' : trim($addid);
    //附加参数,用于独立页面
    if (empty($freeinfos[$fid])) {
        message('definerelaisopage');
    }
    //分析所属子站
    switch_cache($freeinfos[$fid]['sid']);
    $sid = $freeinfos[$fid]['sid'];
    if_siteclosed($sid);
    if (!$addid && $cache1circle && (!$listcachenum || $page <= $listcachenum)) {
        //带附加参数则不缓存
        $cachefile = htmlcac_dir('farc', '', 1) . cac_namepre($fid) . '_' . $page . '.php';
        if (is_file($cachefile) && filemtime($cachefile) > $timestamp - $cache1circle * 60) {
            mexit(read_htmlcac($cachefile));
        }
    }
    if (!($tplname = $freeinfos[$fid]['tplname'])) {
        message('definereltem');
    }
    $_da = array('fid' => $fid, 'sid' => $sid, 'addid' => $addid);
    $_mp = array();
    $_mp['durlpre'] = view_url(en_virtual('info.php?fid=' . $fid . ($addid ? "&addid={$addid}" : '') . '&page={$page}', 1));
Example #7
0
}
$allsite = empty($allsite) ? 0 : 1;
//用于区别主站与整站的搜索
//搜索资料初始化
$wherestr = "WHERE a.checked=1";
$filterstr = '';
//分页链接的附加参数字串
$fromstr = "FROM {$tblprefix}archives AS a";
//只有区分模型才可以查找模型字段
$_da = array('sid' => $sid, 'allsite' => $allsite);
//处理子站及整站
$wherestr .= $allsite ? '' : " AND a.sid={$sid}";
if ($allsite) {
    $filterstr .= ($filterstr ? '&' : '') . "allsite={$allsite}";
} elseif ($sid) {
    switch_cache($sid);
    $filterstr .= ($filterstr ? '&' : '') . "sid={$sid}";
}
//栏目因素
$caid = empty($caid) ? 0 : max(0, intval($caid));
$_da['caid'] = $caid;
$_da['catalog'] = '';
if ($caid) {
    $_da['catalog'] = $catalogs[$caid]['title'];
    if ($cnsql = cnsql(0, cnsonids($caid, $catalogs), 'a.')) {
        $wherestr .= " AND {$cnsql}";
    }
    $filterstr .= ($filterstr ? '&' : '') . "caid={$caid}";
}
//分类因素
foreach ($cotypes as $k => $v) {
Example #8
0
             ${'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);
     foreach (array('ccoids', 'citems', 'coidscp', 'cpkeeps', 'useredits') as $var) {
         ${$var} = $channel[$var] ? explode(',', $channel[$var]) : array();
     }
     if (!submitcheck('barchivedetail')) {
         if (empty($u_tplname)) {
             //显示端不限控制权限,添加时,或审后是否允许修改,都显示出来。