Beispiel #1
0
 function arcid($aid)
 {
     global $db, $tblprefix;
     $this->init();
     $aid = max(0, intval($aid));
     if (!($this->archive = $db->fetch_one("SELECT a.*,s.*,r.* FROM {$tblprefix}archives a LEFT JOIN {$tblprefix}archives_sub s ON s.aid=a.aid LEFT JOIN {$tblprefix}archives_rec r ON r.aid=a.aid WHERE a.aid='{$aid}'"))) {
         return false;
     }
     $this->channel = read_cache('channel', $this->archive['chid']);
     $this->fields = read_cache('fields', $this->archive['chid']);
     cache_merge($this->channel, 'channel', $this->archive['sid']);
     arc_checkend($this->archive);
     $this->aid = $this->archive['aid'];
     return true;
 }
Beispiel #2
0
 function basic_data($auser = 1)
 {
     global $db, $tblprefix, $catalogs, $channels, $enablestatic;
     if (empty($this->aid) || $this->basiced) {
         return;
     }
     if (!($this->archive = $db->fetch_one("SELECT a.*,s.*,r.* FROM {$tblprefix}archives a LEFT JOIN {$tblprefix}archives_sub s ON s.aid=a.aid LEFT JOIN {$tblprefix}archives_rec r ON r.aid=a.aid WHERE a.aid=" . $this->aid))) {
         $this->init();
         return;
     }
     $this->channel = read_cache('channel', $this->archive['chid']);
     $this->fields = read_cache('fields', $this->archive['chid']);
     arc_checkend($this->archive);
     $this->fetch_txt(0);
     if ($auser) {
         $this->auser = new cls_userinfo();
         $this->auser->activeuser($this->archive['mid']);
     }
     $this->basiced = 1;
 }
Beispiel #3
0
function view_arcurl(&$archive, $addno = 0)
{
    //$addno-1为全部页面,不返回
    global $cnhtmldir, $enablestatic, $subsites, $arccustomurl, $wap_suffix, $mspaceurl;
    $channel = read_cache('channel', $archive['chid']);
    arc_checkend($archive);
    $addarr = $addno > 0 ? array($addno) : array(0);
    if ($addno == -1) {
        for ($i = 1; $i <= $channel['addnum']; $i++) {
            $addarr[] = $i;
        }
    }
    if (defined('WAP_MODE')) {
        foreach ($addarr as $k) {
            $archive['arcurl' . ($k ? $k : '')] = view_url("wap/archive.php?aid={$archive['aid']}" . ($k ? "&addno={$k}" : '') . $wap_suffix);
        }
    }
    if (!empty($archive['jumpurl'])) {
        foreach ($addarr as $k) {
            $archive['arcurl' . ($k ? $k : '')] = $archive['jumpurl'];
        }
        if ($addno == -1) {
            $archive['marcurl'] = $archive['jumpurl'];
        }
    } else {
        $staticarr = empty($channel['statics']) ? array() : explode(',', $channel['statics']);
        $novuarr = empty($channel['novus']) ? array() : explode(',', $channel['novus']);
        $arcurl = arc_format($archive);
        foreach ($addarr as $k) {
            if (empty($staticarr[$k]) ? $enablestatic : ($staticarr[$k] == 1 ? 0 : 1)) {
                $archive['arcurl' . ($k ? $k : '')] = view_url(m_parseurl($arcurl, array('addno' => arc_addno($k, $channel['addnos']), 'page' => 1)));
            } else {
                $archive['arcurl' . ($k ? $k : '')] = view_url(en_virtual("archive.php?aid={$archive['aid']}" . ($k ? "&addno={$k}" : ''), 1, @$novuarr[$k]));
            }
        }
        if ($addno == -1) {
            $archive['marcurl'] = $mspaceurl . en_virtual("archive.php?mid=" . @$archive['mid'] . "&aid={$archive['aid']}", 1);
        }
    }
    return $addno >= 0 ? $archive['arcurl' . ($addno ? $addno : '')] : true;
}