Nächste Geburtstage und Color Groups

Allgemeiner Support zum phpBB 2 Board und phpBB 2 Modifikationen
Forumsregeln
Auch wenn hier der Support für phpBB 2 weiterhin aufrecht erhalten bleibt, weisen wir darauf hin, dass das phpBB 2 nicht mehr offiziell unterstützt und weiterentwickelt wird!
Antworten
Benutzeravatar
oxpus
Administrator
Beiträge: 28737
Registriert: Mo 27.Jan, 2003 22:13
Wohnort: Bad Wildungen
Kontaktdaten:

Nächste Geburtstage und Color Groups

Beitrag von oxpus »

In der index.php diesen Teil ersetzen mit:

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] = ' ';
   }
Antworten