Exemple #1
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');
Exemple #2
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);
}