DiscuzX的顶部的格式广告的列数,是再3,4,5之间自动变化的.
具体的代码位于:
source/class/adv/adv_text.php, 从97行开始:
$advcount = count($adids); if($advcount > 5) { $minfillpercent = 0; for($cols = 5; $cols >= 5; $cols--) { if(($remainder = $advcount % $cols) == 0) { $advcols = $cols; break; } elseif($remainder / $cols > $minfillpercent) { $minfillpercent = $remainder / $cols; $advcols = $cols; } } } else { $advcols = $advcount; }
因此我们可以看到格子广告的列数再3,4,5之间动态变化,如果要固定列数,只需要把for循环的两个5改成4或者3就可以了