www.gusucode.com > 仿51.com的php源码 1.1 > vip_getindexguestbookleft.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>
/*********Js Function Begin*********/
/**
* BLOG 留言头像定位
*
* @param obj object <img>元素对象
* @param str string 包含<img>元素的上层元素的id属性值
* @param width int 头像图象显示宽度
* @param height int 头像图象显示高度
*
* @return left string 头像图象style 的left 值
*/
function AppGetImageLeft(obj, str, width, height)
{
	var w = obj.width;
	var left = 0;
	if (w == 0) {
		var src = obj.src;
		var image = new Image();
		image.src = src;
		w = image.width;
	}
	if (w == 0) {
		left = 0;
	}else {
		if (w > width) {
			left = 0-(w - width)/2;
		}else {
			left = (width - w)/2;
		}
	}
	obj.parentElement.parentElement.style.left = left+"px";
}
/*********Js Function End*********/
</script>

<meta http-equiv="Content-Type" content="text/html; charset=GB2312" />
<link href="Style/<?php echo $cssid; ?>/Style_<?php echo $cssid; ?>.css" rel="stylesheet" type="text/css" />


<title>                                                       </title>


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

<script>
function FocusTextArea(){
	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 = 130 + "px";
		moodListObj.style.left = 25 + "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; ?>.js";
	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 html = "";
	html += "<div id='guestbook_style_body' class='ribo t' align='left' style='width:294px;margin:0px;margin-bottom:10px;'>";
	html += "<TABLE width='100%' border='0' align='left' cellpadding='0' cellspacing='0' style='WORD-WRAP:break-word;'>";
	html += "<TR>";
	html += "<!-- 头像 -->";
	html += "<TD width='80' valign='top' style='padding-left:10px;padding-top:10px;'>";
	html += "<scr"+"ipt src='"+userjs+"'></scr"+"ipt>";
	html += "<a href='home.php?user="+VisitUser+"' target='_blank'>";
	html += "<img width=60 border=0 src='"+eval(VisitUser+'_photo')+"'>";
	html += "</a>";
	html += "<BR>";
	html += "<br/>";
	html += "<br/>";
	html += "</TD>";
	html += "<!-- 留言内容 -->";
	html += "<TD valign='top'>";
	html += "<TABLE style='width:200px;padding:5px;'>";
	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;";
	if(userphoto != 0){
		html += "	<img src=images/ivip.gif >";
	}
	html += "</div></td>";
	html += "</TR>";
	html += "<TR>";
	html += "<TD width='200'  height='100px' class='lyco' valign='top' style='width:180px;WORD-WRAP:break-word;padding-top:10px;'>";
	html += postMemo+"<div style='height:10px;'></div>";
	html += "</TD>";
	html += "</TR>";
	html += "</TR>";
	html += "<TR>";
	html += "<TD height='30'  style='text-align:right;'>"+postTime+"</TD>";
	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' style='width:294px;'>";
		html2 += "<TABLE width='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("vip_getindexguestbookleft").style.height=document.body.scrollHeight;
	}
}
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=" 提交留言 ";
}
</script>
<div id="message" class="c" style='width:294px;'>
<div id='guestbook_style_head' class="riti t" style='width:294px;'>
<TABLE width='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="left" style='width:294px;margin-bottom:10px;padding:8px;'>
<TABLE border="0" align="center" cellpadding="0" cellspacing="0">
<Form id="theform1" name="form1" target='tempframe' 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)){SubmitCommentForms(this, 'SubmitComment')}}"></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></TD>
</TR>
</FORM>
<iframe style="display:none" name="tempframe"></iframe>
</TABLE>
</div>
</div>



<script language='javascript'>
document.all('f_Guest_Memo').style.width = 260;
document.all('f_Guest_Memo').style.height = 50;
</script>


<div id='guestbookbigarea'>



<div id='guestbook_style_head' class="riti t" style='width:294px;'>
<TABLE width='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="left" style='width:294px;margin:0px;margin-bottom:10px;'>
<TABLE width="100%" border="0" align="left" cellpadding="0" cellspacing="0" style="WORD-WRAP:break-word;">
<TR>
<!-- 头像 -->
<TD width="80" valign="top" style='padding-left:10px;padding-top:10px;'>
<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=60 border=0 src=\''+<?php echo $row["User_Account"]; ?>_photo+'\'>');
</script>
</a>
<BR>
<br/>
<br/>
</TD>
<!-- 留言内容 -->
<TD valign='top'>
<TABLE style='width:200px;padding:5px;'>
<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>
</div></td>
</TR>
<TR>


<TD width="200"  height="80px" class="lyco" valign="top" style='width:180px;WORD-WRAP:break-word;padding-top:10px;'>
<?php echo ubb($row["Guest_Memo"]); ?><div style='height:10px;'></div>
</TD>
</TR>
<TR>

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

</TR>
<TR>
<TD height="30"  style='text-align:right;'><?php echo $row["Guest_AddDate"]; ?></TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
</div>
<?php }?>


</div>

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

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