Quote
profile_link( integer $user_id, string $user_name, integer $user_status [ , string $class ] )
Parameters
user_id
The User ID of the user which is displayed
user_name
The User Name of the user which is displayed
user_status
The user's status; 0 = banned, 1 = active etc.
class
CSS class for the profile link
Return Values
Returns a link to the user's account along with the user name correctly depending on the user's status.
Basic profile_link() usage example
Code
<?php
// <a href='profile.php?lookup=1'>Administrator</a>
echo profile_link("1", "Administrator", "0");
// <a href='profile.php?lookup=1' class='my-class'>Administrator</a>
echo profile_link("1", "Administrator", "0", "my-class");
// Cancelled User Account (status = 5)
// <a href='profile.php?lookup=2'>Anonymous User</a>
echo profile_link("2", "Testuser", "5");
// Anonymized User (status = 6)
// <a href='profile.php?lookup=2'>Anonymous User</a>
echo profile_link("2", "Testuser", "6");
?>
Shows how the function behaves when the different parameters are altered.
Advanced profile_link() usage example
Code
<?php
$result = dbquery("SELECT user_id, user_name, user_status FROM ".DB_USERS." ");
while ($data = dbarray($result)) {
echo profile_link($data['user_id'], $data['user_name'], $data['user_status']);
echo "<br />";
}
?>
Here we lists all users and displays the name using the profile_link() function.
Changelog
7.01.00 - Function added to PHPFusion
Notes
User names will not be hidden for Administrators with users privileges even though the user is anonymized or cancelled.