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

📄 topsys.php

📁 FTB安装版 v1.3(虚拟形象)FTB安装版 v1.3(虚拟形象)
💻 PHP
字号:
<?
$forumid=126;
require("global.php");
require("ofstarcode.php");
require("userdata/style.php");
$add_title=" > 总置顶中心";
$msgg_max=100;#系统记录的最大总置顶数目
$pagesize=10;#每页显示数目
if ($job=="") $job=show;
if ($login_status==1 && ($username==$manager ||($manager && in_array($username,$manager)))) {$announceadmin=1;}
//----让增加的管理员有权管理!----------
if (file_exists("bbsdata/superadmin.php")) {
		include("bbsdata/superadmin.php");
		if ($superadmin && in_array($username,$superadmin)) {
		$announceadmin=1;
		}
	}
//----让增加的管理员有权管理!----------
$musia=0;
if ($announceadmin==1) $musia=1;
if (file_exists("bbsdata/tbuser.php")) {
include("bbsdata/tbuser.php");
if ($tbuser && in_array($username,$tbuser)) $musia=1;
}
          
if($login_status!=1 || $musia!=1) $not_member=1;
if (!isset($page)) $page=1;


?>

<?
if (!$login_status) {echo "<center>对不起,您还未登录"; exit;}
$user=$username;
if ($job=="read") {
if (file_exists("bbsdata/topsys.php")) {
$receivelist=file("bbsdata/topsys.php");
list($author,$title,$time,$content,$member)=explode("|",$receivelist[$msg]);
$ctime=getfulldate($time);
if ($member=="1" && $not_member=="1") $content="特别会员总置顶,申请加入会员才能看见!";
$content=convert($content,$ftbcode_post);
echo "
<html>
<head><title>总置顶排列</title>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">
<style type=\"text/css\">
<!--
p,td,input,select{ font-size: 9pt; color:#333333;}
a {color:#333333;font-size: 9pt;text-decoration:none; }
a:hover {color:#000000;text-decoration:underline overline;}
a:active {color:#FF6699;}
-->
</style>
</head>
<body bgcolor={$backgroundcolor} leftmargin=0 topmargin=10 marginwidth=0>
<table cellpadding=0 cellspacing=0 border=0 width={$tablewidth} bgcolor={$bordercolor} align=center>
<tr><td><table cellpadding=5 cellspacing=1 border=0 width=100%>";
echo "
<tr bgcolor={$titlecolor}> 
  <td colspan=2><b class=title>-=> 阅读总置顶 </b> <a href=javascript:window.close()>关闭窗口</a></td>
</tr>
<tr>
  <td bgcolor={$forumcolortwo}><br><font color=5A6633>时 间:</font>$ctime<br><font color=5A6633>发布者:</font>$author<br><font color=5A6633>路径:</font>$title<br>$content";
echo "</td>
</tr></table>
    </td>
  </tr>
</table>
</body>
</html>";

}
}

if ($job=="show") {
require("header.php");echo"$headertp";
headguide('你现在正在社区的总置顶中心','总置顶中心','','no');



if (file_exists("bbsdata/topsys.php")) {
$receivelist=file("bbsdata/topsys.php");
$count=count($receivelist);
$sum=$count-1;
$totalpage=ceil($sum/$pagesize);
if ($page>$totalpage || $page<=0) {
$page=1;
}
if ($totalpage==0) {
$totalpage=1;
$page=1;
}
//$start=$sum-$pagesize*($page-1);
//$end=$start-$pagesize;
$start=$pagesize*($page-1);
$end=$start+$pagesize;

if ($count<=1 && empty($receivelist[0])) {
echo "<table cellpadding=0 cellspacing=0 border=0 width={$tablewidth} bgcolor={$titlecolor} align=center>
<tr ><td>";
echo"<br><center>暂时没有任何总置顶";
echo "</td></tr></table>";

if ($announceadmin) {echo "<table bgcolor={$forumcolortwo} width={$tablewidth} border=0 cellspacing=0 cellpadding=2 align=center><tr align=center><td>";
 echo " [<a href=topsys.php?job=clear>清空</a>] [<a href=topsys.php?job=write>发布</a>] [<a href=topsys.php?job=showzt>状态</a>]";
echo "</td></tr></table>";}
require("footer.php");echo"$footertp";exit;}

if ($announceadmin) {echo "<table bgcolor={$forumcolortwo} width={$tablewidth} border=0 cellspacing=0 cellpadding=2 align=center><tr align=center><td>";
 echo " [<a href=topsys.php?job=clear>清空</a>] [<a href=topsys.php?job=write>发布</a>] [<a href=topsys.php?job=showzt>状态</a>]";
echo "</td></tr></table>";}

sline_top();
for ($i=$start; $i<$end; $i++) {
if ($i>$sum) break;
list($author,$title,$time,$content,$member)=explode("|",$receivelist[$i]);
$time=getfulldate($time);
$content=convert($content,$ftbcode_post);
if ($member=="1" && $not_member=="1") $content="特别会员总置顶,申请加入会员才能看见!";
echo "
<tr bgcolor={$titlecolor}> 
  <td colspan=2 bgcolor=$titlecolor><b class=title>-=> 进入:<a href=$title >$content</a>  </b></td>
</tr>
<tr>
  <td bgcolor={$forumcolortwo}>";
echo "<table width={$tablewidth} border=0 cellspacing=0 cellpadding=2 align=center>"; 

 echo "<tr align=left><td>时间:$time 置顶者:$author</td>
<td>";
if ($announceadmin==1)echo "<br><br>[<a href='topsys.php?job=delone&msg=$i'>删除</a>]";
echo "</td></tr></table>";
sline_top();
}
}
else {echo "<br><center>暂时没有任何总置顶";

if ($announceadmin) {echo "<table bgcolor={$forumcolortwo} width={$tablewidth} border=0 cellspacing=0 cellpadding=2 align=center><tr align=center><td>";
 echo " [<a href=topsys.php?job=clear>清空</a>] [<a href=topsys.php?job=write>置顶</a>] [<a href=topsys.php?job=showzt>状态</a>]";
echo "</td></tr></table>";}
 require("footer.php");echo"$footertp"; exit; }
echo "</td></tr></table></td></tr></table><br>";

pagenum();

require("footer.php");echo"$footertp";
}
if ($job=="write") {
if ($announceadmin!=1) {require("header.php");echo"$headertp";
echo "对不起,未登陆或者身份不正确,请 <a href='javascript:history.back(1);'>返回检查</a>";
 require("footer.php");echo"$footertp";
exit;}
if (empty($step)) {require("header.php");echo"$headertp";
                           headguide('你现在正在社区的帖子总置顶中心','置顶帖子','','no');
                           print_form();
                           require("footer.php");echo"$footertp";
                          }
elseif($step==2) {
if (empty($content) || empty($title) || $announceadmin!=1) {
echo "<center>对不起,未登陆或者身份不正确或者必添项为空白,请 <a href='javascript:history.back(1);'>返回检查</a>";
exit;
}
if (file_exists("bbsdata/topsys.php")) $msg=file("bbsdata/topsys.php");
else $msg[0]="";

$content=stripslashes(safe_convert($content));
$title=stripslashes(safe_convert($title));
$title="".$title;
if($filename) $title=$title."&filename=".$filename;//for read.php
$new="$user|$title|$timestamp|$content|$member\n";

$oldcount=count($msg);
if ($oldcount>$msgg_max) {
for ($i=$msgg_max; $i<$oldcount; $i++) unset($msg);
}

$old=implode("",$msg);
writetofile("bbsdata/topsys.php",$new.$old);

if($filename) echo "<meta http-equiv=\"refresh\" content=\"0;URL=$title\">";
echo "<br>已经成功发布<br><br><a href='topsys.php'>点这里返回总置顶中心</a>";
exit;
}
}
if ($job=="clear") {
if ($announceadmin!=1) {require("header.php");echo"$headertp";
echo "对不起,未登陆或者身份不正确,请 <a href='javascript:history.back(1);'>返回检查</a>";
 require("footer.php");echo"$footertp";
exit;}
      echo "<br>确定清空所有总置顶?<br><a href='topsys.php?job=yesclear'>[确认]</a> <a href='javascript:history.back(1);'>[返回]</a>";
      exit;
}

if ($job=="yesclear") {
if ($announceadmin!=1) {require("header.php");echo"$headertp";
echo "对不起,未登陆或者身份不正确,请 <a href='javascript:history.back(1);'>返回检查</a>";
 require("footer.php");echo"$footertp";
exit;}
if (file_exists("bbsdata/topsys.php")) unlink("bbsdata/topsys.php");
echo "<br>您的所有总置顶已被成功清空";
exit;
}

if ($job=="delone") {
if ($announceadmin!=1) {require("header.php");echo"$headertp";
echo "对不起,未登陆或者身份不正确,请 <a href='javascript:history.back(1);'>返回检查</a>";
 require("footer.php");echo"$footertp";
exit;}
if (file_exists("bbsdata/topsys.php")) {
$receivelist=file("bbsdata/topsys.php");
$count=count($receivelist);
$fp=fopen("bbsdata/topsys.php","w");
for ($i=0; $i<$count; $i++) {
if ($i!=$msg) fputs($fp,$receivelist[$i]);

}
fclose($fp);
echo "<br>成功删除一条总置顶<meta http-equiv=\"refresh\" content=\"0;URL=topsys.php\">";
exit;
}
}

if ($job=="showzt") {
if ($announceadmin!=1) {require("header.php");echo"$headertp";
echo "对不起,未登陆或者身份不正确,请 <a href='javascript:history.back(1);'>返回检查</a>";
 require("footer.php");echo"$footertp";
exit;}
if (file_exists("bbsdata/topsys.php")) {
$receivelist=file("bbsdata/topsys.php");
$count=count($receivelist);
         $contl=($count/$msgg_max)*100;
        echo"目前有总置顶<font color=red>".$count."</font>条<br>";
echo"最多可存总置顶<font color=red>".$msgg_max."</font>条<br>";
echo"使用率<font color=red>".$contl."%</font><br>";
echo "<br><br><a href='topsys.php'>点这里返回总置顶中心</a>";
exit;
}
}
function sline_top() {
global $tablewidth,$bordercolor;
print ("</td>
</tr></table>
    </td>
  </tr>
</table>
<br>
<table cellpadding=0 cellspacing=0 border=0 width={$tablewidth} bgcolor={$bordercolor} align=center>
<tr><td><table cellpadding=5 cellspacing=1 border=0 width=100%>");
}

function pagenum(){
global $sum,$pagesize,$page,$totalpage;
$sum1=$sum+1;

echo "<center>共 $sum1 篇,分 $totalpage 页,每页 $pagesize 篇,当前第 $page 页 ";
$back=$page-1;
$forward=$page+1;
if ($page==1) {
echo "首页 上一页 ";
}
else {
echo "<a href=\"topsys.php?page=1\">首页</a> <a href=\"topsys.php?page=$back\">上一页</a> ";
}
if ($page==$totalpage) {
echo "下一页 尾页<br>";
}
else {
echo "<a href=\"topsys.php?page=$forward\">下一页</a> <a href=\"topsys.php?page=$totalpage\">尾页</a><br>";
}
}
function print_form() {
global $target,$tablewidth,$bordercolor,$titlecolor,$titlefontcolor,$forumcolortwo,$backgroundcolor;
?>
<table cellpadding=0 cellspacing=0 border=0 width=<?=$tablewidth?> bgcolor=<?=$bordercolor?> align=center>
<tr><td><table cellpadding=5 cellspacing=1 border=0 width=100%>
<tr> 
  <td bgcolor=<?=$titlecolor?> colspan=2><b class=title>-=> 发布总置顶 </b></td>
</tr><form action=topsys.php method=POST>
<tr>
  <td bgcolor=<?=$forumcolortwo?>>
    
      会员总置顶:
<input type="checkbox" name="member" value=1>(?)<br>
      总置顶帖路径:
      <input style="background-color:#FEFEFF; color:#9999FF; border: 1 double #B4B4B4" onMouseOver = "this.style.backgroundColor = '#E5F0FF'" onMouseOut ="this.style.backgroundColor =''" type=text size=70 name="title">
      <br>
      总置顶帖标题:
      <input style="background-color:#FEFEFF; color:#9999FF; border: 1 double #B4B4B4" onMouseOver = "this.style.backgroundColor = '#E5F0FF'" onMouseOut ="this.style.backgroundColor =''" type=text size=70 name="content">
      <br>
    </td>
  </tr>
<tr bgcolor=<?=$backgroundcolor?>>
<td><input style="color: #000000; background-color: #f3f3f3; border-style: solid; border-width: 1" onMouseOver ="this.style.backgroundColor='#FFC864'" onMouseOut ="this.style.backgroundColor='#f3f3f3'" type=submit value="提 交">
<input type=hidden name=job value=write>
<input type=hidden name=step value=2>
</td>
  </tr></form>
</table>
    </td>
  </tr>
</table>
<?}

⌨️ 快捷键说明

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