Add rank icons

From PunBB Resource Wiki

Jump to: navigation, search

Contributed by Ju

Open "viewtopic.php"

Find:

    $post_count++;
    $user_avatar = '';
    $user_info = array();
    $user_contacts = array();
    $post_actions = array();
    $is_online = '';
    $signature = '';

After add:

        $rank_pips = "";

Find:

    // If the poster is a registered user.
    if ($cur_post['poster_id'] > 1)
    {

After add:

        switch ($cur_post['num_posts']) {
            case > 5000 : $num_pips = 10; break;
            case > 3000 : $num_pips = 9;  break;
            case > 2000 : $num_pips = 8;  break;
            case > 1000 : $num_pips = 7;  break;
            case > 500  : $num_pips = 6;  break;
            case > 300  : $num_pips = 5;  break;
            case > 100  : $num_pips = 4;  break;
            case > 50   : $num_pips = 3;  break;
            case > 10   : $num_pips = 2;  break;
            default     : $num_pips = 1;
        }
        for($pip=0; $pip<$num_pips; $pip++) {
            $rank_pips .= '<img src="img/pip.gif" alt="" />';
        }

Find:

           <dl>
                    <dt><strong><?php echo $username ?></strong></dt>
                    <dd class="usertitle"><strong><?php echo $user_title ?></strong></dd>

After, add:

                    <dd class="usertitle"><?php echo $rank_pips ?></dd>

Save viewtopic.php and upload (overwrite)

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox