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

📄 global.php

📁 酷蝶XP留言本(TEXT)这款留言薄软件是为单机用户专门量身定做
💻 PHP
字号:
<?php
/**********************************************************************

	  	        Dream Fly GuestBook 3.2 for Text (v20050206)

       版    本:3.0.23
       程序设计:浪 者
       版权所有:(C)1999-2005 酷虫工作室

       创    建:2003/11/20 11:22:00
       修    改: 2005/02/06
       演    示:http://xpower.jsphome.com

*************************************************************************/

// + ------------------------
// 常量
define('MSG_SAVE' , 101);
define('MSG_INFO' , 102);
define('MSG_ERR'  , 103);
define('MSG_FAIL' , 104);
define('MSG_SQL'  , 105);

// 数据路径
define('BACKUP_PATH', 	 '_Backup/');				// 备奋目录,以 "/" 结束,如 "_Backup/"
define('DATA_PATH',		 '_Datas/');				// 数据目录,以 "/" 结束,如 "_Datas/"
define('DATA_LIST_FILE', DATA_PATH.'list_db.php');  // 数据索引文件,可以自定义路径,如 "./list.php";

define('SOFT_VER' ,'3.2');

$words["switch"] =  array("关闭","打开");
$words["gender"] =  array("美眉","帅哥");

// + ------------------------
// 文本操作核心函数
function writetofile($file_name,$data,$method='w') { //Write file
	$filenum=fopen($file_name,$method);
	flock($filenum,LOCK_EX);
	$file_int=fwrite($filenum,$data);
	fclose($filenum);
	return $file_int;
}

function readfromfile($file_name) { //Read file
	$filenum=fopen($file_name,'r');
	flock($filenum,LOCK_SH);
	$file_data=fread($filenum,filesize($file_name));
	fclose($filenum);
	return $file_data;
}

// + ------------------------
// 输入内容安全转换
function safe_input($d) {
  global $filters;
  
  //敏感词汇
  if(is_array($filters))
  	  $d = preg_replace('/('.join('|',$filters).')/i', '***', $d);

  $d = str_replace('|', ' ',$d);
  $d = str_replace("\t",'',$d);
  $d = str_replace("\r",'',$d);
  $d = htmlspecialchars($d);
  $d = str_replace("\n",'<br>',$d);
  $d = str_replace('  ',' &nbsp;',$d);
  return $d;
}


// ++ ----------------------
// 打印输出
function TitleBar($title){
	global $cfg;
	print <<< EOT
<!--Title Bar-->
<table border=0 cellpadding=0 cellspacing=0 width=730 height=45>
<tr>
  <td valign=top> &nbsp;<img src=images/announce.gif align=middle> <b>系统公告:</b>[ <script language=javascript>timeString()</script> ]
  <br><marquee onmouseover="this.stop();" onmouseout="this.start();" style="MARGIN-LEFT: 14px;" scrollamount=3 width=340 height=24 align=bottom><img src=images/dog.gif border=0 align=middle> $cfg[board_news] </marquee>
  </td>
  <td align=right valign=top><a href=index.php?MOD=write><img src=images/write.gif border=0></a> <a href=index.php?MOD=write><b>签写留言</b></a>
  <a href=index.php?&MOD=system><img src=images/setup.gif border=0></a> <a href=index.php?MOD=system><b>控制面板</b></a> &nbsp;
  </td>
</tr>
</table>
<table border=0 cellpadding=0 cellspacing=0 width=730 class=TitleBar>
<tr>
<td class=TitleBar_L></td>
<td class=TitleBar_T> ≡ $title ≡ </td>
<td class=TitleBar_R></td>
</tr>
</table>
EOT;
}

function Hemline(){
print <<< EOT
<!--Hemline-->
<table border=0 cellpadding=0 cellspacing=0 width=730 class=Hemline>
<tr>
<td class=Hemline_L></td>
<td class=Hemline_T><img style="width:1; height:0"></td>
<td class=Hemline_R></td>
</tr>
</table>
EOT;
}

function ShowMsg($msg,$type=MSG_ERROR,$actions=''){ // 输出信息
	global $P;
	
	switch ($type) {
      case MSG_SAVE:
         $msg='<b>恭喜您:</b> '.$msg;
         $actions =array('[ <a href=index.php?P=' .$P. '>返回留言本</a> ]','<a href=index.php?MOD=system>返回控制面版</a>','<a href=index.php?MOD=logout>退出管理</a>');
         $img='MsgInfo.gif';
         break;
      case MSG_ERROR:
         $msg='<b>操作失败:</b> '.$msg;
         $actions = '[ <a href="javascript:history.go(-1);">返回上一页,重新输入</a> ]';
         $img='MsgError.gif';
	      break;
      case MSG_FAIL:
         $msg='<b>非法操作:</b> '.$msg;
         $actions = array('<a href="javascript:history.go(-1);">返回上一页,检查您的输入是否有误</a>',"<a href=index.php?MOD=login>重新登录,进入管理</a>");
         $img='MsgWarn.gif';
         break;
      case MSG_SQL:
         $msg='<b>服务器错误:</b> '.$msg.'<br><br>这可能是有于数据读、写错误造成的。请您稍后再试,或与系统管理员联系。';
         $actions = array('<a href="javascript:history.go(-1);">返回上一页,重试一次</a>',"[ <a href=index.php>返回首页</a> ]");
         $img='MsgWarn.gif';
         break;
      default:
         $img='MsgInfo.gif';
   }
   if(is_array($actions)){
   	foreach($actions as $v)	$act.="<p><li>$v</li></p>\n";
   }else{
      $act.="<p><li>$actions</li></p>\n";
   }
	TitleBar('系统信息');
	print <<< EOT
<table border=0 cellpadding=0 cellspacing=0 width=730 class=TextBox_1>
  <tr>
    <td width=5 rowspan=4 class=Border_L></td>
    <td height=1 colspan=2 class=BgLine></td>
    <td width=5 rowspan=4 class=Border_R></td>
  </tr>
  <tr><td height=8 colspan=2></td></tr>
  <tr>
    <td width=200 align=right valign=top><br><img src=images/$img width=48 height=48 align=absmiddle></td>
    <td width=420 valign=top><br>
		$msg
		$act
    </blockquote>
    </td>
  </tr>
  <tr><td height=8 colspan=2></td></tr>
</table>
EOT;
	Hemline();
}

function JumpUrl($url=0,$jumptime=4){

	$url = (is_int($url)) ? "window.history.go($url);" : "location.href=\"$url\"; ";
	print'
<SCRIPT language=javascript>
<!--
var secs = ' .$jumptime. '; //秒
for(i=1;i<=secs;i++) {
	window.setTimeout("update(" + i + ")", i * 1000);
}
function update(num) {
	if(num == secs) {
		'.$url.'
	}
}
//-->
</SCRIPT>
';
}

function SetupBar($title){
   global $MOD;
   TitleBar($title);
   $soft_ver = SOFT_VER;
   print<<< SETUP
<table border=0 cellpadding=0 cellspacing=0 width=730 class=TextBox_1>
  <tr>
    <td width=5  rowspan=4 class=Border_L></td>
    <td height=1 colspan=3 class=BgLine></td>
    <td width=5  rowspan=4 class=Border_R></td>
  </tr>
  <tr>
    <td height=8 colspan=3></td>
  </tr>
  <tr>
    <td width=150 valign=top align=center>
   	<p><br>
		<p><b>Dream Fly $soft_ver
     	<p>控 制 面 板</b>
<Script>
function alertBox(){
	window.alert('该功能将在稍后推出!敬请期待。');
}
</Script>
    <p>[ <a href=index.php title="对留言进行回复、删除操作">留言管理</a> ]
   	<p>[ <a href=index.php?MOD=setup title="设置留言本密码、风格等">版面设置</a> ]
<!--    <p>[ <a href=# title="对留言数据库进行备份、恢复备份" onClick="alertBox()">留言备份</a> ]
    <p>[ <a href=# title="编辑更多页面风格" onClick="alertBox()">风格编辑</a> ]
-->	<p>[ <a href=index.php?MOD=security title="设置敏感词汇,限制发言 IP 增强系统安全">安全设置</a> ]
    <p>[ <a href=index.php?MOD=quickdel title="以多种方式批量删除旧贴">批量删除</a> ]
	<p>[ <a href=index.php?MOD=system title="查询系统信息及 Dream Fly 最新版本">系统信息</a> ]
   	<p>[ <a href=index.php?MOD=logout title="安全退出管理"><font class=insist>退出管理</font></a> ]
    </td>
    <td width=1 class=bgLine> </td>
    <td align=center><br>
   	<form name=form1 method=POST action="index.php?MOD=$MOD" id=form1>
   	<p><b>Dream Fly $soft_ver 留言本 $title</b></p>
SETUP;
}

function SetupLine(){
	print"
    </td></form>
  </tr>
  <tr>
    <td height=8 colspan=2></td>
  </tr>
</table>";
	Hemline();
}
?>

⌨️ 快捷键说明

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