Topic: [Modification] Show Post Name Under "Last Post" In Index
First i was looking for this myself now Slavok posted a solution so ill put a modified version of his and mine in this post
Go to 68 line of index.php. And replace array "$query" with this:
$query = array(
'SELECT' => 'c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.redirect_url, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster, t.subject',
'FROM' => 'categories AS c',
'JOINS' => array(
array(
'INNER JOIN' => 'forums AS f',
'ON' => 'c.id=f.cat_id'
),
array(
'LEFT JOIN' => 'topics AS t',
'ON' => 't.last_post_id=f.last_post_id'
),
array(
'LEFT JOIN' => 'forum_perms AS fp',
'ON' => '(fp.forum_id=f.id AND fp.group_id='.$forum_user['g_id'].')'
)
),
'WHERE' => 'fp.read_forum IS NULL OR fp.read_forum=1',
'ORDER BY' => 'c.disp_position, c.id, f.disp_position'
);
Next
Find
$forum_page['item_body']['info']['lastpost'] = '<li class="info-lastpost"><span class="label">'.$lang_index['Last post'].'</span> <strong><a href="'.forum_link($forum_url['post'], $cur_forum['last_post_id']).'">'.format_time($cur_forum['last_post']).'</a></strong> <cite>'.sprintf($lang_index['Last poster'], forum_htmlencode($cur_forum['last_poster'])).'</cite></li>';
Change It Too
$forum_page['item_body']['info']['lastpost'] = '<li class="info-lastpost"><span class="label">'.$lang_index['Last post'].'</span> <strong><a href="'.forum_link($forum_url['post'], $cur_forum['last_post_id']).'">'.limit_characters(forum_htmlencode($cur_forum['subject'])).'</a></strong> <cite>'.sprintf($lang_index['Last poster'], forum_htmlencode($cur_forum['last_poster'])).'</cite><strong>'.format_time($cur_forum['last_post']).'</strong></li>';
Go To Functions.php in includes folder
Find
//
// Common helpers and forum's wrappers for PHP functions
//
After That Add
function limit_characters ($str)
{
if ( strlen ( $str ) <= 30 )
{
return $str;
}
else {
return substr ( $str, 0, 30 ) . '...';
}
}
You Are Done. Punbb Rocks
Credit to Slavok & Some to me