Seite 1 von 2

[erledigt] Keine Geburtagsvorschau mehr im Portal ...

Verfasst: 26.12.2007 01:05
von derkubi
Hallo

Nach Einbau des Arcade Mods habe ich auf der INDEX-Seite :
Geburtstag(e) in den nächsten 7 Tagen: JohnDoe (47)

Im PORTAL steht :
Keine Geburtstage in den nächsten 7 Tagen.

Setze ich meinen Geburtstag auf heute , steht mein Name im Index und im Portal , aber weiterhin keine Vorschau auf den nächsten Geburtstag im Portal .

Was kann denn da passiert sein . Bin die komplette Install-Anweisung und die entspr. Dateien vom Arcade Mod nochmal durchgegangen . finde keinen Fehler .

Verfasst: 26.12.2007 10:27
von Würzi
Moin,

was passiert denn, wenn du den Geburtstag auf 31.12 setzt?

Da kriegst ihn angezeigt oder? 8)

dann setz ihn mal auf 1.1.

Dann nicht mehr oder? 8)

Hat aber nix mit dem Arcade Mod zu tun. 8)

Ich hoffe ich liege richtig mit meiner Vermutung. :P

Verfasst: 26.12.2007 12:10
von derkubi
NEIN , wir haben einen Geburtstag am 27.12.2007 .

[ externes Bild ]

Links - PORTAL-Seite , Rechts - INDEX-Seite

Verfasst: 26.12.2007 12:37
von Würzi
Hmm.... :-?

Ich würde trotzdem mal folgendes versuchen:

Suche in der index.php den code für den Birthday mod.
Wie der anfängt kann ich grad nicht schauen, da ich .... äh... auf Arbeit bin.

Vermutlich: // birthday unsw.

Nimm diesen Code aus der index.php und ersetze damit mal testhalber den code aus in deiner portal.php

Vorher FTP Backup der Datei logischerweise. :wink:

Ein link zum Forum wäre natürlich auch nett, weil ich man ja nicht weis, was du alles so eingebaut hast. :oops:

Verfasst: 26.12.2007 13:50
von Mahony
Hallo
Suche in der portal.php

Code: Alles auswählen

$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" : "";
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);
}
Ersetze mit folgendem Code

Code: Alles auswählen

$sql = ($board_config['birthday_check_day']) ? "SELECT user_id, username, user_birthday,user_level FROM " . USERS_TABLE. " WHERE user_birthday!=999999 ORDER BY username" :"";
if($result = $db->sql_query($sql)) 
{ 
	if (!empty($result)) 
	{ 
		$time_now = time();
		$this_year = create_date('Y', $time_now, $board_config['board_timezone']);
		$date_today = create_date('Ymd', $time_now, $board_config['board_timezone']);
		$date_forward = create_date('Ymd', $time_now+($board_config['birthday_check_day']*86400), $board_config['board_timezone']);
	      while ($birthdayrow = $db->sql_fetchrow($result))
		{ 
		      $user_birthday2 = $this_year.($user_birthday = realdate("md",$birthdayrow['user_birthday'] )); 
      		if ( $user_birthday2 < $date_today ) $user_birthday2 += 10000;
			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>,'; 
			} else 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>,'; 
		      }
			 
		}
		if ($birthday_today_list) $birthday_today_list[ strlen( $birthday_today_list)-1] = ' ';
		if ($birthday_week_list) $birthday_week_list[ strlen( $birthday_week_list)-1] = ' ';
	} 
	$db->sql_freeresult($result);
}
Das sollte dein Problem beheben.


Grüße: Mahony

Verfasst: 27.12.2007 00:23
von derkubi
SUPERDANK , Problem behoben :grin:

Wo wir gerade dabei sind : Wie gefiel Dir mein Forum ?

Verfasst: 18.01.2008 09:05
von matteskoeln
Hi, danke! Der Code da oben hat mir jetzt auch weitergeholfen. Bei mir kam immer eine Fehlermeldung, sobald ich den birthday-MOD eingeschaltet hatte.
Jetzt stellt sich mir die ganz bldöe Frage: Wie füge ich Geburtstage ein?
Ich nutze den birthday-MOD über das Intro+Portal MOD.

*hmm* tja... das wär's erstmal. Ihr kennt sicher die Lösung. Ich noch nicht. Wäre dankbar über jede Hilfe ;)

EDIT: Ich füge mal noch ein paar Bilder an.
Bild 1: Portal, linke Spalte.
Bild 2: Index, ganz unten - wo ist die Anzeige???
Bild 3: Als Beispiel habe ich meine Profileinstellung genommen: Wo soll ich hier den Geburtstag eintragen???

Also irgendwas stimmt da noch nicht :-?

[ externes Bild ]

(verkleinert)
[ externes Bild ]

[ externes Bild ]

Verfasst: 18.01.2008 10:47
von Mahony
Hallo
Hast du diesen Birthday MOD eingebaut (Version 1.6.3 von
Niels Chr. Denmark and Diablo Gamer)?

Wenn du ein anderes Template benutzt, musst du die Änderungen in den Template-Dateien auch für dieses Template machen.

Also alles was du bei

Code: Alles auswählen

##     templates/subSilver/index_body.tpl
##     templates/subSilver/overall_header.tpl
##      templates/subSilver/profile_add_body.tpl
##      templates/subSilver/profile_view_body.tpl
##	  templates/subSilver/viewtopic_body.tpl
##      templates/subSilver/admin/board_config_body.tpl
##      templates/subSilver/admin/user_edit_body.tpl
ändern musstest, musst du auch für jedes andere Template machen.



Grüße: Mahony

Verfasst: 18.01.2008 10:52
von matteskoeln
Mahony hat geschrieben:Hallo
Hast du diesen Birthday MOD eingebaut (Version 1.6.3 von
Niels Chr. Denmark and Diablo Gamer)?
Ich habe erst das Intro+Portal MOD runtergeladen und installiert.
Das Birthday MOD habe ich nach langer Suche gerade erst gefunden. Hatte immer die Links von der dänischen Homepage. Die gingen aber nicht. Wie gesagt habe ich den phpbbhacks-Link gerade vor fünf Minuten erst gefunden :roll:

Nunja, zum Thema: im Intro+Portal Mod soll der Birthday MOD mit drin sein.
Ich hab mir aber jetzt mal das HowTo vom Birthday Mod angeschaut und da muss man im SQL rumschreiben. Und das ist etwas was ich überhaupt nicht kann.

:cry:
Die Frage wegen den Templates kann ich dir so beantworten: Ich habe nur die Bilder ausgetauscht und die Farben geändert. Also habe ich nur ein Template.

Gruß Mathias

Verfasst: 18.01.2008 11:05
von Mahony
Hallo
Der Birthday MOD muss extra eingebaut werden. Der MOD ist nicht im Intro+Portal MOD enthalten (lediglich die Option den MOD im Intro+Portal MOD anzeigen zu lassen) Du wirst also nicht umhin kommen, den MOD zu installieren.

Die Datenbank-Einträge für den MOD, machst du einfach über phpmyadmin (siehe hierzu KB:122 ).

Also das hier

Code: Alles auswählen

ALTER TABLE phpbb_users ADD user_birthday INT DEFAULT '999999' not null;
ALTER TABLE phpbb_users ADD user_next_birthday_greeting INT DEFAULT '0' not null;
INSERT INTO phpbb_config (config_name, config_value) VALUES ('birthday_required', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('birthday_greeting', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_user_age', '100');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('min_user_age', '5');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('birthday_check_day', '7');
im SQL Fenster von phpmyadmin eingeben und auf O.K. klicken.





Grüße: Mahony