Authored by tmq

资讯

@@ -28,7 +28,7 @@ @@ -28,7 +28,7 @@
28 </div> 28 </div>
29 <div class="content-wrap clearfix"> 29 <div class="content-wrap clearfix">
30 <div class="fluid-list"> 30 <div class="fluid-list">
31 - <div class="fluid-list-inner main-layout clearfix" id="img_flow"> 31 + <div id="index_content" class="fluid-list-inner main-layout clearfix" id="img_flow">
32 <?php 32 <?php
33 $this->_widget('news_list', array('list'=> $this->view->news)); 33 $this->_widget('news_list', array('list'=> $this->view->news));
34 ?> 34 ?>
@@ -153,12 +153,17 @@ EOL; @@ -153,12 +153,17 @@ EOL;
153 $banners = $this->view->rightBanners; 153 $banners = $this->view->rightBanners;
154 $temp = array(); 154 $temp = array();
155 $len = count($banners); 155 $len = count($banners);
156 - if($len >=3) 156 + if($len >=3 && is_numeric($len)&($len&1))
157 { 157 {
158 $temp = array_slice($banners, 0, 1); 158 $temp = array_slice($banners, 0, 1);
159 - $pos = rand(1, $len - 1); 159 + $pos = rand(1, $len);
160 $banners = array_merge($temp, array_slice($banners, $pos, 1)); 160 $banners = array_merge($temp, array_slice($banners, $pos, 1));
161 } 161 }
  162 + if($len >3 && is_numeric($len)&(!($len&1))){
  163 + $temp = array_slice($banners, 0, 1);
  164 + $pos = rand(1, $len);
  165 + $banners = array_merge($temp, array_slice($banners, $pos, 2));
  166 + }
162 foreach($banners as $banner): 167 foreach($banners as $banner):
163 $res_size = json_decode($banner['res_size'], true); 168 $res_size = json_decode($banner['res_size'], true);
164 if($res_size['height'] < 308 && $res_size['width']< 308) 169 if($res_size['height'] < 308 && $res_size['width']< 308)