Exemple #1
0
     ShowMsg("你没有权限删除这篇文档!", "-1");
     exit;
 }
 if ($row['arcrank'] >= 0) {
     $dtime = time();
     $maxtime = $cfg_mb_editday * 24 * 3600;
     if ($dtime - $row['senddate'] > $maxtime) {
         ShowMsg("这篇文档已经锁定,你不能再删除它!", "-1");
         exit;
     }
 }
 $channelid = $row['channel'];
 $row['litpic'] = isset($arr['litpic']) ? $arr['litpic'] : '';
 //删除文档
 if ($row['issystem'] != -1) {
     $rs = DelArc($aid);
 } else {
     $rs = DelArcSg($aid);
 }
 //删除缩略图
 if (trim($row['litpic']) != '' && preg_match("#^" . $cfg_user_dir . "/{$cfg_ml->M_ID}#", $row['litpic'])) {
     $dsql->ExecuteNoneQuery("DELETE FROM `#@__uploads` WHERE url LIKE '{$row['litpic']}' AND mid='{$cfg_ml->M_ID}' ");
     @unlink($cfg_basedir . $row['litpic']);
 }
 if ($ENV_GOBACK_URL == 'content_list.php?channelid=') {
     $ENV_GOBACK_URL = $ENV_GOBACK_URL . $channelid;
 }
 if ($rs) {
     //更新用户记录
     countArchives($channelid);
     //扣除积分
            $dsql->SetQuery($q1);
            $dsql->Execute();
            $rownum = $dsql->GetTotalRow();
            if ($rownum < 2) {
                continue;
            }
            $i = 1;
            while ($row = $dsql->GetObject()) {
                $i++;
                $naid = $row->id;
                $ntitle = $row->title;
                if ($i > $rownum) {
                    continue;
                }
                $totalarc++;
                DelArc($naid, 'OFF');
            }
        }
        $dsql->executenonequery(" OPTIMIZE TABLE `{$maintable}`; ");
        ShowMsg("一共删除了[{$totalarc}]篇重复的文档!", "javascript:;");
        exit;
    }
}
//向导页
$channelinfos = array();
$dsql->setquery("select id,typename,maintable,addtable from `#@__channeltype` ");
$dsql->execute();
while ($row = $dsql->getarray()) {
    $channelinfos[] = $row;
}
include DedeInclude('templets/article_test_same.htm');
	CheckPurview('a_Del,a_AccDel,a_MyDel,sys_ArcBatch');
	require_once(dirname(__FILE__)."/../include/pub_oxwindow.php");
	if(empty($fmdo)) $fmdo = "";
	if($fmdo=="yes")
	{
	  if( $aid!="" && !ereg("(".$aid."`|`".$aid.")",$qstr) ) $qstr .= "`".$aid;
	  if($qstr==""){
	  	ShowMsg("参数无效!",$ENV_GOBACK_URL);
	  	exit();
	  }
	  $qstrs = explode("`",$qstr);
	  $okaids = Array();
	  $dsql = new DedeSql(false);
	  foreach($qstrs as $aid){
	  	echo $channelid;
	    if(!isset($okaids[$aid])) DelArc($aid,false,$channelid);
	    else $okaids[$aid] = 1;
    }
    $dsql->Close();
    ShowMsg("成功删除指定的文档!",$ENV_GOBACK_URL);
	  exit();
  }//确定刪除操作完成

  //删除确认消息
  //-----------------------
	$wintitle = "文档管理-删除文档";
	$wecome_info = "<a href='".$ENV_GOBACK_URL."'>文档管理</a>::删除文档";
	$win = new OxWindow();
	$win->Init("archives_do.php","js/blank.js","POST");
	$win->AddHidden("fmdo","yes");
	$win->AddHidden("dopost",$dopost);
     $fmdo = '';
 }
 $recycle = empty($recycle) ? "" : $recycle;
 if ($fmdo == 'yes') {
     if (!empty($aid) && empty($qstr)) {
         $qstr = $aid;
     }
     if ($qstr == '') {
         ShowMsg("参数无效!", "recycling.php");
         exit;
     }
     $qstrs = explode("`", $qstr);
     $okaids = array();
     foreach ($qstrs as $aid) {
         if (!isset($okaids[$aid])) {
             DelArc($aid, "OK", "", $recycle);
         } else {
             $okaids[$aid] = 1;
         }
     }
     ShowMsg("成功删除指定的文档!", "recycling.php");
     exit;
 } else {
     $wintitle = "文档管理-删除文档";
     $wecome_info = "<a href='recycling.php'>文档管理</a>::删除文档";
     $win = new OxWindow();
     $win->Init("archives_do.php", "js/blank.js", "POST");
     $win->AddHidden("fmdo", "yes");
     $win->AddHidden("dopost", $dopost);
     $win->AddHidden("qstr", $qstr);
     $win->AddHidden("aid", $aid);
             }
             if ($tdd > 0) {
                 $jumpurl = "makehtml_archives_action.php?endid={$endid}&startid={$startid}";
                 $jumpurl .= "&typeid={$newtypeid}&pagesize=20&seltime={$seltime}";
                 $jumpurl .= "&stime=" . urlencode($starttime) . "&etime=" . urlencode($endtime);
                 ShowMsg("成功移动 {$tdd} 条记录,准备重新生成HTML...", $jumpurl);
             } else {
                 ShowMsg("完成操作,没移动任何数据...", "javascript:;");
             }
         } else {
             if ($action == 'delnulltitle') {
                 $dsql->SetQuery("SELECT id FROM #@__archives WHERE trim(title)='' ");
                 $dsql->Execute('x');
                 $tdd = 0;
                 while ($row = $dsql->GetObject('x')) {
                     if (DelArc($row->id)) {
                         $tdd++;
                     }
                 }
                 ShowMsg("成功删除 {$tdd} 条记录!", "javascript:;");
                 exit;
             } else {
                 if ($action == 'modddpic') {
                     $dsql->ExecuteNoneQuery("UPDATE #@__archives SET litpic='' WHERE trim(litpic)='litpic' ");
                     ShowMsg("成功修正缩略图错误!", "javascript:;");
                     exit;
                 }
             }
         }
     }
 }
  	$dsql->Close();
    ShowMsg("你不能把数据移动到非最终列表的栏目!","javascript:;");
	  exit();
  }
  if($typenew->channeltype!=$typeold->channeltype){
  	$dsql->Close();
    ShowMsg("不能把数据移动到内容类型不同的栏目!","javascript:;");
	  exit();
  }
  $gwhere .= " And channel='".$typenew['channeltype']."'";
  $dsql->SetQuery("Select ID From #@__archives $gwhere");
  $dsql->Execute('m');
  $tdd = 0;
  while($row = $dsql->GetObject('m')){
	 	 $rs = $dsql->ExecuteNoneQuery("Update #@__archives set typeid='$newtypeid' where ID='{$row->ID}'");
	   if($rs) $tdd++;
	   DelArc($row->ID,true);
	}
  $dsql->Close();
  if($tdd>0)
  {
  	$jumpurl  = "makehtml_archives_action.php?endid=$endid&startid=$startid";
    $jumpurl .= "&typeid=$newtypeid&pagesize=20&seltime=$seltime";
    $jumpurl .= "&stime=".urlencode($starttime)."&etime=".urlencode($endtime);
  	ShowMsg("成功移动 $tdd 条记录,准备重新生成HTML...",$jumpurl);
  }
  else ShowMsg("完成操作,没移动任何数据...","javascript:;");
	exit();
}
ClearAllLink();
?>
Exemple #7
0
     $fmdo = '';
 }
 //确定刪除操作完成
 if ($fmdo == 'yes') {
     if (!empty($aid) && empty($qstr)) {
         $qstr = $aid;
     }
     if ($qstr == '') {
         ShowMsg("参数无效!", "recycling.php");
         exit;
     }
     $qstrs = explode("`", $qstr);
     $okaids = array();
     foreach ($qstrs as $aid) {
         if (!isset($okaids[$aid])) {
             DelArc($aid, "OK");
         } else {
             $okaids[$aid] = 1;
         }
     }
     ShowMsg("成功删除指定的文档!", "recycling.php");
     exit;
 } else {
     $wintitle = "文档管理-删除文档";
     $wecome_info = "<a href='recycling.php'>文档管理</a>::删除文档";
     $win = new OxWindow();
     $win->Init("archives_do.php", "js/blank.js", "POST");
     $win->AddHidden("fmdo", "yes");
     $win->AddHidden("dopost", $dopost);
     $win->AddHidden("qstr", $qstr);
     $win->AddHidden("aid", $aid);
		 else{
		 	  $title = addslashes(urldecode($title));
		 	  $q1 = "Select ID,title From $maintable where channel='$channelid' and title='$title' $orderby ";
		 }
		 $dsql->SetQuery($q1);
		 $dsql->Execute();
		 $rownum = $dsql->GetTotalRow();
		 if($rownum<2) continue;
		 $i = 1;
		 while($row = $dsql->GetObject()){
		 	 $i++;
		 	 $naid = $row->ID;
		 	 $ntitle = $row->title;
		 	 if($i > $rownum){ continue; }
		 	 $totalarc++;
		 	 DelArc($naid);
		 }
	}
	$dsql->executenonequery("OPTIMIZE TABLE `$maintable`");
	$dsql->Close();
	ShowMsg("一共删除了[{$totalarc}]篇重复的文档!","javascript:;");
	exit();
}

$channelinfos = array();
$dsql->setquery("select ID,typename,maintable,addtable from #@__channeltype");
$dsql->execute();
while($row = $dsql->getarray())
{
	$channelinfos[] = $row;
}
<?php 
require_once(dirname(__FILE__)."/config.php");
require_once(dirname(__FILE__)."/../include/inc_typelink.php");
require_once(dirname(__FILE__)."/inc/inc_batchup.php");
$squery = "select aid from #@__addonarticle where body like '%/plus/img/etag.gif%' ";

$dsql = new DedeSql(false);

$dsql->SetQuery($squery);
$dsql->Execute();

while($row = $dsql->GetArray()){
   $aid = $row['aid'];
   DelArc($aid);
   header("Content-Type: text/html; charset={$cfg_ver_lang}");
   echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset={$cfg_ver_lang}\">\r\n";
   echo "删除 $aid OK<br>";
}

ClearAllLink();

?>