UBB.Dev
Posted By: Jockox3 Can't get data - 03/21/2001 12:43 AM
Sorry for the not very descriptive title for this.

I am trying to alter showmembers.php such that it displays the users' real name entered in their profiles rather than their usernames (login names).

I have made the following little alterations, all of which individually seem to work eslewhere, but here they do not result in '$RealName' being displayed either instead of or alongside the '$Username':

// Jock - add real name to the list of things to fetch from the database
$query = "
SELECT U_Username,U_Registered,U_Extra1,U_Homepage,U_TotalPosts,U_Status,U_Name
FROM w3t_Users
ORDER BY " .$Sorting[$sb][1]. "
$limitit
";
$sth = $dbh -> do_query($query);
$total = $dbh -> total_rows($sth);
$newpage = 0;

// -----------------------
// Set the first row color
$color = "lighttable";

// ----------------------------------------------------------------
// Cycle through the users
for($i=0;$i<$total;$i++){

// Jock - add real name to the list call
list ($Username,$Reged,$ICQ,$Home,$Posts,$Status,$RealName) = $dbh -> fetch_array($sth);

if ($Home) {
$Home = "<a href="http://$Home" target="new">$Home</a>";
}
if ( (ereg("[0-9]",$ICQ)) && ($config[ICQ_Status]) ){
$ICQ = "<img src="http://online.mirabilis.com/scripts/online.dll?icq=$ICQ&img=1">";
}
$Reged = $html -> convert_time($Reged,$user[U_TimeOffset]);
$EUsername = rawurlencode($Username);

// Jock - do we add real names if so do so change $Username to $PUsername in output below too
$PUsername = $Username;
if ($RealName && $config[realnames]){
$PUsername = $PUsername." - ".$RealName;
}

echo "
<tr class="$color">
<td>
<a href="$config[phpurl]/showprofile.php?Cat=$Cat&User=$EUsername&page=$page&what=showmembers">$PUsername</a>
</td><td>
$Status

Posted By: Jockox3 Re: Can't get data - 03/21/2001 2:23 AM
Sorted - see PHP Bug reports - it was losing the variable in config.inc.php

© UBB.Developers