Error in Birthday calender

Current Version: 1.0.6
Released: 09.01.10
Forum rules
Before creating a new support thread, please take a look in the board3 Portal FAQ and use the search!
Many questions have already been answered.
Locked

Topic author
MaxxHoorn
Active Member
Posts: 4
Joined: 10. December 2010 19:41

Error in Birthday calender

Post by MaxxHoorn »

Your Portal Version: 1.0.6
Your phpBB Type: Standard phpBB3
MODs installed: Yes
Your knowledge: Basic Knowledge
Boardlink: http://www.seriejunkies.nl

PHP Version: 3.0.7-PL1

What have you done before the problem was there?
Nothing related to the portal and/or birthdayblock phpcode.

What have you already tryed to solve the problem?
Nothing. Disabled the birthday-block so the error won't show.

Description and Message
Portal shows an error message.

Code: Select all

[phpBB Debug] PHP Notice: in file /portal/includes/functions.php on line 630: mktime() [function.mktime]: Windows does not support negative values for this function
I think it has to do with a specific date or an invalid date a user filled out for his/her birthday. I didn't change anything on the mod settings and in the previous week it worked correctly.[/i]
User avatar

archivar
Portal Professional
Posts: 1959
Joined: 19. April 2009 21:34
phpBB.de User: archivar
phpBB.com User: archivar
Location: Deutschland

Re: Error in Birthday calender

Post by archivar »

Compare this code in in file /portal/includes/functions.php

Code: Select all

function format_birthday($date, $format = false)
{
	global $user;
		$time->time_now	= time();
		$lang_dates		= $user->lang['datetime'];
		$format			= (!$format) ? $time->date_format : $format;

		// Short representation of month in format
		if ((strpos($format, '\M') === false && strpos($format, 'M') !== false) || (strpos($format, '\r') === false && strpos($format, 'r') !== false))
		{
			$lang_dates['May'] = $lang_dates['May_short'];
		}
		unset($lang_dates['May_short']);
		
	// We need to create a UNIX timestamp for date()
	$day = substr($date, 0, strpos($date, '-'));
	$month = substr($date, (strpos($date, '-')+1), 2);
	$year = substr($date, -4);
	$birthday_time = mktime(0, 0, 0, $month, $day, $year);

	return strtr(@date(str_replace('|', '', $format), $birthday_time), $lang_dates);
}
and write is different or the same.
V.G. archivar
sorry for my bad english

Topic author
MaxxHoorn
Active Member
Posts: 4
Joined: 10. December 2010 19:41

Re: Error in Birthday calender

Post by MaxxHoorn »

It's the same. Is that good or bad? :)
User avatar

archivar
Portal Professional
Posts: 1959
Joined: 19. April 2009 21:34
phpBB.de User: archivar
phpBB.com User: archivar
Location: Deutschland

Re: Error in Birthday calender

Post by archivar »

MaxxHoorn wrote:It's the same. Is that good or bad? :)
That's good.
Test if it is error-free in the Forum Index.
V.G. archivar
sorry for my bad english

Topic author
MaxxHoorn
Active Member
Posts: 4
Joined: 10. December 2010 19:41

Re: Error in Birthday calender

Post by MaxxHoorn »

It works on the forumindex, no error.

I think on the forumindex only users with their birthday today are shown, while on the portal users who have their birthday this week are shown. So I might get an error on the index later this week (hopefully not ofcourse).
User avatar

archivar
Portal Professional
Posts: 1959
Joined: 19. April 2009 21:34
phpBB.de User: archivar
phpBB.com User: archivar
Location: Deutschland

Re: Error in Birthday calender

Post by archivar »

You can enter your birthday on this day.
For a short time.
V.G. archivar
sorry for my bad english

Topic author
MaxxHoorn
Active Member
Posts: 4
Joined: 10. December 2010 19:41

Re: Error in Birthday calender

Post by MaxxHoorn »

I know, I tried that and it works.

What I meant was that at the index it only looks at this day. On the portal it shows the whole week. I thought maybe someone has used an invalid date, for a day later this week. For example: 18 jan 2012, which is in the future and it would calculate an age of -1 (a negative value). At the index it would only show on january 18th, but because the portal shows all birthdays of the week, an error might occour.

I'm purely speculating, I don't have any programming skills. :)
User avatar

Marc
Dev
Posts: 2504
Joined: 17. July 2008 21:08
phpBB.de User: marc1706
phpBB.com User: Marc
Location: Clausthal-Zellerfeld / München
Contact:

Re: Error in Birthday calender

Post by Marc »

I'll take a look at it. ;)
User avatar

Marc
Dev
Posts: 2504
Joined: 17. July 2008 21:08
phpBB.de User: marc1706
phpBB.com User: Marc
Location: Clausthal-Zellerfeld / München
Contact:

Re: Error in Birthday calender

Post by Marc »

This is caused by your PHP version in combination with your Windows machine. If you want it to work, update your PHP version.
Locked

Return to “board3 Portal 1.0.x - English Support”