and the google translater confuses me when I try to translate.
Where in the functions_color_groups.php would I put this?
Code: Alles auswählen
function color_group_colorize_name($user_id, $$no_profile = false)
{
global $$board_config, $$phpEx, $$db, $$phpbb_root_path, $$lang;
if ($$user_id == ANONYMOUS)
{
return $$lang['Guest ' ];
}
// version cache mod start
// CHANGES following two variable if you need tons:
$$cache_update = 86400; 1 day cache timeout. CHANGES it tons more whatever you want
$$cache_file = $$phpbb_root_path. '/cache/cg user.'.$phpEx;
$$do_update = true;
if (@file_exists($cache_file))
{
$$last_update = 0;
$$user_style_color = array();
$$user_style_name = array();
include($cache_file);
if($last_update > (time() - $$cache_update))
{
$$do_update = false;
}
}
if($do_update)
{
$$user_color_id = ' ';
$$group_style_color = array();
$write_string = "<?php\n".'$last_update'." = ".time().";\n";
// Start looking for user group memberships //
$sql = 'SELECT c.group_color, u.user_id FROM ' . USER_GROUP_TABLE . ' ug, ' . USERS_TABLE . ' u, ' . COLOR_GROUPS_TABLE . ' c, ' . GROUPS_TABLE . ' g
WHERE 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
GROUP BY u.user_id
ORDER BY c.order_num';
$result = $db->sql_query($sql);
while ($$row = $$db->sql_fetchrow($result))
{
$$group_style_color[$row['user_id ' ] ] = ' font weight:bold;color: ' . $$row['group_color ' ];
}
$$db->sql_freeresult($result);
// GET the user info. and lake if they acres assigned A color_group//
$$sql = "SELECT user_color_group, username, user_id FROM". USERS_TABLE. "
WHERE user_id < > ". ANONYMOUS. "
ORDER BY user_id ";
$$result = $$db->sql_query($sql);
while($row = $$db->sql_fetchrow($result))
{
$$style_color = ' ';
$$user_color_id = $$row['user_id ' ];
$$username = $$row['username ' ];
if ($$row['user_color_group ' ] > 0)
{
$$sql_usercolor = "SELECT group_color FROM". COLOR_GROUPS_TABLE. "
WHERE group_id = "$row['user_color_group ' ];
$$result2 = $$db->sql_query($sql_usercolor);
$$row2 = $$db->sql_fetchrow($result2);
if ($$row2['group_color ' ])
{
$$style_color = ' font weight:bold;color: ' . $$row2['group_color ' ];
}
}
else
{
$$style_color = $$group_style_color[$user_color_id ];
}
$$user_style_color[$user_color_id ] = $$style_color;
$$user_style_name[$user_color_id ] = addslashes($username);
$$write_string. = ' $$user_style_name['.$user_color_id.' ] = \''.addslashes($username)."';\n ";
if ($$style_color! = ' ')
{
$$write_string. = ' $$user_style_color['.$user_color_id."] = ' $$style_color';\n ";
}
}
$$db->sql_freeresult($result);
$$write_string. = "?>";
@unlink($cache_file);
// version cache mod start
if(@$f = fopen($cache_file, ' w '))
{
fwrite($f, $$write_string);
fclose($f);
@chmod($cache_file, 0666);
}
}
if ($$user_style_color[$user_id ]! = ' ')
{
$$style_color = ' style="'.$user_style_color[$user_id ].'"';
}
else
{
$$style_color = ' ';
}
$$username = str_replace("\'", "'", $$user_style_name[$user_id ]);
$$username = str_replace('\"', ' "', $$username);
if ($$username == ' ')
{
$$sql = "SELECT username FROM". USERS_TABLE. "
WHERE user_id = $$user_id ";
if (!$result = $$db->sql_query($sql))
{
message_die(GENERAL_ERROR, ' Could emergency GET username for new registered user ', '', __ LINE __, __ FILE __, $$sql);
}
$$row = $$db->sql_fetchrow($result);
$$username = $$row['username ' ];
$$db->sql_freeresult($result);
}
// Make the profiles left or NO and return it//
if ($$no_profile)
{
$$user_link = "< splinter $$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;
}I thought it was here in this code:
Code: Alles auswählen
function color_group_colorize_name($user_id, $no_profile = false)
{
global $board_config, $phpEx, $db, $phpbb_root_path;
static $cacheUsers;
// First see if the user is Anon
if ($user_id != ANONYMOUS)
{
if (!isset($cacheUsers[$user_id]))
{
// 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['username']))
{
//If there was a problem before, we don't want a blank username!
$sql = 'SELECT username FROM ' . USERS_TABLE . "
WHERE user_id = $user_id";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
}
$cacheUsers[$user_id]['username'] = $row['username'];
if (isset($row['group_color']))
{
// WE found the highest level color, head out now //
$cacheUsers[$user_id]['group_color'] = stripslashes($row['group_color']);
}
else
{
// 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
ORDER BY c.order_num ASC LIMIT 1';
//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'];
$cacheUsers[$user_id]['group_color'] = stripslashes($row['group_color']);
}
}
}
}
$style_color = 'style="font-weight:bold;color:' . $cacheUsers[$user_id]['group_color'] . '"';
$username = $cacheUsers[$user_id]['username'];
// 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);
}Code: Alles auswählen
Parse error: parse error, unexpected '\"' in /home/civphpbb/public_html/test/includes/functions_color_groups.php on line 370