how to show last 5 forum in main page plz give a code and where put a code i am using jcms5.2.1
too long. why don't just fetch id, text, user name? that's make page fast loading
last 5 forum post just mysql fetch id, text, user name. if u want don't to show closed topic just add close != 1 .
/* Showing last 5 thread */
$selectdb = mysql_query("SELECT id, text, user_name FROM forum WHERE type = t AND close != 1 ORDER BY id DESC LIMIT 5");
echo '<div class="phdr">New topic</div>';
while($last5post = mysql_fetch_array($selectdb)) {
echo '<div class="list1">• <a href="/forum/index.php?id='.$last5post['id'].'">'.$last5post['text'].'</a> ('.$last5post['user_name'].')</div>'; }
That enough. if u want show last 5 thread that use just comment. changing ORDER BY id to ORDER BY time.