<?php
if(!function_exists('get_big_Pic')){//这里加判断的原因是考虑到生成静态页时这个页面会被包含多次
	function get_big_Pic($aid,$mid){
		global $pre,$db;
		@extract($db->get_one("SELECT photourl FROM {$pre}article_content_{$mid} WHERE aid='$aid'"));
		$detail1=explode("\n",$photourl);
		foreach($detail1 AS $key=>$rs){
			$detail2=explode("@@@",$rs);
			if($detail2[0]){
				$picurl=$detail2[0];
				break;
			}
		}
		$picurl=filtrate($picurl);
		$picurl=tempdir($picurl);
		return $picurl;
	}
}
?>

<!------------大分类开始----------------->
<!--
<?php
if($listdb_moresort){
print <<<EOT
-->
<script type="text/javascript" src="$webdb[www_url]/images/blue/picfocus.js"></script>
<link rel="stylesheet" type="text/css" href="$webdb[www_url]/images/blue/picbigsort.css">
<div class="ListContTop">
	<div class="ShowSlides">
    	<ul class="slideTxt">
<!--
EOT;
$ListHots=fetch_article($fid,"new",15,50);
$i=0;
foreach($ListHots AS $key=>$rs){
$i++;
$classcur=($i==1)?"class='cur'":"";
$rs[picurl]=tempdir($rs[picurl],'120:90');
print <<<EOT
-->
			 <li $classcur><div><span><img onerror="this.src='$webdb[www_url]/images/default/nopic.jpg'" src="$rs[picurl]" height="75"/></span></div></li>
<!--
EOT;
}
print <<<EOT
-->
        </ul>
		<ul class="slidePic">
<!--
EOT;
$ListHots=fetch_article($fid,"new",15,50);
foreach($ListHots AS $key=>$rs){
$bigpicurl=get_big_Pic($rs[aid],$rs[mid]);
$bigpicurl=tempdir($bigpicurl,'840:580');
$listnum=$key+1;
print <<<EOT
-->
			<li>
            	<div><a href="bencandy.php?fid=$rs[fid]&id=$rs[aid]" target="_blank" title='$rs[full_title]'><img onerror="this.src='$webdb[www_url]/images/default/nopic.jpg'" src="$bigpicurl"/></a></div>
                <span><a href="bencandy.php?fid=$rs[fid]&id=$rs[aid]" target="_blank" title='$rs[full_title]'>$rs[title]</a> <em>$listnum/$i</em></span>
            </li>
<!--
EOT;
}
print <<<EOT
-->
          </ul> 
          <div class="ChangePic">
            <div class="Up_atc"><a href="javascript:;up_show_pic()">上一张</a></div>
            <div class="Down_atc"><a href="javascript:;down_show_pic()">下一张</a></div>
         </div>
<SCRIPT LANGUAGE="JavaScript" src="$webdb[www_url]/images/blue/photo_slide.js"></SCRIPT>      
	</div>
    <div class="SideCont">
        <div class="head"><div class="tag">热门图片</div></div>
        <div class="cont">
<!--
EOT;
$ListHots=fetch_article($fid,"hot",18,32);
foreach($ListHots AS $key=>$rs){
$listnum=$key+1;
print <<<EOT
-->
        <div class="list$listnum">
        	<span>$listnum</span>
            <a href="bencandy.php?fid=$rs[fid]&id=$rs[aid]" target="_blank" title='$rs[full_title]'>$rs[title]</a>
            <em>$rs[posttime]</em>
        </div>
<!--
EOT;
}
print <<<EOT
-->
        </div>
    </div> 
</div>
<!--
EOT;
foreach($listdb_moresort AS $keys=>$rss){
print <<<EOT
-->
<div class="ShowSorts"> 
    <div class="head"><div class="tag"><span>$rss[name]</span></div><a href="list.php?fid=$rss[fid]">更多&gt;&gt;</a></div>
    <div class="cont">
    	<div class="ListPic" id="ListPic$rss[fid]">
        	<ul>
<!--
EOT;
foreach($rss[article] AS $key1=>$rs){
$rs[picurl]=tempdir($rs[picurl],'150:120');
print <<<EOT
-->
                <dl>
                    <dt><a href="bencandy.php?fid=$rs[fid]&id=$rs[aid]" target="_blank" title='$rs[full_title]'><img onerror="this.src='$webdb[www_url]/images/default/nopic.jpg'" src="$rs[picurl]" height="120" /></a></dt>
                    <dd><a href="bencandy.php?fid=$rs[fid]&id=$rs[aid]" title="$rs[full_title]" target="_blank">$rs[title]</a></dd>
                </dl>
<!--
EOT;
}print <<<EOT
-->
			</ul>
		</div>        
	</div>
    <div class="prev" id="prev$rss[fid]"><a href="javascript:;" title="向前">向前</a></div>
    <div class="next" id="next$rss[fid]"><a href="javascript:;" title="向后">向后</a></div>
</div>
<script type="text/javascript">new ImagesSlider("ListPic$rss[fid]",{leftHandle:"prev$rss[fid]",rightHandle:"next$rss[fid]"});</script>
<!--
EOT;
}}

?>
--> 
<!------------大分类结束----------------->

<!------------小栏目开始----------------->
<!--
<?php
if(!$listdb_moresort){
print <<<EOT
-->
<link rel="stylesheet" type="text/css" href="$webdb[www_url]/images/blue/piclist.css">
<div class="MainCont">
	<table width="100%" cellspacing="0" cellpadding="0" class="ListPicTable">
<!--
EOT;
$ids=0;
foreach($listdb AS $key=>$rs){
if($ids==0){
print <<<EOT
-->
	  <tr>
<!--
EOT;
}
$ids++;
$rs[picurl]=tempdir($rs[picurl],'260:200');
print <<<EOT
-->
	    <td>
             <dl>
                <dt><a href="bencandy.php?fid=$rs[fid]&id=$rs[aid]" target="_blank" title='$rs[full_title]'><img onerror="this.src='$webdb[www_url]/images/default/nopic.jpg'" src="$rs[picurl]" height="200" /></a></dt>
                <dd>
                	<h3><a href="bencandy.php?fid=$rs[fid]&id=$rs[aid]" title="$rs[full_title]" target="_blank">$rs[title]</a></h3>
                    <p><span>发布时间:$rs[posttime]</span><em>点击:$rs[hits]</em></p>
                </dd>
             </dl>
	    </td>
<!--
EOT;
if($ids==4){
$ids=0;print <<<EOT
-->
	  </tr>
<!--
EOT;
}}if($ids && $ids<4){
for($i=$ids;$i<4;$i++){print <<<EOT
-->
	    <td><br /></td>
<!--
EOT;
}print <<<EOT
-->
	  </tr>
<!--
EOT;
}print <<<EOT
-->
	</table>
	<div class="showpage">$showpage</div>
</div>
<!--
EOT;
}
?>
-->
<script type="text/javascript">
$(".ListPicTable dl").hover(
	function(){$(this).addClass("over");},
	function(){$(this).removeClass("over");}
);
</script>
<!------------小栏目结束----------------->