<?php
/**
 * 拒绝直接访问模板
 */ 
if(ZIBANMA_SYS_LINK != 'zibanma_com'){
	die('access deny');
}
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo isset($site_config)?$site_config->config_content->site_name:'紫斑马软件';?></title>
<meta name="keywords" content="<?php echo isset($site_config)?$site_config->config_content->site_keywords:'紫斑马软件';?>" />
<meta name="description" content="<?php echo isset($site_config)?$site_config->config_content->site_description:'紫斑马软件';?>" />
<link href="/style/global.css" rel="stylesheet" type="text/css" />
<link href="/style/index.css" rel="stylesheet" type="text/css" />
<script src="/library/js/zibanma.global.js" type="text/javascript"></script>
<script type="text/javascript">
window.onload = function(){
	window.zibanma.init({
		method:'focus',
		data:{
			id:'focus',
			time:3000
		}
	});
}
</script>
</head>

<body>
<div id="zibanma">
    
    <?php include ZIBANMA_SYS_APP_ROOT.'/template/inc/header.php';?>
    
    <div id="recommend">
    	<div id="focus" class="focus">
    		<ul>
    		<?php 
    		if(isset($focus_list) && count($focus_list)):
    		for ($i=0; $i<count($focus_list); $i++):
    		?>
		    <li <?php if($i>0):?>class="none"<?php endif;?> onmouseover="window.zibanma.focus.mouseover();" onmouseout="window.zibanma.focus.mouseout();"><a href="<?php echo $focus_list[$i]->url;?>" target="<?php echo $focus_list[$i]->target;?>"><img src="<?php echo $focus_list[$i]->image;?>" title="<?php echo $focus_list[$i]->title;?>" /></a></li>
		    <?php 
		    	endfor;
		    endif;
		    ?>
		    </ul>
        </div>
        <div class="article">
        	<div class="title">最新资讯</div>
        	<?php if(isset($recommend[0])):?>
            <div class="new"><a href="<?php echo $common->get_rewriter_url_arr(array('news','article',$recommend[0]->id));?>" title="<?php echo $recommend[0]->title;?>" target="_blank"><?php echo $recommend[0]->title;?></a></div>
            <?php endif;?>
            <div class="content">
            	<ul>
            	<?php 
            	if(isset($recommend) && count($recommend)):
            		for($i=1; $i<count($recommend); $i++):
            	?>
            	<li>[<a href="<?php echo $common->get_rewriter_url_arr(array('news','category',$recommend[$i]->category_id));?>"><?php echo $recommend[$i]->category_name;?></a>] <a href="<?php echo $common->get_rewriter_url_arr(array('news','article',$recommend[$i]->id));?>" title="<?php echo $recommend[$i]->title;?>" target="_blank"><?php echo $recommend[$i]->title;?></a></li>
            	<?php 
            		endfor;
            	endif;
            	?>
                </ul>
            </div>
        </div>
    </div>
    <div class="clear"></div>
    
    <div id="index">
    	<div class="left">
        	<div class="pic">
            	<div class="title">最新图片</div>
                <div class="content">
                	<ul>
                	<?php 
                	if(isset($pic) && count($pic)):
                		foreach ($pic as $v):
                	?>
                	<li><img src="<?php echo $v->pic_thumb_small;?>" name="<?php echo $v->pic_thumb_big;?>" title="<?php echo $v->title;?>" onclick="javascript:window.zibanma.graph.single(this);" /></li>
                	<?php 
                    	endforeach;
                    endif;
                    ?>
                    </ul>
                </div>
            </div>
            <div class="category">
            	<?php 
            	if(isset($category_list) && count($category_list)):
            		$n=1;
            		foreach ($category_list as $v):
            	?>
            	<div class="li <?php if($n%2==0):?>float_right<?php else:?>float_left<?php endif;?>">
                	<div class="title"><a href="<?php echo $common->get_rewriter_url_arr(array('news','category',$v->id));?>" title="<?php echo $v->category_name;?>"><?php echo $v->category_name;?></a></div>
                    <div class="content">
                    	<ul>
                    	<?php 
                    	if(isset($v->data) && count($v->data)):
                    		foreach ($v->data as $li):
                    	?>
                    	<li><span><?php echo date('m-d',$li->create_time);?></span> <a href="<?php echo $common->get_rewriter_url_arr(array('news','article',$li->id));?>" title="<?php echo $li->title;?>" target="_blank"><?php echo $li->title;?></a></li>
                    	<?php 
                    		endforeach;
                    	else:
                    	?>
                    	<li><span>&nbsp;</span>暂无数据</li>
                    	<?php endif;?>
                        </ul>
                    </div>
                </div>
                <?php 
                	$n++;
                	endforeach;
                endif;
                ?>

            </div>
        </div>
        <div class="right">
        
        	<div class="newlist">
               <div class="title">热门文章</div>
                <div class="content">
                    <ul>
                	<?php 
                	if(isset($hot_list) && count($hot_list)):
                		foreach ($hot_list as $v):
                	?>
                    <li><a href="<?php echo $common->get_rewriter_url_arr(array('news','article',$v->id));?>" title="<?php echo $v->title;?>" target="_blank"><?php echo $v->title;?></a></li>
                    <?php 
                    	endforeach;
                    else:
                    ?>
                    <li>暂无数据</li>
                    <?php endif;?>
                    </ul>
                </div>
            </div>
            
            <div class="newlist">
               <div class="title">随机推荐</div>
                <div class="content">
                    <ul>
                    <?php 
                	if(isset($random_list) && count($random_list)):
                		foreach ($random_list as $v):
                	?>
                    <li><a href="<?php echo $common->get_rewriter_url_arr(array('news','article',$v->id));?>" title="<?php echo $v->title;?>" target="_blank"><?php echo $v->title;?></a></li>
                    <?php 
                    	endforeach;
                    else:
                    ?>
                    <li>暂无数据</li>
                    <?php endif;?>
                    </ul>
                </div>
            </div>
            
        </div>
    </div>
    <div class="clear"></div>
    
    <div id="link">
    	<div class="title">
	    	<span class="float_left">友情链接</span>
	    	<span class="float_right" style="margin-right:10px;"><a href="<?php echo $common->get_rewriter_url_arr(array('link','index'));?>">申请链接</a></span>
    	</div>
        <div class="link">
        	<ul>
        	<?php 
        	if(isset($link_list) && count($link_list)):
        		foreach ($link_list as $v):
        	?>
        	<li><a href="<?php echo $v->url;?>" title="<?php echo $v->title;?>" target="_blank"><?php echo $v->title;?></a></li>
        	<?php 
        		endforeach;
        	else:
        	?>
        	<li>暂无数据</li>
        	<?php endif;?>
        	</ul>
        </div>
    </div>
    <div class="clear"></div>
    
	<?php include ZIBANMA_SYS_APP_ROOT.'/template/inc/footer.php';?>
    
</div>
</body>
</html>
