Discuz如何让帖子列表的标题显示帖子附件中的图片
Discuz的代码还是比较容易看懂的。关键是要找到需要改的地方。第1步:forumdisplay.php,用来准备要显示的帖子列表,然后用forumdisplay.htm作为显示模板。找到forumdisplay.php中的:$query = $sdb->query(”SELECT t.* FROM {$tablepre}threads t WHERE t.fid=’$fid’ $filteradd AND $displayorderadd ORDER BY t.displayorder DESC, t.$orderby $ascdesc LIMIT “.($filterbool ? $start_limit : $start_limit – $stickycount).”, $tpp”);
替换为:$query = $sdb->query(”SELECT t.*,min(att.attachment) as attm FROM {$tablepre}threads t LEFT JOIN {$tablepre}posts p ON p.tid=t.tid LEFT JOIN {$tablepre}attachments att ON att.tid=t.tid WHERE t.fid=’$fid’ [...]

