Es geht um den Mod der den Geburtstags Mod (Birthday 1.3.3 neuste Version) im Kalender (Calendar Lite 1.2.2m neuste Version) anzeigen soll.
Das Problem bei dem Mod ist, er wurde nicht für diese aktuellsten Versionen von Calender und Birthday Mod geschrieben und daher funktioniert er auch nicht vollständig.
Das funktioniert: Der Mod zeigt im Kalender die User an die Geburtstag haben

Das funktioniert nicht:
- Das Alter eines Users wird im Kalender nicht angezeigt (was aber eigentlich gehen soll)

- Die Sprungfunktion zu einem x-bliebigen Monat im x-beliebigen Jahr funktioniert, aber es wird nicht verhindert das man zum Beispiel das Jahr 75 oder 200 beispielsweise eingeben kann (das soll eigentlich im Code verhindert werden)

Download der Mods:
- Calendar Lite 1.2.2m (dafür muß man registriert und eingelogt sein)
http://www.snailsource.com/forum/minidl ... file_id=12
- Birthday Mod
http://mods.db9.dk/contrib/birthday.zip
Und so sieht der Birthday in Calender Mod aus der beides miteinander verbinden soll (der ist von http://phpbb2.de/phpBB/viewtopic.php?t=66 ):
Code: Alles auswählen
#############################################################################
## Mod Title: Calendar/Birthday-Hack
## Mod Version: 0.0.1
## Author: Michael "neima" Neumann
## webmaster@team-doof.de
#############################################################################
##
## ATTENTION: you MUST have installed Calendar-mod
## and Birthday-mod
## otherwise it won't make much sense ;)
##
#############################################################################
## Description: This mod will add the users' birthdays to the calendar.
## Also a "quick-jump-to-month"-box is included, this means you can
## choose your year and month and call it in your calendar.
##
## Installation Level: easy
## Installation Time: 5-10 Minutes
## Files To Edit: 2
## calendar.php
## lang_main.php
#############################################################################
-----------------------------------------------------------------------------
#############################################################################
##-----[ OPEN FILE ]
cal_settings.php
#############################################################################
##-----[ FIND ]
?>
##-----[ add BEFORE ]
$showage = 'yes';
#############################################################################
#############################################################################
##-----[ CLOSE AND SAVE FILE ]
cal_settings.php
#############################################################################
##-----[ OPEN FILE ]
calendar.php
#############################################################################
##-----[ FIND ]
$cal_lang_file = "lang_calendar.php";
##-----[ add AFTER ]
// START neima-MOD » added title and checks if $year is valid
$page_title = "Kalender";
if ($year < 1970) { $year = 1970; }
if ($year > 2037) { $year = 2037; }
//END neima-MOD »
#############################################################################
#############################################################################
##-----[ FIND ]
function display()
{
global $PHP_SELF, $phpbb_root_path, $phpEx, $dbhost, $dbuser, $dbpasswd, $dbname, $mysql_tablename, $action,
$id, $day, $month, $year, $time, $userdata, $lang, $config_footer, $footer, $calmod, $caluser,
$endday, $endmonth, $endyear, $usersuggest, $board_config, $bbcode_uid;
$monthname = $lang['months_long'][date('n', mktime(0,0,0,$month,1,$year))-1];
##-----[ REPLACE with ]
function display()
{
// neima-MOD » added $table_prefix to global
global $PHP_SELF, $phpbb_root_path, $phpEx, $dbhost, $dbuser, $dbpasswd, $dbname, $mysql_tablename, $action,
$id, $day, $month, $year, $time, $userdata, $lang, $config_footer, $footer, $calmod, $caluser,
$endday, $endmonth, $endyear, $usersuggest, $board_config, $bbcode_uid, $table_prefix;
$monthname = $lang['months_long'][date('n', mktime(0,0,0,$month,1,$year))-1];
// START neima-MOD » get users having birthday this day
$birthlist = array("id"=>array(),"name"=>array());
$sql = "SELECT user_id, username, user_birthday FROM ".$table_prefix."users";
$result = mysql_query($sql);
while($row = mysql_fetch_array($result)) {
if ($row[2]!=999999) {
$tag = realdate('d', $row[2]);
$monat = realdate('m', $row[2]);
if (($monat == $month) AND ($tag == $day)) {
$birthlist['id'][] = $row[0];
$birthlist['name'][] = $row[1];
}
}
}
$birthsize = sizeof($birthlist['name']);
// END neima-MOD »
#############################################################################
#############################################################################
##-----[ FIND ]
$check = 0;
echo "<table cellpadding=2 cellspacing=0 border=0 width=100%>";
##-----[ add AFTER ]
// START neima-MOD » write down the birthdays for this day
if ($birthsize > 0) {
echo "<tr><td class=row2 colspan=4><span class=genmed><b>" . $lang['Birthday'] . "</b></span></td></tr>\n";
echo "<tr><td class=row1 colspan=4><span class=genmed>Heute ";
if ($birthsize > 1) { echo "haben "; } else { echo "hat "; }
for ($ichzaehl=0; $ichzaehl<$birthsize; $ichzaehl++) {
echo "<a href=\"profile.php?mode=viewprofile&u="; echo $birthlist['id'][$ichzaehl]; echo "\" class=gensmall><b>"; echo $birthlist['name'][$ichzaehl]; echo "</b></a>";
if (($ichzaehl == $birthsize - 2) AND ($birthsize > 1)) { echo " und "; }
if (($ichzaehl < $birthsize - 2) AND ($birthsize > 1)) { echo ", "; }
}
echo " Geburtstag!</span></td></tr>\n";
echo "<tr><td colspan=4 class=row2><hr width=100% size=1></td></tr>\n";
}
// END neima-MOD »
#############################################################################
#############################################################################
##-----[ FIND ]
if($check == 0)
##-----[ REPLACE with ]
if(($check == 0) AND ($birthsize < 1)) // neima-MOD » added $birthsize < 1
#############################################################################
#############################################################################
##-----[ FIND ]
function defaultview()
{
global $PHP_SELF, $phpbb_root_path, $phpEx, $dbhost, $dbuser, $dbpasswd, $dbname, $mysql_tablename, $action, $subjectlen, $cal_dem,
$board_config, $id, $day, $month, $year, $time, $userdata, $lang, $description, $subject, $calmod, $caluser, $daycolor,
$endday, $endmonth, $endyear, $usersuggest;
##-----[ REPLACE with ]
function defaultview()
{
// neima-MOD » added $table_prefix to global
global $PHP_SELF, $phpbb_root_path, $phpEx, $dbhost, $dbuser, $dbpasswd, $dbname, $mysql_tablename, $action, $subjectlen, $cal_dem,
$board_config, $id, $day, $month, $year, $time, $userdata, $lang, $description, $subject, $calmod, $caluser, $daycolor,
$endday, $endmonth, $endyear, $usersuggest, $table_prefix;
#############################################################################
#############################################################################
##-----[ FIND ]
$rowrow = 1;
##-----[ add AFTER ]
// START neima-MOD » get users having birthday this month
$birthlist = array("tag"=>array(),"id"=>array(),"name"=>array());
$sql = "SELECT user_id, username, user_birthday FROM ".$table_prefix."users";
$result = mysql_query($sql);
while($row = mysql_fetch_array($result)) {
if ($row[2]!=999999) {
$tag = realdate('d', $row[2]);
$monat = realdate('m', $row[2]);
if ($monat == $month) {
$birthlist['tag'][] = $tag;
$birthlist['id'][] = $row[0];
$birthlist['name'][] = $row[1];
$birthlist['jahr'][] = realdate('Y', $row[2]);
}
}
}
// END neima-MOD »
#############################################################################
#############################################################################
##-----[ FIND ]
$query2 = mysql_query("SELECT * FROM $mysql_tablename WHERE valid = 'yes' AND eventspan >= \"$year-$month-$thisday 00:00:00\" AND stamp <= \"$year-$month-$thisday 23:59:59\" ORDER BY stamp");
##-----[ add BEFORE ]
// START neima-MOD » write down usernames for this day
for ($ichzaehl=0; $ichzaehl<sizeof($birthlist['name']); $ichzaehl++) {
if ($showage == 'yes') { $age = $year - $birthlist['jahr'][$ichzaehl];
$age = ' ('. $age .')'; }
if ($birthlist['tag'][$ichzaehl] == $thisday) {echo "<a href=\"profile.php?mode=viewprofile&u=". $birthlist['id'][$ichzaehl] ."\" class=gensmall>". $birthlist['name'][$ichzaehl] . $age ."</a><br>"; }
}
// END neima-MOD »
#############################################################################
#############################################################################
##-----[ FIND ]
$query3 = mysql_query("SELECT * FROM $mysql_tablename WHERE valid = 'yes' AND eventspan >= \"$year-$month-$nextday 00:00:00\" AND stamp <= \"$year-$month-$nextday 23:59:59\" ORDER BY stamp");
##-----[ add BEFORE ]
// START neima-MOD » write down usernames for this day
for ($ichzaehl=0; $ichzaehl<sizeof($birthlist['name']); $ichzaehl++) {
if ($showage == 'yes') { $age = $year - $birthlist['jahr'][$ichzaehl];
$age = ' ('. $age .')'; }
if ($birthlist['tag'][$ichzaehl] == $nextday) { echo "<a href=\"profile.php?mode=viewprofile&u=". $birthlist['id'][$ichzaehl] ."\" class=gensmall>". $birthlist['name'][$ichzaehl] . $age ."</a><br>"; }
}
// END neima-MOD »
#############################################################################
#############################################################################
##-----[ FIND ] --- (end of display-function)
echo "</center></table>";
return;
}
##-----[ REPLACE with ]
// START neima-MOD » create a month/year-jumparoundboxthing
echo "<form method=post action=$PHP_SELF>";
echo "<table><tr><td><select name=month class=mainoption>";
for ($zaehl=1;$zaehl<13;$zaehl++) {
echo "<option value=$zaehl";
if ($zaehl == $month) { echo " SELECTED"; }
echo ">";
echo $lang['months_long'][$zaehl-1];
echo "</option>";
}
echo "</select></td><td><input type=text name=year value=\"$year\" size=4></td>";
echo "<td><input type=submit value=\"" . $lang['Cal_goto'] . "\" class=mainoption></td>\n";
echo "</tr></table></form>";
// END neima-MOD »
echo "</center></table>";
return;
}
#############################################################################
#############################################################################
##-----[ CLOSE AND SAVE FILE ]
calendar.php
#############################################################################
##-----[ OPEN FILE ] --- (for every language you have installed)
language/lang_XXX/lang_main.php
#############################################################################
##-----[ FIND ]
?>
##-----[ add BOFORE ] (German version --- English: "Call Month" or whatever you like)
$lang['Cal_goto'] = "Monat aufrufen »";
#############################################################################
#############################################################################
##-----[ CLOSE AND SAVE FILE ]
calendar.php
-----------------------------------------------------------------------------
#############################################################################
##
## That's it... Congrats :)
## I hope it works...
##
#############################################################################
Code: Alles auswählen
###find###
echo "</center></table>";
return;
}
###REPLACE with###
// START neima-MOD » create a month/year-jumparoundboxthing
echo "<form method=post action=$PHP_SELF>";
echo "<table><tr><td><select name=month class=mainoption>";
for ($zaehl=1;$zaehl<13;$zaehl++) {
echo "<option value=$zaehl";
if ($zaehl+1 == $month) { echo " SELECTED"; }
echo ">";
switch ($zaehl) {
case 1 :
$monname = "January";
break;
case 2 :
$monname = "February";
break;
case 3 :
$monname = "March";
break;
case 4 :
$monname = "April";
break;
case 5 :
$monname = "May";
break;
case 6 :
$monname = "June";
break;
case 7 :
$monname = "July";
break;
case 8 :
$monname = "August";
break;
case 9 :
$monname = "September";
break;
case 10 :
$monname = "October";
break;
case 11 :
$monname = "November";
break;
case 12 :
$monname = "December";
break;
}
echo $lang['datetime'][$monname];
echo "</option>";
}
echo "</select></td><td><input type=text name=year value=\"$year\" size=4></td>";
echo "<td><input type=submit value=\"" . $lang['Cal_goto'] . "\" class=mainoption></td>\n";
echo "</tr></table></form>";
echo "</center></table>";
return;
}
// END neima-MOD »
Code: Alles auswählen
global $PHP_SELF, $phpbb_root_path, $phpEx, $dbhost, $dbuser, $dbpasswd, $dbname, $mysql_tablename, $action,
$id, $day, $month, $year, $time, $userdata, $lang, $config_footer, $footer, $calmod, $caluser,
$endday, $endmonth, $endyear, $usersuggest, $board_config, $bbcode_uid, $table_prefix;
Code: Alles auswählen
global $PHP_SELF, $phpbb_root_path, $phpEx, $dbhost, $dbuser, $dbpasswd, $dbname, $mysql_tablename, $action, $subjectlen, $cal_dem,
$board_config, $id, $day, $month, $year, $time, $userdata, $lang, $description, $subject, $calmod, $caluser, $daycolor,
$endday, $endmonth, $endyear, $usersuggest, $table_prefix;
Kann hier jemand helfen und diesen Mod so machen das er das Alter der Leute die Geburtstag haben anzeigt und das vorallem man nur zu bestimmten Jahren springen kann und nicht zum Beispiel zum Jahre 0 *g*
Wer nicht weis was ich mit dem springen meine, ich habe den Mod bei mir installiert unter http://www.debytes-community.de/phpbb2/calendar.php (nicht weiter auf die Farben achten das liegt daran das ich bei mir sämtliche Styles geändert habe) dort kann man unten ein Jahr eingeben, leider jedes x-beliebige, es gibt keine Minimal und Maximal -sperre, obwohl der Code es eigentlich vorsieht. An einer Stelle wird das eingefügt (nur gehts nicht):
Code: Alles auswählen
if ($year < 1970) { $year = 1970; }
if ($year > 2037) { $year = 2037; }