PDA

View Full Version : A small idea


heretic
04-29-2002, 12:28 AM
on my board, most users have 2 nicknames. right now, I'm using one of the names as a custom profile field, and then just doing a template edit to show the change. however, for the life of me I can't figure out how to get the name to change on the forumdisplay.
here's a shot of what I'm talking about:

heretic
04-29-2002, 12:28 AM
and what I want to replace:

heretic
04-29-2002, 07:51 AM
anyone? I'm sure this is easy

Neo
04-29-2002, 08:04 AM
Find

if ($thread['postuserid']) {
$thread['postedby'] = "<a href=\"member.php?action=getinfo&userid=$thread[postuserid]\">$thread[postusername]</a>";
} else {
$thread['postedby'] = $thread[postusername];
}


and replace with


$secondname_db=$DB_site->query("SELECT fieldx FROM userfield WHERE userid='$thread[postuserid]'");
$secondname=$secondname_db[fieldx];
if ($thread['postuserid']) {
$thread['postedby'] = "<a href=\"member.php?action=getinfo&userid=$thread[postuserid]\">$secondname</a>";
} else {
$thread['postedby'] = $secondname;
}


edit the fieldX to whatever the field number is.

Have fun.

heretic
04-29-2002, 11:03 AM
thanks :)

Neo
04-29-2002, 05:37 PM
No problem.