<?php
/*
 * 注意：此文件由tpl_engine编译型模板引擎编译生成。
 * 如果您的模板要进行修改，请修改 templates/default/modules/blog/blog_friend.html
 * 如果您的模型要进行修改，请修改 models/modules/blog/blog_friend.php
 *
 * 修改完成之后需要您进入后台重新编译，才会重新生成。
 * 如果您开启了debug模式运行，那么您可以省去上面这一步，但是debug模式每次都会判断程序是否更新，debug模式只适合开发调试。
 * 如果您正式运行此程序时，请切换到service模式运行！
 * 
 * 如有您有问题请到官方论坛（http://tech.jooyea.com/bbs/）提问，谢谢您的支持。
 */
?><?php
	//必须登录才能浏览该页面
	require("foundation/auser_mustlogin.php");
	
	//引入公共模块
	require("foundation/fpages_bar.php");
	require("foundation/module_blog.php");
	require("foundation/fcontent_format.php");
	
	//语言包引入
	$b_langpackage=new bloglp;
	
	//变量定义
	$user_id=get_sess_userid();
	$user_mypals=get_sess_mypals();
	
	//当前页面参数
	$page_num=trim(get_argg('page'));
	
	//数据表定义  
	$t_blog=$tablePreStr."blog";
	$t_mypals=$tablePreStr."pals_mine";
	
	$blog_rs=array();
	$page_total='';
	if($user_mypals!=''){
		
		//读写分离定义方法
		$dbo=new dbex;
		dbtarget('r',$dbServs);
		
		$condition="user_id in ($user_mypals) and blog_limit<=1 and log_pass = 1 ";
		$order_by="order by log_id desc";
		$type="getRs";
		$dbo->setPages($set_page_data_num,$page_num);//设置分页
		$blog_rs=get_db_data($dbo,$t_blog,$condition,$order_by,$type);
		$page_total=$dbo->totalPage;//分页总数
  }
  
  	//控制数据显示
		$content_data_none="content_none";
		$content_data_set="";
		$isNull=0;
	if(empty($blog_rs)){
		$isNull=1;
		$content_data_none="";
		$content_data_set="content_none";
	}  
?>
<!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>blog</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">
</head>
<body>
	
  <div class="main_right_title">
       <span class="main_title_dot"></span>
       <span class="main_title_txt"><?php echo $b_langpackage->b_blog;?></span>
  </div> 

	<div id="tabsB">
		<ul>
			<li><a href="?app=blog" title="<?php echo $b_langpackage->b_mine;?>">
				<span><?php echo $b_langpackage->b_mine;?></span></a>
			</li>
			<li><a href="?app=blog_friend" title="<?php echo $b_langpackage->b_friend;?>" class="nowbutl">
				<span class="nowbutr"><?php echo $b_langpackage->b_friend;?></span></a>
			</li>
		</ul>
		
		<div class="div_but" onclick="location.href='?app=blog_edit'">
			<?php echo $b_langpackage->b_creat;?>
		</div>	
	</div>

	<div class="container <?php echo $content_data_set;?>">
		<div class="rs_head">
			<?php echo str_replace("{num}",count($blog_rs),$b_langpackage->b_num);?>
		</div>
	</div>

	<?php foreach($blog_rs as $rs){?>
	<div class="listphoto left w100">
		<a href="home.php?h=<?php echo $rs["user_id"];?>" target="_blank" title="<?php echo $rf_langpackage->rf_v_home;?>"><img src='<?php echo $rs["user_ico"];?>' /></a>
	</div>
	<div class="left blog_box_2">
		<dl class="log_list">
			<dt>
				<strong><?php echo $b_langpackage->b_title;?>：<a href='modules.php?app=blog_show&id=<?php echo $rs["log_id"];?>&is_friend=1'><?php echo filt_word($rs["log_title"]);?></a></strong><br />
				<span><?php echo $rs["add_time"];?></span>
			</dt>
			<dd class="log_list_content"><?php echo get_short_txt($rs["log_content"]);?></dd>
			<dd><span><?php echo $b_langpackage->b_sort;?>：<?php echo get_blog_sort(filt_word($rs['log_sort_name']));?></span><span><?php echo $b_langpackage->b_author;?>：<a href="home.php?h=<?php echo $rs['user_id'];?>" target="_blank"><?php echo filt_word($rs['user_name']);?></a></span><span><?php echo str_replace("{b_com_num}",$rs['comments'],$b_langpackage->b_com_num);?></span><span>|</span><span><?php echo str_replace("{b_read_num}",$rs['hits'],$b_langpackage->b_read_num);?></span></dd>
		</dl>
	</div>
	<?php }?>
	
	<div style='clear:both'><?php echo page_show($isNull,$page_num,$page_total);?></div>
    		
    <div class='guide_info <?php echo $content_data_none;?>'><?php echo $b_langpackage->b_no_fri_blog;?></div>
    
</body>
</html>