MODs: Ja
Dein Wissensstand: Fortgeschritten
Link zu Deinem Forum: [url]http://[/url]
PHP Version:
MySQL Version:
Was hast Du gemacht, bevor das Problem aufgetreten ist?
Was hast Du bereits versucht um das Problem zu lösen?
Fehlerbeschreibung und Nachricht
Hallo Oxpus und andere, habe mal wieder Probleme mit dem Einbau eines Mods.
Da ich hier immer Hilfe bekommen habe, für die ich dankbar bin, diesmal wieder eine Frage von mir:
Mein Problem ist folgendes:
Mod-Einbau von IP Country Flag, MOD Version: 1.1.0 RC3
in phpBB-Plus 1.5.3 Beta 4 mit vielen weitern Mods,
Problem mit functions_color_groups.php,v $
Wer kann helfen?
in der Mod- Anleitung steht:
in page_header steht jedoch:#
#-----[ FIND - in page_header: ]---------------------------------------------------------
# the line is longer..
$user_online_link = '<a href="'
#
#
#-----[ IN-LINE FIND ]-------------------------------------------------
#
'>' . $row['username']
#
#-----[ IN-LINE REPLACE WITH ]-----------------------------------------
#
' title="' . $country . '"><img src="images/flags/small/' . $row['session_cf_iso3661_1'] . '.png" width="14" height="9" border="0" alt="' . $country . '" title="' . $country . '" /> ' . $row['username']
Der Part in functions_color_groups dürfte dieser sein:$user_online_link = color_group_colorize_name($row['user_id']);
Meine Frage wäre: kann ich den $user_link folgendermaßen ändern?function color_group_colorize_name($user_id, $no_profile = false)
{
global $board_config, $phpEx, $db, $phpbb_root_path, $colorusers, $coloruname, $colorgroup;
// First see if the user is Anon
if ($user_id != ANONYMOUS)
{
$username = $coloruname[$user_id];
if ( $colorusers[$user_id] != 0 )
{
// Get the user info and see if they are assigned a color_group //
$sql = 'SELECT u.user_color_group, u.username, c.* FROM ' . USERS_TABLE . ' u, ' . COLOR_GROUPS_TABLE . " c
WHERE u.user_id = $user_id
AND u.user_color_group = c.group_id";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
}
if (isset($row['group_color']))
{
// WE found the highest level color, head out now //
$style_color = 'style="font-weight:bold;color:' . $row['group_color'] . '"';
}
else
{
if ( in_array($user_id, $colorgroup) )
{
// Now start looking for user group memberships //
$sql = 'SELECT c.* FROM ' . USER_GROUP_TABLE . ' ug, ' . USERS_TABLE . ' u, ' . COLOR_GROUPS_TABLE . ' c, ' . GROUPS_TABLE . ' g
WHERE ug.user_id = ' . $user_id . '
AND u.user_id = ug.user_id
AND ug.group_id = g.group_id
AND g.group_color_group = c.group_id
AND g.group_single_user = 0';
//print $sql;
$result = $db->sql_query($sql);
$curr = 10000000000000;
$style_color = '';
while ($row = $db->sql_fetchrow($result))
{
// If our new group in the list is a higher order number, it's color takes precedence //
if ($row['order_num'] < $curr)
{
$curr = $row['order_num'];
$style_color = 'style="font-weight:bold;color:' . $row['group_color'] . '"';
}
}
}
}
// Make the profile link or no and return it //
if ($no_profile)
{
$user_link = "<span $style_color>$username</span>";
}
else
{
$user_link = '<a href="' . append_sid($phpbb_root_path."profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$user_id") . '"' . $style_color .'>' . $username . '</a>';
}
return($user_link);
}
else
{
$username = $coloruname[$user_id];
if ($no_profile)
{
$user_link = "<span $style_color>$username</span>";
}
else
{
$user_link = '<a href="' . append_sid($phpbb_root_path."profile.php?mode=viewprofile&" . POST_USERS_URL . "=$user_id") . '"' . $style_color .'>' . $username . '</a>';
}
return $username;
}
}
Wenn ja, wo müsste ich $country definieren?$user_link = '<a href="' . append_sid($phpbb_root_path."profile.php?mode=viewprofile&" . POST_USERS_URL . "=$user_id") . '"' . $style_color .' title="' . $country . '"><img src="images/flags/small/' . $row['session_cf_iso3661_1'] . '.png" width="14" height="9" border="0" alt="' . $country . '" title="' . $country . '" /> ' . $username . '</a>';
//-- mod : IP Country Flags ----------------------------------------------
// add
$country = $row['session_cf_country'];
if (($user->data['user_lang'] != 'english') && (strlen (trim ($countries[$row['session_cf_iso3661_1']]) != 0)))
{
$country = $countries[$row['session_cf_iso3661_1']];
}
//-- end mod : IP Country Flags ------------------------------------------