Error in index page

Having trouble installing ModphpBB3 - Post any questions or issues in here.
Anggun
Forum Member
Forum Member
Posts: 15
Joined: Wed Jul 23, 2008 9:11 am

Error in index page

Post by Anggun »

I'm trying to install ModphpBB3 1.0.5 Beta and followed the usual instructions to a T.

But when I get to the index page, I keep getting this error.

Code: Select all

Fatal error: Call to undefined method user::format_dateucb() in /home/tlgimsco/domains/ogphu.co.cc/public_html/includes/functions_upcbirthdays.php on line 91
All other pages are fine. I think it has something to do with the upcoming birthdays at the bottom of the index page but I can't figure what is wrong.
User avatar
LDM
Site Admin
Site Admin
Posts: 1786
Joined: Thu May 29, 2008 6:51 pm

Re: Error in index page

Post by LDM »

Is it a convertion or fresh install?
Anggun
Forum Member
Forum Member
Posts: 15
Joined: Wed Jul 23, 2008 9:11 am

Re: Error in index page

Post by Anggun »

Fresh install.
User avatar
LDM
Site Admin
Site Admin
Posts: 1786
Joined: Thu May 29, 2008 6:51 pm

Re: Error in index page

Post by LDM »

There could be a few things to try as I haven't seen that error on a fresh install before.

Double check the table is added in Database, if not, run this in there:

Code: Select all

INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_birthdays_ahead', '7');
Also, you could disable it within ACP. Can't really remember the settings you need to adjust (it's late :D ) but it is down there in 'load settings' area if I remember right.

Final straw, delete the template include to see if index loads again. Open index_body.html and delete:

Code: Select all

<br /><!-- IF BIRTHDAYS_AHEAD_LIST -->{L_BIRTHDAYS_AHEAD}: <strong>{BIRTHDAYS_AHEAD_LIST}</strong><!-- ENDIF -->
Anggun
Forum Member
Forum Member
Posts: 15
Joined: Wed Jul 23, 2008 9:11 am

Re: Error in index page

Post by Anggun »

LDM wrote:There could be a few things to try as I haven't seen that error on a fresh install before.

Double check the table is added in Database, if not, run this in there:

Code: Select all

INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_birthdays_ahead', '7');
THank you.. This one worked. The table row had an initial value of 365... Deleted it and insert the above and it worked.

I was going crazy trying to figure out what when wrong, did I missed a file to upload. Thank goodness its not a conversion or else my members will be stranded.
User avatar
LDM
Site Admin
Site Admin
Posts: 1786
Joined: Thu May 29, 2008 6:51 pm

Re: Error in index page

Post by LDM »

I'm glad you got it sorted Anggun. It doesn't normally throw that errow and haven't seen any report other than this one on it, so could be something server-side.

Nevermind, it's all running now which is the main thing.
Anggun
Forum Member
Forum Member
Posts: 15
Joined: Wed Jul 23, 2008 9:11 am

Re: Error in index page

Post by Anggun »

Okay, is there another way around this?
Since the upcoming birthday is set to 7 days ahead, I found that if someone has a birthday in the next 7 days, I got the same error again..
So basically I can't use that feature at all.
Kinda sad.. my members love that feature.

About that it could be server side, I don't know though I tried it on my localhost and got the same error.
User avatar
LDM
Site Admin
Site Admin
Posts: 1786
Joined: Thu May 29, 2008 6:51 pm

Re: Error in index page

Post by LDM »

What style are you using?
Anggun
Forum Member
Forum Member
Posts: 15
Joined: Wed Jul 23, 2008 9:11 am

Re: Error in index page

Post by Anggun »

Prosilver
User avatar
LDM
Site Admin
Site Admin
Posts: 1786
Joined: Thu May 29, 2008 6:51 pm

Re: Error in index page

Post by LDM »

hmm, it sounds like something server related. Can you see if the edit is at the bottom of index_body.html.
Anggun
Forum Member
Forum Member
Posts: 15
Joined: Wed Jul 23, 2008 9:11 am

Re: Error in index page

Post by Anggun »

LDM wrote:hmm, it sounds like something server related. Can you see if the edit is at the bottom of index_body.html.
You mean this line??

Code: Select all

<br /><!-- IF BIRTHDAYS_AHEAD_LIST -->{L_BIRTHDAYS_AHEAD}: <strong>{BIRTHDAYS_AHEAD_LIST}</strong><!-- ENDIF -->
I didn't delete it if thats what you meant....

Okay, I tried deleting it... and still got the same error...
Disable the upcoming birthday feature in ACP and its back to normal.
User avatar
LDM
Site Admin
Site Admin
Posts: 1786
Joined: Thu May 29, 2008 6:51 pm

Re: Error in index page

Post by LDM »

I still think it could may be server related as haven't seen this issue before. Maybe a bug on that mod that only affects some servers or maybe a language issue?

Here are the edits for the core files so you can have a check over your files.

index.php

Find:

Code: Select all

// Assign index specific vars
Listed before:

Code: Select all

if ($config['load_birthdays'] && $config['allow_birthdays'] && ( $config['allow_birthdays_ahead'] > 0 ) )
{
	if(!function_exists('get_upcbirthdays'))
	{	
		include_once($phpbb_root_path . 'includes/functions_upcbirthdays.' . $phpEx);
	}
	get_upcbirthdays();
}
includes/acp/acp_board.php

Find:

Code: Select all

'allow_birthdays'		=> array('lang' => 'ALLOW_BIRTHDAYS',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
Listed after:

Code: Select all

'allow_birthdays_ahead'	=> array('lang' => 'ALLOW_BIRTHDAYS_AHEAD','validate' => 'int',	'type' => 'text:3:4', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']),
includes/session.php

Find:

Code: Select all

/**
       * Format user date
       */
       function format_date($gmepoch, $format = false, $forcedate = false)
Listed before:

Code: Select all

/**
       * Format user date for the Upcoming Birthday Mod
       */
       function format_dateucb($date, $format = false)
       {

          $lang_dates = $this->lang['datetime'];
          $format = (!$format) ? $this->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']);


          return strtr(@date(str_replace('|', '', $format), $date), $lang_dates);
       }
language/en/common.php

find:

Code: Select all

'BIRTHDAYS'				=> 'Birthdays',
listed after:

Code: Select all

'BIRTHDAYS_AHEAD'		=> 'Users with a birthday within the next %d days',
language/en/acp/board.php

find:

Code: Select all

'ALLOW_BIRTHDAYS_EXPLAIN'	=> 'Allow birthdays to be entered and age being displayed in profiles. Please note the birthday list within the board index is controlled by a separate load setting.',
listed after:

Code: Select all

'ALLOW_BIRTHDAYS_AHEAD'		=> 'Number of Days to display upcoming birthdays',
	'ALLOW_BIRTHDAYS_AHEAD_EXPLAIN'	=> 'Displays the upcoming birthdays on the index page. Entering 0 or negative numbers will disable this feature.',
These edits should be on index_body.html

Code: Select all

<!-- IF S_DISPLAY_BIRTHDAY_LIST and BIRTHDAY_LIST or BIRTHDAYS_AHEAD_LIST -->
and

Code: Select all

{L_NO_BIRTHDAYS}<!-- ENDIF --><br /><!-- IF BIRTHDAYS_AHEAD_LIST -->{L_BIRTHDAYS_AHEAD}: <strong>{BIRTHDAYS_AHEAD_LIST}</strong><!-- ENDIF -->
I would like to help ypu more Anggun but really not sure why you are getting the error. The other option is to locate this upcoming birthday mods thread on phpbb.com and ask the author if they've seen the error before. It may even have been posted in there.
Anggun
Forum Member
Forum Member
Posts: 15
Joined: Wed Jul 23, 2008 9:11 am

Re: Error in index page

Post by Anggun »

LDM wrote:I still think it could may be server related as haven't seen this issue before. Maybe a bug on that mod that only affects some servers or maybe a language issue?

Here are the edits for the core files so you can have a check over your files.
Thank you so much!! I found a discrepancy in the index.php... Don't know how I got that considering the original file I got has the correct line.
User avatar
pawmarks
Forum Member
Forum Member
Posts: 18
Joined: Sat Apr 18, 2009 5:14 am

Re: Error in index page

Post by pawmarks »

I'm getting this same error after the upgrade to 3.0.5 from 3.0.4

perhaps because i'm running modphpbb3?

Fatal error: Call to undefined method user::format_dateucb() in /home/rough/public_html/includes/functions_upcbirthdays.php on line 91

couldn't find the "load settings" anywhere in acp or any other mention of birthday config within admin. (guess it's hiding from me)

tried to do the insert but it fails - duplicate - guess that's already in there.

whole forum is down because of this. any help is appreciated!
User avatar
pawmarks
Forum Member
Forum Member
Posts: 18
Joined: Sat Apr 18, 2009 5:14 am

Re: Error in index page

Post by pawmarks »

Ok, i simply disabled the upcoming birthdays look ahead within board features and WHAM! everything is now working (except, of course the bday thingie - big deal)

guess it's time i RTFM'd a bit! LOL
Post Reply