Authored by tmq

bug

... ... @@ -76,7 +76,7 @@
</li>
EOL;
$groupLen ++;
if($groupLen>= 6)
if($groupLen>= 8)
{
$templates[] ='<div class="{class}"><h2>'.$type.'</h2><ul class="clearfix">'.$html.'</ul></div>';
$html = '';
... ... @@ -110,10 +110,10 @@ EOL;
$temp = str_replace('{class}','media', $temp);
}
preg_match_all("/<li>/i", $temp, $liLen, PREG_SET_ORDER);
if(count($liLen) >= 6)
if(count($liLen) >= 8)
{
$temp = preg_replace('@<div class="(\w+)">(.+)<\/div>@isU', "\\2", $temp);
$template .='<div class="box clearfix">'.$temp.'</div>';
$template .='<div class="box clearfix big-size">'.$temp.'</div>';
$pos = -1;
}
else
... ... @@ -156,13 +156,14 @@ EOL;
if($len >=3 && is_numeric($len)&($len&1))
{
$temp = array_slice($banners, 0, 1);
$pos = rand(1, $len);
$pos = rand(1, $len-1);
$banners = array_merge($temp, array_slice($banners, $pos, 1));
}
if($len >3 && is_numeric($len)&(!($len&1))){
//$banners=array_chunk($banners,2);
$temp = array_slice($banners, 0, 1);
$pos = rand(1, $len);
$banners = array_merge($temp, array_slice($banners, $pos, 2));
$pos = rand(1, $len-1);
$banners = array_merge($temp, array_slice($banners, $pos, 1));
}
foreach($banners as $banner):
$res_size = json_decode($banner['res_size'], true);
... ...