<?php
/*
 * 注意：此文件由tpl_engine编译型模板引擎编译生成。
 * 如果您的模板要进行修改，请修改 templates/default/modules/group/group_hot.html
 * 如果您的模型要进行修改，请修改 models/modules/group/group_hot.php
 *
 * 修改完成之后需要您进入后台重新编译，才会重新生成。
 * 如果您开启了debug模式运行，那么您可以省去上面这一步，但是debug模式每次都会判断程序是否更新，debug模式只适合开发调试。
 * 如果您正式运行此程序时，请切换到service模式运行！
 * 
 * 如有您有问题请到官方论坛（http://tech.jooyea.com/bbs/）提问，谢谢您的支持。
 */
?><?php
	//引入公共模块
	require("foundation/module_users.php");
	require("foundation/module_group.php");
	
	//引入语言包
	$g_langpackage=new grouplp;
	
	//变量区
	$user_id=get_sess_userid();
	
	//数据表定义
	$t_groups=$tablePreStr."groups";
	$t_group_members=$tablePreStr."group_members";
	$t_users=$tablePreStr."users";
	
	$dbo=new dbex;
	dbtarget('r',$dbServs);
	
	$group_hot_rs=array();
	$select_items=array("join_group","creat_group");
	$my_group=get_user_info_item($dbo,$select_items,$t_users,$user_id);
	$user_join_group=$my_group['join_group'];
	$user_creat_group=$my_group['creat_group'];
	//缓存功能区
	require($webRoot.$baseLibsPath."model/group_hot_list.model.cache.php");	
		
	//数据显示控制
	$list_display="";
	$list_none="content_none";
	if(empty($group_hot_rs)){
		$list_display="content_none";
		$list_none="";
	}
	
	$g_join_num=$g_langpackage->g_join_num;
?>

<!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>
<SCRIPT language=JavaScript src="servtools/ajax_client/ajax.js"></SCRIPT>
<script language="JavaScript">

function join_group(group_id){
	var xmlhttp=InitAjax();
	xmlhttp.open("GET","do.php?act=group_join&group_id="+group_id,true);
	xmlhttp.onreadystatechange=function(){
	if(xmlhttp.readyState==4&&xmlhttp.status==200){
		var return_str=xmlhttp.responseText;
		var	return_text=return_str.replace(/[\s\n\r]/g,"");
		parent.Dialog.alert(return_text);
	}
}
xmlhttp.send(null);
}
</script>
<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">
</head>
<body>
  <div class="main_right_title">
     <span class="main_title_dot8"></span>
     <span class="main_title_txt"><?php echo $g_langpackage->g_group;?></span>
  </div>
<div id="tabsB">
  <ul>
    <li><a href="?app=group" title="<?php echo $g_langpackage->g_mine;?>"><span><?php echo $g_langpackage->g_mine;?></span></a></li>
    <li><a href="?app=group_hot" title="<?php echo $g_langpackage->g_hot;?>" class="nowbutl"><span class="nowbutr"><?php echo $g_langpackage->g_hot;?></span></a></li>
  </ul>
    <div class="div_but" onclick="location.href='?app=group_creat'"><?php echo $g_langpackage->g_creat;?></div>
    <div class="div_but_2" onclick="location.href='?app=group_select'"><?php echo $g_langpackage->g_search;?></div>
</div>


	<?php foreach($group_hot_rs as $rs){?>
		<div class="group_box" onmouseover="this.className = 'group_box_active';" onmouseout="this.className='group_box';">
			<div class="group_box_content">
				<div class="group_photo"><a href='?app=group_space&group_id=<?php echo $rs["group_id"];?>&user_id=<?php echo $url_uid;?>'><img src=<?php echo $rs['group_logo'];?> width='100px' height='100px' alt="<?php echo $rs['group_name'];?>" onerror="parent.pic_error(this)" /></a></div>
				<dl class="group_list">
					<dt><a href='?app=group_space&group_id=<?php echo $rs["group_id"];?>&user_id=<?php echo $url_uid;?>'><?php echo filt_word($rs['group_name']);?></a></dt>
					<dd><?php echo $g_langpackage->g_type;?>：<?php echo $rs['group_type'];?></dd>
					<dd><a href='home.php?h=<?php echo $rs["add_userid"];?>' target="_blank"><?php echo filt_word($rs['group_creat_name']);?></a></dd>
					<dd><?php echo str_replace('{num}','<span>'.$rs['member_count'].'</span>',$g_join_num);?></dd>
					<dd><span><?php echo join_type($rs['group_join_type']);?></span></dd>
				</dl>
			</div>
			<div class="group_control">				<?php echo group_state($rs['group_id'],$rs['group_join_type'],$user_creat_group,$user_join_group,$rs['group_req_id']);?>

				<a href='?app=group_space&group_id=<?php echo $rs["group_id"];?>&user_id=<?php echo $url_uid;?>'><?php echo $g_langpackage->g_en_space;?></a>
			</div>	
		</div>	

	<?php }?>
	
		<div class="guide_info <?php echo $list_none;?>">
			<?php echo $g_langpackage->g_no_group;?>
		</div>
		
</body>
</html>