[外掛] 主題行事曆 1.0.1

MODs Released by Other phpbb Sites
非官方認證通過之 MOD ,或許有安全性之疑慮,所有問題由原發表者回覆!

版主: 版主管理群

主題已鎖定
天霜
竹貓忠實會員
竹貓忠實會員
文章: 882
註冊時間: 2003-04-15 19:40
來自: 星之鄉學園
聯繫:

[外掛] 主題行事曆 1.0.1

文章 天霜 »

代碼: 選擇全部

############################################################## 
## MOD Title:		Topic calendar - Part 1 (common to all setup)
## MOD Author:		Ptirhiik < ptirhiik@clanmckeen.com > (Pierre) http://rpgnet.clanmckeen.com
## MOD Description:
##			This mod adds a calendar to your board, working with natural phpBB auth.
##
## MOD Version:		1.0.1
## 
## Installation Level:	Easy
## Installation Time:	25 Minutes
## Files To Edit:
##			posting.php
##			search.php
##			viewforum.php
##			viewtopic.php
##
##			includes/auth.php
##			includes/constants.php
##			includes/functions.php
##			includes/functions_post.php
##			includes/page_header.php
##			includes/topic_review.php
##
##			templates/subSilver/overall_header.tpl
##			templates/subSilver/posting_body.tpl
##			templates/subSilver/subSilver.cfg
##
## Included Files:
##			calendar.php
##			calendar_scheduler.php
##
##			functions_calendar.php
##			toggle_display.js
##			mod_calendar.php
##
##			lang_extend_topic_calendar.php
##
##			calendar_body.tpl
##			calendar_box.tpl
##			calendar_overview_profil.tpl
##			calendar_overview_topic.tpl
##			calendar_scheduler_body.tpl
##
##				--- graphics ---
##			graph.gif/folder_calendar.gif
##			graph.gif/icon_calendar.gif
##			graph.gif/icon_mini_calendar.gif
##			graph.gif/icon_tiny_profile.gif
##			graph.gif/icon_tiny_topic.gif
##			graph.gif/icon_down_arrow.gif
##			graph.gif/icon_up_arrow.gif
##
##				--- mods settings ---
##			mod-mods_settings/admin_board_extend.php
##			mod-mods_settings/functions_mods_settings.php
##			mod-mods_settings/board_config_extend_body.tpl
##			mod-mods_settings/lang_extend_mods_settings.php
##
##				--- lang settings ---
##			mod-lang_settings/lang_extend_mac.php
##
##				--- topics list ---
##			mod-topics_list/functions_topics_list.php
##			mod-topics_list/topics_list_box.tpl
##
##			mod-topics_list/graph.gif/folder_announce_own.gif
##			mod-topics_list/graph.gif/folder_announce_new_own.gif
##			mod-topics_list/graph.gif/folder_own.gif
##			mod-topics_list/graph.gif/folder_new_own.gif
##			mod-topics_list/graph.gif/folder_hot_own.gif
##			mod-topics_list/graph.gif/folder_new_hot_own.gif
##			mod-topics_list/graph.gif/folder_lock_own.gif
##			mod-topics_list/graph.gif/folder_lock_new_own.gif
##			mod-topics_list/graph.gif/folder_sticky_own.gif
##			mod-topics_list/graph.gif/folder_sticky_new_own.gif
##
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ 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/ 
############################################################## 
## Author Notes: 
##
##	o part 1 is common to all setups
##	o part 2 is required if you haven't Split topic type v 2 or greater installed
##	o part 3 is required if you haven't Categories hierarchy v 2.0.4 or greater
##	o part 4 is required if you have Categories hierarchy v 2.0.4 or greater
##
##	o This mod was originaly based on ModjavLinux's mycalendar 2.2.6, but differs now in so
##	many points that it can't be qualified as an evolution, but rather a brand new way to
##	manage events with a calendar. Anyway, it wouldn't have been fair to not mentioned the
##	old-timer as the grand-father of this one :).
##
##	o The javascript included in calendar_box.tpl comes from Mojavlinux's MyCalendar 2.2.6 
##	( http://www.mojavelinux.com/ )
##
##	o For those using the Profile Control Panel, the calendar will also display the birthday
##	of your users.
##
##	o This mod uses mods settings mod (also included with the pack) to manage configuration values.
##	If you whish to grant your users the ability to customize their setting, install it too :).
##
##	o This mod can be installed using Nutzzy's EasyMOD v 0.0.10a ( http://phpbb.com/phpBB/viewtopic.php?t=125071 ),
##	on a phpBB 2.0.4, 2.0.5 and 2.0.6
## 
############################################################## 
## MOD History:
##
##   2003-11-11 - Version 1.0.1
##	- no changes to the mod, only the installation description has been enhance to ease the
##	installation with Categories hierarchy v 2.0.4 or greater
##
##   2003-10-30 - Version 1.0.0
##      - fix a bug on DST date change in scheduler
##	- fix the -1 issue in preview post
##	- cut off softer the message in the overview event window
##
##   2003-09-14 - Version 1.0.0 beta 1.5
##	- fix empty auths
##	- various little design fixes
##	- add forum selection
##	- add prec/next month
##	- upgrade mod-topics_list version
##
##   2003-09-09 - Version 1.0.0 beta 1.4
##	- split the mod in two part for those having or planing to install the split topic type mod
##	- adapt the mod to post icon mod
##	- fix a collision between send email input field and events on flying windows
##	- remove the jumbox on calendar view
##	- fix overview window width and right position with mozilla
##	- fix an error on days shown moved with events in little month box
##	- add a link to return from schedular to calendar
##
##   2003-09-05 - Version 1.0.0 beta 1.3
##	- fix the birthday issue on some server (DST active issue with mktime())
##	- add default icons (in prevision for posts icon mod)
##
##   2003-08-26 - Version 1.0.0 beta 1.2
##	- enhancement of the scheduler
##      - getting various type events modularization
##
##   2003-08-28 - Version 1.0.0 beta 1.0a
##      - first beta
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
##############################################################

代碼: 選擇全部

############################################################## 
## MOD Title:		Topic calendar - Part 2 (without Split topic type v 2 or greater)
## MOD Author:		Ptirhiik < ptirhiik@clanmckeen.com > (Pierre) http://rpgnet.clanmckeen.com
## MOD Description:
##			This part is required if you have not Split topic v 2 or greater
##
## MOD Version:		1.0.1
## 
## Installation Level:	Easy
## Installation Time:	3 Minutes
## Files To Edit:
##			viewforum.php
## Included Files:(n/a)
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ 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/ 
############################################################## 
## Author Notes: 
##
##	o part 1 is common to all setups
##	o part 2 is required if you haven't Split topic type v 2 or greater installed
##	o part 3 is required if you haven't Categories hierarchy v 2.0.4 or greater
##	o part 4 is required if you have Categories hierarchy v 2.0.4 or greater
## 
############################################################## 
## MOD History:
##
##   2003-11-11 - Version 1.0.1
##	- no changes to the mod, only the installation description has been enhance to ease the
##	installation with Categories hierarchy v 2.0.4 or greater
##
##   2003-10-30 - Version 1.0.0
##      - fix a bug on DST date change in scheduler
##	- fix the -1 issue in preview post
##	- cut off softer the message in the overview event window
##
##   2003-09-14 - Version 1.0.0 beta 1.5
##	- fix empty auths
##	- various little design fixes
##	- add forum selection
##	- add prec/next month
##	- upgrade mod-topics_list version
##
##   2003-09-09 - Version 1.0.0 beta 1.4
##	- split the mod in two part for those having or planing to install the split topic type mod
##	- adapt the mod to post icon mod
##	- fix a collision between send email input field and events on flying windows
##	- remove the jumbox on calendar view
##	- fix overview window width and right position with mozilla
##	- fix an error on days shown moved with events in little month box
##	- add a link to return from schedular to calendar
##
##   2003-09-05 - Version 1.0.0 beta 1.3
##	- fix the birthday issue on some server (DST active issue with mktime())
##	- add default icons (in prevision for posts icon mod)
##
##   2003-08-26 - Version 1.0.0 beta 1.2
##	- enhancement of the scheduler
##      - getting various type events modularization
##
##   2003-08-28 - Version 1.0.0 beta 1.0a
##      - first beta
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
##############################################################

代碼: 選擇全部

############################################################## 
## MOD Title:		Topic calendar - Part 3 (without categories hierarchy v 2.0.4 or greater)
## MOD Author:		Ptirhiik < ptirhiik@clanmckeen.com > (Pierre) http://rpgnet.clanmckeen.com
## MOD Description:
##			This part has to be installed if you haven't Categories hierarchy v 2.0.4 or greater
##
## MOD Version:		1.0.1
## 
## Installation Level:	Easy
## Installation Time:	5 Minutes
## Files To Edit:
##			admin/admin_forumauth.php
##			admin/admin_ug_auth.php
##
## Included Files: (n/a)
##
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ 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/ 
############################################################## 
## Author Notes: 
##
##	o part 1 is common to all setups
##	o part 2 is required if you haven't Split topic type v 2 or greater installed
##	o part 3 is required if you haven't Categories hierarchy v 2.0.4 or greater
##	o part 4 is required if you have Categories hierarchy v 2.0.4 or greater
## 
############################################################## 
## MOD History:
##
##   2003-11-11 - Version 1.0.1
##	- no changes to the mod, only the installation description has been enhance to ease the
##	installation with Categories hierarchy v 2.0.4 or greater
##
##   2003-10-30 - Version 1.0.0
##      - fix a bug on DST date change in scheduler
##	- fix the -1 issue in preview post
##	- cut off softer the message in the overview event window
##
##   2003-09-14 - Version 1.0.0 beta 1.5
##	- fix empty auths
##	- various little design fixes
##	- add forum selection
##	- add prec/next month
##	- upgrade mod-topics_list version
##
##   2003-09-09 - Version 1.0.0 beta 1.4
##	- split the mod in two part for those having or planing to install the split topic type mod
##	- adapt the mod to post icon mod
##	- fix a collision between send email input field and events on flying windows
##	- remove the jumbox on calendar view
##	- fix overview window width and right position with mozilla
##	- fix an error on days shown moved with events in little month box
##	- add a link to return from schedular to calendar
##
##   2003-09-05 - Version 1.0.0 beta 1.3
##	- fix the birthday issue on some server (DST active issue with mktime())
##	- add default icons (in prevision for posts icon mod)
##
##   2003-08-26 - Version 1.0.0 beta 1.2
##	- enhancement of the scheduler
##      - getting various type events modularization
##
##   2003-08-28 - Version 1.0.0 beta 1.0a
##      - first beta
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
##############################################################

代碼: 選擇全部

############################################################## 
## MOD Title:		Topic calendar - Part 4 (with categories hierarchy v 2.0.4 or greater)
## MOD Author:		Ptirhiik < ptirhiik@clanmckeen.com > (Pierre) http://rpgnet.clanmckeen.com
## MOD Description:
##			This part has to be installed if you have Categories hierarchy v 2.0.4 or greater
##
## MOD Version:		1.0.1
## 
## Installation Level:	Easy
## Installation Time:	3 Minutes
## Files To Edit:
##			includes/def_auth.php
##
## Included Files: (n/a)
##
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ 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/ 
############################################################## 
## Author Notes: 
##
##	o part 1 is common to all setups
##	o part 2 is required if you haven't Split topic type v 2 or greater installed
##	o part 3 is required if you haven't Categories hierarchy v 2.0.4 or greater
##	o part 4 is required if you have Categories hierarchy v 2.0.4 or greater
## 
############################################################## 
## MOD History:
##
##   2003-11-11 - Version 1.0.1
##	- no changes to the mod, only the installation description has been enhance to ease the
##	installation with Categories hierarchy v 2.0.4 or greater
##
##   2003-10-30 - Version 1.0.0
##      - fix a bug on DST date change in scheduler
##	- fix the -1 issue in preview post
##	- cut off softer the message in the overview event window
##
##   2003-09-14 - Version 1.0.0 beta 1.5
##	- fix empty auths
##	- various little design fixes
##	- add forum selection
##	- add prec/next month
##	- upgrade mod-topics_list version
##
##   2003-09-09 - Version 1.0.0 beta 1.4
##	- split the mod in two part for those having or planing to install the split topic type mod
##	- adapt the mod to post icon mod
##	- fix a collision between send email input field and events on flying windows
##	- remove the jumbox on calendar view
##	- fix overview window width and right position with mozilla
##	- fix an error on days shown moved with events in little month box
##	- add a link to return from schedular to calendar
##
##   2003-09-05 - Version 1.0.0 beta 1.3
##	- fix the birthday issue on some server (DST active issue with mktime())
##	- add default icons (in prevision for posts icon mod)
##
##   2003-08-26 - Version 1.0.0 beta 1.2
##	- enhancement of the scheduler
##      - getting various type events modularization
##
##   2003-08-28 - Version 1.0.0 beta 1.0a
##      - first beta
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
##############################################################

代碼: 選擇全部

// admin part
if ( $lang_extend_admin )
{
	$lang['Lang_extend_topic_calendar'] = '主題行事曆';
}

$lang['Calendar']				= '行事日曆';
$lang['Calendar_scheduler']		= '清單';
$lang['Calendar_event']			= '重要事項';
$lang['Calendar_from_to']		= '從 %s 到 %s (included)';
$lang['Calendar_time']			= '%s';
$lang['Calendar_duration']		= '期間';

$lang['Calendar_settings']		= '行事曆設定';
$lang['Calendar_week_start']	= '每週的第一天';
$lang['Calendar_header_cells']	= '版面頭條位置顯示(格)數 (0 表示不顯示)';
$lang['Calendar_title_length']	= '版頭行事曆主題字數';
$lang['Calendar_text_length']	= '總覽視窗文字長度';
$lang['Calendar_display_open']	= '版頭顯示行事曆列';
$lang['Calendar_nb_row']		= '版頭每日顯示列數';
$lang['Calendar_birthday']		= '在行事曆上顯示會員生日';
$lang['Calendar_forum']			= '在清單中的主題標題上方顯該討論區名稱';

$lang['Sorry_auth_cal']			= '抱歉,但是只有 %s 可以發表討論區行事曆內的行程。';
$lang['Date_error']				= '日 %d, 月 %d, 年 %d 不是個正確的時間';

$lang['Event_time']				= '行程';
$lang['Minutes']				= '分鐘';
$lang['Today']					= '今日';
$lang['All_events']				= '所有行程';

$lang['Rules_calendar_can']		= '你 <b>可以</b> 在這個版面新增事件';
$lang['Rules_calendar_cannot']	= '你 <b>無法</b> 在這個版面新增事件';
  • 安裝說明:
    MOD-topic_calendar-part1.txt(必裝)
    MOD-topic_calendar-part2.txt(未安裝Split topic type 2.0.1 者必裝)
    MOD-topic_calendar-part3.txt(未安裝categories hierarchy v 2.0.4 者必裝)
    MOD-topic_calendar-part4.txt(已安裝categories hierarchy v 2.0.4 者必裝)
天霜
竹貓忠實會員
竹貓忠實會員
文章: 882
註冊時間: 2003-04-15 19:40
來自: 星之鄉學園
聯繫:

[外掛]Topiccalendar for Birthday

文章 天霜 »

  • 原文章網址:
    http://www.phpbb.com/phpBB/viewtopic.ph ... 580#954580

  • 在 Topic calendar 日曆中顯示會員生日\r
    原文改法只能顯示祝賀詞及會員名稱,我再改良成可以再顯示會員頭像及刪除P.C.P Birthday相關程式碼最後再對提示畫面進行美化


    原始版功能:
    行事日曆顯示當天生日的會員名稱\r
    顯示提示小畫面,內容有會員名稱及祝賀詞

    改良版功能:
    行事日曆顯示當天生日的會員名稱\r
    美化原使版顯示提示小畫面,內容有會員名稱、年齡、祝賀詞、個人頭像
    後台基本組態 +中可設定是否顯示生日會員名稱\r
    移除P.C.P Birthday相關程式碼\r

  • Topic calendar適用版本:(未列出版本表示沒測驗過)
    1.0.1:

  • Niels Birthday適用版本:(未列出版本表示沒測驗過)
    1.5.4:
    1.5.5:
    1.5.6:

    請先安裝完 Topic calendar 和 Niels Birthday 這兩個外掛模組後
    再追加以下修改
#
#-----[ OPEN 打開 ]------------------------------------------------
#

代碼: 選擇全部

includes/functions_calendar.php
#
#-----[ FIND 尋找 ]------------------------------------------------
#

代碼: 選擇全部

//
// birthday (only with PCP)
//
function get_event_PCP_birthday(&$events, &$number, $start_date, $end_date, $limit=false, $start=0, $max_limit=-1)
{
	global $template, $lang, $images, $userdata, $board_config, $db, $phpbb_root_path, $phpEx;
	global $tree;

	// init results
	$number = 0;
	if ($max_limit < 0)
	{
		$max_limit = $board_config['topics_per_page'];
	}

	// add birthday events (only with Profile Control Panel) for logged people eyes
	if ($board_config['calendar_birthday'] && isset($lang['Happy_birthday']) && isset($userdata['user_birthday']) && ($userdata['user_id'] != ANONYMOUS))
	{
		// get start month
		$sql_where = '';
		$work_date = $start_date;
		while ( intval(date('Ym', $work_date)) <= intval(date('Ym', $end_date)) )
		{
			$start_month = date('md', $work_date );
			$end_month = date('m', $work_date) . '99';
			if ( intval(date('Ym', $work_date)) == intval(date('Ym', $end_date)) )
			{
				$end_month = date('md', $end_date);
			}
			$sql_where .= !empty($sql_where) ? ' OR' : '';
			$sql_where .= " ( RIGHT(u.user_birthday, 4) >= $start_month AND RIGHT(u.user_birthday, 4) < $end_month )";

			// go to next month
			$work_year = intval(date('Y', $work_date));
			$work_month = intval(date('m', $work_date));
			$work_month++;
			if ($work_month > 12)
			{
				$work_month = 1;
				$work_year++;
			}
			$work_date = mktime( 0,0,0, $work_month, 01, $work_year );
		}

		// select now profiles
		if (!empty($sql_where))
		{
			$user_id = $userdata['user_id'];
			$sql = "SELECT u.*, 
							(CASE WHEN b.buddy_ignore = 0 THEN 1 ELSE 0 END) as user_friend,
							i.buddy_ignore AS user_ignore,
							b.buddy_visible AS user_visible
						FROM ((" . USERS_TABLE . " AS u 
						LEFT JOIN " . BUDDYS_TABLE . " AS b	ON b.user_id=u.user_id AND b.buddy_id=$user_id)
						LEFT JOIN " . BUDDYS_TABLE . " AS i ON i.user_id=$user_id AND i.buddy_id=u.user_id)
						WHERE u.user_id <> " . ANONYMOUS . " 
							AND u.user_birthday <> 0 
							AND u.user_birthday <> '' 
							AND ( $sql_where )
						ORDER BY username";
			if ( !$result = $db->sql_query($sql) )
			{
				message_die(GENERAL_ERROR, 'Could not read user table to get birthday today info', '', __LINE__, __FILE__, $sql);
			}

			// get the number of occurences
			$number = $db->sql_numrows($result);

			// if limit per page asked, limit the number of results
			if ($limit)
			{
				$sql .= " LIMIT $start, $max_limit";
				if ( !($result = $db->sql_query($sql)) )
				{
					message_die(GENERAL_ERROR, 'Could not obtain topics information', '', __LINE__, __FILE__, $sql);
				}
			}

			// read users
			while ($row = $db->sql_fetchrow($result))
			{
				// user info
				$user_id		= $row['user_id'];
				$username		= $row['username'];
				$user_birthday	= $row['user_birthday'];

				// get user relational status
				$ignore			= $row['user_ignore'];
				$friend			= $row['user_friend'];
				$always_visible = $row['user_visible'];

				// get the status of each info
				$real_display	= ( !$ignore && $userdata['user_allow_real'] && $row['user_allow_real'] && ( ($row['user_viewreal'] == YES) || ( ($row['user_viewreal'] == FRIEND_ONLY) && $friend ) ) );

				// take care of admin status
				if ( is_admin($userdata) || ($user_id == $userdata['user_id']) )
				{
					$real_display = true;
				}

				if ($real_display)
				{
					$txt_class = get_user_level_class($row['user_level'], 'genmed', $row);
					if ($row['user_allow_viewonline'] != YES)
					{
						$username = '<i>' . $username . '</i>';
					}
					$username_link = append_sid($phpbb_root_path . "./profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$user_id");

					$event_month	= intval(substr($user_birthday, 4, 2));
					$event_day		= intval(substr($user_birthday, 6, 2));
					$start_month	= intval(date('m', $start_date));
					$event_year		= intval(date('Y', $start_date));
					if ($event_month < $start_month) $event_year++;
					$event_time = mktime( 0,0,0, $event_month, $event_day, $event_year );

					// build the overview
					$sav_tpl = $template->_tpldata;
					$det_handler = '_overview_profil_' . $user_id;
					$template->set_filenames(array(
						$det_handler => 'calendar_overview_profil.tpl')
					);

					$age = $event_year - intval(substr($user_birthday, 0, 4));
					if ( intval(substr($user_birthday, 4, 4)) > intval(date('md', $event_time)) ) $age--;
					if ($age <= 0) $age = '';

					// avatar
					$avatar_display = ( $userdata['user_viewavatar'] && $row['user_allowavatar'] );
					if ( is_admin($userdata)|| ($view_user_id == $user_id) )
					{
						$avatar_display = true;
					}
					$avatar = '';
					if ( $avatar_display && $row['user_avatar_type'] )
					{
						switch( $row['user_avatar_type'] )
						{
							case USER_AVATAR_UPLOAD:
								$avatar = ( $board_config['allow_avatar_upload'] ) ? '<img src="' . $board_config['avatar_path'] . '/' . $row['user_avatar'] . '" alt="" border="0" />' : '';
								break;
							case USER_AVATAR_REMOTE:
								$avatar = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $row['user_avatar'] . '" alt="" border="0" />' : '';
								break;
							case USER_AVATAR_GALLERY:
								$avatar = ( $board_config['allow_avatar_local'] ) ? '<img src="' . $board_config['avatar_gallery_path'] . '/' . $row['user_avatar'] . '" alt="" border="0" />' : '';
								break;
						}
					}

					$template->assign_vars(array(
						'L_TITLE'		=> $lang['Happy_birthday'],
						'L_USERNAME'	=> $username,
						'TXT_CLASS'		=> $txt_class,
						'L_AGE'			=> $lang['Age'],
						'AVATAR'		=> $avatar,
						'AGE'			=> $age,
						)
					);

					$template->assign_var_from_handle('_calendar_overview', $det_handler);
					$message = $template->_tpldata['.'][0]['_calendar_overview'];
					$template->_tpldata = $sav_tpl;

					// remove 
 remaining from the template
					$message = preg_replace("/[

]{1,2}/", '', $message);

					// store only the new values
					$new_row = array();
					$new_row['event_id']				= POST_USERS_URL . $user_id;

					$new_row['event_author_id']			= $user_id;
					$new_row['event_author']			= $username;
					$new_row['event_time']				= $event_time;

					$new_row['event_last_author_id']	= '';
					$new_row['event_last_author']		= '';
					$new_row['event_last_time']			= '';

					$new_row['event_replies']			= '';
					$new_row['event_views']				= '';
					$new_row['event_type']				= POST_BIRTHDAY;
					$new_row['event_vote']				= '';
					$new_row['event_status']			= '';
					$new_row['event_moved_id']			= '';
					$new_row['event_last_id']			= '';
					$new_row['event_forum_id']			= '';
					$new_row['event_forum_name']		= '';

					$new_row['event_icon']				= '';
					$new_row['event_title']				= $username;
					$new_row['event_short_title']		= $username;
					$new_row['event_message']			= $message;
					$new_row['event_calendar_time']		= $event_time;
					$new_row['event_calendar_duration']	= '';
					$new_row['event_link']				= $username_link;
					$new_row['event_txt_class']			= $txt_class;
					$new_row['event_type_icon']			= '<img src="' . $images['icon_tiny_profile'] . '" border="0" align="absbottom" hspace="2" />';

					$events[] = $new_row;
				}
			}
		}
	}
}
#
#-----[ REPLACE WITH 替換 ]----------------------------------------
#

代碼: 選擇全部

//-- mod : Birthday Mod for Topic Calendar --------------------------------------------------------
//-- REPLACE WITH
/*
//
// birthday (only with PCP)
//
function get_event_PCP_birthday(&$events, &$number, $start_date, $end_date, $limit=false, $start=0, $max_limit=-1)
{
	global $template, $lang, $images, $userdata, $board_config, $db, $phpbb_root_path, $phpEx;
	global $tree;

	// init results
	$number = 0;
	if ($max_limit < 0)
	{
		$max_limit = $board_config['topics_per_page'];
	}

	// add birthday events (only with Profile Control Panel) for logged people eyes
	if ($board_config['calendar_birthday'] && isset($lang['Happy_birthday']) && isset($userdata['user_birthday']) && ($userdata['user_id'] != ANONYMOUS))
	{
		// get start month
		$sql_where = '';
		$work_date = $start_date;
		while ( intval(date('Ym', $work_date)) <= intval(date('Ym', $end_date)) )
		{
			$start_month = date('md', $work_date );
			$end_month = date('m', $work_date) . '99';
			if ( intval(date('Ym', $work_date)) == intval(date('Ym', $end_date)) )
			{
				$end_month = date('md', $end_date);
			}
			$sql_where .= !empty($sql_where) ? ' OR' : '';
			$sql_where .= " ( RIGHT(u.user_birthday, 4) >= $start_month AND RIGHT(u.user_birthday, 4) < $end_month )";

			// go to next month
			$work_year = intval(date('Y', $work_date));
			$work_month = intval(date('m', $work_date));
			$work_month++;
			if ($work_month > 12)
			{
				$work_month = 1;
				$work_year++;
			}
			$work_date = mktime( 0,0,0, $work_month, 01, $work_year );
		}

		// select now profiles
		if (!empty($sql_where))
		{
			$user_id = $userdata['user_id'];
			$sql = "SELECT u.*, 
							(CASE WHEN b.buddy_ignore = 0 THEN 1 ELSE 0 END) as user_friend,
							i.buddy_ignore AS user_ignore,
							b.buddy_visible AS user_visible
						FROM ((" . USERS_TABLE . " AS u 
						LEFT JOIN " . BUDDYS_TABLE . " AS b	ON b.user_id=u.user_id AND b.buddy_id=$user_id)
						LEFT JOIN " . BUDDYS_TABLE . " AS i ON i.user_id=$user_id AND i.buddy_id=u.user_id)
						WHERE u.user_id <> " . ANONYMOUS . " 
							AND u.user_birthday <> 0 
							AND u.user_birthday <> '' 
							AND ( $sql_where )
						ORDER BY username";
			if ( !$result = $db->sql_query($sql) )
			{
				message_die(GENERAL_ERROR, 'Could not read user table to get birthday today info', '', __LINE__, __FILE__, $sql);
			}

			// get the number of occurences
			$number = $db->sql_numrows($result);

			// if limit per page asked, limit the number of results
			if ($limit)
			{
				$sql .= " LIMIT $start, $max_limit";
				if ( !($result = $db->sql_query($sql)) )
				{
					message_die(GENERAL_ERROR, 'Could not obtain topics information', '', __LINE__, __FILE__, $sql);
				}
			}

			// read users
			while ($row = $db->sql_fetchrow($result))
			{
				// user info
				$user_id		= $row['user_id'];
				$username		= $row['username'];
				$user_birthday	= $row['user_birthday'];

				// get user relational status
				$ignore			= $row['user_ignore'];
				$friend			= $row['user_friend'];
				$always_visible = $row['user_visible'];

				// get the status of each info
				$real_display	= ( !$ignore && $userdata['user_allow_real'] && $row['user_allow_real'] && ( ($row['user_viewreal'] == YES) || ( ($row['user_viewreal'] == FRIEND_ONLY) && $friend ) ) );

				// take care of admin status
				if ( is_admin($userdata) || ($user_id == $userdata['user_id']) )
				{
					$real_display = true;
				}

				if ($real_display)
				{
					$txt_class = get_user_level_class($row['user_level'], 'genmed', $row);
					if ($row['user_allow_viewonline'] != YES)
					{
						$username = '<i>' . $username . '</i>';
					}
					$username_link = append_sid($phpbb_root_path . "./profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$user_id");

					$event_month	= intval(substr($user_birthday, 4, 2));
					$event_day		= intval(substr($user_birthday, 6, 2));
					$start_month	= intval(date('m', $start_date));
					$event_year		= intval(date('Y', $start_date));
					if ($event_month < $start_month) $event_year++;
					$event_time = mktime( 0,0,0, $event_month, $event_day, $event_year );

					// build the overview
					$sav_tpl = $template->_tpldata;
					$det_handler = '_overview_profil_' . $user_id;
					$template->set_filenames(array(
						$det_handler => 'calendar_overview_profil.tpl')
					);

					$age = $event_year - intval(substr($user_birthday, 0, 4));
					if ( intval(substr($user_birthday, 4, 4)) > intval(date('md', $event_time)) ) $age--;
					if ($age <= 0) $age = '';

					// avatar
					$avatar_display = ( $userdata['user_viewavatar'] && $row['user_allowavatar'] );
					if ( is_admin($userdata)|| ($view_user_id == $user_id) )
					{
						$avatar_display = true;
					}
					$avatar = '';
					if ( $avatar_display && $row['user_avatar_type'] )
					{
						switch( $row['user_avatar_type'] )
						{
							case USER_AVATAR_UPLOAD:
								$avatar = ( $board_config['allow_avatar_upload'] ) ? '<img src="' . $board_config['avatar_path'] . '/' . $row['user_avatar'] . '" alt="" border="0" />' : '';
								break;
							case USER_AVATAR_REMOTE:
								$avatar = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $row['user_avatar'] . '" alt="" border="0" />' : '';
								break;
							case USER_AVATAR_GALLERY:
								$avatar = ( $board_config['allow_avatar_local'] ) ? '<img src="' . $board_config['avatar_gallery_path'] . '/' . $row['user_avatar'] . '" alt="" border="0" />' : '';
								break;
						}
					}

					$template->assign_vars(array(
						'L_TITLE'		=> $lang['Happy_birthday'],
						'L_USERNAME'	=> $username,
						'TXT_CLASS'		=> $txt_class,
						'L_AGE'			=> $lang['Age'],
						'AVATAR'		=> $avatar,
						'AGE'			=> $age,
						)
					);

					$template->assign_var_from_handle('_calendar_overview', $det_handler);
					$message = $template->_tpldata['.'][0]['_calendar_overview'];
					$template->_tpldata = $sav_tpl;

					// remove 
 remaining from the template
					$message = preg_replace("/[

]{1,2}/", '', $message);

					// store only the new values
					$new_row = array();
					$new_row['event_id']				= POST_USERS_URL . $user_id;

					$new_row['event_author_id']			= $user_id;
					$new_row['event_author']			= $username;
					$new_row['event_time']				= $event_time;

					$new_row['event_last_author_id']	= '';
					$new_row['event_last_author']		= '';
					$new_row['event_last_time']			= '';

					$new_row['event_replies']			= '';
					$new_row['event_views']				= '';
					$new_row['event_type']				= POST_BIRTHDAY;
					$new_row['event_vote']				= '';
					$new_row['event_status']			= '';
					$new_row['event_moved_id']			= '';
					$new_row['event_last_id']			= '';
					$new_row['event_forum_id']			= '';
					$new_row['event_forum_name']		= '';

					$new_row['event_icon']				= '';
					$new_row['event_title']				= $username;
					$new_row['event_short_title']		= $username;
					$new_row['event_message']			= $message;
					$new_row['event_calendar_time']		= $event_time;
					$new_row['event_calendar_duration']	= '';
					$new_row['event_link']				= $username_link;
					$new_row['event_txt_class']			= $txt_class;
					$new_row['event_type_icon']			= '<img src="' . $images['icon_tiny_profile'] . '" border="0" align="absbottom" hspace="2" />';

					$events[] = $new_row;
				}
			}
		}
	}
}
//-- add
*/
function get_birthday(&$events, &$number, $start_date, $end_date, $limit=false, $start=0, $max_limit=-1) 
{ 
	global $template, $lang, $images, $userdata, $board_config, $db, $phpbb_root_path, $phpEx; 
	global $tree;

	// init results
	$number = 0;
	if ($max_limit < 0)
	{
		$max_limit = $board_config['topics_per_page'];
	}

	// add birthday events (only with Profile Control Panel) for logged people eyes
	if ($board_config['calendar_birthday'] && isset($lang['Happy_birthday']) && isset($userdata['user_birthday']) && ($userdata['user_id'] != ANONYMOUS))
	{
		// get start month
		$sql_where = '';
		$work_date = $start_date;
		while ( intval(date('Ym', $work_date)) <= intval(date('Ym', $end_date)) )
		{
			$start_month = date('md', $work_date );
			$end_month = date('m', $work_date) . '99';
			if ( intval(date('Ym', $work_date)) == intval(date('Ym', $end_date)) )
			{
				$end_month = date('md', $end_date);
			}
			$sql_where .= !empty($sql_where) ? ' OR' : '';
			$sql_where .= " ( RIGHT(u.user_birthday, 4) >= $start_month AND RIGHT(u.user_birthday, 4) < $end_month )";

			// go to next month
			$work_year = intval(date('Y', $work_date));
			$work_month = intval(date('m', $work_date));
			$work_month++;
			if ($work_month > 12)
			{
				$work_month = 1;
				$work_year++;
			}
			$work_date = mktime( 0,0,0, $work_month, 01, $work_year );
		}

			$sql = "SELECT u.* 
						FROM " . USERS_TABLE . " AS u 
						WHERE u.user_id <> " . ANONYMOUS . " 
							AND u.user_birthday <> 999999 
						ORDER BY username";
			if ( !$result = $db->sql_query($sql) ) 
			{ 
				message_die(GENERAL_ERROR, 'Could not read user table to get birthday today info', '', __LINE__, __FILE__, $sql); 
			} 

			// get the number of occurences 
			$number = $db->sql_numrows($result); 

			// if limit per page asked, limit the number of results 
			if ($limit)
			{
				$sql .= " LIMIT $start, $max_limit";
				if ( !($result = $db->sql_query($sql)) )
				{
					message_die(GENERAL_ERROR, 'Could not obtain topics information', '', __LINE__, __FILE__, $sql);
				}
			}

		// read users 
		while ($row = $db->sql_fetchrow($result)) 
		{ 
				$user_id      = $row['user_id']; 
				$username      = $row['username']; 
                $user_birthday = realdate($lang['DATE_FORMAT'], $row['user_birthday']); 

				$ignore         = $row['user_ignore']; 
				$friend         = $row['user_friend']; 
				$always_visible = $row['user_visible']; 

				$username_link = append_sid($phpbb_root_path . "./profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$user_id"); 


				$event_day   = realdate('d',$row['user_birthday']); 
				$event_month   = realdate('n',$row['user_birthday']); 
				$event_year2   = realdate('Y',$row['user_birthday']); 
				$start_month   = intval(date('m', $start_date)); 
				$event_year      = intval(date('Y', $start_date)); 
				if ($event_month < $start_month) $event_year++; 
				$event_time = mktime( 0,0,0, $event_month, $event_day, $event_year ); 

      $age = $event_year - $event_year2;
      if ( intval(substr($user_birthday, 4, 4)) > intval(date('md', $event_time)) ) $age--;
      if ($age <= 0) $age = '';

					// build the overview
					$sav_tpl = $template->_tpldata;
					$det_handler = '_overview_profil_' . $user_id;
					$template->set_filenames(array(
						$det_handler => 'calendar_overview_profil.tpl')
					);

					// avatar
					$avatar = '';
					if ( $userdata['user_avatar_type'] && $userdata['user_allowavatar'] )
					{
						switch( $row['user_avatar_type'] )
						{
							case USER_AVATAR_UPLOAD:
								$avatar = ( $board_config['allow_avatar_upload'] ) ? '<img src="' . $board_config['avatar_path'] . '/' . $row['user_avatar'] . '" alt="" border="0" />' : '';
								break;
							case USER_AVATAR_REMOTE:
								$avatar = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $row['user_avatar'] . '" alt="" border="0" />' : '';
								break;
							case USER_AVATAR_GALLERY:
								$avatar = ( $board_config['allow_avatar_local'] ) ? '<img src="' . $board_config['avatar_gallery_path'] . '/' . $row['user_avatar'] . '" alt="" border="0" />' : '';
								break;
						}
					}

					$template->assign_vars(array(
						'L_BIRTHDAY_USERNAME'   => sprintf($lang['birthday'],$username, $age),
						'AVATAR'		=> $avatar,
						'L_TITLE'		=> $lang['Happy_birthday'],
						)
					);

					$template->assign_var_from_handle('_calendar_overview', $det_handler);
					$message = $template->_tpldata['.'][0]['_calendar_overview'];
					$template->_tpldata = $sav_tpl;

					// remove 
 remaining from the template
					$message = preg_replace("/[

]{1,2}/", '', $message);

					// store only the new values
					$new_row = array(); 
					$new_row['event_id']                = POST_USERS_URL . $user_id; 

					$new_row['event_author_id']         = $user_id; 
					$new_row['event_author']            = $username; 
					$new_row['event_time']              = $event_time; 

					$new_row['event_last_author_id']    = ''; 
					$new_row['event_last_author']       = ''; 
					$new_row['event_last_time']         = ''; 

					$new_row['event_replies']           = ''; 
					$new_row['event_views']             = ''; 
					$new_row['event_type']              = POST_BIRTHDAY; 
					$new_row['event_vote']              = ''; 
					$new_row['event_status']            = ''; 
					$new_row['event_moved_id']          = ''; 
					$new_row['event_last_id']           = ''; 
					$new_row['event_forum_id']          = ''; 
					$new_row['event_forum_name']        = ''; 
 
					$new_row['event_icon']              = ''; 
					$new_row['event_title']             = $username; 
					$new_row['event_short_title']       = $username; 
					$new_row['event_message']           = $message; 
					$new_row['event_calendar_time']     = $event_time; 
					$new_row['event_calendar_duration'] = ''; 
					$new_row['event_link']              = $username_link; 
					$new_row['event_txt_class']         = $txt_class; 
					$new_row['event_type_icon']         = '<img src="' . $images['icon_tiny_profile'] . '" border="0" align="absbottom" hspace="2" />'; 
					$events[] = $new_row; 
		}
	}
}
//-- fin mod : Birthday Mod for Topic Calendar ----------------------------------------------------
#
#-----[ FIND 尋找 ]------------------------------------------------
#

代碼: 選擇全部

	get_event_PCP_birthday($events, $number, $start_date, $end_date);
#
#-----[ REPLACE WITH 替換 ]----------------------------------------
#

代碼: 選擇全部

//-- mod : Birthday Mod for Topic Calendar --------------------------------------------------------
//-- REPLACE WITH
/*
	get_event_PCP_birthday($events, $number, $start_date, $end_date);
//-- add
*/
	get_birthday($events, $number, $start_date, $end_date);
//-- fin mod : Birthday Mod for Topic Calendar ----------------------------------------------------
#
#-----[ OPEN 打開 ]------------------------------------------------
#

代碼: 選擇全部

templates/subSilver/calendar_overview_profil.tpl
#
#-----[ FIND 尋找 ]------------------------------------------------
#

代碼: 選擇全部

<table cellspacing="1" cellpadding="5" border="0" width="100%" class="forumline">
<tr>
	<td class="cat" align="center"><span class="cattitle">{L_TITLE}</span></td>
</tr>
<tr>
	<td class="row1" align="center">
		<span class="gen">
			<span class="{TXT_CLASS}"><br />{L_USERNAME}<br /> </span>
		</span>
	</td>
</tr>
<tr>
	<td class="row1">
		<table width="100%" cellspacing="0" cellpadding="10" border="0">
		<tr>
			<td class="row2">{AVATAR}</td>
			<td class="row1" width="100%" align="center"><span class="gen"><b>{L_AGE}:</b> {AGE}</span></td>
		</tr>
		</table>
	</td>
</tr>
</table>
#
#-----[ REPLACE WITH 替換 ]----------------------------------------
#

代碼: 選擇全部

<table cellspacing="1" cellpadding="5" border="0" width="100%" class="forumline">
<tr>
	<td class="cat" align="center"><span class="cattitle">{L_TITLE}</span></td>
</tr>
<tr>
	<td class="row1">
		<table width="100%" cellspacing="0" cellpadding="10" border="0">
		<tr>
			<td class="row1">{AVATAR}</td>
			<td class="row1" width="100%" align="center" nowrap="nowrap" ><span class="gen">{L_BIRTHDAY_USERNAME}</span></td>
		</tr>
		</table>
	</td>
</tr>
</table>
#
#-----[ OPEN 打開 ]------------------------------------------------
#

代碼: 選擇全部

language/lang_chinese_traditional_taiwan/lang_extend_topic_calendar.php
#
#-----[ FIND 尋找 ]------------------------------------------------
#

代碼: 選擇全部

?>
#
#-----[ BEFORE ADD 之前, 加上 ]------------------------------------
#

代碼: 選擇全部

$lang['Happy_birthday']         = '生日快樂!'; 
$lang['birthday']               = '<b>%s</b><br /><br />祝您 <b>%s</b> 歲生日快樂!<br /><br />身體健康,萬事如意!<br /><br />年年有今日,歲歲有今朝!';
#
#-----[ SAVE/CLOSE ALL FILES 儲存/關閉所有檔案 ]-------------------
#
# EoM 外掛修正結束

  • calendar scheduler部份有顯示Birthday部份:
    但目前還找不出相容Birthday的改法
    故先註解掉P.C.P Birthday的部份,不然會出現錯誤
#
#-----[ OPEN 打開 ]------------------------------------------------
#

代碼: 選擇全部

calendar_scheduler.php
#
#-----[ FIND 尋找 ]------------------------------------------------
#

代碼: 選擇全部

get_event_PCP_birthday($events, $number, $month_start, $month_end);
#
#-----[ REPLACE WITH 替換 ]----------------------------------------
#

代碼: 選擇全部

//get_event_PCP_birthday($events, $number, $month_start, $month_end);
#
#-----[ FIND 尋找 ]------------------------------------------------
#

代碼: 選擇全部

// birthday
$birthdays_count = 0;
$remaining = $board_config['topics_per_page'];
get_event_PCP_birthday($events, $birthdays_count, $start_date, $end_date, true, $start, $remaining);
$displayed = count($events)-1;
if ($displayed < 0) $displayed = 0;
#
#-----[ REPLACE WITH 替換 ]----------------------------------------
#

代碼: 選擇全部

/*
// birthday
$birthdays_count = 0;
$remaining = $board_config['topics_per_page'];
get_event_PCP_birthday($events, $birthdays_count, $start_date, $end_date, true, $start, $remaining);
$displayed = count($events)-1;
if ($displayed < 0) $displayed = 0;
*/
#
#-----[ SAVE/CLOSE ALL FILES 儲存/關閉所有檔案 ]-------------------
#
# EoM 外掛修正結束
主題已鎖定

回到「非官方認證外掛」