header("content-Type: text/html; charset=big5");
include"link.php";
function remove($dir){
$d=opendir($dir);
while($f=readdir($d)){
if($f!="." && $f!=".."){
if(strstr($f,"."))unlink("$dir/$f");
if(!strstr($f,"."))remove("$dir/$f");
}
}
rmdir($dir);
}
if($_GET[hot])$cper=100000;else$cper=10;
if(!$_GET[login]){
if(!$_GET[del]){
$d=opendir(".");
while($user=readdir($d)){
if(!preg_match("/^\.|bbs_msn|language|subject_icon|template/",$user) && is_dir($user))
$use[]="$user";
}
closedir($d);
$count=count($use);
if($count){
include"./$ctemplate/list_top.php";
if($_GET[key])$_POST[key]=$_GET[key];
if($_POST[key])
foreach($use as $user){
@include"$user/setup.php";
if(strstr($user,$_POST[key]) or strstr($about,$_POST[key]) or strstr($admin_name,$_POST[key]) or strstr($bbs_title,$_POST[key]))
$u[]="$user";
}
if($_POST[key])$use=$u;
$no=count($use);
if(!$_GET[page])$_GET[page]=1;
$number=($_GET[page]-1)*$cper+1;
foreach(array_slice($use,($_GET[page]-1)*$cper,$cper) as $use){
@include"$use/count.php";
@include"$use/setup.php";
if(!$_GET[hot] or $count3>=$hot_num)
include"./$ctemplate/list_main.php";
$number++;
}
}
$p=ceil(($no+1)/$cper);
for($n=1;$n<=$p;$n++){
$pagex.="$n";
}
$n--;
include"./$ctemplate/list_bottom.php";
}else{
$table_name=mysql_list_tables("$db_name");
while($table=mysql_fetch_row($table_name)){
if(strstr($table[0],"$_GET[del]_php_visual_board"))@mysql_query("drop table $table[0]");
remove("$_GET[del]");
}
header("location:list.php");
}
}else{
if($_POST[cpass]!=$cpass)exit("±K½X¤£¥¿½T!");
setcookie("admin",1);
header("location:list.php");
}
?>