版块调整多了,右边就会空出一块,可以考虑把贴图精选的数量加多。。。
找到home.php
找到$digestimgs = $aggregation['digestimgs'] ? $aggregation['digestimgs'] : array(); //note 帖图精选
foreach($digestimgs as $key => $value) {
$digestimgs[$key][3] = PUBATTURL.$imgsdir.$digestimgs[$key][3];
}
$digestimgcount = 2 - count($digestimgs);
if($digestimgcount > 0) { //note 补全帖图精选
$query = $db->query("SELECT t.tid, t.subject, atta.attachment FROM {$tablepre}threads t LEFT JOIN {$tablepre}attachments atta ON atta.tid = t.tid WHERE t.attachment = '1' $sqljoin_disableforum AND atta.isimage = '1' AND atta.filesize > '8192' GROUP BY atta.tid ORDER BY t.views DESC,t.dateline DESC LIMIT 10");
$count = '0';
while($digestimg = $db->fetch_array($query)) {
$link = './viewthread.php?tid='.$digestimg['tid'];
if(file_exists($attachmentdir.$digestimg['attachment'])) {
$targetimg = $home_autocache.'autothumb_'.random(5).'.jpg';
$sourceimg = $attachmentdir.$digestimg['attachment'];
makethumb($sourceimg, $targetimg, '134', '95');
if(file_exists($targetimg)) {
$digestimgs[] = array(cutstr($digestimg['subject'],'16'), '', $link, PUBATTURL.$targetimg);
}
if(count($digestimgs) == 2) break;
}
}
}
更改为$digestimgs = $aggregation['digestimgs'] ? $aggregation['digestimgs'] : array(); //note 帖图精选
foreach($digestimgs as $key => $value) {
$digestimgs[$key][3] = PUBATTURL.$imgsdir.$digestimgs[$key][3];
}
$digestimgcount = 6 - count($digestimgs);
if($digestimgcount > 0) { //note 补全帖图精选
$query = $db->query("SELECT t.tid, t.subject, atta.attachment FROM {$tablepre}threads t LEFT JOIN {$tablepre}attachments atta ON atta.tid = t.tid WHERE t.attachment = '1' $sqljoin_disableforum AND atta.isimage = '1' AND atta.filesize > '8192' GROUP BY atta.tid ORDER BY t.views DESC,t.dateline DESC LIMIT 10");
$count = '0';
while($digestimg = $db->fetch_array($query)) {
$link = './viewthread.php?tid='.$digestimg['tid'];
if(file_exists($attachmentdir.$digestimg['attachment'])) {
$targetimg = $home_autocache.'autothumb_'.random(5).'.jpg';
$sourceimg = $attachmentdir.$digestimg['attachment'];
makethumb($sourceimg, $targetimg, '134', '95');
if(file_exists($targetimg)) {
$digestimgs[] = array(cutstr($digestimg['subject'],'16'), '', $link, PUBATTURL.$targetimg);
}
if(count($digestimgs) == 6) break;
}
}
}
光这样改了还没用,再找到./templates/default/home.htm
找到 <div class="mainbox hotimgright">
<h3>贴图精选</h3>
<ul>
<!--{loop $digestimgs $img}-->
增加红色部分 <div class="mainbox hotimgright" style="height:887px;">
<h3>贴图精选</h3>
<ul>
<!--{loop $digestimgs $img}-->
这个像素值由图片的数量来决定,可自行调整
下面是后台的更改
找到./admin/aggregation.inc.php
找到 showsetting('帖图精选:<br><span class="smalltxt">每行一张图片,每张有三项内容:标题,图片地址,链接。<br>各项之间请用半角英文分号隔开(;)。<br>标准尺寸:<font color=red>134px × 95px</font><br>最多2张</span>', '', '', '<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr class="category"><td width="16%">图片说明</td><td width="25%">图片地址</td><td>链接地址</td></tr><tr>
<td><input class="text" name="newaggregation[digestimgs][0][0]" value="'.$aggregation[digestimgs][0][0].'" type="text"></td><td><input class="text" name="newaggregation[digestimgs][0][1]" value="'.$aggregation[digestimgs][0][1].'" type="text" size="35"><input class="text" name="newaggregation[digestimgs][0][3]" value="'.$aggregation[digestimgs][0][3].'" type="hidden"></td><td><input class="text" name="newaggregation[digestimgs][0][2]" value="'.$aggregation[digestimgs][0][2].'" type="text" size="35"></td>
</tr><tr>
<td><input class="text" name="newaggregation[digestimgs][1][0]" value="'.$aggregation[digestimgs][1][0].'" type="text"></td><td><input class="text" name="newaggregation[digestimgs][1][1]" value="'.$aggregation[digestimgs][1][1].'" type="text" size="35"><input class="text" name="newaggregation[digestimgs][1][3]" value="'.$aggregation[digestimgs][1][3].'" type="hidden"></td><td><input class="text" name="newaggregation[digestimgs][1][2]" value="'.$aggregation[digestimgs][1][2].'" type="text" size="35"></td>
</tr></table>', '20%');
增加 showsetting('帖图精选:<br><span class="smalltxt">每行一张图片,每张有三项内容:标题,图片地址,链接。<br>各项之间请用半角英文分号隔开(;)。<br>标准尺寸:<font color=red>134px × 95px</font><br>最多6张</span>', '', '', '<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr class="category"><td width="16%">图片说明</td><td width="25%">图片地址</td><td>链接地址</td></tr><tr>
<td><input class="text" name="newaggregation[digestimgs][0][0]" value="'.$aggregation[digestimgs][0][0].'" type="text"></td><td><input class="text" name="newaggregation[digestimgs][0][1]" value="'.$aggregation[digestimgs][0][1].'" type="text" size="35"><input class="text" name="newaggregation[digestimgs][0][3]" value="'.$aggregation[digestimgs][0][3].'" type="hidden"></td><td><input class="text" name="newaggregation[digestimgs][0][2]" value="'.$aggregation[digestimgs][0][2].'" type="text" size="35"></td>
</tr><tr>
<td><input class="text" name="newaggregation[digestimgs][1][0]" value="'.$aggregation[digestimgs][1][0].'" type="text"></td><td><input class="text" name="newaggregation[digestimgs][1][1]" value="'.$aggregation[digestimgs][1][1].'" type="text" size="35"><input class="text" name="newaggregation[digestimgs][1][3]" value="'.$aggregation[digestimgs][1][3].'" type="hidden"></td><td><input class="text" name="newaggregation[digestimgs][1][2]" value="'.$aggregation[digestimgs][1][2].'" type="text" size="35"></td>
</tr><tr>
<td><input class="text" name="newaggregation[digestimgs][2][0]" value="'.$aggregation[digestimgs][2][0].'" type="text"></td><td><input class="text" name="newaggregation[digestimgs][2][1]" value="'.$aggregation[digestimgs][2][1].'" type="text" size="35"><input class="text" name="newaggregation[digestimgs][2][3]" value="'.$aggregation[digestimgs][2][3].'" type="hidden"></td><td><input class="text" name="newaggregation[digestimgs][2][2]" value="'.$aggregation[digestimgs][2][2].'" type="text" size="35"></td>
</tr><tr>
<td><input class="text" name="newaggregation[digestimgs][3][0]" value="'.$aggregation[digestimgs][3][0].'" type="text"></td><td><input class="text" name="newaggregation[digestimgs][3][1]" value="'.$aggregation[digestimgs][3][1].'" type="text" size="35"><input class="text" name="newaggregation[digestimgs][3][3]" value="'.$aggregation[digestimgs][3][3].'" type="hidden"></td><td><input class="text" name="newaggregation[digestimgs][3][2]" value="'.$aggregation[digestimgs][3][2].'" type="text" size="35"></td>
</tr><tr>
<td><input class="text" name="newaggregation[digestimgs][4][0]" value="'.$aggregation[digestimgs][4][0].'" type="text"></td><td><input class="text" name="newaggregation[digestimgs][4][1]" value="'.$aggregation[digestimgs][4][1].'" type="text" size="35"><input class="text" name="newaggregation[digestimgs][4][3]" value="'.$aggregation[digestimgs][4][3].'" type="hidden"></td><td><input class="text" name="newaggregation[digestimgs][4][2]" value="'.$aggregation[digestimgs][4][2].'" type="text" size="35"></td>
</tr><tr>
<td><input class="text" name="newaggregation[digestimgs][5][0]" value="'.$aggregation[digestimgs][5][0].'" type="text"></td><td><input class="text" name="newaggregation[digestimgs][5][1]" value="'.$aggregation[digestimgs][5][1].'" type="text" size="35"><input class="text" name="newaggregation[digestimgs][5][3]" value="'.$aggregation[digestimgs][5][3].'" type="hidden"></td><td><input class="text" name="newaggregation[digestimgs][5][2]" value="'.$aggregation[digestimgs][5][2].'" type="text" size="35"></td>
</tr>
</table>', '20%');
这样就可以了
改完之后,更新论坛缓存,再刷新home页 |