Exemple #1
0
$arc = new cls_archive();
if (empty($auth)) {
    follow_dynamic($aid, 'down', $temparr);
    //统计全部统一到函数之中进行
} else {
    $midarr = explode("\t", authcode($auth, 'DECODE'));
    if ($midarr[0] == $memberid && $midarr[1] == $aid && $midarr[2] == $temparr['tname'] && $midarr[3] == $temparr['tmode'] && $midarr[4] == $temparr['fid']) {
        $arc->arcid($aid);
        $arc->detail_data();
        if (!$arc->aid) {
            message('choosearchive');
        }
        if (!$arc->archive['checked']) {
            message('poinarcnoche');
        }
        if (empty($temparr['tmode'])) {
            if ($temp = @unserialize($arc->archive[$temparr['tname']])) {
                $temp = @$temp[$temparr['fid']];
            }
        } else {
            $temp = @explode('#', $arc->archive[$temparr['tname']]);
        }
        $url = view_atmurl(@$temp['remote']);
        unset($temp);
        empty($url) && message('noattach');
        down_url($url);
        mexit();
    } else {
        message('attachdownerr');
    }
}
Exemple #2
0
    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>";
}
Exemple #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);
}
Exemple #4
0
 function fill_blank()
 {
     if ($this->tclass == 'images') {
         $this->item['url'] = $this->item['url_s'] = view_atmurl($this->tag['emptyurl']);
         $this->item['width'] = $this->tag['maxwidth'];
         $this->item['height'] = $this->tag['maxheight'];
         $this->cell_fill = 1;
     }
 }
include_once M_ROOT . "./include/upload.cls.php";
include_once M_ROOT . "./include/fields.cls.php";
$url_type = 'repus';
include 'urlsarr.inc.php';
url_nav(lang('repurelate'), $urlsarr, 'grade');
if (!submitcheck('brepugradesedit')) {
    $itemstr = '';
    tabheader(lang('repugradeadmin'), 'repugradesedit', '?entry=repugrades', '7');
    trcategory(array(lang('id'), lang('repugrade') . lang('cname'), lang('rgbase'), lang('available'), lang('ico'), lang('preview')));
    $query = $db->query("SELECT * FROM {$tblprefix}repugrades ORDER BY rgid ASC");
    while ($row = $db->fetch_array($query)) {
        $rgid = $row['rgid'];
        $validstr = empty($invalid) && (!isset($oldvalue) || $row['rgbase'] > $oldvalue) ? 'Y' : '-';
        $oldvalue = $row['rgbase'];
        $invalid = $validstr != '-' ? false : true;
        $thumbstr = $row['thumb'] ? "<img src=\"" . view_atmurl($row['thumb']) . "\" height=\"18\">" : '';
        echo "<tr class=\"txtcenter txt\"><td class=\"txtC\">{$rgid}</td>\n" . "<td class=\"txtC\"><input type=\"text\" size=\"25\" name=\"repugradesnew[{$rgid}][cname]\" value=\"{$row['cname']}\"></td>\n" . "<td class=\"txtC\"><input type=\"text\" size=\"5\" name=\"repugradesnew[{$rgid}][rgbase]\" value=\"{$row['rgbase']}\"></td>\n" . "<td class=\"txtC\">{$validstr}</td>\n" . "<td class=\"txtC\">";
        echo singlemodule("repugradesnew[{$rgid}][thumb]", $row['thumb'], 'image');
        echo "</td>\n" . "<td class=\"txtC\">{$thumbstr}</td>\n" . "</tr>\n";
    }
    tabfooter('brepugradesedit', lang('modify'));
    a_guide('repugradesedit');
} else {
    $c_upload = new cls_upload();
    foreach ($repugradesnew as $rgid => $repugrade) {
        $repugrade['rgbase'] = intval($repugrade['rgbase']);
        $repugrade['cname'] = trim($repugrade['cname']);
        $sqlstr = "rgbase='{$repugrade['rgbase']}'";
        $repugrade['cname'] && ($sqlstr .= ",cname='{$repugrade['cname']}'");
        $repugrade['thumb'] = upload_s($repugrade['thumb'], @$repugrades[$rgid]['thumb'], 'image');
        if ($k = strpos($repugrade['thumb'], '#')) {
     tabheader_e();
     echo "<tr><td class=\"txtL\">";
     echo lang('aidstxt') . "&nbsp; <input class=\"text\" name=\"aids\" type=\"text\" value=\"{$aids}\" style=\"vertical-align: middle;\">&nbsp; ";
     echo "<select style=\"vertical-align: middle;\" name=\"type\">" . makeoption($typearr, $type) . "</select>&nbsp; ";
     echo "<select style=\"vertical-align: middle;\" name=\"table\">" . makeoption($tabsarr, $table) . "</select>&nbsp; ";
     echo strbutton('bfilter', 'filter0') . '</td></tr>';
     tabfooter();
     $pagetmp = $page;
     do {
         $query = $db->query("SELECT * FROM {$tblprefix}userfiles {$wheresql} ORDER BY ufid DESC LIMIT " . ($pagetmp - 1) * $atpp . ",{$atpp}");
         $pagetmp--;
     } while (!$db->num_rows($query) && $pagetmp);
     $itemstr = '';
     while ($item = $db->fetch_array($query)) {
         $item['createdate'] = date("{$dateformat}", $item['createdate']);
         $item['preview'] = $item['type'] == 'image' ? "<a href=\"" . view_atmurl($item['url']) . "\" target=\"_blank\">" . lang('preview') . "</a>" : "-";
         $item['type'] = $typearr[$item['type']];
         $item['thumbedstr'] = $item['thumbed'] ? 'Y' : '-';
         $item['size'] = ceil($item['size'] / 1024);
         $item['source'] = $item['aid'] ? "<a href=\"?entry=" . $linkarr[$item['tid']] . "{$item['aid']}\" target=\"_blank\" onclick=\"return floatwin('open_editbyatt',this)\">" . lang('look') . "</a>" : "-";
         $itemstr .= "<tr class=\"txt\"><td class=\"txtC w40\"><input class=\"checkbox\" type=\"checkbox\" name=\"selectid['{$item['ufid']}']\" value=\"{$item['ufid']}\">\n" . "<td class=\"txtL\">{$item['filename']}</td>\n" . "<td class=\"txtC w40\">{$item['type']}</td>\n" . "<td class=\"txtC w50\">{$item['size']}</td>\n" . "<td class=\"txtC w40\">{$item['preview']}</td>\n" . "<td class=\"txtC w40\">{$item['thumbedstr']}</td>\n" . "<td class=\"txtC w80\">{$item['mname']}</td>\n" . "<td class=\"txtC w100\">{$item['createdate']}</td>\n" . "<td class=\"txtC w40\">{$item['source']}</td></tr>\n";
     }
     $itemcount = $db->result_one("SELECT count(*) FROM {$tblprefix}userfiles {$wheresql}");
     $multi = multi($itemcount, $atpp, $page, "?entry=userfiles&action=userfilesedit{$filterstr}");
     tabheader(lang('attalistdeloper') . "&nbsp;&nbsp;&nbsp;&nbsp;<input class=\"checkbox\" type=\"checkbox\" name=\"select_all\" value=\"1\">&nbsp;" . lang('selectallpage'), '', '', 9);
     trcategory(array("<input class=\"checkbox\" type=\"checkbox\" name=\"chkall\" class=\"category\" onclick=\"checkall(this.form, 'selectid', 'chkall')\">" . lang('del'), array(lang('cname'), 'txtL'), lang('type'), lang('sizek'), lang('preview'), lang('thumb'), lang('member'), lang('uploaddate'), lang('source')));
     echo $itemstr;
     tabfooter();
     echo $multi;
     echo "<br><input class=\"button\" type=\"submit\" name=\"buserfilesedit\" value=\"" . lang('submit') . "\"></form>";
 } else {
Exemple #7
0
        }
    }
}
$mode = 0;
if (empty($cnstr) || !isset($cnodes[$cnstr])) {
    $mode = 1;
    $cn_link = $cms_abs;
} else {
    if (!$curuser->pmbypmids('cread', cn_pmids($cnstr, $sid))) {
        exit(lang('nocatasbrowsepermis'));
    }
    $cnode = cnodearr($cnstr);
    $cn_link = $cnode['indexurl'];
}
$cn_name = mhtmlspecialchars($cn_name);
$rss_str = "<?xml version=\"1.0\" encoding=\"" . $mcharset . "\"?>\n" . "<rss version=\"2.0\">\n" . "  <channel>\n" . "    <title>{$cn_name}</title>\n" . "    <link>" . mhtmlspecialchars($archive['subject']) . "{$cn_link}</link>\n" . "    <description>Latest {$rss_num} archives of {$cn_name}</description>\n" . "    <copyright>Copyright(C) " . mhtmlspecialchars($cmsname) . "</copyright>\n" . "    <generator>www.08cms.com</generator>\n" . "    <lastBuildDate>" . date('r', $timestamp) . "</lastBuildDate>\n" . "    <ttl>{$rss_ttl}</ttl>\n" . "    <image>\n" . "      <url>" . view_atmurl($cmslogo) . "</url>\n" . "      <title>" . mhtmlspecialchars($cmsname) . "</title>\n" . "      <link>" . $cms_abs . "</link>\n" . "    </image>\n";
$cachefile = htmlcac_dir('rss', '', 1) . cac_namepre('rss', $cnstr) . '.php';
if ($timestamp - @filemtime($cachefile) > $rss_ttl * 60) {
    $rsscaches = rss_cache($sqlstr);
} else {
    include $cachefile;
}
foreach ($rsscaches as $aid => $archive) {
    $archive['arcurl'] = view_arcurl($archive);
    $rss_str .= "    <item>\n" . "      <title>" . mhtmlspecialchars($archive['subject']) . "</title>\n" . "      <link>{$archive['arcurl']}</link>\n" . "      <description><![CDATA[" . mhtmlspecialchars($archive['abstract']) . "]]></description>\n" . "      <category>{$cn_name}</category>\n" . "      <author>" . mhtmlspecialchars($archive['mname']) . "</author>\n" . "      <pubDate>" . date('r', $archive['createdate']) . "</pubDate>\n" . "    </item>\n";
}
$rss_str .= "  </channel>\n" . "</rss>";
mheader("Content-type: application/xml");
echo $rss_str;
exit;
function rss_cache($sqlstr = '')
Exemple #8
0
<?php

!defined('M_COM') && exit('No Permission');
load_cache('grouptypes,currencys,mchannels,commus,mcommus');
$curuser->sub_data();
$usergroupstr = '';
foreach ($grouptypes as $k => $v) {
    if ($curuser->info['grouptype' . $k]) {
        $usergroups = read_cache('usergroups', $k);
        $usergroupstr .= '<font class="cBlue">' . $usergroups[$curuser->info['grouptype' . $k]]['cname'] . '</font> &nbsp;';
    }
}
$repugradestr = lang('yourrepugrade') . ' : <font class="cBlue">' . $repugrades[$curuser->info['rgid']]['cname'] . ($repugrades[$curuser->info['rgid']]['thumb'] ? '&nbsp; <img src="' . view_atmurl($repugrades[$curuser->info['rgid']]['thumb']) . '" height="18">' : '') . '</font>';
$currencystr = lang('cashaccount') . ' : <font class="cRed">' . $curuser->info['currency0'] . '</font><font class="cBlue"> ' . lang('yuan') . '</font>&nbsp; ';
foreach ($currencys as $v) {
    $tmp = $curuser->info['currency' . $v['crid']];
    $currencystr .= " {$v['cname']} : <font class=\"cRed\">{$tmp}</font><font class=\"cBlue\"> {$v['unit']}</font>&nbsp; ";
}
$friendnum = $db->result_one("SELECT COUNT(*) FROM {$tblprefix}mfriends WHERE mid='{$memberid}' AND checked=1");
$friendstr = '';
$query = $db->query("SELECT * FROM {$tblprefix}mfriends WHERE mid='{$memberid}' AND checked=1 ORDER BY cid DESC LIMIT 0,10");
while ($row = $db->fetch_array($query)) {
    $friendstr .= "<li><a href=\"{$mspaceurl}index.php?mid={$row['fromid']}\" target=\"_blank\">{$row['fromname']}</a></li>";
}
$msgstr = '';
$row = $db->fetch_one("SELECT COUNT(pmid) AS pms,SUM(viewed) AS views FROM {$tblprefix}pms WHERE toid='{$memberid}'");
$msgstr .= '<tr><td>' . lang('receives') . lang('pm') . " : <font class=\"cRed\">{$row['pms']}</font></td>";
$msgstr .= '<td>' . lang('noread') . " : <font class=\"cRed\">" . ($row['pms'] - $row['views']) . "</font></td></tr>";
$query = $db->query("SELECT cuid,COUNT(cid) AS cids,SUM(uread) AS ureads FROM {$tblprefix}replys cu LEFT JOIN {$tblprefix}archives a ON cu.aid=a.aid WHERE a.mid='{$memberid}' GROUP BY cu.cuid");
while ($row = $db->fetch_array($query)) {
    $msgstr .= '<tr><td>' . lang('receives') . @$commus[$row['cuid']]['cname'] . " : <font class=\"cRed\">{$row['cids']}</font></td>";