<?php
   /*-----------------------------------------------------
   * 管理面板主程序admin/index.php
   * auther:coldwind
   * OurHome:http://iwind.org
   * 著作权所有，不得侵犯
   * 
   * */
   require"../include/IWUpload.php";
   require"../include/functions.php";
   require"../data/config.php";
   require"../include/$language.php";
   //+-------------
   	     if(file_exists("../data/sort/list.php")){
		      require"../data/sort/list.php";
		 }
   ///////初始化///////////////
   session_start();
   session_unregister("soft_session");
   if(empty($page)){
       $page="1";
   }
   ///////////////////////////
   $myfile=new IWFile();
   $myupload=new IWUpload();
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="doc/index.css" type="text/css">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<table width="750" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td bgcolor="efefef">欢迎来到管理面板</td>
  </tr>
</table>
<table width="750" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr> 
    <td  width="205" valign="top"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" background="../image/page_bg.gif">
        <tr> 
          <td> 
            <div align="center">== 类别管理 ==</div>
          </td>
        </tr>
        <tr> 
          <td> 
            <div align="center"><a href="?action=cate">大类管理</a></div>
          </td>
        </tr>
        <tr> 
          <td> 
            <div align="center"><a href="?action=sort">小类管理</a></div>
          </td>
        </tr>
        <tr> 
          <td> 
            <div align="center"><a href="?action=topic">专题管理</a></div>
          </td>
        </tr>
        <tr> 
          <td> 
            <div align="center">== 软件管理 ==</div>
          </td>
        </tr>
        <tr> 
          <td> 
            <div align="center"><a href="?action=list">软件列表</a></div>
          </td>
        </tr>
        <tr> 
          <td> 
            <div align="center"><a href="?action=software"><font color="#FF0000">软件添加</font></a></div>
          </td>
        </tr>
        <tr> 
          <td> 
            <div align="center"><a href="?action=rating">评论管理</a></div>
          </td>
        </tr>
        <tr> 
          <td> 
            <div align="center">== 系统设置 ==</div>
          </td>
        </tr>
        <tr> 
          <td> 
            <div align="center"><a href="?action=usual">常规设置</a></div>
          </td>
        </tr>
        <tr> 
          <td> 
            <div align="center"><a href="?action=system">公告管理</a></div>
          </td>
        </tr>
        <tr> 
          <td> 
            <div align="center">== 登陆选项 ==</div>
          </td>
        </tr>
        <tr> 
          <td> 
            <div align="center"><a href="?action=logout">退出登陆</a></div>
          </td>
        </tr>
        <tr> 
          <td> 
            <div align="center"></div>
          </td>
        </tr>
        <tr> 
          <td> 
            <div align="center"></div>
          </td>
        </tr>
        <tr> 
          <td> 
            <div align="center"></div>
          </td>
        </tr>
      </table>
    </td>
    <td width="544" valign="top">
	<!--   PHP SCRIPTS START -->
<?php
	if($user_login_sess["name"]!=$adminname||$user_login_sess["pass"]!=$adminpass){
	  if($action!="login"){
	       $action=nologin;
		   }
	}
       else{
        @session_register("user_login_sess");
		$user_login_sess["name"]=$adminname;
		$user_login_sess["pass"]=$adminpass;
       }
	/////////////显示首页/////////////////////////
	if(empty($action)){
	     echo"请从左边选择管理选项";
	}
	/////////////登陆程式/////////////////////////
	else if($action=="nologin"){
	   require"doc/login.html";
	}
	///登陆判断//////////////////////////////////
	else if($action=="login"){
	    $name=trim($name);
		$pass=trim($pass);
		if($name!=$adminname||$pass!=$adminpass){
		   GoIn("index.php?action=nologin","登陆失败，请返回");
		   exit;
		}
		session_register("user_login_sess");
		$user_login_sess["name"]=$name;
		$user_login_sess["pass"]=$pass;
		echo"请从左边选择管理选项";
	}
	//////////大类管理首页/////////////////////////
	else if($action=="cate"){
	     if(file_exists("../data/sort/list.php")){
		      require"../data/sort/list.php";
		 }
	     $array=@$myfile->arrayfromfile("../data/sort/sort.php","\n");
		 $total=sizeof($array)-1;
	     require"doc/cate.html";
	}
	//大类添加动作
	else if($action=="cate_add"){
	     $newcate=trim($newcate);
		 if($newcate==""){
		   goback("-1","大类名不能为空");
		   exit;
		 }
		 $time=UpNum("0");
		 $myfile->writetofile("../data/sort/sort.php","$time\n","a+");
		 $myfile->writetofile("../data/sort/list.php","<?\$sort$time='$newcate';?>","a+");
		 goback("-1","大类 $newcate 添加成功,请返回");
	}
	//大类修改动作
	else if($action=="cate_edit"){
	     $newcate=trim($newcate);
		 if($newcate==""){
		    goback("-1","新的大类名不能为空");
			exit;
		 }
		 require"../data/sort/list.php";
		 $data=$myfile->readfromfile("../data/sort/list.php","r");
		 $newdata=ereg_replace("$oldcate='${sort.$oldcate}'","$oldcate='$newcate'",$data);
		 $myfile->writetofile("../data/sort/list.php",$newdata,"w+");
		 goback("-1","类别修改成功,请返回");
	}
	//大类删除动作
	else if($action=="cate_del"){
	   /* --------- from sort.php ------*/
	      list($cate_time,$id)=explode("|",$cate_id);
		  $array=$myfile->arrayfromfile("../data/sort/sort.php","\n");
		  if($array[$id]!=$cate_time){
		     goback("-1","请把此大类下的小类删除");
			 exit;
		  }
		 $myfile->deletefromfile("../data/sort/sort.php",$id,"\n");
		 /* ------  from list.php --------------*/
		 require"../data/sort/list.php";
		 $data=$myfile->readfromfile("../data/sort/list.php","r");
		 $newdata=str_replace("<?\$sort$cate_time='${sort.$cate_time}';?>","",$data);
		 $myfile->writetofile("../data/sort/list.php",$newdata,"w+");
		 goback("-1","删除成功,请返回");
	}
	//大类交换位置
	else if($action=="cate_exchange"){
	    $arr=$myfile->arrayfromfile("../data/sort/sort.php","\n");
		$t=$arr[$cate1];
		$arr[$cate1]=$arr[$cate2];
		$arr[$cate2]=$t;
		$data=implode("\n",$arr);
		$myfile->writetofile("../data/sort/sort.php",$data,"w+");
		goback("-1","操作成功,请返回");
	}
	///////////////////////////小类管理////////////////////////////
	//显示首页
	else if($action=="sort"){
	    $array=$myfile->arrayfromfile("../data/sort/sort.php","\n");
		$total=sizeof($array)-1;
		if(file_exists("../data/sort/list.php")){
		    require"../data/sort/list.php";
			}
	    require"doc/sort.html";
	}
	//添加小类到数据库
	else if($action=="sort_add"){
	    $newsort=trim($newsort);
		if($newsort==""){
		   goback("-1","小类名称不能为空");
		   exit;
		}
		$time=UpNum("1");
		$array=$myfile->arrayfromfile("../data/sort/sort.php","\n");
		$array[$cate_id].="|$time";
		$myfile->editfile("../data/sort/sort.php","$cate_id","\n",$array[$cate_id]);
	    $myfile->writetofile("../data/sort/list.php","<?\$sort$time='$newsort';?>","a+");
		goback("-1","小类 $newsort 添加成功,请返回");
	}
	//修改小类
	else if($action=="sort_edit"){
		  $newsort=trim($newsort);
		 if($newsort==""){
		    goback("-1","新的大类名不能为空");
			exit;
		 }
		 require"../data/sort/list.php";
		 $data=$myfile->readfromfile("../data/sort/list.php","r");
		 $newdata=str_replace("$sort_time='${sort.$sort_time}'","$sort_time='$newsort'",$data);
		 $myfile->writetofile("../data/sort/list.php",$newdata,"w+");
		 goback("-1","类别修改成功,请返回");    
	}
	//位置交换
	else if($action=="sort_exchange"){
	    $time=time(0);
	    $data=$myfile->readfromfile("../data/sort/sort.php");
		$data=str_replace($new,$time,$data);
		$data=str_replace($old,$new,$data);
		$data=str_replace($time,$old,$data);
		$myfile->writetofile("../data/sort/sort.php",$data,"w+");
		goback("-1","操作成功,请返回");
	}
	//删除小类
	else if($action=="sort_del"){
	/*--------------------删除所含软件-------------------------------*/
	     $arr=$myfile->arrayfromfile("../data/sort.php","\n");
	     $sortarr=ArrSectString($arr,$sort_id);
		 $hitarr=$myfile->arrayfromfile("../data/hit.php","\n");
		 $rating=$myfile->arrayfromfile("../data/rating.php","\n");
		 $mainarr=$myfile->arrayfromfile("../data/main.php","\n");
		 $total=sizeof($keys);
         foreach($sortarr as $key=>$value){
		   $myfile->deletefromfile("../data/hit.php",$key,"\n");
		   $myfile->deletefromfile("../data/rating.php",$key,"\n");
		   list(,,,,$pid)=explode("|%|",$mainarr[$key]);
		   $info=$myfile->readfromfile("../data/main/$pid.php");
			list($name,$env,$mod,$size,$date,$link,$user,$p_addr,$s_addr,$brief,$time)=explode("|%|",$info);
			@unlink("../$p_addr");
			@unlink("../$s_addr");
			@unlink("../data/main/$pid.php");
			$myfile->deletefromfile("../data/reply.php",$key,"\n");
			$myfile->deletefromfile("../data/main.php",$key,"\n");
			$myfile->deletefromfile("../data/sort.php",$key,"\n");
			$myfile->deletefromfile("../data/topic.php",$key,"\n");
		 }
	     /*--------------- 从sort.php 中删除 ----------------*/
		 $data=$myfile->readfromfile("../data/sort/sort.php");
		 $newdata=str_replace("|$sort_id","",$data);
		 $myfile->writetofile("../data/sort/sort.php",$newdata,"w+");
		 /*-------------- 从list.php 中删除------------------*/
		 require"../data/sort/list.php";
		 $data1=$myfile->readfromfile("../data/sort/list.php","r");
		 $newdata1=str_replace("<?\$sort$sort_id='${sort.$sort_id}';?>","",$data1);
		 $myfile->writetofile("../data/sort/list.php","$newdata1","w+");
		 goback("-1","删除成功,请返回");    
	}
	////////////////////////////软件添加////////////////////
	//显示首页
	else if($action==software){
	    $array=$myfile->arrayfromfile("../data/sort/sort.php","\n");
		$topic_arr=$myfile->arrayfromfile("../data/sort/topic.php","\n");
		$total=sizeof($array)-1;
		@require"../data/sort/list.php";
        require"doc/software.html";
	}
	//软件添加
	else if($action=="soft_add"){
	    $name=trim($name);
		$addr=trim($addr);
		$brief=ubb($brief);
		session_register("soft_session");
		$soft_session["name"]=$name;
		$soft_session["addr"]=$addr;
		$soft_session["brief"]=$brief;
		if($name==""){
		  goback("-1","软件名称不能为空");
		  exit;
		}
		if($addr==""&&$file=="none"){
		  goback("-1","软件上传或下载地址二者必须有其一");
		  exit;
		}
		if($brief==""){
		  $brief="没有简介!";
		}
		$time=UpNum("3");
		///////
		if($photo!="none"&&$photo!=""){
		    $myupload->allowtype="|gif|jpg|jpeg|bmp|png|";
			if($myupload->check_type($photo_name)){
		    $p_ext=$myupload->file_extence($photo_name);
		    $myupload->copy_file($photo,"../upload/photo/$time.$p_ext");
			$p_addr="upload/photo/$time.$p_ext";
			}
			else{
			goback("-1","上传的图片不合法");
			exit;
			}
		}
		if($file!="none"&&$file!=""){
		    $myupload->allowsize="150000";
			if($myupload->check_size($file)){
		    $s_ext=$myupload->file_extence($file_name);
		    $myupload->copy_file($file,"../upload/software/$time.$s_ext");
			$s_addr="upload/software/$time.$s_ext";
			}
			else{
			goback("-1","上传的软件已经超过1M");
			exit;
			}
		}
	   else{
	       $s_addr=$addr;
	   }
		
		$link=str_replace("\n","",$link);
		$tmp="$name|%|$env|%|$mod|%|$size|%|$date|%|$link|%|$user|%|$p_addr|%|$s_addr|%|$brief|%|$time";
		$index_brief=GetString($brief,"100");
        $temp="$name|%|$date|%|$link|%|$index_brief|%|$time";
		$myfile->writetofile("../data/sort.php",$sort."\n","a+");
		$myfile->writetofile("../data/rating.php",$rating."\n","a+");
		$myfile->writetofile("../data/hit.php",$hit."\n","a+");
                $myfile->writetofile("../data/view.php","0\n","a+");
		$myfile->writetofile("../data/main.php",$temp."\n","a+");
		$myfile->writetofile("../data/main/$time.php","$tmp","w+");
		$myfile->writetofile("../data/topic.php","$topic_id\n","a+");
        $myfile->writetofile("../data/reply.php","\n","a+");
	    goback("-1","软件添加成功，请返回");	
	}
	/////////////////////////软件列表///////////////////////////////////////////////////
	else if($action=="list"){
	  if(file_exists("../data/sort/list.php")){
	     require"../data/sort/list.php";
	  }
	  $sortarr=$myfile->arrayfromfile("../data/sort.php","\n");
	  $mainarr=$myfile->arrayfromfile("../data/main.php","\n");
	  $ratingarr=$myfile->arrayfromfile("../data/rating.php","\n");
	  $hitarr=$myfile->arrayfromfile("../data/hit.php","\n");
	  $total_item=sizeof($mainarr)-1;
	  $pagenum=ceil($total_item/$adminpage);
	   $pagestart=$total_item-1-$adminpage*($page-1);
       $pageend=$total_item-$adminpage*$page;
	  require"doc/list.html";
	}
	//删除条目
	else if($action=="list_del"){
	    $myfile->deletefromfile("../data/hit.php",$id,"\n");
            $myfile->deletefromfile("../data/view.php",$id,"\n");
		$myfile->deletefromfile("../data/rating.php",$id,"\n");
		$myfile->deletefromfile("../data/sort.php",$id,"\n");
		$mainarr=$myfile->arrayfromfile("../data/main.php","\n");
		list($name,$env,$mod,$size,$date,$link,$user,$p_addr,$s_addr,$brief,$time)=explode("|%|",$mainarr[$id]);
                $p_addr_arr=explode("|",$p_addr);
                for($i=0;$i<sizeof($p_addr_arr);$i++){
		    @unlink("../$p_addr_arr[$i]");
                }
		@unlink("../$s_addr");
		@unlink("../data/main/$pid.php");
		$myfile->deletefromfile("../data/main.php",$id,"\n");
		$myfile->deletefromfile("../data/topic.php",$id,"\n");
                $myfile->deletefromfile("../data/reply.php",$id,"\n");
		goback("-1","删除成功,请返回");
	}
	//修改条目
	else if($action=="list_edit"){
	  if(file_exists("../data/sort/list.php")){
	     require"../data/sort/list.php";
	  }
	  $topic_arr=$myfile->arrayfromfile("../data/sort/topic.php","\n");
	  $array=$myfile->arrayfromfile("../data/sort/sort.php","\n");
	  $total=sizeof($array)-1;
	  $sortarr=$myfile->arrayfromfile("../data/sort.php","\n");
	  $mainarr=$myfile->arrayfromfile("../data/main.php","\n");
	  $ratingarr=$myfile->arrayfromfile("../data/rating.php","\n");
	  $hitarr=$myfile->arrayfromfile("../data/hit.php","\n");
      $topicarr=$myfile->arrayfromfile("../data/topic.php","\n");
	  $info=$myfile->readfromfile("../data/main/$pid.php");
	  list($name,$env,$mod,$size,$date,$link,$user,$p_addr,$s_addr,$brief,$time)=explode("|%|",$info);
	  $sort_id=$sortarr[$id];
	  require"doc/edit.html";
	}
	//执行修改动作
	else if($action=="list_edit1"){
	  ////-----------------------------
	    if($photo!="none"&&$photo!=""){
		     @unlink("../$p_addr");
		    $myupload->allowtype="|gif|jpg|jpeg|bmp|png|";
			if($myupload->check_type($photo_name)){
		    $p_ext=$myupload->file_extence($photo_name);
		    $myupload->copy_file($photo,"../upload/photo/$time.$p_ext");
			$p_addr="upload/photo/$time.$p_ext";
			}
			else{
			goback("-1","上传的图片不合法");
			exit;
			}
		}
		if($file!="none"&&$file!=""){
		     @unlink("../$s_addr");
		    $myupload->allowsize="1000000";
			if($myupload->check_size($file)){
		    $s_ext=$myupload->file_extence($file_name);
		    $myupload->copy_file($file,"../upload/software/$time.$s_ext");
			$s_addr="upload/software/$time.$s_ext";
			}
			else{
			goback("-1","上传的软件已经超过1M");
			exit;
			}
		}
	   else{
	       $s_addr=$addr;
	   }
	  //------------------------------
		$link=str_replace("\n","",$link);
        $brief=str_replace("\n","",$brief);
        $brief=str_replace("\r","",$brief);
		$tmp="$name|%|$env|%|$mod|%|$size|%|$date|%|$link|%|$user|%|$p_addr|%|$s_addr|%|$brief|%|$time";
		$index_brief=GetString($brief,"100");
        $temp="$name|%|$date|%|$link|%|$index_brief|%|$time";
		$myfile->editfile("../data/sort.php",$id,"\n",$sort);
		$myfile->editfile("../data/rating.php",$id,"\n",$rating);
		$myfile->editfile("../data/hit.php",$id,"\n",$hit);
		$myfile->editfile("../data/main.php",$id,"\n",$temp);
		$myfile->writetofile("../data/main/$pid.php",$tmp,"w+");
		$myfile->editfile("../data/topic.php",$id,"\n",$topic_id);
		goback("-1","修改成功,请返回");
	}
      //系统变量管理
      else if($action=="system"){
	    $arr=$myfile->arrayfromfile("../data/ann.php","\n");
        require"doc/system.html";
      }
	  //公告添加动作
	  else if($action=="add_ann"){
	    $title=trim($title);
		$content=ubb($content);
		if($title==""||$content==""){
		  goback("-1","公告标题或内容不能为空");
		  exit;
		}
	    $date=date("Y-m-d H",time(0));
		$myfile->writetofile("../data/ann.php","$date|%|$title|%|$content\n","a+");
		goback("-1","公告添加成功，请返回");
	  }
	  //公告删除动作
	  else if($action=="del_ann"){
	    $myfile->deletefromfile("../data/ann.php",$id,"\n");
		goback("-1","删除成功，请返回");
	  }
	  //公告修改表单
	  else if($action=="edit_ann"){
	    $arr=$myfile->arrayfromfile("../data/ann.php","\n");
		list($date,$title,$content)=explode("|%|",$arr[$id]);
	    require"doc/edit_ann_form.html";
	  }
	  //公告修改动作
	  else if($action=="edit_ann1"){
	   	$title=trim($title);
		$content=trim($content);
		if($title==""||$content==""){
		  goback("-1","公告标题或内容不能为空");
		  exit;
		}
	   $date=date("Y-m-d H",time(0));
	   $myfile->editfile("../data/ann.php",$id,"\n","$date|%|$title|%|$content");
	   GoIN("?action=system","修改成功，请返回");
	  }
	  //////////////////////专题管理///////////////////////////////
	  else if($action=="topic"){
	     $array=@$myfile->arrayfromfile("../data/sort/sort.php","\n");
		 $topic_arr=@$myfile->arrayfromfile("../data/sort/topic.php","\n");
		 $total=sizeof($array)-1;
	    require"doc/topic.html";
	  }
	  //添加专题动作
	  else if($action=="add_topic"){
	    $topic_name=trim($topic_name);
		if($topic_name==""){
		  goback("-1","专题名称不能为空");
		  exit;
		}
		$time=UpNum("2");
		$myfile->writetofile("../data/sort/list.php","<?\$topic$time='$topic_name';?>","a+");
		$myfile->writetofile("../data/sort/topic.php","$time|$sort_time\n","a+");
		goback("-1","专题 $topic_name 添加成功，请返回");
	  }
	  //专题修改动作
	  else if($action=="edit_topic"){
	   $new_name=trim($new_name);
	   if($new_name==""){
	     goback("-1","专题新名称不能为空");
		 exit;
	   }
	   list($topic,$id)=explode("|",$topic_id);
	   $myfile->editfile("../data/sort/topic.php",$id,"\n","$topic|$sort_id");
	   $data=$myfile->readfromfile("../data/sort/list.php");
	   $newdata=str_replace("<?\$topic$topic='${topic.$topic}';?>","<?\$topic$topic='$new_name';?>",$data);
	   $myfile->writetofile("../data/sort/list.php","$newdata","w+");
	   goback("-1","专题修改成功，请返回");
	  }
	  //专题删除动作
	  else if($action=="del_topic"){
	  list($topic,$id)=explode("|",$topic_id);
	  $data=$myfile->readfromfile("../data/sort/list.php");
	  $newdata=str_replace("<?\$topic$topic='${topic.$topic}';?>","",$data);
	  $myfile->deletefromfile("../data/sort/topic.php","$id","\n");
	  $myfile->writetofile("../data/sort/list.php","$newdata","w+");
	  //+-----未尽事宜-----------
	  $data=$myfile->readfromfile("../data/topic.php");
	  $newdata=str_replace("$topic","0",$data);
	  $myfile->writetofile("../data/topic.php","$newdata","w+");
	  goback("-1","专题删除成功");
	  }
	  //以下是评论管理
	  else if($action=="rating"){
	  $replyarr=$myfile->arrayfromfile("../data/reply.php","\n");
	  $mainarr=$myfile->arrayfromfile("../data/main.php","\n");
	  require"doc/rating.html";
	  }
	  //以下是删除评论动作
	  else if($action=="rating_del"){
      $replyarr=$myfile->arrayfromfile("../data/reply.php","\n");
	  $arr=explode("|!|",$replyarr[$id]);
	  unset($arr[$k]);
	  $replyarr[$id]=implode("|!|",$arr);
	  $data=implode("\n",$replyarr);
	  $myfile->writetofile("../data/reply.php",$data,"w+");
	  goback("-1","删除成功，请返回");
	  }
	  //以下是回复评论表单
	  else if($action=="rating_reply"){
	  require"doc/rating_reply_form.html";
	  }
	  //以下是回复评论动作
	  else if($action=="rating_rep"){
	  $content=ubb($content);
	  if($content==""){
	    goback("-1","回复内容不能为空");
		exit;
	  }
	  $date=date("Y-m-d H",time(0));
	  $replyarr=$myfile->arrayfromfile("../data/reply.php","\n");
	  $arr=explode("|!|",$replyarr[$id]);
	  $arr[$k].="<br>&nbsp;&nbsp;&nbsp;&nbsp;<font color=\"red\">管理员回复</font>：$content <font size=\"1\">$date</font>";
	  $replyarr[$id]=implode("|!|",$arr);
	  $data=implode("\n",$replyarr);
	  $myfile->writetofile("../data/reply.php",$data,"w+");
	  GoIn("?action=rating","回复成功，请返回");
	  }
	  //以下是退出登陆动作
	  else if($action=="logout"){
	   session_unregister("user_login_sess");
	   goback("-1","成功退出,返回");
	   echo"<br>";
	   GoIn("../index.php","回到首页");
	  }
	  //以下是系统常规设置选项表单
	  else if($action=="usual"){
	    require"doc/usual.html";
	  }
	  //以下是常规选项更改动作
	  else if($action=="usual1"){
	  $username=Encode($username);
	  $userpass=Encode($userpass);
	  $userpass1=Encode($userpass1);
	  if($userpass!=$userpass1){
	   goback("-1","两次输入的密码不一致");
	   exit;
	  }
	  $sitename=Encode($sitename);
	  $siteaddr=Encode($siteaddr);
	  $downaddr=Encode($downaddr);
	  $indexnum=Encode($indexnum);
	  $pagenum=Encode($pagenum);
	  $listnum=Encode($listnum);
	  $data="<?php
         //+---------------以下是用户管理------------------------
          \$adminname=\"$username\";//用户名
          \$adminpass=\"$userpass\";//用户密码
          \$adminhome=\"$sitename\";//用户网站名
          \$adminaddr=\"$siteaddr\";//用户网站地址
          \$admindown=\"$downaddr\";//下载系统所在文件夹
          \$adminnum=\"$indexnum\";//首页调用软件数

         //+--------------以下是页码控制---------------------------
         \$adminpage=\"$pagenum\";//每页显示数
         \$adminlist=\"$listnum\";//右侧列表软件数

         //+---------------以下是语言选择-------------------------
         \$language=\"$select\";//简体中文:gb 英语:en 
           ?>";
		   @unlink("../data/config.php");
		   $myfile->writetofile("../data/config.php",$data,"w+");
		   goback("-1","设置更新完毕,请返回");
	  }
	echo"</td>";
    echo'<td width="1">&nbsp;</td>';
    echo'</tr>';
    echo'</table>';
    echo'</body>';
    echo'</html>';
      ?>
