Quantcast
Channel: MyBB Community Forums - Tutorials
Viewing all articles
Browse latest Browse all 685

Add thread prefixes in portal latest threads

$
0
0

  1. Open portal.php
  2. Find 
    PHP Code:
    $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 
    PHP Code:
    $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
    PHP Code:
    $thread['subject'] = htmlspecialchars_uni($parser->parse_badwords($thread['subject'])); 


  5. Add 
    PHP Code:
    $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 
    PHP Code:
    {$thread['subject']} 


  7. Add 
    PHP Code:
    {$thread['threadprefix']} 


  8. Profit.
[Image: HIEmwqb.png]


\/

[Image: tv6fPWa.png]

Viewing all articles
Browse latest Browse all 685

Trending Articles