[Add-on] myCalendar vs. Birthday Mod

Mod that adds a birthday field to the users profile, theire age are displayed beside the posts, and on there birthday they will have a greeting popup
Forum rules
The content in this forum is dated Dec. 21 2005 and can be used as Archive only. This Forum is LOCKED and READ ONLY !

[Add-on] myCalendar vs. Birthday Mod

Postby smedd on Sat 21. Dec, 2002 09:36

MOD: mycalendar [version: 2.2.7] - see it here
Author: mojavelinux
Homepage:
http://www.mojavelinux.com/forum/viewtopic.php?t=129
older url:http://mojavelinux.com/forum/viewtopic.php?t=11
Description: Enables users to add events to the calendar through a chosen forum.
If you have the birthday mod and you want birthdays on your calender go here http://www.mojavelinux.com/forum/viewtopic.php?t=11&highlight=birthday&start=465posts

Code: Select all
####################################################
## Mod Title: myCalendar vs. Birthday Mod
## Mod Version: 1.0
## 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 Mod v2.2.7 made by mojavelinux < dan@mojavelinux.com > - Dan Allen - http://mojavelinux.com
##               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
##
####################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/
####################################################
## Author Note:
## install.txt made by Kooky
##
## Great thanks to Niels and Mojavelinux for their great work
## and to all members that contribute to this.
##
####################################################
## 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_body.tpl')
);

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

// For the Birthday Mod
unset($birthdays);
$sql = "SELECT user_id, username, user_birthday FROM " . USERS_TABLE. " WHERE user_birthday!=999999";
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']);
   $birthdays[intval($user_birthday[4].$user_birthday[5])][intval($user_birthday[6].$user_birthday[7])][] = (array(
   'user_id' => $birthdayrow['user_id'],'username' => $birthdayrow['username'],
   'birthday_year' => $user_birthday[0].$user_birthday[1].$user_birthday[2].$user_birthday[3]) );
}

#
#------[ FIND ]---------------------------
#
                    // number the event should fall in, for visual block events (interval = 1 day)
                    elseif (!isset($eventStack[$topic_id]) && $topic['cal_interval_units'] == 'DAY' && $topic['cal_interval'] == 1) {
                        $eventStack[$topic_id] = empty($eventStack) ? 0 : sizeof($eventStack);
                    }
                }
            }

#
#------[ AFTER, ADD ]---------------------------
# users name appears (limited for max 18 letters)
#

            // For the Birthday Mod
            if (isset($birthdays[intval($monthView['month'])][intval($day)]))
            foreach ($birthdays[intval($monthView['month'])][intval($day)] as $users)
            {
                $first_date = '<span style="line-height: 16px; font-size: 16px; font-weight: bolder; vertical-align: middle;">&middot;</span> ';
                $topic_text = strlen(($lang['Birthday'] . ': ' . $users['username'])) > 18 ? substr(($lang['Birthday'] . ': ' . $users['username']), 0, 17) . '...' : ($lang['Birthday'] . ': ' . $users['username']);
                $u_user = append_sid('profile.' . $phpEx . '?mode=viewprofile&amp;u='.$users['user_id']);
                $user_age = $monthView['year']-$users['birthday_year'];

                $template->assign_block_vars('date_row.date_cell.switch_date_cells.date_event', array(
                         'U_EVENT' => "$first_date<a href=\"$u_user\" onmouseover=\"domTT_activate(event, 'content', '<b>" . $lang['Birthday'] . ":</b> " . $users['username'] . "</br><b>" . $lang['Age'] . ':</b> ' . $user_age . "', event.pageX, event.pageY);\" onMouseOut=\"destroyTitle();\" class=\"gensmall\">$topic_text</a>") );
            }

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



- If you are using MyCalendar+ and you want birthday with it
Take a look there
-> http://mods.db9.dk/viewtopic.php?p=10938#10938


- if you use Calendar Lite and you want birthday with it
Take a look on phpBB2.de


- if you are using Ptirhiik's Topic Calendar Mod and you want birthday with it
Take a look there
-> http://www.phpbb.com/phpBB/viewtopic.php?t=170574


[Last Edited by kooky]
smedd
Poster
Poster
 
Posts: 7
Joined: Sat 21. Dec, 2002 07:49

Postby Niels on Thu 02. Jan, 2003 18:19

I have change this topic into stiky since some users migth find this info usefull.

how-ever this mod to the mod have proberbly some isues, you should be aware of
1. it will proberly only work on a UNIX/LINUX OS, since windoze can not handle dates before 1980
2. in current version it seams to be hard coded into english language
3. the calcultation of the users age migth have a problem

if this is not a problem for you, then go ahead and install this fine litle mod :D
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby Niels on Mon 17. Feb, 2003 16:00

I have now tested the mycallender mod ver 2.2.6., there is a few typos in the how-to, but execpt from this, is seams to work well.

cal_date should be "datetime", and there was missing a ; in the lang_main.php


I will countinue by test the interaction with the birthday mod, and see how this behaive
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Get

Postby das_elch on Mon 17. Feb, 2003 17:17

Where I can get this MOD ? :lol: Because I want to test it :idea:
das_elch
Poster
Poster
 
Posts: 17
Joined: Mon 10. Feb, 2003 17:33
Location: Lithuania, Shalchininkay

Postby kooky on Tue 18. Feb, 2003 01:12

Niels
i think you should used myCalendar MOD v2.27 instead of 2.26 !!!
kooky
brilliant supporter
 
Posts: 1329
Joined: Tue 31. Dec, 2002 17:52
Location: Au pays des rêves

Postby Niels on Tue 18. Feb, 2003 13:52

could you post a link to 2.2.7., since the above post seams to lead to "lastes version 2.2.6", witch apperently no longer is the latest :?
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby Niels on Tue 18. Feb, 2003 14:05

I found 2.2.7, and I have updated the abouve post, with the new link
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby Niels on Tue 04. Mar, 2003 12:29

I will give it a try to explain how to add the birthday's to the calendar mod.

in file mycalender.php



Code: Select all
[FIND]
$template->set_filenames(array(
    'body' => 'mycalendar_body.tpl')
);

[AFTER ADD]
// For the Birthday Mod
unset($birthdays);
$sql = "SELECT user_id, username, user_birthday FROM " . USERS_TABLE. " WHERE user_birthday!=999999";
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']);
   $birthdays[intval($user_birthday[4].$user_birthday[5])][intval($user_birthday[6].$user_birthday[7])][] = (array(
      'user_id' => $birthdayrow['user_id'],'username' => $birthdayrow['username'],
      'birthday_year' => $user_birthday[0].$user_birthday[1].$user_birthday[2].$user_birthday[3]) );
}

[FIND]
                    // number the event should fall in, for visual block events (interval = 1 day)
                    elseif (!isset($eventStack[$topic_id]) && $topic['cal_interval_units'] == 'DAY' && $topic['cal_interval'] == 1) {
                        $eventStack[$topic_id] = empty($eventStack) ? 0 : sizeof($eventStack);
                    }
                }
            }

[AFTER ADD]
if (isset($birthdays[intval($monthView['month'])][intval($day)]))
foreach ($birthdays[intval($monthView['month'])][intval($day)] as $users)
{
      $first_date = '<span style="line-height: 16px; font-size: 16px; font-weight: bolder; vertical-align: middle;">&middot;</span> ';
      $topic_text = strlen($lang['Birthday']) > 18 ? substr($lang['Birthday'], 0, 17) . '...' : $lang['Birthday'];
   $u_user = append_sid('profile.' . $phpEx . '?mode=viewprofile&amp;u='.$users['user_id']);
   $user_age = $today['year']-$users['birthday_year'];
   $template->assign_block_vars('date_row.date_cell.switch_date_cells.date_event', array(
               'U_EVENT' => "$first_date<a href=\"$u_user\" onMouseOver=\"createTitle(this, '<b>".$lang['Birthday'].": </b> ".$users['username']."</br><b>".$lang['Age'].':</b>'.$user_age."', event.pageX, event.pageY);\" onMouseOut=\"destroyTitle();\" class=\"gensmall\">$topic_text</a>") );
}


I hope I haven't forgot any thing
Last edited by Niels on Tue 04. Mar, 2003 17:59, edited 1 time in total.
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Next

Return to Birthday [2.0.10/EM]

Who is online

Users browsing this forum: No registered users and 1 guest

cron