|
From: <dac...@us...> - 2007-09-08 22:26:21
|
Revision: 57
http://thevr.svn.sourceforge.net/thevr/?rev=57&view=rev
Author: dachebodt
Date: 2007-09-08 15:26:25 -0700 (Sat, 08 Sep 2007)
Log Message:
-----------
Added Calendar and Event mods
- fixed some bugs in bloks and content mods
Modified Paths:
--------------
mods/cms/trunk/modules/blocks/functions_blocks.php
mods/cms/trunk/modules/content/cms_content.php
mods/cms/trunk/modules/content/language/en/content.php
mods/cms/trunk/modules/forums/cms_search.php
Added Paths:
-----------
mods/cms/trunk/modules/calendar/
mods/cms/trunk/modules/calendar/blocks/
mods/cms/trunk/modules/calendar/blocks/cms_calendar.php
mods/cms/trunk/modules/calendar/functions_calendar.php
mods/cms/trunk/modules/calendar/language/
mods/cms/trunk/modules/calendar/language/en/
mods/cms/trunk/modules/calendar/language/en/calendar.php
mods/cms/trunk/modules/calendar/language/en/common.php
mods/cms/trunk/modules/calendar/template/
mods/cms/trunk/modules/calendar/template/calendar_day.html
mods/cms/trunk/modules/calendar/template/calendar_footer.html
mods/cms/trunk/modules/calendar/template/calendar_header.html
mods/cms/trunk/modules/calendar/template/calendar_mini.html
mods/cms/trunk/modules/calendar/template/calendar_month.html
mods/cms/trunk/modules/calendar/template/calendar_week.html
mods/cms/trunk/modules/calendar/template/calendar_year.html
mods/cms/trunk/modules/events/
mods/cms/trunk/modules/events/acp_events.php
mods/cms/trunk/modules/events/blocks/
mods/cms/trunk/modules/events/cms_events.php
mods/cms/trunk/modules/events/constants.php
mods/cms/trunk/modules/events/functions_events.php
mods/cms/trunk/modules/events/info/
mods/cms/trunk/modules/events/info/acp_events.php
mods/cms/trunk/modules/events/info/cms_events.php
mods/cms/trunk/modules/events/info/events_info.php
mods/cms/trunk/modules/events/info/gcp_events.php
mods/cms/trunk/modules/events/info/grp_events.php
mods/cms/trunk/modules/events/info/mcp_events.php
mods/cms/trunk/modules/events/info/ucp_events.php
mods/cms/trunk/modules/events/language/
mods/cms/trunk/modules/events/language/en/
mods/cms/trunk/modules/events/language/en/common.php
mods/cms/trunk/modules/events/language/en/events.php
mods/cms/trunk/modules/events/language/en/permissions_comments.php
mods/cms/trunk/modules/events/template/
mods/cms/trunk/modules/events/template/acp_events.html
mods/cms/trunk/modules/events/template/events_list.html
mods/cms/trunk/modules/events/template/events_map.html
Modified: mods/cms/trunk/modules/blocks/functions_blocks.php
===================================================================
--- mods/cms/trunk/modules/blocks/functions_blocks.php 2007-09-05 05:46:11 UTC (rev 56)
+++ mods/cms/trunk/modules/blocks/functions_blocks.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -10,12 +10,10 @@
include($phpbb_root_path . "modules/blocks/constants.$phpEx");
- $front = request_var('front', '');
-
$user->add_mod_lang(array('blocks' => 'common'));
- $url_chunks = explode("&", $_SERVER['QUERY_STRING']);
- $is_front = (sizeof($url_chunks) <= 1 || $front) ? true : false;
+ $url_chunks = explode("&", $user->page['page']);
+ $is_front = (sizeof($url_chunks) <= 1) ? true : false;
// Get cached blocks
if (($this->block_cache = $cache->get('_block_' . $module_name)) === false)
Added: mods/cms/trunk/modules/calendar/blocks/cms_calendar.php
===================================================================
--- mods/cms/trunk/modules/calendar/blocks/cms_calendar.php (rev 0)
+++ mods/cms/trunk/modules/calendar/blocks/cms_calendar.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,29 @@
+<?php
+/**
+*
+* @package blocks
+* @version $Id: cms_calendar.php,v 1.38 2006/11/24 14:58:07 acydburn Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+function calendar_block($data)
+{
+ global $config, $template, $phpbb_root_path, $phpEx, $user;
+
+ include_once($phpbb_root_path . "modules/calendar/functions_calendar.$phpEx");
+
+ $block['TITLE'] = 'Calendar';
+ $block['CONTENT'] = build_calendar('', 'mini');
+
+ return $block;
+}
+
+function calendar_block_config()
+{
+ $block_config = array();
+
+ return $block_config;
+}
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/calendar/functions_calendar.php
===================================================================
--- mods/cms/trunk/modules/calendar/functions_calendar.php (rev 0)
+++ mods/cms/trunk/modules/calendar/functions_calendar.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,336 @@
+<?php
+
+// Based on an article by Jason Gilmore found here http://www.zend.com/zend/trick/tricks-Oct-2002.php
+
+function build_calendar($u_action, $display = 'month', $data = array(), $month = false, $day = false, $year = false, $tpl_recur = false, $calendar = false)
+{
+ global $phpbb_root_path, $phpEx, $user, $config;
+
+ $user->add_mod_lang(array('calendar' => 'calendar'));
+
+ if(empty($calendar))
+ {
+ $calendar = new template();
+ $tpl_path = $phpbb_root_path . "modules/calendar/template/";
+ $calendar->set_custom_template($tpl_path, 'calendar');
+ }
+
+ if($display == 'month' && $year && !$month)
+ {
+ $display = 'year';
+ }
+ elseif($display == 'day' && $year && $month && !$day)
+ {
+ $display = 'month';
+ }
+
+ // set defaults
+ $dst = $config['board_dst'] * 3600;
+ $timezone = (($user->data['user_id'] != ANONYMOUS) ? strval(doubleval($user->data['user_timezone'])) : strval(doubleval($config['board_timezone']))) * 3600;
+
+ list($curr_day, $curr_month, $curr_year) = explode(' ', gmdate('j n Y', time() + $timezone + $dst));
+
+ $year = ($year) ? $year : $curr_year;
+ $month = ($month) ? $month : $curr_month;
+ $day = ($day) ? $day : $curr_day;
+
+ $today = "$curr_year-$curr_month-$curr_day";
+
+ $lang_dates = $user->lang['datetime'];
+
+ switch($display)
+ {
+ case 'day':
+
+ $d = "$year-$month-$day";
+ $data = calendar_prepare_data($data, 'time');
+
+ for($i = 5; $i < 30; $i++)
+ {
+ $unix_time = mktime($i, 0, 0, $month, $day, $year);
+ $calendar->assign_block_vars('cal_day', array(
+ 'TIME' => date('h:i a', $unix_time), //$user->format_date($unix_time, 'h:i a'),
+ ));
+
+ $t = date('G', $unix_time);
+ if(isset($data["$d/$t"]))
+ {
+ $tdata = $data["$d/$t"];
+ foreach($tdata as $j => $row)
+ {
+ $calendar->assign_block_vars('cal_day.events', array(
+ 'TITLE' => $row['title'],
+ 'U_LINK' => $row['url'],
+ ));
+ }
+ }
+ }
+
+ $unix_time = mktime(0, 0, 0, $month, $day, $year);
+ $next_day = date("Y-n-j", strtotime("+1 day", $unix_time));
+ $prev_day = date("Y-n-j", strtotime("-1 day", $unix_time));
+
+ $calendar->assign_vars(array(
+ 'DAY' => strtr(@gmdate(str_replace('|', '', 'l F d, Y'), $unix_time), $lang_dates),
+ 'U_NEXT_DAY' => $u_action . '&display=day&date=' . $next_day,
+ 'U_PREV_DAY' => $u_action . '&display=day&date=' . $prev_day,
+ ));
+
+ if("$curr_year-$curr_month" == "$year-$month")
+ {
+ if($curr_day == $day || $curr_day == ($day - 1))
+ {
+ $calendar->assign_vars(array('L_PREV_DAY' => $user->lang['datetime']['YESTERDAY']));
+ }
+
+ if($curr_day == $day || $curr_day == ($day + 1))
+ {
+ $calendar->assign_vars(array('L_NEXT_DAY' => $user->lang['datetime']['TOMORROW']));
+ }
+ }
+
+ break;
+
+ case 'week':
+
+ $week_num = date('W', mktime(0, 0, 0, $month, $day, $year));
+ $unix_start = strtotime("+ $week_num weeks -1 day", mktime(0, 0, 0, 1, 1, $year));
+ $data = calendar_prepare_data($data, 'date');
+
+ for($i = 0; $i < 7; $i++)
+ {
+ $unix_time = strtotime("+$i day", $unix_start);
+ $tdate = date('Y-n-j', $unix_time);
+
+ $calendar->assign_block_vars('week_days', array(
+ 'DAY' => strtr(@gmdate(str_replace('|', '', 'M d'), $unix_time), $lang_dates),
+ 'L_DAY' => strtr(@gmdate(str_replace('|', '', 'l'), $unix_time), $lang_dates),
+ 'U_DAY' => $u_action . '&display=day&date=' . $tdate,
+ ));
+
+ $calendar->assign_block_vars('cal_week', array());
+
+ if(isset($data[$tdate]))
+ {
+ $edata = $data[$tdate];
+ foreach($edata as $j => $row)
+ {
+ $calendar->assign_block_vars('cal_week.events', array(
+ 'TITLE' => $row['title'],
+ 'U_LINK' => $row['url'],
+ ));
+ }
+ }
+ }
+
+ $to_year = date('Y', $unix_time);
+ $format = ($year != $to_year) ? 'M d, Y' : 'M d';
+
+ $from_day = strtr(@gmdate(str_replace('|', '', $format), $unix_start), $lang_dates);
+ $to_day = strtr(@gmdate(str_replace('|', '', 'M d, Y'), $unix_time), $lang_dates);
+
+ $next_week = date("Y-n-j", strtotime("+1 day", $unix_time));
+ $last_week = date("Y-n-j", strtotime("-7 days", $unix_start));
+
+ $calendar->assign_vars(array(
+ 'WEEK_DAYS' => sprintf($user->lang['WEEK_OF'], $from_day, $to_day),
+ 'U_NEXT_WEEK' => $u_action . '&display=week&date=' . $next_week,
+ 'U_PREV_WEEK' => $u_action . '&display=week&date=' . $last_week,
+ ));
+
+ break;
+
+ case 'mini':
+ case 'month':
+
+ // What is the first day of the month in question?
+ $unix_start = mktime(0, 0, 0, $month, 1, $year);
+
+ // How many days does this month contain?
+ $numberDays = date('t', $unix_start);
+
+ // Retrieve some information about the first day of the month in question.
+ $date_components = getdate($unix_start);
+
+ // What is the index value (0-6) of the first day of the month in question.
+ $day_of_week = $date_components['wday'];
+
+ $start_day = $day_of_week;
+
+ $u_month = "$year-$month";
+ $next_month = date("Y-n", strtotime("+1 month", $unix_start));
+ $last_month = date("Y-n", strtotime("-1 month", $unix_start));
+ $next_year = date("Y-n", strtotime("+1 year", $unix_start));
+ $last_year = date("Y-n", strtotime("-1 year", $unix_start));
+
+ $tpl_ary = array(
+ 'MONTH' => strtr(@gmdate(str_replace('|', '', 'F Y'), $unix_start), $lang_dates),
+ 'S_DAY_OF_WEEK' => $start_day,
+ 'S_REMAINING_DAYS' => ($day_of_week != 7) ? (7 - $day_of_week) : '',
+
+ 'U_MONTH' => $u_action . '&display=month&date=' . $u_month,
+ 'U_NEXT_MONTH' => $u_action . '&display=month&date=' . $next_month,
+ 'U_LAST_MONTH' => $u_action . '&display=month&date=' . $last_month,
+ 'U_NEXT_YEAR' => $u_action . '&display=month&date=' . $next_year,
+ 'U_LAST_YEAR' => $u_action . '&display=month&date=' . $last_year,
+ );
+
+ if($tpl_recur)
+ {
+ $calendar->assign_block_vars($tpl_recur, $tpl_ary);
+ $handle = $tpl_recur . '.cal_' . $display;
+ }
+ else
+ {
+ $calendar->assign_vars($tpl_ary);
+ $handle = 'cal_' . $display;
+ }
+
+ $current_day = 1;
+ $data = calendar_prepare_data($data, 'date');
+
+ while ($current_day <= $numberDays)
+ {
+ // Seventh column (Saturday) reached. Start a new row.
+ $break = '';
+ if ($day_of_week == 7)
+ {
+ $day_of_week = 0;
+ $break = 1;
+ }
+
+ $tdate = "$year-$month-$current_day";
+ $calendar->assign_block_vars($handle, array(
+ 'S_BREAK' => $break,
+ 'S_TODAY' => ($tdate == $today) ? true : false,
+ 'CURR_DAY' => $current_day,
+ 'U_LINK' => (isset($data[$tdate])) ? (($tpl_recur || $display == 'month') ? $u_action . '&display=day' : $u_action) . '&date=' . $tdate : '',
+ ));
+
+ if($display == 'month' && isset($data[$tdate]))
+ {
+ $mdata = $data[$tdate];
+ foreach($mdata as $j => $row)
+ {
+ $calendar->assign_block_vars($handle . '.events', array(
+ 'TITLE' => $row['title'],
+ 'U_LINK' => $row['url'],
+ ));
+ }
+ }
+
+ $current_day++;
+ $day_of_week++;
+ }
+
+ if($tpl_recur)
+ {
+ return;
+ }
+ else
+ {
+ $days_ary = array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');
+ foreach($days_ary as $i => $day)
+ {
+ $tpl_ary['L_' . strtoupper($day)] = $user->lang['datetime'][$day];
+ }
+ $calendar->assign_vars($tpl_ary);
+ }
+
+ break;
+
+ case 'year':
+
+ for($i = 1; $i < 13; $i++)
+ {
+ build_calendar($u_action, 'mini', $data, $i, false, $year, 'cal_year', &$calendar);
+ }
+
+ $calendar->assign_vars(array(
+ 'YEAR' => $year,
+ 'U_NEXT_YEAR' => $u_action . '&display=year&date=' . ($year + 1),
+ 'U_LAST_YEAR' => $u_action . '&display=year&date=' . ($year - 1),
+ ));
+
+ break;
+ }
+
+ $display_options = array('day', 'week', 'month', 'year');
+
+ foreach($display_options as $i => $option)
+ {
+ $calendar->assign_block_vars('cal_menu', array(
+ 'S_ACTIVE' => ($option == $display) ? true : false,
+ 'OPTION' => $user->lang[strtoupper($option)],
+ 'U_OPTION' => $u_action . '&display=' . $option,
+ ));
+ }
+
+ $calendar->set_filenames(array(
+ 'calendar' => "calendar_$display.html")
+ );
+
+ return $calendar->assign_display('calendar');
+}
+
+function calendar_prepare_data($data, $format)
+{
+ global $user;
+
+ $return = array();
+ if($format == 'date')
+ {
+ foreach($data as $timestamp => $row)
+ {
+ $date = $user->format_date($timestamp, 'Y-n-j');
+ $return[$date][] = $row;
+ }
+ }
+ else
+ {
+ foreach($data as $timestamp => $row)
+ {
+ $time = $user->format_date($timestamp, 'Y-n-j/G');
+ $return[$time][] = $row;
+ }
+ }
+
+ return $return;
+}
+
+function calendar_get_datetime_limits($display, $year, $month, $day)
+{
+ global $user, $config;
+
+ $dst = $config['board_dst'] * 3600;
+ $timezone = (($user->data['user_id'] != ANONYMOUS) ? strval(doubleval($user->data['user_timezone'])) : strval(doubleval($config['board_timezone']))) * 3600;
+
+ switch($display)
+ {
+ case 'day':
+ $start = mktime(0, 0, 0, $month, $day, $year) + $timezone + $dst;
+ $stop = $start + (60 * 60 * 24); //mktime(23, 59, 59, $month, $day, $year) + $timezone + $dst;
+ break;
+ case 'week':
+ $week_num = date('W', mktime(0, 0, 0, $month, $day, $year));
+ $start = strtotime("+ $week_num weeks -1 day", mktime(0, 0, 0, 1, 1, $year)) + $timezone + $dst;
+ $stop = $start + (60 * 60 * 24 * 7);
+ break;
+ case 'year':
+ $start = mktime(0, 0, 0, 1, 1, $year) + $timezone + $dst;
+ $stop = mktime(23, 59, 59, 12, 31, $year) + $timezone + $dst;
+ break;
+ default:
+ $start = mktime(0, 0, 0, $month, 1, $year) + $timezone + $dst;
+ $num_days = date('t', $start);
+ $stop = mktime(23, 59, 59, $month, $num_days, $year) + $timezone + $dst;
+ break;
+ }
+
+ $data['start'] = $start;
+ $data['stop'] = $stop;
+
+ return $data;
+}
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/calendar/language/en/calendar.php
===================================================================
--- mods/cms/trunk/modules/calendar/language/en/calendar.php (rev 0)
+++ mods/cms/trunk/modules/calendar/language/en/calendar.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,57 @@
+<?php
+/**
+*
+* calendar [English]
+*
+* @package language
+* @version $Id: calendar.php,v x.xxx yyyy/mm/dd hh:mm:ss Username Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* DO NOT CHANGE
+*/
+if (empty($lang) || !is_array($lang))
+{
+ $lang = array();
+}
+
+// DEVELOPERS PLEASE NOTE
+//
+// Placeholders can now contain order information, e.g. instead of
+// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
+// translators to re-order the output of data while ensuring it remains correct
+//
+// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
+// equally where a string contains only two placeholders which are used to wrap text
+// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
+
+$lang = array_merge($lang, array(
+ 'MINI_SUNDAY' => 'S',
+ 'MINI_MONDAY' => 'M',
+ 'MINI_TUESDAY' => 'T',
+ 'MINI_WEDNESDAY' => 'W',
+ 'MINI_THURSDAY' => 'T',
+ 'MINI_FRIDAY' => 'F',
+ 'MINI_SATURDAY' => 'S',
+
+ 'WEEK' => 'Week',
+ 'MONTH' => 'Month',
+
+ 'NEXT_WEEK' => 'Next Week',
+ 'PREV_WEEK' => 'Last Week',
+ 'WEEK_OF' => 'Week of %1$s - %2$s',
+
+ 'NEXT_MONTH' => 'Next Month',
+ 'NEXT_YEAR' => 'Next Year',
+ 'LAST_MONTH' => 'Last Month',
+ 'LAST_YEAR' => 'Last Year',
+
+ 'NEXT_DAY' => 'Next Day',
+ 'PREV_DAY' => 'Previous Day',
+
+));
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/calendar/language/en/common.php
===================================================================
--- mods/cms/trunk/modules/calendar/language/en/common.php (rev 0)
+++ mods/cms/trunk/modules/calendar/language/en/common.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,36 @@
+<?php
+/**
+*
+* blocks [English]
+*
+* @package language
+* @version $Id: style_generator.php,v x.xxx yyyy/mm/dd hh:mm:ss Username Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* DO NOT CHANGE
+*/
+if (empty($lang) || !is_array($lang))
+{
+ $lang = array();
+}
+
+// DEVELOPERS PLEASE NOTE
+//
+// Placeholders can now contain order information, e.g. instead of
+// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
+// translators to re-order the output of data while ensuring it remains correct
+//
+// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
+// equally where a string contains only two placeholders which are used to wrap text
+// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
+
+$lang = array_merge($lang, array(
+ 'CALENDAR' => 'Calendar',
+
+));
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/calendar/template/calendar_day.html
===================================================================
--- mods/cms/trunk/modules/calendar/template/calendar_day.html (rev 0)
+++ mods/cms/trunk/modules/calendar/template/calendar_day.html 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,28 @@
+<!-- INCLUDE calendar_header.html -->
+
+<table class="calendar" width="100%" border="0" cellspacing="1">
+ <tr>
+ <td colspan="2" height="35">
+ <div class="left-box"><span><a href="{U_PREV_DAY}">{L_PREV_DAY}</a></span></div>
+ <div class="right-box"><span><a href="{U_NEXT_DAY}">{L_NEXT_DAY}</a></span></div>
+ <div style="text-align:center"><strong>{DAY}</strong></div>
+ </td>
+ </tr>
+
+ <!-- BEGIN cal_day -->
+ <tr>
+ <td width="90" height="25"><b>{cal_day.TIME}</b></td>
+ <td class="bg2" width="90%">
+ <!-- BEGIN events -->
+ <a href="{cal_day.events.U_LINK}">{cal_day.events.TITLE}</a>
+ <!-- END events -->
+ <td>
+ </tr>
+ <tr>
+ <td height="25"> </td>
+ <td class="bg2"><td>
+ </tr>
+ <!-- END cal_day -->
+</table>
+
+<!-- INCLUDE calendar_footer.html -->
Added: mods/cms/trunk/modules/calendar/template/calendar_footer.html
===================================================================
--- mods/cms/trunk/modules/calendar/template/calendar_footer.html (rev 0)
+++ mods/cms/trunk/modules/calendar/template/calendar_footer.html 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,2 @@
+ <span class="corners-bottom"><span></span></span></div>
+</div>
\ No newline at end of file
Added: mods/cms/trunk/modules/calendar/template/calendar_header.html
===================================================================
--- mods/cms/trunk/modules/calendar/template/calendar_header.html (rev 0)
+++ mods/cms/trunk/modules/calendar/template/calendar_header.html 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,10 @@
+<div id="tabs">
+ <ul class="rightside">
+ <!-- BEGIN cal_menu -->
+ <li<!-- IF cal_menu.S_ACTIVE --> class="activetab"<!-- ENDIF -->><a href="{cal_menu.U_OPTION}"><span>{cal_menu.OPTION}</span></a></li>
+ <!-- END cal_menu -->
+ </ul>
+</div>
+
+<div class="panel bg3">
+ <div class="inner"><span class="corners-top"><span></span></span>
\ No newline at end of file
Added: mods/cms/trunk/modules/calendar/template/calendar_mini.html
===================================================================
--- mods/cms/trunk/modules/calendar/template/calendar_mini.html (rev 0)
+++ mods/cms/trunk/modules/calendar/template/calendar_mini.html 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,28 @@
+<table width="100%" border="0" cellspacing="1">
+ <caption><b>{MONTH}</b></caption>
+ <tr>
+ <th>{L_MINI_SUNDAY}</th>
+ <th>{L_MINI_MONDAY}</th>
+ <th>{L_MINI_TUESDAY}</th>
+ <th>{L_MINI_WEDNESDAY}</th>
+ <th>{L_MINI_THURSDAY}</th>
+ <th>{L_MINI_FRIDAY}</th>
+ <th>{L_MINI_SATURDAY}</th>
+ </tr>
+ <tr>
+ <!-- IF S_DAY_OF_WEEK > 0 --><td colspan="{S_DAY_OF_WEEK}"> </td><!-- ENDIF -->
+
+ <!-- BEGIN cal_mini -->
+ <!-- IF cal_mini.S_BREAK --></tr><tr><!-- ENDIF -->
+ <td class="<!-- IF cal_mini.S_TODAY -->forumbg<!-- ENDIF -->" width="14.2%">
+ <!-- IF cal_mini.U_LINK -->
+ <span class="forabg"><a href="{cal_mini.U_LINK}" class="calendarlink">{cal_mini.CURR_DAY}</a></span>
+ <!-- ELSE -->
+ {cal_mini.CURR_DAY}
+ <!-- ENDIF -->
+ </td>
+ <!-- END cal_mini -->
+
+ <!-- IF S_REMAINING_DAYS --><td colspan="{S_REMAINING_DAYS}"> </td><!-- ENDIF -->
+ </tr>
+</table>
Added: mods/cms/trunk/modules/calendar/template/calendar_month.html
===================================================================
--- mods/cms/trunk/modules/calendar/template/calendar_month.html (rev 0)
+++ mods/cms/trunk/modules/calendar/template/calendar_month.html 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,47 @@
+<!-- INCLUDE calendar_header.html -->
+
+<table class="calendar" width="100%" border="0" cellspacing="1">
+ <tr>
+ <td><span><a href="{U_LAST_YEAR}" title="{L_LAST_YEAR}"><<</a></span></td>
+ <td><span><a href="{U_LAST_MONTH}" title="{L_LAST_MONTH}"><</a></span></td>
+ <td colspan="3"><h2 style="text-align:center">{MONTH}</h2></td>
+ <td><span class="right-box"><a href="{U_NEXT_MONTH}" title="{L_NEXT_MONTH}">></a></span></td>
+ <td><span class="right-box"><a href="{U_NEXT_YEAR}" title="{L_NEXT_YEAR}">>></a></span></td>
+ </tr>
+ <tr>
+ <th>{L_SUNDAY}</th>
+ <th>{L_MONDAY}</th>
+ <th>{L_TUESDAY}</th>
+ <th>{L_WEDNESDAY}</th>
+ <th>{L_THURSDAY}</th>
+ <th>{L_FRIDAY}</th>
+ <th>{L_SATURDAY}</th>
+ </tr>
+ <tr>
+ <!-- IF S_DAY_OF_WEEK > 0 --><td colspan="{S_DAY_OF_WEEK}"> </td><!-- ENDIF -->
+
+ <!-- BEGIN cal_month -->
+ <!-- IF cal_month.S_BREAK --></tr><tr><!-- ENDIF -->
+ <td width="14.2%">
+ <div class="<!-- IF cal_month.S_TODAY -->forabg<!-- ELSE -->bg3<!-- ENDIF -->" style="text-align:right">
+ <!-- IF cal_month.U_LINK -->
+ <a href="{cal_month.U_LINK}" class="bg1">{cal_month.CURR_DAY}</a>
+ <!-- ELSE -->
+ {cal_month.CURR_DAY}
+ <!-- ENDIF -->
+ </div>
+ <div class="bg2" style="height:100px"><br />
+ <ul>
+ <!-- BEGIN events -->
+ <li><a href="{cal_month.events.U_LINK}">{cal_month.events.TITLE}</a></li>
+ <!-- END events -->
+ </ul>
+ </div>
+ </td>
+ <!-- END cal_month -->
+
+ <!-- IF S_REMAINING_DAYS --><td colspan="{S_REMAINING_DAYS}"> </td><!-- ENDIF -->
+ </tr>
+</table>
+
+<!-- INCLUDE calendar_footer.html -->
Added: mods/cms/trunk/modules/calendar/template/calendar_week.html
===================================================================
--- mods/cms/trunk/modules/calendar/template/calendar_week.html (rev 0)
+++ mods/cms/trunk/modules/calendar/template/calendar_week.html 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,29 @@
+<!-- INCLUDE calendar_header.html -->
+
+<table class="calendar" width="100%" border="0" cellspacing="2">
+ <tr>
+ <td><span><a href="{U_PREV_WEEK}">{L_PREV_WEEK}</a></span></td>
+ <td colspan="5"><h2 style="text-align:center">{WEEK_DAYS}</h2></td>
+ <td><span class="right-box"><a href="{U_NEXT_WEEK}">{L_NEXT_WEEK}</a></span></td>
+ </tr>
+ <tr>
+ <!-- BEGIN week_days -->
+ <td style="width:14.2%;text-align:center"><span><b>{week_days.L_DAY}</b><br /><a href="{week_days.U_DAY}">{week_days.DAY}</a></span></td>
+ <!-- END week_days -->
+ </tr>
+ <tr>
+ <!-- BEGIN cal_week -->
+ <td style="width:14.2%; height:450px" valign="top">
+ <div class="bg2" style="height:450px"><br />
+ <ul>
+ <!-- BEGIN events -->
+ <li><a href="{cal_week.events.U_LINK}">{cal_week.events.TITLE}</li>
+ <!-- END events -->
+ </ul>
+ </div>
+ </td>
+ <!-- END cal_week -->
+ </tr>
+</table>
+
+<!-- INCLUDE calendar_footer.html -->
Added: mods/cms/trunk/modules/calendar/template/calendar_year.html
===================================================================
--- mods/cms/trunk/modules/calendar/template/calendar_year.html (rev 0)
+++ mods/cms/trunk/modules/calendar/template/calendar_year.html 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,48 @@
+<!-- INCLUDE calendar_header.html -->
+
+<div style="text-align:center; width:100%">
+ <div class="left-box"><span><a href="{U_LAST_YEAR}">{L_LAST_YEAR}</a></span></div>
+ <div class="right-box"><span><a href="{U_NEXT_YEAR}">{L_NEXT_YEAR}</a></span></div>
+ <p><strong>{YEAR}</strong></p>
+ <br />
+
+ <div class="bg2" style="height:100%">
+
+ <!-- BEGIN cal_year -->
+ <table border="0" cellspacing="1" class="bg3" style="float:left;margin:2%;width:27.9%;height:165px">
+ <tr>
+ <td colspan="7"><strong><a href="{cal_year.U_MONTH}">{cal_year.MONTH}</a></strong></td>
+ </tr>
+ <tr>
+ <th>{L_MINI_SUNDAY}</th>
+ <th>{L_MINI_MONDAY}</th>
+ <th>{L_MINI_TUESDAY}</th>
+ <th>{L_MINI_WEDNESDAY}</th>
+ <th>{L_MINI_THURSDAY}</th>
+ <th>{L_MINI_FRIDAY}</th>
+ <th>{L_MINI_SATURDAY}</th>
+ </tr>
+ <tr>
+ <!-- IF cal_year.S_DAY_OF_WEEK > 0 --><td colspan="{cal_year.S_DAY_OF_WEEK}"> </td><!-- ENDIF -->
+
+ <!-- BEGIN cal_mini -->
+ <!-- IF cal_year.cal_mini.S_BREAK --></tr><tr><!-- ENDIF -->
+ <td class="<!-- IF cal_year.cal_mini.S_TODAY -->forumbg<!-- ENDIF -->" width="14.2%">
+ <!-- IF cal_year.cal_mini.U_LINK -->
+ <span class="forabg"><a href="{cal_year.cal_mini.U_LINK}" class="calendarlink">{cal_year.cal_mini.CURR_DAY}</a></span>
+ <!-- ELSE -->
+ {cal_year.cal_mini.CURR_DAY}
+ <!-- ENDIF -->
+ </td>
+ <!-- END cal_mini -->
+
+ <!-- IF cal_year.S_REMAINING_DAYS --><td colspan="{cal_year.S_REMAINING_DAYS}"> </td><!-- ENDIF -->
+ </tr>
+ </table>
+ <!-- END cal_year -->
+
+ <br clear="both" />
+ </div>
+</div>
+
+<!-- INCLUDE calendar_footer.html -->
\ No newline at end of file
Modified: mods/cms/trunk/modules/content/cms_content.php
===================================================================
--- mods/cms/trunk/modules/content/cms_content.php 2007-09-05 05:46:11 UTC (rev 56)
+++ mods/cms/trunk/modules/content/cms_content.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -2,7 +2,7 @@
/**
*
* @package cms
-* @version $Id: gui_content.php,v 1.38 2006/11/24 14:58:07 acydburn Exp $
+* @version $Id: cms_content.php,v 1.38 2006/11/24 14:58:07 Blitze Exp $
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
@@ -124,7 +124,7 @@
$tags = '';
if($content_data['allow_keywords'] && $row['keywords'])
{
- $tags_ary = str_replace(' ', '', $row['keywords']);
+ $tags_ary = str_replace(', ', ',', $row['keywords']);
$tags_ary = explode(',', $tags_ary);
foreach($tags_ary as $i => $tag)
@@ -161,7 +161,7 @@
'U_HIDE_COMMENTS' => $url,
'U_VIEW_COMMENTS' => $url . "&comments=1#comments",
- 'U_POST_COMMENT' => $url . "&comments=1#post_comments",
+ 'U_POST_COMMENT' => $url . "&comments=1#post_comment",
'U_AUTHOR' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['author']),
'U_APPROVER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['approver']),
));
@@ -256,7 +256,7 @@
AND UNIX_TIMESTAMP(NOW()) > c.post_time';
$sql .= ($cat_items) ? ' AND ' . $db->sql_in_set('c.id', $cat_items) : '';
$sql .= ($author) ? ' AND c.author = ' . (int) $author : '';
- $sql .= ($tag) ? " AND c.keywords LIKE '%" . $db->sql_escape(utf8_clean_string($tag)) . "%'" : '';
+ $sql .= ($tag) ? " AND c.keywords " . $db->sql_like_expression(str_replace('*', $db->any_char, utf8_case_fold_nfc("*$tag*"))) : '';
$sql .= ' ORDER BY c.post_time DESC';
$result = $db->sql_query_limit($sql, $config['posts_per_page'], $start);
Modified: mods/cms/trunk/modules/content/language/en/content.php
===================================================================
--- mods/cms/trunk/modules/content/language/en/content.php 2007-09-05 05:46:11 UTC (rev 56)
+++ mods/cms/trunk/modules/content/language/en/content.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -82,7 +82,7 @@
'NO_ITEMS' => 'There are no existing items for this content type.',
'NO_CONTENT_TYPE' => 'There are no existing content types',
- 'NO_CMS_CONTENT' => 'No %s(s) have been posted yet.',
+ 'NO_CMS_CONTENT' => 'No %s found.',
'TEXT' => 'Text',
'SMALL_TEXTAREA' => 'Small Textarea',
'LARGE_TEXTAREA' => 'Large Textarea',
Added: mods/cms/trunk/modules/events/acp_events.php
===================================================================
--- mods/cms/trunk/modules/events/acp_events.php (rev 0)
+++ mods/cms/trunk/modules/events/acp_events.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,151 @@
+<?php
+/**
+*
+* @package events
+* @version $Id: acp_events.php,v 1.38 2006/11/24 14:58:07 Blitze Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* acp_events
+* @package events
+*/
+class acp_events
+{
+ var $u_action;
+
+ function main($id, $mode)
+ {
+ global $config, $db, $user, $auth, $template, $mtemplate, $phpbb_root_path, $phpEx;
+
+ include($phpbb_root_path . "modules/events/constants.$phpEx");
+ include($phpbb_root_path . "modules/events/functions_events.$phpEx");
+
+ $user->add_mod_lang(array('events' => 'events'));
+
+ $action = request_var('action', '');
+ $display = request_var('display', '');
+ $event_id = request_var('e', '');
+ $group_id = request_var('g', '');
+ $user_id = request_var('u', '');
+ $submit = (isset($_POST['submit'])) ? true : false;
+
+ if($submit)
+ {
+ event_save($event_id);
+ }
+
+ if($action == 'approve')
+ {
+ set_event_status($event_id, 1);
+ $event_id = '';
+ }
+
+ switch($action)
+ {
+ case 'edit':
+ case 'add':
+ event_add($event_id);
+ break;
+
+ default:
+
+ $sql_array = array(
+ 'SELECT' => 'e.*, u.username, u.user_colour, g.group_name',
+ 'FROM' => array(
+ EVENTS_TABLE => 'e',
+ USERS_TABLE => 'u',
+ ),
+ 'LEFT_JOIN' => array(
+ array(
+ 'FROM' => array(GROUPS_TABLE => 'g'),
+ 'ON' => 'g.group_id = e.group_id'
+ )
+ ),
+ 'WHERE' => 'u.user_id = e.user_id',
+ 'ORDER_BY' => 'e.event_start DESC'
+ );
+
+ if($display)
+ {
+ $sql_array['WHERE'] .= ' AND ';
+
+ switch($display)
+ {
+ case 'user':
+ $sql_array['WHERE'] .= ($user_id) ? 'e.user_id = ' . $user_id : "e.group_id = ''";
+ break;
+ case 'group':
+ $sql_array['WHERE'] .= ($group_id) ? 'e.group_id = ' . $group_id : "e.group_id <> ''";
+ break;
+ case 'pending':
+ $sql_array['WHERE'] .= 'e.event_status = 0';
+ break;
+ case 'approved':
+ $sql_array['WHERE'] .= 'e.event_status = 1';
+ break;
+ case 'past':
+ $sql_array['WHERE'] .= 'e.event_end < UNIX_TIMESTAMP(NOW())';
+ break;
+ }
+ }
+
+ if($event_id)
+ {
+ $sql_array['WHERE'] .= ' AND e.event_id = ' . $event_id;
+ $mtemplate->assign_vars(array('S_DETAILS' => true));
+ }
+
+ $sql = $db->sql_build_query('SELECT', $sql_array);
+ $result = $db->sql_query($sql);
+
+ while($row = $db->sql_fetchrow($result))
+ {
+ $mtemplate->assign_block_vars('events', array(
+ 'EVENT_TITLE' => censor_text($row['event_title']),
+ 'EVENT_START' => $user->format_date($row['event_start']),
+ 'EVENT_END' => $user->format_date($row['event_end']),
+ 'EVENT_POSTER' => $row['username'],
+ 'EVENT_STATUS' => $row['event_status'],
+ 'GROUP' => ($row['group_name']) ? ((isset($user->lang['G_' . $row['group_name']])) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) : '',
+
+ 'U_USER' => $this->u_action . '&display=user&u=' . $row['user_id'],
+ 'U_GROUP' => $this->u_action . '&display=group&g=' . $row['group_id'],
+ 'U_VIEW' => $this->u_action . '&e=' . $row['event_id'],
+ 'U_APPROVE' => $this->u_action . '&e=' . $row['event_id'] . '&action=approve',
+ 'U_DELETE' => $this->u_action . '&e=' . $row['event_id'] . '&action=delete',
+ 'U_EDIT' => $this->u_action . '&e=' . $row['event_id'] . '&action=edit',
+ ));
+ }
+ $db->sql_freeresult($result);
+
+ $mtemplate->assign_vars(array(
+ 'U_EVENT_ADD' => $this->u_action . '&action=add',
+ 'U_USER_VIEW' => $this->u_action . '&display=user',
+ 'U_GROUP_VIEW' => $this->u_action . '&display=group',
+ 'U_PENDING_VIEW' => $this->u_action . '&display=pending',
+ 'U_APPROVED_VIEW' => $this->u_action . '&display=approved',
+ 'U_PAST_VIEW' => $this->u_action . '&display=past',
+ ));
+
+ break;
+ }
+
+ $mtemplate->set_filenames(array(
+ 'content' => 'acp_events.html')
+ );
+
+ $template->assign_vars(array(
+ 'CONTENT' => $mtemplate->assign_display('content'),
+ 'L_TITLE' => $user->lang['EVENTS'],
+ 'L_TITLE_EXPLAIN' => '',
+ ));
+
+ $this->tpl_name = 'mod_admin';
+ $this->page_title = 'ACP_EVENTS';
+ }
+}
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/events/cms_events.php
===================================================================
--- mods/cms/trunk/modules/events/cms_events.php (rev 0)
+++ mods/cms/trunk/modules/events/cms_events.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,41 @@
+<?php
+/**
+*
+* @package cms
+* @version $Id: cms_events.php,v 1.41 2007/01/24 11:28:50 acydburn Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* cms_events
+* @package events
+*/
+class cms_events
+{
+ var $u_action;
+ var $tpl_name;
+
+ function main($id, $mode)
+ {
+ global $db, $user, $mtemplate, $template, $phpbb_root_path, $phpEx;
+
+ include_once($phpbb_root_path . "modules/events/constants.$phpEx");
+ include($phpbb_root_path . "modules/events/functions_events.$phpEx");
+
+ $user->add_mod_lang(array('events' => 'events'));
+
+ $event_id = request_var('e', '');
+
+ $this->page_title = $user->lang['CMS_EVENTS'];
+
+ $module_block['TITLE'] = $user->lang['CMS_EVENTS'];
+ $module_block['CONTENT'] = get_events($mode, $this->u_action, $event_id);
+
+ $template->assign_vars(array('S_NO_CONTAINER' => true));
+ $template->assign_block_vars('module', $module_block);
+ }
+}
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/events/constants.php
===================================================================
--- mods/cms/trunk/modules/events/constants.php (rev 0)
+++ mods/cms/trunk/modules/events/constants.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,19 @@
+<?php
+/**
+*
+* @package phpBB3
+* @version $Id: constants.php,v 1.76 2006/10/19 13:54:47 acydburn Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+*/
+
+global $table_prefix;
+
+define('EVENTS_TABLE', $table_prefix . 'events');
+define('EVENTS_RSVP_TABLE', $table_prefix . 'events_rsvp');
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/events/functions_events.php
===================================================================
--- mods/cms/trunk/modules/events/functions_events.php (rev 0)
+++ mods/cms/trunk/modules/events/functions_events.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,247 @@
+<?php
+/**
+*
+* @package events
+* @version $Id: functions_events.php,v 1.38 2006/11/24 14:58:07 Blitze Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/*
+* get_events
+*
+* mode [string], list/calendar/map
+* event_id [int], limits to specific event
+* scope [string], accepts user/group: used to limits events by user/group
+* ug_id [int], id of the group or user
+* status [int], accepts 0/1: used to limit events by status (1 = approved)
+* path_to_details: if set, will be used instead of default to view event detail
+*/
+
+function get_events($mode, $u_action, $event_id = '', $scope = false, $ug_id = '', $status = 1, $path_to_details = '')
+{
+ global $db, $user, $config, $mtemplate, $phpbb_root_path, $phpEx;
+
+ $display = request_var('display', 'month');
+ $date = request_var('date', '');
+
+ $dst = $config['board_dst'] * 3600;
+ $timezone = (($user->data['user_id'] != ANONYMOUS) ? strval(doubleval($user->data['user_timezone'])) : strval(doubleval($config['board_timezone']))) * 3600;
+
+ list($day, $month, $year) = explode(' ', gmdate('j n Y', time() + $timezone + $dst));
+
+ if($date)
+ {
+ $date_info = explode('-', $date);
+ $year = (isset($date_info[0])) ? $date_info[0] : '';
+ $month = (isset($date_info[1])) ? $date_info[1] : '';
+ $day = (isset($date_info[2])) ? $date_info[2] : '';
+ }
+
+ $sql_array = array(
+ 'SELECT' => 'e.*, u.username, u.user_colour, g.group_name',
+ 'FROM' => array(
+ EVENTS_TABLE => 'e',
+ USERS_TABLE => 'u',
+ ),
+ 'LEFT_JOIN' => array(
+ array(
+ 'FROM' => array(GROUPS_TABLE => 'g'),
+ 'ON' => 'g.group_id = e.group_id'
+ )
+ ),
+ 'WHERE' => 'u.user_id = e.user_id',
+ 'ORDER_BY' => 'e.event_start DESC'
+ );
+
+ if($mode == 'calendar')
+ {
+ include($phpbb_root_path . "modules/calendar/functions_calendar.$phpEx");
+
+ $limits = calendar_get_datetime_limits($display, $year, $month, $day);
+ $sql_array['WHERE'] .= ' AND e.event_start BETWEEN ' . $limits['start'] . ' AND ' . $limits['stop'];
+ }
+
+ if($scope)
+ {
+ if($scope == 'group')
+ {
+ $sql_array['WHERE'] .= ' AND ' . (($ug_id) ? "e.group_id = $ug_id" : "e.group_id <> ''");
+ }
+ else
+ {
+ $sql_array['WHERE'] .= ' AND ' . (($ug_id) ? "e.user_id = $ug_id" : "e.group_id = ''");
+ }
+ }
+
+ $sql_array['WHERE'] .= ' AND ' . (($status) ? 'e.event_status = 1' : 'e.event_status = 0');
+
+ $result = $db->sql_query($db->sql_build_query('SELECT', $sql_array));
+
+ $data = array();
+ $path_to_details = ($path_to_details) ? $path_to_details : append_sid("{$phpbb_root_path}index.$phpEx", 'i=events&mode=details');
+
+ switch($mode)
+ {
+ case 'map':
+ break;
+
+ case 'calendar':
+
+ while($row = $db->sql_fetchrow($result))
+ {
+ $data[$row['event_start']]['title'] = censor_text($row['event_title']);
+ $data[$row['event_start']]['url'] = $path_to_details . '&e=' . $row['event_id'];
+ }
+
+ $data = build_calendar($u_action, $display, $data, $month, $day, $year);
+
+ break;
+
+ default:
+
+ while($row = $db->sql_fetchrow($result))
+ {
+ $mtemplate->assign_block_vars('events', array(
+ 'EVENT_TITLE' => censor_text($row['event_title']),
+ 'EVENT_START' => $user->format_date($row['event_start']),
+ 'EVENT_END' => $user->format_date($row['event_end']),
+ 'EVENT_POSTER' => $row['username'],
+ 'EVENT_DESC' => $row['event_desc'],
+
+ 'U_VIEW' => $path_to_details . '&e=' . $row['event_id'],
+ 'U_USER' => $u_action . '&browseby=user&u=' . $row['user_id'],
+ 'U_APPROVE' => $u_action . '&e=' . $row['event_id'] . '&action=approve',
+ 'U_DELETE' => $u_action . '&e=' . $row['event_id'] . '&action=delete',
+ 'U_EDIT' => $u_action . '&e=' . $row['event_id'] . '&action=edit',
+ ));
+ }
+
+ $mtemplate->set_filenames(array(
+ 'events_list' => 'events_list.html')
+ );
+
+ $data = $mtemplate->assign_display('events_list');
+
+ break;
+ }
+ $db->sql_freeresult($result);
+
+ return $data;
+}
+
+function event_add($event_id)
+{
+ global $db, $mtemplate, $user;
+
+ if($event_id)
+ {
+ $sql = 'SELECT *
+ FROM ' . EVENTS_TABLE . "
+ WHERE event_id = $event_id";
+ $result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ $mtemplate->assign_vars(array(
+ 'EVENT_TITLE' => $row['event_title'],
+ 'EVENT_DESC' => $row['event_desc'],
+ 'EVENT_STARTDATE' => $user->format_date($row['event_start'], 'm/d/Y', true),
+ 'EVENT_STARTTIME' => $user->format_date($row['event_start'], 'H:i', true),
+ 'EVENT_ENDDATE' => $user->format_date($row['event_end'], 'm/d/Y', true),
+ 'EVENT_ENDTIME' => $user->format_date($row['event_end'], 'H:i', true),
+ 'EVENT_ADDRESS' => $row['event_address'],
+ 'EVENT_CONTACT' => $row['event_contact'],
+ 'S_RSVP' => $row['event_rsvp'],
+ 'L_EVENT_ADD' => $user->lang['EVENT_EDIT'],
+ ));
+ }
+
+ $mtemplate->assign_vars(array('S_EDIT' => true));
+}
+
+function event_save($event_id)
+{
+ global $db, $template, $user, $config;
+
+ $event_title = (string) request_var('title', '');
+ $event_desc = utf8_normalize_nfc(request_var('desc', '', true));
+ $event_startdate = request_var('start_date', '');
+ $event_starttime = request_var('start_time', '');
+ $event_enddate = request_var('end_date', '');
+ $event_endtime = request_var('end_time', '');
+
+ $errors = array();
+
+ if (!$event_title)
+ {
+ $errors[] = $user->lang['MISSING_TITLE'];
+ }
+
+ if(!$event_desc)
+ {
+ $errors[] = $user->lang['MISSING_DESC'];
+ }
+
+ if(sizeof($errors))
+ {
+ $template->assign_vars(array('MESSAGE' => join('<br>', $errors)));
+ return;
+ }
+
+ $enable_smilies = ($config['allow_smilies'] && $user->optionget('smilies')) ? true : false;
+ $enable_bbcode = ($config['allow_bbcode'] && $user->optionget('bbcode')) ? true : false;
+ $enable_urls = ($config['allow_urls']) ? true : false;
+
+ $sdate = explode('/', $event_startdate);
+ $stime = explode(':', $event_starttime);
+ $edate = explode('/', $event_enddate);
+ $etime = explode(':', $event_endtime);
+
+ $dst = $config['board_dst'] * 3600;
+ $timezone = ($user->data['user_id'] != ANONYMOUS) ? strval(doubleval($user->data['user_timezone'])) : strval(doubleval($config['board_timezone'])) * 3600;
+
+ $event_start = mktime($stime[0], $stime[1], 60, $sdate[0], $sdate[1], $sdate[2]) + $timezone + $dst;
+ $event_end = mktime($etime[0], $etime[1], 60, $edate[0], $edate[1], $edate[2]) + $timezone + $dst;
+
+ $sql_ary = array(
+ 'event_desc' => $event_desc,
+ 'event_title' => $event_title,
+ 'event_contact' => request_var('contact', ''),
+ 'event_address' => request_var('address', ''),
+ 'event_start' => $event_start,
+ 'event_end' => $event_end,
+ 'event_recur' => request_var('recur', '0'),
+ 'event_props' => request_var('recur_prop', '0'),
+ 'event_rsvp' => request_var('rsvp', '0'),
+ 'event_auth' => request_var('auth', '1'),
+ );
+
+ if(!$event_id)
+ {
+ $sql_ary['user_id'] = $user->data['user_id'];
+ $sql_ary['group_id'] = (int) request_var('g', '');
+ $sql_ary['event_posttime'] = request_var('post_time', '');
+ }
+
+ generate_text_for_storage($sql_ary['event_desc'], $sql_ary['bbcode_uid'], $sql_ary['bbcode_bitfield'], $sql_ary['bbcode_options'], $enable_bbcode, $enable_urls, $enable_smilies);
+
+ $sql = ($event_id) ? 'UPDATE ' . EVENTS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' WHERE event_id = ' . (int) $event_id : 'INSERT INTO ' . EVENTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
+ $db->sql_query($sql);
+}
+
+function set_event_status($event_id, $status)
+{
+ global $db;
+
+ if(!$event_id)
+ {
+ return;
+ }
+
+ $sql = 'UPDATE ' . EVENTS_TABLE . " SET event_status = $status WHERE event_id = $event_id";
+ $db->sql_query($sql);
+}
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/events/info/acp_events.php
===================================================================
--- mods/cms/trunk/modules/events/info/acp_events.php (rev 0)
+++ mods/cms/trunk/modules/events/info/acp_events.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,80 @@
+<?php
+/**
+*
+* @package events
+* @version $Id: acp_events.php,v 1.2 2006/05/01 19:45:42 grahamje Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @package module_install
+*/
+class acp_events_info
+{
+ function module()
+ {
+ return array(
+ 'filename' => 'acp_events',
+ 'title' => 'ACP_EVENTS',
+ 'parent' => 'ACP_MOD_MANAGEMENT',
+ 'version' => '1.0.0',
+ 'modes' => array(
+ 'events' => array('title' => 'ACP_EVENTS', 'auth' => '', 'cat' => array('ACP_EVENTS')),
+ ),
+ );
+ }
+
+ function install()
+ {
+ global $db, $phpbb_root_path, $phpEx;
+
+ include_once($phpbb_root_path . "modules/events/constants.$phpEx");
+
+ $sql_ary[] = 'CREATE TABLE IF NOT EXISTS ' . EVENTS_TABLE . " (
+ `event_id` mediumint(8) NOT NULL auto_increment,
+ `user_id` mediumint(8) NOT NULL,
+ `group_id` mediumint(8) NOT NULL,
+ `event_title` varchar(100) collate utf8_bin NOT NULL,
+ `event_desc` text collate utf8_bin,
+ `bbcode_bitfield` varchar(255) collate utf8_bin NOT NULL,
+ `bbcode_uid` varchar(5) collate utf8_bin NOT NULL,
+ `bbcode_options` int(11) NOT NULL default '7',
+ `event_contact` varchar(255) collate utf8_bin NOT NULL,
+ `event_address` varchar(255) collate utf8_bin NOT NULL,
+ `event_start` int(11) NOT NULL default '0',
+ `event_end` int(11) NOT NULL default '0',
+ `event_posttime` int(11) NOT NULL default '0',
+ `event_rsvp` tinyint(1) NOT NULL default '0',
+ `event_recur` tinyint(1) NOT NULL default '0',
+ `event_props` tinyint(1) NOT NULL default '0',
+ `event_nexttime` int(11) NOT NULL default '0',
+ `event_status` tinyint(1) NOT NULL default '0',
+ `event_auth` mediumint(8) NOT NULL,
+ PRIMARY KEY (`event_id`)
+ ) CHARACTER SET `utf8` COLLATE `utf8_bin`";
+
+ $sql_ary[] = 'CREATE TABLE IF NOT EXISTS ' . EVENTS_RSVP_TABLE . " (
+ `event_id` mediumint(8) NOT NULL,
+ `user_id` mediumint(8) NOT NULL,
+ `event_rsvp` tinyint(2) NOT NULL default '0'
+ )";
+
+ $sql_ary[] = 'UPDATE ' . MODULES_TABLE . "
+ SET module_display = 0
+ WHERE module_mode = 'details'
+ AND module_dir = 'events'";
+
+ foreach($sql_ary as $i => $sql)
+ {
+ $db->sql_query($sql);
+ }
+ }
+
+ function uninstall()
+ {
+ }
+}
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/events/info/cms_events.php
===================================================================
--- mods/cms/trunk/modules/events/info/cms_events.php (rev 0)
+++ mods/cms/trunk/modules/events/info/cms_events.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,40 @@
+<?php
+/**
+*
+* @package events
+* @version $Id: cms_events.php,v 1.2 2006/05/01 19:45:42 Blitze Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @package module_install
+*/
+class cms_events_info
+{
+ function module()
+ {
+ return array(
+ 'filename' => 'cms_events',
+ 'title' => 'CMS_EVENTS',
+ 'version' => '1.0.0',
+ 'modes' => array(
+ 'list' => array('title' => 'EVENTS_LIST', 'auth' => '', 'cat' => array('CMS_EVENTS')),
+ 'calendar' => array('title' => 'EVENTS_CALENDAR', 'auth' => '', 'cat' => array('CMS_EVENTS')),
+ 'map' => array('title' => 'EVENTS_MAP', 'auth' => '', 'cat' => array('CMS_EVENTS')),
+ 'details' => array('title' => 'EVENTS_DETAILS', 'auth' => '', 'cat' => array('CMS_EVENTS')),
+ ),
+ );
+ }
+
+ function install()
+ {
+ }
+
+ function uninstall()
+ {
+ }
+}
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/events/info/events_info.php
===================================================================
--- mods/cms/trunk/modules/events/info/events_info.php (rev 0)
+++ mods/cms/trunk/modules/events/info/events_info.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,30 @@
+<?php
+/**
+*
+* @package events
+* @version $Id: events_info.php,v 1.3 2006/10/06 18:43:54 acydburn Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @package module_install
+*/
+$module_info = array(
+ 'mod_name' => 'events',
+ 'mod_disp_name' => 'Events',
+ 'mod_short_desc' => 'Events System',
+ 'mod_long_desc' => 'Creates an events system',
+ 'mod_image' => '',
+ 'mod_author' => 'Blitze',
+ 'mod_contact' => '',
+ 'mod_url' => '',
+ 'mod_vers' => '1.01',
+ 'mod_compat' => 'rc5',
+ 'mod_type' => 'mod',
+ 'mod_demo_url' => '',
+ 'mod_dependents' => ''
+);
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/events/info/gcp_events.php
===================================================================
--- mods/cms/trunk/modules/events/info/gcp_events.php (rev 0)
+++ mods/cms/trunk/modules/events/info/gcp_events.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,37 @@
+<?php
+/**
+*
+* @package events
+* @version $Id: gcp_events.php,v 1.2 2006/05/01 19:45:42 grahamje Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @package module_install
+*/
+class gcp_events_info
+{
+ function module()
+ {
+ return array(
+ 'filename' => 'gcp_events',
+ 'title' => 'GCP_EVENTS',
+ 'version' => '1.0.0',
+ 'modes' => array(
+ 'events' => array('title' => 'EVENTS', 'auth' => '', 'cat' => array('GCP_EVENTS')),
+ ),
+ );
+ }
+
+ function install()
+ {
+ }
+
+ function uninstall()
+ {
+ }
+}
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/events/info/grp_events.php
===================================================================
--- mods/cms/trunk/modules/events/info/grp_events.php (rev 0)
+++ mods/cms/trunk/modules/events/info/grp_events.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,37 @@
+<?php
+/**
+*
+* @package events
+* @version $Id: grp_events.php,v 1.2 2006/05/01 19:45:42 grahamje Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @package module_install
+*/
+class grp_events_info
+{
+ function module()
+ {
+ return array(
+ 'filename' => 'grp_events',
+ 'title' => 'GRP_EVENTS',
+ 'version' => '1.0.0',
+ 'modes' => array(
+ 'events' => array('title' => 'EVENTS', 'auth' => '', 'cat' => array('GRP_EVENTS')),
+ ),
+ );
+ }
+
+ function install()
+ {
+ }
+
+ function uninstall()
+ {
+ }
+}
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/events/info/mcp_events.php
===================================================================
--- mods/cms/trunk/modules/events/info/mcp_events.php (rev 0)
+++ mods/cms/trunk/modules/events/info/mcp_events.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,37 @@
+<?php
+/**
+*
+* @package events
+* @version $Id: mcp_events.php,v 1.2 2006/05/01 19:45:42 grahamje Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @package module_install
+*/
+class mcp_events_info
+{
+ function module()
+ {
+ return array(
+ 'filename' => 'mcp_events',
+ 'title' => 'MCP_EVENTS',
+ 'version' => '1.0.0',
+ 'modes' => array(
+ 'events' => array('title' => 'EVENTS', 'auth' => '', 'cat' => array('MCP_EVENTS')),
+ ),
+ );
+ }
+
+ function install()
+ {
+ }
+
+ function uninstall()
+ {
+ }
+}
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/events/info/ucp_events.php
===================================================================
--- mods/cms/trunk/modules/events/info/ucp_events.php (rev 0)
+++ mods/cms/trunk/modules/events/info/ucp_events.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,37 @@
+<?php
+/**
+*
+* @package events
+* @version $Id: ucp_events.php,v 1.2 2006/05/01 19:45:42 grahamje Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @package module_install
+*/
+class ucp_events_info
+{
+ function module()
+ {
+ return array(
+ 'filename' => 'ucp_events',
+ 'title' => 'UCP_EVENTS',
+ 'version' => '1.0.0',
+ 'modes' => array(
+ 'events' => array('title' => 'EVENTS', 'auth' => '', 'cat' => array('UCP_EVENTS')),
+ ),
+ );
+ }
+
+ function install()
+ {
+ }
+
+ function uninstall()
+ {
+ }
+}
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/events/language/en/common.php
===================================================================
--- mods/cms/trunk/modules/events/language/en/common.php (rev 0)
+++ mods/cms/trunk/modules/events/language/en/common.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,47 @@
+<?php
+/**
+*
+* Events [English]
+*
+* @package language
+* @version $Id: common.php,v x.xxx yyyy/mm/dd hh:mm:ss Username Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* DO NOT CHANGE
+*/
+if (empty($lang) || !is_array($lang))
+{
+ $lang = array();
+}
+
+// DEVELOPERS PLEASE NOTE
+//
+// Placeholders can now contain order information, e.g. instead of
+// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
+// translators to re-order the output of data while ensuring it remains correct
+//
+// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
+// equally where a string contains only two placeholders which are used to wrap text
+// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
+
+$lang = array_merge($lang, array(
+ 'EVENTS' => 'Events',
+ 'ACP_EVENTS' => 'Events',
+ 'CMS_EVENTS' => 'Events',
+ 'UCP_EVENTS' => 'Events',
+ 'MCP_EVENTS' => 'Events',
+ 'PRO_EVENTS' => 'Events',
+ 'GCP_EVENTS' => 'Events',
+ 'GRP_EVENTS' => 'Group Events',
+
+ 'EVENTS_LIST' => 'Events List',
+ 'EVENTS_CALENDAR' => 'Events Calendar',
+ 'EVENTS_MAP' => 'Events Map',
+ 'EVENTS_DETAILS' => 'Event Details',
+));
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/events/language/en/events.php
===================================================================
--- mods/cms/trunk/modules/events/language/en/events.php (rev 0)
+++ mods/cms/trunk/modules/events/language/en/events.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,50 @@
+<?php
+/**
+* @package Events
+* @version $Id: common.php,v x.xxx yyyy/mm/dd hh:mm:ss Username Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* DO NOT CHANGE
+*/
+if (empty($lang) || !is_array($lang))
+{
+ $lang = array();
+}
+
+// DEVELOPERS PLEASE NOTE
+//
+// Placeholders can now contain order information, e.g. instead of
+// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
+// translators to re-order the output of data while ensuring it remains correct
+//
+// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
+// equally where a string contains only two placeholders which are used to wrap text
+// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
+
+$lang = array_merge($lang, array(
+ 'PENDING' => 'Pending',
+
+ 'EVENT' => 'Event',
+ 'DATE_TIME' => 'Date/Time',
+ 'EVENT_ADD' => 'Add New Event',
+ 'EVENT_EDIT' => 'Edit Event',
+ 'NO_EVENTS' => 'No events have been posted',
+ 'TITLE' => 'Title',
+ 'DESCRIPTION' => 'Description',
+ 'BEGINS' => 'Begins',
+ 'ENDS' => 'Ends',
+ 'ADDRESS' => 'Address',
+ 'CONTACT' => 'Contact',
+ 'RSVP' => 'RSVP',
+ 'PERMISSION' => 'Permission',
+ 'POSTER' => 'Author',
+ 'STATUS' => 'Status',
+ 'OPTIONS' => 'Options',
+
+));
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/events/language/en/permissions_comments.php
===================================================================
--- mods/cms/trunk/modules/events/language/en/permissions_comments.php (rev 0)
+++ mods/cms/trunk/modules/events/language/en/permissions_comments.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,69 @@
+<?php
+/**
+* acp_permissions (phpBB Permission Set) [English]
+*
+* @package language
+* @version $Id: permissions_phpbb.php,v 1.24 2007/05/03 14:28:51 acydburn Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*/
+
+/**
+* DO NOT CHANGE
+*/
+if (empty($lang) || !is_array($lang))
+{
+ $lang = array();
+}
+
+// DEVELOPERS PLEASE NOTE
+//
+// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
+//
+// Placeholders can now contain order information, e.g. instead of
+// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
+// translators to re-order the output of data while ensuring it remains correct
+//
+// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
+// equally where a string contains only two placeholders which are used to wrap text
+// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
+
+/**
+* MODDERS PLEASE NOTE
+*
+* You are able to put your permission sets into a separate file too by
+* prefixing the new file with permissions_ and putting it into the acp
+* language folder.
+*
+* An example of how the file could look like:
+*
+* <code>
+*
+* if (empty($lang) || !is_array($lang))
+* {
+* $lang = array();
+* }
+*
+* // Adding new category
+* $lang['permission_cat']['bugs'] = 'Bugs';
+*
+* // Adding new permission set
+* $lang['permission_type']['bug_'] = 'Bug Permissions';
+*
+* // Adding the permissions
+* $lang = array_merge($lang, array(
+* 'acl_bug_view' => array('lang' => 'Can view bug reports', 'cat' => 'bugs'),
+* 'acl_bug_post' => array('lang' => 'Can post bugs', 'cat' => 'post'), // Using a phpBB category here
+* ));
+*
+* </code>
+*/
+
+// User Permissions
+$lang = array_merge($lang, array(
+ 'acl_u_comments_post' => array('lang' => 'Can post comments', 'cat' => 'misc'),
+ 'acl_m_comments_manage' => array('lang' => 'Can manage comments', 'cat' => 'misc'),
+ 'acl_a_comments_manage' => array('lang' => 'Can manage comments', 'cat' => 'misc'),
+));
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/events/template/acp_events.html
===================================================================
--- mods/cms/trunk/modules/events/template/acp_events.html (rev 0)
+++ mods/cms/trunk/modules/events/template/acp_events.html 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,82 @@
+<!-- IF S_EDIT -->
+ <form method="post" name="edit_event" action="{U_ACTION}">
+ <fieldset>
+ <legend>{L_EVENT_ADD}</legend>
+ <dl>
+ <dt><label for="title">{L_TITLE}:</label></dt>
+ <dd><input name="title" type="text" id="title" class="medium" maxlength="50" value="{EVENT_TITLE}" /></dd>
+ </dl>
+ <dl>
+ <dt><label for="desc">{L_DESCRIPTION}:</label></dt>
+ <dd><textarea name="desc" cols="15" rows="10">{EVENT_DESC}</textarea></dd>
+ </dl>
+ <dl>
+ <dt><label for="start_date">{L_BEGINS}:</label></dt>
+ <dd>
+ <input name="start_date" type="text" id="start_date" class="small" maxlength="10" value="{EVENT_STARTDATE}" /> @
+ <input name="start_time" type="text" id="start_time" class="small" maxlength="5" value="{EVENT_STARTTIME}" />
+ </dd>
+ </dl>
+ <dl>
+ <dt><label for="end_date">{L_ENDS}:</label></dt>
+ <dd>
+ <input name="end_date" type="text" id="end_date" class="small" maxlength="10" value="{EVENT_ENDDATE}" /> @
+ <input name="end_time" type="text" id="end_time" class="small" maxlength="5" value="{EVENT_ENDTIME}" />
+ </dd>
+ </dl>
+ <dl>
+ <dt><label for="address">{L_ADDRESS}:</label></dt>
+ <dd><input name="address" type="text" id="address" class="medium" maxlength="75" value="{EVENT_ADDRESS}" /></dd>
+ </...
[truncated message content] |