или это:
open include/class_forum.php
find :
PHP:
// THIS METHOD LISTS ALL TOPICS IN A FORUM
// INPUT: $forum_id REPRESENTING THE FORUM ID OF THE FORUM TO RETRIEVE TOPICS FROM
// $start REPRESENTING THE TOPIC TO START WITH
// $limit REPRESENTING THE NUMBER OF TOPICS TO RETURN
// OUTPUT: AN ARRAY OF TOPIC INFORMATION
function forum_topic_list($forum_id, $start, $limit)
Add above this :
PHP:
// GET New topics
function new_topic_list($forum_id, $limit) { // if $forum_id=0, all forums
global $database, $user;
if($forum_id) $where="WHERE forumtopic_forum_id='$forum_id'";
// GET TOPICS
$gettopics = $database->database_query("SELECT se_forumtopics.forumtopic_id, se_forumtopics.forumtopic_subject, se_forumtopics.forumtopic_date, se_forumtopics.forumtopic_forum_id,se_forumtopics.forumtopic_creatoruser_id,se_forumtopics.forumtopic_totalreplies, se_forumtopics.forumtopic_views, se_users.user_id, se_users.user_username, se_users.user_fname, se_users.user_lname, se_users.user_photo FROM se_forumtopics LEFT JOIN se_users ON se_forumtopics.forumtopic_creatoruser_id=se_users.user_id {$where} ORDER BY se_forumtopics.forumtopic_id DESC LIMIT $limit");
$forumtopic_array = Array();
while( $newtopics = $database->database_fetch_assoc($gettopics) )
$forumtopic_array[]=$newtopics;
return $forumtopic_array ;
} // END new_topic_list() METHOD
open home.php
find :
PHP:
// ASSIGN SMARTY VARIABLES AND INCLUDE FOOTER
add above it :
PHP:
// GET NEW TOPICS
$forum = new se_forum();
$topic_limit = 10;
// SET TOPIC ARRAY
$topic_array = $forum->new_topic_list(0,$topic_limit); // set 0 for all forums or set whatever forum id you want to show
$smarty->assign('topics', $topic_array);
open home.tpl
put wherever you want them showed :
PHP:
{* NEW TOPICS FROM FORUMS *}
{section name=topic_loop loop=$topics max=10}
<div style='border-bottom: 1px solid #ccc; padding:1px 0; width:100%'>
<div style="float:left"><img src="../images/icons/disscusion.jpg" /> </div>
<div >
<div style="margin-top:3px;">
<div style='float:left; padding-bottom:5px;'> <a href='forum_topic.php?forum_id={$topics[topic_loop].forumtopic_forum_id}&topic_id={$topics[topic_loop].forumtopic_id}'>{$topics[topic_loop].forumtopic_subject}</a>
{capture assign="topic_poster"} <a href='{$url->url_create("profile", $topics[topic_loop].user_username)}'> {$topics[topic_loop].user_fname} {$topics[topic_loop].user_lname}</a>{/capture} {lang_sprintf id=6000095 1=$topic_poster}
{assign var='topic_date_basic' value=$datetime->time_since($topics[topic_loop].forumtopic_date)}
- {lang_sprintf id=$topic_date_basic[0] 1=$topic_date_basic[1]}</div>
<div style="float:right"> {lang_print id=1000065} {$topics[topic_loop].forumtopic_views} | {lang_print id=69658061} {$topics[topic_loop].forumtopic_totalreplies} </div>
<div class="space-line"></div>
</div>
</div>
</div>
{/section}