mirror of
https://github.com/e107inc/e107.git
synced 2025-08-05 22:27:34 +02:00
Event Calendar V3.70
This commit is contained in:
@@ -11,20 +11,19 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/admin_config.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/admin_config.php,v $
|
||||||
| $Revision: 1.1.1.1 $
|
| $Revision: 1.2 $
|
||||||
| $Date: 2006-12-02 04:34:45 $
|
| $Date: 2007-07-13 19:37:52 $
|
||||||
| $Author: mcfly_e107 $
|
| $Author: e107steved $
|
||||||
|
|
|
||||||
| 02.11.06 - Cache clear option added
|
|
||||||
| 10.11.06 - Support for updated templates etc
|
|
||||||
|
|
|
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
$eplug_admin = true; // Make sure we show admin theme
|
$eplug_admin = true; // Make sure we show admin theme
|
||||||
|
$e_sub_cat = 'event_calendar';
|
||||||
require_once("../../class2.php");
|
require_once("../../class2.php");
|
||||||
require_once(e_HANDLER."userclass_class.php");
|
require_once(e_HANDLER."userclass_class.php");
|
||||||
if (!getperms("P")) {
|
if (!getperms("P"))
|
||||||
header("location:".e_BASE."index.php");
|
{
|
||||||
|
header("location:".e_BASE."index.php");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -39,6 +38,7 @@ if (isset($_POST['updatesettings'])) {
|
|||||||
$pref['eventpost_admin'] = $_POST['eventpost_admin'];
|
$pref['eventpost_admin'] = $_POST['eventpost_admin'];
|
||||||
$pref['eventpost_adminlog'] = $_POST['eventpost_adminlog'];
|
$pref['eventpost_adminlog'] = $_POST['eventpost_adminlog'];
|
||||||
$pref['eventpost_showeventcount'] = $_POST['eventpost_showeventcount'];
|
$pref['eventpost_showeventcount'] = $_POST['eventpost_showeventcount'];
|
||||||
|
$pref['eventpost_showmouseover'] = $_POST['eventpost_showmouseover'];
|
||||||
$pref['eventpost_forum'] = $_POST['eventpost_forum'];
|
$pref['eventpost_forum'] = $_POST['eventpost_forum'];
|
||||||
$pref['eventpost_recentshow'] = $_POST['eventpost_recentshow'];
|
$pref['eventpost_recentshow'] = $_POST['eventpost_recentshow'];
|
||||||
$pref['eventpost_super'] = $_POST['eventpost_super'];
|
$pref['eventpost_super'] = $_POST['eventpost_super'];
|
||||||
@@ -55,6 +55,7 @@ if (isset($_POST['updatesettings'])) {
|
|||||||
$pref['eventpost_datenext'] = $_POST['eventpost_datenext'];
|
$pref['eventpost_datenext'] = $_POST['eventpost_datenext'];
|
||||||
$pref['eventpost_eventdatecustom'] = $_POST['eventpost_eventdatecustom'];
|
$pref['eventpost_eventdatecustom'] = $_POST['eventpost_eventdatecustom'];
|
||||||
$pref['eventpost_nextdatecustom'] = $_POST['eventpost_nextdatecustom'];
|
$pref['eventpost_nextdatecustom'] = $_POST['eventpost_nextdatecustom'];
|
||||||
|
$pref['eventpost_printlists'] = $_POST['eventpost_printlists'];
|
||||||
$pref['eventpost_mailsubject'] = $_POST['eventpost_mailsubject'];
|
$pref['eventpost_mailsubject'] = $_POST['eventpost_mailsubject'];
|
||||||
$pref['eventpost_mailfrom'] = $_POST['eventpost_mailfrom'];
|
$pref['eventpost_mailfrom'] = $_POST['eventpost_mailfrom'];
|
||||||
$pref['eventpost_mailaddress'] = $_POST['eventpost_mailaddress'];
|
$pref['eventpost_mailaddress'] = $_POST['eventpost_mailaddress'];
|
||||||
@@ -74,6 +75,8 @@ if (isset($_POST['updateforthcoming']))
|
|||||||
$pref['eventpost_checkrecur'] = $_POST['eventpost_fe_checkrecur'];
|
$pref['eventpost_checkrecur'] = $_POST['eventpost_fe_checkrecur'];
|
||||||
$pref['eventpost_linkheader'] = $_POST['eventpost_fe_linkheader'];
|
$pref['eventpost_linkheader'] = $_POST['eventpost_fe_linkheader'];
|
||||||
$pref['eventpost_fe_set'] = implode(",", $_POST['fe_eventclass']);
|
$pref['eventpost_fe_set'] = implode(",", $_POST['fe_eventclass']);
|
||||||
|
$pref['eventpost_fe_hideifnone'] = $_POST['eventpost_fe_hideifnone'];
|
||||||
|
$pref['eventpost_fe_showrecent'] = $_POST['eventpost_fe_showrecent'];
|
||||||
$pref['eventpost_showcaticon'] = $_POST['eventpost_showcaticon'];
|
$pref['eventpost_showcaticon'] = $_POST['eventpost_showcaticon'];
|
||||||
$pref['eventpost_namelink'] = $_POST['eventpost_namelink'];
|
$pref['eventpost_namelink'] = $_POST['eventpost_namelink'];
|
||||||
save_prefs();
|
save_prefs();
|
||||||
@@ -83,10 +86,11 @@ if (isset($_POST['updateforthcoming']))
|
|||||||
|
|
||||||
if (e_QUERY)
|
if (e_QUERY)
|
||||||
{
|
{
|
||||||
$qs = explode(".", e_QUERY);
|
$ec_qs = explode(".", e_QUERY);
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once('ecal_class.php');
|
require_once('ecal_class.php');
|
||||||
|
global $ecal_class;
|
||||||
$ecal_class = new ecal_class;
|
$ecal_class = new ecal_class;
|
||||||
|
|
||||||
|
|
||||||
@@ -99,8 +103,8 @@ if (isset($_POST['deleteold']) && isset($_POST['eventpost_deleteoldmonths']))
|
|||||||
$old_date = intval(mktime(0,0,0,$ecal_class->now_date['mon']-$back_count,1,$ecal_class->now_date['year']));
|
$old_date = intval(mktime(0,0,0,$ecal_class->now_date['mon']-$back_count,1,$ecal_class->now_date['year']));
|
||||||
$old_string = strftime("%d %B %Y",$old_date);
|
$old_string = strftime("%d %B %Y",$old_date);
|
||||||
// $message = "Back delete {$back_count} months. Oldest date = {$old_string}";
|
// $message = "Back delete {$back_count} months. Oldest date = {$old_string}";
|
||||||
$qs[0] = "confdel";
|
$ec_qs[0] = "confdel";
|
||||||
$qs[1] = $old_date;
|
$ec_qs[1] = $old_date;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
$message = EC_ADLAN_A148;
|
$message = EC_ADLAN_A148;
|
||||||
@@ -109,18 +113,22 @@ if (isset($_POST['deleteold']) && isset($_POST['eventpost_deleteoldmonths']))
|
|||||||
|
|
||||||
if (isset($_POST['cache_clear']))
|
if (isset($_POST['cache_clear']))
|
||||||
{
|
{
|
||||||
$qs[0] = "confcache";
|
$ec_qs[0] = "confcache";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------
|
||||||
|
|
||||||
require_once(e_ADMIN."auth.php");
|
require_once(e_ADMIN."auth.php");
|
||||||
|
|
||||||
|
if (!defined("USER_WIDTH")){ define("USER_WIDTH","width:auto"); }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Actually delete back events
|
// Actually delete back events
|
||||||
if (isset($_POST['confirmdeleteold']) && isset($qs[0]) && ($qs[0] == "backdel"))
|
if (isset($_POST['confirmdeleteold']) && isset($ec_qs[0]) && ($ec_qs[0] == "backdel"))
|
||||||
{
|
{
|
||||||
$old_date = $qs[1];
|
$old_date = $ec_qs[1];
|
||||||
$old_string = strftime("%d %B %Y",$old_date);
|
$old_string = strftime("%d %B %Y",$old_date);
|
||||||
// Check both start and end dates to avoid problems with events originally entered under 0.617
|
// Check both start and end dates to avoid problems with events originally entered under 0.617
|
||||||
$qry = "event_start < {$old_date} AND event_end < {$old_date} AND event_recurring = 0";
|
$qry = "event_start < {$old_date} AND event_end < {$old_date} AND event_recurring = 0";
|
||||||
@@ -128,7 +136,7 @@ if (isset($_POST['confirmdeleteold']) && isset($qs[0]) && ($qs[0] == "backdel"))
|
|||||||
if ($sql -> db_Delete("event",$qry))
|
if ($sql -> db_Delete("event",$qry))
|
||||||
{
|
{
|
||||||
// Add in a log event
|
// Add in a log event
|
||||||
$ecal_class->cal_log(4,'db_Delete - earlier than {$old_string} (past {$back_count} months)',$qry);
|
$ecal_class->cal_log(4,"db_Delete - earlier than {$old_string} (past {$back_count} months)",$qry);
|
||||||
$message = EC_ADLAN_A146.$old_string.EC_ADLAN_A147;
|
$message = EC_ADLAN_A146.$old_string.EC_ADLAN_A147;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -136,25 +144,25 @@ if (isset($_POST['confirmdeleteold']) && isset($qs[0]) && ($qs[0] == "backdel"))
|
|||||||
$message = EC_ADLAN_A149." : ".$sql->mySQLresult;
|
$message = EC_ADLAN_A149." : ".$sql->mySQLresult;
|
||||||
}
|
}
|
||||||
|
|
||||||
$qs[0] = "maint";
|
$ec_qs[0] = "maint";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Actually empty cache
|
// Actually empty cache
|
||||||
if (isset($_POST['confirmdelcache']) && isset($qs[0]) &&($qs[0] == "cachedel"))
|
if (isset($_POST['confirmdelcache']) && isset($ec_qs[0]) &&($ec_qs[0] == "cachedel"))
|
||||||
{
|
{
|
||||||
$e107cache->clear('nq_event_cal');
|
$e107cache->clear('nq_event_cal');
|
||||||
$message = EC_ADLAN_A163;
|
$message = EC_ADLAN_A163;
|
||||||
$qs[0] = "maint"; // Re-display maintenance menu
|
$ec_qs[0] = "maint"; // Re-display maintenance menu
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Prompt to delete back events
|
// Prompt to delete back events
|
||||||
if(isset($qs[0]) && ($qs[0] == "confdel"))
|
if(isset($ec_qs[0]) && ($ec_qs[0] == "confdel"))
|
||||||
{
|
{
|
||||||
$old_string = strftime("%d %B %Y",$qs[1]);
|
$old_string = strftime("%d %B %Y",$ec_qs[1]);
|
||||||
$text = "<div style='text-align:center'>
|
$text = "<div style='text-align:center'>
|
||||||
<form method='post' action='".e_SELF."?backdel.{$qs[1]}'>
|
<form method='post' action='".e_SELF."?backdel.{$ec_qs[1]}'>
|
||||||
<table style='width:97%' class='fborder'>
|
<table style='width:97%' class='fborder'>
|
||||||
<tr>
|
<tr>
|
||||||
<td class='forumheader3' style='width:100%;vertical-align:top;rext-align:center;'>".EC_ADLAN_A150.$old_string." </td>
|
<td class='forumheader3' style='width:100%;vertical-align:top;rext-align:center;'>".EC_ADLAN_A150.$old_string." </td>
|
||||||
@@ -167,7 +175,7 @@ if(isset($qs[0]) && ($qs[0] == "confdel"))
|
|||||||
|
|
||||||
|
|
||||||
// Prompt to clear cache
|
// Prompt to clear cache
|
||||||
if (isset($qs[0]) && ($qs[0] == "confcache"))
|
if (isset($ec_qs[0]) && ($ec_qs[0] == "confcache"))
|
||||||
{
|
{
|
||||||
$text = "<div style='text-align:center'>
|
$text = "<div style='text-align:center'>
|
||||||
<form method='post' action='".e_SELF."?cachedel'>
|
<form method='post' action='".e_SELF."?cachedel'>
|
||||||
@@ -182,16 +190,42 @@ if (isset($qs[0]) && ($qs[0] == "confcache"))
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (isset($message))
|
// Just delete odd email subscriptions
|
||||||
|
if (isset($ec_qs[0]) && isset($ec_qs[2]) && isset($ec_qs[3]) && ($ec_qs[0] == 'subs') && ($ec_qs[2] == 'del') && is_numeric($ec_qs[3]))
|
||||||
{
|
{
|
||||||
$ns->tablerender("", "<div style='text-align:center'><b>$message</b></div>");
|
if ($sql->db_Delete("event_subs","event_subid='{$ec_qs[3]}'"))
|
||||||
|
$message = EC_ADLAN_A180.$ec_qs[3];
|
||||||
|
else
|
||||||
|
$message = EC_ADLAN_A181.$ec_qs[3];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($message) && ($message != ""))
|
||||||
|
{
|
||||||
|
$ns->tablerender("", "<div style='text-align:center'><b>{$message}</b></div>");
|
||||||
|
$message = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//category
|
//category
|
||||||
if(isset($qs[0]) && $qs[0] == "cat")
|
$ecal_sendemail = 0;
|
||||||
|
if(isset($ec_qs[0]) && $ec_qs[0] == "cat")
|
||||||
{
|
{
|
||||||
|
// This uses two hidden fields, preset from the category selection menu:
|
||||||
|
// calendarmenu_action
|
||||||
|
// 'update' - to create or update a record (actually save the info)
|
||||||
|
// 'dothings' - create/edit/delete just triggered - $calendarmenu_do = $_POST['calendarmenu_recdel']; has action 1, 2, 3
|
||||||
|
// calendarmenu_id - the number of the category - zero indicates a new category
|
||||||
|
// We may also have $_POST['send_email_1'] or $_POST['send_email_2'] set to generate a test email as well as doing update/save
|
||||||
|
|
||||||
|
if (is_readable(THEME."ec_mailout_template.php"))
|
||||||
|
{ // Has to be require
|
||||||
|
require(THEME."ec_mailout_template.php");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
require(e_PLUGIN."calendar_menu/ec_mailout_template.php");
|
||||||
|
}
|
||||||
$calendarmenu_db = new DB;
|
$calendarmenu_db = new DB;
|
||||||
$calendarmenu_action = '';
|
$calendarmenu_action = '';
|
||||||
if (isset($_POST['calendarmenu_action'])) $calendarmenu_action = $_POST['calendarmenu_action'];
|
if (isset($_POST['calendarmenu_action'])) $calendarmenu_action = $_POST['calendarmenu_action'];
|
||||||
@@ -201,8 +235,7 @@ if(isset($qs[0]) && $qs[0] == "cat")
|
|||||||
{
|
{
|
||||||
$calendarmenu_id = $_POST['calendarmenu_id'];
|
$calendarmenu_id = $_POST['calendarmenu_id'];
|
||||||
if ($calendarmenu_id == 0)
|
if ($calendarmenu_id == 0)
|
||||||
{
|
{ // New record so add it
|
||||||
// New record so add it
|
|
||||||
// Enumerate fields so it doesn't matter if they're in the wrong order.
|
// Enumerate fields so it doesn't matter if they're in the wrong order.
|
||||||
// db_Insert can take an array of key => value pairs
|
// db_Insert can take an array of key => value pairs
|
||||||
$calendarmenu_args = array (
|
$calendarmenu_args = array (
|
||||||
@@ -220,7 +253,6 @@ if(isset($qs[0]) && $qs[0] == "cat")
|
|||||||
'event_cat_lastupdate' => intval(time()),
|
'event_cat_lastupdate' => intval(time()),
|
||||||
'event_cat_addclass' => intval($_POST['event_cat_addclass'])
|
'event_cat_addclass' => intval($_POST['event_cat_addclass'])
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($calendarmenu_db->db_Insert("event_cat", $calendarmenu_args))
|
if ($calendarmenu_db->db_Insert("event_cat", $calendarmenu_args))
|
||||||
{
|
{
|
||||||
$calendarmenu_msg .= "<tr><td class='forumheader3' colspan='2'><strong>".EC_ADLAN_A26."</strong></td></tr>";
|
$calendarmenu_msg .= "<tr><td class='forumheader3' colspan='2'><strong>".EC_ADLAN_A26."</strong></td></tr>";
|
||||||
@@ -247,14 +279,27 @@ if(isset($qs[0]) && $qs[0] == "cat")
|
|||||||
event_cat_addclass='".intval($_POST['event_cat_addclass'])."',
|
event_cat_addclass='".intval($_POST['event_cat_addclass'])."',
|
||||||
event_cat_lastupdate='".time()."'
|
event_cat_lastupdate='".time()."'
|
||||||
where event_cat_id='$calendarmenu_id'";
|
where event_cat_id='$calendarmenu_id'";
|
||||||
if ($calendarmenu_db->db_Update("event_cat", $calendarmenu_args)){
|
if ($calendarmenu_db->db_Update("event_cat", $calendarmenu_args))
|
||||||
// Changes saved
|
{ // Changes saved
|
||||||
$calendarmenu_msg .= "<tr><td class='forumheader3' colspan='2'><b>".EC_ADLAN_A28."</b></td></tr>";
|
$calendarmenu_msg .= "<tr><td class='forumheader3' colspan='2'><b>".EC_ADLAN_A28."</b></td></tr>";
|
||||||
}else{
|
}
|
||||||
$calendarmenu_msg .= "<tr><td class='forumheader3' colspan='2'><b>".EC_ADLAN_A29."</b></td></tr>";
|
else
|
||||||
|
{
|
||||||
|
$calendarmenu_msg .= "<tr><td class='forumheader3' colspan='2'><b>".EC_ADLAN_A29."</b></td></tr>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Now see if we need to send a test email
|
||||||
|
if (isset($_POST['send_email_1'])) $ecal_send_email = 1;
|
||||||
|
if (isset($_POST['send_email_2'])) $ecal_send_email = 2;
|
||||||
|
if ($ecal_send_email != 0)
|
||||||
|
{
|
||||||
|
$calendarmenu_action = 'dothings'; // This forces us back to category edit screen
|
||||||
|
$_POST['calendarmenu_selcat'] = $calendarmenu_id; // Record number to use
|
||||||
|
$_POST['calendarmenu_recdel'] = '1'; // This forces re-read of the record
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// We are creating, editing or deleting a record
|
// We are creating, editing or deleting a record
|
||||||
if ($calendarmenu_action == 'dothings')
|
if ($calendarmenu_action == 'dothings')
|
||||||
{
|
{
|
||||||
@@ -272,6 +317,39 @@ if(isset($qs[0]) && $qs[0] == "cat")
|
|||||||
extract($calendarmenu_row);
|
extract($calendarmenu_row);
|
||||||
$calendarmenu_cap1 = EC_ADLAN_A24;
|
$calendarmenu_cap1 = EC_ADLAN_A24;
|
||||||
$calendarmenu_edit = TRUE;
|
$calendarmenu_edit = TRUE;
|
||||||
|
if ($ecal_send_email != 0)
|
||||||
|
{ // Need to send a test email
|
||||||
|
// First, set up a dummy event
|
||||||
|
global $thisevent;
|
||||||
|
$thisevent = array('event_start' => $ecal_class->time_now, 'event_end' => ($ecal_class->time_now)+3600,
|
||||||
|
'event_title' => "Test event", 'event_details' => EC_ADLAN_A191,
|
||||||
|
'event_cat_name' => $event_cat_name, 'event_location' => EC_ADLAN_A192,
|
||||||
|
'event_contact' => USEREMAIL,
|
||||||
|
'event_thread' => SITEURL."dodgypage",
|
||||||
|
'event_id' => '6');
|
||||||
|
|
||||||
|
// *************** SEND EMAIL HERE **************
|
||||||
|
require_once(e_PLUGIN."calendar_menu/calendar_shortcodes.php");
|
||||||
|
require_once(e_HANDLER . "mail.php");
|
||||||
|
switch ($ecal_send_email)
|
||||||
|
{
|
||||||
|
case 1 : $cal_msg = $event_cat_msg1;
|
||||||
|
break;
|
||||||
|
case 2 : $cal_msg = $event_cat_msg2;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$cal_msg = $tp -> parseTemplate($cal_msg, FALSE, $calendar_shortcodes);
|
||||||
|
$cal_title = $tp -> parseTemplate($pref['eventpost_mailsubject'], FALSE, $calendar_shortcodes);
|
||||||
|
$user_email = USEREMAIL;
|
||||||
|
$user_name = USERNAME;
|
||||||
|
// $cal_msg = str_replace("\r","\n",$cal_msg);
|
||||||
|
// echo $cal_msg."<br /><br />";
|
||||||
|
$send_result = sendemail($user_email, $cal_title, $cal_msg, $user_name, $pref['eventpost_mailaddress'], $pref['eventpost_mailfrom']);
|
||||||
|
if ($send_result)
|
||||||
|
$calendarmenu_msg .= "<tr><td class='forumheader3' colspan='2'><strong>".EC_ADLAN_A187.$ecal_send_email."</strong></td></tr>";
|
||||||
|
else
|
||||||
|
$calendarmenu_msg .= "<tr><td class='forumheader3' colspan='2'><strong>".EC_ADLAN_A188.$ecal_send_email."</strong></td></tr>";
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case '2': // New category
|
case '2': // New category
|
||||||
@@ -283,22 +361,41 @@ if(isset($qs[0]) && $qs[0] == "cat")
|
|||||||
$calendar_category_description = "";
|
$calendar_category_description = "";
|
||||||
$calendarmenu_cap1 = EC_ADLAN_A23;
|
$calendarmenu_cap1 = EC_ADLAN_A23;
|
||||||
$calendarmenu_edit = TRUE;
|
$calendarmenu_edit = TRUE;
|
||||||
|
$event_cat_name = ''; // Define some variables for notice removal
|
||||||
|
$event_cat_description = '';
|
||||||
|
$event_cat_class = e_UC_MEMBER;
|
||||||
|
$event_cat_addclass = e_UC_ADMIN;
|
||||||
|
$event_cat_icon = '';
|
||||||
|
$event_cat_subs = 0;
|
||||||
|
$event_cat_notify = 0;
|
||||||
|
$event_cat_force_class = '';
|
||||||
|
$event_cat_ahead = 5;
|
||||||
|
$event_cat_msg1 = '';
|
||||||
|
$event_cat_msg2 = '';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case '3':
|
case '3':
|
||||||
{
|
{ // delete the record
|
||||||
// delete the record
|
if ($_POST['calendarmenu_okdel'] == '1')
|
||||||
if ($_POST['calendarmenu_okdel'] == '1'){
|
{
|
||||||
if ($calendarmenu_db->db_Select("event", "event_id", " where event_category='$calendarmenu_id'", "nowhere")){
|
if ($calendarmenu_db->db_Select("event", "event_id", " where event_category='{$calendarmenu_id}'", "nowhere"))
|
||||||
$calendarmenu_msg .= "<tr><td class='forumheader3' colspan='2'><strong>".EC_ADLAN_A59."</strong></td></tr>";
|
{
|
||||||
}else{
|
$calendarmenu_msg .= "<tr><td class='forumheader3' colspan='2'><strong>".EC_ADLAN_A59."</strong></td></tr>";
|
||||||
if ($calendarmenu_db->db_Delete("event_cat", " event_cat_id='$calendarmenu_id'")){
|
}
|
||||||
$calendarmenu_msg .= "<tr><td class='forumheader3' colspan='2'><strong>".EC_ADLAN_A30."</strong></td></tr>";
|
else
|
||||||
}else{
|
{
|
||||||
$calendarmenu_msg .= "<tr><td class='forumheader3' colspan='2'><strong>".EC_ADLAN_A32."</strong></td></tr>";
|
if ($calendarmenu_db->db_Delete("event_cat", " event_cat_id='{$calendarmenu_id}'"))
|
||||||
}
|
{
|
||||||
|
$calendarmenu_msg .= "<tr><td class='forumheader3' colspan='2'><strong>".EC_ADLAN_A30."</strong></td></tr>";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$calendarmenu_msg .= "<tr><td class='forumheader3' colspan='2'><strong>".EC_ADLAN_A32."</strong></td></tr>";
|
||||||
}
|
}
|
||||||
}else{
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
$calendarmenu_msg .= "<tr><td class='forumheader3' colspan='2'><strong>".EC_ADLAN_A31."</strong></td></tr>";
|
$calendarmenu_msg .= "<tr><td class='forumheader3' colspan='2'><strong>".EC_ADLAN_A31."</strong></td></tr>";
|
||||||
}
|
}
|
||||||
$calendarmenu_dodel = TRUE;
|
$calendarmenu_dodel = TRUE;
|
||||||
@@ -310,7 +407,6 @@ if(isset($qs[0]) && $qs[0] == "cat")
|
|||||||
{
|
{
|
||||||
require_once(e_HANDLER."file_class.php");
|
require_once(e_HANDLER."file_class.php");
|
||||||
|
|
||||||
|
|
||||||
$calendarmenu_text .= "
|
$calendarmenu_text .= "
|
||||||
<form id='calformupdate' method='post' action='".e_SELF."?cat'>
|
<form id='calformupdate' method='post' action='".e_SELF."?cat'>
|
||||||
<table style='width:97%;' class='fborder'>
|
<table style='width:97%;' class='fborder'>
|
||||||
@@ -375,17 +471,31 @@ if(isset($qs[0]) && $qs[0] == "cat")
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class='forumheader3' style='width:20%'>".EC_ADLAN_A83."</td>
|
<td class='forumheader3' style='width:20%'>".EC_ADLAN_A83."</td>
|
||||||
<td class='forumheader3'><input type='text' size='4' maxlength='5' class='tbox' name='event_cat_ahead' value='$event_cat_ahead' /></td>
|
<td class='forumheader3'><input type='text' size='4' maxlength='5' class='tbox' name='event_cat_ahead' value='{$event_cat_ahead}' /></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class='forumheader3' style='width:20%;vertical-align:top;'>".EC_ADLAN_A84."</td>
|
<td class='forumheader3' style='width:20%;vertical-align:top;'>".EC_ADLAN_A84;
|
||||||
<td class='forumheader3'><textarea rows='5' cols='80' class='tbox' name='event_cat_msg1' >".$event_cat_msg1."</textarea></td>
|
if ($calendarmenu_do == 1)
|
||||||
|
$calendarmenu_text .= "<br /><br /><br /><input type='submit' name='send_email_1' value='".EC_ADLAN_A186."' class='tbox' />";
|
||||||
|
$calendarmenu_text .= "</td>
|
||||||
|
<td class='forumheader3'><textarea rows='5' cols='80' class='tbox' name='event_cat_msg1' >".$event_cat_msg1."</textarea>";
|
||||||
|
if ($event_cat_name != EC_DEFAULT_CATEGORY)
|
||||||
|
$calendarmenu_text .= "<br /><span class='smalltext'><em>".EC_ADLAN_A189."</em></span>";
|
||||||
|
$calendarmenu_text .= "
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class='forumheader3' style='width:20%;vertical-align:top;'>".EC_ADLAN_A117."</td>
|
<td class='forumheader3' style='width:20%;vertical-align:top;'>".EC_ADLAN_A117;
|
||||||
<td class='forumheader3'><textarea rows='5' cols='80' class='tbox' name='event_cat_msg2' >".$event_cat_msg2."</textarea></td>
|
if ($calendarmenu_do == 1)
|
||||||
|
$calendarmenu_text .= "<br /><br /><br /><input type='submit' name='send_email_2' value='".EC_ADLAN_A186."' class='tbox' />";
|
||||||
|
$calendarmenu_text .= "</td>
|
||||||
|
<td class='forumheader3'><textarea rows='5' cols='80' class='tbox' name='event_cat_msg2' >".$event_cat_msg2."</textarea>";
|
||||||
|
if ($event_cat_name != EC_DEFAULT_CATEGORY)
|
||||||
|
$calendarmenu_text .= "<br /><span class='smalltext'><em>".EC_ADLAN_A189."</em></span>";
|
||||||
|
$calendarmenu_text .= "
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr><td colspan='2' style='text-align:center' class='fcaption'><input type='submit' name='submits' value='".EC_LAN_77."' class='tbox' /></td></tr>
|
<tr><td colspan='2' style='text-align:center' class='fcaption'><input type='submit' name='submits' value='".EC_LAN_77."' class='button' /></td></tr>
|
||||||
</table>
|
</table>
|
||||||
</form>";
|
</form>";
|
||||||
}
|
}
|
||||||
@@ -437,7 +547,7 @@ if(isset($qs[0]) && $qs[0] == "cat")
|
|||||||
}
|
}
|
||||||
if(isset($calendarmenu_text))
|
if(isset($calendarmenu_text))
|
||||||
{
|
{
|
||||||
$ns->tablerender(EC_ADLAN_A19, $calendarmenu_text);
|
$ns->tablerender("<div style='text-align:center'>".EC_ADLAN_1." - ".EC_ADLAN_A19."</div>", $calendarmenu_text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -445,7 +555,7 @@ if(isset($qs[0]) && $qs[0] == "cat")
|
|||||||
// FORTHCOMING EVENTS OPTIONS
|
// FORTHCOMING EVENTS OPTIONS
|
||||||
// ====================================================
|
// ====================================================
|
||||||
|
|
||||||
if((isset($qs[0]) && $qs[0] == "forthcoming"))
|
if((isset($ec_qs[0]) && $ec_qs[0] == "forthcoming"))
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!isset($pref['eventpost_menuheading'])) $pref['eventpost_menuheading'] = EC_ADLAN_A100;
|
if (!isset($pref['eventpost_menuheading'])) $pref['eventpost_menuheading'] = EC_ADLAN_A100;
|
||||||
@@ -478,10 +588,20 @@ if (!isset($pref['eventpost_namelink'])) $pref['eventpost_namelink'] = '1';
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A103."<br /><span class='smalltext'><em>".EC_ADLAN_A107."</em></span></td>
|
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A103."</td>
|
||||||
<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='checkbox' name='eventpost_fe_checkrecur' value='1' ".($pref['eventpost_checkrecur']==1?" checked='checked' ":"")." /></td>
|
<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='checkbox' name='eventpost_fe_checkrecur' value='1' ".($pref['eventpost_checkrecur']==1?" checked='checked' ":"")." /></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A107."</td>
|
||||||
|
<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='checkbox' name='eventpost_fe_hideifnone' value='1' ".($pref['eventpost_fe_hideifnone']==1?" checked='checked' ":"")." /></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A199."</td>
|
||||||
|
<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='checkbox' name='eventpost_fe_showrecent' value='1' ".($pref['eventpost_fe_showrecent']==1?" checked='checked' ":"")." /></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A130."<br /></td>
|
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A130."<br /></td>
|
||||||
<td style='width:60%;vertical-align:top;' class='forumheader3'>
|
<td style='width:60%;vertical-align:top;' class='forumheader3'>
|
||||||
@@ -511,8 +631,8 @@ if (!isset($pref['eventpost_namelink'])) $pref['eventpost_namelink'] = '1';
|
|||||||
// Now display all the current categories as checkboxes
|
// Now display all the current categories as checkboxes
|
||||||
$cal_fe_prefs = array();
|
$cal_fe_prefs = array();
|
||||||
if (isset($pref['eventpost_fe_set'])) $cal_fe_prefs = array_flip(explode(",",$pref['eventpost_fe_set']));
|
if (isset($pref['eventpost_fe_set'])) $cal_fe_prefs = array_flip(explode(",",$pref['eventpost_fe_set']));
|
||||||
if (!is_object($calendarmenu2_db)) $calendarmenu2_db = new DB; // Possible notice here
|
if (!isset($calendarmenu2_db) || !is_object($calendarmenu2_db)) $calendarmenu2_db = new DB; // Possible notice here
|
||||||
if ($calendarmenu2_db->db_Select("event_cat", "event_cat_id,event_cat_name", " order by event_cat_name", "nowhere"))
|
if ($calendarmenu2_db->db_Select("event_cat", "event_cat_id,event_cat_name", " WHERE (event_cat_name != '".EC_DEFAULT_CATEGORY."') order by event_cat_name", "nowhere"))
|
||||||
{
|
{
|
||||||
while ($row = $calendarmenu2_db->db_Fetch())
|
while ($row = $calendarmenu2_db->db_Fetch())
|
||||||
{
|
{
|
||||||
@@ -533,7 +653,7 @@ if (!isset($pref['eventpost_namelink'])) $pref['eventpost_namelink'] = '1';
|
|||||||
</form>
|
</form>
|
||||||
</div>";
|
</div>";
|
||||||
|
|
||||||
$ns->tablerender("<div style='text-align:center'>".EC_ADLAN_A100."</div>", $text);
|
$ns->tablerender("<div style='text-align:center'>".EC_ADLAN_1." - ".EC_ADLAN_A100."</div>", $text);
|
||||||
} // End of Forthcoming Events Menu Options
|
} // End of Forthcoming Events Menu Options
|
||||||
|
|
||||||
|
|
||||||
@@ -541,7 +661,7 @@ if (!isset($pref['eventpost_namelink'])) $pref['eventpost_namelink'] = '1';
|
|||||||
// MAINTENANCE OPTIONS
|
// MAINTENANCE OPTIONS
|
||||||
// ====================================================
|
// ====================================================
|
||||||
|
|
||||||
if((isset($qs[0]) && $qs[0] == "maint"))
|
if((isset($ec_qs[0]) && $ec_qs[0] == "maint"))
|
||||||
{
|
{
|
||||||
$text = "<div style='text-align:center'>
|
$text = "<div style='text-align:center'>
|
||||||
<form method='post' action='".e_SELF."?maint'>
|
<form method='post' action='".e_SELF."?maint'>
|
||||||
@@ -570,7 +690,7 @@ if((isset($qs[0]) && $qs[0] == "maint"))
|
|||||||
<tr><td colspan='2' style='text-align:center' class='fcaption'><input class='button' type='submit' name='deleteold' value='".EC_ADLAN_A145."' /></td></tr>
|
<tr><td colspan='2' style='text-align:center' class='fcaption'><input class='button' type='submit' name='deleteold' value='".EC_ADLAN_A145."' /></td></tr>
|
||||||
</table></form></div><br /><br />";
|
</table></form></div><br /><br />";
|
||||||
|
|
||||||
$ns->tablerender("<div style='text-align:center'>".EC_ADLAN_A144."</div>", $text);
|
$ns->tablerender("<div style='text-align:center'>".EC_ADLAN_1." - ".EC_ADLAN_A141."</div>", $text);
|
||||||
|
|
||||||
$text = "<div style='text-align:center'>
|
$text = "<div style='text-align:center'>
|
||||||
<form method='post' action='".e_SELF."?maint'>
|
<form method='post' action='".e_SELF."?maint'>
|
||||||
@@ -579,36 +699,125 @@ if((isset($qs[0]) && $qs[0] == "maint"))
|
|||||||
<tr><td colspan='2' style='text-align:center' class='fcaption'><input class='button' type='submit' name='cache_clear' value='".EC_ADLAN_A161."' /></td></tr>
|
<tr><td colspan='2' style='text-align:center' class='fcaption'><input class='button' type='submit' name='cache_clear' value='".EC_ADLAN_A161."' /></td></tr>
|
||||||
</table></form></div>";
|
</table></form></div>";
|
||||||
|
|
||||||
$ns->tablerender("<div style='text-align:center'>".EC_ADLAN_A159."</div>", $text);
|
$ns->tablerender("<div style='text-align:center'>".EC_ADLAN_1." - ".EC_ADLAN_A159."</div>", $text);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ====================================================
|
||||||
|
// SUBSCRIPTIONS OPTIONS
|
||||||
|
// ====================================================
|
||||||
|
|
||||||
|
if((isset($ec_qs[0]) && $ec_qs[0] == "subs"))
|
||||||
|
{
|
||||||
|
$from = 0;
|
||||||
|
$amount = 20; // Number per page - could make configurable later if required
|
||||||
|
if (isset($ec_qs[1])) $from = $ec_qs[1];
|
||||||
|
|
||||||
|
$num_entry = $sql->db_Count("event_subs", "(*)", ""); // Just count the lot
|
||||||
|
|
||||||
|
$qry = "SELECT es.*, u.user_id, u.user_name, u.user_class, ec.event_cat_id, ec.event_cat_name, ec.event_cat_class FROM #event_subs AS es
|
||||||
|
LEFT JOIN #user AS u ON es.event_userid = u.user_id
|
||||||
|
LEFT JOIN #event_cat AS ec ON es.event_cat = ec.event_cat_id
|
||||||
|
ORDER BY u.user_id
|
||||||
|
LIMIT {$from}, {$amount} ";
|
||||||
|
|
||||||
|
$text = "<div style='text-align:center'>
|
||||||
|
<form method='post' action='".e_SELF."?subs.".$from."'>
|
||||||
|
<table style='".USER_WIDTH."' class='fborder'>
|
||||||
|
<colgroup>
|
||||||
|
<col style='width:10%; vertical-align:top;' />
|
||||||
|
<col style='width:20%; vertical-align:top;' />
|
||||||
|
<col style='width:30%; vertical-align:top;' />
|
||||||
|
<col style='width:30%; vertical-align:top;' />
|
||||||
|
<col style='width:10%; vertical-align:top;' />
|
||||||
|
</colgroup>";
|
||||||
|
|
||||||
|
if (!$sql->db_Select_gen($qry))
|
||||||
|
{
|
||||||
|
$text .= "<tr><td colspan='5' class='forumheader'>".EC_ADLAN_A174."</td></tr>";
|
||||||
|
$num_entry = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$text .= "<tr><td class='forumheader'>".EC_ADLAN_A175."</td><td class='forumheader'>".EC_ADLAN_A176."</td>
|
||||||
|
<td class='forumheader'>".EC_ADLAN_A177."</td><td class='forumheader'>".EC_ADLAN_A178."</td><td class='forumheader'>".EC_ADLAN_A179."</td></tr>";
|
||||||
|
while ($row = $sql->db_Fetch())
|
||||||
|
{
|
||||||
|
// Columns - UID, User name, Category name, Action
|
||||||
|
$problems = "";
|
||||||
|
if (!isset($row['user_id']) || ($row['user_id'] == 0) || (!isset($row['user_name'])) || ($row['user_name'] == ""))
|
||||||
|
$problems = EC_ADLAN_A198;
|
||||||
|
if (!check_class($row['event_cat_class'],$row['user_class']))
|
||||||
|
{
|
||||||
|
if ($problems != "") $problems .= "<br />";
|
||||||
|
$problems .= EC_ADLAN_A197;
|
||||||
|
}
|
||||||
|
$text .= "
|
||||||
|
<tr>
|
||||||
|
<td class='forumheader3'>".$row['user_id']."</td>
|
||||||
|
<td class='forumheader3'>".$row['user_name']."</td>
|
||||||
|
<td class='forumheader3'>".$row['event_cat_name']."</td>
|
||||||
|
<td class='forumheader3'>".$problems."</td>
|
||||||
|
<td class='forumheader3' style='text_align:center'><a href='".e_SELF."?".$ec_qs[0].".".$from.".del.".$row['event_subid']."'>
|
||||||
|
<img src='".e_IMAGE."admin_images/delete_16.png' alt='".LAN_DELETE."' title='".LAN_DELETE."' /></a></td>
|
||||||
|
</tr>";
|
||||||
|
} // End while
|
||||||
|
|
||||||
|
// Next-Previous. ==========================
|
||||||
|
if ($num_entry > $amount)
|
||||||
|
{
|
||||||
|
$parms = "{$num_entry},{$amount},{$from},".e_SELF."?".$ec_qs[0].".[FROM]";
|
||||||
|
$text .= "<br />".$tp->parseTemplate("{NEXTPREV={$parms}}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$text .= "</table></form></div>";
|
||||||
|
|
||||||
|
$text .= " ".str_replace("--NUM--", $num_entry, EC_ADLAN_A182);
|
||||||
|
|
||||||
|
$ns->tablerender("<div style='text-align:center'>".EC_ADLAN_1." - ".EC_ADLAN_A173."</div>", $text);
|
||||||
|
}
|
||||||
// ========================================================
|
// ========================================================
|
||||||
// MAIN OPTIONS MENU
|
// MAIN OPTIONS MENU
|
||||||
// ========================================================
|
// ========================================================
|
||||||
|
|
||||||
|
|
||||||
if(!isset($qs[0]) || (isset($qs[0]) && $qs[0] == "config")){
|
if(!isset($ec_qs[0]) || (isset($ec_qs[0]) && $ec_qs[0] == "config"))
|
||||||
|
{
|
||||||
|
function select_day_start($val)
|
||||||
|
{
|
||||||
|
if ($val == 'sun') $val = 0; elseif ($val == 'mon') $val = 1; // Legacy values
|
||||||
|
$ret = "<select name='eventpost_weekstart' class='tbox'>\n";
|
||||||
|
$ret .= "<\select>\n";
|
||||||
|
foreach (array(EC_LAN_18,EC_LAN_12,EC_LAN_13,EC_LAN_14,EC_LAN_15,EC_LAN_16,EC_LAN_17) as $k => $v)
|
||||||
|
{
|
||||||
|
$sel = ($val == $k) ? " selected='selected'" : "";
|
||||||
|
$ret .= "<option value='{$k}'{$sel}>{$v}</option>\n";
|
||||||
|
}
|
||||||
|
return $ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$text = "<div style='text-align:center'>
|
$text = "<div style='text-align:center'>
|
||||||
<form method='post' action='".e_SELF."'>
|
<form method='post' action='".e_SELF."'>
|
||||||
<table style='width:97%' class='fborder'>
|
<table style='width:97%' class='fborder'><colgroup>
|
||||||
|
<col style='width:40%;vertical-align:top;' /><col style='width:60%;vertical-align:top;' /></colgroup>
|
||||||
<tr><td style='vertical-align:top;' colspan='2' class='fcaption'>".EC_LAN_78." </td></tr>
|
<tr><td style='vertical-align:top;' colspan='2' class='fcaption'>".EC_LAN_78." </td></tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_LAN_76." </td>
|
<td class='forumheader3'>".EC_LAN_76." </td>
|
||||||
<td style='width:60%;vertical-align:top;' class='forumheader3'>". r_userclass("eventpost_admin", $pref['eventpost_admin'], "off", 'public, nobody, member, admin, classes')."
|
<td class='forumheader3'>". r_userclass("eventpost_admin", $pref['eventpost_admin'], "off", 'public, nobody, member, admin, classes')."
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
";
|
";
|
||||||
$text .= "
|
$text .= "
|
||||||
<tr>
|
<tr>
|
||||||
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_LAN_104." </td>
|
<td class='forumheader3'>".EC_LAN_104." </td>
|
||||||
<td style='width:60%;vertical-align:top;' class='forumheader3'>". r_userclass("eventpost_super", $pref['eventpost_super'], "off", 'public, nobody, member, admin, classes')."
|
<td class='forumheader3'>". r_userclass("eventpost_super", $pref['eventpost_super'], "off", 'public, nobody, member, admin, classes')."
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A134."</td>
|
<td class='forumheader3'>".EC_ADLAN_A134."</td>
|
||||||
<td style='width:60%;vertical-align:top;' class='forumheader3'>
|
<td class='forumheader3'>
|
||||||
<select name='eventpost_adminlog' class='tbox'>
|
<select name='eventpost_adminlog' class='tbox'>
|
||||||
<option value='0' ".($pref['eventpost_adminlog']=='0'?" selected='selected' ":"")." >". EC_ADLAN_A87." </option>
|
<option value='0' ".($pref['eventpost_adminlog']=='0'?" selected='selected' ":"")." >". EC_ADLAN_A87." </option>
|
||||||
<option value='1' ".($pref['eventpost_adminlog']=='1'?" selected='selected' ":"")." >".EC_ADLAN_A135." </option>
|
<option value='1' ".($pref['eventpost_adminlog']=='1'?" selected='selected' ":"")." >".EC_ADLAN_A135." </option>
|
||||||
@@ -619,44 +828,46 @@ $text .= "
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A165."</td>
|
<td class='forumheader3'>".EC_ADLAN_A165."</td>
|
||||||
<td style='width:60%;vertical-align:top;' class='forumheader3'>
|
<td class='forumheader3'>
|
||||||
<select name='eventpost_menulink' class='tbox'>
|
<select name='eventpost_menulink' class='tbox'>
|
||||||
<option value='0' ".($pref['eventpost_menulink']=='0'?" selected='selected' ":"")." >".EC_LAN_80." </option>
|
<option value='0' ".($pref['eventpost_menulink']=='0'?" selected='selected' ":"")." >".EC_LAN_80." </option>
|
||||||
<option value='1' ".($pref['eventpost_menulink']=='1'?" selected='selected' ":"")." >".EC_LAN_83." </option>
|
<option value='1' ".($pref['eventpost_menulink']=='1'?" selected='selected' ":"")." >".EC_LAN_83." </option>
|
||||||
|
<option value='2' ".($pref['eventpost_menulink']=='2'?" selected='selected' ":"")." >".EC_ADLAN_A185." </option>
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A140."</td>
|
<td class='forumheader3'>".EC_ADLAN_A183."</td>
|
||||||
<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='checkbox' name='eventpost_showeventcount' value='1' ".($pref['eventpost_showeventcount']==1?" checked='checked' ":"")." /></td>
|
<td class='forumheader3'><input class='tbox' type='checkbox' name='eventpost_showmouseover' value='1' ".($pref['eventpost_showmouseover']==1?" checked='checked' ":"")." />
|
||||||
|
<span class='smalltext'><em>".EC_ADLAN_A184."</em></span></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_LAN_102."</td>
|
<td class='forumheader3'>".EC_ADLAN_A140."</td>
|
||||||
<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='checkbox' name='eventpost_forum' value='1' ".($pref['eventpost_forum']==1?" checked='checked' ":"")." /></td>
|
<td class='forumheader3'><input class='tbox' type='checkbox' name='eventpost_showeventcount' value='1' ".($pref['eventpost_showeventcount']==1?" checked='checked' ":"")." /></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A171."</td>
|
<td class='forumheader3'>".EC_LAN_102."</td>
|
||||||
<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='text' name='eventpost_recentshow' size='10' value='".$pref['eventpost_recentshow']."' maxlength='5' />
|
<td class='forumheader3'><input class='tbox' type='checkbox' name='eventpost_forum' value='1' ".($pref['eventpost_forum']==1?" checked='checked' ":"")." /></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class='forumheader3'>".EC_ADLAN_A171."</td>
|
||||||
|
<td class='forumheader3'><input class='tbox' type='text' name='eventpost_recentshow' size='10' value='".$pref['eventpost_recentshow']."' maxlength='5' />
|
||||||
<span class='smalltext'><em>".EC_ADLAN_A172."</em></span>
|
<span class='smalltext'><em>".EC_ADLAN_A172."</em></span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_LAN_114."</td>
|
<td class='forumheader3'>".EC_LAN_114."</td>
|
||||||
<td style='width:60%;vertical-align:top;' class='forumheader3'>
|
<td class='forumheader3'>".select_day_start($pref['eventpost_weekstart'])."</td>
|
||||||
<select name='eventpost_weekstart' class='tbox'>
|
|
||||||
<option value='sun' ".($pref['eventpost_weekstart']=='sun'?" selected='selected' ":"")." >".EC_LAN_115."</option>
|
|
||||||
<option value='mon' ".($pref['eventpost_weekstart']=='mon'?" selected='selected' ":"")." >".EC_LAN_116."</option>
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_LAN_117."<br /></td>
|
<td class='forumheader3'>".EC_LAN_117."<br /></td>
|
||||||
<td style='width:60%;vertical-align:top;' class='forumheader3'>
|
<td class='forumheader3'>
|
||||||
<select name='eventpost_lenday' class='tbox'>
|
<select name='eventpost_lenday' class='tbox'>
|
||||||
<option value='1' ".($pref['eventpost_lenday']=='1'?" selected='selected' ":"")." > 1 </option>
|
<option value='1' ".($pref['eventpost_lenday']=='1'?" selected='selected' ":"")." > 1 </option>
|
||||||
<option value='2' ".($pref['eventpost_lenday']=='2'?" selected='selected' ":"")." > 2 </option>
|
<option value='2' ".($pref['eventpost_lenday']=='2'?" selected='selected' ":"")." > 2 </option>
|
||||||
@@ -666,8 +877,8 @@ $text .= "
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_LAN_118."<br /></td>
|
<td class='forumheader3'>".EC_LAN_118."<br /></td>
|
||||||
<td style='width:60%;vertical-align:top;' class='forumheader3'>
|
<td class='forumheader3'>
|
||||||
<select name='eventpost_dateformat' class='tbox'>
|
<select name='eventpost_dateformat' class='tbox'>
|
||||||
<option value='my' ".($pref['eventpost_dateformat']=='my'?" selected='selected' ":"")." >".EC_LAN_119."</option>
|
<option value='my' ".($pref['eventpost_dateformat']=='my'?" selected='selected' ":"")." >".EC_LAN_119."</option>
|
||||||
<option value='ym' ".($pref['eventpost_dateformat']=='ym'?" selected='selected' ":"")." >".EC_LAN_120."</option>
|
<option value='ym' ".($pref['eventpost_dateformat']=='ym'?" selected='selected' ":"")." >".EC_LAN_120."</option>
|
||||||
@@ -676,29 +887,35 @@ $text .= "
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A133."<br /></td>
|
<td class='forumheader3'>".EC_ADLAN_A133."<br /></td>
|
||||||
<td style='width:60%;vertical-align:top;' class='forumheader3'>
|
<td class='forumheader3'>
|
||||||
<select name='eventpost_datedisplay' class='tbox'>
|
<select name='eventpost_datedisplay' class='tbox'>
|
||||||
<option value='1' ".($pref['eventpost_datedisplay']=='1'?" selected='selected' ":"")." > yyyy-mm-dd </option>
|
<option value='1' ".($pref['eventpost_datedisplay']=='1'?" selected='selected' ":"")." > yyyy-mm-dd</option>
|
||||||
<option value='2' ".($pref['eventpost_datedisplay']=='2'?" selected='selected' ":"")." > dd-mm-yyyy</option>
|
<option value='2' ".($pref['eventpost_datedisplay']=='2'?" selected='selected' ":"")." > dd-mm-yyyy</option>
|
||||||
<option value='3' ".($pref['eventpost_datedisplay']=='3'?" selected='selected' ":"")." > mm-dd-yyyy</option>
|
<option value='3' ".($pref['eventpost_datedisplay']=='3'?" selected='selected' ":"")." > mm-dd-yyyy</option>
|
||||||
|
<option value='4' ".($pref['eventpost_datedisplay']=='4'?" selected='selected' ":"")." > yyyy.mm.dd</option>
|
||||||
|
<option value='5' ".($pref['eventpost_datedisplay']=='5'?" selected='selected' ":"")." > dd.mm.yyyy</option>
|
||||||
|
<option value='6' ".($pref['eventpost_datedisplay']=='6'?" selected='selected' ":"")." > mm.dd.yyyy</option>
|
||||||
|
<option value='7' ".($pref['eventpost_datedisplay']=='7'?" selected='selected' ":"")." > yyyy/mm/dd</option>
|
||||||
|
<option value='8' ".($pref['eventpost_datedisplay']=='8'?" selected='selected' ":"")." > dd/mm/yyyy</option>
|
||||||
|
<option value='9' ".($pref['eventpost_datedisplay']=='9'?" selected='selected' ":"")." > mm/dd/yyyy</option>
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A138."</td>
|
<td class='forumheader3'>".EC_ADLAN_A138."</td>
|
||||||
<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='checkbox' name='eventpost_fivemins' value='1' ".($pref['eventpost_fivemins']==1?" checked='checked' ":"")." /> <span class='smalltext'><em>".EC_ADLAN_A139."</em></span>
|
<td class='forumheader3'><input class='tbox' type='checkbox' name='eventpost_fivemins' value='1' ".($pref['eventpost_fivemins']==1?" checked='checked' ":"")." /> <span class='smalltext'><em>".EC_ADLAN_A139."</em></span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A122."<br />
|
<td class='forumheader3'>".EC_ADLAN_A122."<br />
|
||||||
<span class='smalltext'><em>".EC_ADLAN_A124."</em></span>".$ecal_class->time_string($ecal_class->time_now)."<br />
|
<span class='smalltext'><em>".EC_ADLAN_A124."</em></span>".$ecal_class->time_string($ecal_class->time_now)."<br />
|
||||||
<span class='smalltext'><em>".EC_ADLAN_A125."</em></span>".$ecal_class->time_string($ecal_class->site_timedate)."<br />
|
<span class='smalltext'><em>".EC_ADLAN_A125."</em></span>".$ecal_class->time_string($ecal_class->site_timedate)."<br />
|
||||||
<span class='smalltext'><em>".EC_ADLAN_A126."</em></span>".$ecal_class->time_string($ecal_class->user_timedate)."
|
<span class='smalltext'><em>".EC_ADLAN_A126."</em></span>".$ecal_class->time_string($ecal_class->user_timedate)."
|
||||||
</td>
|
</td>
|
||||||
<td style='width:60%;vertical-align:top;' class='forumheader3'>
|
<td class='forumheader3'>
|
||||||
<select name='eventpost_caltime' class='tbox'>
|
<select name='eventpost_caltime' class='tbox'>
|
||||||
<option value='1' ".($pref['eventpost_caltime']=='1'?" selected='selected' ":"")." > Server </option>
|
<option value='1' ".($pref['eventpost_caltime']=='1'?" selected='selected' ":"")." > Server </option>
|
||||||
<option value='2' ".($pref['eventpost_caltime']=='2'?" selected='selected' ":"")." > Site </option>
|
<option value='2' ".($pref['eventpost_caltime']=='2'?" selected='selected' ":"")." > Site </option>
|
||||||
@@ -708,12 +925,13 @@ $text .= "
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A123."<br />
|
<td class='forumheader3'>".EC_ADLAN_A123."<br />
|
||||||
<span class='smalltext'><em>".EC_ADLAN_A127."</em></span>
|
<span class='smalltext'><em>".EC_ADLAN_A127."</em></span>
|
||||||
</td>
|
</td>
|
||||||
<td style='width:60%;vertical-align:top;' class='forumheader3'>
|
<td class='forumheader3'>
|
||||||
<select name='eventpost_timedisplay' class='tbox'>
|
<select name='eventpost_timedisplay' class='tbox'>
|
||||||
<option value='1' ".($pref['eventpost_timedisplay']=='1'?" selected='selected' ":"")." > 24-hour </option>
|
<option value='1' ".($pref['eventpost_timedisplay']=='1'?" selected='selected' ":"")." > 24-hour hhmm </option>
|
||||||
|
<option value='4' ".($pref['eventpost_timedisplay']=='4'?" selected='selected' ":"")." > 24-hour hh:mm </option>
|
||||||
<option value='2' ".($pref['eventpost_timedisplay']=='2'?" selected='selected' ":"")." > 12-hour </option>
|
<option value='2' ".($pref['eventpost_timedisplay']=='2'?" selected='selected' ":"")." > 12-hour </option>
|
||||||
<option value='3' ".($pref['eventpost_timedisplay']=='3'?" selected='selected' ":"")." > Custom </option>
|
<option value='3' ".($pref['eventpost_timedisplay']=='3'?" selected='selected' ":"")." > Custom </option>
|
||||||
</select>
|
</select>
|
||||||
@@ -723,10 +941,10 @@ $text .= "
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A166."<br />
|
<td class='forumheader3'>".EC_ADLAN_A166."<br />
|
||||||
<span class='smalltext'><em>".EC_ADLAN_A169."</em></span>
|
<span class='smalltext'><em>".EC_ADLAN_A169."</em></span>
|
||||||
</td>
|
</td>
|
||||||
<td style='width:60%;vertical-align:top;' class='forumheader3'>
|
<td class='forumheader3'>
|
||||||
<select name='eventpost_dateevent' class='tbox'>
|
<select name='eventpost_dateevent' class='tbox'>
|
||||||
<option value='1' ".($pref['eventpost_dateevent']=='1'?" selected='selected' ":"")." > dayofweek day month yyyy </option>
|
<option value='1' ".($pref['eventpost_dateevent']=='1'?" selected='selected' ":"")." > dayofweek day month yyyy </option>
|
||||||
<option value='2' ".($pref['eventpost_dateevent']=='2'?" selected='selected' ":"")." > dyofwk day mon yyyy </option>
|
<option value='2' ".($pref['eventpost_dateevent']=='2'?" selected='selected' ":"")." > dyofwk day mon yyyy </option>
|
||||||
@@ -739,10 +957,10 @@ $text .= "
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A167."<br />
|
<td class='forumheader3'>".EC_ADLAN_A167."<br />
|
||||||
<span class='smalltext'><em>".EC_ADLAN_A170."</em></span>
|
<span class='smalltext'><em>".EC_ADLAN_A170."</em></span>
|
||||||
</td>
|
</td>
|
||||||
<td style='width:60%;vertical-align:top;' class='forumheader3'>
|
<td class='forumheader3'>
|
||||||
<select name='eventpost_datenext' class='tbox'>
|
<select name='eventpost_datenext' class='tbox'>
|
||||||
<option value='1' ".($pref['eventpost_datenext']=='1'?" selected='selected' ":"")." > dd month </option>
|
<option value='1' ".($pref['eventpost_datenext']=='1'?" selected='selected' ":"")." > dd month </option>
|
||||||
<option value='2' ".($pref['eventpost_datenext']=='2'?" selected='selected' ":"")." > dd mon </option>
|
<option value='2' ".($pref['eventpost_datenext']=='2'?" selected='selected' ":"")." > dd mon </option>
|
||||||
@@ -756,32 +974,43 @@ $text .= "
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A95."</td>
|
<td class='forumheader3'>".EC_ADLAN_A193."<br /></td>
|
||||||
<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='checkbox' name='eventpost_asubs' value='1' ".($pref['eventpost_asubs']==1?" checked='checked' ":"")." /> <span class='smalltext'><em>".EC_ADLAN_A96."</em></span>
|
<td class='forumheader3'>
|
||||||
|
<select name='eventpost_printlists' class='tbox'>
|
||||||
|
<option value='0' ".($pref['eventpost_printlists']=='0'?" selected='selected' ":"")." >". EC_ADLAN_A194." </option>
|
||||||
|
<option value='1' ".($pref['eventpost_printlists']=='1'?" selected='selected' ":"")." >".EC_ADLAN_A195." </option>
|
||||||
|
<option value='2' ".($pref['eventpost_printlists']=='2'?" selected='selected' ":"")." >".EC_ADLAN_A196." </option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class='forumheader3'>".EC_ADLAN_A95."</td>
|
||||||
|
<td class='forumheader3'><input class='tbox' type='checkbox' name='eventpost_asubs' value='1' ".($pref['eventpost_asubs']==1?" checked='checked' ":"")." /> <span class='smalltext'><em>".EC_ADLAN_A96."</em></span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A92."</td>
|
<td class='forumheader3'>".EC_ADLAN_A92."</td>
|
||||||
<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='text' name='eventpost_mailfrom' size='60' value='".$pref['eventpost_mailfrom']."' maxlength='100' />
|
<td class='forumheader3'><input class='tbox' type='text' name='eventpost_mailfrom' size='60' value='".$pref['eventpost_mailfrom']."' maxlength='100' />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A91."</td>
|
<td class='forumheader3'>".EC_ADLAN_A91."</td>
|
||||||
<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='text' name='eventpost_mailsubject' size='60' value='".$pref['eventpost_mailsubject']."' maxlength='100' />
|
<td class='forumheader3'><input class='tbox' type='text' name='eventpost_mailsubject' size='60' value='".$pref['eventpost_mailsubject']."' maxlength='100' />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A93."</td>
|
<td class='forumheader3'>".EC_ADLAN_A93."</td>
|
||||||
<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='text' name='eventpost_mailaddress' size='60' value='".$pref['eventpost_mailaddress']."' maxlength='100' />
|
<td class='forumheader3'><input class='tbox' type='text' name='eventpost_mailaddress' size='60' value='".$pref['eventpost_mailaddress']."' maxlength='100' />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A114."<br /></td>
|
<td class='forumheader3'>".EC_ADLAN_A114."<br /></td>
|
||||||
<td style='width:60%;vertical-align:top;' class='forumheader3'>
|
<td class='forumheader3'>
|
||||||
<select name='eventpost_emaillog' class='tbox'>
|
<select name='eventpost_emaillog' class='tbox'>
|
||||||
<option value='0' ".($pref['eventpost_emaillog']=='0'?" selected='selected' ":"")." >". EC_ADLAN_A87." </option>
|
<option value='0' ".($pref['eventpost_emaillog']=='0'?" selected='selected' ":"")." >". EC_ADLAN_A87." </option>
|
||||||
<option value='1' ".($pref['eventpost_emaillog']=='1'?" selected='selected' ":"")." >".EC_ADLAN_A115." </option>
|
<option value='1' ".($pref['eventpost_emaillog']=='1'?" selected='selected' ":"")." >".EC_ADLAN_A115." </option>
|
||||||
@@ -795,7 +1024,7 @@ $text .= "
|
|||||||
</form>
|
</form>
|
||||||
</div>";
|
</div>";
|
||||||
|
|
||||||
$ns->tablerender("<div style='text-align:center'>".EC_LAN_78."</div>", $text);
|
$ns->tablerender("<div style='text-align:center'>".EC_ADLAN_1." - ".EC_LAN_78."</div>", $text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -821,6 +1050,9 @@ function admin_config_adminmenu()
|
|||||||
$var['maint']['text'] = EC_ADLAN_A141;
|
$var['maint']['text'] = EC_ADLAN_A141;
|
||||||
$var['maint']['link'] ="admin_config.php?maint";
|
$var['maint']['link'] ="admin_config.php?maint";
|
||||||
|
|
||||||
|
$var['subs']['text'] = EC_ADLAN_A173;
|
||||||
|
$var['subs']['link'] ="admin_config.php?subs";
|
||||||
|
|
||||||
show_admin_menu(EC_ADLAN_A12, $action, $var);
|
show_admin_menu(EC_ADLAN_A12, $action, $var);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -11,17 +11,16 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/calendar.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/calendar.php,v $
|
||||||
| $Revision: 1.1.1.1 $
|
| $Revision: 1.2 $
|
||||||
| $Date: 2006-12-02 04:34:46 $
|
| $Date: 2007-07-13 19:37:52 $
|
||||||
| $Author: mcfly_e107 $
|
| $Author: e107steved $
|
||||||
|
|
|
||||||
| 11.11.06 - steved - mods for next CVS release
|
|
||||||
|
|
|
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
require_once("../../class2.php");
|
require_once("../../class2.php");
|
||||||
|
if (!isset($pref['plug_installed']['calendar_menu'])) header("Location: ".e_BASE."index.php");
|
||||||
require_once(e_PLUGIN."calendar_menu/calendar_shortcodes.php");
|
require_once(e_PLUGIN."calendar_menu/calendar_shortcodes.php");
|
||||||
if (isset($_POST['viewallevents']))
|
if (isset($_POST['viewallevents']))
|
||||||
{
|
{
|
||||||
@@ -35,8 +34,12 @@ if (isset($_POST['subs']))
|
|||||||
{
|
{
|
||||||
Header("Location: " . e_PLUGIN . "calendar_menu/subscribe.php");
|
Header("Location: " . e_PLUGIN . "calendar_menu/subscribe.php");
|
||||||
}
|
}
|
||||||
|
if (isset($_POST['printlists']))
|
||||||
|
{
|
||||||
|
Header("Location: " . e_PLUGIN . "calendar_menu/ec_pf_page.php");
|
||||||
|
}
|
||||||
|
|
||||||
@include_lan(e_PLUGIN."calendar_menu/languages/".e_LANGUAGE.".php");
|
include_lan(e_PLUGIN."calendar_menu/languages/".e_LANGUAGE.".php");
|
||||||
define("PAGE_NAME", EC_LAN_121);
|
define("PAGE_NAME", EC_LAN_121);
|
||||||
|
|
||||||
require_once('ecal_class.php');
|
require_once('ecal_class.php');
|
||||||
@@ -51,21 +54,14 @@ else
|
|||||||
require(e_PLUGIN."calendar_menu/calendar_template.php");
|
require(e_PLUGIN."calendar_menu/calendar_template.php");
|
||||||
}
|
}
|
||||||
|
|
||||||
$num = (isset($_POST['num']) && $_POST['num'] ? $_POST['num'] : "");
|
|
||||||
|
|
||||||
|
|
||||||
$category_filter = "";
|
|
||||||
if ((isset($_POST['event_cat_ids']) && $_POST['event_cat_ids'] != "all"))
|
|
||||||
{
|
|
||||||
$category_filter = " AND (e.event_category = '".$_POST['event_cat_ids']."') ";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
$cat_filter = intval(varset($_POST['event_cat_ids'],0));
|
||||||
|
|
||||||
require_once(HEADERF);
|
require_once(HEADERF);
|
||||||
|
|
||||||
// get current date information ---------------------------------------------------------------------
|
// get date within area to display
|
||||||
$qs = explode(".", e_QUERY);
|
$qs = explode(".", e_QUERY);
|
||||||
if($qs[0] == "")
|
if(varset($qs[0],'') == "")
|
||||||
{ // Show current month
|
{ // Show current month
|
||||||
$datearray = $ecal_class->cal_date;
|
$datearray = $ecal_class->cal_date;
|
||||||
}
|
}
|
||||||
@@ -73,52 +69,51 @@ else
|
|||||||
{ // Get date from query
|
{ // Get date from query
|
||||||
$datearray = getdate($qs[0]);
|
$datearray = getdate($qs[0]);
|
||||||
}
|
}
|
||||||
$month = $datearray['mon'];
|
|
||||||
$year = $datearray['year'];
|
// Note: A lot of the following variables are used within the shortcodes
|
||||||
|
$month = $datearray['mon']; // Number of month being shown
|
||||||
|
$year = $datearray['year']; // Number of year being shown
|
||||||
|
$monthstart = mktime(0, 0, 0, $month, 1, $year); // Start of month to be shown
|
||||||
|
$monthend = mktime(0, 0, 0, $month + 1, 1, $year) - 1; // End of month to be shown
|
||||||
|
$prevmonth = $month-1;
|
||||||
|
$prevyear = $year;
|
||||||
|
if ($prevmonth == 0)
|
||||||
|
{
|
||||||
|
$prevmonth = 12;
|
||||||
|
$prevyear = $year-1;
|
||||||
|
}
|
||||||
|
$previous = mktime(0, 0, 0, $prevmonth, 1, $prevyear); // Used by nav
|
||||||
|
|
||||||
|
$nextmonth = $month + 1;
|
||||||
|
$nextyear = $year;
|
||||||
|
if ($nextmonth == 13)
|
||||||
|
{
|
||||||
|
$nextmonth = 1;
|
||||||
|
$nextyear = $year + 1;
|
||||||
|
}
|
||||||
|
$next = mktime(0, 0, 0, $nextmonth, 1, $nextyear);
|
||||||
|
$py = $year-1; // Number of previous year for nav
|
||||||
|
$prevlink = mktime(0, 0, 0, $month, 1, $py);
|
||||||
|
$ny = $year + 1; // Number of next year for nav
|
||||||
|
$nextlink = mktime(0, 0, 0, $month, 1, $ny);
|
||||||
|
|
||||||
|
$prop = gmmktime(0, 0, 0, $month, 1, $year); // Sets start date for new event entry
|
||||||
|
$nowmonth = $ecal_class->cal_date['mon'];
|
||||||
|
$nowyear = $ecal_class->cal_date['year'];
|
||||||
|
$nowday = $ecal_class->cal_date['mday'];
|
||||||
|
|
||||||
|
|
||||||
// set up arrays for calender display ------------------------------------------------------------------
|
// set up arrays for calendar display ------------------------------------------------------------------
|
||||||
if($pref['eventpost_weekstart'] == 'sun') {
|
// $months is used in the navigator buttons. $monthabb is used for month list
|
||||||
$week = Array(EC_LAN_25, EC_LAN_19, EC_LAN_20, EC_LAN_21, EC_LAN_22, EC_LAN_23, EC_LAN_24);
|
|
||||||
} else {
|
|
||||||
$week = Array(EC_LAN_19, EC_LAN_20, EC_LAN_21, EC_LAN_22, EC_LAN_23, EC_LAN_24, EC_LAN_25);
|
|
||||||
}
|
|
||||||
$months = Array(EC_LAN_0, EC_LAN_1, EC_LAN_2, EC_LAN_3, EC_LAN_4, EC_LAN_5, EC_LAN_6, EC_LAN_7, EC_LAN_8, EC_LAN_9, EC_LAN_10, EC_LAN_11);
|
$months = Array(EC_LAN_0, EC_LAN_1, EC_LAN_2, EC_LAN_3, EC_LAN_4, EC_LAN_5, EC_LAN_6, EC_LAN_7, EC_LAN_8, EC_LAN_9, EC_LAN_10, EC_LAN_11);
|
||||||
$monthabb = Array(EC_LAN_JAN, EC_LAN_FEB, EC_LAN_MAR, EC_LAN_APR, EC_LAN_MAY, EC_LAN_JUN, EC_LAN_JUL, EC_LAN_AUG, EC_LAN_SEP, EC_LAN_OCT, EC_LAN_NOV, EC_LAN_DEC);
|
$monthabb = Array(EC_LAN_JAN, EC_LAN_FEB, EC_LAN_MAR, EC_LAN_APR, EC_LAN_MAY, EC_LAN_JUN, EC_LAN_JUL, EC_LAN_AUG, EC_LAN_SEP, EC_LAN_OCT, EC_LAN_NOV, EC_LAN_DEC);
|
||||||
|
|
||||||
$days = array(EC_LAN_DAY_1, EC_LAN_DAY_2, EC_LAN_DAY_3, EC_LAN_DAY_4, EC_LAN_DAY_5, EC_LAN_DAY_6, EC_LAN_DAY_7, EC_LAN_DAY_8, EC_LAN_DAY_9, EC_LAN_DAY_10, EC_LAN_DAY_11, EC_LAN_DAY_12, EC_LAN_DAY_13, EC_LAN_DAY_14, EC_LAN_DAY_15, EC_LAN_DAY_16, EC_LAN_DAY_17, EC_LAN_DAY_18, EC_LAN_DAY_19, EC_LAN_DAY_20, EC_LAN_DAY_21, EC_LAN_DAY_22, EC_LAN_DAY_23, EC_LAN_DAY_24, EC_LAN_DAY_25, EC_LAN_DAY_26, EC_LAN_DAY_27, EC_LAN_DAY_28, EC_LAN_DAY_29, EC_LAN_DAY_30, EC_LAN_DAY_31);
|
$days = array(EC_LAN_DAY_1, EC_LAN_DAY_2, EC_LAN_DAY_3, EC_LAN_DAY_4, EC_LAN_DAY_5, EC_LAN_DAY_6, EC_LAN_DAY_7, EC_LAN_DAY_8, EC_LAN_DAY_9, EC_LAN_DAY_10, EC_LAN_DAY_11, EC_LAN_DAY_12, EC_LAN_DAY_13, EC_LAN_DAY_14, EC_LAN_DAY_15, EC_LAN_DAY_16, EC_LAN_DAY_17, EC_LAN_DAY_18, EC_LAN_DAY_19, EC_LAN_DAY_20, EC_LAN_DAY_21, EC_LAN_DAY_22, EC_LAN_DAY_23, EC_LAN_DAY_24, EC_LAN_DAY_25, EC_LAN_DAY_26, EC_LAN_DAY_27, EC_LAN_DAY_28, EC_LAN_DAY_29, EC_LAN_DAY_30, EC_LAN_DAY_31);
|
||||||
|
|
||||||
// show events-------------------------------------------------------------------------------------------
|
|
||||||
$monthstart = mktime(0, 0, 0, $month, 1, $year); // Start of month to be shown
|
|
||||||
$firstdayarray = getdate($monthstart);
|
|
||||||
$monthend = mktime(0, 0, 0, $month + 1, 1, $year) - 1; // End of month to be shown
|
|
||||||
|
|
||||||
$prevmonth = ($month-1);
|
//-------------------------------------------------
|
||||||
$prevyear = $year;
|
// Start calculating text to display
|
||||||
if ($prevmonth == 0)
|
//-------------------------------------------------
|
||||||
{
|
|
||||||
$prevmonth = 12;
|
|
||||||
$prevyear = ($year-1);
|
|
||||||
}
|
|
||||||
$previous = mktime(0, 0, 0, $prevmonth, 1, $prevyear); // Used by nav
|
|
||||||
|
|
||||||
$nextmonth = ($month + 1);
|
|
||||||
$nextyear = $year;
|
|
||||||
if ($nextmonth == 13)
|
|
||||||
{
|
|
||||||
$nextmonth = 1;
|
|
||||||
$nextyear = ($year + 1);
|
|
||||||
}
|
|
||||||
$next = mktime(0, 0, 0, $nextmonth, 1, $nextyear);
|
|
||||||
$py = $year-1;
|
|
||||||
$prevlink = mktime(0, 0, 0, $month, 1, $py);
|
|
||||||
$ny = $year + 1;
|
|
||||||
$nextlink = mktime(0, 0, 0, $month, 1, $ny);
|
|
||||||
|
|
||||||
$prop = mktime(0, 0, 0, $month, 1, $year); // Sets start date for new event entry
|
|
||||||
$nowmonth = $ecal_class->cal_date['mon'];
|
|
||||||
$nowyear = $ecal_class->cal_date['year'];
|
|
||||||
$nowday = $ecal_class->cal_date['mday'];
|
|
||||||
|
|
||||||
// time switch buttons
|
// time switch buttons
|
||||||
$cal_text = $tp -> parseTemplate($CALENDAR_TIME_TABLE, FALSE, $calendar_shortcodes);
|
$cal_text = $tp -> parseTemplate($CALENDAR_TIME_TABLE, FALSE, $calendar_shortcodes);
|
||||||
@@ -126,86 +121,59 @@ $cal_text = $tp -> parseTemplate($CALENDAR_TIME_TABLE, FALSE, $calendar_shortcod
|
|||||||
// navigation buttons
|
// navigation buttons
|
||||||
$nav_text = $tp -> parseTemplate($CALENDAR_NAVIGATION_TABLE, FALSE, $calendar_shortcodes);
|
$nav_text = $tp -> parseTemplate($CALENDAR_NAVIGATION_TABLE, FALSE, $calendar_shortcodes);
|
||||||
|
|
||||||
// get events from selected
|
// We'll need virtually all of the event-related fields, so get them regardless. Just cut back on category fields
|
||||||
$qry = "SELECT e.*, ec.*
|
$ev_list = $ecal_class->get_events($monthstart, $monthend, FALSE, $cat_filter, TRUE, '*', 'event_cat_name,event_cat_icon');
|
||||||
FROM #event as e
|
|
||||||
LEFT JOIN #event_cat as ec ON e.event_category = ec.event_cat_id
|
|
||||||
WHERE e.event_id != ''
|
|
||||||
AND ((e.event_start >= ".intval($monthstart)." AND e.event_start <= ".intval($monthend).")
|
|
||||||
OR (e.event_end >= ".intval($monthstart)." AND e.event_end <= ".intval($monthend).")
|
|
||||||
OR (e.event_start <= ".intval($monthstart)." AND e.event_end >= ".intval($monthend).")
|
|
||||||
OR (e.event_recurring = '1' AND e.event_rec_y = ".intval($month).")) {$category_filter}
|
|
||||||
{$ecal_class->extra_query}
|
|
||||||
ORDER BY e.event_start";
|
|
||||||
|
|
||||||
if ($sql->db_Select_gen($qry))
|
// We create an array $events[] which has a 'primary' index of each day of the current month - 1..31 potentially
|
||||||
{
|
// For each day there is then a sub-array entry for each event
|
||||||
while ($row = $sql->db_Fetch())
|
// Note that the new class-based retrieval adds an 'is_recent' flag to the data if changed according to the configured criteria
|
||||||
|
$events = array();
|
||||||
|
foreach ($ev_list as $row)
|
||||||
{
|
{
|
||||||
// check for recurring events in this month
|
$row['startofevent'] = TRUE; // This sets 'large print' and so on for the first day of an event
|
||||||
if($row['event_recurring']=='1')
|
|
||||||
|
// check for recurring events in this month (could also use is_array($row['event_start']) as a test)
|
||||||
|
if($row['event_recurring'] != '0')
|
||||||
|
{ // There could be several dates for the same event, if its a daily/weekly event
|
||||||
|
$t_start = $row['event_start'];
|
||||||
|
foreach ($t_start as $ev_start)
|
||||||
{
|
{
|
||||||
if ($month == $row['event_rec_y'])
|
// Need to save event, copy marker for date
|
||||||
{ // Change it into an event that happens today
|
$row['event_start'] = $ev_start;
|
||||||
$row['event_start'] = mktime(0,0,0,$row['event_rec_y'],$row['event_rec_m'],$year);
|
$events[date('j',$ev_start)][] = $row;
|
||||||
$row['event_end'] = $row['event_start'];
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // Effectively create a null event
|
{ // Its a 'normal' event
|
||||||
$row['event_start'] = 0;
|
$tmp = date('j',$row['event_start']); // Day of month for start
|
||||||
$row['event_end'] = 0;
|
$tmp2 = date('j',$row['event_end']); // Day of month for end
|
||||||
|
|
||||||
|
if(($row['event_start']>=$monthstart) && ($row['event_start']<=$monthend))
|
||||||
|
{ // Start within month
|
||||||
|
$events[$tmp][] = $row;
|
||||||
|
$tmp++;
|
||||||
|
if ($row['event_end']>$monthend)
|
||||||
|
{ // End outside month
|
||||||
|
$tmp2 = date("t", $monthstart); // number of days in this month
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
$evf = getdate($row['event_start']);
|
{ // Start before month
|
||||||
$tmp = $evf['mday']; // Day of month for start
|
$tmp = 1;
|
||||||
$eve = getdate($row['event_end']);
|
if ($row['event_end']>$monthend)
|
||||||
$tmp2 = $eve['mday']; // Day of month for end
|
{ // End outside month
|
||||||
$tmp3 = date("t", $monthstart); // number of days in this month
|
$tmp2 = date("t", $monthstart); // number of days in this month
|
||||||
if ((($ecal_class->max_recent_show != 0) && (time() - $row['event_datestamp']) <= $ecal_class->max_recent_show)) $row['is_recent'] = TRUE;
|
}
|
||||||
|
|
||||||
//1) start in month, end in month
|
|
||||||
if(($row['event_start']>=$monthstart && $row['event_start']<=$monthend) && $row['event_end']<=$monthend)
|
|
||||||
{
|
|
||||||
$events[$tmp][] = $row;
|
|
||||||
for ($c=($tmp+1); $c<($tmp2+1); $c++)
|
|
||||||
{
|
|
||||||
$row['event_true_end'][$c] = ($c!=$tmp2 ? 1 : 2);
|
|
||||||
$events[$c][] = $row;
|
|
||||||
}
|
|
||||||
|
|
||||||
//2) start in month, end after month
|
|
||||||
}
|
}
|
||||||
elseif(($row['event_start']>=$monthstart && $row['event_start']<=$monthend) && $row['event_end']>=$monthend)
|
// Now put in markers for all 'non-start' days within current month
|
||||||
|
$row['startofevent'] = FALSE;
|
||||||
|
for ($c= $tmp; $c<=$tmp2; $c++)
|
||||||
{
|
{
|
||||||
$events[$tmp][] = $row;
|
$events[$c][] = $row;
|
||||||
for ($c=($tmp+1); $c<=$tmp3; $c++)
|
|
||||||
{
|
|
||||||
$row['event_true_end'][$c] = 1;
|
|
||||||
$events[$c][] = $row;
|
|
||||||
}
|
|
||||||
|
|
||||||
//3) start before month, end in month
|
|
||||||
}
|
|
||||||
elseif($row['event_start']<=$monthstart && ($row['event_end']>=$monthstart && $row['event_end']<=$monthend))
|
|
||||||
{
|
|
||||||
for ($c=1; $c<=$tmp2; $c++)
|
|
||||||
{
|
|
||||||
$row['event_true_end'][$c] = ($c!=$tmp2 ? 1 : 2);
|
|
||||||
$events[$c][] = $row;
|
|
||||||
}
|
|
||||||
|
|
||||||
//4) start before month, end after month
|
|
||||||
}
|
|
||||||
elseif($row['event_start']<=$monthstart && $row['event_end']>=$monthend)
|
|
||||||
{
|
|
||||||
for ($c=1; $c<=$tmp3; $c++){
|
|
||||||
$row['event_true_end'][$c] = 1;
|
|
||||||
$events[$c][] = $row;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ****** CAUTION - the category dropdown also used $sql object - take care to avoid interference!
|
// ****** CAUTION - the category dropdown also used $sql object - take care to avoid interference!
|
||||||
@@ -216,103 +184,93 @@ $numberdays = date("t", $start); // number of days in this month
|
|||||||
$text = "";
|
$text = "";
|
||||||
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_START, FALSE, $calendar_shortcodes);
|
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_START, FALSE, $calendar_shortcodes);
|
||||||
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_HEADER_START, FALSE, $calendar_shortcodes);
|
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_HEADER_START, FALSE, $calendar_shortcodes);
|
||||||
foreach($week as $day)
|
|
||||||
|
for ($i = 0; $i < 7; $i++)
|
||||||
{
|
{
|
||||||
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_HEADER, FALSE, $calendar_shortcodes);
|
$day = $ecal_class->day_offset_string($i);
|
||||||
|
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_HEADER, FALSE, $calendar_shortcodes);
|
||||||
}
|
}
|
||||||
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_HEADER_END, FALSE, $calendar_shortcodes);
|
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_HEADER_END, FALSE, $calendar_shortcodes);
|
||||||
|
|
||||||
$calmonth = $datearray['mon'];
|
|
||||||
$calday = $datearray['mday'];
|
|
||||||
$calyear = $datearray['year'];
|
|
||||||
|
|
||||||
if ($pref['eventpost_weekstart'] == 'mon')
|
// Calculate number of days to skip before 'real' days on first line of calendar
|
||||||
{
|
$firstdayoffset = date('w',$start) - $ecal_class->ec_first_day_of_week;
|
||||||
$firstdayoffset = ($firstdayarray['wday'] == 0 ? $firstdayarray['wday']+6 : $firstdayarray['wday']-1);
|
if ($firstdayoffset < 0) $firstdayoffset+= 7;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$firstdayoffset = $firstdayarray['wday'] ;
|
|
||||||
}
|
|
||||||
for ($c=0; $c<$firstdayoffset; $c++)
|
for ($c=0; $c<$firstdayoffset; $c++)
|
||||||
{
|
{
|
||||||
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_DAY_NON, FALSE, $calendar_shortcodes);
|
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_DAY_NON, FALSE, $calendar_shortcodes);
|
||||||
}
|
}
|
||||||
|
|
||||||
$loop = $firstdayoffset;
|
$loop = $firstdayoffset;
|
||||||
|
|
||||||
for ($c = 1; $c <= $numberdays; $c++)
|
for ($c = 1; $c <= $numberdays; $c++)
|
||||||
{
|
{ // Loop through the number of days in this month
|
||||||
$dayarray = getdate($start + (($c-1) * 86400));
|
$startt = $start; // Used by shortcodes - start of current day
|
||||||
$stopp = mktime(24, 0, 0, $calmonth, $c, $calyear);
|
$stopp = $start + 86399; // End of current day
|
||||||
$startt = mktime(0, 0, 0, $calmonth, $c, $calyear);
|
$got_ev = array_key_exists($c, $events) && is_array($events[$c]) && count($events[$c]) > 0; // Flag set if events today
|
||||||
|
|
||||||
// Highlight the current day.
|
// Highlight the current day.
|
||||||
if ($dayarray['mon'] == $calmonth)
|
if ($nowday == $c && $month == $nowmonth && $year == $nowyear)
|
||||||
{
|
{ //today
|
||||||
if ($nowday == $c && $calmonth == $nowmonth && $calyear == $nowyear)
|
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_DAY_TODAY, FALSE, $calendar_shortcodes);
|
||||||
{
|
}
|
||||||
//today
|
elseif ($got_ev)
|
||||||
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_DAY_TODAY, FALSE, $calendar_shortcodes);
|
{ //day has events
|
||||||
}
|
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_DAY_EVENT, FALSE, $calendar_shortcodes);
|
||||||
elseif(isset($events[$c]) && is_array($events[$c]) && !empty($events[$c]) && count($events[$c]) > 0)
|
|
||||||
{
|
|
||||||
//day has events
|
|
||||||
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_DAY_EVENT, FALSE, $calendar_shortcodes);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// no events and not today
|
|
||||||
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_DAY_EMPTY, FALSE, $calendar_shortcodes);
|
|
||||||
}
|
|
||||||
// if there are events then list them
|
|
||||||
if (array_key_exists($c, $events))
|
|
||||||
{
|
|
||||||
foreach($events[$c] as $ev)
|
|
||||||
{
|
|
||||||
//if ($event_true_end[$c][$a]){
|
|
||||||
if(isset($ev['event_true_end']) && $ev['event_true_end'])
|
|
||||||
{
|
|
||||||
//$ev['indicat'] = ($ev['event_true_end']==1 ? "->" : "|");
|
|
||||||
$ev['indicat'] = "";
|
|
||||||
$ev['imagesize'] = "4";
|
|
||||||
$ev['fulltopic'] = FALSE;
|
|
||||||
$ev['startofevent'] = FALSE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$ev['indicat'] = "";
|
|
||||||
$ev['imagesize'] = "8";
|
|
||||||
$ev['fulltopic'] = TRUE;
|
|
||||||
$ev['startofevent'] = TRUE;
|
|
||||||
}
|
|
||||||
$text .= $tp -> parseTemplate($CALENDAR_SHOWEVENT, FALSE, $calendar_shortcodes);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_DAY_END, FALSE, $calendar_shortcodes);
|
|
||||||
}
|
}
|
||||||
$loop++;
|
else
|
||||||
if ($loop == 7)
|
{ // no events and not today
|
||||||
{
|
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_DAY_EMPTY, FALSE, $calendar_shortcodes);
|
||||||
$loop = 0;
|
|
||||||
if($c != $numberdays)
|
|
||||||
{
|
|
||||||
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_WEEKSWITCH, FALSE, $calendar_shortcodes);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if ($got_ev)
|
||||||
|
{
|
||||||
|
foreach($events[$c] as $ev)
|
||||||
|
{
|
||||||
|
if ($ev['startofevent'])
|
||||||
|
{
|
||||||
|
$ev['indicat'] = "";
|
||||||
|
$ev['imagesize'] = "8";
|
||||||
|
$ev['fulltopic'] = TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$ev['indicat'] = "";
|
||||||
|
$ev['imagesize'] = "4";
|
||||||
|
$ev['fulltopic'] = FALSE;
|
||||||
|
}
|
||||||
|
$text .= $tp -> parseTemplate($CALENDAR_SHOWEVENT, FALSE, $calendar_shortcodes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_DAY_END, FALSE, $calendar_shortcodes);
|
||||||
|
|
||||||
|
$loop++;
|
||||||
|
if ($loop == 7)
|
||||||
|
{
|
||||||
|
$loop = 0;
|
||||||
|
if($c != $numberdays)
|
||||||
|
{
|
||||||
|
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_WEEKSWITCH, FALSE, $calendar_shortcodes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$start += 86400;
|
||||||
}
|
}
|
||||||
|
|
||||||
//remainder cells to end the row properly with empty cells
|
//remainder cells to end the row properly with empty cells
|
||||||
if($loop!=0)
|
if($loop!=0)
|
||||||
{
|
{
|
||||||
$remainder = 7-$loop;
|
for ($c=$loop; $c<7; $c++)
|
||||||
for ($c=0; $c<$remainder; $c++)
|
{
|
||||||
{
|
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_DAY_NON, FALSE, $calendar_shortcodes);
|
||||||
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_DAY_NON, FALSE, $calendar_shortcodes);
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_END, FALSE, $calendar_shortcodes);
|
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_END, FALSE, $calendar_shortcodes);
|
||||||
|
|
||||||
$caption = EC_LAN_79; // "Calendar View";
|
$ns->tablerender(EC_LAN_79, $cal_text . $nav_text . $text);
|
||||||
$nav = $cal_text . $nav_text . $text;
|
|
||||||
$ns->tablerender($caption, $nav);
|
// Claim back memory from key variables
|
||||||
|
unset($ev_list);
|
||||||
|
unset($text);
|
||||||
|
|
||||||
require_once(FOOTERF);
|
require_once(FOOTERF);
|
||||||
|
|
||||||
|
@@ -11,128 +11,82 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/calendar_menu.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/calendar_menu.php,v $
|
||||||
| $Revision: 1.1.1.1 $
|
| $Revision: 1.2 $
|
||||||
| $Date: 2006-12-02 04:34:46 $
|
| $Date: 2007-07-13 19:37:52 $
|
||||||
| $Author: mcfly_e107 $
|
| $Author: e107steved $
|
||||||
|
|
|
|
||||||
| 22.10.06 steved - Various tidying up, additional options supported
|
|
||||||
| 24.10.06 steved - templated, various cleaning up
|
|
||||||
| 06.11.06 steved - template file integrated with other calendar files
|
|
||||||
| 09.11.06 steved - Caching added, other mods to templates etc
|
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
$ecal_dir = e_PLUGIN . "calendar_menu/";
|
$ecal_dir = e_PLUGIN . "calendar_menu/";
|
||||||
require_once($ecal_dir.'ecal_class.php');
|
require_once($ecal_dir.'ecal_class.php');
|
||||||
$ecal_class = new ecal_class;
|
if (!isset($ecal_class) || !is_object($ecal_class)) $ecal_class = new ecal_class;
|
||||||
|
|
||||||
$cache_tag = "nq_event_cal_cal";
|
$cache_tag = "nq_event_cal_cal";
|
||||||
|
|
||||||
|
|
||||||
// See if the page is already in the cache
|
// See if the page is already in the cache
|
||||||
if($cacheData = $e107cache->retrieve($cache_tag, $ecal_class->max_cache_time))
|
if($cacheData = $e107cache->retrieve($cache_tag, $ecal_class->max_cache_time))
|
||||||
{
|
{
|
||||||
echo $cacheData;
|
echo $cacheData;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
include_lan($ecal_dir."languages/".e_LANGUAGE.".php");
|
include_lan($ecal_dir."languages/".e_LANGUAGE.".php");
|
||||||
|
|
||||||
global $ecal_dir, $tp;
|
global $ecal_dir, $tp;
|
||||||
|
|
||||||
|
|
||||||
if (is_readable(THEME."calendar_template.php"))
|
if (is_readable(THEME."calendar_template.php"))
|
||||||
{
|
{
|
||||||
require(THEME."calendar_template.php");
|
require(THEME."calendar_template.php");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // Needs to be require - otherwise not loaded if two menus use it
|
{ // Needs to be require - otherwise not loaded if two menus use it
|
||||||
require($ecal_dir."calendar_template.php");
|
require($ecal_dir."calendar_template.php");
|
||||||
}
|
}
|
||||||
|
$show_recurring = TRUE; // Could be pref later
|
||||||
|
$cat_filter = ''; // Could be another pref later.
|
||||||
$cal_datearray = $ecal_class->cal_date;
|
$cal_datearray = $ecal_class->cal_date;
|
||||||
$cal_current_month = $cal_datearray['mon'];
|
$cal_current_month = $cal_datearray['mon'];
|
||||||
$cal_current_year = $cal_datearray['year'];
|
$cal_current_year = $cal_datearray['year'];
|
||||||
$numberdays = date("t", $ecal_class->cal_date); // number of days in this month
|
$numberdays = date("t", $ecal_class->cal_timedate); // number of days in this month
|
||||||
|
|
||||||
|
|
||||||
$cal_monthstart = mktime(0, 0, 0, $cal_current_month, 1, $cal_current_year); // Time stamp for first day of month
|
$cal_monthstart = mktime(0, 0, 0, $cal_current_month, 1, $cal_current_year); // Time stamp for first day of month
|
||||||
$cal_firstdayarray = getdate($cal_monthstart);
|
$cal_firstdayarray = getdate($cal_monthstart);
|
||||||
$cal_monthend = mktime(0, 0, 0, $cal_current_month + 1, 1, $cal_current_year) -1; // Time stamp for last day of month
|
$cal_monthend = mktime(0, 0, 0, $cal_current_month + 1, 1, $cal_current_year) -1; // Time stamp for last day of month
|
||||||
|
//$cal_thismonth = $cal_datearray['mon'];
|
||||||
|
$cal_thisday = $cal_datearray['mday']; // Today
|
||||||
$cal_qry = "SELECT e.event_rec_m, e.event_rec_y, e.event_start, e.event_end, e.event_datestamp, ec.*
|
|
||||||
FROM #event as e LEFT JOIN #event_cat as ec ON e.event_category = ec.event_cat_id
|
|
||||||
WHERE ((e.event_start >= {$cal_monthstart} AND e.event_start <= {$cal_monthend}) OR (e.event_rec_y = {$cal_current_month}))
|
|
||||||
{$ecal_class->extra_query} order by e.event_start";
|
|
||||||
|
|
||||||
|
|
||||||
$cal_events = array();
|
$cal_events = array();
|
||||||
|
$cal_titles = array();
|
||||||
|
$cal_recent = array();
|
||||||
$cal_totev = 0;
|
$cal_totev = 0;
|
||||||
if ($cal_totev = $sql->db_Select_gen($cal_qry))
|
$ev_list = $ecal_class->get_events($cal_monthstart, $cal_monthend, FALSE, $cat_filter, $show_recurring,
|
||||||
{
|
'event_start, event_thread, event_title, event_recurring, event_allday', 'event_cat_icon');
|
||||||
while ($cal_row = $sql->db_Fetch())
|
$cal_totev = count($ev_list);
|
||||||
|
foreach ($ev_list as $cal_row)
|
||||||
{
|
{
|
||||||
if ($cal_row['event_rec_y'] == $cal_current_month)
|
if (is_array($cal_row['event_start'])) $temp = $cal_row['event_start']; else $temp = array($cal_row['event_start']);
|
||||||
{ // Recurring events
|
foreach ($temp as $ts)
|
||||||
$cal_start_day = $cal_row['event_rec_m'];
|
{
|
||||||
}
|
$cal_start_day = date('j',$ts); // Day of month for start
|
||||||
else
|
|
||||||
{ // 'normal' events
|
|
||||||
$cal_tmp = getdate($cal_row['event_start']);
|
|
||||||
if ($cal_tmp['mon'] == $cal_current_month)
|
|
||||||
{
|
|
||||||
$cal_start_day = $cal_tmp['mday'];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$cal_start_day = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Mark start day of each event
|
// Mark start day of each event
|
||||||
$cal_events[$cal_start_day][] = $cal_row['event_cat_icon']; // Will be overwritten if several events on same day
|
$cal_events[$cal_start_day][] = $cal_row['event_cat_icon']; // Only first is actually used
|
||||||
if ((($ecal_class->max_recent_show != 0) && (time() - $cal_row['event_datestamp']) <= $ecal_class->max_recent_show)) $cal_events[$cal_start_day]['is_recent'] = TRUE;
|
if (isset($cal_row['is_recent'])) $cal_recent[$cal_start_day] = TRUE;
|
||||||
|
$cal_titles[$cal_start_day][] = $cal_row['event_title']; // In case titles displayed on mouseover
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
// set up month array for calendar display
|
||||||
|
|
||||||
|
|
||||||
if ($pref['eventpost_weekstart'] == 'sun')
|
|
||||||
{
|
|
||||||
$cal_week = array(EC_LAN_25, EC_LAN_19, EC_LAN_20, EC_LAN_21, EC_LAN_22, EC_LAN_23, EC_LAN_24);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$cal_week = array(EC_LAN_19, EC_LAN_20, EC_LAN_21, EC_LAN_22, EC_LAN_23, EC_LAN_24, EC_LAN_25);
|
|
||||||
}
|
|
||||||
|
|
||||||
$cal_months = array(EC_LAN_0, EC_LAN_1, EC_LAN_2, EC_LAN_3, EC_LAN_4, EC_LAN_5, EC_LAN_6, EC_LAN_7, EC_LAN_8, EC_LAN_9, EC_LAN_10, EC_LAN_11);
|
$cal_months = array(EC_LAN_0, EC_LAN_1, EC_LAN_2, EC_LAN_3, EC_LAN_4, EC_LAN_5, EC_LAN_6, EC_LAN_7, EC_LAN_8, EC_LAN_9, EC_LAN_10, EC_LAN_11);
|
||||||
|
|
||||||
|
|
||||||
$calendar_title = "<a class='forumlink' href='".e_PLUGIN."calendar_menu/";
|
|
||||||
if ($pref['eventpost_menulink'] == 1)
|
|
||||||
{
|
|
||||||
$calendar_title .= "calendar.php' >";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$calendar_title .= "event.php' >";
|
|
||||||
}
|
|
||||||
if ($pref['eventpost_dateformat'] == 'my')
|
if ($pref['eventpost_dateformat'] == 'my')
|
||||||
{
|
{
|
||||||
$calendar_title .= $cal_months[$cal_datearray['mon']-1] ." ". $cal_current_year . "</a>";
|
$calendar_title = $cal_months[$cal_current_month-1] ." ". $cal_current_year;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$calendar_title .= $cal_current_year ." ". $cal_months[$cal_datearray['mon']-1] . "</a>";
|
$calendar_title = $cal_current_year ." ". $cal_months[$cal_current_month-1];
|
||||||
|
}
|
||||||
|
switch ($pref['eventpost_menulink'])
|
||||||
|
{
|
||||||
|
case 0 : $calendar_title = "<a {$CALENDAR_MENU_HDG_LINK_CLASS} href='".e_PLUGIN."calendar_menu/event.php' >".$calendar_title."</a>";
|
||||||
|
break;
|
||||||
|
case 1 : $calendar_title = "<a {$CALENDAR_MENU_HDG_LINK_CLASS} href='".e_PLUGIN."calendar_menu/calendar.php' >".$calendar_title."</a>";
|
||||||
|
break;
|
||||||
|
default : ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$cal_text = $CALENDAR_MENU_START;
|
$cal_text = $CALENDAR_MENU_START;
|
||||||
|
|
||||||
|
|
||||||
if ($pref['eventpost_showeventcount']=='1')
|
if ($pref['eventpost_showeventcount']=='1')
|
||||||
{
|
{
|
||||||
if ($cal_totev)
|
if ($cal_totev)
|
||||||
@@ -145,98 +99,93 @@ if ($pref['eventpost_showeventcount']=='1')
|
|||||||
}
|
}
|
||||||
$cal_text .= "<br /><br />";
|
$cal_text .= "<br /><br />";
|
||||||
}
|
}
|
||||||
|
|
||||||
$cal_start = $cal_monthstart; // First day of month as time stamp
|
$cal_start = $cal_monthstart; // First day of month as time stamp
|
||||||
|
|
||||||
|
|
||||||
// Start the table
|
// Start the table
|
||||||
$cal_text .= $CALENDAR_MENU_TABLE_START;
|
$cal_text .= $CALENDAR_MENU_TABLE_START;
|
||||||
// Open header row
|
// Open header row
|
||||||
$cal_text .= $CALENDAR_MENU_HEADER_START;
|
$cal_text .= $CALENDAR_MENU_HEADER_START;
|
||||||
// Now do the headings
|
// Now do the headings (days of week)
|
||||||
|
for ($i = 0; $i < 7; $i++)
|
||||||
foreach($cal_week as $cal_day)
|
|
||||||
{
|
{
|
||||||
$cal_text .= $CALENDAR_MENU_HEADER_FRONT;
|
$cal_day = $ecal_class->day_offset_string($i);
|
||||||
$cal_text .= substr($cal_day, 0, $pref['eventpost_lenday']);
|
$cal_text .= $CALENDAR_MENU_HEADER_FRONT;
|
||||||
$cal_text .= $CALENDAR_MENU_HEADER_BACK;
|
// $cal_text .= substr($cal_day, 0, $pref['eventpost_lenday']);
|
||||||
|
$cal_text .= substr($cal_day, 0, 1); // Unlikely to have room for more than 1 letter
|
||||||
|
$cal_text .= $CALENDAR_MENU_HEADER_BACK;
|
||||||
}
|
}
|
||||||
$cal_text .= $CALENDAR_MENU_HEADER_END; // Close off header row, open first date row
|
$cal_text .= $CALENDAR_MENU_HEADER_END; // Close off header row, open first date row
|
||||||
|
// Calculate number of days to skip before 'real' days on first line of calendar
|
||||||
|
$firstdayoffset = date('w',$cal_start) - $ecal_class->ec_first_day_of_week;
|
||||||
$cal_thismonth = $cal_datearray['mon'];
|
if ($firstdayoffset < 0) $firstdayoffset+= 7;
|
||||||
$cal_thisday = $cal_datearray['mday']; // Today
|
|
||||||
|
|
||||||
|
|
||||||
if ($pref['eventpost_weekstart'] == 'mon')
|
|
||||||
{
|
|
||||||
$firstdayoffset = ($cal_firstdayarray['wday'] == 0 ? $cal_firstdayarray['wday'] + 6 : $cal_firstdayarray['wday']-1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$firstdayoffset = $cal_firstdayarray['wday'];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
for ($cal_c = 0; $cal_c < $firstdayoffset; $cal_c++)
|
for ($cal_c = 0; $cal_c < $firstdayoffset; $cal_c++)
|
||||||
{
|
{
|
||||||
$cal_text .= $CALENDAR_MENU_DAY_NON;
|
$cal_text .= $CALENDAR_MENU_DAY_NON;
|
||||||
}
|
}
|
||||||
$cal_loop = $firstdayoffset;
|
$cal_loop = $firstdayoffset;
|
||||||
|
|
||||||
// Now do the days of the month
|
// Now do the days of the month
|
||||||
for($cal_c = 1; $cal_c <= 31; $cal_c++)
|
for($cal_c = 1; $cal_c <= $numberdays; $cal_c++)
|
||||||
{ // Four cases to decode:
|
{ // Four cases to decode:
|
||||||
// 1 - Today, no events
|
// 1 - Today, no events
|
||||||
// 2 - Some other day, no events (or no icon defined)
|
// 2 - Some other day, no events
|
||||||
// 3 - Today with events (and icon defined)
|
// 3 - Today with events
|
||||||
// 4 - Some other day with events (and icon defined)
|
// 4 - Some other day with events
|
||||||
$cal_dayarray = getdate($cal_start + (($cal_c-1) * 86400));
|
// 5 - Today with recently added events
|
||||||
|
// 6 - Some other day with recently added events
|
||||||
|
// $cal_dayarray = getdate($cal_start + (($cal_c-1) * 86400));
|
||||||
$cal_css = 2; // The default - not today, no events
|
$cal_css = 2; // The default - not today, no events
|
||||||
if ($cal_dayarray['mon'] == $cal_thismonth)
|
$cal_img = $cal_c; // Default 'image' is the day of the month
|
||||||
{ // Dates match for this month
|
$cal_event_count = 0;
|
||||||
$cal_img = $cal_c; // Default 'image' is the day of the month
|
$title = "";
|
||||||
$cal_event_count = 0;
|
if ($cal_thisday == $cal_c) $cal_css = 1;
|
||||||
$title = "";
|
$cal_linkut = mktime(0 , 0 , 0 , $cal_current_month, $cal_c, $cal_current_year).".one"; // Always need "one"
|
||||||
if ($cal_thisday == $cal_c) $cal_css = 1;
|
if (array_key_exists($cal_c, $cal_events))
|
||||||
$cal_linkut = mktime(0 , 0 , 0 , $cal_dayarray['mon'], $cal_c, $cal_datearray['year']).".one"; // ALways need "one"
|
{ // There are events today
|
||||||
if (array_key_exists($cal_c, $cal_events))
|
$cal_event_icon = "calendar_menu/images/" . $cal_events[$cal_c]['0']; // Icon file could be NULL
|
||||||
{
|
$cal_event_count = count($cal_events[$cal_c]); // See how many events today
|
||||||
$cal_event_icon = e_PLUGIN . "calendar_menu/images/" . $cal_events[$cal_c]['0'];
|
if ($cal_event_count)
|
||||||
$cal_event_count = count($cal_events[$cal_c]); // See how many events today
|
{ // Show icon if it exists
|
||||||
if (!empty($cal_events[$cal_c]) && is_file($cal_event_icon))
|
$cal_css += 2; // Gives 3 for today, 4 for other day
|
||||||
{ // Show icon if it exists
|
if (isset($pref['eventpost_showmouseover']) && ($pref['eventpost_showmouseover'] == 1))
|
||||||
$cal_css += 2; // Gives 3 for today, 4 for other day
|
{
|
||||||
if ($cal_event_count == 1)
|
$cal_ins = " title='";
|
||||||
{
|
foreach ($cal_titles[$cal_c] as $cur_title)
|
||||||
$title = " title='1 ".EC_LAN_135."' ";
|
{ // New line would be better, but doesn't get displayed
|
||||||
}
|
$title .= $cal_ins.$cur_title;
|
||||||
else
|
$cal_ins = ", ";
|
||||||
{
|
}
|
||||||
$title = " title='{$cal_event_count} " . EC_LAN_106 . "' ";
|
$title .= "'";
|
||||||
}
|
|
||||||
$cal_img = "<img style='border:0' src='{$cal_event_icon}' alt='' />";
|
|
||||||
//height='10' width='10'
|
|
||||||
if (isset($cal_events[$cal_c]['is_recent']) && $cal_events[$cal_c]['is_recent'])
|
|
||||||
{
|
|
||||||
$cal_css += 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$cal_text .= $CALENDAR_MENU_DAY_START[$cal_css]."<a {$title} href='" . e_PLUGIN . "calendar_menu/event.php?{$cal_linkut}'>{$cal_img}</a>";
|
else
|
||||||
$cal_text .= $CALENDAR_MENU_DAY_END[$cal_css];
|
{
|
||||||
$cal_loop++;
|
if ($cal_event_count == 1)
|
||||||
if ($cal_loop == 7)
|
{
|
||||||
{ // Start next row
|
$title = " title='1 ".EC_LAN_135."' ";
|
||||||
$cal_loop = 0;
|
}
|
||||||
if ($cal_c != $numberdays)
|
else
|
||||||
{
|
{
|
||||||
$cal_text .= $CALENDAR_MENU_WEEKSWITCH;
|
$title = " title='{$cal_event_count} " . EC_LAN_106 . "' ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (is_file(e_PLUGIN.$cal_event_icon)) $cal_img = "<img style='border:0' src='".e_PLUGIN_ABS.$cal_event_icon."' alt='' />";
|
||||||
|
//height='10' width='10'
|
||||||
|
if (isset($cal_recent[$cal_c]) && $cal_recent[$cal_c])
|
||||||
|
{
|
||||||
|
$cal_css += 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$cal_text .= $CALENDAR_MENU_DAY_START[$cal_css]."<a {$title} href='" . e_PLUGIN . "calendar_menu/event.php?{$cal_linkut}'>{$cal_img}</a>";
|
||||||
|
$cal_text .= $CALENDAR_MENU_DAY_END[$cal_css];
|
||||||
|
$cal_loop++;
|
||||||
|
if ($cal_loop == 7)
|
||||||
|
{ // Start next row
|
||||||
|
$cal_loop = 0;
|
||||||
|
if ($cal_c != $numberdays)
|
||||||
|
{
|
||||||
|
$cal_text .= $CALENDAR_MENU_WEEKSWITCH;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($cal_loop != 0)
|
if ($cal_loop != 0)
|
||||||
{
|
{
|
||||||
for($cal_a = ($cal_loop + 1); $cal_a <= 7; $cal_a++)
|
for($cal_a = ($cal_loop + 1); $cal_a <= 7; $cal_a++)
|
||||||
@@ -246,12 +195,11 @@ for($cal_a = ($cal_loop + 1); $cal_a <= 7; $cal_a++)
|
|||||||
}
|
}
|
||||||
// Close table
|
// Close table
|
||||||
$cal_text .= $CALENDAR_MENU_END;
|
$cal_text .= $CALENDAR_MENU_END;
|
||||||
|
|
||||||
// Now handle the data, cache as well
|
// Now handle the data, cache as well
|
||||||
ob_start(); // Set up a new output buffer
|
ob_start(); // Set up a new output buffer
|
||||||
$ns->tablerender($calendar_title, $cal_text, 'calendar_menu');
|
$ns->tablerender($calendar_title, $cal_text, 'calendar_menu');
|
||||||
$cache_data = ob_get_flush(); // Get the page content, and display it
|
$cache_data = ob_get_flush(); // Get the page content, and display it
|
||||||
$e107cache->set($cache_tag, $cache_data); // Save to cache
|
$e107cache->set($cache_tag, $cache_data); // Save to cache
|
||||||
|
unset($ev_list);
|
||||||
|
unset($cal_text);
|
||||||
?>
|
?>
|
File diff suppressed because it is too large
Load Diff
@@ -14,7 +14,8 @@ CREATE TABLE event (
|
|||||||
event_thread varchar(100) NOT NULL default '',
|
event_thread varchar(100) NOT NULL default '',
|
||||||
event_rec_m tinyint(2) unsigned NOT NULL default '0',
|
event_rec_m tinyint(2) unsigned NOT NULL default '0',
|
||||||
event_rec_y tinyint(2) unsigned NOT NULL default '0',
|
event_rec_y tinyint(2) unsigned NOT NULL default '0',
|
||||||
PRIMARY KEY (event_id)
|
PRIMARY KEY (event_id),
|
||||||
|
KEY event_start (event_start)
|
||||||
) TYPE=MyISAM;,
|
) TYPE=MyISAM;,
|
||||||
CREATE TABLE event_cat (
|
CREATE TABLE event_cat (
|
||||||
event_cat_id smallint(5) unsigned NOT NULL auto_increment,
|
event_cat_id smallint(5) unsigned NOT NULL auto_increment,
|
||||||
|
@@ -11,64 +11,66 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/calendar_template.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/calendar_template.php,v $
|
||||||
| $Revision: 1.1.1.1 $
|
| $Revision: 1.2 $
|
||||||
| $Date: 2006-12-02 04:34:46 $
|
| $Date: 2007-07-13 19:37:52 $
|
||||||
| $Author: mcfly_e107 $
|
| $Author: e107steved $
|
||||||
|
|
|
|
||||||
| 10.11.06 steved - mods for next CVS release
|
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
if (!defined("USER_WIDTH")){ define("USER_WIDTH","width:auto"); }
|
||||||
|
|
||||||
|
|
||||||
|
if (!defined('EC_RECENT_ICON')) {define('EC_RECENT_ICON',e_IMAGE.'generic/'.IMODE.'/new.png'); } // Filename of icon used to flag recent events
|
||||||
|
|
||||||
// TIME SWITCH BUTTONS ------------------------------------------------------------
|
// TIME SWITCH BUTTONS ------------------------------------------------------------
|
||||||
$sc_style['PREV_MONTH']['pre'] = "<span class='defaulttext'>";
|
$sc_style['EC_PREV_MONTH']['pre'] = "<span class='defaulttext'>";
|
||||||
$sc_style['PREV_MONTH']['post'] = "</span>";
|
$sc_style['EC_PREV_MONTH']['post'] = "</span>";
|
||||||
|
|
||||||
$sc_style['CURRENT_MONTH']['pre'] = "<b>";
|
$sc_style['EC_CURRENT_MONTH']['pre'] = "<b>";
|
||||||
$sc_style['CURRENT_MONTH']['post'] = "</b>";
|
$sc_style['EC_CURRENT_MONTH']['post'] = "</b>";
|
||||||
|
|
||||||
$sc_style['NEXT_MONTH']['pre'] = "<span class='defaulttext'>";
|
$sc_style['EC_NEXT_MONTH']['pre'] = "<span class='defaulttext'>";
|
||||||
$sc_style['NEXT_MONTH']['post'] = "</span>";
|
$sc_style['EC_NEXT_MONTH']['post'] = "</span>";
|
||||||
|
|
||||||
$sc_style['PREV_YEAR']['pre'] = "";
|
$sc_style['EC_PREV_YEAR']['pre'] = "";
|
||||||
$sc_style['PREV_YEAR']['post'] = "";
|
$sc_style['EC_PREV_YEAR']['post'] = "";
|
||||||
|
|
||||||
$sc_style['MONTH_LIST']['pre'] = "";
|
$sc_style['EC_MONTH_LIST']['pre'] = "";
|
||||||
$sc_style['MONTH_LIST']['post'] = "";
|
$sc_style['EC_MONTH_LIST']['post'] = "";
|
||||||
|
|
||||||
$sc_style['NEXT_YEAR']['pre'] = "";
|
$sc_style['EC_NEXT_YEAR']['pre'] = "";
|
||||||
$sc_style['NEXT_YEAR']['post'] = "";
|
$sc_style['EC_NEXT_YEAR']['post'] = "";
|
||||||
|
|
||||||
//<table style='width:98%;' class='fborder'>
|
|
||||||
|
|
||||||
$CALENDAR_TIME_TABLE = "
|
$CALENDAR_TIME_TABLE = "
|
||||||
<table cellpadding='0' cellspacing='1' class='fborder' style='width:100%'>
|
<table cellpadding='0' cellspacing='1' class='fborder' style='width:100%'>
|
||||||
<tr>
|
<tr>
|
||||||
<td class='forumheader' style='width:18%; text-align:left'>{PREV_MONTH}</td>
|
<td class='forumheader' style='width:18%; text-align:left'>{EC_PREV_MONTH}</td>
|
||||||
<td class='fcaption' style='width:64%; text-align:center'>{CURRENT_MONTH}</td>
|
<td class='fcaption' style='width:64%; text-align:center'>{EC_CURRENT_MONTH}</td>
|
||||||
<td class='forumheader' style='width:18%; text-align:right'>{NEXT_MONTH}</td>
|
<td class='forumheader' style='width:18%; text-align:right'>{EC_NEXT_MONTH}</td>
|
||||||
</tr>\n
|
</tr>\n
|
||||||
<tr>
|
<tr>
|
||||||
<td class='forumheader3' style='text-align:left'>{PREV_YEAR}</td>
|
<td class='forumheader3' style='text-align:left'>{EC_PREV_YEAR}</td>
|
||||||
<td class='fcaption' style='text-align:center; vertical-align:middle'>{MONTH_LIST}</td>
|
<td class='fcaption' style='text-align:center; vertical-align:middle'>{EC_MONTH_LIST}</td>
|
||||||
<td class='forumheader3' style='text-align:right'>{NEXT_YEAR}</td>
|
<td class='forumheader3' style='text-align:right'>{EC_NEXT_YEAR}</td>
|
||||||
</tr>\n
|
</tr>\n
|
||||||
</table>";
|
</table>";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// NAVIGATION BUTTONS ------------------------------------------------------------
|
// NAVIGATION BUTTONS
|
||||||
//$sc_style['NAV_LINKCURRENTMONTH']['pre'] = "<span class='button' style='width:120px; '>";
|
//$sc_style['NAV_LINKCURRENTMONTH']['pre'] = "<span class='button' style='width:120px; '>";
|
||||||
//$sc_style['NAV_LINKCURRENTMONTH']['post'] = "</span>";
|
//$sc_style['NAV_LINKCURRENTMONTH']['post'] = "</span>";
|
||||||
$sc_style['NAV_LINKCURRENTMONTH']['pre'] = "";
|
$sc_style['EC_NAV_LINKCURRENTMONTH']['pre'] = "";
|
||||||
$sc_style['NAV_LINKCURRENTMONTH']['post'] = "";
|
$sc_style['EC_NAV_LINKCURRENTMONTH']['post'] = "";
|
||||||
|
|
||||||
$CALENDAR_NAVIGATION_TABLE = "
|
$CALENDAR_NAVIGATION_TABLE = "
|
||||||
<div style='text-align:center; margin-bottom:20px;'>
|
<div style='text-align:center; margin-bottom:20px;'>
|
||||||
<form method='post' action='" . e_SELF . "?" . e_QUERY . "' id='calform'>
|
<form method='post' action='" . e_SELF . "?" . e_QUERY . "' id='calform'>
|
||||||
<table border='0' cellpadding='0' cellspacing='0' style='width:100%;'>
|
<table border='0' cellpadding='0' cellspacing='0' style='width:100%;'>
|
||||||
<tr>
|
<tr>
|
||||||
<td style='text-align:center;'>{NAV_CATEGORIES} {NAV_BUT_ALLEVENTS} {NAV_BUT_VIEWCAT} {NAV_BUT_ENTEREVENT} {NAV_BUT_SUBSCRIPTION} {NAV_LINKCURRENTMONTH}</td>
|
<td style='text-align:center;'>{EC_NAV_CATEGORIES} {EC_NAV_BUT_ALLEVENTS} {EC_NAV_BUT_VIEWCAT} {EC_NAV_BUT_ENTEREVENT} {EC_NAV_BUT_SUBSCRIPTION} {EC_NAV_BUT_PRINTLISTS} {EC_NAV_LINKCURRENTMONTH}</td>
|
||||||
</tr>\n
|
</tr>\n
|
||||||
</table>
|
</table>
|
||||||
</form>
|
</form>
|
||||||
@@ -77,26 +79,26 @@ $CALENDAR_NAVIGATION_TABLE = "
|
|||||||
|
|
||||||
|
|
||||||
// EVENT LIST ------------------------------------------------------------
|
// EVENT LIST ------------------------------------------------------------
|
||||||
$sc_style['EVENTLIST_CAPTION']['pre'] = "<tr><td class='fcaption' colspan='2'>";
|
$sc_style['EC_EVENTLIST_CAPTION']['pre'] = "<tr><td class='fcaption' colspan='2'>";
|
||||||
$sc_style['EVENTLIST_CAPTION']['post'] = ":<br /><br /></td></tr>\n";
|
$sc_style['EC_EVENTLIST_CAPTION']['post'] = ":<br /><br /></td></tr>\n";
|
||||||
|
|
||||||
$EVENT_EVENTLIST_TABLE_START = "<table style='width:100%' class='fborder'>{EVENTLIST_CAPTION}";
|
$EVENT_EVENTLIST_TABLE_START = "<table style='width:100%' class='fborder'>{EC_EVENTLIST_CAPTION}";
|
||||||
$EVENT_EVENTLIST_TABLE_END = "</table>";
|
$EVENT_EVENTLIST_TABLE_END = "</table>";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// EVENT ARCHIVE ------------------------------------------------------------
|
// EVENT ARCHIVE ------------------------------------------------------------
|
||||||
$sc_style['EVENTARCHIVE_CAPTION']['pre'] = "<tr><td colspan='2' class='fcaption'>";
|
$sc_style['EC_EVENTARCHIVE_CAPTION']['pre'] = "<tr><td colspan='2' class='fcaption'>";
|
||||||
$sc_style['EVENTARCHIVE_CAPTION']['post'] = "</td></tr>\n";
|
$sc_style['EC_EVENTARCHIVE_CAPTION']['post'] = "</td></tr>\n";
|
||||||
|
|
||||||
$EVENT_ARCHIVE_TABLE_START = "<br /><table style='width:100%' class='fborder'>{EVENTARCHIVE_CAPTION}";
|
$EVENT_ARCHIVE_TABLE_START = "<br /><table style='width:100%' class='fborder'>{EC_EVENTARCHIVE_CAPTION}";
|
||||||
$EVENT_ARCHIVE_TABLE = "
|
$EVENT_ARCHIVE_TABLE = "
|
||||||
<tr>
|
<tr>
|
||||||
<td style='width:35%; vertical-align:top' class='forumheader3'>{EVENT_RECENT_ICON}{EVENTARCHIVE_DATE}</td>
|
<td style='width:35%; vertical-align:top' class='forumheader3'>{EC_EVENT_RECENT_ICON}{EC_EVENTARCHIVE_DATE}</td>
|
||||||
<td style='width:65%' class='forumheader3'>{EVENTARCHIVE_HEADING}</td>
|
<td style='width:65%' class='forumheader3'>{EC_EVENTARCHIVE_HEADING}</td>
|
||||||
</tr>\n";
|
</tr>\n";
|
||||||
//<br />{EVENTARCHIVE_DETAILS}
|
//<br />{EVENTARCHIVE_DETAILS}
|
||||||
$EVENT_ARCHIVE_TABLE_EMPTY = "<tr><td colspan='2' class='forumheader3'>{EVENTARCHIVE_EMPTY}</td></tr>\n";
|
$EVENT_ARCHIVE_TABLE_EMPTY = "<tr><td colspan='2' class='forumheader3'>{EC_EVENTARCHIVE_EMPTY}</td></tr>\n";
|
||||||
$EVENT_ARCHIVE_TABLE_END = "</table>";
|
$EVENT_ARCHIVE_TABLE_END = "</table>";
|
||||||
|
|
||||||
|
|
||||||
@@ -105,77 +107,98 @@ $EVENT_ARCHIVE_TABLE_END = "</table>";
|
|||||||
$EVENT_EVENT_TABLE_START = "<table style='width:100%' class='fborder' cellspacing='0' cellpadding='0'>";
|
$EVENT_EVENT_TABLE_START = "<table style='width:100%' class='fborder' cellspacing='0' cellpadding='0'>";
|
||||||
$EVENT_EVENT_TABLE_END = "</table>";
|
$EVENT_EVENT_TABLE_END = "</table>";
|
||||||
|
|
||||||
$sc_style['EVENT_HEADING_DATE']['pre'] = "";
|
$sc_style['EC_EVENT_HEADING_DATE']['pre'] = "";
|
||||||
$sc_style['EVENT_HEADING_DATE']['post'] = "";
|
$sc_style['EC_EVENT_HEADING_DATE']['post'] = "";
|
||||||
|
|
||||||
$sc_style['EVENT_DETAILS']['pre'] = "<tr><td colspan='2' class='forumheader3'>";
|
$sc_style['EC_EVENT_DETAILS']['pre'] = "<tr><td colspan='2' class='forumheader3'>";
|
||||||
$sc_style['EVENT_DETAILS']['post'] = "</td></tr>\n";
|
$sc_style['EC_EVENT_DETAILS']['post'] = "</td></tr>\n";
|
||||||
|
|
||||||
$sc_style['EVENT_LOCATION']['pre'] = "<b>".EC_LAN_32."</b> ";
|
$sc_style['EC_EVENT_LOCATION']['pre'] = "<b>".EC_LAN_32."</b> ";
|
||||||
$sc_style['EVENT_LOCATION']['post'] = "";
|
$sc_style['EC_EVENT_LOCATION']['post'] = "";
|
||||||
|
|
||||||
$sc_style['EVENT_AUTHOR']['pre'] = "<b>".EC_LAN_31."</b> ";
|
$sc_style['EC_EVENT_AUTHOR']['pre'] = "<b>".EC_LAN_31."</b> ";
|
||||||
$sc_style['EVENT_AUTHOR']['post'] = " ";
|
$sc_style['EC_EVENT_AUTHOR']['post'] = " ";
|
||||||
|
|
||||||
$sc_style['EVENT_CONTACT']['pre'] = "<b>".EC_LAN_33."</b> ";
|
$sc_style['EC_EVENT_CONTACT']['pre'] = "<b>".EC_LAN_33."</b> ";
|
||||||
$sc_style['EVENT_CONTACT']['post'] = " ";
|
$sc_style['EC_EVENT_CONTACT']['post'] = " ";
|
||||||
|
|
||||||
$sc_style['EVENT_THREAD']['pre'] = "<tr><td colspan='2' class='forumheader3'><span class='smalltext'>";
|
$sc_style['EC_EVENT_THREAD']['pre'] = "<tr><td colspan='2' class='forumheader3'><span class='smalltext'>";
|
||||||
$sc_style['EVENT_THREAD']['post'] = "</span></td></tr>\n";
|
$sc_style['EC_EVENT_THREAD']['post'] = "</span></td></tr>\n";
|
||||||
|
|
||||||
$sc_style['EVENT_CATEGORY']['pre'] = "<b>".EC_LAN_30."</b> ";
|
$sc_style['EC_EVENT_CATEGORY']['pre'] = "<b>".EC_LAN_30."</b> ";
|
||||||
$sc_style['EVENT_CATEGORY']['post'] = " ";
|
$sc_style['EC_EVENT_CATEGORY']['post'] = " ";
|
||||||
|
|
||||||
$sc_style['EVENT_DATE_START']['pre'] = (isset($thisevent['event_allday']) && $thisevent['event_allday']) ? "<b>".EC_LAN_68."</b> " : "<b>".EC_LAN_29."</b> ";
|
$sc_style['EC_EVENT_DATE_START']['pre'] = "";
|
||||||
$sc_style['EVENT_DATE_START']['post'] = "";
|
$sc_style['EC_EVENT_DATE_START']['post'] = "";
|
||||||
|
|
||||||
$sc_style['EVENT_TIME_START']['pre'] = EC_LAN_144;
|
$sc_style['EC_EVENT_TIME_START']['pre'] = "";
|
||||||
$sc_style['EVENT_TIME_START']['post'] = "";
|
$sc_style['EC_EVENT_TIME_START']['post'] = "";
|
||||||
|
|
||||||
$sc_style['EVENT_DATE_END']['pre'] = "<b>".EC_LAN_69."</b> ";
|
$sc_style['EC_EVENT_DATE_END']['pre'] = "";
|
||||||
$sc_style['EVENT_DATE_END']['post'] = "";
|
$sc_style['EC_EVENT_DATE_END']['post'] = "";
|
||||||
|
|
||||||
$sc_style['EVENT_TIME_END']['pre'] = EC_LAN_144;
|
$sc_style['EC_EVENT_TIME_END']['pre'] = "";
|
||||||
$sc_style['EVENT_TIME_END']['post'] = "";
|
$sc_style['EC_EVENT_TIME_END']['post'] = "";
|
||||||
|
|
||||||
|
$sc_style['EC_EVENT_EVENT_DATE_TIME']['pre'] = "<b>".EC_LAN_29."</b> ";
|
||||||
|
$sc_style['EC_EVENT_EVENT_DATE_TIME']['post'] = "";
|
||||||
|
|
||||||
|
$sc_style['EC_IFNOT_ALLDAY']['pre'] = EC_LAN_144;
|
||||||
|
$sc_style['EC_IFNOT_ALLDAY']['post'] = "";
|
||||||
|
|
||||||
|
// The $EVENT_EVENT_DATETIME strings are used with the EC_EVENT_EVENT_DATE_TIME shortcode.
|
||||||
|
// There are four cases, each with a corresponding index into $EVENT_EVENT_DATETIME:
|
||||||
|
// 0 - Normal event, starting and finishing on different dates (the 'original' default)
|
||||||
|
// 1 - Normal event, starting and finishing on the same day
|
||||||
|
// 2 - All-day event, starting and finishing on different days
|
||||||
|
// 3 - All-day event, starting and finishing on the same day
|
||||||
|
$EVENT_EVENT_DATETIME[0] = "{EC_EVENT_DATE_START}".EC_LAN_144."{EC_EVENT_TIME_START}<b> ".EC_LAN_69."</b> {EC_EVENT_DATE_END}{EC_IFNOT_ALLDAY=EC_EVENT_TIME_END}";
|
||||||
|
$EVENT_EVENT_DATETIME[1] = "{EC_EVENT_DATE_START} ".EC_LAN_84." {EC_EVENT_TIME_START}".EC_LAN_85."{EC_EVENT_TIME_END}";
|
||||||
|
$EVENT_EVENT_DATETIME[2] = "{EC_EVENT_DATE_START} <b>".EC_LAN_69."</b> {EC_EVENT_DATE_END}";
|
||||||
|
$EVENT_EVENT_DATETIME[3] = "{EC_EVENT_DATE_START}";
|
||||||
$EVENT_EVENT_TABLE = "
|
$EVENT_EVENT_TABLE = "
|
||||||
<tr>
|
<tr>
|
||||||
<td >
|
<td >
|
||||||
<div title='".EC_LAN_132."' class='fcaption' style='cursor:pointer; text-align:left; border:0px solid #000;' onclick=\"expandit('{EVENT_ID}')\">{EVENT_RECENT_ICON}{EVENT_CAT_ICON}{EVENT_HEADING_DATE}{EVENT_TIME_START} - {EVENT_TITLE}</div>
|
<div title='".EC_LAN_132."' class='fcaption' style='cursor:pointer; text-align:left; border:0px solid #000;' onclick=\"expandit('{EC_EVENT_ID}')\">{EC_EVENT_RECENT_ICON}{EC_EVENT_CAT_ICON}{EC_EVENT_HEADING_DATE}{EC_IFNOT_ALLDAY=EC_EVENT_TIME_START} - {EC_EVENT_TITLE}</div>
|
||||||
<div id='{EVENT_ID}' style='display:{EVENT_DISPLAYSTYLE}; padding-top:10px; padding-bottom:10px; text-align:left;'>
|
<div id='{EC_EVENT_ID}' style='display:{EC_EVENT_DISPLAYSTYLE}; padding-top:10px; padding-bottom:10px; text-align:left;'>
|
||||||
<table style='width:100%;' cellspacing='0' cellpadding='0'>
|
<table style='width:100%;' cellspacing='0' cellpadding='0'>
|
||||||
<tr><td colspan='2' class='forumheader3'>{EVENT_AUTHOR} {EVENT_CAT_ICON} {EVENT_CATEGORY} {EVENT_CONTACT} {EVENT_OPTIONS}</td></tr>
|
<tr><td colspan='2' class='forumheader3'>{EC_EVENT_AUTHOR} {EC_EVENT_CAT_ICON} {EC_EVENT_CATEGORY} {EC_EVENT_CONTACT} {EC_EVENT_OPTIONS}</td></tr>
|
||||||
<tr><td colspan='2' class='forumheader3'>{EVENT_DATE_START}{EVENT_TIME_START} {EVENT_DATE_END}{EVENT_TIME_END}</td></tr>\n
|
<tr><td colspan='2' class='forumheader3'>{EC_EVENT_EVENT_DATE_TIME}</td></tr>\n
|
||||||
<tr><td colspan='2' class='forumheader3'>{EVENT_LOCATION}</td></tr>
|
<tr><td colspan='2' class='forumheader3'>{EC_EVENT_LOCATION}</td></tr>
|
||||||
{EVENT_DETAILS}
|
{EC_EVENT_DETAILS}
|
||||||
{EVENT_THREAD}
|
{EC_EVENT_THREAD}
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>\n
|
</tr>\n
|
||||||
";
|
";
|
||||||
|
|
||||||
|
|
||||||
// CALENDAR SHOW EVENT ------------------------------------------------------------
|
//------------------------------------------
|
||||||
$sc_style['CALENDAR_CALENDAR_RECENT_ICON']['pre'] = "<td style='vertical-align:top; color: #0; background-color: #ff00; width:10px;'>";
|
// CALENDAR CALENDAR - 'Big' calendar
|
||||||
$sc_style['CALENDAR_CALENDAR_RECENT_ICON']['post'] = "</td>";
|
//------------------------------------------
|
||||||
$CALENDAR_SHOWEVENT = "<table cellspacing='0' cellpadding='0' style='width:100%;'><tr>{CALENDAR_CALENDAR_RECENT_ICON}<td style='vertical-align:top; width:10px;'>{SHOWEVENT_IMAGE}</td><td style='vertical-align:top; width:2%;'>{SHOWEVENT_INDICAT}</td><td style='vertical-align:top;'>{SHOWEVENT_HEADING}</td></tr>\n</table>";
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// CALENDAR CALENDAR ------------------------------------------------------------
|
|
||||||
$CALENDAR_CALENDAR_START = "
|
$CALENDAR_CALENDAR_START = "
|
||||||
<div style='text-align:center'>
|
<div style='text-align:center'>
|
||||||
<table cellpadding='0' cellspacing='1' class='fborder' style='background-color:#DDDDDD; width:100%'>";
|
<table cellpadding='0' cellspacing='1' class='fborder' style='background-color:#DDDDDD; width:100%'>
|
||||||
|
<colgroup>
|
||||||
|
<col style='width:14%; padding-bottom:0px;padding-right:0px; margin-right:0px; padding:2px;' />
|
||||||
|
<col style='width:14%; padding-bottom:0px;padding-right:0px; margin-right:0px; padding:2px;' />
|
||||||
|
<col style='width:14%; padding-bottom:0px;padding-right:0px; margin-right:0px; padding:2px;' />
|
||||||
|
<col style='width:14%; padding-bottom:0px;padding-right:0px; margin-right:0px; padding:2px;' />
|
||||||
|
<col style='width:14%; padding-bottom:0px;padding-right:0px; margin-right:0px; padding:2px;' />
|
||||||
|
<col style='width:14%; padding-bottom:0px;padding-right:0px; margin-right:0px; padding:2px;' />
|
||||||
|
<col style='width:14%; padding-bottom:0px;padding-right:0px; margin-right:0px; padding:2px;' />
|
||||||
|
</colgroup>";
|
||||||
|
|
||||||
$CALENDAR_CALENDAR_END = "
|
$CALENDAR_CALENDAR_END = "
|
||||||
</tr>\n</table></div>";
|
</tr>\n</table></div>";
|
||||||
|
|
||||||
$CALENDAR_CALENDAR_DAY_NON = "<td style='width:12%;height:60px;'></td>";
|
// 'Empty' cells where there's not a day at all
|
||||||
|
$CALENDAR_CALENDAR_DAY_NON = "<td style='width:14%;height:90px;'></td>";
|
||||||
|
|
||||||
//header row
|
//header row
|
||||||
$CALENDAR_CALENDAR_HEADER_START = "<tr>";
|
$CALENDAR_CALENDAR_HEADER_START = "<tr>";
|
||||||
$CALENDAR_CALENDAR_HEADER = "<td class='fcaption' style='z-index: -1; background-color:#000; color:#FFF; width:90px; height:20px; text-align:center; vertical-align:middle;'>{CALENDAR_CALENDAR_HEADER_DAY}</td>";
|
$CALENDAR_CALENDAR_HEADER = "<td class='fcaption' style='z-index: -1; background-color:#000; color:#FFF; width:90px; height:20px; text-align:center; vertical-align:middle;'>{EC_CALENDAR_CALENDAR_HEADER_DAY}</td>";
|
||||||
$CALENDAR_CALENDAR_HEADER_END = "</tr>\n<tr>";
|
$CALENDAR_CALENDAR_HEADER_END = "</tr>\n<tr>";
|
||||||
|
|
||||||
|
|
||||||
@@ -183,30 +206,38 @@ $CALENDAR_CALENDAR_WEEKSWITCH = "</tr>\n<tr>";
|
|||||||
|
|
||||||
//today
|
//today
|
||||||
$CALENDAR_CALENDAR_DAY_TODAY = "
|
$CALENDAR_CALENDAR_DAY_TODAY = "
|
||||||
<td class='forumheader3' style='vertical-align:top; width:14%; height:90px; padding-bottom:0px;padding-right:0px; margin-right:0px; padding:2px;'>
|
<td class='forumheader3' style='vertical-align:top;height:90px;'>
|
||||||
<span style='z-index: 2; position:relative; top:1px; height:10px;padding-right:0px'>{CALENDAR_CALENDAR_DAY_TODAY_HEADING}</span>";
|
<span style='z-index: 2; position:relative; top:1px; height:10px;padding-right:0px'>{EC_CALENDAR_CALENDAR_DAY_TODAY_HEADING}</span>";
|
||||||
|
|
||||||
//day has events
|
//day has events
|
||||||
$CALENDAR_CALENDAR_DAY_EVENT = "
|
$CALENDAR_CALENDAR_DAY_EVENT = "
|
||||||
<td class='forumheader3' style='z-index: 1;vertical-align:top; width:14%; height:90px; padding-bottom:0px;padding-right:0px; margin-right:0px; padding:2px;'>
|
<td class='forumheader3' style='z-index: 1;vertical-align:top;height:90px;'>
|
||||||
<span style='z-index: 2; position:relative; top:1px; height:10px;padding-right:0px'><b>{CALENDAR_CALENDAR_DAY_EVENT_HEADING}</b></span>";
|
<span style='z-index: 2; position:relative; top:1px; height:10px;padding-right:0px'><b>{EC_CALENDAR_CALENDAR_DAY_EVENT_HEADING}</b></span>";
|
||||||
|
|
||||||
// no events and not today
|
// no events and not today
|
||||||
$CALENDAR_CALENDAR_DAY_EMPTY = "
|
$CALENDAR_CALENDAR_DAY_EMPTY = "
|
||||||
<td class='forumheader2' style='z-index: 1;vertical-align:top; width:14%; height:90px;padding-bottom:0px;padding-right:0px; margin-right:0px; padding:2px;'>
|
<td class='forumheader2' style='z-index: 1;vertical-align:top;height:90px;'>
|
||||||
<span style='z-index: 2; position:relative; top:1px; height:10px;padding-right:0px'><b>{CALENDAR_CALENDAR_DAY_EMPTY_HEADING}</b></span>";
|
<span style='z-index: 2; position:relative; top:1px; height:10px;padding-right:0px'><b>{EC_CALENDAR_CALENDAR_DAY_EMPTY_HEADING}</b></span>";
|
||||||
|
|
||||||
$CALENDAR_CALENDAR_DAY_END = "</td>";
|
$CALENDAR_CALENDAR_DAY_END = "</td>";
|
||||||
|
|
||||||
//====================================================================
|
// CALENDAR SHOW EVENT
|
||||||
// Calendar menu templates
|
$sc_style['EC_CALENDAR_CALENDAR_RECENT_ICON']['pre'] = "<td style='vertical-align:top; color: #0; background-color: #ff00; width:10px;'>";
|
||||||
|
$sc_style['EC_CALENDAR_CALENDAR_RECENT_ICON']['post'] = "</td>";
|
||||||
|
$CALENDAR_SHOWEVENT = "<table cellspacing='0' cellpadding='0' style='width:100%;'><tr>{EC_CALENDAR_CALENDAR_RECENT_ICON}<td style='vertical-align:top; width:10px;'>{EC_SHOWEVENT_IMAGE}</td><td style='vertical-align:top; width:2%;'>{EC_SHOWEVENT_INDICAT}</td><td style='vertical-align:top;'>{EC_SHOWEVENT_HEADING}</td></tr>\n</table>";
|
||||||
|
|
||||||
|
|
||||||
|
//------------------------------------------
|
||||||
|
// Calendar menu - 'Small' calendar
|
||||||
|
//------------------------------------------
|
||||||
|
$CALENDAR_MENU_HDG_LINK_CLASS = "class='forumlink'"; // Class, and optional style, for menu heading if its a clickable link
|
||||||
$CALENDAR_MENU_START = "<div style='text-align:center'>";
|
$CALENDAR_MENU_START = "<div style='text-align:center'>";
|
||||||
$CALENDAR_MENU_TABLE_START = "<table cellpadding='0' cellspacing='1' style='width:100%' class='fborder'>";
|
$CALENDAR_MENU_TABLE_START = "<table cellpadding='0' cellspacing='1' style='width:100%;' class='fborder'>"; // colgroup doesn't work!
|
||||||
|
|
||||||
$CALENDAR_MENU_END = "</tr></table></div>";
|
$CALENDAR_MENU_END = "</tr></table></div>";
|
||||||
|
|
||||||
// Blank cells at beginning and end
|
// Blank cells at beginning and end
|
||||||
$CALENDAR_MENU_DAY_NON = "<td class='forumheader3' style='padding:1px; text-align:center'><br /></td>";
|
$CALENDAR_MENU_DAY_NON = "<td class='forumheader3' style='width:14.28%; padding:1px; text-align:center; '><br /></td>";
|
||||||
|
|
||||||
//header row
|
//header row
|
||||||
$CALENDAR_MENU_HEADER_START = "<tr>\n";
|
$CALENDAR_MENU_HEADER_START = "<tr>\n";
|
||||||
@@ -219,11 +250,12 @@ $CALENDAR_MENU_WEEKSWITCH = "</tr>\n<tr>";
|
|||||||
|
|
||||||
// Start and end CSS for date cells - six cases to decode, determined by array index:
|
// Start and end CSS for date cells - six cases to decode, determined by array index:
|
||||||
// 1 - Today, no events
|
// 1 - Today, no events
|
||||||
// 2 - Some other day, no events (or no icon defined)
|
// 2 - Some other day, no events
|
||||||
// 3 - Today with events (and icon defined)
|
// 3 - Today with events
|
||||||
// 4 - Some other day with events (and icon defined)
|
// 4 - Some other day with events
|
||||||
// 5 - today with events, one or more of which has recently been added/updated (and icon defined)
|
// 5 - today with events, one or more of which has recently been added/updated
|
||||||
// 6 - Some other day with events, one or more of which has recently been added/updated (and icon defined)
|
// 6 - Some other day with events, one or more of which has recently been added/updated
|
||||||
|
|
||||||
|
|
||||||
//today, no events
|
//today, no events
|
||||||
$CALENDAR_MENU_DAY_START['1'] = "<td class='indent' style='width:14.28%; padding:1px; text-align:center; '>";
|
$CALENDAR_MENU_DAY_START['1'] = "<td class='indent' style='width:14.28%; padding:1px; text-align:center; '>";
|
||||||
@@ -233,14 +265,15 @@ $CALENDAR_MENU_DAY_START['2'] = "<td class='forumheader3' style='width:14.28%; p
|
|||||||
|
|
||||||
//day has events - same whether its today or not
|
//day has events - same whether its today or not
|
||||||
$CALENDAR_MENU_DAY_START['3'] = "<td class='indent' style='width:14.28%; padding:1px; text-align:center; '>";
|
$CALENDAR_MENU_DAY_START['3'] = "<td class='indent' style='width:14.28%; padding:1px; text-align:center; '>";
|
||||||
$CALENDAR_MENU_DAY_START['4'] = "<td class='indent' style='width:14.28%; padding:1px; text-align:center;'>";
|
$CALENDAR_MENU_DAY_START['4'] = "<td class='indent' style='width:14.28%; padding:1px; text-align:center; '>";
|
||||||
// day has events, one which is recently added/updated
|
// day has events, one which is recently added/updated
|
||||||
$CALENDAR_MENU_DAY_START['5'] = "<td class='indent' style='width:14.28%; padding:1px; text-align:center; '>";
|
$CALENDAR_MENU_DAY_START['5'] = "<td class='indent' style='width:14.28%; padding:1px; text-align:center; '>";
|
||||||
$CALENDAR_MENU_DAY_START['6'] = "<td class='indent' style='width:14.28%; padding:1px; text-align:center;'>";
|
$CALENDAR_MENU_DAY_START['6'] = "<td class='indent' style='width:14.28%; padding:1px; text-align:center; '>";
|
||||||
// Example highlight using background colour:
|
// Example highlight using background colour:
|
||||||
//$CALENDAR_MENU_DAY_START['5'] = "<td class='indent' style='width:14.28%; padding:1px; text-align:center; background-color: #FF8000;'>";
|
//$CALENDAR_MENU_DAY_START['5'] = "<td class='indent' style='width:14.28%; padding:1px; text-align:center; background-color: #FF8000;'>";
|
||||||
//$CALENDAR_MENU_DAY_START['6'] = "<td class='indent' style='width:14.28%; padding:1px; text-align:center; background-color: #FF0000; '>";
|
//$CALENDAR_MENU_DAY_START['6'] = "<td class='indent' style='width:14.28%; padding:1px; text-align:center; background-color: #FF0000; '>";
|
||||||
|
|
||||||
|
|
||||||
$CALENDAR_MENU_DAY_END['1'] = "</td>";
|
$CALENDAR_MENU_DAY_END['1'] = "</td>";
|
||||||
$CALENDAR_MENU_DAY_END['2'] = "</td>";
|
$CALENDAR_MENU_DAY_END['2'] = "</td>";
|
||||||
$CALENDAR_MENU_DAY_END['3'] = "</td>";
|
$CALENDAR_MENU_DAY_END['3'] = "</td>";
|
||||||
@@ -250,19 +283,19 @@ $CALENDAR_MENU_DAY_END['6'] = "</td>";
|
|||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
// Next event menu template
|
// Next event menu template
|
||||||
$sc_style['NEXT_EVENT_TIME']['pre'] = EC_LAN_144;
|
$sc_style['EC_NEXT_EVENT_TIME']['pre'] = EC_LAN_144;
|
||||||
$sc_style['NEXT_EVENT_TIME']['post'] = "";
|
$sc_style['EC_NEXT_EVENT_TIME']['post'] = "";
|
||||||
// Following are original styles
|
// Following are original styles
|
||||||
//$sc_style['NEXT_EVENT_ICON']['pre'] = "<img style='border:0px' src='";
|
//$sc_style['NEXT_EVENT_ICON']['pre'] = "<img style='border:0px' src='";
|
||||||
//$sc_style['NEXT_EVENT_ICON']['post'] = "' alt='' /> ";
|
//$sc_style['NEXT_EVENT_ICON']['post'] = "' alt='' /> ";
|
||||||
// Following to 'float right' on a larger icon
|
// Following to 'float right' on a larger icon
|
||||||
$sc_style['NEXT_EVENT_ICON']['pre'] = "<img style='clear: right; float: left; margin: 0px 3px 0px 0px; padding:1px; border: 0px;' src='";
|
$sc_style['EC_NEXT_EVENT_ICON']['pre'] = "<img style='clear: right; float: left; margin: 0px 3px 0px 0px; padding:1px; border: 0px;' src='";
|
||||||
$sc_style['NEXT_EVENT_ICON']['post'] = "' alt='' />";
|
$sc_style['EC_NEXT_EVENT_ICON']['post'] = "' alt='' />";
|
||||||
|
|
||||||
|
|
||||||
if (!isset($EVENT_CAL_FE_LINE))
|
if (!isset($EVENT_CAL_FE_LINE))
|
||||||
{
|
{
|
||||||
$EVENT_CAL_FE_LINE = "{NEXT_EVENT_ICON}{NEXT_EVENT_DATE}{NEXT_EVENT_TIME}<br /><strong>{NEXT_EVENT_TITLE}</strong>{NEXT_EVENT_GAP}";
|
$EVENT_CAL_FE_LINE = "{EC_NEXT_EVENT_RECENT_ICON}{EC_NEXT_EVENT_ICON}{EC_NEXT_EVENT_DATE}{EC_NEXT_EVENT_TIME}<br /><strong>{EC_NEXT_EVENT_TITLE}</strong>{EC_NEXT_EVENT_GAP}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,11 +1,36 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/*
|
||||||
|
+ ----------------------------------------------------------------------------+
|
||||||
|
| e107 website system
|
||||||
|
|
|
||||||
|
| <20>Steve Dunstan 2001-2002
|
||||||
|
| http://e107.org
|
||||||
|
| jalist@e107.org
|
||||||
|
|
|
||||||
|
| Released under the terms and conditions of the
|
||||||
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
||||||
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/e_list.php,v $
|
||||||
|
| $Revision: 1.2 $
|
||||||
|
| $Date: 2007-07-13 19:37:52 $
|
||||||
|
| $Author: e107steved $
|
||||||
|
|
|
||||||
|
+----------------------------------------------------------------------------+
|
||||||
|
*/
|
||||||
|
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
if(!$calendar_install = $sql -> db_Select("plugin", "*", "plugin_path = 'calendar_menu' AND plugin_installflag = '1' "))
|
if (isset($pref['plug_installed'])
|
||||||
{
|
{
|
||||||
return;
|
if (!isset($pref['plug_installed']['calendar_menu'])) return;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{ // Support 'legacy' method as well for now
|
||||||
|
if(!$calendar_install = $sql -> db_Select("plugin", "*", "plugin_path = 'calendar_menu' AND plugin_installflag = '1' "))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$LIST_CAPTION = $arr[0];
|
$LIST_CAPTION = $arr[0];
|
||||||
$LIST_DISPLAYSTYLE = ($arr[2] ? "" : "none");
|
$LIST_DISPLAYSTYLE = ($arr[2] ? "" : "none");
|
||||||
|
@@ -11,9 +11,9 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/e_notify.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/e_notify.php,v $
|
||||||
| $Revision: 1.1.1.1 $
|
| $Revision: 1.2 $
|
||||||
| $Date: 2006-12-02 04:34:46 $
|
| $Date: 2007-07-13 19:37:52 $
|
||||||
| $Author: mcfly_e107 $
|
| $Author: e107steved $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -1,9 +1,28 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/*
|
||||||
// Reflects updates to CVS version 1.3 made 29.10.2006
|
+ ----------------------------------------------------------------------------+
|
||||||
|
| e107 website system
|
||||||
|
|
|
||||||
|
| <20>Steve Dunstan 2001-2002
|
||||||
|
| http://e107.org
|
||||||
|
| jalist@e107.org
|
||||||
|
|
|
||||||
|
| Released under the terms and conditions of the
|
||||||
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
||||||
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/e_rss.php,v $
|
||||||
|
| $Revision: 1.2 $
|
||||||
|
| $Date: 2007-07-13 19:37:52 $
|
||||||
|
| $Author: e107steved $
|
||||||
|
|
|
||||||
|
+----------------------------------------------------------------------------+
|
||||||
|
*/
|
||||||
|
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
|
if (isset($pref['plug_installed']) && !isset($pref['plug_installed']['calendar_menu'])) return;
|
||||||
|
|
||||||
|
|
||||||
//##### create feed for admin, return array $eplug_rss_feed --------------------------------
|
//##### create feed for admin, return array $eplug_rss_feed --------------------------------
|
||||||
$feed['name'] = EC_ADLAN_A12;
|
$feed['name'] = EC_ADLAN_A12;
|
||||||
$feed['url'] = 'calendar'; //the identifier for the rss feed url
|
$feed['url'] = 'calendar'; //the identifier for the rss feed url
|
||||||
|
72
e107_plugins/calendar_menu/ec_mailout_template.php
Normal file
72
e107_plugins/calendar_menu/ec_mailout_template.php
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
+ ----------------------------------------------------------------------------+
|
||||||
|
| e107 website system
|
||||||
|
|
|
||||||
|
| <20>Steve Dunstan 2001-2002
|
||||||
|
| http://e107.org
|
||||||
|
| jalist@e107.org
|
||||||
|
|
|
||||||
|
| Released under the terms and conditions of the
|
||||||
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
||||||
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/ec_mailout_template.php,v $
|
||||||
|
| $Revision: 1.1 $
|
||||||
|
| $Date: 2007-07-13 19:37:52 $
|
||||||
|
| $Author: e107steved $
|
||||||
|
|
|
||||||
|
+----------------------------------------------------------------------------+
|
||||||
|
|
||||||
|
This template is used during the subscription mailouts - it is inserted at the front of the text
|
||||||
|
defined for each category.
|
||||||
|
Main purpose is to define the 'pre' and 'post' styles, but it can be used much as any E107 template
|
||||||
|
*/
|
||||||
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
|
$sc_style['EC_MAIL_HEADING_DATE']['pre'] = "";
|
||||||
|
$sc_style['EC_MAIL_HEADING_DATE']['post'] = "";
|
||||||
|
|
||||||
|
$sc_style['EC_MAIL_SHORT_DATE']['pre'] = "";
|
||||||
|
$sc_style['EC_MAIL_SHORT_DATE']['post'] = "";
|
||||||
|
|
||||||
|
$sc_style['EC_MAIL_TITLE']['pre'] = "";
|
||||||
|
$sc_style['EC_MAIL_TITLE']['post'] = "";
|
||||||
|
|
||||||
|
$sc_style['EC_MAIL_ID']['pre'] = "";
|
||||||
|
$sc_style['EC_MAIL_ID']['post'] = "";
|
||||||
|
|
||||||
|
$sc_style['EC_MAIL_DETAILS']['pre'] = "";
|
||||||
|
$sc_style['EC_MAIL_DETAILS']['post'] = "";
|
||||||
|
|
||||||
|
$sc_style['EC_MAIL_LOCATION']['pre'] = EC_LAN_32." ";
|
||||||
|
$sc_style['EC_MAIL_LOCATION']['post'] = "";
|
||||||
|
|
||||||
|
$sc_style['EC_MAIL_AUTHOR']['pre'] = EC_LAN_31." ";
|
||||||
|
$sc_style['EC_MAIL_AUTHOR']['post'] = "";
|
||||||
|
|
||||||
|
$sc_style['EC_MAIL_CONTACT']['pre'] = EC_LAN_33." ";
|
||||||
|
$sc_style['EC_MAIL_CONTACT']['post'] = "";
|
||||||
|
|
||||||
|
$sc_style['EC_MAIL_THREAD']['pre'] = "";
|
||||||
|
$sc_style['EC_MAIL_THREAD']['post'] = "";
|
||||||
|
|
||||||
|
$sc_style['EC_MAIL_LINK']['pre'] = "";
|
||||||
|
$sc_style['EC_MAIL_LINK']['post'] = "";
|
||||||
|
|
||||||
|
$sc_style['EC_MAIL_CATEGORY']['pre'] = "";
|
||||||
|
$sc_style['EC_MAIL_CATEGORY']['post'] = "";
|
||||||
|
|
||||||
|
$sc_style['EC_MAIL_DATE_START']['pre'] = (isset($thisevent['event_allday']) && $thisevent['event_allday']) ? EC_LAN_68." " : EC_LAN_29." ";
|
||||||
|
$sc_style['EC_MAIL_DATE_START']['post'] = "";
|
||||||
|
|
||||||
|
$sc_style['EC_MAIL_TIME_START']['pre'] = EC_LAN_144;
|
||||||
|
$sc_style['EC_MAIL_TIME_START']['post'] = "";
|
||||||
|
|
||||||
|
$sc_style['EC_MAIL_DATE_END']['pre'] = EC_LAN_69." ";
|
||||||
|
$sc_style['EC_MAIL_DATE_END']['post'] = "";
|
||||||
|
|
||||||
|
$sc_style['EC_MAIL_TIME_END']['pre'] = EC_LAN_144;
|
||||||
|
$sc_style['EC_MAIL_TIME_END']['post'] = "";
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
424
e107_plugins/calendar_menu/ec_pf_page.php
Normal file
424
e107_plugins/calendar_menu/ec_pf_page.php
Normal file
@@ -0,0 +1,424 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
+ ----------------------------------------------------------------------------+
|
||||||
|
| e107 website system
|
||||||
|
|
|
||||||
|
| <20>Steve Dunstan 2001-2002
|
||||||
|
| http://e107.org
|
||||||
|
| jali.@e107.org
|
||||||
|
|
|
||||||
|
| Released under the terms and conditions of the
|
||||||
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
||||||
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/ec_pf_page.php,v $
|
||||||
|
| $Revision: 1.1 $
|
||||||
|
| $Date: 2007-07-13 19:37:52 $
|
||||||
|
| $Author: e107steved $
|
||||||
|
|
|
||||||
|
| Generate a printer-friendly page of calendar events
|
||||||
|
| Query is: ec_pf_page.php?ssssss.eeeeee[[[.cat].template].output]
|
||||||
|
|
|
||||||
|
| Date format is yyyymmdd or yyyymm to make it easy to generate fixed queries.
|
||||||
|
| cat is a number corresponding to a category ID. '*' or blank gives all categories
|
||||||
|
| template determines output style ('*' selects the default template)
|
||||||
|
| output can be 'display' (default), 'print' or 'pdf'
|
||||||
|
|
|
||||||
|
| Mostly the template can use the EVENT and MAIL shortcodes - pretty much anything that
|
||||||
|
| uses $thisevent as a parameter. MAIL is best since it's never used elsewhere at the same time
|
||||||
|
+----------------------------------------------------------------------------+
|
||||||
|
*/
|
||||||
|
require_once("../../class2.php");
|
||||||
|
if (!isset($pref['plug_installed']['calendar_menu'])) header("Location: ".e_BASE."index.php");
|
||||||
|
include_lan(e_PLUGIN."calendar_menu/languages/".e_LANGUAGE.".php");
|
||||||
|
define("PAGE_NAME", EC_LAN_80);
|
||||||
|
|
||||||
|
require_once(e_PLUGIN.'calendar_menu/ecal_class.php');
|
||||||
|
$ecal_class = new ecal_class;
|
||||||
|
|
||||||
|
require_once(e_PLUGIN."calendar_menu/calendar_shortcodes.php");
|
||||||
|
|
||||||
|
$message = "";
|
||||||
|
unset($ec_qs);
|
||||||
|
if (e_QUERY) $ec_qs = explode(".", e_QUERY);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!isset($pref['eventpost_printlists']) || ($pref['eventpost_printlists'] == 0))
|
||||||
|
header("location:".SITEURL); // If disabled, just go back to index page
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($_POST['set_dates']) && isset($_POST['start_date']) && (isset($_POST['end_date'])))
|
||||||
|
{
|
||||||
|
$ec_qs[0] = $_POST['start_date'];
|
||||||
|
$ec_qs[1] = $_POST['end_date'];
|
||||||
|
if (isset($_POST['event_cat_ids']))
|
||||||
|
{
|
||||||
|
$ec_qs[2] = $_POST['event_cat_ids'];
|
||||||
|
if ($ec_qs[2] == 'all') $ec_qs[2] = '*';
|
||||||
|
}
|
||||||
|
if (isset($_POST['template_choice'])) $ec_qs[3] = $_POST['template_choice'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isset($ec_qs[3])) $ec_qs[3] = 'default'; // Template
|
||||||
|
|
||||||
|
if (isset($_POST['output_type'])) $ec_qs[4] = $_POST['output_type'];
|
||||||
|
if (!isset($ec_qs[4]) || (($ec_qs[4]) != 'print') && ($ec_qs[4] != 'pdf') ) $ec_qs[4] = 'display';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
global $cal_super, $calendar_shortcodes;
|
||||||
|
$cal_super = $ecal_class->cal_super;
|
||||||
|
|
||||||
|
// Get templates, since we may have to give a choice if we're displaying something
|
||||||
|
// Actually load three in order so they can accumulate, and give the option of overriding other settings
|
||||||
|
$EVENT_CAL_PDF_HEADER = array();
|
||||||
|
$EVENT_CAL_PDF_BODY = array();
|
||||||
|
$EVENT_CAL_PDF_FOOTER = array();
|
||||||
|
if (is_readable(e_PLUGIN."calendar_menu/ec_pf_template.php")) require_once(e_PLUGIN."calendar_menu/ec_pf_template.php");
|
||||||
|
if (is_readable(e_PLUGIN."calendar_menu/ec_pf_user_template.php")) require_once(e_PLUGIN."calendar_menu/ec_pf_user_template.php");
|
||||||
|
if (is_readable(THEME."ec_pf_template.php")) require_once(THEME."ec_pf_template.php");
|
||||||
|
|
||||||
|
// Hard-coded alternatives
|
||||||
|
if (!count($EVENT_CAL_PDF_HEADER)) $EVENT_CAL_PDF_HEADER['default'] = "<br />";
|
||||||
|
if (!count($EVENT_CAL_PDF_BODY)) $EVENT_CAL_PDF_BODY['default'] = "{EC_MAIL_DATE_START} {EC_MAIL_TIME_START} {EC_MAIL_TITLE}<br />";
|
||||||
|
if (!count($EVENT_CAL_PDF_FOOTER)) $EVENT_CAL_PDF_FOOTER['default'] = "<br />";
|
||||||
|
if (!count($EVENT_CAL_PDF_NAMES)) $ec_pdf_template = 'default';
|
||||||
|
// If one name only, we just assign that
|
||||||
|
if (count($EVENT_CAL_PDF_NAMES) == 1)
|
||||||
|
{
|
||||||
|
$ec_pdf_template = array_pop(array_keys($EVENT_CAL_PDF_NAMES));
|
||||||
|
// echo "Assign template: ".$ec_pdf_template."<br />";
|
||||||
|
}
|
||||||
|
|
||||||
|
$ec_enable_pdf = ($pref['eventpost_printlists'] > 1) && is_readable(e_PLUGIN."pdf/e107pdf.php");
|
||||||
|
|
||||||
|
if (!isset($ec_qs[0]) || !isset($ec_qs[1]))
|
||||||
|
{
|
||||||
|
// Put up a prompt to get the view period
|
||||||
|
require_once(HEADERF);
|
||||||
|
$cal_text = "<div style='text-align:center'>
|
||||||
|
<form method='post' action='".e_SELF."'>
|
||||||
|
<table style='".USER_WIDTH."' class='fborder'>
|
||||||
|
<colgroup>
|
||||||
|
<col width = '60%';vertical-align:top; />
|
||||||
|
<col width = '40%';vertical-align:top; />
|
||||||
|
</colgroup>";
|
||||||
|
$cal_text .= "<tr>
|
||||||
|
<td class='forumheader3'>".EC_LAN_153."</td>
|
||||||
|
<td class='forumheader3' style='text_align:center'>";
|
||||||
|
$cal_text .= gen_drop(FALSE)."</td>
|
||||||
|
</tr><tr>
|
||||||
|
<td class='forumheader3'>".EC_LAN_154."</td>
|
||||||
|
<td class='forumheader3' style='text_align:center'>".gen_drop(TRUE)."</td>
|
||||||
|
</tr><tr>
|
||||||
|
<td class='forumheader3'>".EC_LAN_155."</td>
|
||||||
|
<td class='forumheader3' style='text_align:center'>";
|
||||||
|
$cal_text .= $tp->parseTemplate('{EC_NAV_CATEGORIES=nosubmit}',FALSE,$calendar_shortcodes);
|
||||||
|
$cal_text .= "</td>
|
||||||
|
</tr>";
|
||||||
|
if (isset($EVENT_CAL_PDF_NAMES) && is_array($EVENT_CAL_PDF_NAMES) && (count($EVENT_CAL_PDF_NAMES) > 1))
|
||||||
|
{ // Offer choice of templates
|
||||||
|
$cal_text .= "<tr>
|
||||||
|
<td class='forumheader3'>".EC_LAN_157."</td>
|
||||||
|
<td class='forumheader3' style='text_align:center'><select name='template_choice' class='tbox' style='width:140px;' >\n";
|
||||||
|
foreach($EVENT_CAL_PDF_NAMES as $ec_template_name => $ec_template_choice)
|
||||||
|
{
|
||||||
|
$cal_text .= "<option value='{$ec_template_name}'>{$ec_template_choice}</option>\n";
|
||||||
|
}
|
||||||
|
$cal_text .= "</select></td>
|
||||||
|
</tr>\n";
|
||||||
|
}
|
||||||
|
// Radio buttons to select output type
|
||||||
|
$cal_text .= "<tr>
|
||||||
|
<td class='forumheader3'>".EC_LAN_158."</td>
|
||||||
|
<td class='forumheader3' style='text_align:center'>";
|
||||||
|
$cal_text .= "
|
||||||
|
<input type='radio' name='output_type' value='display' checked='checked' /> ".EC_LAN_159."<br />
|
||||||
|
<input type='radio' name='output_type' value='print' /> ".EC_LAN_160."<br />";
|
||||||
|
if ($ec_enable_pdf)
|
||||||
|
{
|
||||||
|
$cal_text .= "<input type='radio' name='output_type' value='pdf' /> ".EC_LAN_161;
|
||||||
|
}
|
||||||
|
$cal_text .="</td></tr>";
|
||||||
|
|
||||||
|
$cal_text .= "<tr><td colspan='2' style='text-align:center' class='fcaption'><input class='button' type='submit' name='set_dates' value='".EC_LAN_156."' /></td></tr>";
|
||||||
|
|
||||||
|
$cal_text .= "</table></form></div>";
|
||||||
|
$ns->tablerender(EC_LAN_150, $cal_text);
|
||||||
|
require_once(FOOTERF);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (!is_numeric($ec_start_date = decode_date($ec_qs[0],FALSE)))
|
||||||
|
{
|
||||||
|
$message = $ec_start_date;
|
||||||
|
}
|
||||||
|
elseif (!is_numeric($ec_end_date = decode_date($ec_qs[1],TRUE)))
|
||||||
|
{
|
||||||
|
$message = $ec_end_date;
|
||||||
|
}
|
||||||
|
elseif ($ec_start_date >= $ec_end_date)
|
||||||
|
{
|
||||||
|
$message = EC_LAN_151;
|
||||||
|
}
|
||||||
|
elseif (($ec_end_date - $ec_start_date) > 366*86400)
|
||||||
|
{
|
||||||
|
$message = EC_LAN_152;
|
||||||
|
}
|
||||||
|
|
||||||
|
// That's the vetting of the query done (as much as we'll do)
|
||||||
|
if ($message !== "")
|
||||||
|
{
|
||||||
|
require_once(HEADERF);
|
||||||
|
$ns->tablerender(EC_LAN_80, $message);
|
||||||
|
require_once(FOOTERF);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
global $ec_current_month, $thisevent_start_date, $thisevent_end_date, $ec_output_type, $ec_category_list, $ec_list_title;
|
||||||
|
$ec_output_type = $ec_qs[4];
|
||||||
|
if (isset($ec_qs[5])) $ec_list_title = $ec_qs[5]; else $ec_list_title = EC_LAN_163;
|
||||||
|
$ec_list_title = str_replace('_',' ',$ec_list_title);
|
||||||
|
|
||||||
|
if (($ec_output_type == 'pdf') && !$ec_enable_pdf) $ec_output_type = 'display';
|
||||||
|
if ($ec_output_type == 'display') require_once(HEADERF);
|
||||||
|
|
||||||
|
|
||||||
|
// Allow a number of categories separated by a '&'
|
||||||
|
$cat_filter = 0;
|
||||||
|
$ec_category_list = EC_LAN_97; // Displayable version of categories - default to 'all'
|
||||||
|
if (isset($ec_qs[2]) && ($ec_qs[2] != '*'))
|
||||||
|
{
|
||||||
|
$ec_category_list = array();
|
||||||
|
$temp = explode('&',$ec_qs[2]);
|
||||||
|
foreach($temp as $t1)
|
||||||
|
{
|
||||||
|
if (!is_numeric($t1)) unset($t1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Now look up the category names in the database - check access rights at the same time
|
||||||
|
$temp = array(); // Accumulate valid category IDs
|
||||||
|
$cal_qry = "SELECT event_cat_id, event_cat_name FROM #event_cat WHERE find_in_set(event_cat_id, '{$ec_qs[2]}') ".$ecal_class->extra_query;
|
||||||
|
if ($sql->db_Select_gen($cal_qry))
|
||||||
|
{
|
||||||
|
while ($thiscat = $sql->db_Fetch())
|
||||||
|
{
|
||||||
|
$temp [] = $thiscat['event_cat_id'];
|
||||||
|
$ec_category_list[] = $thiscat['event_cat_name'];
|
||||||
|
}
|
||||||
|
$cat_filter = implode(',',$temp); // Gives us a comma separated numeric set of categories
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
echo EC_LAN_100."<br /><br />";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// $ec_start_date - earliest date of period
|
||||||
|
// $ec_end_date - latest date of period
|
||||||
|
|
||||||
|
// We'll potentially need virtually all of the event-related fields, so get them regardless. Just cut back on category fields
|
||||||
|
$ev_list = $ecal_class->get_events($ec_start_date, $ec_end_date, FALSE, $cat_filter, TRUE, '*', 'event_cat_name,event_cat_icon');
|
||||||
|
// Now go through and multiply up any recurring records
|
||||||
|
$tim_arr = array();
|
||||||
|
foreach ($ev_list as $k=>$event)
|
||||||
|
{
|
||||||
|
if (is_array($event['event_start']))
|
||||||
|
{
|
||||||
|
foreach ($event['event_start'] as $t)
|
||||||
|
{
|
||||||
|
$tim_arr[$t] = $k;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$tim_arr[$event['event_start']] = $k;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ksort($tim_arr); // Sort into time order
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (isset($ec_qs[3])) $ec_pdf_template = $ec_qs[3];
|
||||||
|
if (!isset($ec_pdf_template) || !array_key_exists($ec_pdf_template,$EVENT_CAL_PDF_NAMES)) $ec_pdf_template = 'default';
|
||||||
|
|
||||||
|
|
||||||
|
// These available to templates/shortcodes to pick up change of start day/month/year
|
||||||
|
global $ec_last_year, $ec_last_month, $ec_last_day, $ec_year_change, $ec_month_change, $ec_day_change;
|
||||||
|
global $ec_start_date, $ec_end_date, $ec_pdf_options;
|
||||||
|
$ec_last_year = 0;
|
||||||
|
$ec_last_month = 0;
|
||||||
|
$ec_last_day = 0;
|
||||||
|
$ec_pdf_options = ""; // Can configure the PDF driver
|
||||||
|
|
||||||
|
$cal_text = "";
|
||||||
|
$cal_totev = count($ev_list);
|
||||||
|
if ($cal_totev > 0)
|
||||||
|
{
|
||||||
|
if (isset($ec_template_styles[$ec_pdf_template]) && is_array($ec_template_styles[$ec_pdf_template]))
|
||||||
|
{
|
||||||
|
$ec_current_overrides = $ec_template_styles[$ec_pdf_template]; // Possible array of codes to override standard $sc_style
|
||||||
|
$sc_style = array_merge($sc_style,$ec_current_overrides); // Override as necessary
|
||||||
|
}
|
||||||
|
|
||||||
|
// If printing, wrap in a form so the button works
|
||||||
|
if ($ec_output_type == 'print') $cal_text .= "<form action=''>\n";
|
||||||
|
// Add header
|
||||||
|
$cal_text .= $tp->parseTemplate($EVENT_CAL_PDF_HEADER[$ec_pdf_template],TRUE,$calendar_shortcodes);
|
||||||
|
// Debug code
|
||||||
|
// echo "Start date: ".strftime("%d-%m-%Y %H:%M:%S",$ec_start_date)."<br />";
|
||||||
|
// echo "End date: ".strftime("%d-%m-%Y %H:%M:%S",$ec_end_date)."<br />";
|
||||||
|
// echo "Template: ".$ec_pdf_template,"<br />";
|
||||||
|
// echo "Header: ".$EVENT_CAL_PDF_HEADER[$ec_pdf_template]."<br />";
|
||||||
|
// echo "Body: ".$EVENT_CAL_PDF_BODY[$ec_pdf_template]."<br />";
|
||||||
|
// echo "Footer: ".$EVENT_CAL_PDF_FOOTER[$ec_pdf_template]."<br />";
|
||||||
|
|
||||||
|
foreach ($tim_arr as $tim => $ptr)
|
||||||
|
{
|
||||||
|
$ev_list[$ptr]['event_start'] = $tim;
|
||||||
|
$thisevent = $ev_list[$ptr];
|
||||||
|
// echo "Event: ".$thisevent['event_start']." ".$thisevent['event_title']."<br />";
|
||||||
|
// Decode dates into individual fields - we're bound to want them
|
||||||
|
$thisevent_start_date = $ecal_class->gmgetdate($thisevent['event_start']);
|
||||||
|
$thisevent_end_date = $ecal_class->gmgetdate($thisevent['event_end']);
|
||||||
|
|
||||||
|
$ec_year_change = ($ec_last_year != $thisevent_start_date['year']);
|
||||||
|
$ec_month_change = ($ec_last_month != $thisevent_start_date['mon']);
|
||||||
|
$ec_day_change = ($ec_last_day != $thisevent_start_date['mday']);
|
||||||
|
|
||||||
|
$cal_totev --; // Can use this to modify inter-event gap
|
||||||
|
$cal_text .= $tp->parseTemplate($EVENT_CAL_PDF_BODY[$ec_pdf_template],FALSE,$calendar_shortcodes);
|
||||||
|
|
||||||
|
$ec_last_year = $thisevent_start_date['year'];
|
||||||
|
$ec_last_month = $thisevent_start_date['mon'];
|
||||||
|
$ec_last_day = $thisevent_start_date['mday'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add footer
|
||||||
|
$cal_text .= $tp->parseTemplate($EVENT_CAL_PDF_FOOTER[$ec_pdf_template],FALSE,$calendar_shortcodes);
|
||||||
|
if ($ec_output_type == 'print') $cal_text .= "</form>\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$cal_text.= EC_LAN_148;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
switch ($ec_output_type)
|
||||||
|
{
|
||||||
|
case 'display':
|
||||||
|
$ns->tablerender(EC_LAN_80, $cal_text, 'ec_pf_page');
|
||||||
|
require_once(FOOTERF);
|
||||||
|
break;
|
||||||
|
case 'print' :
|
||||||
|
echo $cal_text;
|
||||||
|
break;
|
||||||
|
case 'pdf' :
|
||||||
|
$lan_file = e_PLUGIN."pdf/languages/".e_LANGUAGE.".php";
|
||||||
|
include_once(file_exists($lan_file) ? $lan_file : e_PLUGIN."pdf/languages/English.php");
|
||||||
|
define('FPDF_FONTPATH', 'font/');
|
||||||
|
require_once(e_PLUGIN."pdf/ufpdf.php"); //require the ufpdf class
|
||||||
|
require_once(e_PLUGIN."pdf/e107pdf.php"); //require the e107pdf class
|
||||||
|
if ($ec_pdf_options == "")
|
||||||
|
$pdf = new e107PDF();
|
||||||
|
else
|
||||||
|
$pdf = new e107PDF($ec_pdf_options);
|
||||||
|
// $text = array($text, $creator, $author, $title, $subject, $keywords, $url);
|
||||||
|
$text = array($cal_text,'', '', EC_LAN_163,'','',e_SELF.e_QUERY);
|
||||||
|
$pdf->makePDF($text);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function decode_date($date_string,$last_day = FALSE)
|
||||||
|
{ // Decode a date string
|
||||||
|
if (strpos($date_string,'now') === 0)
|
||||||
|
{ // decode special dates
|
||||||
|
$today = getdate();
|
||||||
|
$date_string = trim(substr($date_string,3)); // Knock off the 'now'
|
||||||
|
if (($date_string != '') && ($date_string[0] == '+'))
|
||||||
|
{
|
||||||
|
$date_string = trim(substr($date_string,1)); // Knock off the '+'
|
||||||
|
if (is_numeric($date_string) && ($date_string >= 0) && ($date_string <= 12))
|
||||||
|
{
|
||||||
|
$today['mon'] += $date_string;
|
||||||
|
if ($today['mon'] > 12)
|
||||||
|
{
|
||||||
|
$today['mon'] -= 12;
|
||||||
|
$today['year'] += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return EC_LAN_149;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$date_string = $today['year'].$today['mon'];
|
||||||
|
}
|
||||||
|
if (ctype_digit($date_string))
|
||||||
|
{
|
||||||
|
$month = 0;
|
||||||
|
$day = 1;
|
||||||
|
if (strlen($date_string) == 5) $date_string = substr_replace($date_string,'0',-1,0);
|
||||||
|
if (strlen($date_string) == 8)
|
||||||
|
{
|
||||||
|
$day = substr($date_string,-2,2);
|
||||||
|
if ($last_day) $day += 1;
|
||||||
|
}
|
||||||
|
elseif (strlen($date_string) == 6)
|
||||||
|
{
|
||||||
|
if ($last_day) $month = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{ // Error
|
||||||
|
return EC_LAN_149;
|
||||||
|
}
|
||||||
|
$month += substr($date_string,4,2);
|
||||||
|
$year = substr($date_string,0,4);
|
||||||
|
$temp = mktime(0,0,0,$month,$day,$year);
|
||||||
|
if ($last_day) $temp -= 1; // Always do this to get whole of last day
|
||||||
|
return $temp;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{ // Error
|
||||||
|
return EC_LAN_149;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Generate monthly drop-down - FALSE = first, TRUE = last
|
||||||
|
// For the first date we want beginning of previous year to end of current year
|
||||||
|
// For the last date we want end of next
|
||||||
|
function gen_drop($drop_type)
|
||||||
|
{
|
||||||
|
$text = "<select name='".($drop_type ? 'end_date' : 'start_date')."' class='tbox' style='width:140px;' >\n";
|
||||||
|
if ($drop_type)
|
||||||
|
{
|
||||||
|
$start_date = strtotime("-3 months");
|
||||||
|
$match_date = strtotime("+3 months"); // Propose 3-month list
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$start_date = strtotime("-9 months");
|
||||||
|
// $match_date = strtotime("-1 months");
|
||||||
|
$match_date = time(); // Use current month for start date
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get date to be 1st of month
|
||||||
|
$date = getdate($match_date);
|
||||||
|
$match_date = mktime(0,0,0,$date['mon'],1,$date['year'],FALSE);
|
||||||
|
|
||||||
|
for ($i = 0; $i < 24; $i++)
|
||||||
|
{
|
||||||
|
$sel_text = (($match_date == $start_date) ? "selected='selected'" : "");
|
||||||
|
$date = getdate($start_date);
|
||||||
|
$text .= "<option value = '{$date['year']}{$date['mon']}' {$sel_text}>{$date['month']} {$date['year']} </option>\n";
|
||||||
|
$start_date = mktime(0,0,0,$date['mon']+1,1,$date['year'],FALSE);
|
||||||
|
}
|
||||||
|
$text .= "</select>\n";
|
||||||
|
return $text;
|
||||||
|
}
|
||||||
|
?>
|
86
e107_plugins/calendar_menu/ec_pf_template.php
Normal file
86
e107_plugins/calendar_menu/ec_pf_template.php
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
Templates file for the event calendar listings (display/print/pdf).
|
||||||
|
There can be more than one template defined, in which case they are selectable.
|
||||||
|
There are four strings to define:
|
||||||
|
$EVENT_CAL_PDF_NAMES[] - a 'user-friendly' name/description (shown in selection box)
|
||||||
|
$EVENT_CAL_PDF_HEADER[] - the template for the header - displayed once at the top pf the list
|
||||||
|
$EVENT_CAL_PDF_BODY[] - template for each individual entry
|
||||||
|
$EVENT_CAL_PDF_FOOTER[] - template for a footer (to close off the list)
|
||||||
|
|
||||||
|
The array index defines the name of the template - if there is an entry in the $EVENT_CAL_PDF_NAMES[]
|
||||||
|
array, there must be a corresponding entry in each of the other three arrays.
|
||||||
|
|
||||||
|
There are two ways of managing the styling of the various shortcodes:
|
||||||
|
a) The $sc_style array works in the usual way, and should be used where the styling is the same
|
||||||
|
for all templates, or where you can set a 'default' styling which applies to most uses of the shortcode
|
||||||
|
b) An $ec_template_styles array sets styles for an individual template. This need only contain the
|
||||||
|
styles which override a default $sc_style entry.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
if (!defined("USER_WIDTH")){ define("USER_WIDTH","width:auto"); }
|
||||||
|
|
||||||
|
$sc_style['EC_PR_CHANGE_YEAR']['pre'] = '<br /><em><strong>';
|
||||||
|
$sc_style['EC_PR_CHANGE_YEAR']['post'] = '</strong></em>';
|
||||||
|
$sc_style['EC_PR_CHANGE_MONTH']['pre'] = '<br /><strong>';
|
||||||
|
$sc_style['EC_PR_CHANGE_MONTH']['post'] = '</strong><br />';
|
||||||
|
$sc_style['EC_PRINT_BUTTON']['pre'] = "<br /><div style='text-align:center'>";
|
||||||
|
$sc_style['EC_PRINT_BUTTON']['post'] = "</div>";
|
||||||
|
$sc_style['EC_NOW_DATE']['pre'] = EC_LAN_170;
|
||||||
|
$sc_style['EC_NOW_DATE']['post'] = "";
|
||||||
|
$sc_style['EC_NOW_TIME']['pre'] = EC_LAN_144;
|
||||||
|
$sc_style['EC_NOW_TIME']['post'] = "";
|
||||||
|
$sc_style['EC_PR_CAT_LIST']['pre'] = EC_LAN_172;
|
||||||
|
$sc_style['EC_PR_CAT_LIST']['post'] = "";
|
||||||
|
$sc_style['EC_PR_LIST_TITLE']['pre'] = "<h3>";
|
||||||
|
$sc_style['EC_PR_LIST_TITLE']['post'] = "</h3>";
|
||||||
|
|
||||||
|
// - Default style - very basic
|
||||||
|
$EVENT_CAL_PDF_NAMES['default'] = EC_LAN_165;
|
||||||
|
$EVENT_CAL_PDF_HEADER['default'] = "{EC_PR_LIST_TITLE}<br />{EC_PR_CAT_LIST}<br />".EC_LAN_168."{EC_PR_LIST_START=%d-%m-%Y}<br />".EC_LAN_169."{EC_PR_LIST_END=%d-%m-%Y}<br />";
|
||||||
|
$EVENT_CAL_PDF_BODY['default'] = "{EC_PR_CHANGE_YEAR}{EC_PR_CHANGE_MONTH}{EC_MAIL_SHORT_DATE} {EC_MAIL_TIME_START} {EC_MAIL_TITLE}<br />\n";
|
||||||
|
$EVENT_CAL_PDF_FOOTER['default'] = "---End of List---<br />{EC_IFNOT_DISPLAY=EC_NOW_DATE}{EC_IFNOT_DISPLAY=EC_NOW_TIME}<br />{EC_PRINT_BUTTON}";
|
||||||
|
|
||||||
|
|
||||||
|
// - A simple tabular style
|
||||||
|
$ec_template_styles['simple']['EC_PR_CHANGE_YEAR']['pre'] = "<tr><td colspan='4'><em><strong><br />";
|
||||||
|
$ec_template_styles['simple']['EC_PR_CHANGE_YEAR']['post'] = '</strong></em></td></tr>';
|
||||||
|
$ec_template_styles['simple']['EC_PR_CHANGE_MONTH']['pre'] = '<strong>';
|
||||||
|
$ec_template_styles['simple']['EC_PR_CHANGE_MONTH']['post'] = '</strong>';
|
||||||
|
|
||||||
|
$EVENT_CAL_PDF_NAMES['simple'] = EC_LAN_166;
|
||||||
|
$EVENT_CAL_PDF_HEADER['simple'] = "{EC_IF_PRINT=LOGO}<table border='0px' cellspacing='10px' cellpadding='5px'>
|
||||||
|
<colgroup> <col width='15%'><col width='10%'><col width='10%'><col width='65%'></colgroup>
|
||||||
|
<tr ><td colspan='4' style='text-align:center'>".EC_LAN_163."<br />".EC_LAN_168."{EC_PR_LIST_START=%d-%m-%Y}<br />".EC_LAN_169."{EC_PR_LIST_END=%d-%m-%Y}</td></tr>";
|
||||||
|
$EVENT_CAL_PDF_BODY['simple'] = "{EC_PR_CHANGE_YEAR}<tr><td>{EC_PR_CHANGE_MONTH} </td>
|
||||||
|
<td>{EC_MAIL_DATE_START=%a %d}</td><td>{EC_MAIL_TIME_START}</td><td>{EC_MAIL_TITLE}</td></tr>\n";
|
||||||
|
$EVENT_CAL_PDF_FOOTER['simple'] = "</table><br /><br />{EC_IFNOT_DISPLAY=EC_NOW_DATE}{EC_IFNOT_DISPLAY=EC_NOW_TIME} <br />{EC_PRINT_BUTTON}";
|
||||||
|
|
||||||
|
|
||||||
|
// - A tabular style with lines round the cells
|
||||||
|
$ec_template_styles['tlinclines']['EC_PR_CHANGE_YEAR']['pre'] = "<tr><td colspan='3'><em><strong><br />";
|
||||||
|
$ec_template_styles['tlinclines']['EC_PR_CHANGE_YEAR']['post'] = '</strong></em></td></tr>';
|
||||||
|
|
||||||
|
$EVENT_CAL_PDF_NAMES['tlinclines'] = EC_LAN_167;
|
||||||
|
$EVENT_CAL_PDF_HEADER['tlinclines'] = "<table border='1px' cellspacing='0px' cellpadding='5px'>
|
||||||
|
<colgroup> <col width='22%'><col width='8%'><col width='70%'></colgroup>
|
||||||
|
<tr ><td colspan='4' style='text-align:center'>".EC_LAN_163."<br />".EC_LAN_168."{EC_PR_LIST_START=%d-%m-%Y}<br />".EC_LAN_169."{EC_PR_LIST_END=%d-%m-%Y}<br /></td></tr>";
|
||||||
|
$EVENT_CAL_PDF_BODY['tlinclines'] = "{EC_PR_CHANGE_YEAR}<tr>
|
||||||
|
<td>{EC_MAIL_DATE_START}</td><td>{EC_MAIL_TIME_START}</td><td>{EC_MAIL_TITLE}</td></tr>\n";
|
||||||
|
$EVENT_CAL_PDF_FOOTER['tlinclines'] = "</table><br /><br />{EC_IFNOT_DISPLAY=EC_NOW_DATE=%d-%m-%y}{EC_IFNOT_DISPLAY=EC_NOW_TIME}{EC_PRINT_BUTTON}";
|
||||||
|
|
||||||
|
// - A tabular style with lines round the cells and categories
|
||||||
|
$ec_template_styles['tlinccatlines']['EC_PR_CHANGE_YEAR']['pre'] = "<tr><td colspan='4'><em><strong><br />";
|
||||||
|
$ec_template_styles['tlinccatlines']['EC_PR_CHANGE_YEAR']['post'] = '</strong></em></td></tr>';
|
||||||
|
|
||||||
|
$EVENT_CAL_PDF_NAMES['tlinccatlines'] = EC_LAN_171;
|
||||||
|
$EVENT_CAL_PDF_HEADER['tlinccatlines'] = "<table border='1px' cellspacing='0px' cellpadding='5px'>
|
||||||
|
<colgroup> <col width='12%'><col width='8%'><col width='18%'><col width='62%'></colgroup>
|
||||||
|
<tr ><td colspan='4' style='text-align:center'>".EC_LAN_163."<br />".EC_LAN_168."{EC_PR_LIST_START=%d-%m-%Y}<br />".EC_LAN_169."{EC_PR_LIST_END=%d-%m-%Y}<br /></td></tr>";
|
||||||
|
$EVENT_CAL_PDF_BODY['tlinccatlines'] = "{EC_PR_CHANGE_YEAR}<tr>
|
||||||
|
<td>{EC_MAIL_DATE_START=%D %d %b}</td><td>{EC_MAIL_TIME_START}</td><td>{EC_MAIL_CATEGORY}</td><td>{EC_MAIL_TITLE}</td></tr>\n";
|
||||||
|
$EVENT_CAL_PDF_FOOTER['tlinccatlines'] = "</table><br /><br />{EC_IFNOT_DISPLAY=EC_NOW_DATE=%d-%m-%y}{EC_IFNOT_DISPLAY=EC_NOW_TIME}{EC_PRINT_BUTTON}";
|
||||||
|
|
||||||
|
?>
|
@@ -11,15 +11,13 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/ecal_class.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/ecal_class.php,v $
|
||||||
| $Revision: 1.1.1.1 $
|
| $Revision: 1.2 $
|
||||||
| $Date: 2006-12-02 04:34:47 $
|
| $Date: 2007-07-13 19:37:52 $
|
||||||
| $Author: mcfly_e107 $
|
| $Author: e107steved $
|
||||||
|
|
|
|
||||||
| Event calendar class for gradual enhancement
|
| Event calendar class:
|
||||||
| (Some bits may be usefully transferred to common code later)
|
| Pre-calculates/caches many useful values
|
||||||
|
|
| Implements functions used in most of the code
|
||||||
| 11.11.06 - Add date formatting options
|
|
||||||
| - Add notify
|
|
||||||
|
|
|
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
@@ -27,11 +25,14 @@
|
|||||||
/*
|
/*
|
||||||
Preferences used:
|
Preferences used:
|
||||||
eventpost_caltime 1 = server, 2 = site, 3 = user
|
eventpost_caltime 1 = server, 2 = site, 3 = user
|
||||||
eventpost_timedisplay 1 = 24 hour, 2 = 12 hour default, 3 = custom
|
eventpost_timedisplay 1 = 24 hour hhmm, 2 = 12 hour default, 3 = custom, 4 = 24 hour hh:mm
|
||||||
eventpost_timecustom String for custom time display
|
eventpost_timecustom String for custom time display
|
||||||
|
|
||||||
date() returns formatted date/time string
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
|
if (!defined("EC_DEFAULT_CATEGORY")) { define('EC_DEFAULT_CATEGORY',"Default"); }
|
||||||
|
|
||||||
class ecal_class
|
class ecal_class
|
||||||
{
|
{
|
||||||
// Useful time/date variables - set up on creation, and available externally
|
// Useful time/date variables - set up on creation, and available externally
|
||||||
@@ -56,13 +57,33 @@ Preferences used:
|
|||||||
var $event_date_format_string; // String to format the date in the event calendar
|
var $event_date_format_string; // String to format the date in the event calendar
|
||||||
var $next_date_format_string; // String to format the date in the 'forthcoming event' menu
|
var $next_date_format_string; // String to format the date in the 'forthcoming event' menu
|
||||||
|
|
||||||
var $max_cache_time; // Oldest permissible age of any cached pages relating to event calendar
|
var $date_separator = '-'; // Used for separating off fields on date entry
|
||||||
var $max_recent_show; // Time in seconds for showing 'recent events'
|
|
||||||
|
|
||||||
|
var $max_cache_time; // Oldest permissible age of any cached pages relating to event calendar
|
||||||
|
var $max_recent_show; // Time in seconds for highlighting 'recent events' (0 = disable)
|
||||||
|
var $cat_text_cache = array(); // Used to cache category text as read
|
||||||
|
|
||||||
|
var $ec_first_day_of_week = 0; // First day of the week
|
||||||
|
var $days = array(EC_LAN_25, EC_LAN_19, EC_LAN_20, EC_LAN_21, EC_LAN_22, EC_LAN_23, EC_LAN_24); // Array Sunday..Saturday
|
||||||
|
var $recur_type = array('0' => 'no', '1' => 'annual', '2' => 'biannual', '3' =>'quarterly', '4' => 'monthly', '5' => 'four weekly',
|
||||||
|
'6' => 'fortnightly', '7' => 'weekly', '8' => 'daily',
|
||||||
|
'100' => 'Sunday in month',
|
||||||
|
'101' => 'Monday in month',
|
||||||
|
'102' => 'Tuesday in month',
|
||||||
|
'103' => 'Wednesday in month',
|
||||||
|
'104' => 'Thursday in month',
|
||||||
|
'105' => 'Friday in month',
|
||||||
|
'106' => 'Saturday in month'
|
||||||
|
);
|
||||||
|
var $recur_week = array('100' => 'First', '200' => 'Second', '300' => 'Third', '400' => 'Fourth');
|
||||||
|
|
||||||
|
|
||||||
function ecal_class()
|
function ecal_class()
|
||||||
{ // Constructor
|
{ // Constructor
|
||||||
global $pref;
|
global $pref;
|
||||||
|
|
||||||
|
// Get all the times in terms of 'clock time' - i.e. allowing for TZ, DST, etc
|
||||||
|
// All the times in the DB should be 'absolute' - so if we compare with 'clock time' it should work out.
|
||||||
$this->time_now = time();
|
$this->time_now = time();
|
||||||
$this->site_timedate = $this->time_now + ($pref['time_offset'] * 3600); // Check sign of offset
|
$this->site_timedate = $this->time_now + ($pref['time_offset'] * 3600); // Check sign of offset
|
||||||
$this->user_timedate = $this->time_now + TIMEOFFSET;
|
$this->user_timedate = $this->time_now + TIMEOFFSET;
|
||||||
@@ -86,14 +107,19 @@ Preferences used:
|
|||||||
$this->cal_super = check_class($pref['eventpost_super']);
|
$this->cal_super = check_class($pref['eventpost_super']);
|
||||||
if ($this->cal_super) $this->extra_query = ""; else $this->extra_query = " AND find_in_set(event_cat_class,'".USERCLASS_LIST."')";
|
if ($this->cal_super) $this->extra_query = ""; else $this->extra_query = " AND find_in_set(event_cat_class,'".USERCLASS_LIST."')";
|
||||||
|
|
||||||
if (isset($pref['eventpost_recentshow']) && ($pref['eventpost_recentshow'] != 0))
|
$this->max_recent_show = 0;
|
||||||
|
if (isset($pref['eventpost_recentshow']))
|
||||||
{
|
{
|
||||||
$this->max_recent_show = 3600 * $pref['eventpost_recentshow'];
|
if ($pref['eventpost_recentshow'] == 'LV')
|
||||||
}
|
{
|
||||||
else
|
if (USER) $this->max_recent_show = time() - USERLV;
|
||||||
{
|
}
|
||||||
$this->max_recent_show = 0;
|
else
|
||||||
|
{
|
||||||
|
$this->max_recent_show = 3600 * $pref['eventpost_recentshow'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($pref['eventpost_timedisplay'])
|
switch ($pref['eventpost_timedisplay'])
|
||||||
{
|
{
|
||||||
case 2 :
|
case 2 :
|
||||||
@@ -102,28 +128,44 @@ Preferences used:
|
|||||||
case 3 :
|
case 3 :
|
||||||
$this->time_format_string = $pref['eventpost_timecustom']; // custom display
|
$this->time_format_string = $pref['eventpost_timecustom']; // custom display
|
||||||
if (isset($this->time_format_string)) break;
|
if (isset($this->time_format_string)) break;
|
||||||
|
case 4 :
|
||||||
|
$this->time_format_string = "%H:%M"; // 24-hour display with separator
|
||||||
|
break;
|
||||||
default :
|
default :
|
||||||
$this->time_format_string = "%H%M"; // default to 24-hour display
|
$this->time_format_string = "%H%M"; // default to 24-hour display
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($pref['eventpost_datedisplay'])
|
if (!isset($pref['eventpost_datedisplay'])) $pref['eventpost_datedisplay'] = 1;
|
||||||
|
$temp = $pref['eventpost_datedisplay'];
|
||||||
|
if ($temp >3)
|
||||||
|
{
|
||||||
|
$temp-= 3;
|
||||||
|
$this->date_separator = '.';
|
||||||
|
if ($temp > 3)
|
||||||
|
{
|
||||||
|
$temp -= 3;
|
||||||
|
$this->date_separator = '/';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
switch ($temp)
|
||||||
{ // Event entry calendar
|
{ // Event entry calendar
|
||||||
case 2 :
|
case 2 :
|
||||||
$this->cal_format_string = "d-m-Y";
|
$this->cal_format_string = "d".$this->date_separator."m".$this->date_separator."Y";
|
||||||
$this->dcal_format_string = "%d-%m-%Y";
|
$this->dcal_format_string = "%d".$this->date_separator."%m".$this->date_separator."%Y";
|
||||||
$this->java_format_code = 2;
|
$this->java_format_code = 2;
|
||||||
break;
|
break;
|
||||||
case 3 :
|
case 3 :
|
||||||
$this->cal_format_string = "m-d-Y";
|
$this->cal_format_string = "m".$this->date_separator."d".$this->date_separator."Y";
|
||||||
$this->dcal_format_string = "%m-%d-%Y";
|
$this->dcal_format_string = "%m".$this->date_separator."%d".$this->date_separator."%Y";
|
||||||
$this->java_format_code = 3;
|
$this->java_format_code = 3;
|
||||||
break;
|
break;
|
||||||
default : // 'original' defaults
|
default : // 'original' defaults
|
||||||
$this->cal_format_string = "Y-m-d";
|
$this->cal_format_string = "Y".$this->date_separator."m".$this->date_separator."d";
|
||||||
$this->dcal_format_string = "%Y-%m-%d";
|
$this->dcal_format_string = "%Y".$this->date_separator."%m".$this->date_separator."%d";
|
||||||
$this->java_format_code = 1;
|
$this->java_format_code = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isset($pref['eventpost_dateevent'])) $pref['eventpost_dateevent'] = 1;
|
||||||
switch ($pref['eventpost_dateevent'])
|
switch ($pref['eventpost_dateevent'])
|
||||||
{ // Event list date display
|
{ // Event list date display
|
||||||
case 0 :
|
case 0 :
|
||||||
@@ -139,6 +181,7 @@ Preferences used:
|
|||||||
$this->event_date_format_string = "%A %d %B %Y";
|
$this->event_date_format_string = "%A %d %B %Y";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isset($pref['eventpost_datenext'])) $pref['eventpost_datenext'] = 1;
|
||||||
switch ($pref['eventpost_datenext'])
|
switch ($pref['eventpost_datenext'])
|
||||||
{ // Forthcoming event date display
|
{ // Forthcoming event date display
|
||||||
case 0 :
|
case 0 :
|
||||||
@@ -156,45 +199,68 @@ Preferences used:
|
|||||||
default :
|
default :
|
||||||
$this->next_date_format_string = "%d %B";
|
$this->next_date_format_string = "%d %B";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch (varset($pref['eventpost_weekstart'],'sun'))
|
||||||
|
{
|
||||||
|
case 'sun' : $this->ec_first_day_of_week = 0; break;
|
||||||
|
case 'mon' : $this->ec_first_day_of_week = 1; break;
|
||||||
|
case 0 :
|
||||||
|
case 1 :
|
||||||
|
case 2 :
|
||||||
|
case 3 :
|
||||||
|
case 4 :
|
||||||
|
case 5 :
|
||||||
|
case 6 :
|
||||||
|
$this->ec_first_day_of_week = $pref['eventpost_weekstart']; break;
|
||||||
|
default :
|
||||||
|
$this->ec_first_day_of_week = 1;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function time_string($convtime)
|
function time_string($convtime)
|
||||||
{ // Returns a time string from a time stamp, formatted as 24-hour, 12-hour or custom as set in prefs
|
{ // Returns a time string from a time stamp, formatted as 24-hour, 12-hour or custom as set in prefs
|
||||||
return strftime($this->time_format_string, $convtime);
|
return gmstrftime($this->time_format_string, $convtime);
|
||||||
}
|
}
|
||||||
|
|
||||||
function event_date_string($convdate)
|
function event_date_string($convdate)
|
||||||
{ // Returns a date string from a date stamp, formatted for display in event list
|
{ // Returns a date string from a date stamp, formatted for display in event list
|
||||||
return strftime($this->event_date_format_string,$convdate);
|
return gmstrftime($this->event_date_format_string,$convdate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function next_date_string($convdate)
|
function next_date_string($convdate)
|
||||||
{ // Returns a date string from a date stamp, formatted for display in forthcoming event menu
|
{ // Returns a date string from a date stamp, formatted for display in forthcoming event menu
|
||||||
return strftime($this->next_date_format_string,$convdate);
|
return gmstrftime($this->next_date_format_string,$convdate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function full_date($convdate)
|
function full_date($convdate)
|
||||||
{ // Returns a date as dd-mm-yyyy or yyyy-mm-dd according to prefs (for event entry)
|
{ // Returns a date as dd-mm-yyyy or yyyy-mm-dd according to prefs (for event entry)
|
||||||
return date($this->cal_format_string, $convdate);
|
return gmdate($this->cal_format_string, $convdate);
|
||||||
}
|
}
|
||||||
|
|
||||||
function make_date($new_hour, $new_minute, $date_string)
|
function make_date($new_hour, $new_minute, $date_string)
|
||||||
{ // Turns a date as entered in the calendar into a time stamp (for event entry)
|
{ // Turns a date as entered in the calendar into a time stamp (for event entry)
|
||||||
global $pref;
|
$tmp = explode($this->date_separator, $date_string);
|
||||||
$tmp = explode("-", $date_string);
|
switch ($this->java_format_code)
|
||||||
switch ($pref['eventpost_datedisplay'])
|
|
||||||
{
|
{
|
||||||
case 2 :
|
case 2 :
|
||||||
return mktime($new_hour, $new_minute, 0, $tmp[1], $tmp[0], $tmp[2]); // dd-mm-yyyy
|
return gmmktime($new_hour, $new_minute, 0, $tmp[1], $tmp[0], $tmp[2]); // dd-mm-yyyy
|
||||||
case 3 :
|
case 3 :
|
||||||
return mktime($new_hour, $new_minute, 0, $tmp[0], $tmp[1], $tmp[2]); // mm-dd-yyyy
|
return gmmktime($new_hour, $new_minute, 0, $tmp[0], $tmp[1], $tmp[2]); // mm-dd-yyyy
|
||||||
default :
|
default :
|
||||||
return mktime($new_hour, $new_minute, 0, $tmp[1], $tmp[2], $tmp[0]); // yyyy-mm-dd
|
return gmmktime($new_hour, $new_minute, 0, $tmp[1], $tmp[2], $tmp[0]); // yyyy-mm-dd
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Return day of week string relative to the start of the week
|
||||||
|
function day_offset_string($doff)
|
||||||
|
{
|
||||||
|
return $this->days[($doff+$this->ec_first_day_of_week) % 7];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function cal_log($event_type, $event_title = '', $event_string='', $event_start=0)
|
function cal_log($event_type, $event_title = '', $event_string='', $event_start=0)
|
||||||
{ // All calendar-related logging intentionally passed through a single point to maintain control
|
{ // All calendar-related logging intentionally passed through a single point to maintain control
|
||||||
// (so we could also add other info if we wanted)
|
// (so we could also add other info if we wanted)
|
||||||
@@ -203,22 +269,27 @@ Preferences used:
|
|||||||
// 2 - edit event
|
// 2 - edit event
|
||||||
// 3 - delete event
|
// 3 - delete event
|
||||||
// 4 - Bulk delete
|
// 4 - Bulk delete
|
||||||
global $pref, $admin_log, $e_event;
|
global $pref, $admin_log, $e_event, $PLUGINS_DIRECTORY;
|
||||||
|
|
||||||
$log_titles = array( '1' => 'Event Calendar - add event',
|
$log_titles = array( '1' => 'Event Calendar - add event',
|
||||||
'2' => 'Event Calendar - edit event',
|
'2' => 'Event Calendar - edit event',
|
||||||
'3' => 'Event Calendar - delete event',
|
'3' => 'Event Calendar - delete event',
|
||||||
'4' => 'Event Calendar - Bulk Delete'
|
'4' => 'Event Calendar - Bulk Delete',
|
||||||
|
'5' => 'Event Calendar - Multiple Add',
|
||||||
);
|
);
|
||||||
// Do the notifies first
|
// Do the notifies first
|
||||||
$cmessage = $log_titles[$event_type]."<br />";
|
$cmessage = $log_titles[$event_type]."<br />";
|
||||||
if ($event_start > 0)
|
if ($event_start > 0)
|
||||||
|
{
|
||||||
$cmessage .= "Event Start: ".strftime("%d-%B-%Y",$event_start)."<br />";
|
$cmessage .= "Event Start: ".strftime("%d-%B-%Y",$event_start)."<br />";
|
||||||
|
$cmessage .= "Event Link: ".$pref['siteurl'].$PLUGINS_DIRECTORY. "calendar_menu/event.php?".$event_start." <br />";
|
||||||
|
}
|
||||||
else
|
else
|
||||||
$cmessage .= "Event Start unknown<br />";
|
$cmessage .= "Event Start unknown<br />";
|
||||||
$edata_ec = array("cmessage" => $cmessage, "ip" => getip());
|
$edata_ec = array("cmessage" => $cmessage, "ip" => getip());
|
||||||
switch ($event_type)
|
switch ($event_type)
|
||||||
{
|
{
|
||||||
|
case 5 :
|
||||||
case 1 : $e_event -> trigger("ecalnew", $edata_ec);
|
case 1 : $e_event -> trigger("ecalnew", $edata_ec);
|
||||||
break;
|
break;
|
||||||
case 2 :
|
case 2 :
|
||||||
@@ -233,13 +304,378 @@ Preferences used:
|
|||||||
case 2 : break; // Continue
|
case 2 : break; // Continue
|
||||||
default : return; // Invalid or undefined option
|
default : return; // Invalid or undefined option
|
||||||
}
|
}
|
||||||
$log_titles = array( '1' => 'Event Calendar - add event',
|
$log_titles = array( '1' => 'Event Calendar - add event'.strftime("%d-%B-%Y",$event_start),
|
||||||
'2' => 'Event Calendar - edit event',
|
'2' => 'Event Calendar - edit event'.strftime("%d-%B-%Y",$event_start),
|
||||||
'3' => 'Event Calendar - delete event',
|
'3' => 'Event Calendar - delete event'.strftime("%d-%B-%Y",$event_start),
|
||||||
'4' => 'Event Calendar - Bulk Delete'
|
'4' => 'Event Calendar - Bulk Delete',
|
||||||
|
'5' => 'Event Calendar - multiple add'.strftime("%d-%B-%Y",$event_start)
|
||||||
);
|
);
|
||||||
$admin_log->log_event($log_titles[$event_type],$event_title." \n".$event_string,4);
|
$admin_log->log_event($log_titles[$event_type],$event_title." \n".$event_string,4);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
function get_category_text($ev_cat)
|
||||||
|
{
|
||||||
|
global $sql;
|
||||||
|
if (!isset($this->cat_text_cache[$ev_cat]))
|
||||||
|
{
|
||||||
|
$sql->db_Select('event_cat','event_cat_name',"event_cat_id='{$ev_cat}'");
|
||||||
|
$row = $sql->db_Fetch();
|
||||||
|
$this->cat_text_cache[$ev_cat] = $row['event_cat_name'];
|
||||||
|
}
|
||||||
|
return $this->cat_text_cache[$ev_cat];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Implements a version of getdate that expects a GMT date and doesn't do TZ/DST adjustments
|
||||||
|
// time() -date('Z') gives the correction to 'null out' the TZ and DST adjustments that getdate() does
|
||||||
|
function gmgetdate($date)
|
||||||
|
{
|
||||||
|
return getdate($date-date('Z'));
|
||||||
|
}
|
||||||
|
|
||||||
|
//------------------------------------------------
|
||||||
|
// Recurring event handling
|
||||||
|
//------------------------------------------------
|
||||||
|
|
||||||
|
// Generate a list of recurring events based on a 'first event' date, an interval and start/finish times
|
||||||
|
// Returns an array of times
|
||||||
|
function gen_recur_regular($first_event, $last_event, $interval, $start_time, $end_time)
|
||||||
|
{
|
||||||
|
if ($last_event < $end_time) $end_time = $last_event;
|
||||||
|
$ret = array();
|
||||||
|
$first_event = $first_event + ceil(($start_time-$first_event)/$interval)*$interval;
|
||||||
|
while ($first_event <= $end_time)
|
||||||
|
{
|
||||||
|
$ret[] = $first_event;
|
||||||
|
$first_event += $interval;
|
||||||
|
}
|
||||||
|
return $ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function add_dates($main_date,$adder)
|
||||||
|
{ // Adds an offset of months and years to a date
|
||||||
|
if ($adder['mon'])
|
||||||
|
{
|
||||||
|
$main_date['mon'] += $adder['mon'];
|
||||||
|
if ($main_date['mon'] > 12)
|
||||||
|
{
|
||||||
|
$main_date['mon'] -= 12;
|
||||||
|
$main_date['year']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($adder['year']) $main_date['year'] += $adder['year'];
|
||||||
|
return $main_date;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Generate a list of recurring events based on a 'first event' date, an interval type and start/finish window
|
||||||
|
// For day number, '0' = 'Sunday'
|
||||||
|
function gen_recur($first_event, $last_event, $interval_type, $start_time, $end_time)
|
||||||
|
{
|
||||||
|
if ($last_event < $end_time) $end_time = $last_event;
|
||||||
|
$ret = array();
|
||||||
|
$week_offset = 0;
|
||||||
|
if ($interval_type >= 100)
|
||||||
|
{
|
||||||
|
$week_offset = intval($interval_type /100);
|
||||||
|
$day_number = $interval_type % 10; // Gives 0..6 in practice; potentially 0..9
|
||||||
|
$interval_type = 100;
|
||||||
|
}
|
||||||
|
if ($first_event > $end_time) return $ret;
|
||||||
|
|
||||||
|
$interval = array('5' => 28*86400, '6' => 14*86400, '7' => 7*86400, '8' => 86400);
|
||||||
|
// Do the easy ones first
|
||||||
|
if (array_key_exists($interval_type, $interval)) return $this->gen_recur_regular($first_event, $last_event, $interval[$interval_type], $start_time, $end_time);
|
||||||
|
|
||||||
|
// We're messing around with months and years here
|
||||||
|
$inc_array['year'] = 0;
|
||||||
|
$inc_array['mon'] = 0;
|
||||||
|
|
||||||
|
// Find the first date which is within, or close to, scope (N.B. may not be one)
|
||||||
|
$event = $this->gmgetdate($first_event);
|
||||||
|
$temp = $this->gmgetdate($start_time);
|
||||||
|
$event['year'] = $temp['year']; // Use the year from the start window
|
||||||
|
if ($event['mon'] > $temp['mon']) $event['year']--; // Handle situation where event later in year than desired window
|
||||||
|
|
||||||
|
switch ($interval_type)
|
||||||
|
{
|
||||||
|
case 1 : // Annual
|
||||||
|
$inc_array['year'] = 1;
|
||||||
|
break;
|
||||||
|
case 2 : // Biannual
|
||||||
|
$inc_array['mon'] = 6;
|
||||||
|
break;
|
||||||
|
case 3 : // Quarterly
|
||||||
|
$inc_array['mon'] = 3;
|
||||||
|
break;
|
||||||
|
case 4 : // Monthly
|
||||||
|
$inc_array['mon'] = 1;
|
||||||
|
break;
|
||||||
|
case 100 : // Monthly on nth Sunday in month
|
||||||
|
case 101 : // Monthly on nth Monday in month
|
||||||
|
case 102 : // Monthly on nth Tuesday in month
|
||||||
|
case 103 : // Monthly on nth Wednesday in month
|
||||||
|
case 104 : // Monthly on nth Thursday in month
|
||||||
|
case 105 : // Monthly on nth Friday in month
|
||||||
|
case 106 : // Monthly on nth Saturday in month
|
||||||
|
// echo "Specific day of month: ".$day_number."<br />";
|
||||||
|
$inc_array['mon'] = 1;
|
||||||
|
$event['mon'] = $temp['mon'];
|
||||||
|
$event['year'] = $temp['year'];
|
||||||
|
$event['mday'] = 1; // Start calculating from first day of each month
|
||||||
|
break;
|
||||||
|
default :
|
||||||
|
return FALSE; // Invalid interval type
|
||||||
|
}
|
||||||
|
|
||||||
|
// echo "First date: ".$event['mon']."-".$event['year']."<br />";
|
||||||
|
// Now loop through using the increment - we may discard a few, but getting clever may be worse!
|
||||||
|
$cont = TRUE;
|
||||||
|
|
||||||
|
do {
|
||||||
|
$tstamp = gmmktime($event['hours'],$event['minutes'],$event['seconds'],$event['mon'],$event['mday'],$event['year']);
|
||||||
|
if ($interval_type >= 100)
|
||||||
|
{ // $tstamp has the first of the month
|
||||||
|
// $dofwk = gmdate('w',$tstamp);
|
||||||
|
$day_diff = $day_number - gmdate('w',$tstamp);
|
||||||
|
if ($day_diff <0) $day_diff += 7;
|
||||||
|
$day_diff += (7 * $week_offset) - 7;
|
||||||
|
// echo "Day difference = ".$day_diff." Stamp=".$tstamp." Week day: ".$dofwk."<br />";
|
||||||
|
$tstamp += $day_diff*86400;
|
||||||
|
}
|
||||||
|
if ($tstamp >= $start_time)
|
||||||
|
{
|
||||||
|
if ($tstamp <= $end_time)
|
||||||
|
{
|
||||||
|
$ret[] = $tstamp;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$cont = FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$event = $this->add_dates($event,$inc_array);
|
||||||
|
} while ($cont);
|
||||||
|
|
||||||
|
return $ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Generate comma separated list of fields for table, with optional alias prefix.
|
||||||
|
function gen_field_list($table, $list, $must_have = '')
|
||||||
|
{
|
||||||
|
if ($list == '*') return $table ? $table.".*" : '*';
|
||||||
|
$ret = '';
|
||||||
|
$pad = '';
|
||||||
|
$temp = explode(',',$list);
|
||||||
|
for ($i = 0; $i < count($temp); $i++) $temp[$i] = trim($temp[$i]);
|
||||||
|
if ($must_have)
|
||||||
|
{
|
||||||
|
$mharr = explode(',',$must_have);
|
||||||
|
foreach ($mharr as $mh)
|
||||||
|
{
|
||||||
|
if (!in_array(trim($mh), $temp)) $temp[] = trim($mh);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach ($temp as $fld)
|
||||||
|
{
|
||||||
|
if ($fld)
|
||||||
|
{
|
||||||
|
if ($table) $fld = $table.'.'.$fld;
|
||||||
|
$ret .= $pad.$fld;
|
||||||
|
$pad = ', ';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Read a list of events between start and end dates
|
||||||
|
// If $start_only is TRUE, only searches based on the start date/time
|
||||||
|
// Potential option to hook in other routines later
|
||||||
|
function get_events($start_time, $end_time, $start_only=FALSE, $cat_filter=0, $inc_recur=FALSE, $event_fields='*', $cat_fields='*')
|
||||||
|
{
|
||||||
|
global $sql;
|
||||||
|
|
||||||
|
$ret = array();
|
||||||
|
$cat_lj = '';
|
||||||
|
$category_filter = '';
|
||||||
|
$extra = '';
|
||||||
|
$so = '';
|
||||||
|
|
||||||
|
$event_fields = $this->gen_field_list('e',$event_fields,'event_start,event_end,event_datestamp');
|
||||||
|
if ($cat_fields)
|
||||||
|
{
|
||||||
|
$cat_fields = ', '.$this->gen_field_list('ec',$cat_fields);
|
||||||
|
$cat_lj = ' LEFT JOIN #event_cat as ec ON e.event_category = ec.event_cat_id ';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($cat_filter && ($cat_filter != '*')) $category_filter = " AND find_in_set(e.event_category, '".$cat_filter."') ";
|
||||||
|
if ($inc_recur) $extra = " OR (e.event_recurring >'0' AND (e.event_start <= ".intval($end_time)." AND e.event_end >= ".intval($start_time).")) ";
|
||||||
|
|
||||||
|
/*
|
||||||
|
if (!$start_only) $so = "OR (e.event_end >= ".intval($start_time)." AND e.event_end <= ".intval($end_time).")
|
||||||
|
OR (e.event_start <= ".intval($start_time)." AND e.event_end >= ".intval($end_time).") ";
|
||||||
|
|
||||||
|
$qry = "SELECT {$event_fields}{$cat_fields} FROM #event as e {$cat_lj}
|
||||||
|
WHERE (
|
||||||
|
(e.event_recurring = '0' AND ((e.event_start >= ".intval($start_time)." AND e.event_start <= ".intval($end_time).") {$so}))
|
||||||
|
{$extra})
|
||||||
|
{$category_filter}
|
||||||
|
{$this->extra_query}
|
||||||
|
ORDER BY e.event_start ASC
|
||||||
|
";
|
||||||
|
*/
|
||||||
|
$so = $start_only ? 'start' : 'end';
|
||||||
|
$qry = "SELECT {$event_fields}{$cat_fields} FROM #event as e {$cat_lj}
|
||||||
|
WHERE (
|
||||||
|
(e.event_recurring = '0' AND ((e.event_{$so} >= ".intval($start_time)." AND e.event_start <= ".intval($end_time).")))
|
||||||
|
{$extra})
|
||||||
|
{$category_filter}
|
||||||
|
{$this->extra_query}
|
||||||
|
ORDER BY e.event_start ASC
|
||||||
|
";
|
||||||
|
|
||||||
|
if ($sql->db_Select_gen($qry))
|
||||||
|
{
|
||||||
|
while ($row = $sql->db_Fetch())
|
||||||
|
{
|
||||||
|
// Always add the 'is_recent' marker if required
|
||||||
|
if ((($this->max_recent_show != 0) && (time() - $row['event_datestamp']) <= $this->max_recent_show)) $row['is_recent'] = TRUE;
|
||||||
|
if ($row['event_recurring'] == 0)
|
||||||
|
{
|
||||||
|
$ret[] = $row;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{ // Recurring events to handle
|
||||||
|
$temp = $this->gen_recur($row['event_start'],$row['event_end'],$row['event_recurring'],$start_time,$end_time);
|
||||||
|
if (count($temp))
|
||||||
|
{
|
||||||
|
$row['event_start'] = $temp; // Have an array of start times
|
||||||
|
$ret[] = $row;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Function to return up to a maximum number of events between a given start and end date
|
||||||
|
// It always uses the event start date only
|
||||||
|
// It tries to keep the actual number of events in memory to a minimum by discarding when it can.
|
||||||
|
// Once there are $num_events read, it pulls in the $end_time to speed up checks
|
||||||
|
function get_n_events($num_event, $start_time, $end_time, $cat_filter=0, $inc_recur=FALSE, $event_fields='*', $cat_fields='*')
|
||||||
|
{
|
||||||
|
global $sql;
|
||||||
|
|
||||||
|
$ret = array();
|
||||||
|
$cat_lj = '';
|
||||||
|
$category_filter = '';
|
||||||
|
$extra = '';
|
||||||
|
|
||||||
|
$event_fields = $this->gen_field_list('e',$event_fields,'event_start,event_end,event_datestamp,event_recurring');
|
||||||
|
if ($cat_fields)
|
||||||
|
{
|
||||||
|
$cat_fields = ', '.$this->gen_field_list('ec',$cat_fields);
|
||||||
|
$cat_lj = ' LEFT JOIN #event_cat as ec ON e.event_category = ec.event_cat_id ';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($cat_filter) $category_filter = " AND find_in_set(e.event_category, '".$cat_filter."') ";
|
||||||
|
if ($inc_recur) $extra = " OR (e.event_recurring >'0' AND (e.event_start <= ".intval($end_time)." AND e.event_end >= ".intval($start_time).")) ";
|
||||||
|
|
||||||
|
$qry = "SELECT {$event_fields}{$cat_fields} FROM #event as e {$cat_lj}
|
||||||
|
WHERE (
|
||||||
|
(e.event_recurring = '0' AND (e.event_start >= ".intval($start_time)." AND e.event_start <= ".intval($end_time).") )
|
||||||
|
{$extra})
|
||||||
|
{$category_filter}
|
||||||
|
{$this->extra_query}
|
||||||
|
ORDER BY e.event_start ASC
|
||||||
|
";
|
||||||
|
|
||||||
|
// echo "get_n_events Query: ".$qry."<br />";
|
||||||
|
|
||||||
|
if ($sql->db_Select_gen($qry))
|
||||||
|
{
|
||||||
|
while ($row = $sql->db_Fetch())
|
||||||
|
{
|
||||||
|
// Always add the 'is_recent' marker if required
|
||||||
|
if ((($this->max_recent_show != 0) && (time() - $row['event_datestamp']) <= $this->max_recent_show)) $row['is_recent'] = TRUE;
|
||||||
|
unset($temp);
|
||||||
|
if ($row['event_recurring'] == 0)
|
||||||
|
{
|
||||||
|
// echo "Standard: ".$row['event_start']." ".$row['event_title']."<br />";
|
||||||
|
$temp = array($row['event_start']);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{ // Recurring events to handle
|
||||||
|
// echo "Recurring: ".$row['event_start']." ".$row['event_title']." - ".$row['event_recurring']." - ";
|
||||||
|
$temp = $this->gen_recur($row['event_start'],$row['event_end'],$row['event_recurring'],$start_time,$end_time);
|
||||||
|
// echo count($temp)."results generated<br />";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (count($temp))
|
||||||
|
{ // We have one or more events to add to the array
|
||||||
|
foreach ($temp as $ts)
|
||||||
|
{
|
||||||
|
// echo "Process: ".$ts." ".$row['event_start']." ".$row['event_title']." ".$end_time."<br />";
|
||||||
|
if ($ts <= $end_time) // We may have pulled in $end_time from the value passed initially
|
||||||
|
{
|
||||||
|
$row['event_start'] = $ts; // Fill this in - may be a recurring event
|
||||||
|
// echo "Add: ".$row['event_start']." ".$row['event_title']."<br />";
|
||||||
|
|
||||||
|
if ((count($ret) == 0) || ($ts > $ret[count($ret)-1]['event_start']))
|
||||||
|
{ // Can just add on end
|
||||||
|
// echo "Add at end<br />";
|
||||||
|
$ret[] = $row;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{ // Find a slot
|
||||||
|
$i = count($ret);
|
||||||
|
while (($i > 0) && ($ret[$i-1]['event_start'] > $ts)) $i--;
|
||||||
|
// $i has the number of the event before which to insert this new event.
|
||||||
|
if ($i == 0)
|
||||||
|
{
|
||||||
|
array_unshift($ret,$row); // Just insert at beginning
|
||||||
|
// echo "Insert at front<br />";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{ // Proper insert needed just before element $i
|
||||||
|
// $tmp = array_unshift(array_slice($ret, $i),$row);
|
||||||
|
// array_splice($ret, $i, count($ret), $tmp);
|
||||||
|
array_splice($ret, $i, count($ret), array_merge(array($row),array_slice($ret, $i)));
|
||||||
|
// echo "Insert at ".$i."<br />";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (count($ret) > $num_event)
|
||||||
|
{ // Knock one off the end
|
||||||
|
// echo "Delete, count is ".count($ret)."<br />";
|
||||||
|
if ($ret[count($ret)-1]['event_start'] < $end_time) $end_time = $ret[count($ret)-1]['event_start']; // Pull in end time if we can
|
||||||
|
array_pop($ret);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $ret;
|
||||||
|
} // End - function get_n_events()
|
||||||
|
|
||||||
|
|
||||||
|
function get_recur_text($recurring)
|
||||||
|
{
|
||||||
|
if ($recurring >= 100)
|
||||||
|
{
|
||||||
|
return $this->recur_week[100*intval($recurring/100)]." ".$this->recur_type[100+($recurring % 10)];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return $this->recur_type[$recurring];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}// End - class definition
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
File diff suppressed because it is too large
Load Diff
BIN
e107_plugins/calendar_menu/images/recent_icon.png
Normal file
BIN
e107_plugins/calendar_menu/images/recent_icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 329 B |
@@ -11,13 +11,10 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/languages/English.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/languages/English.php,v $
|
||||||
| $Revision: 1.1.1.1 $
|
| $Revision: 1.2 $
|
||||||
| $Date: 2006-12-02 04:34:50 $
|
| $Date: 2007-07-13 19:37:52 $
|
||||||
| $Author: mcfly_e107 $
|
| $Author: e107steved $
|
||||||
|
|
|
|
||||||
| Various mods by steved:
|
|
||||||
| a) To reflect updates
|
|
||||||
| b) To reflect CVS update to version 1.14 made 29.10.06
|
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -113,7 +110,7 @@ define('EC_LAN_37', "None Listed.");
|
|||||||
define('EC_LAN_38', "Not specified");
|
define('EC_LAN_38', "Not specified");
|
||||||
define('EC_LAN_39', "Click here for more information");
|
define('EC_LAN_39', "Click here for more information");
|
||||||
define('EC_LAN_40', "Current Month");
|
define('EC_LAN_40', "Current Month");
|
||||||
define('EC_LAN_41', "New category created.");
|
define('EC_LAN_41', "Total -NUM- individual events created");
|
||||||
define('EC_LAN_42', "Event cannot end before it starts.");
|
define('EC_LAN_42', "Event cannot end before it starts.");
|
||||||
define('EC_LAN_43', "You left required field(s) blank.");
|
define('EC_LAN_43', "You left required field(s) blank.");
|
||||||
define('EC_LAN_44', "New event created and entered into database.");
|
define('EC_LAN_44', "New event created and entered into database.");
|
||||||
@@ -135,7 +132,7 @@ define('EC_LAN_59', "Contact email:");
|
|||||||
define('EC_LAN_60', "Update Event");
|
define('EC_LAN_60', "Update Event");
|
||||||
define('EC_LAN_61', "Go");
|
define('EC_LAN_61', "Go");
|
||||||
define('EC_LAN_62', "Next -NUM- Events ...");
|
define('EC_LAN_62', "Next -NUM- Events ...");
|
||||||
define('EC_LAN_63', "Check this if event happens on same day every year, e.g. birthday");
|
define('EC_LAN_63', "Select repeating events between start and end dates. Start and end time as set");
|
||||||
define('EC_LAN_64', "Check for an all-day event");
|
define('EC_LAN_64', "Check for an all-day event");
|
||||||
define('EC_LAN_65', "Recurring:");
|
define('EC_LAN_65', "Recurring:");
|
||||||
define('EC_LAN_66', "Edit Event");
|
define('EC_LAN_66', "Edit Event");
|
||||||
@@ -146,22 +143,7 @@ define('EC_LAN_70', "Event Title:");
|
|||||||
define('EC_LAN_71', "Event Time:");
|
define('EC_LAN_71', "Event Time:");
|
||||||
define('EC_LAN_72', "Event Date:");
|
define('EC_LAN_72', "Event Date:");
|
||||||
define('EC_LAN_73', "End:");
|
define('EC_LAN_73', "End:");
|
||||||
//define('edesc_LAN_0', "Count Down");
|
|
||||||
//define('edesc_LAN_1', "Still ");
|
|
||||||
//define('edesc_LAN_2', "before event on ".SITENAME);
|
|
||||||
//define('edesc_LAN_3', "sec");
|
|
||||||
//define('edesc_LAN_4', "secs");
|
|
||||||
//define('edesc_LAN_5', "min");
|
|
||||||
//define('edesc_LAN_6', "mins");
|
|
||||||
//define('edesc_LAN_7', "h");
|
|
||||||
//define('edesc_LAN_8', "h");
|
|
||||||
//define('edesc_LAN_9', "day");
|
|
||||||
//define('edesc_LAN_10', "days");
|
|
||||||
define('EC_LAN_VIEWCALENDAR', "View Calendar");
|
|
||||||
define('EC_LAN_VIEWALLEVENTS', "View all events");
|
|
||||||
define('EC_LAN_ALLEVENTS', "All events");
|
|
||||||
define('EC_LAN_74', "View Category");
|
define('EC_LAN_74', "View Category");
|
||||||
// ADMIN
|
|
||||||
define('EC_LAN_75', "Calendar settings updated.");
|
define('EC_LAN_75', "Calendar settings updated.");
|
||||||
define('EC_LAN_76', "Events can be added by:");
|
define('EC_LAN_76', "Events can be added by:");
|
||||||
define('EC_LAN_77', "Update Settings");
|
define('EC_LAN_77', "Update Settings");
|
||||||
@@ -171,17 +153,15 @@ define('EC_LAN_80', "Event List");
|
|||||||
define('EC_LAN_81', "Configure Event Calendar");
|
define('EC_LAN_81', "Configure Event Calendar");
|
||||||
define('EC_LAN_82', "To activate please go to your menus screen and select the calendar_menu into one of your menu areas.");
|
define('EC_LAN_82', "To activate please go to your menus screen and select the calendar_menu into one of your menu areas.");
|
||||||
define('EC_LAN_83', "Calendar");
|
define('EC_LAN_83', "Calendar");
|
||||||
|
define('EC_LAN_84', " from ");
|
||||||
//define('EC_LAN_84', "Css element to use for day header");
|
define('EC_LAN_85', " until ");
|
||||||
//define('EC_LAN_85', "Default is 'forumheader'");
|
define('EC_LAN_86', "Individual events from entry");
|
||||||
//define('EC_LAN_86', "Css element to use for day list");
|
define('EC_LAN_87', "By checking this box you may generate a large number of individual events, which you will have to edit or delete individually if they are wrong");
|
||||||
//define('EC_LAN_87', "Default is 'forumheader3'");
|
define('EC_LAN_88', "You have chosen to generate -NUM- individual events.");
|
||||||
//define('EC_LAN_88', "Css element to use for selected day");
|
define('EC_LAN_89', "If the entry is wrong, you will have to edit or delete the entries individually");
|
||||||
//define('EC_LAN_89', "Default is 'indent'");
|
|
||||||
|
|
||||||
// *BK* Corrections to hard coding by Barry
|
|
||||||
define('EC_LAN_90', "Choose");
|
define('EC_LAN_90', "Choose");
|
||||||
define('EC_LAN_91', "None defined");
|
define('EC_LAN_91', "Admin must define first");
|
||||||
define('EC_LAN_92', "View Category");
|
define('EC_LAN_92', "View Category");
|
||||||
define('EC_LAN_93', "View Events List");
|
define('EC_LAN_93', "View Events List");
|
||||||
define('EC_LAN_94', "Enter New Event");
|
define('EC_LAN_94', "Enter New Event");
|
||||||
@@ -190,7 +170,7 @@ define('EC_LAN_96', "View Calendar");
|
|||||||
define('EC_LAN_97', "All");
|
define('EC_LAN_97', "All");
|
||||||
define('EC_LAN_98', "Required fields left blank");
|
define('EC_LAN_98', "Required fields left blank");
|
||||||
define('EC_LAN_99', "Event must either be an all day event or finish after it starts");
|
define('EC_LAN_99', "Event must either be an all day event or finish after it starts");
|
||||||
//define('EC_LAN_100', "Categories can be added by");
|
define('EC_LAN_100', "Invalid Category Selection");
|
||||||
//define('EC_LAN_101', "Set to inactive to disable on the new event form.");
|
//define('EC_LAN_101', "Set to inactive to disable on the new event form.");
|
||||||
define('EC_LAN_102', "Show link to 'more information' with events");
|
define('EC_LAN_102', "Show link to 'more information' with events");
|
||||||
//define('EC_LAN_103', "On new event entry form.");
|
//define('EC_LAN_103', "On new event entry form.");
|
||||||
@@ -229,13 +209,52 @@ define('EC_LAN_135', "Event");
|
|||||||
define('EC_LAN_136', "Category Description");
|
define('EC_LAN_136', "Category Description");
|
||||||
define('EC_LAN_137', "Future Events");
|
define('EC_LAN_137', "Future Events");
|
||||||
|
|
||||||
// Added 12.07.06 for next_event_menu.php
|
|
||||||
define('EC_LAN_140', "Forthcoming Events");
|
define('EC_LAN_140', "Forthcoming Events");
|
||||||
define('EC_LAN_141', "No forthcoming events");
|
define('EC_LAN_141', "No forthcoming events");
|
||||||
define('EC_LAN_142', "Only registered and logged in users can subscribe to events");
|
define('EC_LAN_142', "Only registered and logged in users can subscribe to events");
|
||||||
define('EC_LAN_143', "Facility not available");
|
define('EC_LAN_143', "Facility not available");
|
||||||
define('EC_LAN_144', " at ");
|
define('EC_LAN_144', " at ");
|
||||||
|
|
||||||
|
define('EC_LAN_145', "You must specify a category for the event");
|
||||||
|
define('EC_LAN_146', "Advance notice of calendar event");
|
||||||
|
define('EC_LAN_147', "Calendar event today or tomorrow");
|
||||||
|
define('EC_LAN_148', "No events in specified date range");
|
||||||
|
define('EC_LAN_149', "Invalid date format");
|
||||||
|
define('EC_LAN_150', "Enter start and end date for list");
|
||||||
|
define('EC_LAN_151', "End date after start date");
|
||||||
|
define('EC_LAN_152', "Maximum one year's events");
|
||||||
|
define('EC_LAN_153', "Start Date (first day of): ");
|
||||||
|
define('EC_LAN_154', "End Date (last day of): ");
|
||||||
|
define('EC_LAN_155', "Category: ");
|
||||||
|
define('EC_LAN_156', "Create List");
|
||||||
|
define('EC_LAN_157', "Layout Options:");
|
||||||
|
define('EC_LAN_158', "Output: ");
|
||||||
|
define('EC_LAN_159', "Display ");
|
||||||
|
define('EC_LAN_160', "Print ");
|
||||||
|
define('EC_LAN_161', "PDF ");
|
||||||
|
define('EC_LAN_162', "Print this page");
|
||||||
|
define('EC_LAN_163', "Event Listing");
|
||||||
|
define('EC_LAN_164', "Printable Lists");
|
||||||
|
define('EC_LAN_165', "Default Listing");
|
||||||
|
define('EC_LAN_166', "Tabular List no lines");
|
||||||
|
define('EC_LAN_167', "Tabular List with lines");
|
||||||
|
define('EC_LAN_168', "From: ");
|
||||||
|
define('EC_LAN_169', "To: ");
|
||||||
|
define('EC_LAN_170', "Printed on: ");
|
||||||
|
define('EC_LAN_171', "List including category");
|
||||||
|
define('EC_LAN_172', "Event Categories: ");
|
||||||
|
define('EC_LAN_173', "First event starts: ");
|
||||||
|
define('EC_LAN_174', "Last event ends: ");
|
||||||
|
define('EC_LAN_175', "All Day");
|
||||||
|
define('EC_LAN_176', "Recurring pattern: ");
|
||||||
|
define('EC_LAN_177', "Cancel Entry");
|
||||||
|
define('EC_LAN_178', "Accept Entries");
|
||||||
|
define('EC_LAN_179', "Confirmation of multiple event entry");
|
||||||
|
define('EC_LAN_180', " RECORDS NOT SAVED - DB UPDATE ERROR");
|
||||||
|
|
||||||
|
define('EC_LAN_VIEWCALENDAR', "View Calendar");
|
||||||
|
define('EC_LAN_VIEWALLEVENTS', "View all events");
|
||||||
|
define('EC_LAN_ALLEVENTS', "All events");
|
||||||
|
|
||||||
define('EC_ADLAN_A10', "Configuration");
|
define('EC_ADLAN_A10', "Configuration");
|
||||||
define('EC_ADLAN_A11', "Categories");
|
define('EC_ADLAN_A11', "Categories");
|
||||||
@@ -263,7 +282,7 @@ define('EC_ADLAN_A31', "Tick the confirm box to delete");
|
|||||||
define('EC_ADLAN_A32', "Unable to delete this category");
|
define('EC_ADLAN_A32', "Unable to delete this category");
|
||||||
define('EC_ADLAN_A33', "None defined");
|
define('EC_ADLAN_A33', "None defined");
|
||||||
define('EC_ADLAN_A34', "Calendar Administrator Class");
|
define('EC_ADLAN_A34', "Calendar Administrator Class");
|
||||||
define('EC_ADLAN_A35', "");
|
//define('EC_ADLAN_A35', "");
|
||||||
define('EC_ADLAN_A59', "Category is in use. Can not delete.");
|
define('EC_ADLAN_A59', "Category is in use. Can not delete.");
|
||||||
|
|
||||||
define('EC_ADLAN_A80', "Visible to");
|
define('EC_ADLAN_A80', "Visible to");
|
||||||
@@ -285,7 +304,6 @@ define('EC_ADLAN_A95', "Enable manual subscriptions");
|
|||||||
define('EC_ADLAN_A96', "Disabling this removes the subscriptions button and overrides the category manual subscription setting.");
|
define('EC_ADLAN_A96', "Disabling this removes the subscriptions button and overrides the category manual subscription setting.");
|
||||||
//define('EC_ADLAN_A97', "If set to force subscriptions this category will not be displayed in the available subscription list for the user.");
|
//define('EC_ADLAN_A97', "If set to force subscriptions this category will not be displayed in the available subscription list for the user.");
|
||||||
|
|
||||||
// Added from here 12.07.06 for forthcoming events and mailout upgrades
|
|
||||||
define('EC_ADLAN_A100', "Forthcoming Events");
|
define('EC_ADLAN_A100', "Forthcoming Events");
|
||||||
define('EC_ADLAN_A101', "Days to look forward:");
|
define('EC_ADLAN_A101', "Days to look forward:");
|
||||||
define('EC_ADLAN_A102', "Number of events to display:");
|
define('EC_ADLAN_A102', "Number of events to display:");
|
||||||
@@ -293,7 +311,7 @@ define('EC_ADLAN_A103', "Include recurring events:");
|
|||||||
define('EC_ADLAN_A104', "Title is link to events list:");
|
define('EC_ADLAN_A104', "Title is link to events list:");
|
||||||
define('EC_ADLAN_A105', "Configure Forthcoming Events Menu");
|
define('EC_ADLAN_A105', "Configure Forthcoming Events Menu");
|
||||||
define('EC_ADLAN_A106', "Menu has to be enabled on the 'Menu' page");
|
define('EC_ADLAN_A106', "Menu has to be enabled on the 'Menu' page");
|
||||||
define('EC_ADLAN_A107', "Will not work reliably if looking forward more than 59 days");
|
define('EC_ADLAN_A107', "Hide menu if no events to show");
|
||||||
define('EC_ADLAN_A108', "Menu Heading");
|
define('EC_ADLAN_A108', "Menu Heading");
|
||||||
define('EC_ADLAN_A109', "Forthcoming Events preferences updated");
|
define('EC_ADLAN_A109', "Forthcoming Events preferences updated");
|
||||||
|
|
||||||
@@ -363,8 +381,35 @@ define('EC_ADLAN_A168', "Custom date uses the format in the box on the right");
|
|||||||
define('EC_ADLAN_A169', "Determines date display format for event listings");
|
define('EC_ADLAN_A169', "Determines date display format for event listings");
|
||||||
define('EC_ADLAN_A170', "Determines date display format for forthcoming events menu");
|
define('EC_ADLAN_A170', "Determines date display format for forthcoming events menu");
|
||||||
define('EC_ADLAN_A171', "Flag recently added/updated events");
|
define('EC_ADLAN_A171', "Flag recently added/updated events");
|
||||||
define('EC_ADLAN_A172', "Value is time from update in hours; zero to disable");
|
define('EC_ADLAN_A172', "Value is time from update in hours; zero to disable, 'LV' to show from user's last visit");
|
||||||
|
|
||||||
|
define('EC_ADLAN_A173', "Subscriptions");
|
||||||
|
define('EC_ADLAN_A174', "No subscription entries found");
|
||||||
|
define('EC_ADLAN_A175', "UID");
|
||||||
|
define('EC_ADLAN_A176', "User Name");
|
||||||
|
define('EC_ADLAN_A177', "Category");
|
||||||
|
define('EC_ADLAN_A178', "Problems");
|
||||||
|
define('EC_ADLAN_A179', "Actions");
|
||||||
|
define('EC_ADLAN_A180', "Deleted subscription record no ");
|
||||||
|
define('EC_ADLAN_A181', "Delete failed for record no ");
|
||||||
|
define('EC_ADLAN_A182', "Total --NUM-- entries in database");
|
||||||
|
define('EC_ADLAN_A183', "Calendar Menu mouseover shows event title");
|
||||||
|
define('EC_ADLAN_A184', "may not work with all browsers");
|
||||||
|
define('EC_ADLAN_A185', "Nothing");
|
||||||
|
define('EC_ADLAN_A186', "Update settings\nand send test\nemail to self");
|
||||||
|
define('EC_ADLAN_A187', "Test email sent - ");
|
||||||
|
define('EC_ADLAN_A188', "Error sending test email - ");
|
||||||
|
define('EC_ADLAN_A189', "If the message is left blank, the message from the 'Default' category will be used");
|
||||||
|
define('EC_ADLAN_A190', "Default category - mailout messages are used if none defined for any other category");
|
||||||
|
define('EC_ADLAN_A191', "Details of event for test email");
|
||||||
|
define('EC_ADLAN_A192', "Test event location");
|
||||||
|
define('EC_ADLAN_A193', "Allow users to display/print/PDF lists");
|
||||||
|
define('EC_ADLAN_A194', "None");
|
||||||
|
define('EC_ADLAN_A195', "Display/Print");
|
||||||
|
define('EC_ADLAN_A196', "Display/Print/PDF");
|
||||||
|
define('EC_ADLAN_A197', "No class membership");
|
||||||
|
define('EC_ADLAN_A198', "Invalid User");
|
||||||
|
define('EC_ADLAN_A199', "Show 'recent' icon");
|
||||||
|
|
||||||
// Notify
|
// Notify
|
||||||
define("NT_LAN_EC_1", "Event Calendar Events");
|
define("NT_LAN_EC_1", "Event Calendar Events");
|
||||||
@@ -376,5 +421,8 @@ define("NT_LAN_EC_6", "Event Calendar - Event added");
|
|||||||
define("NT_LAN_EC_7", "New event posted");
|
define("NT_LAN_EC_7", "New event posted");
|
||||||
define("NT_LAN_EC_8", "Event Calendar - Event modified");
|
define("NT_LAN_EC_8", "Event Calendar - Event modified");
|
||||||
|
|
||||||
|
// Prefs - language defines can be used in various places where text is set through the admin screens
|
||||||
|
define('EC_MAILOUT_SUBJECT', "Advice of calendar event"); // USe shortcode EC_MAIL_SUBJECT
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
@@ -11,11 +11,10 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/next_event_menu.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/next_event_menu.php,v $
|
||||||
| $Revision: 1.1.1.1 $
|
| $Revision: 1.2 $
|
||||||
| $Date: 2006-12-02 04:34:47 $
|
| $Date: 2007-07-13 19:37:52 $
|
||||||
| $Author: mcfly_e107 $
|
| $Author: e107steved $
|
||||||
|
|
|
|
||||||
| 09.11.06 - Cache support added, templating/shortcode tweaks
|
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -27,7 +26,7 @@ $ecal_dir = e_PLUGIN . "calendar_menu/";
|
|||||||
|
|
||||||
global $ecal_class;
|
global $ecal_class;
|
||||||
require_once($ecal_dir."ecal_class.php");
|
require_once($ecal_dir."ecal_class.php");
|
||||||
$ecal_class = new ecal_class;
|
if (!is_object($ecal_class)) $ecal_class = new ecal_class;
|
||||||
|
|
||||||
$cache_tag = "nq_event_cal_next";
|
$cache_tag = "nq_event_cal_next";
|
||||||
|
|
||||||
@@ -41,18 +40,11 @@ $ecal_class = new ecal_class;
|
|||||||
include_lan(e_PLUGIN."calendar_menu/languages/".e_LANGUAGE.".php");
|
include_lan(e_PLUGIN."calendar_menu/languages/".e_LANGUAGE.".php");
|
||||||
|
|
||||||
// Values defined through admin pages
|
// Values defined through admin pages
|
||||||
$menu_title = $pref['eventpost_menuheading'];
|
$menu_title = varset($pref['eventpost_menuheading'],EC_LAN_140);
|
||||||
$days_ahead = $pref['eventpost_daysforward'];
|
$days_ahead = varset($pref['eventpost_daysforward'],30); // Number of days ahead to go
|
||||||
$show_count = $pref['eventpost_numevents'];
|
$show_count = varset($pref['eventpost_numevents'],3); // Number of events to show
|
||||||
$show_recurring = $pref['eventpost_checkrecur'];
|
$show_recurring = varset($pref['eventpost_checkrecur'],1); // Zero to exclude recurring events
|
||||||
$link_in_heading = $pref['eventpost_linkheader'];
|
$link_in_heading = varset($pref['eventpost_linkheader'],0); // Zero for simple heading, 1 to have clickable link
|
||||||
|
|
||||||
// Now set defaults for anything not defined
|
|
||||||
if (!$menu_title) $menu_title = EC_LAN_140;
|
|
||||||
if (!$days_ahead) $days_ahead = 30; // Number of days ahead to go
|
|
||||||
if (!$show_count) $show_count = 3; // Number of events to show
|
|
||||||
if (!$show_recurring) $show_recurring = 1; // Zero to exclude recurring events
|
|
||||||
if (!$link_in_heading) $link_in_heading = 0; // Zero for simple heading, 1 to have clickable link
|
|
||||||
|
|
||||||
|
|
||||||
require($ecal_dir."calendar_shortcodes.php");
|
require($ecal_dir."calendar_shortcodes.php");
|
||||||
@@ -65,55 +57,8 @@ else
|
|||||||
require($ecal_dir."calendar_template.php");
|
require($ecal_dir."calendar_template.php");
|
||||||
}
|
}
|
||||||
|
|
||||||
$site_time = $ecal_class->cal_timedate;
|
$start_time = $ecal_class->cal_timedate;
|
||||||
$end_time = $site_time + (86400 * $days_ahead);
|
$end_time = $start_time + (86400 * $days_ahead) - 1;
|
||||||
|
|
||||||
|
|
||||||
// Build up query bit by bit
|
|
||||||
$cal_qry = "SELECT e.event_id, e.event_rec_m, e.event_rec_y, e.event_start, e.event_thread, e.event_title, e.event_recurring, e.event_allday, ec.*
|
|
||||||
FROM #event as e LEFT JOIN #event_cat as ec ON e.event_category = ec.event_cat_id
|
|
||||||
WHERE (((e.event_start >= {$site_time} AND e.event_start < {$end_time}))";
|
|
||||||
|
|
||||||
if ($show_recurring > 0)
|
|
||||||
{ // This won't work properly under some circumstances if $days_ahead is greater than the number of days in the current month plus next month.
|
|
||||||
// If that matters, need another test on event_rec_y (which is actually the month) - plus the calculation to generate the values
|
|
||||||
$cal_datearray = $ecal_class->cal_date;
|
|
||||||
$first_day = $cal_datearray['mday'];
|
|
||||||
$first_month = $cal_datearray['mon'];
|
|
||||||
|
|
||||||
$end_date = mktime(0,0,0,$first_month,$first_day,0) + (86400 * $days_ahead);
|
|
||||||
$end_datearray = getdate($end_date);
|
|
||||||
$last_month = $end_datearray['mon'];
|
|
||||||
$last_day = $end_datearray['mday'];
|
|
||||||
$cal_qry .= " OR ((e.event_recurring = '1')
|
|
||||||
AND ";
|
|
||||||
if ($first_month == $last_month)
|
|
||||||
{ // All dates within current month
|
|
||||||
$cal_qry .= "(((e.event_rec_y = {$first_month})
|
|
||||||
AND (e.event_rec_m >= {$first_day}) AND (e.event_rec_m < {$last_day}) ) ))";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{ // Dates overlap one or more months
|
|
||||||
$cal_qry .= "(((e.event_rec_y = {$first_month}) AND (e.event_rec_m >= {$first_day}))
|
|
||||||
OR ((e.event_rec_y = {$last_month}) AND (e.event_rec_m < {$last_day}))";
|
|
||||||
$first_month++;
|
|
||||||
if ($first_month > 12) $first_month = 1;
|
|
||||||
if ($first_month <> $last_month)
|
|
||||||
{ // Add a whole month in the middle
|
|
||||||
$cal_qry .= " OR (e.event_rec_y = {$first_month}) ";
|
|
||||||
}
|
|
||||||
$cal_qry .= "))";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$cal_qry .= ')'.$ecal_class->extra_query; // Puts in class filter if not calendar admin
|
|
||||||
|
|
||||||
if (isset($pref['eventpost_fe_set']))
|
|
||||||
{
|
|
||||||
$cal_qry .= " AND find_in_set(ec.event_cat_id,'".$pref['eventpost_fe_set']."')";
|
|
||||||
}
|
|
||||||
|
|
||||||
$cal_qry .= " order by e.event_start LIMIT {$show_count}";
|
|
||||||
|
|
||||||
|
|
||||||
$cal_totev = 0;
|
$cal_totev = 0;
|
||||||
@@ -121,26 +66,29 @@ $cal_text = '';
|
|||||||
$cal_row = array();
|
$cal_row = array();
|
||||||
global $cal_row, $cal_totev;
|
global $cal_row, $cal_totev;
|
||||||
|
|
||||||
$cal_totev = $sql->db_Select_gen($cal_qry);
|
|
||||||
|
|
||||||
|
$ev_list = $ecal_class->get_n_events($show_count, $start_time, $end_time, varset($pref['eventpost_fe_set'],0), $show_recurring,
|
||||||
|
'event_id,event_start, event_thread, event_title, event_recurring, event_allday', 'event_cat_icon');
|
||||||
|
|
||||||
|
$cal_totev = count($ev_list);
|
||||||
if ($cal_totev > 0)
|
if ($cal_totev > 0)
|
||||||
{
|
{
|
||||||
while ($cal_row = $sql->db_Fetch())
|
foreach ($ev_list as $cal_row)
|
||||||
{
|
{
|
||||||
$cal_totev --; // Can use this to modify inter-event gap
|
$cal_totev --; // Can use this to modify inter-event gap
|
||||||
$cal_text .= $tp->parseTemplate($EVENT_CAL_FE_LINE,FALSE,$calendar_shortcodes);
|
$cal_text .= $tp->parseTemplate($EVENT_CAL_FE_LINE,TRUE,$calendar_shortcodes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if ($pref['eventpost_fe_hideifnone']) return '';
|
||||||
$cal_text.= EC_LAN_141;
|
$cal_text.= EC_LAN_141;
|
||||||
}
|
}
|
||||||
|
|
||||||
$calendar_title = $menu_title;
|
$calendar_title = $tp->toHTML($menu_title,FALSE,'TITLE'); // Allows multi-language title, shortcodes
|
||||||
if ($link_in_heading == 1)
|
if ($link_in_heading == 1)
|
||||||
{
|
{
|
||||||
$calendar_title = "<a class='forumlink' href='" . e_PLUGIN . "calendar_menu/event.php' >" . $menu_title . "</a>";
|
$calendar_title = "<a class='forumlink' href='" . e_PLUGIN . "calendar_menu/event.php' >" . $calendar_title . "</a>";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now handle the data, cache as well
|
// Now handle the data, cache as well
|
||||||
@@ -148,6 +96,7 @@ ob_start(); // Set up a new output buffer
|
|||||||
$ns->tablerender($calendar_title, $cal_text, 'next_event_menu');
|
$ns->tablerender($calendar_title, $cal_text, 'next_event_menu');
|
||||||
$cache_data = ob_get_flush(); // Get the page content, and display it
|
$cache_data = ob_get_flush(); // Get the page content, and display it
|
||||||
$e107cache->set($cache_tag, $cache_data); // Save to cache
|
$e107cache->set($cache_tag, $cache_data); // Save to cache
|
||||||
|
|
||||||
|
unset($ev_list);
|
||||||
|
|
||||||
?>
|
?>
|
@@ -11,60 +11,91 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/plugin.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/plugin.php,v $
|
||||||
| $Revision: 1.4 $ - with mods to hopefully trigger upgrade to new version
|
| $Revision: 1.5 $
|
||||||
| $Date: 2007-04-12 08:46:08 $
|
| $Date: 2007-07-13 19:37:52 $
|
||||||
| $Author: lisa_ $
|
| $Author: e107steved $
|
||||||
|
|
|
|
||||||
| 22.07.06 - Mods for V3.6 upgrade, including log directory
|
|
||||||
| 02.08.06 - Support for category icon display added
|
|
||||||
| 29.09.06 - prefs, db field added for next batch of mods
|
|
||||||
| 03.10.06 - forced subs fields changed
|
|
||||||
| 04.10.06 - db field order changed to avoid confusing update routines
|
|
||||||
| 29.10.06 - Language mods to reflect CVS update to V1.14
|
|
||||||
| 10.11.06 - Mods for next release to CVS
|
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
// Plugin info -------------------------------------------------------------------------------------------------------
|
// Plugin info
|
||||||
$lan_file = e_PLUGIN."calendar_menu/languages/".e_LANGUAGE.".php";
|
// -----------
|
||||||
@require_once(file_exists($lan_file) ? $lan_file : e_PLUGIN."calendar_menu/languages/English.php");
|
include_lan(e_PLUGIN."calendar_menu/languages/".e_LANGUAGE.".php");
|
||||||
$eplug_name = EC_ADLAN_1;
|
$eplug_name = EC_ADLAN_1;
|
||||||
$eplug_version = "3.6";
|
$eplug_version = "3.70";
|
||||||
$eplug_author = "jalist / cameron / McFly / Barry / Lisa_ / steved";
|
$eplug_author = "jalist / cameron / McFly / Barry / Lisa_ / steved";
|
||||||
$eplug_url = "http://e107.org";
|
$eplug_url = "http://e107.org";
|
||||||
$eplug_email = "jalist@e107.org";
|
$eplug_email = "jalist@e107.org";
|
||||||
$eplug_description = EC_LAN_107;
|
$eplug_description = EC_LAN_107;
|
||||||
$eplug_compatible = "e107v7";
|
$eplug_compatible = "e107v8";
|
||||||
$eplug_readme = "readme.pdf";
|
$eplug_readme = "readme.pdf";
|
||||||
// leave blank if no readme file
|
|
||||||
$eplug_compliant = TRUE;
|
$eplug_compliant = TRUE;
|
||||||
|
$eplug_folder = "calendar_menu"; // Name of the plugin's folder
|
||||||
|
|
||||||
// Name of the plugin's folder -------------------------------------------------------------------------------------
|
$eplug_menu_name = "calendar_menu"; // Name of menu item for plugin
|
||||||
$eplug_folder = "calendar_menu";
|
$eplug_conffile = "admin_config.php"; // Name of the admin configuration file
|
||||||
|
|
||||||
// Name of menu item for plugin ----------------------------------------------------------------------------------
|
$eplug_icon = $eplug_folder."/images/calendar_32.png"; // 32x32 icon
|
||||||
$eplug_menu_name = "calendar_menu";
|
$eplug_icon_small = $eplug_folder."/images/calendar_16.png"; // 16x16 icon
|
||||||
|
$eplug_caption = EC_LAN_81; // Admin caption
|
||||||
|
|
||||||
// Name of the admin configuration file --------------------------------------------------------------------------
|
|
||||||
$eplug_conffile = "admin_config.php";
|
|
||||||
|
|
||||||
// Icon image and caption text ------------------------------------------------------------------------------------
|
//---------------------------------------
|
||||||
$eplug_icon = $eplug_folder."/images/calendar_32.png";
|
// Get version of installed plugin
|
||||||
$eplug_icon_small = $eplug_folder."/images/calendar_16.png";
|
//---------------------------------------
|
||||||
$eplug_caption = EC_LAN_81; // "Configure Event Calendar";
|
// If there's the potential for install/uninstall/upgrade, $plug is always set.
|
||||||
|
// Otherwise we're just being scanned for some info - don't execute anything
|
||||||
|
$ec_mode = 'scan';
|
||||||
|
$ecal_ver = $eplug_version;
|
||||||
|
if (isset($plug))
|
||||||
|
{
|
||||||
|
if (isset($plug['plug_action']))
|
||||||
|
{
|
||||||
|
$ec_mode = $plug['plug_action']; // Definitive answer
|
||||||
|
}
|
||||||
|
elseif ($plug['plugin_installflag'])
|
||||||
|
{ // Potential upgrade - we're installed
|
||||||
|
$ecal_ver = $plug['plugin_version'];
|
||||||
|
$ec_mode = 'upgrade';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{ // Potential install
|
||||||
|
$ec_mode = 'install';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif (isset($pref['plug_installed'][$eplug_folder]))
|
||||||
|
{ // Potential upgrade - we're installed. But more likely just a scan
|
||||||
|
$ecal_ver = $pref['plug_installed'][$eplug_folder];
|
||||||
|
$ec_mode = 'upgrade';
|
||||||
|
}
|
||||||
|
if (($ec_mode == 'upgrade') && ($ecal_ver == $eplug_version)) $ec_mode = 'scan'; // Nothing to do if version up to date
|
||||||
|
|
||||||
$ecalSQL = new db;
|
list($$ecal_ver_num,$ecal_ver_alpha) = explode(" ", $ecal_ver);
|
||||||
$ecalSQL->db_Select("plugin", "plugin_version", "plugin_path='calendar_menu' AND plugin_installflag > 0");
|
$ecal_ver_num = intval((100*$ecal_ver_num) + 0.1); // Pull out numeric version as integer
|
||||||
list($ecalVer) = $ecalSQL->db_Fetch();
|
$ecal_ver_alpha = trim($ecal_ver_alpha); // Release candidate etc
|
||||||
$ecalVer = preg_replace("/[a-zA-z\s]/", '', $ecalVer);
|
|
||||||
|
|
||||||
// List of preferences -----------------------------------------------------------------------------------------------
|
//echo "Calendar Version: ".$ecal_ver." Numeric: ".$ecal_ver_num." Alpha: ".$ecal_ver_alpha." Mode: ".$ec_mode."<br />";
|
||||||
|
|
||||||
|
|
||||||
|
// Work out query to insert default category here, so we only have to modify one place.
|
||||||
|
require_once('ecal_class.php'); // Gets the define for the 'Default' category
|
||||||
|
$ec_insert_entries = "INSERT INTO ".MPREFIX."event_cat (event_cat_name, event_cat_description, event_cat_ahead, event_cat_msg1, event_cat_msg2, event_cat_lastupdate)
|
||||||
|
VALUES ('".EC_DEFAULT_CATEGORY."', '".EC_ADLAN_A190."', 5,
|
||||||
|
'Forthcoming event:\n\n{EC_MAIL_CATEGORY}\n\n{EC_MAIL_TITLE} on {EC_MAIL_HEADING_DATE}{EC_MAIL_TIME_START}\n\n".
|
||||||
|
"{EC_MAIL_DETAILS}\n\nFor further details: {EC_EVENT_LINK=Click Here}\n\nor {EC_MAIL_CONTACT} for further information.', ".
|
||||||
|
"'Calendar event imminent:\n\n{EC_MAIL_CATEGORY}\n\n{EC_MAIL_TITLE} on {EC_MAIL_HEADING_DATE}{EC_MAIL_TIME_START}\n\n{EC_MAIL_DETAILS}\n\n".
|
||||||
|
"For further details see the calendar entry on the web site:\n{EC_MAIL_LINK=Click Here}\n\n {EC_MAIL_CONTACT} for further details',
|
||||||
|
'".intval(time())."') ";
|
||||||
|
|
||||||
|
// List of preferences
|
||||||
|
// -------------------
|
||||||
$eplug_prefs = array(
|
$eplug_prefs = array(
|
||||||
"eventpost_admin" => 0,
|
"eventpost_admin" => 0,
|
||||||
"eventpost_adminlog" => 0,
|
"eventpost_adminlog" => 0,
|
||||||
"eventpost_showeventcount" => 1,
|
"eventpost_showeventcount" => 1,
|
||||||
|
"eventpost_showmouseover" => 0,
|
||||||
"eventpost_forum" => 1,
|
"eventpost_forum" => 1,
|
||||||
"eventpost_recentshow" => 0,
|
"eventpost_recentshow" => 0,
|
||||||
"eventpost_super" => 0,
|
"eventpost_super" => 0,
|
||||||
@@ -81,7 +112,7 @@ $eplug_prefs = array(
|
|||||||
"eventpost_datenext" => 1,
|
"eventpost_datenext" => 1,
|
||||||
"eventpost_eventdatecustom" => "%A %d %B %Y",
|
"eventpost_eventdatecustom" => "%A %d %B %Y",
|
||||||
"eventpost_nextdatecustom" => "%d %b",
|
"eventpost_nextdatecustom" => "%d %b",
|
||||||
"eventpost_mailsubject" => EC_ADLAN_A12,
|
"eventpost_mailsubject" => EC_ADLAN_A12." - {EC_MAIL_TITLE}",
|
||||||
"eventpost_mailfrom" => EC_ADLAN_A151,
|
"eventpost_mailfrom" => EC_ADLAN_A151,
|
||||||
"eventpost_mailaddress" => EC_ADLAN_A152,
|
"eventpost_mailaddress" => EC_ADLAN_A152,
|
||||||
"eventpost_asubs" => 1,
|
"eventpost_asubs" => 1,
|
||||||
@@ -92,13 +123,20 @@ $eplug_prefs = array(
|
|||||||
"eventpost_checkrecur" => 1,
|
"eventpost_checkrecur" => 1,
|
||||||
"eventpost_linkheader" => 0,
|
"eventpost_linkheader" => 0,
|
||||||
"eventpost_fe_set" => "",
|
"eventpost_fe_set" => "",
|
||||||
|
"eventpost_fe_hideifnone" => '0',
|
||||||
|
"eventpost_fe_showrecent" => 0,
|
||||||
"eventpost_showcaticon" => 0,
|
"eventpost_showcaticon" => 0,
|
||||||
|
"eventpost_printlists" => 1,
|
||||||
"eventpost_namelink" => 1 );
|
"eventpost_namelink" => 1 );
|
||||||
|
|
||||||
// List of table names -----------------------------------------------------------------------------------------------
|
|
||||||
|
// List of table names
|
||||||
|
//--------------------
|
||||||
$eplug_table_names = array("event","event_cat","event_subs" );
|
$eplug_table_names = array("event","event_cat","event_subs" );
|
||||||
|
|
||||||
// List of sql requests to create tables -----------------------------------------------------------------------------
|
|
||||||
|
// List of sql requests to create tables
|
||||||
|
//--------------------------------------
|
||||||
$eplug_tables = array(
|
$eplug_tables = array(
|
||||||
"CREATE TABLE ".MPREFIX."event (
|
"CREATE TABLE ".MPREFIX."event (
|
||||||
event_id int(11) unsigned NOT NULL auto_increment,
|
event_id int(11) unsigned NOT NULL auto_increment,
|
||||||
@@ -142,72 +180,75 @@ $eplug_tables = array(
|
|||||||
event_userid int(10) unsigned NOT NULL default '0',
|
event_userid int(10) unsigned NOT NULL default '0',
|
||||||
event_cat int(10) unsigned NOT NULL default '0',
|
event_cat int(10) unsigned NOT NULL default '0',
|
||||||
PRIMARY KEY (event_subid)
|
PRIMARY KEY (event_subid)
|
||||||
) TYPE=MyISAM;");
|
) TYPE=MyISAM;", $ec_insert_entries);
|
||||||
|
|
||||||
|
|
||||||
// Create a link in main menu (yes=TRUE, no=FALSE) -------------------------------------------------------------
|
// Create a link in main menu (yes=TRUE, no=FALSE)
|
||||||
|
//---------------------------
|
||||||
$ec_dir = e_PLUGIN."calendar_menu/";
|
$ec_dir = e_PLUGIN."calendar_menu/";
|
||||||
$eplug_link = TRUE;
|
$eplug_link = TRUE;
|
||||||
$eplug_link_name = EC_LAN_83; // "Calendar";
|
$eplug_link_name = EC_LAN_83; // "Calendar";
|
||||||
$eplug_link_url = "".$ec_dir."calendar.php";
|
$eplug_link_url = "".$ec_dir."calendar.php";
|
||||||
$eplug_link_perms = "Everyone"; // Everyone, Guest, Member, Admin
|
$eplug_link_perms = "everyone"; // Everyone, Guest, Member, Admin
|
||||||
|
|
||||||
|
|
||||||
// Text to display after plugin successfully installed ------------------------------------------------------------------
|
// Text to display after plugin successfully installed
|
||||||
$eplug_done = EC_LAN_82; // "To activate please go to your menus screen and select the calendar_menu into one of your menu areas.";
|
//----------------------------------------------------
|
||||||
|
$eplug_done = EC_LAN_82; // "To activate please go to your menus screen and select the calendar_menu into one of your menu areas.";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// upgrading ... //
|
// upgrading ... //
|
||||||
$upgrade_add_prefs = "";
|
$upgrade_add_prefs = array();
|
||||||
$upgrade_remove_prefs = "";
|
$upgrade_remove_prefs = array();
|
||||||
$upgrade_alter_tables = array();
|
$upgrade_alter_tables = array();
|
||||||
$version_notes = "";
|
$version_notes = "";
|
||||||
|
|
||||||
|
|
||||||
|
//----------------------------------------------------
|
||||||
|
// Solely for upgrades after here
|
||||||
|
//----------------------------------------------------
|
||||||
|
|
||||||
if (!function_exists('create_ec_log_dir'))
|
if (!function_exists('create_ec_log_dir'))
|
||||||
{
|
{
|
||||||
function create_ec_log_dir()
|
function create_ec_log_dir($eplug_folder)
|
||||||
{
|
|
||||||
global $eplug_folder;
|
|
||||||
|
|
||||||
$response = "";
|
|
||||||
$cal_log_dir = e_PLUGIN.$eplug_folder.'/log';
|
|
||||||
if (!is_dir($cal_log_dir))
|
|
||||||
{ // Need to create log directory
|
|
||||||
if (!mkdir($cal_log_dir,0666))
|
|
||||||
{
|
|
||||||
$response = EC_ADLAN_A158."<br />";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!is_dir($cal_log_dir))
|
|
||||||
{
|
{
|
||||||
$response .= EC_ADLAN_A153;
|
$response = "";
|
||||||
|
$cal_log_dir = e_PLUGIN.$eplug_folder.'/log';
|
||||||
|
if (!is_dir($cal_log_dir))
|
||||||
|
{ // Need to create log directory
|
||||||
|
if (!mkdir($cal_log_dir,0666))
|
||||||
|
{
|
||||||
|
$response = EC_ADLAN_A158."<br />";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!is_dir($cal_log_dir))
|
||||||
|
{
|
||||||
|
$response .= EC_ADLAN_A153;
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Now check directory permissions
|
||||||
|
if (!is_writable($cal_log_dir."/"))
|
||||||
|
{
|
||||||
|
if (!chmod($cal_log_dir,0666))
|
||||||
|
{
|
||||||
|
$response = EC_ADLAN_A154."<br />";
|
||||||
|
}
|
||||||
|
if (!is_writable($cal_log_dir."/"))
|
||||||
|
{
|
||||||
|
$response .= EC_ADLAN_A155;
|
||||||
|
}
|
||||||
|
}
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now check directory permissions
|
|
||||||
if (!is_writable($cal_log_dir."/"))
|
|
||||||
{
|
|
||||||
if (!chmod($cal_log_dir,0666))
|
|
||||||
{
|
|
||||||
$response = EC_ADLAN_A154."<br />";
|
|
||||||
}
|
|
||||||
if (!is_writable($cal_log_dir."/"))
|
|
||||||
{
|
|
||||||
$response .= EC_ADLAN_A155;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $response;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Note: Decimal points removed from version number, two decimal places implied
|
||||||
if ($ecalVer < 3.5)
|
if ($ecal_ver_num < 350)
|
||||||
{
|
{ // To version 3.50
|
||||||
// To version 3.5
|
// echo "Add for V3.5<br />";
|
||||||
|
$upgrade_alter_tables = array_merge($upgrade_alter_tables,array(
|
||||||
$upgrade_alter_tables = array(
|
|
||||||
"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_class int(10) unsigned NOT NULL default '0'",
|
"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_class int(10) unsigned NOT NULL default '0'",
|
||||||
"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_subs tinyint(3) unsigned NOT NULL default '0'",
|
"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_subs tinyint(3) unsigned NOT NULL default '0'",
|
||||||
"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_force tinyint(3) unsigned NOT NULL default '0'",
|
"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_force tinyint(3) unsigned NOT NULL default '0'",
|
||||||
@@ -225,17 +266,19 @@ $upgrade_alter_tables = array(
|
|||||||
event_cat int(10) unsigned NOT NULL default '0',
|
event_cat int(10) unsigned NOT NULL default '0',
|
||||||
PRIMARY KEY (event_subid)
|
PRIMARY KEY (event_subid)
|
||||||
) TYPE=MyISAM;"
|
) TYPE=MyISAM;"
|
||||||
);
|
));
|
||||||
$version_notes .= "<u>3.5</u><br />".EC_ADLAN_A156."<br />";
|
$version_notes .= "<u>3.5</u><br />".EC_ADLAN_A156."<br />";
|
||||||
}
|
}
|
||||||
// To version 3.6 - fair number of tweaks overall
|
|
||||||
if ($ecalVer < 3.6)
|
// To version 3.60 - fair number of tweaks overall
|
||||||
|
if ($ecal_ver_num < 360)
|
||||||
{
|
{
|
||||||
$upgrade_alter_tables = array(
|
// echo "Add for V3.6<br />";
|
||||||
|
$upgrade_alter_tables = array_merge($upgrade_alter_tables,array(
|
||||||
"ALTER TABLE ".MPREFIX."event_cat DROP event_cat_force",
|
"ALTER TABLE ".MPREFIX."event_cat DROP event_cat_force",
|
||||||
"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_description text",
|
"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_description text",
|
||||||
"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_force_class int(10) unsigned NOT NULL default '0'"
|
"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_force_class int(10) unsigned NOT NULL default '0'"
|
||||||
);
|
));
|
||||||
$verprefs = array(
|
$verprefs = array(
|
||||||
"eventpost_adminlog" => 0,
|
"eventpost_adminlog" => 0,
|
||||||
"eventpost_showeventcount" => 1,
|
"eventpost_showeventcount" => 1,
|
||||||
@@ -257,11 +300,11 @@ $upgrade_alter_tables = array(
|
|||||||
"eventpost_recentshow" => 0,
|
"eventpost_recentshow" => 0,
|
||||||
"eventpost_dateevent" => 1,
|
"eventpost_dateevent" => 1,
|
||||||
"eventpost_datenext" => 1,
|
"eventpost_datenext" => 1,
|
||||||
"eventpost_eventdatecustom" => "&A %d %B %Y",
|
"eventpost_eventdatecustom" => "%A %d %B %Y",
|
||||||
"eventpost_nextdatecustom" => "%d %b",
|
"eventpost_nextdatecustom" => "%d %b",
|
||||||
"eventpost_menulink" => 0 );
|
"eventpost_menulink" => 0 );
|
||||||
$upgrade_add_prefs .= $verprefs;
|
$upgrade_add_prefs = array_merge($upgrade_add_prefs,$verprefs);
|
||||||
$version_notes .= "<u>3.6</u><br />".EC_ADLAN_A156."<br />".create_ec_log_dir()."<br />
|
$version_notes .= "<u>3.6</u><br />".EC_ADLAN_A156."<br />".create_ec_log_dir($eplug_folder)."<br />
|
||||||
<a href='".e_PLUGIN_ABS.$eplug_folder."/".$eplug_conffile."'>Configure</a><br />";
|
<a href='".e_PLUGIN_ABS.$eplug_folder."/".$eplug_conffile."'>Configure</a><br />";
|
||||||
|
|
||||||
$upgrade_remove_prefs = array(
|
$upgrade_remove_prefs = array(
|
||||||
@@ -274,6 +317,22 @@ $upgrade_alter_tables = array(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Mods for 3.70 - not much
|
||||||
|
if ($ecal_ver_num < 370)
|
||||||
|
{
|
||||||
|
// echo "Add for V3.7<br />";
|
||||||
|
$upgrade_alter_tables = array_merge($upgrade_alter_tables,array($ec_insert_entries)); // Add the 'default' category
|
||||||
|
|
||||||
|
$verprefs = array(
|
||||||
|
"eventpost_showmouseover" => 0,
|
||||||
|
"eventpost_fe_hideifnone" => '0',
|
||||||
|
"eventpost_fe_showrecent" => 0,
|
||||||
|
"eventpost_printlists" => 1
|
||||||
|
);
|
||||||
|
$upgrade_add_prefs = array_merge($upgrade_add_prefs,$verprefs);
|
||||||
|
$version_notes .= "<u>3.7</u><br />".EC_ADLAN_A164;
|
||||||
|
}
|
||||||
|
|
||||||
$eplug_upgrade_done = EC_LAN_108."<br />".$version_notes;
|
$eplug_upgrade_done = EC_LAN_108."<br />".$version_notes;
|
||||||
|
|
||||||
|
|
||||||
|
Binary file not shown.
@@ -11,9 +11,9 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/search/search_parser.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/search/search_parser.php,v $
|
||||||
| $Revision: 1.1.1.1 $
|
| $Revision: 1.2 $
|
||||||
| $Date: 2006-12-02 04:34:50 $
|
| $Date: 2007-07-13 19:37:52 $
|
||||||
| $Author: mcfly_e107 $
|
| $Author: e107steved $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -11,42 +11,54 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/subs_menu.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/subs_menu.php,v $
|
||||||
| $Revision: 1.1.1.1 $
|
| $Revision: 1.2 $
|
||||||
| $Date: 2006-12-02 04:34:49 $
|
| $Date: 2007-07-13 19:37:52 $
|
||||||
| $Author: mcfly_e107 $
|
| $Author: e107steved $
|
||||||
|
|
|
||||||
| 09.07.06 - Mods by steved:
|
|
||||||
| General restructuring to use common routines
|
|
||||||
| Support for sending emails on previous day.
|
|
||||||
| Logging capability
|
|
||||||
| Debugging option
|
|
||||||
|
|
|
||||||
| 11.07.06 - Adjustment to logging messages
|
|
||||||
| 12.07.06 - More adjustment to logging messages
|
|
||||||
| 15.07.06 - Adjustment to 'tomorrow' query
|
|
||||||
| 17.07.06 - More adjustment to 'tomorrow' query
|
|
||||||
|
|
|
||||||
| 04.10.06 - Mods to mailout to allow mix of voluntary and forced subs to the same event
|
|
||||||
| 24.10.06 - Change DB names so works as a menu
|
|
||||||
| 25.10.06 - Logging selectively disabled when run as menu
|
|
||||||
| 27.10.06 - Update queries to new structure, don't email banned users
|
|
||||||
| 31.10.06 - Attempt to optimise query better
|
|
||||||
| 01.11.06 - More refinements on query
|
|
||||||
| 05.11.06 - More refinement on query - ignores midnight at end of day. **** BANG ****
|
|
||||||
|
|
|
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
// This menu can be called from a cron job - see readme.rtf
|
// This menu is best called from a cron job - see readme.pdf
|
||||||
$run_from_menu = function_exists("parseheader"); // Use this to suppress logging in 'through' path
|
global $ec_default_msg_1, $ec_default_msg_2, $ec_log_requirement, $ec_debug_level, $ec_run_from_menu, $tp;
|
||||||
$ec_dir = e_PLUGIN . "calendar_menu/";
|
|
||||||
// Check if we are going to do the notify
|
|
||||||
|
|
||||||
$debug_level = 0; // Set to 1 or 2 to suppress actual sending of emails
|
|
||||||
|
|
||||||
if (($debug_level > 0) && e_QUERY)
|
global $ecal_class;
|
||||||
|
if (!is_object($ecal_class))
|
||||||
|
{
|
||||||
|
require_once('ecal_class.php');
|
||||||
|
$ecal_class = new ecal_class;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Work out whether we're being called as a menu (i.e. within a displayed page) or not
|
||||||
|
$ec_run_from_menu = (defined('USER_AREA') && USER_AREA) || (defined('ADMIN_AREA') && ADMIN_AREA);
|
||||||
|
//echo ($ec_run_from_menu == TRUE ? "Run from menu" : "Standalone")."<br />";
|
||||||
|
|
||||||
|
if ($ec_run_from_menu)
|
||||||
|
{
|
||||||
|
if ($cacheData = $e107cache->retrieve("nomd5_cal_subs",$ecal_class->max_cache_time, TRUE)) exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
@include_lan(e_PLUGIN."calendar_menu/languages/".e_LANGUAGE.".php"); // May be needed for mailouts
|
||||||
|
|
||||||
|
if (!isset($calendar_shortcodes)) require(e_PLUGIN."calendar_menu/calendar_shortcodes.php");
|
||||||
|
if (is_readable(THEME."ec_mailout_template.php"))
|
||||||
|
{ // Has to be require
|
||||||
|
require(THEME."ec_mailout_template.php");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
require(e_PLUGIN."calendar_menu/ec_mailout_template.php");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$ec_debug_level = 0; // Set to 1 or 2 to suppress actual sending of emails
|
||||||
|
$ec_default_msg_1 = "";
|
||||||
|
$ec_default_msg_2 = "";
|
||||||
|
|
||||||
|
|
||||||
|
if (($ec_debug_level > 0) && e_QUERY)
|
||||||
{ // Run with query of ?dd-mm[-yy] to test specific date
|
{ // Run with query of ?dd-mm[-yy] to test specific date
|
||||||
list($day,$month,$year) = explode("-",e_QUERY);
|
list($day,$month,$year) = explode("-",e_QUERY);
|
||||||
if (!isset($year) || ($year == 0)) $year = date("Y");
|
if (!isset($year) || ($year == 0)) $year = date("Y");
|
||||||
@@ -55,24 +67,52 @@ if (($debug_level > 0) && e_QUERY)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // Normal operation
|
{ // Normal operation
|
||||||
$cal_starttime = mktime(0, 0, 0, date("n"), date("d"), date("Y"));
|
$cal_starttime = mktime(0, 0, 0, date("n"), date("d"), date("Y"));
|
||||||
}
|
}
|
||||||
|
|
||||||
$log_requirement = 0; // Logging required 0=none, 1=summary, 2=detailed
|
|
||||||
if (isset($pref['eventpost_emaillog'])) $log_requirement = $pref['eventpost_emaillog'];
|
|
||||||
if ($debug_level >= 2) $log_requirement = 2; // Force full logging if debug
|
|
||||||
|
|
||||||
if ($log_requirement > 0)
|
$ec_log_requirement = 0; // Logging required 0=none, 1=summary, 2=detailed
|
||||||
|
if (isset($pref['eventpost_emaillog'])) $ec_log_requirement = $pref['eventpost_emaillog'];
|
||||||
|
if ($ec_debug_level >= 2) $ec_log_requirement = 2; // Force full logging if debug
|
||||||
|
|
||||||
|
|
||||||
|
function subs_log_a_line($log_text,$close_after = FALSE, $log_always = FALSE)
|
||||||
{
|
{
|
||||||
$log_filename = $ec_dir.'log/calendar_mail.txt';
|
global $ec_log_requirement, $ec_run_from_menu;
|
||||||
if (!$run_from_menu)
|
if ($ec_log_requirement == 0) return;
|
||||||
|
if ($ec_run_from_menu && ($log_always == FALSE)) return;
|
||||||
|
// echo "Logging: ".$log_text."<br />";
|
||||||
|
static $handle = NULL;
|
||||||
|
$log_filename = e_PLUGIN."calendar_menu/log/calendar_mail.txt";
|
||||||
|
if ($handle == NULL)
|
||||||
|
{
|
||||||
|
if (!($handle = fopen($log_filename, "a")))
|
||||||
|
{ // Problem creating file?
|
||||||
|
echo "File open failed!<br />";
|
||||||
|
$ec_log_requirement = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fwrite($handle,$log_text) == FALSE)
|
||||||
|
{
|
||||||
|
$ec_log_requirement = 0;
|
||||||
|
echo "File write failed!<br />";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($close_after)
|
||||||
{
|
{
|
||||||
if (!($handle = fopen($log_filename, 'a'))) $log_requirement = 0;
|
|
||||||
if (fwrite($handle,"\r\n\r\nMail subscriptions run started at ".date("D j M Y G:i:s")) === false) $log_requirement = 0;
|
|
||||||
fclose($handle);
|
fclose($handle);
|
||||||
|
$handle = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Start of the 'real' code
|
||||||
|
subs_log_a_line("\r\n\r\nMail subscriptions run started at ".date("D j M Y G:i:s"),TRUE,FALSE);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Start with the 'in advance' emails
|
// Start with the 'in advance' emails
|
||||||
$cal_args = "select * from #event left join #event_cat on event_category=event_cat_id where (event_cat_subs>0 OR event_cat_force_class != '') and
|
$cal_args = "select * from #event left join #event_cat on event_category=event_cat_id where (event_cat_subs>0 OR event_cat_force_class != '') and
|
||||||
event_cat_last < " . intval($cal_starttime) . " and
|
event_cat_last < " . intval($cal_starttime) . " and
|
||||||
@@ -81,85 +121,121 @@ event_start >= (" . intval($cal_starttime) . "+(86400*(event_cat_ahead))) and
|
|||||||
event_start < (" . intval($cal_starttime) . "+(86400*(event_cat_ahead+1))) and
|
event_start < (" . intval($cal_starttime) . "+(86400*(event_cat_ahead+1))) and
|
||||||
find_in_set(event_cat_notify,'1,3,5,7')";
|
find_in_set(event_cat_notify,'1,3,5,7')";
|
||||||
|
|
||||||
send_mailshot($cal_args, 'Advance',1);
|
ec_send_mailshot($cal_args, 'Advance',1, $calendar_shortcodes);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// then for today
|
// then for today
|
||||||
//$cal_starttime = mktime(0, 0, 0, date("n"), date("d"), date("Y"));
|
|
||||||
$cal_args = "select * from #event left join #event_cat on event_category=event_cat_id where (event_cat_subs>0 OR event_cat_force_class != '') and
|
$cal_args = "select * from #event left join #event_cat on event_category=event_cat_id where (event_cat_subs>0 OR event_cat_force_class != '') and
|
||||||
event_cat_today < " . intval($cal_starttime) . " and
|
event_cat_today < " . intval($cal_starttime) . " and
|
||||||
event_start >= (" . intval($cal_starttime) . ") and
|
event_start >= (" . intval($cal_starttime) . ") and
|
||||||
event_start < (86400+" . intval($cal_starttime) . ") and
|
event_start < (86400+" . intval($cal_starttime) . ") and
|
||||||
find_in_set(event_cat_notify,'2,3,6,7')";
|
find_in_set(event_cat_notify,'2,3,6,7')";
|
||||||
|
|
||||||
send_mailshot($cal_args, 'today',2);
|
ec_send_mailshot($cal_args, 'today',2, $calendar_shortcodes);
|
||||||
|
|
||||||
|
|
||||||
// Finally do 'day before' emails
|
// Finally do 'day before' emails (its an alternative to 'today' emails)
|
||||||
$cal_args = "select * from #event left join #event_cat on event_category=event_cat_id where (event_cat_subs>0 OR event_cat_force_class != '') and
|
$cal_args = "select * from #event left join #event_cat on event_category=event_cat_id where (event_cat_subs>0 OR event_cat_force_class != '') and
|
||||||
event_cat_today < " . intval($cal_starttime) . " and
|
event_cat_today < " . intval($cal_starttime) . " and
|
||||||
event_start >= (" . intval($cal_starttime) ." + 86400 ) and
|
event_start >= (" . intval($cal_starttime) ." + 86400 ) and
|
||||||
event_start < (" . intval($cal_starttime) ." + 172800) and
|
event_start < (" . intval($cal_starttime) ." + 172800) and
|
||||||
find_in_set(event_cat_notify,'4,5,6,7')";
|
find_in_set(event_cat_notify,'4,5,6,7')";
|
||||||
|
|
||||||
send_mailshot($cal_args, 'tomorrow',2);
|
ec_send_mailshot($cal_args, 'tomorrow',2, $calendar_shortcodes);
|
||||||
|
|
||||||
|
|
||||||
if (($log_requirement > 0) && (!$run_from_menu))
|
subs_log_a_line("\r\n .. completed at ".date("D j M Y G:i:s")."\r\n",TRUE,FALSE);
|
||||||
|
|
||||||
|
// This stops the mailout running again until first access of tomorrow
|
||||||
|
if ($ec_run_from_menu)
|
||||||
{
|
{
|
||||||
if (!($handle = fopen($log_filename, 'a'))) $log_requirement = 0;
|
$e107cache->set("nomd5_cal_subs", time(),TRUE);
|
||||||
if (fwrite($handle," .. completed at ".date("D j M Y G:i:s")."\r\n") === false) $log_requirement = 0;
|
|
||||||
fclose($handle);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Done
|
// Done
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Function called to load in default templates (messages) if required - only accesses database once
|
||||||
|
function ec_load_default_messages()
|
||||||
|
{
|
||||||
|
global $sql2, $ec_default_msg_1, $ec_default_msg_2;
|
||||||
|
if (($ec_default_msg_1 != "") && ($ec_default_msg_2 != "")) return;
|
||||||
|
if ($sql2->db_Select("event_cat", "*", "event_cat_name = '".EC_DEFAULT_CATEGORY."' "))
|
||||||
|
{
|
||||||
|
if ($row = $sql2->db_Fetch())
|
||||||
|
{
|
||||||
|
$ec_default_msg_1 = $row['event_cat_msg1'];
|
||||||
|
$ec_default_msg_2 = $row['event_cat_msg2'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Put in generic message rather than nothing - will help flag omission
|
||||||
|
if ($ec_default_msg_1 == "") $ec_default_msg_1 = EC_LAN_146;
|
||||||
|
if ($ec_default_msg_2 == "") $ec_default_msg_2 = EC_LAN_147;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Function to actually send a mailshot
|
Function to actually send a mailshot
|
||||||
*/
|
*/
|
||||||
function send_mailshot($cal_query, $shot_type, $msg_num)
|
function ec_send_mailshot($cal_query, $shot_type, $msg_num, $calendar_shortcodes)
|
||||||
{
|
{
|
||||||
global $sql, $sql2;
|
global $sql, $sql2;
|
||||||
global $log_requirement, $log_filename, $debug_level;
|
global $ec_debug_level, $ec_log_requirement;
|
||||||
global $pref;
|
global $pref, $tp, $thisevent;
|
||||||
global $run_from_menu;
|
global $ec_default_msg_1, $ec_default_msg_2;
|
||||||
|
|
||||||
if (($log_requirement > 1) && (!$run_from_menu))
|
if ($ec_log_requirement > 1)
|
||||||
{
|
{
|
||||||
if (!$handle = fopen($log_filename, 'a')) $log_requirement = 0;
|
subs_log_a_line("\r\n Starting emails for ".$shot_type." at ".date("D j M Y G:i:s"),FALSE,FALSE);
|
||||||
if (fwrite($handle,"\r\n Starting emails for ".$shot_type." at ".date("D j M Y G:i:s")) === false) $log_requirement = 0;
|
if ($ec_debug_level >= 2) subs_log_a_line("\r\n Query is: ".$cal_query."\r\n",FALSE,FALSE);
|
||||||
if ($debug_level >= 2)
|
|
||||||
{
|
|
||||||
if (fwrite($handle,"\r\n Query is: ".$cal_query."\r\n") === false) $log_requirement = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($num_cat_proc = $sql->db_Select_gen($cal_query))
|
if ($num_cat_proc = $sql->db_Select_gen($cal_query))
|
||||||
{ // Got at least one event to process here
|
{ // Got at least one event to process here
|
||||||
if ($log_requirement > 1)
|
if ($ec_log_requirement > 1)
|
||||||
{
|
subs_log_a_line(" - ".$num_cat_proc." categories found to process\r\n",FALSE,TRUE);
|
||||||
if ($run_from_menu) if (!($handle = fopen($log_filename, 'a'))) $log_requirement = 0;
|
|
||||||
if (fwrite($handle," - ".$num_cat_proc." categories found to process\r\n") === false) $log_requirement = 0;
|
|
||||||
}
|
|
||||||
require_once(e_HANDLER . "mail.php");
|
require_once(e_HANDLER . "mail.php");
|
||||||
while ($cal_row = $sql->db_Fetch())
|
while ($cal_row = $sql->db_Fetch())
|
||||||
{ // Process one event at a time
|
{ // Process one event at a time
|
||||||
|
$thisevent = $cal_row; // Used for shortcodes
|
||||||
extract($cal_row);
|
extract($cal_row);
|
||||||
|
|
||||||
if ($log_requirement > 1)
|
subs_log_a_line(" Processing event: ".$event_title." \r\n",FALSE,TRUE);
|
||||||
{
|
|
||||||
if (fwrite($handle," Processing event: ".$event_title." \r\n") === false) $log_requirement = 0;
|
// Note that event processed, and generate the email
|
||||||
}
|
|
||||||
|
|
||||||
if ($msg_num == 1)
|
if ($msg_num == 1)
|
||||||
|
{
|
||||||
$sql2->db_Update("event_cat", "event_cat_last=" . time() . " where event_cat_id=" . intval($event_cat_id));
|
$sql2->db_Update("event_cat", "event_cat_last=" . time() . " where event_cat_id=" . intval($event_cat_id));
|
||||||
|
// $cal_msg = $event_title . "\n\n" . $event_cat_msg1;
|
||||||
|
$cal_msg = $event_cat_msg1;
|
||||||
|
if (trim($cal_msg) == "")
|
||||||
|
{
|
||||||
|
ec_load_default_messages();
|
||||||
|
$cal_msg = $ec_default_msg_1;
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
$sql2->db_Update("event_cat", "event_cat_today=" . time() . " where event_cat_id=" . intval($event_cat_id));
|
$sql2->db_Update("event_cat", "event_cat_today=" . time() . " where event_cat_id=" . intval($event_cat_id));
|
||||||
|
// $cal_msg = $event_title . "\n\n" . $event_cat_msg2;
|
||||||
|
$cal_msg = $event_cat_msg2;
|
||||||
// Start of next try on query
|
if (trim($cal_msg) == "")
|
||||||
|
{
|
||||||
|
ec_load_default_messages();
|
||||||
|
$cal_msg = $ec_default_msg_2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Parsing the template here means we can't use USER-related shortcodes
|
||||||
|
// Main ones which are relevant: MAIL_DATE_START, MAIL_TIME_START, MAIL_DATE_END,
|
||||||
|
// MAIL_TIME_END, MAIL_TITLE, MAIL_DETAILS, MAIL_CATEGORY, MAIL_LOCATION,
|
||||||
|
// MAIL_CONTACT, MAIL_THREAD (maybe). Also MAIL_LINK, MAIL_SHORT_DATE
|
||||||
|
// Best to strip entities here rather than at entry - handles old events as well
|
||||||
|
$cal_title = html_entity_decode($tp -> parseTemplate($pref['eventpost_mailsubject'], FALSE, $calendar_shortcodes),ENT_QUOTES,CHARSET);
|
||||||
|
$cal_msg = html_entity_decode($tp -> parseTemplate($cal_msg, FALSE, $calendar_shortcodes),ENT_QUOTES,CHARSET);
|
||||||
|
// $cal_msg = str_replace("\r","\n",$cal_msg);
|
||||||
|
|
||||||
// Four cases for the query:
|
// Four cases for the query:
|
||||||
// 1. No forced mailshots - based on event_subs table only Need INNER JOIN
|
// 1. No forced mailshots - based on event_subs table only Need INNER JOIN
|
||||||
// 2. Forced mailshot to members - send to all users (don't care about subscriptions) Don't need JOIN
|
// 2. Forced mailshot to members - send to all users (don't care about subscriptions) Don't need JOIN
|
||||||
@@ -206,42 +282,31 @@ if ($num_cat_proc = $sql->db_Select_gen($cal_query))
|
|||||||
WHERE u.user_ban = '0' {$where_clause} {$group_clause}";
|
WHERE u.user_ban = '0' {$where_clause} {$group_clause}";
|
||||||
|
|
||||||
|
|
||||||
if ($debug_level >= 2)
|
if ($ec_debug_level >= 2)
|
||||||
{
|
{
|
||||||
if (fwrite($handle,"\r\n Email selection query is: ".$cal_emilargs."\r\n") === false) $log_requirement = 0;
|
subs_log_a_line("\r\n Email selection query is: ".$cal_emilargs."\r\n",FALSE,TRUE);
|
||||||
}
|
}
|
||||||
if ($num_shots = $sql2->db_Select_gen($cal_emilargs))
|
if ($num_shots = $sql2->db_Select_gen($cal_emilargs))
|
||||||
{
|
{
|
||||||
if ($log_requirement > 1)
|
subs_log_a_line(" - ".$num_shots." emails found to send\r\n",FALSE,TRUE);
|
||||||
{
|
|
||||||
if (fwrite($handle," - ".$num_shots." emails found to send\r\n") === false) $log_requirement = 0;
|
while ($cal_emrow = $sql2->db_Fetch())
|
||||||
}
|
{
|
||||||
while ($cal_emrow = $sql2->db_Fetch())
|
extract($cal_emrow);
|
||||||
{
|
if ($ec_debug_level == 0)
|
||||||
extract($cal_emrow);
|
$send_result = sendemail($user_email, $cal_title, $cal_msg, $user_name, $pref['eventpost_mailaddress'], $pref['eventpost_mailfrom']);
|
||||||
if ($msg_num == 1)
|
|
||||||
$cal_msg = $event_title . "\n\n" . $event_cat_msg1;
|
|
||||||
else
|
else
|
||||||
$cal_msg = $event_title . "\n\n" . $event_cat_msg2;
|
$send_result = " **DEBUG**";
|
||||||
if ($debug_level == 0) $send_result = sendemail($user_email, $pref['eventpost_mailsubject'], $cal_msg, $user_name, $pref['eventpost_mailaddress'], $pref['eventpost_mailfrom']);
|
if ($ec_log_requirement > 1)
|
||||||
if ($log_requirement > 1)
|
|
||||||
{
|
{
|
||||||
$log_string = " Send to: ".$user_email." Name: ".$user_name;
|
subs_log_a_line(" Send to: ".$user_email." Name: ".$user_name." Result = ".$send_result."\r\n",FALSE,TRUE);
|
||||||
if ($debug_level > 0)
|
|
||||||
{ $log_string .= " *DEBUG*
|
|
||||||
"; }
|
|
||||||
else
|
|
||||||
{ $log_string .= " Result = ".$send_result."
|
|
||||||
"; }
|
|
||||||
if (fwrite($handle,$log_string) === false) $log_requirement = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // while
|
} // while
|
||||||
if ($log_requirement > 1)
|
if ($ec_log_requirement > 1)
|
||||||
{
|
{
|
||||||
if (fwrite($handle," Completed emails for ".$shot_type." at ".date("D j M Y G:i:s")."\r\n") === false) $log_requirement = 0;
|
subs_log_a_line(" Completed emails for ".$shot_type." at ".date("D j M Y G:i:s")."\r\n",TRUE,TRUE);
|
||||||
fclose($handle);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -11,14 +11,15 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/subscribe.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/subscribe.php,v $
|
||||||
| $Revision: 1.2 $
|
| $Revision: 1.3 $
|
||||||
| $Date: 2007-01-28 11:40:20 $
|
| $Date: 2007-07-13 19:37:52 $
|
||||||
| $Author: e107steved $
|
| $Author: e107steved $
|
||||||
|
|
|
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once("../../class2.php");
|
require_once("../../class2.php");
|
||||||
|
if (!isset($pref['plug_installed']['calendar_menu'])) header("Location: ".e_BASE."index.php");
|
||||||
include_lan(e_PLUGIN . "calendar_menu/languages/".e_LANGUAGE.".php");
|
include_lan(e_PLUGIN . "calendar_menu/languages/".e_LANGUAGE.".php");
|
||||||
|
|
||||||
define("PAGE_NAME", EC_LAN_80);
|
define("PAGE_NAME", EC_LAN_80);
|
||||||
|
Reference in New Issue
Block a user