⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 typeunit.class.admin.php

📁 这是matlab的一个小程序
💻 PHP
📖 第 1 页 / 共 2 页
字号:
				if($step==" ")
				{
					$stepdd = 2;
				}
				else
				{
					$stepdd = 3;
				}
				$rank = $row->sortrank;
				if($row->ishidden=='1')
				{
					$nss = "<font color='red'>[隐]</font>";
				}
				else
				{
					$nss = "";
				}

				//普通列表
				if($ispart==0)
				{
					echo "<tr height='24' oncontextmenu=\"CommonMenu(event,this,$id,'".urlencode($typeName)."')\">\r\n";
					echo "<td class='nbline'>";
					echo "<table width='98%' border='0' cellspacing='0' cellpadding='0'>";
					echo "<tr onMouseMove=\"javascript:this.bgColor='#FAFCE0';\" onMouseOut=\"javascript:this.bgColor='#FFFFFF';\"><td width='50%'>";
					echo "<input class='np' type='checkbox' name='tids[]' value='{$id}'><a href='catalog_do.php?cid=".$id."&dopost=listArchives'>$step ·{$nss}".$typeName."[ID:".$id."]</a>(文档:".$this->GetTotalArc($id).")  <a onclick=\"AlertMsg('快捷编辑窗口','$id');\" href=\"javascript:;\"><img src='img/write2.gif'/></a>";
					echo "</td><td align='right'>";
					echo "<a href='{$GLOBALS['cfg_phpurl']}/list.php?tid={$id}' target='_blank'>预览</a>";
					echo "|<a href='catalog_do.php?cid={$id}&dopost=listArchives'>内容</a>";
					echo "|<a href='catalog_add.php?id={$id}'>增加子类</a>";
					echo "|<a href='catalog_edit.php?id={$id}'>更改</a>";
					echo "|<a href='catalog_move.php?job=movelist&typeid={$id}'>移动</a>";
					echo "|<a href='catalog_del.php?id={$id}&typeoldname=".urlencode($typeName)."'>删除</a>";
					echo "&nbsp; <input type='text' name='sortrank{$id}' value='{$rank}' style='width:25;height:16'></td></tr></table></td></tr>\r\n";
				}

				//封面频道
				else if($ispart==1)
				{
					echo " <tr height='24' oncontextmenu=\"CommonMenu(event,this,$id,'".urlencode($typeName)."')\">\r\n";
					echo "<td class='nbline'><table width='98%' border='0' cellspacing='0' cellpadding='0'><tr onMouseMove=\"javascript:this.bgColor='#FAFCE0';\" onMouseOut=\"javascript:this.bgColor='#FFFFFF';\"><td width='50%'>";
					echo "<input class='np' type='checkbox' name='tids[]' value='{$id}'><a href='catalog_do.php?cid=".$id."&dopost=listArchives'>$step ·{$nss}".$typeName."[ID:".$id."]</a>  <a onclick=\"AlertMsg('快捷编辑窗口','$id');\" href=\"javascript:;\"><img src='img/write2.gif'/></a>";
					echo "</td><td align='right'>";
					echo "<a href='{$GLOBALS['cfg_phpurl']}/list.php?tid={$id}' target='_blank'>预览</a>";
					echo "|<a href='catalog_do.php?cid={$id}&dopost=listArchives'>内容</a>";
					echo "|<a href='catalog_add.php?id={$id}'>增加子类</a>";
					echo "|<a href='catalog_edit.php?id={$id}'>更改</a>";
					echo "|<a href='catalog_move.php?job=movelist&typeid={$id}'>移动</a>";
					echo "|<a href='catalog_del.php?id={$id}&typeoldname=".urlencode($typeName)."'>删除</a>";
					echo "&nbsp; <input type='text' name='sortrank{$id}' value='{$rank}' style='width:25;height:16'></td></tr></table></td></tr>\r\n";
				}

				//独立页面
				else if($ispart==2)
				{
					echo "<tr height='24' oncontextmenu=\"SingleMenu(event,this,$id,'".urlencode($typeName)."')\">\r\n";
					echo "<td class='bline2'><table width='98%' border='0' cellspacing='0' cellpadding='0'>";
					echo "<tr onMouseMove=\"javascript:this.bgColor='#FAFCE0';\" onMouseOut=\"javascript:this.bgColor='#FFFFFF';\"><td width='50%'>";
					echo "<input class='np' type='checkbox' name='tids[]' value='{$id}'><a href='catalog_do.php?cid=".$id."&dopost=listArchives'>$step ·{$nss}".$typeName."[ID:".$id."]</a>  <a onclick=\"AlertMsg('快捷编辑窗口','$id');\" href=\"javascript:;\"><img src='img/write2.gif'/></a>";
					echo "</td><td align='right'>";
					echo "<a href='{$typeDir}' target='_blank'>预览</a>";
					echo "|<a href='catalog_edit.php?id={$id}'>更改</a>";
					echo "|<a href='catalog_move.php?job=movelist&typeid={$id}'>移动</a>";
					echo "|<a href='catalog_del.php?id={$id}&typeoldname=".urlencode($typeName)."'>删除</a>";
					echo "&nbsp; <input type='text' name='sortrank{$id}' value='{$rank}' style='width:25;height:16'></td></tr></table></td></tr>\r\n";
				}
				$this->LogicListAllSunType($id,$step." ");
			}
		}
	}

	//-----返回与某个目相关的下级目录的类目ID列表(删除类目或文章时调用)
	function GetSunTypes($id,$channel=0)
	{
		$this->dsql = $GLOBALS['dsql'];
		$this->idArray[$this->idCounter]=$id;
		$this->idCounter++;
		$fid = $id;
		if($channel!=0)
		{
			$csql = " And channeltype=$channel ";
		}
		else
		{
			$csql = "";
		}
		$this->dsql->SetQuery("Select id From `#@__arctype` where reid=$id $csql");
		$this->dsql->Execute("gs".$fid);

		//if($this->dsql->GetTotalRow("gs".$fid)!=0)
		//{
		while($row=$this->dsql->GetObject("gs".$fid))
		{
			$nid = $row->id;
			$this->GetSunTypes($nid,$channel);
		}
		//}
		return $this->idArray;
	}

	//删除类目
	function DelType($id,$isDelFile)
	{
		$this->idCounter = 0;
		$this->idArray = "";
		$this->GetSunTypes($id);
		$query = "
		Select #@__arctype.*,#@__channeltype.typename as ctypename,
		#@__channeltype.addtable
		From `#@__arctype` left join #@__channeltype
		on #@__channeltype.id=#@__arctype.channeltype
		where #@__arctype.id='$id'
		";
		$typeinfos = $this->dsql->GetOne($query);
		$topinfos = $this->dsql->GetOne("Select moresite,siteurl From `#@__arctype` where id='".$typeinfos['topid']."'");
		if(!is_array($typeinfos))
		{
			return false;
		}
		$indir = $typeinfos['typedir'];
		$addtable = $typeinfos['addtable'];
		$ispart = $typeinfos['ispart'];
		$defaultname = $typeinfos['defaultname'];

		//删除数据库里的相关记录
		foreach($this->idArray as $id)
		{
			$myrow = $this->dsql->GetOne("Select * From `#@__arctype` where id='$id'");
			if($myrow['topid']>0)
			{
				$mytoprow = $this->dsql->GetOne("Select moresite,siteurl From `#@__arctype` where id='".$myrow['topid']."'");
				if(is_array($mytoprow) && !empty($mytoprow))
				{
					foreach($mytoprow as $k=>$v)
					{
						if(!ereg("[0-9]",$k))
						{
							$myrow[$k] = $v;
						}
					}
				}
			}

			//删除目录和目录里的所有文件 ### 禁止了此功能
			//删除单独页面
			if($myrow['ispart']==2 && $myrow['typedir']=='')
			{
				if( is_file($this->baseDir.'/'.$myrow['defaultname']) )
				{
					@unlink($this->baseDir.'/'.$myrow['defaultname']);
				}
			}

			//删除数据库信息
			$this->dsql->ExecuteNoneQuery("Delete From `#@__arctype` where id='$id'");
			$this->dsql->ExecuteNoneQuery("Delete From `#@__arctiny` where typeid='$id'");
			$this->dsql->ExecuteNoneQuery("Delete From `#@__archives` where typeid='$id'");
			$this->dsql->ExecuteNoneQuery("Delete From `#@__spec` where typeid='$id'");
			$this->dsql->ExecuteNoneQuery("Delete From `#@__feedback` where typeid='$id'");
			if($addtable!="")
			{
				$this->dsql->ExecuteNoneQuery("Delete From $addtable where typeid='$id'");
			}
		}

		//删除目录和目录里的所有文件 ### 禁止了此功能
		//删除单独页面
		if($ispart==2 && $indir=="")
		{
			if( is_file($this->baseDir."/".$defaultname) )
			{
				@unlink($this->baseDir."/".$defaultname);
			}
		}
		@reset($this->idArray);
		$this->idCounter = 0;
		return true;
	}

	//---- 删除指定目录的所有文件
	function RmDirFile($indir)
	{
		if(!file_exists($indir)) return;
		$dh = dir($indir);
		while($file = $dh->read())
		{
			if($file == "." || $file == "..")
			{
				continue;
			}
			else if(is_file("$indir/$file"))
			{
				@unlink("$indir/$file");
			}
			else
			{
				$this->RmDirFile("$indir/$file");
			}
			if(is_dir("$indir/$file"))
			{
				@rmdir("$indir/$file");
			}
		}
		$dh->close();
		return(1);
	}
}
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -