www.gusucode.com > 仿51.com的php源码 1.1 > vip_getindexguestbook.php

    <?php
 header   ("Cache-Control:   no-cache,   must-revalidate");     
 header   ("Pragma:   no-cache");   
?>
<?php 
include("include/dbclass.php");
include("include/global.php");
$dbc=new DbConn();
$user=$_GET["user"];
$uid=$_COOKIE["uid"];
$type=$_GET["Type"];

$sql="select * from userdata where User_Account='$user'";
$rs=$dbc->getRs($sql);
if($rs==null)
{
echo "没有资料! ";
exit();
}
?>
<?php if((int)$_COOKIE["ucpreviewhomepage"]==1)
{
$cssid=$_COOKIE["tplhomepageid"];
}
else
{
$cssid=$rs["DefaultStyle"];
}
?>

<script>
</script>

<HEAD>
<TITLE></TITLE>
<link href="Style/<?php echo $cssid; ?>/Style_<?php echo $cssid; ?>.css" rel="stylesheet" type="text/css" />
</HEAD>


<style>
body{
background:transparent;
}
</style>

<script>
function FocusTextArea(){
	if (document.all('f_Guest_Memo')) {
		document.all('f_Guest_Memo').focus();
	}
}
</script>
<script src='Ajax.js'></script>
<script src="1e/<?php echo $uid; ?>/<?php echo $uid; ?>.js"></script>

<SCRIPT LANGUAGE="JavaScript">
<!--
var vu = "<?php echo $uid; ?>";
if (vu) {
	var userphoto = eval(vu+"_vip");
}
//-->
</SCRIPT>

<script language="javascript" type="text/javascript">
function showFace() {
	var moodListObj = document.getElementById("face");
	if (moodListObj) {
		moodListObj.style.display = (moodListObj.style.display == "inline") ? "none" : "inline";
		moodListObj.style.top = 120 + "px";
		moodListObj.style.left = 220 + "px";
	}
}
function hiddenFace()
{
	var moodListObj = document.getElementById("face");
	if (moodListObj) {
		moodListObj.style.display = "none";
	}
}
function insert(u)
{
	doInsert("[img]"+u, "[/img]", false);
	hiddenFace();
}
function doInsert(ibTag, ibClsTag, isSingle)
{
	var isClose = false;
	var obj_ta = document.form1.f_Guest_Memo;
	if(obj_ta.isTextEdit){
		obj_ta.focus();
		var sel = document.selection;
		var rng = sel.createRange();
		rng.collapse;
		if((sel.type == "Text" || sel.type == "None") && rng != null){
			if(ibClsTag != "" && rng.text.length > 0)
				ibTag += rng.text + ibClsTag;
			else if(isSingle)
				isClose = true;
			else
				ibTag+=ibClsTag;
			rng.text = ibTag;
		}
	}
	else{
		if(isSingle)
			isClose = true;
		obj_ta.value += ibTag;
	}
	obj_ta.focus();
	return isClose;
}
function showFullPic(num){
	if(canPopup){
		var popWidth=60,popHeight=50;
		var newxx=event.screenX+5;
		var newyy=event.screenY+5;
		oPopup.document.body.innerHTML="<table width='100%' height='100%' border=1 style='border-collapse: collapse;'><tr><td width=100%  height=100% align='center' valign='middle'><img src='/face/"+num+".gif'></td></tr></table>";
		oPopup.show(newxx,newyy,popWidth,popHeight);
	}
}
function hideFullPic() {
	if(canPopup){
		oPopup.hide();
	}
}
function displayGuestBook(postMemo) {
	var userjs = "1e/<?php echo $uid; ?>/<?php echo $uid; ?>";
	var VisitUser = "<?php echo $uid; ?>";
	var postTime = document.form1.f_Guest_AddDate.value;
	var IsHide = document.form1.f_Guest_IsHide.value;
	if (IsHide == '1') {
		return;
	}


var divW = "588";
var tblW = "558";


var html = "";
html += "<div id='guestbook_style_body' class='ribo t' align='Center' style='width:"+divW+"px;margin-bottom:10px;padding:10px'>";
html += "<TABLE width='"+tblW+"' border='0' align='center' cellpadding='0' cellspacing='0' style='WORD-WRAP:break-word;'>";
html += "<TR>";
html += "<!-- 头像 -->";
html += "<TD width='108' valign='top'>";
html += "<scr"+"ipt src='"+userjs+"'></scr"+"ipt>";
html += "<div style='width:80px;height:90px;overflow:hidden;border:solid 1px cccccc;'>";
html += "<div style='position:relative;left:0px'>";
html += "<a href='/home.php?user="+VisitUser+"' target='_blank'>";
html += "<img border=0 src='"+eval(VisitUser+'_photo')+"'>";
html += "</a>";
html += "</div>";
html += "</div>";
html += "</TD>";
html += "<!-- 留言内容 -->";
html += "<TD valign='top'>";
html += "<TABLE style='width:448px;'>";
html += "<TR>";
html += "<TD><div style='height:30px;padding-top:5px;'>";
html += "●&nbsp;<a href='/home.php?user="+VisitUser+"' class='lync' target='_blank'>"+VisitUser+"</a>&nbsp;";
html += "<span id='vipinfo1111'></span>";
if(userphoto != 0){
html += "	<img src=images/ivip.gif >";
}
html += "&nbsp;&nbsp;&nbsp;"+postTime+"</div>";
html += "</TD>";
html += "</TR>";
html += "<TR>";
html += "<TD width='400'  height='100px' class='lyco' valign='top' style='width:400px;WORD-WRAP:break-word;'>";
html += postMemo+"<br>";
html += "</TD>";
html += "</TR>";
html += "<TR>";
html += "</TR>";
html += "</TABLE>";
html += "</TD>";
html += "</TR>";
html += "</TABLE>";
html += "</div>";
if (document.getElementById('guestbooklist')) {
document.getElementById('guestbooklist').innerHTML = html + document.getElementById('guestbooklist').innerHTML;
}else {
var html2 = "";
html2 += "<div id='guestbook_style_head' class='riti t'>";
html2 += "<TABLE width='99%' height='100%'>";
html2 += "<TR>";
html2 += "<TD>";
html2 += "<div id='guestbook_style_head_font' class='rinav'>最新留言</div>";
html2 += "<div id='guestbook_style_head_gd' class='gd'><a target='_blank' href='vip_guestbook.php?user=<?php echo $user; ?>'  >更多&gt;&gt;</a></div>";
html2 += "</TD>";
html2 += "</TR>";
html2 += "</TABLE>";
html2 += "</div>";
html2 += "<div id='guestbooklist'>";
html2 += html;
html2 += "</div>";
document.getElementById('guestbookbigarea').innerHTML = html2;
}
if(document.body.scrollHeight){
parent.document.all("guestbookframe").style.height=document.body.scrollHeight;
}
}
</script>

<script language="javascript" type="text/javascript">
function disabledForm() {
	document.form1.SubmitComment.disabled="disabled";
	document.form1.f_Guest_Memo.disabled="disabled";
	document.form1.SubmitComment.value="正在发送数据...";
}
function enableFrome(flag) {
	document.form1.SubmitComment.disabled=false;
	document.form1.f_Guest_Memo.disabled=false;
	if (flag == 1) {
		document.form1.f_Guest_Memo.value="";
	}
	document.form1.SubmitComment.value=" 提交留言 ";
}
/*
function subToParent()
{
	document.form1.action = "GuestBookSubmitTurn.php?user=qbx02qbx&action=SaveMessage";
	document.form1.target = "_parent";
	document.form1.method = "POST";
	document.form1.submit();
}
function subToIFrame()
{
	document.form1.action = "ProcessInterface_Guestbook.php?user=qbx02qbx&action=SaveMessage";
	document.form1.target = "tempframe";
}
function subGuestBookForm()
{


SubmitCommentForms(document.getElementById('SubmitComment'), 'SubmitComment');


}
*/
//CTRL + ENTER函数
function SubmitCommentForms(obj, field)
{
obj.form.submit();
if (document.all(field)) {
document.all(field).value='正在发送...';
document.all(field).disabled=true;
}
}
</script>


<div id="message"class="c">
<div id='guestbook_style_head' class="riti t">
<TABLE width='99%' height="100%">
<TR>
<TD>
<div id='guestbook_style_head_font' class="rinav">给我留言</div>
</TD>
</TR>
</TABLE>
</div>
<div id='guestbook_style_body' class='ribo t' align="Center" style='width:588px;margin-bottom:10px;padding:10px'>


<TABLE border="0" align="center" cellpadding="0" cellspacing="0">
<Form id="theform1" target='tempframe' name="form1" method="post" action="ProcessInterface_Guestbook.php?user=<?php echo $user; ?>&go=6&action=SaveMessage"  onsubmit="return CountStringLengthG(500);this.SubmitComment.value='正在发送...';this.SubmitComment.disabled=true;">
<TR>
<TD><SPAN><img id='font-face' src='/images/ubbeditor/face.gif' border='0' onclick='DownloadFace();' onmouseout="this.src='/images/ubbeditor/face.gif'" style='cursor:hand;' />&nbsp;</SPAN><br>
<INPUT Name="f_Guest_Sex" type="hidden" value="<?php echo $rs["User_Sex "]; ?>"/>
<textarea Name="f_Guest_Memo" type="TextArea" id="TBlog_Diary_Comment_TextArea" style="filter:alpha(opacity=80);" Cols="95" Rows="6" OnKeyDown="if (event.ctrlKey && event.keyCode == 13){ if(CountStringLengthG(500)){subGuestBookForm()}}"></TextArea>
<INPUT Name="f_Guest_AddDate" type="hidden" value="<?php echo date("Y-m-d h:i:s",strftime(time())); ?>"/><br>
是否悄悄话(只有<?php echo $user; ?>本人才能看到)&nbsp;<select name="f_Guest_IsHide"><option value=0>否</option><option value=1>是</option></select>&nbsp;&nbsp;&nbsp;<input type='submit' style='FILTER:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#FFFFFF, EndColorStr=#9DBCEA);font-size:12px;BORDER:1px solid #002D96;PADDING:2px 2px 0;CURSOR:hand;COLOR:black;;background-color:#BFEFFF;' value="提交留言" Name="SubmitComment" ID="TBlog_Diary_Comment_TextArea"><BR><BR></TD>
</TR>
</FORM>
<iframe style="display:none" name="tempframe"></iframe>
</TABLE>


</div>
</div>





<script language='javascript'>
if (document.all('f_Guest_Memo')) {
	document.all('f_Guest_Memo').style.width = 550;
	document.all('f_Guest_Memo').style.height = 50;
}
</script>



<!-- Use GuestBook Cache -->

<div id='guestbookbigarea'>


<div id='guestbook_style_head' class="riti t">
<TABLE width='99%' height="100%">
<TR>
<TD>
<div id='guestbook_style_head_font' class="rinav">最新留言</div>
<div id='guestbook_style_head_gd' class="gd"><a target="_blank" href="vip_guestbook.php?user=<?php echo $user; ?>"  >更多&gt;&gt;</a></div>
</TD>
</TR>
</TABLE>
</div>
<div id='guestbooklist'>

<?php 
$sql1="select * from guestbook where UserName='$user' and Guest_IsHide='0' order by Guest_AddDate desc limit 0,6";
$result=$dbc->query($sql1);
while ($row=@mysql_fetch_array($result)) {

?>

<div id='guestbook_style_body' class='ribo t' align="Center" style='width:588px;margin-bottom:10px;padding:10px'>
<TABLE width="558" border="0" align="center" cellpadding="0" cellspacing="0" style="WORD-WRAP:break-word;">
<TR>
<!-- 头像 -->
<TD width="108" valign="top" >
<div style='width:80px;height:90px;overflow:hidden;border:solid 1px cccccc;'>
<div style='position:relative;left:0px'>
<script src='1e/<?php echo $row["User_Account"]; ?>/<?php echo $row["User_Account"]; ?>.js'></script>
<a href='home.php?user=<?php echo $row["User_Account"]; ?>' target='_blank'>

<script>
document.write('<img width=80 height=90 class=photo border=0 src=\''+<?php echo $row["User_Account"]; ?>_photo+'\'>');
</script>
</a>
</div>
</div>
</TD>
<!-- 留言内容 -->
<TD valign='top'>
<TABLE style='width:448px;'>
<TR>
<TD><div style='height:30px;padding-top:5px;'>
●&nbsp;<a href='home.php?user=<?php echo $row["User_Account"]; ?>' class='lync' target='_blank'>
<?php echo $row["User_Account"]; ?></a>&nbsp;

<script>
//显示VIP信息
if(<?php echo $row["User_Account"]; ?>_vip != 0){
	document.write('<img src=/i/ivip.gif >');
}
</script>

&nbsp;&nbsp;&nbsp;<?php echo $row["Guest_AddDate"]; ?></div>
</TD>
</TR>
<TR>


<TD width="400"  height="100px" class="lyco" valign="top" style='width:400px;WORD-WRAP:break-word;'>
<?php echo ubb($row["Guest_Memo"]); ?><br><br>
</TD>
</TR>
<TR>

<?php if($row["Replay_Memo"]!=null){?>
<TD width="400" class="lyfh" valign="top">
<TABLE width="400" style='table-layout:fixed;'>
<TR>
<TD><div class="lyff" style='width:400px;WORD-WRAP:break-word;'><span style="font-size: 14px;color: red"><?php echo $row["UserName"]; ?>回复:&nbsp;&nbsp;<?php echo ubb($row["Replay_Memo"]); ?></span><BR><br></div></TD>
</TR>
</TABLE>
</TD>
<?php }?>


</TR>
</TABLE>
</TD>
</TR>
</TABLE>
</div>
<?php }?>

</div>


</div>
</div>
<BR><BR><BR>
<div id="face" style="display:none;border:1px solid #cccccc;position:absolute;"></div>

<script>
parent.document.all("guestbookframe").style.height=document.body.scrollHeight;
parent.document.all("guestbookframe").style.width=document.body.scrollWidth;
</script>