i have a question about a function.
function &formatName($id, $name, $clanId, $clanSym, $clanCol)
{
static $cache = array();
if (!isset($cache[$name])) {
$cache[$name] = esc($name);
if ($id !== NULL) {
$cache[$name] = '<a href="' . esc('player_info.php?target=' . $id) .
'">' . $cache[$name] . '</a>';
} else {
$cache[$name] = "<s>{$cache[$name]}</s>";
}
if ($clanId !== NULL && $clanId != 0) {
$cache[$name] = "(<span style=\"color: #$clanCol;\">" .
htmlentities($clanSym) . "</span>) " . $cache[$name];
}
}
return $cache[$name];
}
//print clickable name of $player
function print_name($player)
{
global $db_name, $user_options;
static $cache = array();
if (!isset($cache[$player['login_name']])) {//this user not cached
$pQuery = mysql_query("select u.login_id, u.login_name, u.clan_id, u.clan_sym_color,u.clan_sym from ${db_name}_users u where u.login_id = '$player[login_id]'");
$player = mysql_fetch_assoc($pQuery);
$cache[$player['login_name']] = formatName($player['login_id'],
$player['login_name'], $player['clan_id'], $player['clan_sym'],
$player['clan_sym_color']);
}
return $cache[$player['login_name']];
}
the above functions prints a link with player’s name.
i would like to place a table or some sort of decorative background on the link.
Any way i can do this?
thank you for reading.
Simply change the line:
to
Then you can style the link and the surrounding span using CSS: