Du hast Probleme beim Einbau oder bei der Benutzung eines Mods? In diesem Forum bist du richtig.
Forumsregeln
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.0, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
oxpus
Ehemaliges Teammitglied
Beiträge: 5395 Registriert: 03.02.2003 12:33
Wohnort: Bad Wildungen
Kontaktdaten:
Beitrag
von oxpus » 19.11.2003 09:32
Ich hab das jetzt mal so eingebaut und das funzt bei mir:
Code: Alles auswählen
if (!empty($birthdayrows))
{
$this_year = create_date('Y', $time_now, $board_config['board_timezone']);
$date_today = $this_year.$date_now;
$date_forward = $this_year.$date_forward;
while (list($user_number, $birthdayrow) = each($birthdayrows))
{
$user_birthday2 = $this_year.($user_birthday = realdate("md",$birthdayrow['user_birthday'] ));
// give user a year more, if he alread have had birthday
if ( $user_birthday2 < $date_today ) $user_birthday2 += 10000;
if ( $user_birthday2 == $date_today )
{
//user have birthday today
$user_age = $this_year - realdate ( 'Y',$birthdayrow['user_birthday'] );
include_once("includes/functions_color_groups.".$phpEx);
switch ($birthdayrow['user_level'])
{
case ADMIN :
$birthdayrow['username'] = '<b>' . color_group_colorize_name($birthdayrow['user_id'], true) . '</b>';
break;
case JUNIOR_ADMIN :
$birthdayrow['username'] = '<b>' . color_group_colorize_name($birthdayrow['user_id'], true) . '</b>';
break;
case MOD :
$birthdayrow['username'] = '<b>' . color_group_colorize_name($birthdayrow['user_id'], true) . '</b>';
break;
default: $style_color = '';
}
$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>,';
} else 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']);
include_once("includes/functions_color_groups.".$phpEx);
switch ($birthdayrow['user_level'])
{
case ADMIN :
$birthdayrow['username'] = '<b>' . color_group_colorize_name($birthdayrow['user_id'], true) . '</b>';
break;
case JUNIOR_ADMIN :
$birthdayrow['username'] = '<b>' . color_group_colorize_name($birthdayrow['user_id'], true) . '</b>';
break;
case MOD :
$birthdayrow['username'] = '<b>' . color_group_colorize_name($birthdayrow['user_id'], true) . '</b>';
break;
default: $style_color = '';
}
$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>,';
}
}
if ($birthday_today_list) $birthday_today_list[ strlen( $birthday_today_list)-1] = ' ';
if ($birthday_week_list) $birthday_week_list[ strlen( $birthday_week_list)-1] = ' ';
}
Das gleiche kann man natürlich auch für Super-Mods machen...
OXPUS
Grüße
OXPUS
Kein Support bei unaufgeforderten PNs, E-Mails oder auf anderem Weg!!
TheRealKoston
Mitglied
Beiträge: 225 Registriert: 10.01.2004 20:26
Wohnort: Freystadt
Beitrag
von TheRealKoston » 25.01.2004 20:51
Oxpus funktioniert das auch in dem aktuellen Bday mod?
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']);
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);
was müsst ich da änderen
?
oxpus
Ehemaliges Teammitglied
Beiträge: 5395 Registriert: 03.02.2003 12:33
Wohnort: Bad Wildungen
Kontaktdaten:
Beitrag
von oxpus » 25.01.2004 21:17
Das hier (2x!):
Code: Alles auswählen
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 = '';
in dieses ändern
Code: Alles auswählen
case ADMIN :
$birthdayrow['username'] = '<b>' . color_group_colorize_name($birthdayrow['user_id'], true) . '</b>';
break;
case JUNIOR_ADMIN :
$birthdayrow['username'] = '<b>' . color_group_colorize_name($birthdayrow['user_id'], true) . '</b>';
break;
case MOD :
$birthdayrow['username'] = '<b>' . color_group_colorize_name($birthdayrow['user_id'], true) . '</b>';
break;
default: $style_color = '';
Grüße
OXPUS
Kein Support bei unaufgeforderten PNs, E-Mails oder auf anderem Weg!!
TheRealKoston
Mitglied
Beiträge: 225 Registriert: 10.01.2004 20:26
Wohnort: Freystadt
Beitrag
von TheRealKoston » 25.01.2004 21:26
huhu, danke
aber kann man einstellen, das Alter auch farbig wird (z.b. (17))
und es in der richtigen farbe unterstrichen ist
?
hab mal nen screenshot beigelegt:
[ externes Bild ]
sorry wegen der shclechten Farbqualität aber wollte das Bild klein halten (11 kb)
oxpus
Ehemaliges Teammitglied
Beiträge: 5395 Registriert: 03.02.2003 12:33
Wohnort: Bad Wildungen
Kontaktdaten:
Beitrag
von oxpus » 25.01.2004 21:42
Das ist mit dem Color Groups Mod nicht so ohne weiteres möglich...
Grüße
OXPUS
Kein Support bei unaufgeforderten PNs, E-Mails oder auf anderem Weg!!
TheRealKoston
Mitglied
Beiträge: 225 Registriert: 10.01.2004 20:26
Wohnort: Freystadt
Beitrag
von TheRealKoston » 25.01.2004 21:45
schade ;(
naja trotzdem Danke
vielleicht hat ja einer die Lösung =)
oxpus
Ehemaliges Teammitglied
Beiträge: 5395 Registriert: 03.02.2003 12:33
Wohnort: Bad Wildungen
Kontaktdaten:
Beitrag
von oxpus » 26.01.2004 00:59
Sagen wir es mal so: Eine Lösung könnte ich schon liefern, aber da spricht in meinen Augen etwas gewaltig dagegen:
Die Last auf der Datenbank!
Der Color Group Mod wird bereits in der Standard-Version für jeden User einmal aufgerufen (genauer die Funktion für die User-Farbe). Und genau an diesem Aufruf muss man dann auch den Geburtstag des Users auslesen und berechnen, damit es ebenfalls in der selben Farbe dargestellt werden kann.
Im günstigsten Fall klappt daß in der selben Abfrage, aber die zusächstliche Berechnung bremst das Board mehr aus. Bei vielen gleichzeitig aktiven Usern würde man das merken und daher rate ich eher davon ab und auch ich lebe daher lieber mit farbigen Usernamen und "einfachen" Altersangaben...
Grüße
OXPUS
Kein Support bei unaufgeforderten PNs, E-Mails oder auf anderem Weg!!
eVo
Mitglied
Beiträge: 62 Registriert: 30.11.2003 21:22
Kontaktdaten:
Beitrag
von eVo » 28.03.2004 20:09
@oxpus
Danke für die schnelle und unkomplizierte Integration!
Funkutioniert wunderbar.
Gruß eVo