<?php
$list_str='';
foreach($listdb AS $key=>$rs){
	$rs[picurl]&&$rs[picurl]=tempdir($rs[picurl],"160:100");
	if($rs[mid]==100||$rs[mid]==102||$rs[mid]==103||$rs[mid]==105){
		$list_str.="<div class='ListImgs'>\r\n<ul>\r\n";
		$list_str.="<ol><a href='wapbencandy.php?fid=$rs[fid]&id=$rs[aid]'><span><img src='$rs[picurl]' onError=\"this.src='$webdb[www_url]/images/default/nopic.jpg'\"/></span></a></ol>";
		$list_str.="<li><a href='bencandy.php?fid=$rs[fid]&id=$rs[aid]'>$rs[title]</a></li>";
		$list_str.="</ul>\r\n</div>\r\n";
	}else{
		@extract($db->get_one("SELECT content FROM {$pre}reply WHERE aid=$rs[aid]"));
		$rs[content]=@preg_replace('/<([^<]*)>/is',"",$content);	//把HTML代码过滤掉
		$rs[content]=get_word($rs[content],150);
		$rs[posttime]=date('m-d',$rs[posttime]);
		$moreinfo="<dl class='moreinfo'><dt>浏览:<span>{$rs[hits]}</span>次 评论:<span>{$rs[comments]}</span>条</dt><dd>$rs[posttime]</dd></dl>\r\n";
		unset($picdb);
		$querys = $db->query("SELECT imgurl FROM `{$pre}article_pic` WHERE id='$rs[aid]'");
		while($rss = $db->fetch_array($querys)){
			if($rss[imgurl]){
				$picdb[]=tempdir($rss[imgurl],"160:100");
			}
		}
		$thispicnum=count($picdb);
		if($thispicnum>2){
			$thiscontent="<div class='ListMorpic'>\r\n<div class='title'><a href='wapbencandy.php?fid=$rs[fid]&id=$rs[aid]'>$rs[title]</a></div>\r\n<a href='wapbencandy.php?fid=$rs[fid]&id=$rs[aid]'><ul>\r\n";
			$i=0;
			foreach($picdb AS $keys=>$rss){
				$i++;
				if($i<4){
					$thiscontent.="	<li><span><img src='$rss' onError=\"this.src='$webdb[www_url]/images/default/nopic.jpg'\" onmouseover='thisimg_over(\$(this))' onmouseout='thisimg_out(\$(this))'/></span></li>\r\n";
				}
			}
			$thiscontent.="</ul>\r\n</a>\r\n";
			$thiscontent.=$moreinfo."</div>\r\n";
		}elseif($rs[picurl]){
			$rs[picurl]&&$rs[picurl]=tempdir($rs[picurl],"160:100");
			$rs[title]=get_word($rs[title],20);
			$rs[content]=get_word($rs[content],60);
			$thiscontent="<ul class='pic_word'>\r\n";
			$thiscontent.="	<ol><a href='wapbencandy.php?fid=$rs[fid]&id=$rs[aid]'><span><img src='$rs[picurl]' onError=\"this.src='$webdb[www_url]/images/default/nopic.jpg'\" onmouseover='thisimg_over(\$(this))' onmouseout='thisimg_out(\$(this))'/></span></a></ol>\r\n";
			$thiscontent.="	<li><div class='title'><a href='wapbencandy.php?fid=$rs[fid]&id=$rs[aid]'>$rs[title]</a></div>\r\n<p>{$rs[content]}</p>\r\n{$moreinfo}</li>\r\n";
			$thiscontent.="</ul>\r\n";
		}else{
			$thiscontent="<ul class='pic_word'>\r\n";
			$thiscontent.="	<li><div class='title'><a href='wapbencandy.php?fid=$rs[fid]&id=$rs[aid]'>$rs[title]</a></div>\r\n<p>{$rs[content]}</p>\r\n{$moreinfo}</li>\r\n";
			$thiscontent.="</ul>\r\n";
		}		
		$list_str.=$thiscontent;
	}
}
if($job=='ShowMoreArtic'){
	ob_end_clean();
	$list_str||$list_str="notArtic";
	echo $list_str;
	exit;
}
require(ROOT_PATH."inc/waphead.php");
?>
<!--
<?php
print <<<EOT
-->
<link rel="stylesheet" type="text/css" href="$webdb[www_url]/images/news/waplist.css">
<div class="nav_guide">当前位置：$GuideFidStr</div>
<div class="MainContainerBox">
	<div class="ListConts">
		$list_str
	</div>
</div>
<div class="ShowMoreArtic"><span>内容加载中……</span></div>
<script type="text/javascript">
<!--
var page=$page;
var check_showMore=1;
function ShowMoreArtic(){
	page++;
	check_showMore=0;
	$('.ShowMoreArtic').fadeIn();
	$.get("$webdb[www_url]/waplist.php?fid=$fid&job=ShowMoreArtic&page="+page+"&"+Math.random(),function(d){
		$('.ShowMoreArtic').fadeOut();
		if(d=='notArtic'){
			//layer.alert("没有更多内容了！");
		}else{
			$('.MainContainerBox .ListConts').append(d);
			check_showMore=1;
		}	
	});
}
$(document).ready(function () {
	$(window).scroll(function () {
		var scroll_Height=$(window).scrollTop();
		if($('body').height()-scroll_Height<1300 && check_showMore==1){
			ShowMoreArtic();
		}
	});
	$('.MainContainerBox').hover(function(){
		$('.HeaerBox .SearchBox').fadeOut();
		$('.HeaerBox .members').fadeOut();
	});
});
//-->
</script>
<!--
EOT;
?>
-->
<?php
require(ROOT_PATH."inc/wapfoot.php");
?>