<!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" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<?php include(DDROOTPATH.'/cache/title/'.$pagetag.'_title.php');?>
<link href="template/<?=MOBAN?>/css/common.css" rel="stylesheet" />
<link href="template/<?=MOBAN?>/css/shai_u.css" rel="stylesheet" />
<script language="javascript" type="text/javascript" src="template/<?=MOBAN?>/js/jquery.js"></script>
<script>
function imgAuto(img, maxW, maxH) {
	var oriImg = document.createElement("img");
	oriImg.onload = function(){
		if (oriImg.width == 0 || oriImg.height == 0)
			return;
		var oriW$H = oriImg.width / oriImg.height;
		// var maxW$H = maxW / maxH;

		if (oriImg.height > maxH) {
			img.height = maxH;
			// img.removeAttribute("width");
			img.width = maxH * oriW$H;
		}
		if (img.width > maxW) {
			img.width = maxW;
			// img.removeAttribute("height");
			img.height = maxW / oriW$H;
		}

		if (maxH) {// if it defined the maxH argument
			if (img.height > 0)
				img.style.marginTop = (maxH - img.height) / 2 + "px";
		}
	};
	oriImg.src = img.src;
}
</script>
</head>

<body>
<?php include(DDROOTPATH.'/template/'.MOBAN.'/header.tpl.php');?>
<?php include(DDROOTPATH.'/template/'.MOBAN.'/nav.tpl.php');?>
<div class="main">
  <table class="cat" border="0" >
    <tr>
      <td <?php if($catid==''){?> class="curcat"<?php }?>><a href="userbao<?=$url_head_id?><?=$userid?><?=$url_end?>">最新分享</a></td>
      <?php foreach($shaicat_arr as $k=>$v){?>
      <td <?php if($k==$catid){?> class="curcat"<?php }?>><a href="userbao<?=$url_head_id?><?=$userid?><?=WJT?'-':'&catid='?><?=$k?><?=$url_head_xs?><?=$xs?><?=$url_head_page?>1<?=$url_end?>"><?=$v?></a></td>
      <?php }?>
    </tr>
  </table>
  <div class="space">
    <div class="space-left">
      <div class="avatar"><img onerror="this.src='images/noavatar_middle.gif'" src="upload/avatar/<?=get_avatar_filepath($userid, $size = 'middle')?>" /></div>
    </div>
    <div class="space-center">
      <div class="username">
          <table border="0">
  <tr>
    <td><span style="font-size:30px"><?=$info['ddusername']?></span></td>
    <td width="25" align="center"><div style="width:1px; height:30px; border-left:1px #666 dashed">&nbsp;</div></td>
    <td style="font-size:18px"><b style="font-family:'宋体'; color:#666666">晒单</b><b style="color:#FF6699; margin-left:10px"><?=$shai_nums?></b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b style="font-family:'宋体'; color:#666666">分享</b><b style="color:#FF6699; margin-left:10px"><?=$share_nums?></b></td>
  </tr>
</table>
      </div>
      <div class="goods-top">
      <ul>
        <li <?php if($xs=='all'){?> class="cur"<?php }?>><a href="userbao<?=$url_head_id?><?=$userid?><?=WJT?'-':'&catid='?><?=$catid?><?=$url_head_xs?>all<?=$url_head_page?>1<?=$url_end?>">Ta的宝贝</a></li>
        <li <?php if($xs=='like'){?> class="cur"<?php }?>><a href="userbao<?=$url_head_id?><?=$userid?><?=WJT?'-':'&catid='?><?=$catid?><?=$url_head_xs?>like<?=$url_head_page?>1<?=$url_end?>">Ta的喜欢</a></li>
      </ul>
    </div>
    </div>
    <div class="space-right">
      <div style="border:#FF0099 1px solid; width:110px; height:28px; color:#FF6699;">
        <div style="margin-top:7px; margin-left:22px">
          <div style="float:left; height:19px; line-height:19px; font-size:16px">收到的</div>
          <div style=" width:16px" class="icon2"></div>
        </div>
      </div>
      <div style="border:#8C8C8C 1px dashed; border-top:0px; width:110px; height:44px; color:#FF3261; text-align:center; font-size:24px; font-weight:bold; line-height:44px"><?=$info['hart']?></div>
    </div>
    
  </div>
  <div style="height:2px; overflow:hidden; background:#F0F0F0">&nbsp;</div>
  <div class="good">
  <!-- 产品列表 开始 -->
    <div class="goods">
    <script type="text/javascript">
   $(document).ready(function(){
	   /*
	   var len=$(".goods_list_img").length;
	   var htm1="";
	   var htm2="";
	   var htm3="";
	   var htm4="";
	   var d="<div class='zhanxian_list'>";
	   var v="</div>";
	   for(var i=0;i<len;i++){
			if(i==0||i==4||i==8||i==12||i==16||i==20||i==24){htm1+=d+$(".goods_list_img:eq("+i+")").html()+v;$("#zhanxian_1").html(htm1)};
			if(i==1||i==5||i==9||i==13||i==17||i==21){htm2+=d+$(".goods_list_img:eq("+i+")").html()+v;$("#zhanxian_2").html(htm2)};
			if(i==2||i==6||i==10||i==14||i==18||i==22){htm3+=d+$(".goods_list_img:eq("+i+")").html()+v;$("#zhanxian_3").html(htm3)};
			if(i==3||i==7||i==11||i==15||i==19||i==23){htm4+=d+$(".goods_list_img:eq("+i+")").html()+v;$("#zhanxian_4").html(htm4)};
	   };
	   */
	   /*
	   ImgList();
	   for(var i=0;i<24;i++){
		   $(".goods_list_img_i:eq("+i+")").load(function(){
			   ImgList();
		   });	 
	   };
	   ImgList();
	   */
	   var len=$(".goods_list_img").length;
	   var hml;
	   for(var i=0;i<len;i++){
		   hml=$(".goods_list_img:eq("+i+")").html();
		   $("#zhanxian_list_"+i).html(hml);
		   $("#zhanxian_list_"+i).css("height","auto");
	   };
	   $(".zhanxian_list").css("height","auto");
	   for(var i=len;i<24;i++){$("#zhanxian_list_"+i).css("display","none");};
	});
		msg=new Array();
		msg[6]='您已经送过红心';
		msg[7]='登陆才能送红心哦';
		
		function likek(id){
			var user_hart=parseInt($("#x_"+id).text());
			$.post("a.php",{fun:'inc_hart',shai_id:id,xs:'share'},function(data){//alert(data);
				var data= eval("(" + data + ")");
				if(data.err==0){
					$("#x_"+id).text(user_hart+1);
				}
				else{
					alert(msg[data.msg]);
				}
			});
		};
    </script>
    <?php if(count($shaidan_arr)==0){?><div style="text-align:center; padding-top:20px; font-size:16px; color:#F00; font-weight:bold">暂无宝贝</div><?php }?>
    <div id="jizai" style=" width:100%; height:50px;position:absolute; z-index:20; text-indent:450px; margin-top:50px; display:none; font-size:14px; overflow:hidden;">加载中...</div>
    <div id="goods_list_img_u">
    <div id="zhanxian_1" class="zhanxian">
    <div class='zhanxian_list' id="zhanxian_list_0"></div>
    <div class='zhanxian_list' id="zhanxian_list_4"></div>
    <div class='zhanxian_list' id="zhanxian_list_8"></div>
    <div class='zhanxian_list' id="zhanxian_list_12"></div>
    <div class='zhanxian_list' id="zhanxian_list_16"></div>
    <div class='zhanxian_list' id="zhanxian_list_20"></div>
    </div>
    <div id="zhanxian_2" class="zhanxian">
    <div class='zhanxian_list' id="zhanxian_list_1"></div>
    <div class='zhanxian_list' id="zhanxian_list_5"></div>
    <div class='zhanxian_list' id="zhanxian_list_9"></div>
    <div class='zhanxian_list' id="zhanxian_list_13"></div>
    <div class='zhanxian_list' id="zhanxian_list_17"></div>
    <div class='zhanxian_list' id="zhanxian_list_21"></div>
    </div>
    <div id="zhanxian_3" class="zhanxian">
    <div class='zhanxian_list' id="zhanxian_list_2"></div>
    <div class='zhanxian_list' id="zhanxian_list_6"></div>
    <div class='zhanxian_list' id="zhanxian_list_10"></div>
    <div class='zhanxian_list' id="zhanxian_list_14"></div>
    <div class='zhanxian_list' id="zhanxian_list_18"></div>
    <div class='zhanxian_list' id="zhanxian_list_22"></div>
    </div>
    <div id="zhanxian_4" class="zhanxian">
    <div class='zhanxian_list' id="zhanxian_list_3"></div>
    <div class='zhanxian_list' id="zhanxian_list_7"></div>
    <div class='zhanxian_list' id="zhanxian_list_11"></div>
    <div class='zhanxian_list' id="zhanxian_list_15"></div>
    <div class='zhanxian_list' id="zhanxian_list_19"></div>
    <div class='zhanxian_list' id="zhanxian_list_23"></div>
    </div>
    </div>
      <ul style="display:none;">
      <?php foreach($shaidan_arr as $row){?>
        <li class="goods_list_img">
          <a class="img" target="_blank" href="baobei<?=$url_head_id?><?=$row['id']?><?=$url_end?>">
          <img class="goods_list_img_i" src="topic.php?pic=<?=base64_encode($row['image'])?>" alt="<?=$row['title']?>" width="200" /></a>
          
          <div class="pinglun">
             <div class="pinglun_s pinglun_s1" onclick="likek(<?=$row['id']?>)" style="cursor:pointer;" title="送红心"></div>
             <div class="pinglun_s pinglun_s2"></div>
             <div class="pinglun_s pinglun_s3" id="x_<?=$row['id']?>"><?=$row['hart']?></div>
             <div class="pinglun_s pinglun_s4"></div>
             <div class="pinglun_s pinglun_s5"><a class="img" style="margin-top:-13px; color:#fe5d9b; text-decoration:underline;" target="_blank" href="baobei<?=$url_head_id?><?=$row['id']?><?=$url_end?>#p">评论</a></div>
          </div>
          <div class="pinglun_r"></div>
          
          <div class="name" style="clear:both; width:100%; height:70px; overflow:hidden;">
          <div style="width:26px; height:26px; padding-top:8px; float:left; padding-right:5px; overflow:hidden;">
          <a href="userbao.php?id=<?=$row['dduserid']?>">
          <img onerror="this.src='images/noavatar_middle.gif'" width="24" height="24" style="border:#ffaf9a 1px solid;" src="upload/avatar/<?=get_avatar_filepath($row['dduserid'], $size = 'small', $type = '')?>" />
          </a>
          </div>
          <div style=" width:150px; height:32px; padding-top:5px; line-height:16px; float:left; overflow:hidden;">
          <span style="font-size:12px; color:#e8876d;">由</span>
          <a style="color:#fe5dad;" href="userbao<?=$url_head_id?><?=$row['dduserid']?><?=$url_end?>"><?=$row['ddusername']?></a>
          <span style="font-size:12px; color:#e8876d;">分享</span><br />
          <span style=" color:#d5bba1; font-size:12px;"><?=date('m月d日 H:i',$row['time'])?></span>
          </div>
          <div class="comment" style="font-size:12px; color:#000; width:100%; height:25px; padding-top:5px; overflow:hidden;"><?=utf_substr(strip_tags($row['comment']),28)?></div>
          </div>
        </li>
      <?php }?>
        <div class="clear"></div>
      </ul>
      <div class="megas512" style="text-align:center; margin-top:30px;"><?php pageft($total,$pagesize,1,0,0,10,$page_userbao);echo $pagenav;?></div>
    <div style="height:20px; width:100%"></div>
  </div>
  	<!-- 产品列表 结束 -->
  </div>
</div>
<div style="height:5px; width:100%"></div>
<?php include(DDROOTPATH.'/template/'.MOBAN.'/footer.tpl.php');?>
</body>
</html>
