<?php
/*
 * 注意：此文件由tpl_engine编译型模板引擎编译生成。
 * 如果您的模板要进行修改，请修改 templates/default/modules/msgboard/msgboard_more.html
 * 如果您的模型要进行修改，请修改 models/modules/msgboard/msgboard_more.php
 *
 * 修改完成之后需要您进入后台重新编译，才会重新生成。
 * 如果您开启了debug模式运行，那么您可以省去上面这一步，但是debug模式每次都会判断程序是否更新，debug模式只适合开发调试。
 * 如果您正式运行此程序时，请切换到service模式运行！
 * 
 * 如有您有问题请到官方论坛（http://tech.jooyea.com/bbs/）提问，谢谢您的支持。
 */
?><?php
	//引入语言包
	$mb_langpackage=new msgboardlp;

	//变量取得
	$url_uid= short_check(get_argg('user_id'));
	$ses_uid=get_sess_userid();

	//引入模块公共权限过程文件
	$is_self_mode='partLimit';
	$is_login_mode='';
	require("foundation/auser_validate.php");
	require("foundation/fpages_bar.php");
	require("foundation/module_users.php");
	require("foundation/fcontent_format.php");
	//数据表定义区
	$t_message = $tablePreStr."msgboard";
	$t_users = $tablePreStr."users";
	$dbo=new dbex;

	//读写分离定义方法
	dbtarget('r',$dbServs);

	//缓存区
	require($webRoot.$baseLibsPath."model/msgboard_list.model.cache.php");
	if($is_self=='Y' && $url_uid==''){
		//更新提醒
		dbtarget('w',$dbServs);
		$sql="update $t_message set readed=1 where to_user_id='$ses_uid'";
		$dbo->exeUpdate($sql);
		$msg_title=$mb_langpackage->mb_msgb;
	}else{
		$holder_name=get_hodler_name($dbo,$t_users,$url_uid);
		$msg_title=str_replace("{holder}",$holder_name,$mb_langpackage->mb_who_msg);
	}
	$isNull=1;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link rel="stylesheet" type="text/css" href="skin/<?php echo $skinUrl;?>/css/row_menus.css">
<link rel="stylesheet" type="text/css" href="skin/<?php echo $skinUrl;?>/css/iframe.css">
<script type='text/javascript' src="skin/default/js/jooyea.js"></script>
<script type='text/javascript'>	
	function leave_message(user_name,user_id)
	{
		document.getElementById("CONTENT").value="<?php echo $mb_langpackage->mb_res;?>"+user_name+":";
		document.getElementById("user_id").value=user_id;
	}

	parent.guide("msgboard");

  function unitinfocheck(){
  var mood_text=trim(document.getElementById("CONTENT").value);
	if(mood_text==''){
		parent.Dialog.alert("<?php echo $mb_langpackage->mb_no;?>");
		return (false);
	}
		return (true);
  }
</script>
<link rel="stylesheet" type="text/css" href="skin/<?php echo $skinUrl;?>/css/user_ico_small.css">
</head>

<body>
<form method="post" onsubmit="return unitinfocheck();" action="do.php?act=msgboard_send&user_id=<?php echo $userid;?>"  name="myform" >
<input type="hidden" name="user_id" id="user_id" value="" />
  <div class="main_right_title">
     <span class="main_title_dot6"></span>
     <span class="main_title_txt"><?php echo $msg_title;?></span>
  </div>
<div class="photo_view_box">
	<div class="photo_view_content">	
		<div class="magboard_box">
			<textarea name="CONTENT" id="CONTENT" style='width:97%;' rows='4' maxlength="160" onkeyup="return isMaxLen(this)"></textarea>
			<input class="anniu" type="submit" name="Submit" value="<?php echo $mb_langpackage->mb_con;?>" />
			<a id="reply_a_input" class="right" href="javascript:void(0);" onclick="showFace(this,'face_list_menu','CONTENT');"><?php echo $mb_langpackage->mb_face;?></a> 
	   </div>
<?php foreach($mes_rs as $val){?>
	<?php $isNull=0;?>
<dl class="msgboard" onmouseover="this.style.background = '#ecfbff'" onmouseout="this.style.background = '#ffffff'">
	<dt>
		<a target="_blank" href='home.php?h=<?php echo $val['from_user_id'];?>'>
	  <img src="<?php echo $val['from_user_ico'];?>" width="43px" height="43px" onerror="parent.pic_error(this)" /></a>
	</dt>
	<dd><span class="content"><a target="_blank" href='home.php?h=<?php echo $val['from_user_id'];?>'><?php echo filt_word($val['from_user_name']);?></a></span><br /><span class="content"><?php echo filt_word(get_face($val['message']));?></span></dd>
	<dd style="text-align:right;"><span class="time">[<?php echo $val['add_time'];?>]</span>
		<span>
			<?php if($is_self=='Y'){?>
				<a class="album_edit" href="javascript:void(0)" onclick=leave_message("<?php echo $val['from_user_name'];?>","<?php echo $val['from_user_id'];?>");><?php echo $mb_langpackage->mb_res;?></a>
				<a class="album_del" href="do.php?act=msgboard_del&user_id=<?php echo $userid;?>&mess_id=<?php echo $val['mess_id'];?>&app=msgboard_more"><?php echo $mb_langpackage->mb_del;?></a>
			<?php }?>
		</span>
	</dd>
	
</dl>
<?php }?>
<?php page_show($isNull,$page_num,$page_total);?>
</div></div>
	<!-- face begin -->
	<div id="face_list_menu" class="emBg" style="display:none;z-index:100;">
	</div>
	<!-- face end -->
</form>
</body>
</html>
