function fcn_unstatic($fid = 0)
{
    global $db, $tblprefix, $freeinfos, $infohtmldir, $subsites;
    if (!$fid || empty($freeinfos[$fid]) || empty($freeinfos[$fid]['arcurl'])) {
        return;
    }
    m_unlink((empty($freeinfos[$fid]['sid']) ? $infohtmldir : $subsites[$freeinfos[$fid]['sid']]['dirname']) . '/' . substr($freeinfos[$fid]['arcurl'], 0, -6) . '{$page}.html');
    $db->query("UPDATE {$tblprefix}freeinfos SET arcurl='' WHERE fid={$fid}");
    return;
}
function marc_unstatic($maid = 0, $matid = 0)
{
    global $db, $tblprefix, $arc, $marchtmldir;
    if ($maid) {
        $arc->init();
        $arc->arcid($maid, $matid);
    }
    if (empty($arc->maid)) {
        return false;
    }
    if (!$arc->archive['arcurl']) {
        return true;
    }
    m_unlink($marchtmldir . '/' . substr($arc->archive['arcurl'], 0, -6) . '{$page}.html');
    $db->query("UPDATE {$tblprefix}marchives_{$arc->matid} SET arcurl='' WHERE maid='" . $arc->maid . "'");
    return true;
}
Beispiel #3
0
 function delete($isuser = 0)
 {
     //会员中心的删除
     global $db, $tblprefix, $marchtmldir;
     if (empty($this->maid)) {
         return;
     }
     if ($isuser && $this->archive['checked']) {
         return;
     }
     if ($this->archive['arcurl']) {
         m_unlink($marchtmldir . '/' . substr($this->archive['arcurl'], 0, -6) . '{$page}.html');
     }
     //删除相应的静态文件
     $db->query("DELETE FROM {$tblprefix}marchives_" . $this->archive['matid'] . " WHERE maid='" . $this->maid . "'", 'UNBUFFERED');
     $this->init();
 }
function arc_un_static($aid = 0, $addno = 0, $needwri = 1, $clearold = 0)
{
    global $db, $tblprefix, $arc, $archivecircle, $timestamp;
    if ($aid) {
        $arc->arcid($aid);
    }
    if (empty($arc->aid)) {
        return false;
    }
    $filepre = $arc->filepre($addno);
    $clearold && m_unlink($filepre);
    arc_blank($arc->aid, $addno, M_ROOT . m_parseurl($filepre, array('page' => 1)), 1);
    //强制将初始文件写入
    if ($needwri) {
        $arc->update_needstatic($addno, 1);
    }
    return true;
}
Beispiel #5
0
         $fromstr = empty($fromid) ? "" : "cnid>{$fromid}";
         $nwheresql = !$wheresql ? $fromstr ? "WHERE {$fromstr}" : "" : $wheresql . ($fromstr ? " AND " : "") . $fromstr;
         $query = $db->query("SELECT cnid,ename {$fromsql} {$nwheresql} ORDER BY cnid ASC LIMIT 0,{$atpp}");
         while ($item = $db->fetch_array($query)) {
             $selectid[] = $item['cnid'];
         }
     }
     if (empty($selectid)) {
         amessage('selectcnode', "?entry={$entry}&action={$action}{$param_suffix}&page={$page}{$filterstr}");
     }
 }
 if (!empty($cndeal['delete'])) {
     $query = $db->query("SELECT * {$fromsql} WHERE cnid " . multi_str($selectid));
     while ($r = $db->fetch_array($query)) {
         for ($i = 0; $i <= $r['addnum']; $i++) {
             m_unlink(m_parseurl(cn_format($r['ename'], $i, $r), array('addno' => $i)));
         }
     }
     $db->query("DELETE {$fromsql} WHERE cnid " . multi_str($selectid), 'UNBUFFERED');
 } else {
     if (!empty($cndeal['addnum'])) {
         $db->query("UPDATE {$tblprefix}cnodes SET addnum='" . min(empty($cn_max_addno) ? 0 : $cn_max_addno, max(0, intval($cnaddnum))) . "' WHERE cnid " . multi_str($selectid));
     }
     $tplarr = $wtplarr = $urlarr = $staticarr = $periodarr = array();
     for ($i = 0; $i <= $cn_max_addno; $i++) {
         foreach (array('tpl', 'wtpl', 'url', 'static', 'period') as $var) {
             if (!empty($cndeal[$var . $i])) {
                 ${$var . 'arr'}[$i] = ${'cn' . $var . $i};
             }
         }
     }
Beispiel #6
0
function index_unstatic($cnstr = '', $addno, $needwri = 1)
{
    global $sid;
    if ($cnstr) {
        if (!($cnode = read_cnode($cnstr, $sid))) {
            return;
        }
        $cnformat = cn_format($cnstr, $addno, $cnode);
    } else {
        $cnformat = idx_format($sid);
    }
    m_unlink($cnformat);
    if ($cnstr || $sid) {
        cn_blank($cnstr, $sid, $addno, 1);
    }
    $needwri && cn_update_needstatic($cnstr, $sid, $addno, 1);
    return true;
}
Beispiel #7
0
        $ocache = read_cache('ctag', $k, '', $nsid);
        cache2file($ocache, cache_name('ctag', $k), 'ctag', 0);
    }
    foreach ($ptags as $k => $v) {
        $ocache = read_cache('ptag', $k, '', $nsid);
        cache2file($ocache, cache_name('ptag', $k), 'ptag', 0);
    }
    foreach ($rtags as $k => $v) {
        $ocache = read_cache('rtag', $k, '', $nsid);
        cache2file($ocache, cache_name('rtag', $k), 'rtag', 0);
    }
    clear_dir(M_ROOT . $subsite['dirname'], true);
    //清除子站目录
    clear_dir(M_ROOT . "dynamic/cache/{$nsid}/", true);
    //清除子站缓存
    m_unlink($homedefault);
    //清除可能残留的静态首页
    $db->query("DELETE FROM {$tblprefix}subsites WHERE sid='{$nsid}'", 'SILENT');
    rebuild_cache(-1);
    adminlog(lang('subsittranstmsite'));
    amessage('subtramsifin', '?entry=subsites&action=subsitesedit');
} elseif ($action == 'subsitedel' && $nsid) {
    if (empty($confirm)) {
        $message = lang('delsubsite') . '<br><br>' . lang('del_alert') . "<br><br>";
        $message .= lang('confirmclick') . "[<a href=?entry=subsites&action=subsitedel&nsid=" . $nsid . "&confirm=1>" . lang('delete') . "</a>]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
        $message .= lang('giveupclick') . "[<a href=?entry=subsites&action=subsitesedit>" . lang('goback') . "</a>]";
        amessage($message);
    }
    if ($db->result_one("SELECT COUNT(*) FROM {$tblprefix}archives WHERE sid='{$nsid}'")) {
        amessage('subwitarccandel', '?entry=subsites&action=subsitesedit');
    }
Beispiel #8
0
 function arc_delete($isuser = 0)
 {
     //会员中心的删除
     global $db, $tblprefix, $infohtmldir;
     if (empty($this->aid)) {
         return;
     }
     $this->basic_data();
     if ($isuser && $this->archive['checked']) {
         return;
     }
     $this->archive['arcurl'] && m_unlink($infohtmldir . '/' . substr($this->archive['arcurl'], 0, -6) . '{$page}.html');
     //删除相应的静态文件
     $db->query("DELETE FROM {$tblprefix}consults WHERE aid='" . $this->aid . "'");
     //删除咨询交互的内容
     $customtable = 'farchives_' . $this->archive['chid'];
     $db->query("DELETE FROM {$tblprefix}{$customtable} WHERE aid='" . $this->aid . "'", 'UNBUFFERED');
     $db->query("DELETE FROM {$tblprefix}farchives WHERE aid='" . $this->aid . "'", 'UNBUFFERED');
     $this->init();
 }
function mindex_unstatic($cnstr = '', $addno = 0, $needwri = 1)
{
    m_unlink(mcn_format($cnstr, $addno));
    $cnstr && mcn_blank($cnstr, $addno, 1);
    $needwri && mcn_update_needstatic($cnstr, $addno, 1);
}
Beispiel #10
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;
 }