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
You are not logged in. Please login or register.
PunBB Forums → PunBB 1.2 modifications, plugins and integrations → 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
Moved to Modifications
Plugins are admin/mod only tools
And how can i see what the user is (guest/admin) and if he is a member. Which member he is.
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.
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']
<?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!
PunBB Forums → PunBB 1.2 modifications, plugins and integrations → Get user information
Powered by PunBB, supported by Informer Technologies, Inc.