Ejemplo n.º 1
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);
}
Ejemplo n.º 2
0
include_once dirname(dirname(__FILE__)) . '/include/general.inc.php';
include_once M_ROOT . './include/common.fun.php';
include_once M_ROOT . './include/parse.fun.php';
$cmsclosed && message(empty($cmsclosedreason) ? lang('defaultclosedreason') : mnl2br($cmsclosedreason));
$mspacedisabled && message(lang('mspacedisabled'));
parse_str(un_virtual($_SERVER['QUERY_STRING']));
$mid = empty($mid) ? 0 : max(0, intval($mid));
$mcaid = empty($mcaid) ? 0 : max(0, intval($mcaid));
$ucid = empty($ucid) ? 0 : max(0, intval($ucid));
$page = empty($page) ? 1 : max(1, intval($page));
$addno = empty($addno) ? 0 : 1;
include_once M_ROOT . './include/mparse.fun.php';
$temparr = array('mid' => $mid, 'mcaid' => $mcaid, 'ucid' => $ucid);
$cnstr = ($mcaid ? "mcaid={$mcaid}" : '') . ($ucid ? "&ucid={$ucid}" : '');
if ($cachemscircle && (!$mslistcachenum || $page <= $mslistcachenum)) {
    $cachefile = htmlcac_dir('ms', 'm' . $mid % 100, 1) . cac_namepre($mid, $cnstr) . '_' . $page . '.php';
    if (is_file($cachefile) && filemtime($cachefile) > $timestamp - $cachemscircle * 60) {
        mexit(read_htmlcac($cachefile));
    }
}
$_da = array_merge($_da, mcn_parse($temparr));
$tplname = mcn_tpl($temparr, $addno);
if (!$tplname) {
    message('definereltem');
}
$_mp = array();
$_mp['durlpre'] = $_da['indexurl' . ($addno ? $addno : '')] . '&page={$page}';
$_mp['static'] = 0;
$_mp['nowpage'] = max(1, intval($page));
$_mp['s_num'] = $liststaticnum;
_aenter($_da, 1);
Ejemplo n.º 3
0
<?php

include_once './../include/general.inc.php';
include_once M_ROOT . './include/common.fun.php';
include_once M_ROOT . './include/archive.cls.php';
$cmsclosed && message(empty($cmsclosedreason) ? lang('defaultclosedreason') : mnl2br($cmsclosedreason));
$mspacedisabled && message(lang('mspacedisabled'));
parse_str(un_virtual($_SERVER['QUERY_STRING']));
$mid = empty($mid) ? 0 : max(0, intval($mid));
$cid = empty($cid) ? 0 : max(0, intval($cid));
$page = empty($page) ? 1 : max(1, intval($page));
empty($cid) && message('chooseproduct');
include_once M_ROOT . './include/mparse.fun.php';
if ($cachemscircle && (!$mslistcachenum || $page <= $mslistcachenum)) {
    $cachefile = htmlcac_dir('ms', 'm' . $mid % 100, 1) . cac_namepre($mid, 'product' . $cid) . '_' . $page . '.php';
    if (is_file($cachefile) && filemtime($cachefile) > $timestamp - $cachemscircle * 60) {
        mexit(read_htmlcac($cachefile));
    }
}
if (!($_offer = $db->fetch_one("SELECT * FROM {$tblprefix}offers WHERE cid='{$cid}' AND mid='{$mid}'"))) {
    message('chooseproduct');
}
$arc = new cls_archive();
if (!$arc->arcid($_offer['aid'])) {
    message('choosearchive');
}
if (!$arc->archive['checked'] && !$curuser->isadmin()) {
    message('poinarcnoche');
}
$tplname = ms_arctpl($arc->archive['chid'], 'product');
if (!$tplname) {
Ejemplo n.º 4
0
        $curuser->updatecrids($crids['total'], 0, lang('subscribearchive'));
        $curuser->payrecord($arc->aid, 0, $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('salearchive'));
            unset($actuser);
        }
    }
}
//读取缓存页面
if (!$enablestatic && $cache1circle) {
    $cachefile = htmlcac_dir($ispre ? 'pre' : 'arc', date('Ym', $arc->archive['createdate']), 1) . cac_namepre($arc->aid) . '_' . $page . '.php';
    if (is_file($cachefile) && filemtime($cachefile) > $timestamp - $cache1circle * 60) {
        mexit(read_htmlcac($cachefile));
    }
}
//分析模板来源
$tplname = $ispre ? $pretpl : arc_tplname($addno, $arc->archive['arctpls'], $arc->channel['arctpls']);
!$tplname && message('definereltem');
$arc->detail_data();
$durlpre = $arc->urlpre($addno);
$_da =& $arc->archive;
arc_parse($_da);
$_mp = array();
$_mp['durlpre'] = $durlpre;
$_mp['static'] = 0;
$_mp['nowpage'] = max(1, intval($page));
Ejemplo n.º 5
0
    $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));
    $_mp['static'] = 0;
    $_mp['nowpage'] = max(1, intval($page));
    $_mp['s_num'] = 0;
    //静态页数不限
    @extract($btags);
Ejemplo n.º 6
0
include_once './../include/general.inc.php';
include_once M_ROOT . './include/common.fun.php';
include_once M_ROOT . './include/archive.cls.php';
$cmsclosed && message(empty($cmsclosedreason) ? lang('defaultclosedreason') : mnl2br($cmsclosedreason));
$mspacedisabled && message(lang('mspacedisabled'));
parse_str(un_virtual($_SERVER['QUERY_STRING']));
$mid = empty($mid) ? 0 : max(0, intval($mid));
$aid = empty($aid) ? 0 : max(0, intval($aid));
$page = empty($page) ? 1 : max(1, intval($page));
$addno = empty($addno) ? 0 : min($arcplusnum, max(0, intval($addno)));
$addno = empty($addno) ? '' : $addno;
empty($aid) && message('choosearchive');
include_once M_ROOT . './include/mparse.fun.php';
if ($cachemscircle && (!$mslistcachenum || $page <= $mslistcachenum)) {
    $cachefile = htmlcac_dir('ms', 'm' . $mid % 100, 1) . cac_namepre($mid, 'archive' . $aid . $addno) . '_' . $page . '.php';
    if (is_file($cachefile) && filemtime($cachefile) > $timestamp - $cachemscircle * 60) {
        mexit(read_htmlcac($cachefile));
    }
}
$arc = new cls_archive();
if (!$arc->arcid($aid)) {
    message('choosearchive');
}
if (!$arc->archive['checked'] && !$curuser->isadmin()) {
    message('poinarcnoche');
}
$tplname = ms_arctpl($arc->archive['chid'], 'archive');
if (!$tplname) {
    message('definereltem');
}
Ejemplo n.º 7
0
    $nsid = 0;
}
switch_cache($nsid);
$sid = $nsid;
if_siteclosed($sid);
@extract($btags);
$cnstr = cnstr($temparr);
if ($cnstr && ($cnode = cnodearr($cnstr, $sid))) {
    if (!$curuser->pmbypmids('cread', cn_pmids($cnstr, $sid))) {
        message('nocatabrowseperm');
    }
} else {
    $cnstr = '';
    $addno = 0;
}
$cache1circle && ($cachefile = htmlcac_dir('cn', '', 1) . cac_namepre($cnstr, $addno) . '_' . $page . '.php');
if ($cache1circle && is_file($cachefile) && filemtime($cachefile) > $timestamp - $cache1circle * 60) {
    mexit(read_htmlcac($cachefile));
}
$_da = array();
if (!$cnstr) {
    $tplname = !$sid ? $hometpl : $btags['hometpl'];
    $_da['rss'] = $cms_abs . 'rss.php' . ($sid ? "?sid={$sid}" : '');
} else {
    $_da = cn_parse($cnstr, $sid, -1);
    re_cnode($_da, $cnstr, $cnode);
    $tplname = cn_tplname($cnstr, $cnode, $addno);
    $statics = empty($cnode['statics']) ? array() : explode(',', $cnode['statics']);
    $enablestatic = empty($statics[$addno]) ? $enablestatic : ($statics[$addno] == 1 ? 0 : 1);
}
empty($tplname) && message('definereltem');
Ejemplo n.º 8
0
<?php

include_once dirname(dirname(__FILE__)) . '/include/general.inc.php';
include_once M_ROOT . './include/common.fun.php';
if (empty($tname)) {
    mexit();
}
$_da = empty($data) ? array() : $data;
$querystr = md5($_SERVER['QUERY_STRING']);
$refarr = @parse_url($_SERVER['HTTP_REFERER']);
if (!$jsrefsource || empty($refarr['host']) || in_array($refarr['host'], explode("\r\n", $jsrefsource))) {
    if ($cachejscircle && empty($is_p)) {
        $cachefile = htmlcac_dir('js', '', 1) . cac_namepre($querystr) . '.php';
        if (is_file($cachefile) && filemtime($cachefile) > $timestamp - $cachejscircle * 60) {
            js_write(read_htmlcac($cachefile));
            mexit();
        }
    }
    @extract($btags);
    @extract($_da);
    _aenter($_da, 1);
    ob_clean();
    @(include M_ROOT . "template/{$templatedir}/pcache/js" . (empty($is_p) ? '' : '_p') . "_{$tname}.php");
    $_content = ob_get_contents();
    ob_clean();
    js_write($_content);
    $cachejscircle && empty($is_p) && save_htmlcac($_content, $cachefile);
}
mexit();
function tpl_permission($pmid = 0)
{
Ejemplo n.º 9
0
function rss_cache($sqlstr = '')
{
    global $db, $tblprefix, $rss_num, $sqlstr, $cnstr, $cotypes;
    $sqlstr = "WHERE checked=1" . (empty($sqlstr) ? '' : ' AND ') . $sqlstr;
    $query = $db->query("SELECT * FROM {$tblprefix}archives {$sqlstr} ORDER BY aid DESC LIMIT 0,{$rss_num}");
    while ($row = $db->fetch_array($query)) {
        $row['abstract'] = cutstr(html2text($row['abstract']), 255);
        $rsscaches[$row['aid']] = $row;
    }
    rsscache2file($rsscaches, cac_namepre('rss', $cnstr));
    return $rsscaches;
}