Kleines Birthday MOD Problem im Index

Allgemeiner Support zum phpBB 2 Board und phpBB 2 Modifikationen
Forumsregeln
Auch wenn hier der Support für phpBB 2 weiterhin aufrecht erhalten bleibt, weisen wir darauf hin, dass das phpBB 2 nicht mehr offiziell unterstützt und weiterentwickelt wird!
Antworten
schmidtedv
Beiträge: 607
Registriert: So 13.Feb, 2005 10:46
Wohnort: St. Blasien (seit 01.06)
Kontaktdaten:

Kleines Birthday MOD Problem im Index

Beitrag von schmidtedv »

Deine phpBB Version: 2.0.17
Typ Deines phpBB Forums: Standard phpBB (auch Vanilla genannt)
MODs: Ja
Dein Wissensstand: Fortgeschritten
Link zu Deinem Forum: http://support.schmidtedv.de

PHP Version:
MySQL Version:


Was hast Du gemacht, bevor das Problem aufgetreten ist?
...tjo, es nicht bemerkt


Was hast Du bereits versucht um das Problem zu lösen?
....öhm



Fehlerbeschreibung und Nachricht

Hm, ich hab bei mir den Code des Birthday MOD 1.57 inkl. Cache-Erweiterung eingebaut...und wollte das nun, nach vielen anderen Updates noch einmal testen...habe daher meinen Geb. auf HEUTE und den eines anderen Benutzers auf in 3 Tagen gestellt....meiner wurde nach einigem hin- und her....hatte interressanterweise nichts mit dem Cache zu tun...angezeigt, aber der von dem Benutzer nicht (Vorschau steht auf 14 Tage)..muss der Code vom birthday MOD überarbeitet werden?

Code: Alles auswählen

// Birthday Mod, Show users with birthday 
	$cache_data_file = $phpbb_root_path."cache/birthday_". $board_config['board_timezone'] . ".php"; 
	if (@is_file($cache_data_file)  && empty($SID)) 
	{ 
		$valid = (date('YzH',time()) - date('YzH',@filemtime($cache_data_file))<1) ? true : false; 
	} else 
	{ 
		$valid = false; 
	} 
	if ($valid ) 
	{ 
	include ($cache_data_file); 
		$birthday_today_list = stripslashes($birthday_today_list); 
		$birthday_week_list = stripslashes($birthday_week_list); 
	} else 
	{ 
	$sql = ($board_config['birthday_check_day']) ? "SELECT user_id, username, user_birthday,user_level FROM " . USERS_TABLE. " WHERE user_birthday!=999999" . ( ($userdata['user_level']!=ADMIN) ? " " :" AND user_viewbirthday=1 " ) . "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);
		if (empty($SID)) 
		{ 
         // stores the data set in a cache file 
         $data = "<?php\n"; 
         $data .='$birthday_today_list = \'' . addslashes($birthday_today_list) . "';\n"; 
         $data .='$birthday_week_list = \''.addslashes($birthday_week_list) . "';\n?>"; 
         $fp = fopen( $cache_data_file, "w" ); 
         fwrite($fp, $data); 
         fclose($fp); 
      } 
   } 
}
EDIT: AAAARGH, hat sich wohl erledigt, im Profil stand "Zeige Geburtstag immer an" auf NEIN und damit keine anzeige im Index, ich dödel....
Zuletzt geändert von schmidtedv am Do 21.Jul, 2005 13:33, insgesamt 1-mal geändert.
Benutzeravatar
oxpus
Administrator
Beiträge: 28735
Registriert: Mo 27.Jan, 2003 22:13
Wohnort: Bad Wildungen
Kontaktdaten:

Beitrag von oxpus »

Passiert...
Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
schmidtedv
Beiträge: 607
Registriert: So 13.Feb, 2005 10:46
Wohnort: St. Blasien (seit 01.06)
Kontaktdaten:

Beitrag von schmidtedv »

Ja, aber dafür hab' ich mir mal wieder 2 Std. den Kopf zerbrochen, und alles nur, weil ich nicht ganz verstand', warum CBACK da nun n eigenen MOD zu fertiggestellt hatte und vergleichen wollte, grumpf
Rettet den Wald, esst mehr Specht!

Forum [ sofern im Beitrag darauf verwiesen :-) ]
Antworten