bbs.php

来自「程序安装简便容易」· PHP 代码 · 共 59 行

PHP
59
字号
<?php
!$_SERVER['PHP_SELF'] && $_SERVER['PHP_SELF']=$_SERVER['SCRIPT_NAME'];
substr($_SERVER['PHP_SELF'],-9,-4)!=='admin' && exit('Forbidden');

require_once(R_P.'cache/bbs.php');

include_once(R_P.'cache/set.php');
$checked_a=$set['indexbbs']=='1' ?' checked' : '';
$checked_b=$set['indexbbs']=='0' ?' checked' : '';

if(!empty($_GET['do']) && $_GET['do']==='set') {
	$indexbbs=$_POST['indexbbs'];
	$query=query("UPDATE duoxun_settings SET value='$indexbbs' WHERE name='indexbbs'");
	if($query) {
		settings();
		header("Location: job.php?job=indexbbs&set=success");
	} else {
		header("Location: job.php?job=indexbbs&set=fail");
	}
}		

if(!empty($_GET['showorder']) && $_GET['showorder']==='change') {
	foreach($_POST as $key=>$value) {
		query("UPDATE duoxun_bbs SET showorder='$value' WHERE bid='$key'");			
	}
	bbs();
	header("Location: job.php?job=indexbbs&showorder=change");
} elseif(!empty($_GET['edit']) && $_GET['edit']==='yes') {
	$query=query("UPDATE duoxun_bbs SET showorder='{$_POST['showorder']}',bname='{$_POST['bname']}',bcode='{$_POST['bcode']}',bmore='{$_POST['bmore']}' WHERE bid='{$_GET['id']}'");
	if($query) {
		bbs();
		header("Location: job.php?job=indexbbs&edit=yes");
	} else {
		echo "<script language=\"javascript\">alert(\"编辑失败!请重试!\")</script>";
		echo "<meta http-equiv='refresh' content='0;url=admin.php?job=indexbbs&do=admin'>";
	}			
} elseif(!empty($_GET['add']) && $_GET['add']==='yes') {
	$query=query("INSERT INTO duoxun_bbs (showorder,bname,bcode,bmore) VALUES ('{$_POST['showorder']}','{$_POST['bname']}','{$_POST['bcode']}','{$_POST['bmore']}')");
	if($query) {
		bbs();
		header("Location: job.php?job=indexbbs&add=yes");
	} else {
		echo "<script language=\"javascript\">alert(\"添加失败!请重试!\")</script>";
		echo "<meta http-equiv='refresh' content='0;url=admin.php?job=indexbbs&do=admin'>";
	}			
} elseif(!empty($_GET['del']) && $_GET['del']==='yes') {
	$query=query("DELETE FROM duoxun_bbs WHERE bid='{$_GET['id']}'");
	if($query) {
		bbs();
		header("Location: job.php?job=indexbbs&del=yes");
	} else {
		echo "<script language=\"javascript\">alert(\"删除失败!请重试!\")</script>";
		echo "<meta http-equiv='refresh' content='0;url=admin.php?job=indexbbs&do=admin'>";
	}	
}

require_once template('bbs','admin');

?>

⌨️ 快捷键说明

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