Seite 1 von 2

Passender Kalender-Mod zu Birthday-Mod 1.5.4em

Verfasst: 30.12.2003 23:56
von Gast
Hallo zusammen,

immer wieder lese ich hier, dass es zu Schwierigkeiten kommt, wenn ein Kalender mit dem Birtday-Mod richtig verknüpft werden soll. In "meinem" Board habe ich den Birthday-Mod in der oben genannten Version installiert. Gerne hätte ich auch einen Kalender installiert, aber nur wenn es zuverlässig funktioniert, dass auch die Geburtstage in diesem angezeigt werden. Kann mir hier jemand diesbzgl. Tipps geben?

Vielen Dank für alles, und schöne Grüße

Sascha

Verfasst: 31.12.2003 08:49
von Markus Wandel
Hallo,

also ich hatte den myCalendar 2.2.7 bei mir am laufen, mit einem kleinen MOD funktionierten da auch die Geburtstage von Birthday MOD.

Ich habe jetzt bei mir den myCalendar+ 0.8 am laufen; ebenfalls über einen zusätzlichen MOD mit dem Birthday MOD verbunden.

Es gehen auch de Calendar Lite und Calendar Pro.

Der Kalender leider nicht mit dem Birthday MOD geht ist der Topic Calendar. Der benutzt ein anderes Datumsformat.

Ob es noch weiterer Kalender gibt, die gehen oder nicht gehen, kann ich nicht sagen.

Verfasst: 31.12.2003 10:39
von oxpus
Topic Kalender würde auch gehen (das Datumsformat ist nicht das entscheidende), ist nur sau schwer umzusetzen. Daher hat noch keiner eine Lösung dafür...

Verfasst: 31.12.2003 12:09
von Gast
Markus Wandel hat geschrieben:Ich habe jetzt bei mir den myCalendar+ 0.8 am laufen; ebenfalls über einen zusätzlichen MOD mit dem Birthday MOD verbunden.
Kann ich mir den mal ansehen?

Hast du auch gleich einen Link zu den notwendigen Mods parat? Nur wenn es keine Umstände macht, sonst such ich mir das schon raus. :)

Vielen Dank und schöne Grüße

Sascha

Verfasst: 31.12.2003 14:00
von Markus Wandel
Also den myCalendar+ 0.8 findest du hier http://mojavelinux.com.

Den Kalender selber kannst du bei http://forum.kuszak.de anschauen

Die entsprechende Anbindung dazu wäre folgende:

Code: Alles auswählen

#################################################### 
## Mod Title: myCalendar+ vs. Birthday Mod 
## Mod Version: 1.0 
## Author: Mike Chidsey < mikechidsey@hotmail.com > 
## Original Author:   Niels Chr. Denmark < ncr@db9.dk > (Niels Chr. Rød) HTTP://mods.db9.dk 
##         & his members contribution 
## 
## Description: This is not exactly a mod, more an extension mod. 
##              With this mod your users Birthday will appears with the calendar as an event 
## 
## Requirements: myCalendar+ 0.8 made by flashdagger http://forum.kuszak.de 
##               Birthday Mod v1.4.x made by Niels Chr. Denmark < ncr@db9.dk > (Niels Chr. Rød) HTTP://mods.db9.dk 
## 
## Installation Level: easy 
## Installation Time: 5 Minutes 
## Files To Edit: 1 
##                mycalendar.php 
## 
## Included Files: N/A 
## 
#################################################### 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
#################################################### 

# 
#------[ OPEN ]--------------------------- 
# 
mycalender.php 

# 
#------[ FIND ]--------------------------- 
# 
$template->set_filenames(array( 
    'body' => 'mycalendar_mod/mycalendar_body.tpl') 
); 

# 
#------[ AFTER, ADD ]--------------------------- 
# 

// For the Birthday Mod 
unset($birthdays); 

// these aren't really dates, so the hard-coded 31 isn't a problem 
$date_start = (strlen($month)==1) ? '0':''. $month.'01'; 
$date_end =  (strlen($month)==1) ? '0':''. $month.'31'; 

// load only the birthdays for this month 
$sql = "SELECT user_id, username, user_birthday FROM " . USERS_TABLE. " WHERE user_birthday!=999999 AND 
   (DATE_FORMAT(addDate('1970-01-01', INTERVAL user_birthday DAY),'%m%d') BETWEEN '$date_start' AND '$date_end') ORDER BY username"; 

if (!$result = $db->sql_query($sql)){ 
   message_die(GENERAL_ERROR, 'Error querying birthdays for mycalendar.'); 
} 
while ($birthdayrow = $db->sql_fetchrow($result)){ 
   $user_birthday = realdate("Ymd",$birthdayrow['user_birthday']); 
   // since we loaded the birthdays for this month, save the b-day in the array indexed by day 
   $birthdays[intval($user_birthday[6].$user_birthday[7])][] = ( 
        array( 
      'user_id' => $birthdayrow['user_id'], 
      'username' => $birthdayrow['username'], 
      'display_date' => realdate($lang['DATE_FORMAT'],$birthdayrow['user_birthday']), 
      'birthday_year' => $user_birthday[0].$user_birthday[1].$user_birthday[2].$user_birthday[3]) 
   ); 
} 


# 
#------[ FIND ]--------------------------- 
# 
            while ( $day == $event['day']){ 
            $act_date = "$year-$month-" . sprintf('%02d', $day); 
            $cal_date_end = date('Y-m-d', $event['cal_date_end']); 
            $cal_date = date('Y-m-d', $event['cal_date']); 

# 
#------[ Before, ADD ]--------------------------- 
# 

         // list birthdays first 
         if (isset($birthdays[$day]))  // see if there is a birthday on this day 
            foreach ($birthdays[$day] as $users){ 
             
               $topic_title = '<b>{TITLE}:</b>&nbsp;{NAME}'; 
               // $link_text is how the birthday will appear on the calendar (notice the link break <BR>) 
               $link_text = str_replace('{TITLE}', $lang['Birthday'], $topic_title); 
               $link_text = str_replace('{NAME}', '<br>'.$users['username'], $link_text); 

               // $title_text is how the title of the popup will appear 
               $title_text = str_replace('{TITLE}', $lang['Birthday'], $topic_title); 
               $title_text = str_replace('{NAME}', $users['username'], $title_text); 
                
               // prepare the popup text, escaping quotes for java**script 
               $u_user = append_sid('profile.' . $phpEx . '?mode=viewprofile&u='.$users['user_id']); 
               // calculate the user's age (as of the calendar year) 
               $user_age = intval($year)-intval($users['birthday_year']); 
               $style  = 'style="height:14px;margin:1px 0px;padding-left:2px;'; 
                
               $caption  = "<div class=\\\"ol_caption\\\">" . $title_text . "</div>"; 
                
               // configure the details section of the popup 
               // line 1:              
               $line1 = "<b>".$lang['Name'].":</b>&nbsp;". $users['username']; 
               // line2: 
               $line2 = "<b>" . $lang['Age'] . ":</b>&nbsp;".$user_age; 
               //line 3: 
               $line3 = "<b>" . $lang['Date'] . ":</b>&nbsp;".$users['display_date']; 
                            
               $tiptext = "<div style=\\\"white-space:nowrap;\\\">{LINE1}<br>{LINE2}<br>{LINE3}</div>"; 
                
               $tiptext = str_replace("{LINE1}", $line1, $tiptext); 
               $tiptext = str_replace("{LINE2}", $line2, $tiptext); 
               $tiptext = str_replace("{LINE3}", $line3, $tiptext); 
                
               $tiptext = str_replace("'", "\\'", $tiptext); 
                
               // we need to generate a unique topic ID for the js array, so user the 
               // userid. To avoid conflicts with Topic IDs, also make it negative 
               $ol_topic_id = -1 * intval($users['user_id']); 
               $js_arraydata .= "\nol_caps[$ol_topic_id] = \"$caption\";\nol_texts[$ol_topic_id] = \"$tiptext\";"; 
                
               $overlib = "onmouseover=\"return overlib(INARRAY, $ol_topic_id, CAPARRAY, $ol_topic_id, CSSCLASS, FGCLASS, 'ol_fg', BGCLASS, 'ol_bg', CAPTIONFONTCLASS, 'ol_caption', TEXTFONTCLASS, 'ol_text', STICKY, AUTOCLOSE, NOCLOSE, HAUTO, VAUTO, DELAY, 400);\" onmouseout=\"return nd();\""; 

               // in order to separate events from birthdays, make the birthdays look different 
               // this will display the birthday in a table with a border and white background 
               $entry = "<div $style ><span class=\"gensmall\"></span><table cellpadding=1 cellspacing=0 style='background-color: white; border: 1px solid black;' width='100%'><tr><td><a href=\"$u_user\" class=\"gensmall\" style=\"$style\" $overlib >$link_text</a></td></tr></table></div>"; 
                
               // to dispay birthdays as events, uncomment the following line: 
               //$entry = "<div $style ><span class=\"gensmall\"></span>&middot;<a href=\"$u_user\" class=\"gensmall\" style=\"$style\" $overlib >". str_replace('<br>', '', $link_text)."</a></div>"; 

                               
               $template->assign_block_vars('date_row.date_cell.switch_date_cells.date_event', array( 
                     'U_EVENT' => $entry)); 
                         
         } 

# 
#------[ SAVE & CLOSE ]--------------------------- 
# EoM

Verfasst: 17.02.2004 16:17
von helluvaguy
Hat jemand eine Ahnung, wie der obige Code zu ändern ist, so dass die Geburtstage nicht mehr als erster Termin an dem jeweiligen Tag angezeigt werden?

Wenn der nämlich in einem Termin liegt, der mehrere Tage dauert, wird die Darstellung des längeren Termins "etwas unübersichtlich", da sie nicht mehr auf einer Zeile liegt.

Verfasst: 14.03.2004 01:13
von TheSteffen
Das würde mich auch interessieren. :grin:

Wenn nämlich ein Termin und ein Geburtstag am gleichen Tag sind, dann verdeckt der Geburtstagseintrag im Kalender den anderen Termin. :cry:

Kann jemand helfen?

Verfasst: 14.03.2004 11:40
von helluvaguy
Ersetze

Code: Alles auswählen

$link_text = str_replace('{NAME}', '<br>'.$users['username'], $link_text); 
mit

Code: Alles auswählen

$link_text = str_replace('{NAME}', $users['username'], $link_text); 
Das sollte das Verdecken der andern Kalendereinträge verhindern (wenn ich mich recht erinnere, habe ich das auch gehabt)

Verfasst: 14.03.2004 11:55
von TheSteffen
Ich danke dir schon einmal. Ist ne schnelle Lösung. Bei langen Benutzernamen wird dann aber trotzdem die zweite Zeile beschrieben :(

Kann man die Termine nicht einfach immer 2 Zeilen nach unten verschieben?
Habe leider keinen Plan was ich dazu wo ändern muß.

Bin für weitere Lösungsvorschläge dankbar. :grin:

Verfasst: 14.03.2004 12:36
von TheSteffen
Habe mir das noch einmal in den zwei Foren angeschaut, die ich habe und betrifft nur einen einzigen Benutzer, wo es so wäre und damit kann ich leben.

Besten Dank also und keine weitere Mühe machen. :)