<?php
include("includes/inc_header.php");
echo "<p>";
$db->execute("SELECT * FROM `".$g_db_prefix."words` WHERE u_ID='".$u_id."'");
if($db->count()==0)
{
?>
<table width="640" border="0" align="center" cellpadding="0" cellspacing="0" class="tableborder">
<tr>
<th width="90" height="20"><a href="#" onclick="javascript:document.all.post.style.visibility='visible'">我要留言</a></th>
<th width="507" align="left"> </th>
</tr>
<tr>
<td height="20" colspan="2" align="center">感谢访问 <?php echo $u_title?> 留言板,欢迎留言。</td>
</tr>
</table>
<?php
}
else
{
?>
<table width="640" border="0" align="center" cellpadding="0" cellspacing="0" class="tableborder" style="word-break:break-all">
<tr>
<th width="80" height="20"><a href="#" onclick="javascript:document.all.post.style.visibility='visible'">我要留言</a></th>
<td width="558" align="right">
<?php
if(isset($_GET["page"]))
$page = (int)$_GET["page"];
else
$page = 1;
$getpage = new Page($page, $db->count(), $u_pagesize);
echo "共 <font class=\"pagefont\">".$getpage->count()."</font> 页 ";
echo "<a href=\"index.php?id=".$u_id."&page=".$getpage->begin()."\">|<</a> <a href=\"index.php?id=".$u_id."&page=".$getpage->pre()."\"><<</a> ";
if($getpage->getpage() < 10)
{
$k = 1;
$j = $getpage->count();
}
else
{
$k = $getpage->getpage() - 9;
$j = $getpage->getpage() + 9;
}
for($i = $k; $i <= $j; $i++)
if($i==$page)
echo " <a href=\"index.php?id=".$u_id."&page=$i\"><font class=\"pagefont\">$i</font></a> ";
else
echo " <a href=\"index.php?id=".$u_id."&page=$i\">$i</a> ";
echo " <a href=\"index.php?id=".$u_id."&page=".$getpage->next()."\">>></a> <a href=\"index.php?id=".$u_id."&page=".$getpage->end()."\">>|</a>";
$db->execute("SELECT * FROM ".$g_db_prefix."words WHERE u_ID='".$u_id."' ORDER BY w_ID DESC LIMIT ".$getpage->start().", ".$u_pagesize);
?>
</td>
</tr>
<?php
while($dbrow = $db->reader())
{
?>
<tr><td colspan="2"><hr class="tableborder"></td></tr>
<tr>
<td height="40" align="center"><table width="100%" border="0" cellspacing="0" cellpadding="0" style="word-break:break-all">
<tr>
<th align="center"><?php echo $dbrow["w_name"]?></th>
</tr>
</table></td>
<td>
<?php
if(!empty($dbrow["w_mail"]))
echo "<a href=\"mailto:".$dbrow["w_mail"]."\" target=\"_BLANK\"><img src=\"".$s_path."mail.gif\" width=\"32\" height=\"32\" alt=\"".$dbrow["w_mail"]."\" border=\"0\"></a> ";
else
echo "<img src=\"".$s_path."mail.gif\" alt=\"无\"> ";if(!empty($dbrow["w_QQ"]))
echo "<a href=\"http://friend.qq.com/cgi-bin/friend/user_show_info?ln=".$dbrow["w_QQ"]."\" target=\"_BLANK\"><img src=\"".$s_path."qq.gif\" width=\"32\" height=\"32\" alt=\"".$dbrow["w_QQ"]."\" border=\"0\"></a> ";
else
echo "<img src=\"".$s_path."qq.gif\" alt=\"无\"> ";if(!empty($dbrow["w_web"]))
echo "<a href=\"".$dbrow["w_web"]."\" target=\"_BLANK\"><img src=\"".$s_path."url.gif\" width=\"32\" height=\"32\" alt=\"".$dbrow["w_web"]."\" border=\"0\"></a> ";
else
echo "<img src=\"".$s_path."url.gif\" alt=\"无\"> ";
if($u_IP == "S")
$ip = $dbrow["w_IP"];
else
$ip = "已记录";
echo "<img src=\"".$s_path."ip.gif\" width=\"32\" height=\"32\" alt=\"".$ip."\" >";
?>
</td>
</tr>
<tr>
<td height="80" align="center" valign="top">
<?php
$imgfile = $h_path.$dbrow["w_head"].".gif";
if(!file_exists($imgfile))
$imgfile = "head/none.gif";
?>
<img src="<?php echo $imgfile?>" width="72" height="72">
</td>
<td rowspan="2" valign="top">
<?php
echo $dbrow["w_title"]."<hr class=\"tableborder\" width=\"98%\">".$dbrow["w_content"];
if(!empty($dbrow["w_re"]))
echo "<hr class=\"tableborder\" width=\"98%\">站长回复:".$dbrow["w_re"];
?>
</td>
</tr>
<tr>
<td height="40" align="center">
<?php
$datetime = explode(" ",$dbrow["w_date"]);
echo $datetime[0]."<br>".$datetime[1];
?></td>
</tr>
<?php }?>
</table>
<?php }?>
<p>
<div id="post" style="position:absolute; top:45px; width:325px; height:270px; z-index:1; visibility: hidden; left: 327px;" align="center">
<script language="JavaScript">
<!--
function verifyAddress(obj)
{
var email = obj;
var pattern = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/;
flag = pattern.test(email);
if(flag)
return true;
else
return false;
}
function regcheck() {
if (this.document.words.name.value==""){
window.alert("请输入用户名!");
this.document.words.name.focus();
return;
}
if (this.document.words.mail.value!="")
if(!verifyAddress(document.words.mail.value))
{
window.alert("请输入正确的电子邮件!");
document.words.mail.select();
document.words.mail.focus();
return;
}
include("includes/inc_header.php");
echo "<p>";
$db->execute("SELECT * FROM `".$g_db_prefix."words` WHERE u_ID='".$u_id."'");
if($db->count()==0)
{
?>
<table width="640" border="0" align="center" cellpadding="0" cellspacing="0" class="tableborder">
<tr>
<th width="90" height="20"><a href="#" onclick="javascript:document.all.post.style.visibility='visible'">我要留言</a></th>
<th width="507" align="left"> </th>
</tr>
<tr>
<td height="20" colspan="2" align="center">感谢访问 <?php echo $u_title?> 留言板,欢迎留言。</td>
</tr>
</table>
<?php
}
else
{
?>
<table width="640" border="0" align="center" cellpadding="0" cellspacing="0" class="tableborder" style="word-break:break-all">
<tr>
<th width="80" height="20"><a href="#" onclick="javascript:document.all.post.style.visibility='visible'">我要留言</a></th>
<td width="558" align="right">
<?php
if(isset($_GET["page"]))
$page = (int)$_GET["page"];
else
$page = 1;
$getpage = new Page($page, $db->count(), $u_pagesize);
echo "共 <font class=\"pagefont\">".$getpage->count()."</font> 页 ";
echo "<a href=\"index.php?id=".$u_id."&page=".$getpage->begin()."\">|<</a> <a href=\"index.php?id=".$u_id."&page=".$getpage->pre()."\"><<</a> ";
if($getpage->getpage() < 10)
{
$k = 1;
$j = $getpage->count();
}
else
{
$k = $getpage->getpage() - 9;
$j = $getpage->getpage() + 9;
}
for($i = $k; $i <= $j; $i++)
if($i==$page)
echo " <a href=\"index.php?id=".$u_id."&page=$i\"><font class=\"pagefont\">$i</font></a> ";
else
echo " <a href=\"index.php?id=".$u_id."&page=$i\">$i</a> ";
echo " <a href=\"index.php?id=".$u_id."&page=".$getpage->next()."\">>></a> <a href=\"index.php?id=".$u_id."&page=".$getpage->end()."\">>|</a>";
$db->execute("SELECT * FROM ".$g_db_prefix."words WHERE u_ID='".$u_id."' ORDER BY w_ID DESC LIMIT ".$getpage->start().", ".$u_pagesize);
?>
</td>
</tr>
<?php
while($dbrow = $db->reader())
{
?>
<tr><td colspan="2"><hr class="tableborder"></td></tr>
<tr>
<td height="40" align="center"><table width="100%" border="0" cellspacing="0" cellpadding="0" style="word-break:break-all">
<tr>
<th align="center"><?php echo $dbrow["w_name"]?></th>
</tr>
</table></td>
<td>
<?php
if(!empty($dbrow["w_mail"]))
echo "<a href=\"mailto:".$dbrow["w_mail"]."\" target=\"_BLANK\"><img src=\"".$s_path."mail.gif\" width=\"32\" height=\"32\" alt=\"".$dbrow["w_mail"]."\" border=\"0\"></a> ";
else
echo "<img src=\"".$s_path."mail.gif\" alt=\"无\"> ";if(!empty($dbrow["w_QQ"]))
echo "<a href=\"http://friend.qq.com/cgi-bin/friend/user_show_info?ln=".$dbrow["w_QQ"]."\" target=\"_BLANK\"><img src=\"".$s_path."qq.gif\" width=\"32\" height=\"32\" alt=\"".$dbrow["w_QQ"]."\" border=\"0\"></a> ";
else
echo "<img src=\"".$s_path."qq.gif\" alt=\"无\"> ";if(!empty($dbrow["w_web"]))
echo "<a href=\"".$dbrow["w_web"]."\" target=\"_BLANK\"><img src=\"".$s_path."url.gif\" width=\"32\" height=\"32\" alt=\"".$dbrow["w_web"]."\" border=\"0\"></a> ";
else
echo "<img src=\"".$s_path."url.gif\" alt=\"无\"> ";
if($u_IP == "S")
$ip = $dbrow["w_IP"];
else
$ip = "已记录";
echo "<img src=\"".$s_path."ip.gif\" width=\"32\" height=\"32\" alt=\"".$ip."\" >";
?>
</td>
</tr>
<tr>
<td height="80" align="center" valign="top">
<?php
$imgfile = $h_path.$dbrow["w_head"].".gif";
if(!file_exists($imgfile))
$imgfile = "head/none.gif";
?>
<img src="<?php echo $imgfile?>" width="72" height="72">
</td>
<td rowspan="2" valign="top">
<?php
echo $dbrow["w_title"]."<hr class=\"tableborder\" width=\"98%\">".$dbrow["w_content"];
if(!empty($dbrow["w_re"]))
echo "<hr class=\"tableborder\" width=\"98%\">站长回复:".$dbrow["w_re"];
?>
</td>
</tr>
<tr>
<td height="40" align="center">
<?php
$datetime = explode(" ",$dbrow["w_date"]);
echo $datetime[0]."<br>".$datetime[1];
?></td>
</tr>
<?php }?>
</table>
<?php }?>
<p>
<div id="post" style="position:absolute; top:45px; width:325px; height:270px; z-index:1; visibility: hidden; left: 327px;" align="center">
<script language="JavaScript">
<!--
function verifyAddress(obj)
{
var email = obj;
var pattern = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/;
flag = pattern.test(email);
if(flag)
return true;
else
return false;
}
function regcheck() {
if (this.document.words.name.value==""){
window.alert("请输入用户名!");
this.document.words.name.focus();
return;
}
if (this.document.words.mail.value!="")
if(!verifyAddress(document.words.mail.value))
{
window.alert("请输入正确的电子邮件!");
document.words.mail.select();
document.words.mail.focus();
return;
}
window.alert("请输入主题!");
this.document.words.title.focus();
return;
}
if(this.document.words.content.value==""){
window.alert("请输入留言内容!");
this.document.words.content.focus();
return;
}
this.document.words.Submit.disabled = true;
this.document.words.submit();
return;
}
function changepic(value)
{
this.document.words.pic.src="<?php echo $h_path?>"+value+".gif";
}
function selectpic(value)
{
this.document.words.head.selectedIndex = value - 1;
changepic(value);
document.all.post.style.visibility="visible";
document.all.headpic.style.visibility="hidden";
}
function keyUp()
{
if (event.ctrlKey && event.keyCode== 13)
regcheck();
}
//-->
</script> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tableborder">
<form name="words" method="post" action="post.php" onkeyup="javascript:keyUp();">
<tr align="right">
<td height="20" colspan="2"><a href="#" onclick="javascript:document.all.post.style.visibility='hidden'">关闭-<strong>X</strong></a></td>
</tr>
<tr>
<td width="23%" height="20" align="right">名字:</td>
<td> <input name="name" type="text" class="textbox" id="name" maxlength="32">
<input name="id" type="hidden" id="id" value="<?php echo $u_id;?>">
</td>
</tr>
<tr>
<td height="20" align="right">电子邮件:</td>
<td><input name="mail" type="text" class="textbox" id="mail" maxlength="64"></td>
</tr>
<tr>
<td height="20" align="right">QQ:</td>
<td><input name="QQ" type="text" class="textbox" id="QQ" maxlength="32"></td>
</tr>
<tr>
<td height="20" align="right">个人主页:</td>
<td><input name="web" type="text" class="textbox" id="web" value="http://" maxlength="255"></td>
</tr>
<tr>
<td height="20" align="right">头像:</td>
<td> <select name="head" class="button" id="head" onChange="changepic(this.document.words.head.value)">
<?php
for($i=1;$i<=$h_count;$i++)
{
echo "<option value=\"$i\">头像$i</option>";
}
?>
</select> <img src="<?php echo $h_path;?>1.gif" name="pic" width="72" height="72" align="absmiddle" id="pic"><a href="#" onclick="javascript:document.all.headpic.style.visibility='visible';document.all.post.style.visibility='hidden';">查看全部头像</a></td>
</tr>
<tr>
<td height="20" align="right">标题:</td>
<td><input name="title" type="text" class="textbox" id="title" maxlength="64"></td>
</tr>
<tr>
<td height="20" align="right">帮助:</td>
<td><a href="#" onclick="javascript:document.all.ubbcode.style.visibility='visible';document.all.post.style.visibility='hidden';">如何使用UBB代码</a></td>
</tr>
<tr>
<td height="20" align="right">内容:</td>
<td><textarea name="content" cols="35" rows="8" class="textbox" id="content"></textarea>
</td>
</tr>
<tr align="center">
<td height="20" colspan="2">可使用Ctrl+Enter提交</td>
</tr>
<tr align="center">
<td height="20" colspan="2"><input type="button" name="Submit" value="确定" class="button" onClick="javascript:regcheck();">
<input type="reset" name="Submit2" value="重置" class="button">
</td>
</tr>
</form>
</table>
</div>
<div id="headpic" style="position:absolute; left:212px; top:61px; width:235px; height:99px; z-index:2; overflow: visible; visibility: hidden;">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tableborder">
<tr>
<td align="right"><a href="#" onclick="javascript:document.all.headpic.style.visibility='hidden';document.all.post.style.visibility='visible';">关闭-<strong>X</strong></a>
</td>
</tr>
<tr>
<td><?php
for($i=1;$i<=$h_count;$i++)
{
if(($i % 8)==1)
echo "<br>";
echo "<a href=\"#\" onClick=\"selectpic(".$i.")\"><img src=\"".$h_path.$i.".gif\" border=\"0\" width=\"72\" height=\"72\">";
}
?></td>
</tr>
</table>
</div>
<div id="ubbcode" style="position:absolute; left:299px; top:45px; width:414px; height:84px; z-index:3; visibility: hidden;">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tableborder">
<tr>
<td align="right"><a href="#" onclick="javascript:document.all.ubbcode.style.visibility='hidden';document.all.post.style.visibility='visible';">关闭-<strong>X</strong></a>
</td>
</tr>
<TR>
<TD height=20>使用参数:需要斜体的文字</TD>
</TR>
<TR>
<TD height=20>效果范例: 斜体<EM>斜体</EM></TD>
</TR>
<TR>
<TD height=20><hr></TD>
</TR>
<TR>
<TD height=20>使用参数:需要粗体的文字</TD>
</TR>
<TR>
<TD height=20>效果范例: 粗体<B>粗体</B></TD>
</TR>
<TR>
<TD height=20><hr></TD>
</TR>
<TR>
<TD height=20>使用参数:需要粗体的文字</TD>
</TR>
<TR>
<TD height=20>效果范例: 下划线<U>下划线</U></TD>
</TR>
<TR>
<TD height=20><hr></TD>
</TR>
<TR>
<TD height=20>使用参数:[align=对齐方式]需要下划线的文字[/align],其中对齐方式可填:center, left, right</TD>
</TR>
<TR>
<TD height=20>效果范例:
已经打开了