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

📄 main.php

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

	  	        Dream Fly GuestBook 3.2 for Text (v20050206)

       程序设计:浪 者
       版权所有:(C)1999-2005 酷虫工作室
       演    示:http://xpower.jsphome.com

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

if(!defined('INDEX_POST')) die('非法操作!<a href=../index.php>返回</a>');

require_once 'include/ubbcode.php';

if(file_exists( DATA_LIST_FILE )){
	$ListDatas = @file( DATA_LIST_FILE );
	$MsgNum = count($ListDatas)-1;
}else{
	writetofile( DATA_LIST_FILE, "<? die() ?>\n" );
	$MsgNum = 0;
}

if($MsgNum>=1){
	
	rsort($ListDatas);

	if(!($P>0)) $P=1;
	$Pages = ceil($MsgNum/$cfg[max_page]);
	if($P>$Pages) $P=$Pages;

	$start = ($P-1) * $cfg[max_page] + 1;

print <<< TOOLTIP
<div id=toolTipLayer style="position:absolute; visibility: hidden; z-index:1; filter = \'alpha(opacity=75)\';"></div>
<Script language="JavaScript">
function toolTip(msgName, msgEmail, msgPage, msgOicq, msgIp, msgTime){
    if(msgName!=null){
    	var	content = '<table align=left><tr><td nowrap class=ToolTip>' +
    		' 姓名: ' + msgName +  '<br>' +
    		' 邮件: ' + msgEmail +  '<br>' +
    		' 主页: ' + msgPage +  '<br>' +
    		' Q Q : ' + msgOicq +  '<br>' +
    		' I P : ' + msgIp +  '<br>' +
    		' 时间: ' + msgTime +  '&nbsp\;</td></tr></table>';
		showToolTip(content);    
    }else{
    	showToolTip();
    }
}
initToolTips();
</Script>
TOOLTIP;

	TitleBar('最新留言');

	for($i=0; $i < $cfg[max_page]; $i++){
		if(($id = $i+$start)>$MsgNum) break;
		$fname = DATA_PATH.trim($ListDatas[$id]).".php";
		//if(file_exists($fname)){
			$info = explode('|',@readfromfile($fname));
			$info[1] = trim($ListDatas[$id]);
			MakeText($info,$ADMIN);
		//}
	}
	Hemline();
	MakePages($MsgNum,$Pages,'index.php?MOD=main');
}else{
	$msg = '欢迎光顾 '.$cfg[user_name].' 的留言本,这里还没有任何的留言。';
    $act = array("<a href=index.php?MOD=write>我要开始新的留言</a>","<a href=index.php?MOD=login>斑竹登录修改资料</a>");
	ShowMsg($msg,MSG_INF,$act);
}



// +---------------------------------

function MakeText($info,$Author){
   global $P,$cfg,$words;
  	static $tmp_i = 0;	// 静态变量
	// 版子样式
   $tmp_tag = ($tmp_i++)%2+1;
	// 管理
   $tmp_admin = ($Author) ?  "<img src=images/revort.gif border=0> <a href=\"index.php?MOD=revort&P=$P&MID=$info[1]\">回复</a> <img src=images/delete.gif border=0> <a href=\"index.php?MOD=kill&P=$P&MID=$info[1]\" OnClick=\"JavaScript: if(confirm('确实要删除这条留言吗?')) return true; else return false;\">删除</a>":'';
  	// 时间
   $tmp_time  = date($cfg[time_type],$info[1]);
   // 心情
   $tmp_emote = ($info[9]=='0'||empty($info[9])) ? '': '今天心情 <img src=images/emote/e'.$info[9].'.gif border=0 width=18 height=18>';
  	// 悄悄话
   if($info[2]){
   	$info[11] = ($Author) ? '悄悄话:'.conver($info[11]) : '此处内容被隐去,只有管理员才能查看!';
   } else {
      $info[11] = conver($info[11]);
   }
   // IP
   $info[13]= ($Author) ? $info[13] : preg_replace("/^([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)[0-9]{1,3}$/","\\1***",$info[13]);

   print <<< EOT
<!-- Text Box -->
<table border=0 width=730 cellspacing=0 cellpadding=0 class=TextBox_$tmp_tag>
<tr>
<td rowspan=5 class=Border_L></td>
<td width=720 height=1 colspan=3 class=bgLine></td>
<td rowspan=5 class=Border_R></td>
</tr>
<tr>
<td width=144 height=8></td>
<td width=1></td>
<td width=575></td>
</tr>
<tr>
<td valign=top>
 &nbsp;
<div align=center><b>$info[3]</b><br><br>
<img src=images/face/$info[8].gif border=0 width=100 height=100 OnMouseOver="toolTip('$info[3]', '$info[5]', '$info[6]', '$info[7]', '$info[13]', '$tmp_time');" OnMouseOut="toolTip();">
<br><br>我是:{$words["gender"]["$info[4]"]}<br>
$tmp_emote<br>
</div>
</td>
<td width=1 class=bgLine> </td>
<td valign=top>
 &nbsp;<img alt="$info[5]" border=0 src=images/email.gif width=16 height=16> <a href="mailto:$info[5]">信箱</a>
 <img alt="$info[6]" src=images/home.gif border=0 width=16 height=16> <a href="$info[6]" target=_blank>主页</a>
 <img alt="$info[3] 的 QQ 号码:$info[7]" src=images/oicq.gif border=0 width=16 height=16> Oicq
 <img alt="IP 地址:$info[13]" border=0 src=images/ip.gif width=16 height=15> 地址
 <img alt="$tmp_time" border=0 src=images/time.gif width=16 height=16> 发表时间:$tmp_time
 $tmp_admin
 <hr align=left width=70% size=1 noshade>
<!--# Text -->
<table border=0 width=96% cellspacing=4 cellpadding=4>
<tr>
<td class=booktext><div class=booktext>
$info[11]
</div></td>
</tr>
</table>
<!-- Text End-->
</td>
</tr>
EOT;

if(trim($info[17])) {
	$tmp_time  = date($cfg[time_type],$info[16]);
   $tmp_revort = conver($info[17]);
   print <<< EOT
<tr>
<td valign=top align=center>
<hr align=right width=80% size=1 noshade>
版主回复<br>$tmp_time
</td>
<td width=1 class=bgLine></td>
<td valign=top>
<hr align=left width=80% size=1 noshade>
<!--# Revort -->
<table border=0 width=96% cellspacing=4 cellpadding=4 class=booktext>
<tr>
<td class=Revort>
$tmp_revort
<br></td>
</tr>
</table>
<!-- Revort -->
</td>
</tr>
EOT;
}
print"
<tr><td height=8 colspan=3></td></tr>
</table>";
}
/*
function seekbox($all=0){
   $html='<form action=index.php method=GET OnSubmit="javascript: if(this.STR.value==\'\' || this.STR.value.length<2){ alert(\'您没有填写搜索关键词,或者您的关键词太短!\n请重新填写至少 2 个字符。\');return false;}else{ return true;}">'
     .'搜索:<input type=hidden value="seek" name=MOD>'
     .'<input class=text size=13 name=STR>';
   $html.= ($all) ? '<input type=submit value="搜索" class=button><br> <input type=radio name=TRY value=c checked>内容查询 <input type=radio name=TRY value=n>姓名查询 </form>': '</form>';
	return $html;
}
*/
function MakePages($MsgNum,$Pages,$url){
   global $P,$cfg;

   print'<table width=730 border=0 cellspacing=0 cellpadding=0>'
     .'<tr><td nowrap valign=bottom width=100> </td>'
     .'<td align=center width=530 valign=bottom> <form> ';

   $TP = floor(($P-0.5)/ $cfg[max_list] ) * $cfg[max_list];

   echo ($P==1) ? '<font face="Webdings" color=#990000>9</font>' : "<a href=$url&P=1 title=\"首页\"><font face=\"Webdings\" color=#990000>9</font></a> ";
   echo ($TP>1) ? "<a href=$url&P=$TP title=\"第 $TP 页\"><font face=\"Webdings\" color=#990000>7</font></a> ": '<font face="Webdings" color=#990000>7</font>';
   echo ' [ ';
   for($i=1;$i<=$cfg[max_list];$i++){
   	if($TP++ == $Pages) break;
	   if($TP==$P) echo "<b>$TP</b> ";
		else echo "<a href=$url&P=$TP title=\"第 $TP 页\">$TP</a> ";
  	}
   echo '] ';
   echo ($TP<$Pages) ? "<a href=$url&P=".++$TP." title=\"第 $TP 页\"><font face=\"Webdings\" color=#990000>8</font></a>" : '<font face="Webdings" color=#990000>8</font>';
   echo ($P==$Pages) ? '<font face="Webdings" color=#990000>:</font>' : "<a href=$url&P=$Pages title=\"尾页\"><font face=\"Webdings\" color=#990000>:</font></a> ";

	print"</form></td><td align=right valign=bottom nowrap>
     <form>
     共 $MsgNum 条留言,$Pages 页
     </form>
     </td></tr></table>";
}

?>

⌨️ 快捷键说明

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