[Fixed] Both January and October BD's show in October

Mod that adds a birthday field to the users profile, theire age are displayed beside the posts, and on there birthday they will have a greeting popup
Forum rules
The content in this forum is dated Dec. 21 2005 and can be used as Archive only. This Forum is LOCKED and READ ONLY !

Postby parad0x on Sun 12. Oct, 2003 21:46

I could be wrong, but I would almost bet that this is a Windows issue. The only reason I say that is this ... if you create 12 folders in Windows and have them sort by name (numerical order) they will order like this:
1
10
11
12
2
3

That, IMHO, is what this MOD is doing. Now, the fix for Windows would be to use 2 digits to name them, so you would get this:
01
02
03
04
...
11
12

If you use 2 digits for all 12 values, Windows will sort them correctly. Do you think it would fix the MOD as well?

BTW, this might have been fixed in Windows XP, but I know that Windows 2000 and previous versions have this bug/feature.
parad0x
Poster
Poster
 
Posts: 18
Joined: Sun 23. Mar, 2003 23:52

Postby kooky on Sun 12. Oct, 2003 23:19

No i don't think that come from Win
i have the same problem on UNIX PHP 4.3 and phpBB 2.0.4

i try to reproduce the error on an other website with UNIX and phpBB 2.0.6, and i haven't the error
very weird :?
kooky
brilliant supporter
 
Posts: 1329
Joined: Tue 31. Dec, 2002 17:52
Location: Au pays des rêves

Postby Niels on Mon 13. Oct, 2003 00:04

first of all, the birthday mod uses 4 digits for the year, and 2 digits for day and month, so this should not be the case....
I have enabled the "list on the index" here on mods.db9.dk, but was not able to see the problem.
so I asume it must be server dependent....here on mods I run on a win NT server with mySQL (3.23.49) my PHP versoin is 4.3.2 maybe this could be a isue....what is yours...
(if a how-to is EM ready, it will mostly be bullet prof, since a machine is more picky than a human. :D)
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby parad0x on Mon 13. Oct, 2003 01:27

I'm running:
    Windows 2000
    PHP 4.2.2
    Apache 1.3.26
    MySQL 4.0.0
    phpbb 2.03
The more I think about it, the stranger it gets. It almost has to be a sorting problem, but what would be causing it? It must not be OS related as I have the problem in Windows and kooky can duplicate it on UNIX. Maybe something in the older versions of phpbb (but I can't imagine why)?

If I find some free time this week, I'll set up a localhost with different versions of phpbb and see if I have the same issues.

Just to clarify:
<option value="1">&nbsp;'.$lang['datetime']['January'].'&nbsp;</option>

Does this keep a value of 1, or does it change?
parad0x
Poster
Poster
 
Posts: 18
Joined: Sun 23. Mar, 2003 23:52

Postby Niels on Mon 13. Oct, 2003 03:01

I agree it could be a sorting isue..maybe.

I seee you use mySQL 4 - I use mySQL 3 maybe this could cause it.
I don't think php version could be the isue. as the different between 4.2.2 and 4.3.2. should not be major. but one can never know.



so for now:
it's not a windows probl. (I'm using windows)
it deffently not the apache version
nor is it the phpBB version
(if a how-to is EM ready, it will mostly be bullet prof, since a machine is more picky than a human. :D)
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby m-a-b on Sat 25. Oct, 2003 13:03

i have the same problem.

but i'm showing birthday of next seven days.

you can watch it here: http://www.augs-burg.de/aev/portal.php
and here http://www.augs-burg.de/aev/index.php

php-version: 4.3.1
System: Linux
MySQL: 3.23.49

i hope we will find a solution!
m-a-b
Poster
Poster
 
Posts: 6
Joined: Mon 31. Mar, 2003 19:54

Postby m-a-b on Sat 25. Oct, 2003 13:13

you've to take the actual code:

Code: Select all
#
#-----[ OPEN ]------------------------------------------
#
index.php

#
#-----[ FIND ]------------------------------------------
#
   //
   // Start output of page

#
#-----[ BEFORE, ADD ]------------------------------------------
#

//
// Birthday Mod, Show users with birthday
$time_now = time();
$date_now = create_date('md', $time_now, $board_config['board_timezone']);
$date_forward = create_date('md', $time_now+($board_config['birthday_check_day']*86400), $board_config['board_timezone']);
$sql = ($board_config['birthday_check_day']) ? "SELECT user_id, username, user_birthday, user_level FROM ".USERS_TABLE." WHERE user_birthday<>999999 AND
(user_birthday<0 OR DATE_FORMAT(FROM_DAYS(user_birthday),'%m%d') BETWEEN ".(($date_now<$date_forward) ? "'($date_now+0)' AND '$date_forward'" : "'($date_now+0)' AND '1231' OR DATE_FORMAT(FROM_DAYS(user_birthday),'%m%d') BETWEEN '0101' AND '$date_forward'") .") ORDER BY username" : "SELECT 1";
if(!$result = $db->sql_query($sql))
{
        message_die(GENERAL_ERROR, "Could not fetch birthday for users.", "", __LINE__, __FILE__, $sql);
} else
{
   $birthdayrows = array();
   $birthdayrows = $db->sql_fetchrowset($result);
}
   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'] );
            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>,';
            } 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']);
            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>,';
         }
      }
      if ($birthday_today_list) $birthday_today_list[ strlen( $birthday_today_list)-1] = ' ';
      if ($birthday_week_list) $birthday_week_list[ strlen( $birthday_week_list)-1] = ' ';
   }
if (isset($result))
{
   $db->sql_freeresult($result);
}


after i have taken this code my problem was gone!
m-a-b
Poster
Poster
 
Posts: 6
Joined: Mon 31. Mar, 2003 19:54

got the same prob

Postby felixdacat on Mon 27. Oct, 2003 06:40

hey folks

i encountered the same problem, and thanx to m-a-b i could get rid of this error. thanx man! but nevertheless i would like to know what went wrong!
felix
felixdacat
Poster
Poster
 
Posts: 7
Joined: Wed 13. Nov, 2002 05:41

PreviousNext

Return to Birthday [2.0.10/EM]

Who is online

Users browsing this forum: No registered users and 1 guest

cron