Forum posts List page Call post summary using the G variable is not available, the solution found online to share with you
Content Summary
Include_once libfile (' function/post ');
Include_once libfile (' function/attachment ');
$thread [' post '] = c::t (' forum_post ')->fetch_all_by_tid_position ($thread [' Posttableid '], $thread [' tid '],1];
$thread [' post '] = Array_shift ($thread [' post ']);
$thread [' preview '] = messagecutstr ($thread [' Post '] [' message '], 200);
$attachments = c::t (' forum_attachment_n ')->fetch_all_by_id (' tid: '. $thread [' Post '] [' tid '], ' pid ', $thread [' Post ' [' PID ']);
$attachs = $imgattachs = Array ();
foreach (C::t (' forum_attachment ')->fetch_all_by_id (' pid ', $thread [' Post '] [' pid '], ' aid ') as $attach) {
$attach = Array_merge ($attach, $attachments [$attach [' aid ']];
$attach [' filenametitle '] = $attach [' filename '];
$attach [' ext '] = fileext ($attach [' filename ']);
Getattach_row ($attach, $attachs, $imgattachs);
}
$thread [' attachments '] = $imgattachs;
Content Summary End
Added to module/forum/forum_forumdisplay.php line 810
The previous sentence is $threadids [$threadindex] = $thread [' Tid '];
The latter sentence is $_g[' forum_threadlist ' [$threadindex] = $thread;
Template calling Code:
$thread [' Preview ']
Between two and six. Get topic content and Attachments
discuzX3.2 forum Posts List page Invoke Post summary instance