MyBB Community Forums

Full Version: Add thread prefixes in portal latest threads
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

  1. Open portal.php
  2. Find 
    $query = $db->query("
    		SELECT t.tid, t.fid, t.uid, t.lastpost, t.lastposteruid, t.lastposter, t.subject, t.replies, t.views, u.username
    		FROM ".TABLE_PREFIX."threads t
    		LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=t.uid)
    		WHERE 1=1 {$excludeforums}{$tunviewwhere} AND t.visible='1' AND t.closed NOT LIKE 'moved|%'
    		ORDER BY t.lastpost DESC
    		LIMIT 0, ".$mybb->settings['portal_showdiscussionsnum']
    	);


  3. Replace with 
    $query = $db->query("
    		SELECT t.tid, t.fid, t.prefix, t.uid, t.lastpost, t.lastposteruid, t.lastposter, t.subject, t.replies, t.views, u.username
    		FROM ".TABLE_PREFIX."threads t
    		LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=t.uid)
    		WHERE 1=1 {$excludeforums}{$tunviewwhere} AND t.visible='1' AND t.closed NOT LIKE 'moved|%'
    		ORDER BY t.lastpost DESC
    		LIMIT 0, ".$mybb->settings['portal_showdiscussionsnum']
    	);


  4. Above this
    $thread['subject'] = htmlspecialchars_uni($parser->parse_badwords($thread['subject']));


  5. Add 
    $thread['threadprefix'] = $threadprefix = '';
    
    if($thread['prefix'] != 0)
    {
    	$threadprefix = build_prefixes($thread['prefix']);
    
    	if(!empty($threadprefix))
    	{
    		$thread['threadprefix'] = $threadprefix['displaystyle'].' ';
    	}
    }


  6. In portal_latestthreads_thread template before 
    {$thread['subject']}


  7. Add 
    {$thread['threadprefix']}


  8. Profit.
[Image: HIEmwqb.png]


\/

[Image: tv6fPWa.png]
If you told line number it more better and easy to find

Still erro
You don't have permission to access /admin/index.php on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.