<?php
/*
 * 注意：此文件由tpl_engine编译型模板引擎编译生成。
 * 如果您的模板要进行修改，请修改 templates/default/modules/mood/mood_more.html
 * 如果您的模型要进行修改，请修改 models/modules/mood/mood_more.php
 *
 * 修改完成之后需要您进入后台重新编译，才会重新生成。
 * 如果您开启了debug模式运行，那么您可以省去上面这一步，但是debug模式每次都会判断程序是否更新，debug模式只适合开发调试。
 * 如果您正式运行此程序时，请切换到service模式运行！
 * 
 * 如有您有问题请到官方论坛（http://tech.jooyea.com/bbs/）提问，谢谢您的支持。
 */
?><?php
	//引入语言包
	$mo_langpackage=new moodlp;
	
	//变量取得
	$url_uid= short_check(get_argg('user_id'));
	$ses_uid=get_sess_userid();
	$userico=get_sess_userico();
	//引入模块公共权限过程文件
	$is_self_mode='partLimit';
	$is_login_mode='';
	require("foundation/fcontent_format.php");
	require("foundation/auser_validate.php");
	require("foundation/module_users.php");
	require("foundation/fpages_bar.php");
	//数据表定义区
	$t_mood = $tablePreStr."mood";
	$t_users = $tablePreStr."users";
	//当前页面参数
	$page_num=trim(get_argg('page'));

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

	$sql = "select * from $t_mood where user_id=$userid order by add_time desc limit 0,50";
	$dbo->setPages($set_page_data_num,$page_num);//设置分页	
	$mood_rs = $dbo ->getRs($sql);
	$page_total=$dbo->totalPage;//分页总数
	
	//分页显示
	$isNull=0;
	$data_none='content_none';
	$show_data='';	
	if(empty($mood_rs)){
		$isNull=1;
		$data_none='';
		$show_data='content_none';
	}
	$button="content_none";
	if($is_self=='Y'){
		$data_none='content_none';
		$show_data='';
		$mood_title=$mo_langpackage->mo_mood;
		$button="";
	}else{
		$holder_name=get_hodler_name($dbo,$t_users,$url_uid);
		$mood_title=str_replace("{holder}",filt_word($holder_name),$mo_langpackage->mo_who);		
	}
?>
<!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" />
<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">
<title></title>
<SCRIPT type='text/javascript' src="servtools/ajax_client/ajax.js"></SCRIPT>
<SCRIPT language=JavaScript src="skin/default/js/jooyea.js"></SCRIPT>
<script type='text/javascript'>
function unitinfocheck()
{
var mood_text=trim(document.getElementById("mood").value);
if(mood_text==''){
	parent.Dialog.alert("<?php echo $mo_langpackage->mo_add_err;?>");
  return (false);
}
  return (true);
}

parent.guide("mood");
	 
function mood_com(mood_id,mod_id,type_id,start_num,end_num){
	var obj_mood=$('content_mood_'+mood_id);
	if(obj_mood.style.display=='none'){
		obj_mood.style.display="";
		parent.get_mod_com(mod_id,type_id,start_num,end_num);
	}else{
		obj_mood.style.display='none';
		$('face_list_menu').style.display='none';
	}
}

function show_more(mood_id,len){
	if(len>=160){
		$('contentall_mood_'+mood_id).style.display = '';
	}
} 

</script>
</head>

<body>
<form id="form1" name="form1" method="post" onsubmit="return unitinfocheck();" action="do.php?act=mood_add&user_id=<?php echo $userid;?>">
  <div class="main_right_title">
     <span class="main_title_dot7"></span>
     <span class="main_title_txt"><?php echo $mood_title;?></span>
  </div>
  <div class="top10"></div>
	<div class="mood_send <?php echo $button;?>">
		<div class="my_photo"><img src="<?php echo $userico;?>" onerror="parent.pic_error(this)" alt='' title='' height='43px' width='43px' /></div>
		<div class="send_area">
			<textarea name="mood" id="mood" rows='4' maxlength="160" onmouseover="this.className = 'tarea_hover'" onmouseout="this.className = ''" onkeyup="return isMaxLen(this)" onblur="show('face_list_menu',200)" onclick="showFace(this,'face_list_menu','mood');"></textarea>
			<input type="submit" name="Submit" value="" />
		</div>
	</div>
	<div class="mood_line"><div class="current_tab"></div></div>
    <div class="mood_box">
		<ul>
			<?php foreach($mood_rs as $val){?>
			<li onmouseover="this.className = 'li_hover'" onmouseout="this.className = ''">
				<div class="mood_date"><?php echo $val['add_time'];?></div>
				<div class="mood_content" onmouseover="show_more(<?php echo $val["mood_id"];?>,<?php echo strlen($val['mood']);?>)" onmouseout="$('contentall_mood_<?php echo $val["mood_id"];?>').style.display = 'none'"><?php echo filt_word(get_face($val['mood']));?></div>
				<div class="tright"><a class="<?php echo $button;?>" href="do.php?act=mood_del&mood_id=<?php echo $val['mood_id'];?>&app=mood_more"><?php echo $mo_langpackage->mo_del;?></a><a id="restore_mood_<?php echo $val['mood_id'];?>" href='javascript:void(0);' onclick="mood_com(<?php echo $val['mood_id'];?>,<?php echo $val['mood_id'];?>,6,0,10)"><?php echo $mo_langpackage->mo_com;?></a><span id="total_num_<?php echo $val['mood_id'];?>"><?php echo $val['comments'];?></span></div>
				<div class="mood_replybox" style="display:none" id='contentall_mood_<?php echo $val["mood_id"];?>'>
					<div class="top"></div>
					<div class="contentall"><div class="mood_contentall"><?php echo filt_word(get_face($val['mood']));?></div></div>
					<div class="bottom"></div>
				</div>
				<div class="mood_replybox" style="display:none;" id="content_mood_<?php echo $val['mood_id'];?>">
					<div class="top"></div>
					<div class="contentall">
							<div id='show_6_<?php echo $val["mood_id"];?>'></div>
							<?php if($ses_uid!=''){?>
							<div class="mood_reply">
								<img src='<?php echo get_sess_userico();?>' />
								<textarea onkeyup="return isMaxLen(this)" id="reply_6_<?php echo $val['mood_id'];?>_input"></textarea>
								<div class="mood_replybt">
									<a id="reply_a_<?php echo $val['mood_id'];?>_input" class="right" href="javascript:void(0);" onclick="showFace(this,'face_list_menu','reply_6_<?php echo $val['mood_id'];?>_input');"><?php echo $mo_langpackage->mo_face;?></a><input class="top_button" onclick=parent.restore_com(<?php echo $val['user_id'];?>,6,<?php echo $val['mood_id'];?>);show('face_list_menu',200) type="button" name="button" id="button" value="<?php echo $mo_langpackage->mo_b_con;?>" />
								</div>
							</div>
							<?php }?>
					</div>
					<div class="bottom"></div>
				</div>
			</li>
			<?php }?>
		</ul>
		<div class="clear"></div>
		<?php echo page_show($isNull,$page_num,$page_total);?>
    </div>
</form>
<!-- face begin -->
<div id="face_list_menu" class="emBg" style="display:none;z-index:100;"></div>
<!-- face end -->
<div class="guide_info <?php echo $data_none;?>">
	<?php echo $mo_langpackage->mo_none_data;?>
</div>
<?php if(isset($_GET['remind'])){?>
	<script type='text/javascript'>
		share_com(<?php echo $_GET['mod'];?>,<?php echo $_GET['mod'];?>,6,0,10);
	</script>
<?php }?>
</body>
</html>
