<?php
function format_name($username, $usergroup, $displaygroup="")
{
global $groupscache, $cache;
if(!is_array($groupscache))
{
$groupscache = $cache->read("usergroups");
}
if($displaygroup != 0)
{
$usergroup = $displaygroup;
}
$ugroup = $groupscache[$usergroup];
$format = $ugroup['namestyle'];
$userin = substr_count($format, "{username}");
if($userin == 0)
{
$format = "{username}";
}
$format = stripslashes($format);
return str_replace("{username}", $username, $format);
}
<?php
function format_name($username, $usergroup, $displaygroup="")
{
global $groupscache, $cache, $db;
if(!is_array($groupscache))
{
$groupscache = $cache->read("usergroups");
}
if($displaygroup != 0)
{
$usergroup = $displaygroup;
}
$ugroup = $groupscache[$usergroup];
$format = $ugroup['namestyle'];
$userin = substr_count($format, "{username}");
if($userin == 0)
{
$format = "{username}";
}
$format = stripslashes($format);
if($db->table_exists("pointshop_customname") && $db->table_exists("pointshop_customname_users"))
{
$query = $db->simple_select('users', 'customname', "username='".$db->escape_string(trim($username))."' AND usergroup='".$db->escape_string(trim($usergroup))."'");
$user = $db->fetch_array($query);
if(!empty($user['customname']))
{
$query = $db->simple_select('pointshop_customname', 'style', 'acid='.$user['customname']);
$custom = $db->fetch_array($query);
$format = $custom['style'];
$format = stripslashes($format);
return str_replace("{username}", $username, $format);
}
else
{
return str_replace("{username}", $username, $format);
}
}
else
{
return str_replace("{username}", $username, $format);
}
}
(16 Sep, 2011, 10:10 am)Jaizu escribió:(16 Sep, 2011, 8:43 am)Edson Ordaz escribió: Ya te eh contestado en tu otro post xD
Justo lo arreglé antes de que solucionases xD
Mejor será que TÚ(no otro, no es por gritar xD) borres estos mensajes nuestros para no dejar el SPAM xD