1

Topic: PunBB User Panel ( Side Block )

Okay, so right now I'm working on what's known as a "PunBB User Panel". It will be displayed as a side block on my index page. I've been thinking of different fields, and options to add to this block, but can't seem to come up with anything else. So far, it displays the login status. When logged in, it will list the username, group, and post count. It also has a "Logout" option that's currently being displayed as a button.


Here is the source code:

// START SUBST - <pun_user_panel>
if ($pun_user['g_id'] != PUN_GUEST)
{
    ob_start();
?>
    <div class="block">
        <h2><span>User Panel</span></h2>
        <div class="box">
            <div class="inbox">
                <ul>
                    <li> » Username: <span class="<?php echo $pun_user['g_title'] ?>"><a href="profile.php?id=<?php echo $pun_user['id'] ?>"><?php echo $pun_user['username'] ?></a></span></li>
                    <li> » Group: <a href="userlist.php?username=&show_group=<?php echo $pun_user['g_id'] ?>&sort_by=username&sort_dir=ASC&search=Submit"><?php echo $pun_user['g_title'] ?></a></li>
                    <li> » Posts: <a href="search.php?action=show_user&user_id=<?php echo $pun_user['id'] ?>"><?php echo $pun_user['num_posts'] ?></a></li>
                </ul>
                <br />
                <form style="text-align: center;" method="post" action="login.php?action=out&id=<?php echo $pun_user['id'] ?>"><input type="submit" value="Logout"></form>
                <br />
            </div>
        </div>
    </div>
<?php
    $tpl_temp = trim(ob_get_contents());
    $tpl_main = str_replace('<pun_user_panel>', $tpl_temp, $tpl_main);
    ob_end_clean();
}
else
    $tpl_main = str_replace('<pun_user_panel>', '', $tpl_main);
// END SUBST - <pun_user_panel>

As you may have noticed, this code has been modified to work with header.php. After placing this code within your header.php, you are able to call for it by using the following tag within your PunBB template files.

<pun_user_panel>

If you have any suggestions, or additions, just let me know.

Thanks, Tubby

Re: PunBB User Panel ( Side Block )

quick links to edit profile fields?
pm link. etc.

Q

My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!

3

Re: PunBB User Panel ( Side Block )

quaker wrote:

quick links to edit profile fields?
pm link. etc.

Q

That seems like an alternative smile. I'll look in to it.

Re: PunBB User Panel ( Side Block )

another thing, let use add links to it?
member gallery like koos image upload ..
list can go on and on...hahaha
Q

My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!