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

📄 forumset.php

📁 FTB安装版 v1.3(虚拟形象)FTB安装版 v1.3(虚拟形象)
💻 PHP
字号:
<?
//版块名称:<input type=text name='name' size=20 value='$forumdetail[1]'><br>
//$detail[1]=$name;
require("userdata/style.php");
require("global.php");
$forumfile="bbsdata/forumdata.php";
if (file_exists($forumfile)) {
	$forumdata=file($forumfile);
	$count=count($forumdata);
	for($i=0; $i<$count; $i++) {
		$forumdetail=explode("|",$forumdata[$i]);
		if($forumdetail[3]==$forumid) break;
	}
}
get_forum_info();
if (empty($forumid)) {
	$status="未知的工作指示,别乱调用程序呀";
	require("header.php");echo"$headertp";
	headguide("您正处在<br>$bbs_title<br>的 论坛版块管理程式中",
"<a href=\"thread.php?forumid=$forumid\">$forum_name</a>",
"论坛版块管理程式","no");
	print_err();
	require("footer.php");echo"$footertp";
	exit;
}
//---------check-----------
$check_user=0;
	if ($login_status==1 && $username==$manager) $check_user=1;
	if ($login_status==1 && $check_user==0 && file_exists("bbsdata/admin.php")) {
		$adminlist=file("bbsdata/admin.php");
		$admincount=count($adminlist);
		for ($i=0; $i<$admincount; $i++) {
			$detail=explode("|", str_replace("\n","", $adminlist[$i]));
			if ($detail[0]==$forumid && $detail[1]==$username) $check_user=1;
		}
	}
//----让增加的管理员有权管理!----------
	if (file_exists("bbsdata/superadmin.php")) {
		include("bbsdata/superadmin.php");
		if ($superadmin && in_array($username,$superadmin)) {
		$check_user=1; 
		}
	}
//----让增加的管理员有权管理!----------
	if ($check_user==0) {
		$status="您没有权利进行操作,请您以合适的身份登录(管理员,斑竹)";
		require("header.php");echo"$headertp";
		headguide("您正处在<br>$bbs_title<br>的 论坛版块管理 程式中",
"<a href=\"thread.php?forumid=$forumid\">$forum_name</a>",
"论坛版块管理程式","no");
		print_err();
		require("footer.php");echo"$footertp";
		exit;
	}
if (empty($action)) {
	require("header.php");echo"$headertp";
	headguide("您正处在<br>$bbs_title<br>的 论坛版块管理 程式中",
"<a href=\"thread.php?forumid=$forumid\">$forum_name</a>",
"论坛版块管理程式","no");
	print_confirm();
	require("footer.php");echo"$footertp";
	exit;
}
if ($action=="modify") {
for ($i=0; $i<$count; $i++) {
  $detail=explode("|",$forumdata[$i]);
  if ($detail[3]==$forumid) {
      if (!empty($forumtype)||$forumtype!="") $detail[0]=$forumtype;
      if ($detail[0]!="category") $detail[2]=$forumdes;
      if (!empty($forumpwd)) $forumpwd=md5($forumpwd);
	$forumannounce=str_replace("\n","<br>",$forumannounce);
	$forumannounce=str_replace("\r","",$forumannounce);
      $detail[5]=$forumpwd;$detail[7]=$post;$detail[8]=$hide;$detail[9]=$sell;$detail[10]=$announcetitle;$detail[11]=$forumannounce;$detail[12]="1";$detail[13]="$setifchildren";
      $forumskin=stripslashes($forumskin);
      if (!empty($forumskin) && $detail[0]!="category") {if($forumskin=="默认风格") $forumskin=""; $detail[6]=$forumskin;}
      $new[]=implode("|",$detail);
  }
  else $new[]=$forumdata[$i];
}
$new=implode("",$new);
$new=str_replace("
","
",$new);
writetofile($forumfile,$new);
get_forum_info();
//------write to the forum even LIST-----
		if (file_exists("bbsdata/forumevent.php")) 
		$forumevent=explode("\n",readfromfile("bbsdata/forumevent.php"));
		else $forumevent[0]="";
		$newevent="设置版块|$forumid||$forum_name|$username|修改版块设置|0|0|$timestamp|$username|\n";
		$forumevent=implode("\n",$forumevent);
		writetofile("bbsdata/forumevent.php",$newevent.$forumevent);
	jump_page("thread.php?forumid=$forumid","执行成功");
}
function print_err() {
global $status;
$title="发生错误";
$content="管理程式发生了错误,情况:<br>
<br>$status<br><ul>
<li><a href='javascript:history.back(1)'>返回前一页</a></li>
</ul>";
msg_box($title,$content);
}
function print_confirm() {
global $forumid,$forumdetail,$username,$manager,$superadmin;
$title="论坛版块设置";
$title="<b>$title</b>";
if($forumdetail[7]) $post_yes="checked";else $post_no="checked";
if($forumdetail[8]) $hide_yes="checked";else $hide_no="checked";
if($forumdetail[9]) $sell_yes="checked";else $sell_no="checked";
if($forumdetail[13]==1) $ifchildren_yes="checked";else $ifchildren_no="checked";
if($forumdetail[0]=="forum") $ft="<option value='forum'>开放版块</option>";
if($forumdetail[0]=="former") $ft="<option value='former'>正规版块</option>";
if($forumdetail[0]=="locked") $ft="<option value='locked'>认证版块</option>";
if($forumdetail[0]=="hidden") $ft="<option value='hidden'>隐藏版块</option>";
if($forumdetail[0]=="closed") $ft="<option value='closed'>关闭版块</option>";
if($forumdetail[0]=="selection") $ft="<option value='selection'>只读版块</option>";
if($forumdetail[0]=="readonly") $ft="<option value='readonly'>只能回复</option>";
	$dh=opendir("userdata/style/");
	while ($userskin=readdir($dh)) {
		if (($userskin!=".") && ($userskin!="..")  ) {
			$user_skin[]=$userskin;
		}
	}
	closedir($dh);
	$count=count($user_skin);
	$forumstyle="<select name='forumskin'><option value=''>请选择风格</option><option value='默认风格'>默认风格</option>";
	for ($i=0; $i<$count; $i++) {
	if($forumdetail[6]=="$user_skin[$i]") $forumstyle.="<option value=$user_skin[$i] selected>$user_skin[$i]</option>";
	else $forumstyle.="<option value=$user_skin[$i]>$user_skin[$i]</option>";
	}
	$forumstyle.="</select>"; 
$forumdetail[11]=str_replace("<br>","\n",$forumdetail[11]);
if($username==$manager ||($superadmin && in_array($username,$superadmin))) $pwdcontent="版块密码:<input type=text name=forumpwd value='$forumdetail[5]' size=10> 显示的密码已经过md5加密,所以你看不到真正的密码,不用密码请清空<br>";
$content="
<form action='$forumset' method=POST>
版块名称:<input type=text name='name' size=20 value='$forumdetail[1]'><font color=red>不可改项,需要更改请联系流星论坛</font><br>
版块描述:<input type=text name='forumdes' size=40 value='$forumdetail[2]'><br>
版块类别:<select name='forumtype'>
$ft
<option value='forum'>开放版块</option>
<option value='former'>正规版块</option>
<option value='locked'>认证版块</option>
<option value='hidden'>隐藏版块</option>
<option value='closed'>关闭版块</option>
<option value='selection'>只读版块</option>
<option value='readonly'>只能回复</option>
</select><br>
版块风格:$forumstyle<br>
$pwdcontent
是否只显示子版块:<input type=radio name=setifchildren value=1 $ifchildren_yes>是<input type=radio name=setifchildren value=0 $ifchildren_no>否 &nbsp;&nbsp;<font color=red>请版主慎重,不要乱选且此版块必须有子版块 才生效!</font><br>
是否允许加密贴:&nbsp;&nbsp;<input type=radio name=post value=1 $post_yes>是<input type=radio name=post value=0 $post_no>否 <br>
是否允许隐藏贴:&nbsp;&nbsp;<input type=radio name=hide value=1 $hide_yes>是<input type=radio name=hide value=0 $hide_no>否 <br>
是否允许出售贴:&nbsp;&nbsp;<input type=radio name=sell value=1 $sell_yes>是<input type=radio name=sell value=0 $sell_no>否 <br>
版务公告标题:<input type=text name=announcetitle size=60 value=$forumdetail[10]><br>
版务公告内容:<textarea cols=60 rows=6 name=forumannounce>$forumdetail[11]</textarea><br>
请慎重使用版主的管理职能,版主所有操作将被记录<br><br><input type=submit value='确认继续'> 
<input type=button value='返回前页' onclick='javascript:history.back(1)'><br><br>
<input type=hidden name=action value='modify'>
<input type=hidden name=forumid value='$forumid'>";
msg_box($title,$content);
}

⌨️ 快捷键说明

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