<?php
	//引入语言包
	$rf_langpackage=new recaffairlp;

	//引入模块公共方法文件
	require("foundation/arecent_affair.php");
  require("foundation/module_restore.php");
  
	//变量取得
	$ra_type=short_check(get_argg('t'));
	$user_id=get_sess_userid();
	$pals_id=get_sess_mypals();
	$hidden_pals_id=get_session('hidden_pals');
	$hidden_type_id=get_session('hidden_type');
	$holder_id=short_check(get_argg('user_id'));
	$ra_mod_type='';
	$ra_type_str='';
	$ra_owner_sql='';
	$pals_str='';
	$limit_num=0;
	$show_setting='content_none';
	if($holder_id!=''){
		$limit_num=$home_affair_num;
		$ra_owner_sql=" user_id=$holder_id";
		$holder_id=" $holder_id";
		$hidden_button_over="void(0)";
		$hidden_button_out="void(0)";
	}else{
		if($hidden_pals_id!='' && $hidden_pals_id!=','){
			$pals_str=",".$pals_id.",";
			$hidden_pals_array=explode(",",$hidden_pals_id);
			foreach($hidden_pals_array as $rep){
				if($rep!=''){
					$pals_str=str_replace(",".$rep.",",",",$pals_str);
				}
			}
			$pals_str=preg_replace(array("/^,/","/,$/"),"",$pals_str);
			$pals_id=$pals_str;
		}
		if($hidden_type_id!='' && $hidden_type_id!=','){
			$hidden_type_id=preg_replace(array("/^,/","/,$/"),"",$hidden_type_id);
			$ra_mod_type=" and mod_type not in ($hidden_type_id)";
		}
	  $limit_num=$index_affair_num;
	  $ra_owner_sql=" user_id in ($pals_id)";
	  $hidden_button_over="feed_menu({id},1);";
	  $hidden_button_out="feed_menu({id},0);";
		$show_setting='';
	}
	if($ra_type!=0){
		$ra_type_str=" and type_id=$ra_type ";
	}

	//数据表定义区
	$t_rec_affair=$tablePreStr."recent_affair";
	$dbo=new dbex;
	
	//读写分离定义方法
	dbtarget('r',$dbServs);

	$ra_rs = array();
	if($pals_id!='' || $holder_id!=''){
	  $sql = "select * from $t_rec_affair where $ra_owner_sql $ra_type_str $ra_mod_type order by update_time desc limit $limit_num";
	  $ra_rs = $dbo->getRs($sql);
  }

	//显示控制
	$none_data="content_none";
	$is_null=0;
	if(empty($ra_rs)){
		$none_data="";
		$is_null=1;
	}
?>