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;">·</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&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]


