$exe_time=microtime(); ob_start(); include"../link.php"; include('../language/ccharset.php'); include"setup.php"; include"count.php"; function execute_query($sql){ global $sql_num; $sql_num++; return mysql_query($sql); } if($_COOKIE['bbs_template']) $template=$_COOKIE[bbs_template]; if($_COOKIE[bbs_name]==$admin1 or $_COOKIE[bbs_name]==$admin_name){ header("Content-Type:text/html;charset=big5"); if(!$_COOKIE[c_lang])$_COOKIE[c_lang]="$language"; if($_POST && $_COOKIE[c_lang]=="GB"){ $code=new CCharset; $_POST[rankx]=$code->Gb_Big5($_POST[rankx]); $_POST[title]=$code->Gb_Big5($_POST[title]); $_POST[memo]=$code->Gb_Big5($_POST[memo]); $_POST[host]=$code->Gb_Big5($_POST[host]); $_POST['class']=$code->Gb_Big5($_POST['class']); $_POST[admin_name]=$code->Gb_Big5($_POST[admin_name]); $_POST[bbs_title]=$code->Gb_Big5($_POST[bbs_title]); $_POST[super_manager_name]=$code->Gb_Big5($_POST[super_manager_name]); $_POST[admin1]=$code->Gb_Big5($_POST[admin1]); } if($_COOKIE['c_lang']=='GB'){ header("content-Type: text/html; charset=gb2312"); }else{ header("content-Type: text/html; charset=big5"); } $templatez="$template"; $template="template/$template"; include"../$template/log.php"; include("../$template/error.php"); if(!$_GET[seen]){ if(!$_GET[unseen]){ if(!$_GET[panel]){ if(!$_GET[renamego]){ if(!$_GET[dx]){ if(!$_GET[drop]){ if(!$_GET[push]){ if(!$_POST[edit]){ if(!$_GET[unlock]){ if(!$_GET[lock]){ if(!$_GET[top]){ if(!$_GET[back]){ if(!$_GET[delete]){ if(!$_GET[clear]){ if(!extract($_GET) or $_GET[edit] or $_GET[rename] or $_GET[add]){ include"../$template/top.php"; include"../$template/admin_top.php"; include"../$template/admin_main.php"; list($id,$title,$dir,$memo,$host,$secret)=mysql_fetch_array(execute_query("select id,title,dir,memo,host,secret from ${admin_id}_php_visual_board_board where title='$_GET[title]'")); if($_GET[rename])$dest="renamego=$_GET[rename]";else$dest="create=go"; if(!$_GET[edit]){ $c_mode='bbs1'; $c_ban='9'; $c_read='10'; $c_post='9'; $c_post2='9'; $c_edit='9'; $c_editc='9'; $c_vote='9'; $c_lock='9'; $c_link='9'; $c_link_num='2'; $c_com1='9'; $c_com2='9'; $c_com3='9'; $c_reply='9'; $c_poll='9'; $c_post_poll='9'; $c_view='9'; $c_down='9'; $c_html='9'; $c_msn='9'; $c_bbcode='9'; $d_post='9'; $d_post_num='2'; $d_com='9'; $d_com_num='2'; $d_reply='9'; $d_reply_num='2'; $d_poll='9'; $d_poll_num='2'; }else{ include"sub2/$_GET[edit].php"; } if($c_mode==bbs1)$m1="checked"; if($c_mode==bbs2)$m2="checked"; if($c_mode==bill)$m3="checked"; if($c_mode==guest)$m4="checked"; if($c_mode==diary)$m5="checked"; if($c_mode==photo)$m6="checked"; if($c_mode==pds)$m7="checked"; if($c_mode==chat)$m8="checked"; if($c_mode==link)$m9="checked"; if($c_mode==blog)$m10="checked"; if($_GET[rename]) $md="修改分區"; else $md="建立分區"; if(!$_GET[admin2])$_GET[admin2]="$admin_name"; if($secret)$s="checked"; if($_GET[edit]) if($unseen)$u="checked"; if($visible)$v="checked"; if(is_file("./sub2/$_GET[edit].gif")) $logo="
刪除 logo
";
include"../$template/admin_form.php";
}
if($_GET[create]==go){
if(!$_POST[dir] or !$_POST[admin2])error("請輸入完整資料!");
unset($admin2);
include"sub/dir.php";
if($admin2)$admin2="$admin2<>";
fputs(fopen("sub/dir.php",w),"\$admin2='$admin2$_POST[dir]%%$_POST[admin2]';?>");
list($id)=mysql_fetch_array(execute_query("select id from ${admin_id}_php_visual_board_index order by id DESC"));
$id++;
execute_query("insert into ${admin_id}_php_visual_board_index values('$id','$_POST[dir]')") or die("無法寫入資料庫!");
header("location:?");
}
if($_GET[create2]==go && !$_POST[edit]){
if(!$_POST[title] or !$_POST[memo])error("請輸入完整資料!");
if($_POST[sub]){
list($sup,$sub)=mysql_fetch_array(execute_query("select id,sub from ${admin_id}_php_visual_board_board where title='$_POST[sub]'"));
if($sub)$sub="$sub<>";
execute_query("update ${admin_id}_php_visual_board_board set sub='$sub$_POST[title]' where title='$_POST[sub]'") or die("無法寫入資料庫!");
$_POST[sdir]=$_POST[sub];
}
list($id)=mysql_fetch_array(execute_query("select id from ${admin_id}_php_visual_board_board order by id DESC"));
$id++;
if($_POST[notice])$id=999;
$ord++;
execute_query("insert into ${admin_id}_php_visual_board_board values('$id','$_POST[title]','$_POST[sdir]','$_POST[memo]','$_POST[host]','0','0','','','','$_POST[lock]','$_POST[secret]','$ord','','')") or die("無法寫入資料庫!");
fputs(fopen("sub2/$id.php",w),"
\$c_mode='$_POST[c_mode]';
\$c_read='$_POST[c_read]';
\$c_post='$_POST[c_post]';
\$c_post2='$_POST[c_post2]';
\$c_edit='$_POST[c_edit]';
\$c_editc='$_POST[c_editc]';
\$c_vote='$_POST[c_vote]';
\$c_lock='$_POST[c_lock]';
\$c_link='$_POST[c_link]';
\$c_link_num='$_POST[c_link_num]';
\$c_com1='$_POST[c_com1]';
\$c_com2='$_POST[c_com2]';
\$c_com3='$_POST[c_com3]';
\$c_reply='$_POST[c_reply]';
\$c_poll='$_POST[c_poll]';
\$c_post_poll='$_POST[c_post_poll]';
\$c_view='$_POST[c_view]';
\$c_down='$_POST[c_down]';
\$c_html='$_POST[c_html]';
\$c_msn='$_POST[c_msn]';
\$c_bbcode='$_POST[c_bbcode]';
\$d_post='$_POST[d_post]';
\$d_post_num='$_POST[d_post_num]';
\$d_com='$_POST[d_com]';
\$d_com_num='$_POST[d_com_num]';
\$d_reply='$_POST[d_reply]';
\$d_reply_num='$_POST[d_reply_num]';
\$d_poll='$_POST[d_poll]';
\$d_poll_num='$_POST[d_poll_num]';
\$class='$_POST[class]';
\$c_ban='$_POST[c_ban]';
\$secret='$_POST[secret]';
\$unseen='$_POST[unseen]';
\$msn=\"$_POST[msn]\";
\$visible=\"$_POST[visible]\";
?>
");
if($_FILES[logo][tmp_name])
@move_uploaded_file($_FILES[logo][tmp_name],"./sub2/$id.gif");
$create="
create table ${admin_id}_php_visual_board_bbs_$id(
id int primary key auto_increment,
name varchar(24),
pass varchar(24),
icon int,
email varchar(24),
home varchar(24),
title varchar(40),
memo text,
time int,
com text,
hit int,
cnum int,
vote int,
last_time int,
last_name varchar(24),
poll text,
html int,
`lock` int,
id2 varchar(24),
notice int,
id3 varchar(24),
keep varchar(40),
edit_time int,
index(notice)
)
";
include"setup.php";
if($manager)$manager.="<>";
fputs(fopen("setup.php",w),"
\$list_mode=\"$list_mode\";
\$language=\"$language\";
\$bbs_title=\"$bbs_title\";
\$admin_id=\"$admin_id\";
\$admin_name=\"$admin_name\";
\$admin_pass=\"$admin_pass\";
\$manager=\"$manager$id%$_POST[host]\";
\$super_manager_name=\"$super_manager_name\";
\$super_manager_pass=\"$super_manager_pass\";
\$per=\"$per\";
\$per2=\"$per2\";
\$ltotal=\"$ltotal\";
\$info=\"$info\";
\$width=\"$width\";
\$bg=\"$bg\";
\$border=\"$border\";
\$link=\"$link\";
\$template=\"$template\";
\$back_info=\"$back_info\";
\$rankx=\"$rankx\";
\$reg=\"$reg\";
\$co1=\"$co1\";
\$co2=\"$co2\";
\$co3=\"$co3\";
\$co4=\"$co4\";
\$fx=\"$fx\";
\$ts=\"$ts\";
\$admin1=\"$admin1\";
\$height=\"$height\";
\$per_list=\"$per_list\";
\$color=\"$color\";
\$points=\"$points\";
\$dollars=\"$dollars\";
\$about=\"$about\";
\$bank=\"$bank\";
\$dollarx=\"$dollarx\";
\$give=\"$give\";
\$in=\"$in\";
\$out=\"$out\";
\$p1=\"$p1\";
\$p2=\"$p2\";
\$height2=\"$height2\";
\$color2=\"$color2\";
\$height3=\"$height3\";
\$color3=\"$color3\";
?>");
execute_query("$create") or die("建立資料庫 - ${admin_id}_php_visual_board_bbs_$id 失敗!");
foreach(explode("\n",$_POST[host]) as $name){
execute_query("update ${admin_id}_php_visual_board_member set job='2' where name='$name'") or die("無法寫入資料庫!");
}
if($sup)@mkdir("sub/$sup"."_".$id);
if(!$_POST[blog])
header("location:?");
else{
execute_query("update ${admin_id}_php_visual_board_member set home='index.php?blog=$id' where id='$_COOKIE[bbs_id]'") or die("更新資料庫失敗!");
setcookie("bbs_home","index.php?blog=$id",time()+2592000,"/bbs/$admin_id");
header("location:index.php?blog=$id");
}
}
}else{
include"count.php";
$count3-=$_GET[num];
fputs(fopen('count.php',w),"\$count='$count';\$nowd='$nowd';\$day='$day';\$peak='$peak';\$count2='$count2';\$count3='$count3';\$new_member='$new_member';\$new_member_time='$new_member_time';?>");
execute_query("update ${admin_id}_php_visual_board_board set num=\"\",com=\"\",last_time=\"\",last_name=\"\",new=\"\",id2=\"\" where title='$_GET[title]'") or die("無法寫入資料庫!");
execute_query("delete from ${admin_id}_php_visual_board_bbs_$_GET[clear]") or die("無法清空資料表!");
header("location:?");
}
}else{
list($sub)=mysql_fetch_array(execute_query("select sub from ${admin_id}_php_visual_board_board where sub like '%$_GET[title]%'"));
$sub=str_replace("$_GET[title]<>","",$sub);
$sub=str_replace("<>$_GET[title]","",$sub);
$sub=str_replace("$_GET[title]","",$sub);
execute_query("update ${admin_id}_php_visual_board_board set sub='$sub' where sub like '%$_GET[title]%'") or die("無法寫入資料庫!");
include"count.php";
$count3-=$_GET[num];
fputs(fopen('count.php',w),"\$count='$count';\$nowd='$nowd';\$day='$day';\$peak='$peak';\$count2='$count2';\$count3='$count3';\$new_member='$new_member';\$new_member_time='$new_member_time';?>");
execute_query("delete from ${admin_id}_php_visual_board_board where title='$_GET[title]'") or die("無法寫入資料庫!");
$set=file_get_contents("setup.php");
$set=str_replace("$_GET[delete]%$_GET[delete2]<>","",$set);
$set=str_replace("<>$_GET[delete]%$_GET[delete2]","",$set);
$set=str_replace("$_GET[delete]%$_GET[delete2]","",$set);
fputs(fopen('setup.php',w),$set);
@unlink("./sub2/$_GET[delete].gif");
execute_query("drop table ${admin_id}_php_visual_board_bbs_$_GET[delete]") or die("無法刪除資料表 - ! ${admin_id}_php_visual_board_bbs_$_GET[delete]");
header("location:?");
}
}else{
list($ord)=mysql_fetch_array(execute_query("select min(ord) from ${admin_id}_php_visual_board_board"));
$ord--;
execute_query("update ${admin_id}_php_visual_board_board set ord=$ord where title='$_GET[title]'") or die("無法寫入資料庫!");
header("location:?");
}
}else{
list($ord)=mysql_fetch_array(execute_query("select max(ord) from ${admin_id}_php_visual_board_board"));
$ord++;
execute_query("update ${admin_id}_php_visual_board_board set ord=$ord where title='$_GET[title]'") or die("無法寫入資料庫!");
header("location:?");
}
}else{
execute_query("update ${admin_id}_php_visual_board_board set `lock`=1 where title='$_GET[title]'") or die("無法寫入資料庫!");
header("location:?");
}
}else{
execute_query("update ${admin_id}_php_visual_board_board set `lock`=0 where title='$_GET[title]'") or die("無法寫入資料庫!");
header("location:?");
}
}else{
fputs(fopen("sub2/$_POST[id2].php",w),"
\$c_mode='$_POST[c_mode]';
\$c_read='$_POST[c_read]';
\$c_post='$_POST[c_post]';
\$c_post2='$_POST[c_post2]';
\$c_edit='$_POST[c_edit]';
\$c_editc='$_POST[c_editc]';
\$c_vote='$_POST[c_vote]';
\$c_lock='$_POST[c_lock]';
\$c_link='$_POST[c_link]';
\$c_link_num='$_POST[c_link_num]';
\$c_com1='$_POST[c_com1]';
\$c_com2='$_POST[c_com2]';
\$c_com3='$_POST[c_com3]';
\$c_reply='$_POST[c_reply]';
\$c_poll='$_POST[c_poll]';
\$c_post_poll='$_POST[c_post_poll]';
\$c_view='$_POST[c_view]';
\$c_down='$_POST[c_down]';
\$c_html='$_POST[c_html]';
\$c_msn='$_POST[c_msn]';
\$c_bbcode='$_POST[c_bbcode]';
\$d_post='$_POST[d_post]';
\$d_post_num='$_POST[d_post_num]';
\$d_com='$_POST[d_com]';
\$d_com_num='$_POST[d_com_num]';
\$d_reply='$_POST[d_reply]';
\$d_reply_num='$_POST[d_reply_num]';
\$d_poll='$_POST[d_poll]';
\$d_poll_num='$_POST[d_poll_num]';
\$class='$_POST[class]';
\$c_ban='$_POST[c_ban]';
\$secret='$_POST[secret]';
\$unseen='$_POST[unseen]';
\$msn=\"$_POST[msn]\";
\$visible=\"$_POST[visible]\";
?>
");
execute_query("update ${admin_id}_php_visual_board_board set title='$_POST[title]',dir='$_POST[sdir]',memo='$_POST[memo]',host='$_POST[host]' where title='$_POST[edit]'") or die("無法寫入資料庫!");
if($manager)$manager.="<>";
include"setup.php";
fputs(fopen("setup.php",w),"
\$list_mode=\"$list_mode\";
\$language=\"$language\";
\$bbs_title=\"$bbs_title\";
\$admin_id=\"$admin_id\";
\$admin_name=\"$admin_name\";
\$admin_pass=\"$admin_pass\";
\$manager=\"$manager$_POST[id2]%$_POST[host]\";
\$per=\"$per\";
\$per2=\"$per2\";
\$ltotal=\"$ltotal\";
\$info=\"$info\";
\$width=\"$width\";
\$bg=\"$bg\";
\$border=\"$border\";
\$link=\"$link\";
\$template=\"$template\";
\$back_info=\"$back_info\";
\$rankx=\"$rankx\";
\$reg=\"$reg\";
\$co1=\"$co1\";
\$co2=\"$co2\";
\$co3=\"$co3\";
\$co4=\"$co4\";
\$fx=\"$fx\";
\$ts=\"$ts\";
\$admin1=\"$admin1\";
\$height=\"$height\";
\$per_list=\"$per_list\";
\$color=\"$color\";
\$points=\"$points\";
\$dollars=\"$dollars\";
\$about=\"$about\";
\$bank=\"$bank\";
\$dollarx=\"$dollarx\";
\$give=\"$give\";
\$in=\"$in\";
\$out=\"$out\";
\$p1=\"$p1\";
\$p2=\"$p2\";
\$height2=\"$height2\";
\$color2=\"$color2\";
\$height3=\"$height3\";
\$color3=\"$color3\";
?>");
foreach(explode("\n",$_POST[host]) as $name){
execute_query("update ${admin_id}_php_visual_board_member set job='2' where name='$name'") or die("無法寫入資料庫!");
}
$_POST[edit]=urlencode($_POST[edit]);
$_POST[sdir]=urlencode($_POST[sdir]);
if($_FILES[logo][tmp_name])
@move_uploaded_file($_FILES[logo][tmp_name],"./sub2/$_POST[id2].gif");
if($_POST[dl])
@unlink("./sub2/$_POST[id2].gif");
if($_POST[blog])
header("location:index.php?blog=$_POST[id2]");
else
header("location:?edit=$_POST[id2]&title=$_POST[edit]&dirn=$_POST[sdir]");
}
}else{
list($ord)=mysql_fetch_array(execute_query("select ord from ${admin_id}_php_visual_board_board where title='$_GET[title]'"));
$ord+=1;
execute_query("update ${admin_id}_php_visual_board_board set ord=$ord where title='$_GET[title]'") or die("無法寫入資料庫!");
header("location:?");
}
}else{
list($ord)=mysql_fetch_array(execute_query("select ord from ${admin_id}_php_visual_board_board where title='$_GET[title]'"));
$ord-=1;
execute_query("update ${admin_id}_php_visual_board_board set ord=$ord where title='$_GET[title]'") or die("無法寫入資料庫!");
header("location:?");
}
}else{
@unlink("sub/$_GET[dx].log");
$admin2=file_get_contents("sub/dir.php");
$admin2=str_replace("<>$_GET[dx]%%$_GET[dx2]","",$admin2);
$admin2=str_replace("$_GET[dx]%%$_GET[dx2]","",$admin2);
fputs(fopen("sub/dir.php",w),$admin2);
execute_query("delete from ${admin_id}_php_visual_board_index where dir='$_GET[dx]'") or die("無法寫入資料庫!");
header("location:?");
}
}else{
if(!$_POST[dir] or !$_POST[admin2])error("請輸入完整資料!");
$admin2=file_get_contents("sub/dir.php");
$admin2=str_replace("$_GET[renamego]","$_POST[dir]",$admin2);
$admin2=str_replace("$_POST[rad]","$_POST[admin2]",$admin2);
fputs(fopen("sub/dir.php",w),$admin2);
execute_query("update ${admin_id}_php_visual_board_board set dir='$_POST[dir]' where dir='$_GET[renamego]'") or die("無法寫入資料庫!");
execute_query("update ${admin_id}_php_visual_board_index set dir='$_POST[dir]' where dir='$_GET[renamego]'") or die("無法寫入資料庫!");
header("location:?");
}
}else{
if($_GET[md]!="go"){
include"../$template/top.php";
if(file_exists("sub/style.css")){
$delz="
style.css 刪除Style ";
}
if(file_exists("sub/bar.gif")){
$delx="

刪除Bar ";
}
if(file_exists("sub/bar2.gif")){
$delxx="

刪除Bar ";
}
if(file_exists("sub/bar3.gif")){
$delxxx="

刪除menu Bar ";
}
if(file_exists("sub/banner.gif")){
$del="

刪除Banner ";
}
if(file_exists("sub/bg.gif")){
$del2="

刪除背景圖片 ";
}
$rankx=explode("<>",$rankx);
for($n=1;$n<=12;$n++){
$ns=$n-1;
$rank.=<<
HTML;
}
if($language=="BIG5")
$ls="selected";
if($language=="GB")
$ls2="selected";
if(!$list_mode)
$lm1="checked";
if($list_mode)
$lm2="checked";
include"../$template/admin_setup.php";
}else{
if($_FILES[style])
@move_uploaded_file($_FILES[style][tmp_name],"./sub/style.css");
if($_FILES[bar])
@move_uploaded_file($_FILES[bar][tmp_name],"./sub/bar.gif");
if($_FILES[bar2])
@move_uploaded_file($_FILES[bar2][tmp_name],"./sub/bar2.gif");
if($_FILES[bar3])
@move_uploaded_file($_FILES[bar3][tmp_name],"./sub/bar3.gif");
if($_FILES[image])
@move_uploaded_file($_FILES[image][tmp_name],"./sub/banner.gif");
if($_FILES[bg_image])
@move_uploaded_file($_FILES[bg_image][tmp_name],"./sub/bg.gif");
if($_POST[delz])
@unlink("./sub/style.css");
if($_POST[delx])
@unlink("./sub/bar.gif");
if($_POST[delxx])
@unlink("./sub/bar2.gif");
if($_POST[delxxx])
@unlink("./sub/bar3.gif");
if($_POST[del])
@unlink("./sub/banner.gif");
if($_POST[del2])
@unlink("./sub/bg.gif");
$n=1;
while($_POST["rank_$n"]){
if($_POST[rankx])$_POST["rank_$n"]="<>".$_POST["rank_$n"];
$_POST[rankx].=$_POST["rank_$n"];
$n++;
}
fputs(fopen("setup.php",w),"
\$list_mode=\"$_POST[list_mode]\";
\$language=\"$_POST[language]\";
\$bbs_title=\"$_POST[bbs_title]\";
\$admin_id=\"$admin_id\";
\$admin_name=\"$_POST[admin_name]\";
\$admin_pass=\"$_POST[admin_pass]\";
\$super_manager_name=\"$_POST[super_manager_name]\";
\$super_manager_pass=\"$_POST[super_manager_pass]\";
\$manager=\"$_POST[manager]\";
\$per=\"$_POST[per]\";
\$per2=\"$_POST[per2]\";
\$ltotal=\"$_POST[ltotal]\";
\$info=\"$_POST[info]\";
\$width=\"$_POST[width]\";
\$bg=\"$_POST[bg]\";
\$border=\"$_POST[border]\";
\$link=\"$_POST[link]\";
\$template=\"$_POST[template]\";
\$back_info=\"$_POST[back_info]\";
\$rankx=\"$_POST[rankx]\";
\$reg=\"$_POST[reg]\";
\$co1=\"$_POST[co1]\";
\$co2=\"$_POST[co2]\";
\$co3=\"$_POST[co3]\";
\$co4=\"$_POST[co4]\";
\$fx=\"$_POST[fx]\";
\$ts=\"$_POST[ts]\";
\$admin1=\"$_POST[admin1]\";
\$height=\"$_POST[height]\";
\$per_list=\"$_POST[per_list]\";
\$color=\"$_POST[color]\";
\$points=\"$_POST[points]\";
\$dollars=\"$_POST[dollars]\";
\$about=\"$_POST[about]\";
\$bank=\"$bank\";
\$dollarx=\"$_POST[dollarx]\";
\$give=\"$_POST[give]\";
\$in=\"$_POST[in]\";
\$out=\"$_POST[out]\";
\$p1=\"$_POST[p1]\";
\$p2=\"$_POST[p2]\";
\$height2=\"$_POST[height2]\";
\$color2=\"$_POST[color2]\";
\$height3=\"$_POST[height3]\";
\$color3=\"$_POST[color3]\";
?>");
header("location:admin.php?panel=go");
}
}
}else{
@fopen("sub/$_GET[unseen].log",w);
header("location:admin.php");
}
}else{
@unlink("sub/$_GET[seen].log");
header("location:admin.php");
}
}else{
echo "ForBidden 禁止進入!";
exit;
}
$exe_time2=microtime();
include"../$template/bottom.php";
$RealOutput = ob_get_contents();
@include"../$template/chrc.php";
ob_end_clean();
if($_COOKIE[c_lang]=='GB'){
$code=new CCharset;
$RealOutput=$code->Big5_Gb($RealOutput);
}
echo $RealOutput;
?>