示例#1
0
 function filepre($addno = 0)
 {
     return m_parseurl(arc_format($this->archive), array('addno' => arc_addno($addno, $this->channel['addnos'])));
 }
示例#2
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;
}
示例#3
0
 function arc_delete($isuser = 0)
 {
     global $db, $tblprefix, $enablestatic, $cotypes;
     if (empty($this->aid)) {
         return false;
     }
     $this->basic_data();
     if ($isuser && $this->archive['checked']) {
         return false;
     }
     //删除相应的txt存储文本
     $this->detail_data();
     foreach ($this->namepres as $k) {
         txtunlink($k);
     }
     $wherestr = "WHERE aid='" . $this->aid . "'";
     foreach (array('comments', 'favorites', 'subscribes', 'answers', 'arecents', 'purchases', 'offers', 'replys') as $var) {
         //????????????????
         $db->query("DELETE FROM {$tblprefix}{$var} {$wherestr}", 'UNBUFFERED');
     }
     $db->query("DELETE FROM {$tblprefix}albums WHERE aid='" . $this->aid . "' OR pid='" . $this->aid . "'", 'UNBUFFERED');
     //合辑关系全部删除
     //删除相关已生成的静态文件
     $arcurl = arc_format($this->archive);
     for ($i = 1; $i <= $this->channel['addnum']; $i++) {
         m_unlink(m_parseurl($arcurl, array('addno' => $i)));
     }
     $db->query("DELETE FROM {$tblprefix}archives_" . $this->archive['chid'] . " {$wherestr}", 'UNBUFFERED');
     $db->query("DELETE FROM {$tblprefix}archives_sub {$wherestr}", 'UNBUFFERED');
     $db->query("DELETE FROM {$tblprefix}archives_rec {$wherestr}", 'UNBUFFERED');
     $db->query("DELETE FROM {$tblprefix}archives {$wherestr}", 'UNBUFFERED');
     //数量统计
     $this->auser->basedeal('archive', 0);
     $this->archive['checked'] && $this->auser->basedeal('check', 0);
     $uploadsize = 0;
     $query = $db->query("SELECT * FROM {$tblprefix}userfiles WHERE tid='1' AND aid='" . $this->aid . "'");
     while ($item = $db->fetch_array($query)) {
         $ufile = local_file($item['url']);
         @unlink($ufile);
         clear_dir($ufile . '_s', true);
         $uploadsize += ceil($item['size'] / 1024);
     }
     $this->auser->updateuptotal($uploadsize, 'reduce', 1);
     $db->query("DELETE FROM {$tblprefix}userfiles {$wherestr}", 'UNBUFFERED');
     $this->init();
     return true;
 }