1 (edited by Frizzy 2007-07-11 12:48)

Topic: Get user information

I would like to make a plug-in for the profile. How can I make a new field, if anyone can give me an example I would know enough. Sorry for my bad English wink

Re: Get user information

Moved to Modifications
Plugins are admin/mod only tools

3 (edited by Frizzy 2007-07-12 13:12)

Re: Get user information

And how can i see what the user is (guest/admin) and if he is a member. Which member he is.

4 (edited by Flinkman 2007-07-13 09:20)

Re: Get user information

I'm not sure if these are the best examples:

if($pun_user['g_delete_topics'] == '1'){echo"You are admin or moderator ";} You check with this if a user have premissions to delete topics what usually have only admins and moderators.

if($pun_user['username']! == "Guest"){echo"You are logged in as a user"} Use this to check if a user is a member.

5 (edited by Frizzy 2007-07-13 13:45)

Re: Get user information

if ($pun_user['g_id'] == PUN_GUEST)
    error($guest);
This checks if it is a guest. Thank you!

I found this to:
$pun_user['id']

6 (edited by Frizzy 2007-07-13 14:03)

Re: Get user information

<?php
    if (!defined('PUN_ROOT')) define('PUN_ROOT','./');

    require PUN_ROOT.'include/common.php';
    $page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Arcade Games';
    require PUN_ROOT.'lang/'.$pun_user['language'].'/arcade.php';
    require PUN_ROOT.'header.php';
   
    // start

    echo $pun_user['username'];
    mysql_connect("", "", "") or die("Kan geen verbinding maken: " . mysql_error());
    mysql_select_db("punbb");
    $result = mysql_query("SELECT username FROM forum_users where id = " . $pun_user['id'] . ""); //catagorie 1
        while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
        echo "Your name is <b>" . $row[0] . "</b>";
    }
    mysql_free_result($result);

    // end
    if ($cp>1)
        {
            echo $lang_common['Pages'],':';
            for ($i=1;$i<=$cp;$i++)
            if (($i-1)==$s_page) echo " $i ";
            else echo ' <a href="'.$_SERVER['PHP_SELF'].'?page='.($i-1).'">'.$i.'</a> ';
        }
               
    require PUN_ROOT.'footer.php';
?>

And that's al i needed!