Also ich habe das genau so stehen:
Code: Alles auswählen
'POSTER' => color_group_colorize_name($fetchposts[$i]['user_id'], TRUE),Häng doch mal die portal.php und fetchposts.php hier an. Dann schaue ich da rein.
Code: Alles auswählen
'POSTER' => color_group_colorize_name($fetchposts[$i]['user_id'], TRUE),Code: Alles auswählen
#
#-----[ OPEN ]-----
#
common.php
#
#-----[ FIND ]-----
#
?>
#
#-----[ BEFORE, ADD ]-----
#
$colorusers = array();
$coloruname = array();
while ( $row = $db->sql_fetchrow($result) )
{
$userid = $row['user_id'];
$colorusers[$userid] = $row['user_color_group'];
$coloruname[$userid] = $row['username'];
}
$colorgroup = array();
$sql = "SELECT ug.user_id FROM " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g
WHERE g.group_single_user = 0
AND g.group_id = ug.group_id
GROUP BY ug.user_id
ORDER BY ug.user_id";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not read user color groups', '', __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result) )
{
$colorgroup[] = $row['user_id'];
}
#
#-----[ OPEN ]-----
#
includes/functions_color_groups.php
#
#-----[ FIND ]-----
#
function color_group_colorize_name($user_id, $no_profile = false)
{
.
.
.
}
#
#-----[ REPLACE WITH ]-----
#
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;
}
}
#
#-----[ SAVE/CLOSE ALL FILES ]-----
#
# EoM
Code: Alles auswählen
// Birthday Mod, Show users with birthday
$sql = ($board_config['birthday_check_day']) ? "SELECT user_id, username, user_birthday,user_level FROM " . USERS_TABLE. " WHERE user_birthday!=999999 ORDER BY username" :"";
if($result = $db->sql_query($sql))
{
if (!empty($result))
{
$time_now = time();
$this_year = create_date('Y', $time_now, $board_config['board_timezone']);
$date_today = create_date('Ymd', $time_now, $board_config['board_timezone']);
$date_forward = create_date('Ymd', $time_now+($board_config['birthday_check_day']*86400), $board_config['board_timezone']);
while ($birthdayrow = $db->sql_fetchrow($result))
{
usleep(2);
$user_birthday2 = $this_year.($user_birthday = realdate("md",$birthdayrow['user_birthday'] ));
if ( $user_birthday2 < $date_today ) $user_birthday2 += 10000;
if ( $user_birthday2 > $date_today && $user_birthday2 <= $date_forward )
{
// user are having birthday within the next days
$user_age = ( $this_year.$user_birthday < $date_today ) ? $this_year - realdate ('Y',$birthdayrow['user_birthday'])+1 : $this_year- realdate ('Y',$birthdayrow['user_birthday']);
switch ($birthdayrow['user_level'])
{
case ADMIN :
$birthdayrow['username'] = '<b>' . $birthdayrow['username'] . '</b>';
$style_color = 'style="color:#' . $theme['fontcolor3'] . '"';
break;
case MOD :
$birthdayrow['username'] = '<b>' . $birthdayrow['username'] . '</b>';
$style_color = 'style="color:#' . $theme['fontcolor2'] . '"';
break;
default: $style_color = '';
}
$birthday_week_list .= ' <a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $birthdayrow['user_id']) . '"' . $style_color .'>' . $birthdayrow['username'] . ' ('.$user_age.')</a>,';
} else if ( $user_birthday2 == $date_today )
{
//user have birthday today
$user_age = $this_year - realdate ( 'Y',$birthdayrow['user_birthday'] );
switch ($birthdayrow['user_level'])
{
case ADMIN :
$birthdayrow['username'] = '<b>' . $birthdayrow['username'] . '</b>';
$style_color = 'style="color:#' . $theme['fontcolor3'] . '"';
break;
case MOD :
$birthdayrow['username'] = '<b>' . $birthdayrow['username'] . '</b>';
$style_color = 'style="color:#' . $theme['fontcolor2'] . '"';
break;
default: $style_color = '';
}
$birthday_today_list .= ' <a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $birthdayrow['user_id']) . '"' . $style_color .'>' . $birthdayrow['username'] . ' ('.$user_age.')</a>,';
}
}
if ($birthday_today_list) $birthday_today_list[ strlen( $birthday_today_list)-1] = ' ';
if ($birthday_week_list) $birthday_week_list[ strlen( $birthday_week_list)-1] = ' ';
}
$db->sql_freeresult($result);
}
Code: Alles auswählen
if (!empty($result))
{
$time_now = time();
$this_year = create_date('Y', $time_now, $board_config['board_timezone']);
$date_today = create_date('Ymd', $time_now, $board_config['board_timezone']);
$date_forward = create_date('Ymd', $time_now+($board_config['birthday_check_day']*86400), $board_config['board_timezone']);
include_once("includes/functions_color_groups.".$phpEx);
while ($birthdayrow = $db->sql_fetchrow($result))
{
$user_birthday2 = $this_year.($user_birthday = realdate("md",$birthdayrow['user_birthday'] ));
if ( $user_birthday2 < $date_today ) $user_birthday2 += 10000;
if ( $user_birthday2 > $date_today && $user_birthday2 <= $date_forward )
{
// user are having birthday within the next days
$user_age = ( $this_year.$user_birthday < $date_today ) ? $this_year - realdate ('Y',$birthdayrow['user_birthday'])+1 : $this_year- realdate ('Y',$birthdayrow['user_birthday']);
$birthday_week_list .= ' <a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $birthdayrow['user_id']) . '">' . color_group_colorize_name($birthdayrow['user_id'], true) . ' ('.$user_age.')</a>,';
} else if ( $user_birthday2 == $date_today )
{
//user have birthday today
$user_age = $this_year - realdate ( 'Y',$birthdayrow['user_birthday'] );
$birthday_today_list .= ' <a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $birthdayrow['user_id']) . '">' . color_group_colorize_name($birthdayrow['user_id'], true) . ' ('.$user_age.')</a>,';
}
}
if ($birthday_today_list) $birthday_today_list[ strlen( $birthday_today_list)-1] = ' ';
if ($birthday_week_list) $birthday_week_list[ strlen( $birthday_week_list)-1] = ' ';
}Code: Alles auswählen
//
// Users of the day MOD
//
// ############ Edit below ############
// #
$display_not_day_userlist = 0; // change to 1 here if you also want the list of the users who didn't visit to be displayed
$users_list_delay = 48; // change here to the number of hours wanted for the list
$scroll_delay = 95; // increasing the value causes the scroll to become slower
//
//
// #
// ############ Edit above ############
$sql = "SELECT user_id, username, user_allow_viewonline, user_level, user_session_time
FROM ".USERS_TABLE."
WHERE user_id > 0
ORDER BY user_level DESC, username ASC";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain user/day information', '', __LINE__, __FILE__, $sql);
}
$day_userlist = '';
$day_users = 0;
$not_day_userlist = '';
$not_day_users = 0;
while( $row = $db->sql_fetchrow($result) )
{
$style_color = '';
if ( $row['user_level'] == ADMIN )
{
$row['username'] = '<b>' . $row['username'] . '</b>';
$style_color = 'style="color:#' . $theme['fontcolor4'] . '"';
}
else if ( $row['user_level'] == MOD )
{
$row['username'] = '<b>' . $row['username'] . '</b>';
$style_color = 'style="color:#' . $theme['fontcolor2'] . '"';
}
if ( $row['user_allow_viewonline'] )
{
$user_day_link = '<a href="' . append_sid("privmsg.php?mode=post&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .' title="Send User a PM" onMouseOver=document.all.userscroll1.stop() onMouseOut=document.all.userscroll1.start()><img src=templates/subSilver/images/icon_scroll_pm.gif align=top border=0></a> <a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .' title="View Users Profile" onMouseOver=document.all.userscroll1.stop() onMouseOut=document.all.userscroll1.start()>' . $row['username'] . '</a>';
}
else
{
$user_day_link = '<a href="' . append_sid("privmsg.php?mode=post&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .' title="Send User a PM" onMouseOver=document.all.userscroll1.stop() onMouseOut=document.all.userscroll1.start()><img src=templates/subSilver/images/icon_scroll_pm.gif align=top border=0></a> <a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .' title="View Users Profile" onMouseOver=document.all.userscroll1.stop() onMouseOut=document.all.userscroll1.start()><i>' . $row['username'] . '</i></a>';
}
if ( $row['user_allow_viewonline'] || $userdata['user_level'] == ADMIN )
{
if ( $row['user_session_time'] >= ( time() - $users_list_delay * 3600 ) )
{
$day_userlist .= ( $day_userlist != '' ) ? '; ' . $user_day_link : $user_day_link;
$day_users++;
}
else
{
$not_day_userlist .= ( $not_day_userlist != '' ) ? '; ' . $user_day_link : $user_day_link;
$not_day_users++;
}
}
}
$day_userlist = ( ( isset($forum_id) ) ? '' : sprintf($lang['Day_users'], $day_users, $users_list_delay) ) . '<br /><marquee scrolldelay='.$scroll_delay.' id=userscroll1 behavior="scroll" direction="left" >' . $day_userlist . '</marquee>';
$not_day_userlist = ( ( isset($forum_id) ) ? '' : sprintf($lang['Not_day_users'], $not_day_users, $users_list_delay) ) . '<br /><marquee scrolldelay=$scroll_delay id=userscroll2>' . $not_day_userlist . '</marquee>';
if ( $display_not_day_userlist )
{
$day_userlist .= '<br />' . $not_day_userlist;
}
//
// End of MOD
//Code: Alles auswählen
//
// Users of the day Mod
//
// ############ Edit below ############
// #
$display_not_day_userlist = 0; // change to 1 here if you also want the list of the users who didn't visit to be displayed
$users_list_delay = 48; // change here to the number of hours wanted for the list
$scroll_delay = 95; // increasing the value causes the scroll to become slower
//
//
// #
// ############ Edit above ############
$SQL = "SELECT user_id, username, user_allow_viewonline, user_level, user_session_time
FROM ".USERS_TABLE."
WHERE user_id > 0
ORDER BY user_level DESC, username ASC";
if( !($result = $db->sql_query($SQL)) )
{
message_die(GENERAL_ERROR, 'Could not obtain user/day information', '', __LINE__, __FILE__, $SQL);
}
$day_userlist = '';
$day_users = 0;
$not_day_userlist = '';
$not_day_users = 0;
include_once($phpbb_root_path.'includes/functions_color_groups.'.$phpEx);
while( $row = $db->sql_fetchrow($result) )
{
if ( $row['user_allow_viewonline'] )
{
$user_day_link = '<a href="' . append_sid("privmsg.php?mode=post&" . POST_USERS_URL . "=" . $row['user_id']) . '" title="Send User a PM" onMouseOver=document.all.userscroll1.stop() onMouseOut=document.all.userscroll1.start()><img src=templates/subSilver/images/icon_scroll_pm.gif align=top border=0></a> <a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '" title="View Users Profile" onMouseOver=document.all.userscroll1.stop() onMouseOut=document.all.userscroll1.start()>' . (color_group_colorize_name($row['user_id'], true)) . '</a>';
}
else
{
$user_day_link = '<a href="' . append_sid("privmsg.php?mode=post&" . POST_USERS_URL . "=" . $row['user_id']) . '" title="Send User a PM" onMouseOver=document.all.userscroll1.stop() onMouseOut=document.all.userscroll1.start()><img src=templates/subSilver/images/icon_scroll_pm.gif align=top border=0></a> <a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '" title="View Users Profile" onMouseOver=document.all.userscroll1.stop() onMouseOut=document.all.userscroll1.start()><i>' . (color_group_colorize_name($row['user_id'], true)) . '</i></a>';
}
if ( $row['user_allow_viewonline'] || $userdata['user_level'] == ADMIN )
{
if ( $row['user_session_time'] >= ( time() - $users_list_delay * 3600 ) )
{
$day_userlist .= ( $day_userlist != '' ) ? '; ' . $user_day_link : $user_day_link;
$day_users++;
}
else
{
$not_day_userlist .= ( $not_day_userlist != '' ) ? '; ' . $user_day_link : $user_day_link;
$not_day_users++;
}
}
}
$day_userlist = ( ( isset($forum_id) ) ? '' : sprintf($lang['Day_users'], $day_users, $users_list_delay) ) . '<br /><marquee scrolldelay='.$scroll_delay.' id=userscroll1 behavior="scroll" direction="left" >' . $day_userlist . '</marquee>';
$not_day_userlist = ( ( isset($forum_id) ) ? '' : sprintf($lang['Not_day_users'], $not_day_users, $users_list_delay) ) . '<br /><marquee scrolldelay=$scroll_delay id=userscroll2>' . $not_day_userlist . '</marquee>';
if ( $display_not_day_userlist )
{
$day_userlist .= '<br />' . $not_day_userlist;
}
//
// End of Mod
//