Nach Update auf 3.0.6: Fatal error: Call to undefined method

Du hast Probleme beim Einbau oder bei der Benutzung eines Mods? In diesem Forum bist du richtig.
Forumsregeln
phpBB 3.0 hat das Ende seiner Lebenszeit überschritten
phpBB 3.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 3.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf die neuste phpBB-Version, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
Antworten
IceD
Mitglied
Beiträge: 265
Registriert: 25.12.2006 19:42
Wohnort: Dresden

Nach Update auf 3.0.6: Fatal error: Call to undefined method

Beitrag von IceD »

Fatal error: Call to undefined method user::format_dateucb() in includes\functions_upcbirthdays.php on line 87

Code: Alles auswählen

                        $birthday_ahead_list .= (($birthday_ahead_list != '') ? ', ' : '') . '<span title="' . $user->format_dateucb(($ucbirthdayrow[$i]['user_birthday_tstamp']), 'D, j. M') . '">' . $user_link . '</span>';
was kann da dazwischen funken? im Gegensatz zu den anderen Updates lief es ansonsten reibunglos, scheinbar jedenfalls.
Benutzeravatar
nickvergessen
Ehrenadmin
Beiträge: 11559
Registriert: 09.10.2006 21:56
Wohnort: Stuttgart, Germany
Kontaktdaten:

Re: Nach Update auf 3.0.6: Fatal error: Call to undefined method

Beitrag von nickvergessen »

Hast du eine MOD eingebaut, die zukünftige Geburtstage anzeigt?
kein Support per PN
IceD
Mitglied
Beiträge: 265
Registriert: 25.12.2006 19:42
Wohnort: Dresden

Re: Nach Update auf 3.0.6: Fatal error: Call to undefined method

Beitrag von IceD »

jup, hab ich. Wobei ich abgesehen von den language Dateien und den nicht problematischen Konflikten, den neuen Code genommen habe.

Edit: habs, man merkt, dass ich mich schon ne Weile damit nicht mehr beschäftigt habe :roll:
Helmut
Mitglied
Beiträge: 2048
Registriert: 27.12.2002 20:35
Wohnort: Augsburg

Re: Nach Update auf 3.0.6: Fatal error: Call to undefined method

Beitrag von Helmut »

Hallo IceD,

also bei mir läuft der Upcoming Birthday list Mod von lefty74 ohne Probleme mit 3.0.6. Die von dir genannte Codezeile sieht bei mir allerdings etwas anders aus. Hier mal die Funktion:

Code: Alles auswählen

function get_upcbirthdays()
{
   global $cache, $config, $db, $user, $auth;
   global $template, $phpbb_root_path, $phpEx;
      
   $birthday_ahead_list = '';
   $sql = 'SELECT user_id, username, user_colour, user_birthday
      FROM ' . USERS_TABLE . "
      WHERE user_birthday NOT LIKE '%- 0-%'
         AND user_birthday NOT LIKE '0-%'
            AND   user_birthday NOT LIKE '0- 0-%'
               AND   user_birthday NOT LIKE ''
                  AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')
                  ORDER BY username';
   //BEGIN for those of you who have the prime birthday mod installed, code provided by primehalo
   $prime_birthdate_installed = function_exists('user_show_congrats');
    if ($prime_birthdate_installed)
    {
        $sql = str_replace('FROM ' . USERS_TABLE, ', user_show_age FROM ' . USERS_TABLE, $sql);
    }   
   //END for those of you who have the prime birthday mod installed, code provided by primehalo
   $result = $db->sql_query($sql);
   //delete the above line and uncomment below line if you want to cache the query for an hour
   //$result = $db->sql_query($sql,3600);

   $now = getdate(time() + $user->timezone + $user->dst - date('Z'));
    $today = (mktime(0, 0, 0, $now['mon'], $now['mday'], $now['year']));
   
   $ucbirthdayrow = array();
   while ($row = $db->sql_fetchrow($result))
   {
       $birthdaycheck = strtotime(gmdate('Y') . '-' . (int) trim(substr($row['user_birthday'],3,-5)) . '-' . (int) trim(substr($row['user_birthday'],0,-8) ));
      $birthdayyear = ( $birthdaycheck < $today ) ? gmdate('Y') + 1 : gmdate('Y');
      $birthdaydate = ($birthdayyear . '-' . (int) trim(substr($row['user_birthday'],3,-5)) . '-' . (int) trim(substr($row['user_birthday'],0,-8) ));
      $ucbirthdayrow[] = array(
                     'username'            =>   $row['username'],
                     'user_birthday_tstamp'    => strtotime($birthdaydate),
                     'user_birthdayyear'    => $birthdayyear,
                     'user_birthday'       =>    $row['user_birthday'],
                     'user_id'            =>   $row['user_id'],
                     'user_show_age'         =>   (isset($row['user_show_age'])) ? $row['user_show_age'] : 0,
                     'user_colour'         =>   $row['user_colour']);
   }
   $db->sql_freeresult($result);
   //sort($ucbirthdayrow);

   for ($i = 0, $end = sizeof($ucbirthdayrow); $i < $end; $i ++)
   {
      if ( $ucbirthdayrow[$i]['user_birthday_tstamp'] >= ($today + 86400) && $ucbirthdayrow[$i]['user_birthday_tstamp'] <= ($today + ((($config['allow_birthdays_ahead'] >365) ? 365 : $config['allow_birthdays_ahead']) * 86400) ) )
      {
         // BEGIN for those of you who have the prime birthday mod installed, code provided by primehalo
         if ($prime_birthdate_installed)
         {
            if (!user_show_congrats($ucbirthdayrow[$i]['user_show_age']))
            {
               continue;
            }
            $ucbirthdayrow[$i]['user_birthday_tstamp'] = (user_show_age($ucbirthdayrow[$i]['user_show_age'])) ? $ucbirthdayrow[$i]['user_birthday_tstamp'] : '';
         }   
         // END for those of you who have the prime birthday mod installed, code provided by primehalo
         
         // Thanks to nickvergessen for the code suggestion
         $user_link = get_username_string('full', $ucbirthdayrow[$i]['user_id'], $ucbirthdayrow[$i]['username'], $ucbirthdayrow[$i]['user_colour']);

         //lets add to the birthday_ahead list.
         $birthday_ahead_list .= (($birthday_ahead_list != '') ? ', ' : '') . '<span title="' . $user->format_dateucb(($ucbirthdayrow[$i]['user_birthday_tstamp']), 'D, j. M h') . '">' . $user_link . '</span>';
         if ( $age = (int) substr($ucbirthdayrow[$i]['user_birthday'], -4) )
         {
            $birthday_ahead_list .= ' (' . ($ucbirthdayrow[$i]['user_birthdayyear'] - $age) . ')';
         }
      }
   }
   
   // Assign index specific vars
   $template->assign_vars(array(
      'BIRTHDAYS_AHEAD_LIST'   => $birthday_ahead_list,
      'L_BIRTHDAYS_AHEAD'   => sprintf($user->lang['BIRTHDAYS_AHEAD'], ($config['allow_birthdays_ahead'] >365) ? 365 : $config['allow_birthdays_ahead']),
      ));
} 
 
Schaue mal, ob es bei dir in der sessions.php nicht durch das Update an Problemen mit der Codeänderung vom Mod gegeben hat.

Gruß Helmut
Ich bin nicht ganz dicht.... na und.
Antworten

Zurück zu „[3.0.x] Mod Support“