I originally posted this on StackOverflow, but it ended up getting completely ignored there.
Original text:
I am trying to concatenate a couple of things into 1 variable, to make MySQL’s life easier.
However, this only works as it’s supposed to if people have a custom name colour applied.
People who don’t will appear as the default “a” (for URLs) class as specified in CSS.
For example, I have the following thing in PHP:
[code=php]$name = “<a href=’user.php?page=profile&uid=$uid’>”;
if (empty($custom_name_colour)) {
$name .= “<font style=’color: #7C60B0;’>”;
}
else {
$name .= “<span style=’$custom_name_colour’>”;
}
if (empty($display_name)) {
$name .= $username;
}
else {
$name .= $display_name;
}
if (empty($custom_name_colour)) {
$name .= “</font>”;
}
else {
$name .= “</span>”;
}
$name .= “</a>”;
The font style is actually being determined though a function based on the users’ gender and power level, but I chose one of them to make this question a bit more testable.