<?php
/*
 * 注意：此文件由tpl_engine编译型模板引擎编译生成。
 * 如果您的模板要进行修改，请修改 templates/default/modules/blog/blogmine.html
 * 如果您的模型要进行修改，请修改 models/modules/blog/blogmine.php
 *
 * 修改完成之后需要您进入后台重新编译，才会重新生成。
 * 如果您开启了debug模式运行，那么您可以省去上面这一步，但是debug模式每次都会判断程序是否更新，debug模式只适合开发调试。
 * 如果您正式运行此程序时，请切换到service模式运行！
 * 
 * 如有您有问题请到官方论坛（http://tech.jooyea.com/bbs/）提问，谢谢您的支持。
 */
?><?php
  //引入公共模块
  require("foundation/fpages_bar.php");
	require("foundation/module_users.php");
	require("foundation/module_blog.php");
	require("foundation/fcontent_format.php");
	require("foundation/module_mypals.php");
	
  //语言包引入
  $b_langpackage=new bloglp;
  
  //变量区
	$url_uid= short_check(get_argg('user_id'));
	$ses_uid=get_sess_userid();
	$sort_name=get_argg('sort_name')?urldecode(get_argg('sort_name')):"-1";

  //数据表定义
  $t_blog=$tablePreStr."blog";
  $t_users=$tablePreStr."users";
  $t_mypals=$tablePreStr."pals_mine";
  
	dbtarget('r',$dbServs);
	$dbo=new dbex;	
	$page_num=trim(get_argg('page'));
	$is_friend='';
	$no_data_text=$b_langpackage->b_no_fri_blog;
	$button_show_mine="";
	$button_show_his="content_none";	
	
  //引入模块公共权限过程文件
	$is_self_mode='partLimit';
	$is_login_mode='';
	require("foundation/auser_validate.php");
	$url_userid='';
	$cols=" user_id='$userid' ";
	if(get_argg('sort_id')!=NULL){
		$sort_id=short_check(get_argg('sort_id'));
		$cols.=" and log_sort='$sort_id' ";
		if(get_argg('sort_id')==0){
			$sort_name=0;
		}
	}
	 if($is_self=='Y'){
	 	  $str_title=$b_langpackage->b_blog;
		  $ml_class="nowbutl";$mr_class="nowbutr";$l_class="";$r_class="";
		  $no_data_text=$b_langpackage->b_none;
	 }else{
			$holder_name=get_hodler_name($dbo,$t_users,$url_uid);
			$str_title=str_replace("{holder}",$holder_name,$b_langpackage->b_his_blog);
			$url_userid="&user_id=".$userid;
			$button_show_mine="content_none";
			$button_show_his="";
			$holder_pals=getHodlerpals($dbo,$t_mypals,$url_uid);
			if(strstr($holder_pals,",".$ses_uid.",") && $ses_uid!=''){
				$cols.=" and blog_limit <=1 ";
			}else{
				$cols.=" and blog_limit = 0 ";
			}
	 }
	 if(get_argg('is_friend')==1){
		 	$is_friend='&is_friend=1';
			$button_show_mine="content_none";
			$button_show_his="";
			$cols.=" and blog_limit <=1 ";
	 }
	 $blog_rs=array();
   //数据模型及缓存功能区
	 require($webRoot.$baseLibsPath."model/blog_list.model.cache.php");
	//控制数据显示
	$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">
<script type='text/javascript'>
	parent.guide("blog");
</script>
</head>
<body>

  <div class="main_right_title">
     <span class="main_title_dot"></span>
     <span class="main_title_txt"><?php echo $str_title;?></span>
  </div>

<!--按钮控制!-->
		<div id="tabsB" class=<?php echo $button_show_mine;?>>
			<ul>
		    <li><a href="?app=blog" title="<?php echo $b_langpackage->b_mine;?>" class="<?php echo $ml_class;?>"><span class="<?php echo $mr_class;?>"><?php echo $b_langpackage->b_mine;?></span></a></li>
		    <li><a href="?app=blog_friend" title="<?php echo $b_langpackage->b_friend;?>"><span><?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="div_but_2 <?php echo $button_show_his;?>" onclick="location.href='?app=blog&user_id=<?php echo $url_userid;?>'"><?php echo $b_langpackage->b_re_list;?></div>
			<div class="container <?php echo $button_show_his;?>">
					<div class="rs_head"><?php echo get_blog_sort($sort_name);?> &nbsp <?php echo str_replace("{num}",count($blog_rs),$b_langpackage->b_num);?></div>
			</div>
<?php foreach($blog_rs as $rs){?>
	<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"];?><?php echo $url_userid.$is_friend;?>'><?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;?>：<a href="?app=blog&sort_id=<?php echo $rs['log_sort'];?>&sort_name=<?php echo urlencode($rs['log_sort_name']);?><?php echo $url_userid.$is_friend;?>" title="<?php echo $b_langpackage->b_same_sort;?>"><?php echo empty($rs['log_sort_name']) ? $b_langpackage->b_default_sort :filt_word($rs['log_sort_name']);?></a></span><span><?php echo $b_langpackage->b_limit;?>：<?php echo get_blog_limit($rs['blog_limit']);?></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> 
    <?php }?>
	<?php echo page_show($isNull,$page_num,$page_total);?>
    <div class="guide_info <?php echo $content_data_none;?>">
          <?php echo $no_data_text;?>
    </div>
</body>
</html>