Showing
1 changed file
with
7 additions
and
6 deletions
@@ -76,7 +76,7 @@ | @@ -76,7 +76,7 @@ | ||
76 | </li> | 76 | </li> |
77 | EOL; | 77 | EOL; |
78 | $groupLen ++; | 78 | $groupLen ++; |
79 | - if($groupLen>= 6) | 79 | + if($groupLen>= 8) |
80 | { | 80 | { |
81 | $templates[] ='<div class="{class}"><h2>'.$type.'</h2><ul class="clearfix">'.$html.'</ul></div>'; | 81 | $templates[] ='<div class="{class}"><h2>'.$type.'</h2><ul class="clearfix">'.$html.'</ul></div>'; |
82 | $html = ''; | 82 | $html = ''; |
@@ -110,10 +110,10 @@ EOL; | @@ -110,10 +110,10 @@ EOL; | ||
110 | $temp = str_replace('{class}','media', $temp); | 110 | $temp = str_replace('{class}','media', $temp); |
111 | } | 111 | } |
112 | preg_match_all("/<li>/i", $temp, $liLen, PREG_SET_ORDER); | 112 | preg_match_all("/<li>/i", $temp, $liLen, PREG_SET_ORDER); |
113 | - if(count($liLen) >= 6) | 113 | + if(count($liLen) >= 8) |
114 | { | 114 | { |
115 | $temp = preg_replace('@<div class="(\w+)">(.+)<\/div>@isU', "\\2", $temp); | 115 | $temp = preg_replace('@<div class="(\w+)">(.+)<\/div>@isU', "\\2", $temp); |
116 | - $template .='<div class="box clearfix">'.$temp.'</div>'; | 116 | + $template .='<div class="box clearfix big-size">'.$temp.'</div>'; |
117 | $pos = -1; | 117 | $pos = -1; |
118 | } | 118 | } |
119 | else | 119 | else |
@@ -156,13 +156,14 @@ EOL; | @@ -156,13 +156,14 @@ EOL; | ||
156 | if($len >=3 && is_numeric($len)&($len&1)) | 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); | 159 | + $pos = rand(1, $len-1); |
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))){ | 162 | if($len >3 && is_numeric($len)&(!($len&1))){ |
163 | + //$banners=array_chunk($banners,2); | ||
163 | $temp = array_slice($banners, 0, 1); | 164 | $temp = array_slice($banners, 0, 1); |
164 | - $pos = rand(1, $len); | ||
165 | - $banners = array_merge($temp, array_slice($banners, $pos, 2)); | 165 | + $pos = rand(1, $len-1); |
166 | + $banners = array_merge($temp, array_slice($banners, $pos, 1)); | ||
166 | } | 167 | } |
167 | foreach($banners as $banner): | 168 | foreach($banners as $banner): |
168 | $res_size = json_decode($banner['res_size'], true); | 169 | $res_size = json_decode($banner['res_size'], true); |
-
Please register or login to post a comment