From ce3916797eceeeeed1d0b1709c5d7bbaea4195c6 Mon Sep 17 00:00:00 2001 From: e107steved Date: Fri, 13 Jul 2007 19:37:52 +0000 Subject: [PATCH] Event Calendar V3.70 --- e107_plugins/calendar_menu/admin_config.php | 460 +++++++--- e107_plugins/calendar_menu/calendar.php | 358 ++++---- e107_plugins/calendar_menu/calendar_menu.php | 266 +++--- .../calendar_menu/calendar_shortcodes.php | 868 ++++++++++++------ e107_plugins/calendar_menu/calendar_sql.php | 3 +- .../calendar_menu/calendar_template.php | 241 ++--- e107_plugins/calendar_menu/e_list.php | 33 +- e107_plugins/calendar_menu/e_notify.php | 6 +- e107_plugins/calendar_menu/e_rss.php | 23 +- .../calendar_menu/ec_mailout_template.php | 72 ++ e107_plugins/calendar_menu/ec_pf_page.php | 424 +++++++++ e107_plugins/calendar_menu/ec_pf_template.php | 86 ++ e107_plugins/calendar_menu/ecal_class.php | 524 ++++++++++- e107_plugins/calendar_menu/event.php | 858 ++++++++--------- .../calendar_menu/images/recent_icon.png | Bin 0 -> 329 bytes .../calendar_menu/languages/English.php | 124 ++- .../calendar_menu/next_event_menu.php | 99 +- e107_plugins/calendar_menu/plugin.php | 231 +++-- e107_plugins/calendar_menu/readme.pdf | Bin 60782 -> 265 bytes .../calendar_menu/search/search_parser.php | 6 +- e107_plugins/calendar_menu/subs_menu.php | 257 ++++-- e107_plugins/calendar_menu/subscribe.php | 5 +- 22 files changed, 3325 insertions(+), 1619 deletions(-) create mode 100644 e107_plugins/calendar_menu/ec_mailout_template.php create mode 100644 e107_plugins/calendar_menu/ec_pf_page.php create mode 100644 e107_plugins/calendar_menu/ec_pf_template.php create mode 100644 e107_plugins/calendar_menu/images/recent_icon.png diff --git a/e107_plugins/calendar_menu/admin_config.php b/e107_plugins/calendar_menu/admin_config.php index fa8040fd8..07c28183f 100644 --- a/e107_plugins/calendar_menu/admin_config.php +++ b/e107_plugins/calendar_menu/admin_config.php @@ -11,20 +11,19 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/admin_config.php,v $ -| $Revision: 1.1.1.1 $ -| $Date: 2006-12-02 04:34:45 $ -| $Author: mcfly_e107 $ -| -| 02.11.06 - Cache clear option added -| 10.11.06 - Support for updated templates etc +| $Revision: 1.2 $ +| $Date: 2007-07-13 19:37:52 $ +| $Author: e107steved $ | +----------------------------------------------------------------------------+ */ $eplug_admin = true; // Make sure we show admin theme +$e_sub_cat = 'event_calendar'; require_once("../../class2.php"); require_once(e_HANDLER."userclass_class.php"); -if (!getperms("P")) { - header("location:".e_BASE."index.php"); +if (!getperms("P")) +{ + header("location:".e_BASE."index.php"); } @@ -39,6 +38,7 @@ if (isset($_POST['updatesettings'])) { $pref['eventpost_admin'] = $_POST['eventpost_admin']; $pref['eventpost_adminlog'] = $_POST['eventpost_adminlog']; $pref['eventpost_showeventcount'] = $_POST['eventpost_showeventcount']; + $pref['eventpost_showmouseover'] = $_POST['eventpost_showmouseover']; $pref['eventpost_forum'] = $_POST['eventpost_forum']; $pref['eventpost_recentshow'] = $_POST['eventpost_recentshow']; $pref['eventpost_super'] = $_POST['eventpost_super']; @@ -55,6 +55,7 @@ if (isset($_POST['updatesettings'])) { $pref['eventpost_datenext'] = $_POST['eventpost_datenext']; $pref['eventpost_eventdatecustom'] = $_POST['eventpost_eventdatecustom']; $pref['eventpost_nextdatecustom'] = $_POST['eventpost_nextdatecustom']; + $pref['eventpost_printlists'] = $_POST['eventpost_printlists']; $pref['eventpost_mailsubject'] = $_POST['eventpost_mailsubject']; $pref['eventpost_mailfrom'] = $_POST['eventpost_mailfrom']; $pref['eventpost_mailaddress'] = $_POST['eventpost_mailaddress']; @@ -74,6 +75,8 @@ if (isset($_POST['updateforthcoming'])) $pref['eventpost_checkrecur'] = $_POST['eventpost_fe_checkrecur']; $pref['eventpost_linkheader'] = $_POST['eventpost_fe_linkheader']; $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_namelink'] = $_POST['eventpost_namelink']; save_prefs(); @@ -83,10 +86,11 @@ if (isset($_POST['updateforthcoming'])) if (e_QUERY) { - $qs = explode(".", e_QUERY); + $ec_qs = explode(".", e_QUERY); } require_once('ecal_class.php'); +global $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_string = strftime("%d %B %Y",$old_date); // $message = "Back delete {$back_count} months. Oldest date = {$old_string}"; - $qs[0] = "confdel"; - $qs[1] = $old_date; + $ec_qs[0] = "confdel"; + $ec_qs[1] = $old_date; } else $message = EC_ADLAN_A148; @@ -109,18 +113,22 @@ if (isset($_POST['deleteold']) && isset($_POST['eventpost_deleteoldmonths'])) if (isset($_POST['cache_clear'])) { - $qs[0] = "confcache"; + $ec_qs[0] = "confcache"; } + +//------------------------------------------------- + require_once(e_ADMIN."auth.php"); +if (!defined("USER_WIDTH")){ define("USER_WIDTH","width:auto"); } // 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); // 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"; @@ -128,7 +136,7 @@ if (isset($_POST['confirmdeleteold']) && isset($qs[0]) && ($qs[0] == "backdel")) if ($sql -> db_Delete("event",$qry)) { // 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; } else @@ -136,25 +144,25 @@ if (isset($_POST['confirmdeleteold']) && isset($qs[0]) && ($qs[0] == "backdel")) $message = EC_ADLAN_A149." : ".$sql->mySQLresult; } - $qs[0] = "maint"; + $ec_qs[0] = "maint"; } // 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'); $message = EC_ADLAN_A163; - $qs[0] = "maint"; // Re-display maintenance menu + $ec_qs[0] = "maint"; // Re-display maintenance menu } // 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 = "
-
+ @@ -167,7 +175,7 @@ if(isset($qs[0]) && ($qs[0] == "confdel")) // Prompt to clear cache -if (isset($qs[0]) && ($qs[0] == "confcache")) +if (isset($ec_qs[0]) && ($ec_qs[0] == "confcache")) { $text = "
@@ -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("", "
$message
"); + 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("", "
{$message}
"); + $message = ""; } //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_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']; 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. // db_Insert can take an array of key => value pairs $calendarmenu_args = array ( @@ -220,7 +253,6 @@ if(isset($qs[0]) && $qs[0] == "cat") 'event_cat_lastupdate' => intval(time()), 'event_cat_addclass' => intval($_POST['event_cat_addclass']) ); - if ($calendarmenu_db->db_Insert("event_cat", $calendarmenu_args)) { $calendarmenu_msg .= "
"; @@ -247,14 +279,27 @@ if(isset($qs[0]) && $qs[0] == "cat") event_cat_addclass='".intval($_POST['event_cat_addclass'])."', event_cat_lastupdate='".time()."' where event_cat_id='$calendarmenu_id'"; - if ($calendarmenu_db->db_Update("event_cat", $calendarmenu_args)){ - // Changes saved - $calendarmenu_msg .= ""; - }else{ - $calendarmenu_msg .= ""; + if ($calendarmenu_db->db_Update("event_cat", $calendarmenu_args)) + { // Changes saved + $calendarmenu_msg .= ""; + } + else + { + $calendarmenu_msg .= ""; } - } + } + // 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 if ($calendarmenu_action == 'dothings') { @@ -272,6 +317,39 @@ if(isset($qs[0]) && $qs[0] == "cat") extract($calendarmenu_row); $calendarmenu_cap1 = EC_ADLAN_A24; $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."

"; + $send_result = sendemail($user_email, $cal_title, $cal_msg, $user_name, $pref['eventpost_mailaddress'], $pref['eventpost_mailfrom']); + if ($send_result) + $calendarmenu_msg .= ""; + else + $calendarmenu_msg .= ""; + } break; } case '2': // New category @@ -283,22 +361,41 @@ if(isset($qs[0]) && $qs[0] == "cat") $calendar_category_description = ""; $calendarmenu_cap1 = EC_ADLAN_A23; $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; } case '3': - { - // delete the record - if ($_POST['calendarmenu_okdel'] == '1'){ - if ($calendarmenu_db->db_Select("event", "event_id", " where event_category='$calendarmenu_id'", "nowhere")){ - $calendarmenu_msg .= ""; - }else{ - if ($calendarmenu_db->db_Delete("event_cat", " event_cat_id='$calendarmenu_id'")){ - $calendarmenu_msg .= ""; - }else{ - $calendarmenu_msg .= ""; - } + { // delete the record + if ($_POST['calendarmenu_okdel'] == '1') + { + if ($calendarmenu_db->db_Select("event", "event_id", " where event_category='{$calendarmenu_id}'", "nowhere")) + { + $calendarmenu_msg .= ""; + } + else + { + if ($calendarmenu_db->db_Delete("event_cat", " event_cat_id='{$calendarmenu_id}'")) + { + $calendarmenu_msg .= ""; + } + else + { + $calendarmenu_msg .= ""; } - }else{ + } + } + else + { $calendarmenu_msg .= ""; } $calendarmenu_dodel = TRUE; @@ -310,7 +407,6 @@ if(isset($qs[0]) && $qs[0] == "cat") { require_once(e_HANDLER."file_class.php"); - $calendarmenu_text .= "
".EC_ADLAN_A150.$old_string."
".EC_ADLAN_A26."
".EC_ADLAN_A28."
".EC_ADLAN_A29."
".EC_ADLAN_A28."
".EC_ADLAN_A29."
".EC_ADLAN_A187.$ecal_send_email."
".EC_ADLAN_A188.$ecal_send_email."
".EC_ADLAN_A59."
".EC_ADLAN_A30."
".EC_ADLAN_A32."
".EC_ADLAN_A59."
".EC_ADLAN_A30."
".EC_ADLAN_A32."
".EC_ADLAN_A31."
@@ -375,17 +471,31 @@ if(isset($qs[0]) && $qs[0] == "cat") - + - - + + - - + + - +
".EC_ADLAN_A83."
".EC_ADLAN_A84."".EC_ADLAN_A84; + if ($calendarmenu_do == 1) + $calendarmenu_text .= "


"; + $calendarmenu_text .= "
"; + if ($event_cat_name != EC_DEFAULT_CATEGORY) + $calendarmenu_text .= "
".EC_ADLAN_A189.""; + $calendarmenu_text .= " +
".EC_ADLAN_A117."".EC_ADLAN_A117; + if ($calendarmenu_do == 1) + $calendarmenu_text .= "


"; + $calendarmenu_text .= "
"; + if ($event_cat_name != EC_DEFAULT_CATEGORY) + $calendarmenu_text .= "
".EC_ADLAN_A189.""; + $calendarmenu_text .= " +
"; } @@ -437,7 +547,7 @@ if(isset($qs[0]) && $qs[0] == "cat") } if(isset($calendarmenu_text)) { - $ns->tablerender(EC_ADLAN_A19, $calendarmenu_text); + $ns->tablerender("
".EC_ADLAN_1." - ".EC_ADLAN_A19."
", $calendarmenu_text); } } @@ -445,7 +555,7 @@ if(isset($qs[0]) && $qs[0] == "cat") // 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; @@ -478,10 +588,20 @@ if (!isset($pref['eventpost_namelink'])) $pref['eventpost_namelink'] = '1'; - ".EC_ADLAN_A103."
".EC_ADLAN_A107." + ".EC_ADLAN_A103." + + ".EC_ADLAN_A107." + + + + + ".EC_ADLAN_A199." + + + ".EC_ADLAN_A130."
@@ -511,8 +631,8 @@ if (!isset($pref['eventpost_namelink'])) $pref['eventpost_namelink'] = '1'; // Now display all the current categories as checkboxes $cal_fe_prefs = array(); 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 ($calendarmenu2_db->db_Select("event_cat", "event_cat_id,event_cat_name", " order by event_cat_name", "nowhere")) + 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", " WHERE (event_cat_name != '".EC_DEFAULT_CATEGORY."') order by event_cat_name", "nowhere")) { while ($row = $calendarmenu2_db->db_Fetch()) { @@ -533,7 +653,7 @@ if (!isset($pref['eventpost_namelink'])) $pref['eventpost_namelink'] = '1';
"; - $ns->tablerender("
".EC_ADLAN_A100."
", $text); + $ns->tablerender("
".EC_ADLAN_1." - ".EC_ADLAN_A100."
", $text); } // End of Forthcoming Events Menu Options @@ -541,7 +661,7 @@ if (!isset($pref['eventpost_namelink'])) $pref['eventpost_namelink'] = '1'; // MAINTENANCE OPTIONS // ==================================================== -if((isset($qs[0]) && $qs[0] == "maint")) +if((isset($ec_qs[0]) && $ec_qs[0] == "maint")) { $text = "
@@ -570,7 +690,7 @@ if((isset($qs[0]) && $qs[0] == "maint"))


"; - $ns->tablerender("
".EC_ADLAN_A144."
", $text); + $ns->tablerender("
".EC_ADLAN_1." - ".EC_ADLAN_A141."
", $text); $text = "
@@ -579,36 +699,125 @@ if((isset($qs[0]) && $qs[0] == "maint"))
"; - $ns->tablerender("
".EC_ADLAN_A159."
", $text); + $ns->tablerender("
".EC_ADLAN_1." - ".EC_ADLAN_A159."
", $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 = "
+
+ + + + + + + + "; + + if (!$sql->db_Select_gen($qry)) + { + $text .= ""; + $num_entry = 0; + } + else + { + $text .= " + "; + 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 .= "
"; + $problems .= EC_ADLAN_A197; + } + $text .= " + + + + + + + "; + } // End while + +// Next-Previous. ========================== + if ($num_entry > $amount) + { + $parms = "{$num_entry},{$amount},{$from},".e_SELF."?".$ec_qs[0].".[FROM]"; + $text .= "
".$tp->parseTemplate("{NEXTPREV={$parms}}"); + } + } + $text .= "
".EC_ADLAN_A174."
".EC_ADLAN_A175."".EC_ADLAN_A176."".EC_ADLAN_A177."".EC_ADLAN_A178."".EC_ADLAN_A179."
".$row['user_id']."".$row['user_name']."".$row['event_cat_name']."".$problems." + ".LAN_DELETE."
"; + + $text .= "   ".str_replace("--NUM--", $num_entry, EC_ADLAN_A182); + + $ns->tablerender("
".EC_ADLAN_1." - ".EC_ADLAN_A173."
", $text); +} // ======================================================== // 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 = " @@ -619,44 +828,46 @@ $text .= " - ".EC_ADLAN_A165." - + ".EC_ADLAN_A165." + - ".EC_ADLAN_A140." - + ".EC_ADLAN_A183." + + ".EC_ADLAN_A184." - ".EC_LAN_102." - + ".EC_ADLAN_A140." + - ".EC_ADLAN_A171." - + ".EC_LAN_102." + + + + + ".EC_ADLAN_A171." + ".EC_ADLAN_A172." - ".EC_LAN_114." - - - + ".EC_LAN_114." + ".select_day_start($pref['eventpost_weekstart'])." - ".EC_LAN_117."
- + ".EC_LAN_117."
+ @@ -676,29 +887,35 @@ $text .= " - ".EC_ADLAN_A133."
- + ".EC_ADLAN_A133."
+ - ".EC_ADLAN_A138." -   ".EC_ADLAN_A139." + ".EC_ADLAN_A138." +   ".EC_ADLAN_A139." - ".EC_ADLAN_A122."
+ ".EC_ADLAN_A122."
".EC_ADLAN_A124."".$ecal_class->time_string($ecal_class->time_now)."
".EC_ADLAN_A125."".$ecal_class->time_string($ecal_class->site_timedate)."
".EC_ADLAN_A126."".$ecal_class->time_string($ecal_class->user_timedate)." - + - + + @@ -723,10 +941,10 @@ $text .= " - ".EC_ADLAN_A166."
+ ".EC_ADLAN_A166."
".EC_ADLAN_A169." - + @@ -756,32 +974,43 @@ $text .= " - ".EC_ADLAN_A95." -   ".EC_ADLAN_A96." + ".EC_ADLAN_A193."
+ + + + + + + ".EC_ADLAN_A95." +   ".EC_ADLAN_A96." - ".EC_ADLAN_A92." - + ".EC_ADLAN_A92." + - ".EC_ADLAN_A91." - + ".EC_ADLAN_A91." + - ".EC_ADLAN_A93." - + ".EC_ADLAN_A93." + - ".EC_ADLAN_A114."
- + ".EC_ADLAN_A114."
+ "; SC_END -SC_BEGIN NAV_BUT_VIEWCAT - global $NAV_BUT_VIEWCAT; +SC_BEGIN EC_NAV_BUT_VIEWCAT //return ""; return ""; SC_END -SC_BEGIN NAV_BUT_SUBSCRIPTION - global $NAV_BUT_SUBSCRIPTION, $pref; - if (($pref['eventpost_asubs']>0) && USER) +SC_BEGIN EC_NAV_BUT_SUBSCRIPTION + global $pref; + if (isset($pref['eventpost_asubs']) && ($pref['eventpost_asubs']>0) && USER) { - $NAV_BUT_SUBSCRIPTION = ""; + return ""; } - return $NAV_BUT_SUBSCRIPTION; SC_END -SC_BEGIN NAV_BUT_ENTEREVENT - global $NAV_BUT_ENTEREVENT, $pref, $prop; - $NAV_BUT_ENTEREVENT = ""; +SC_BEGIN EC_NAV_BUT_PRINTLISTS + global $pref; + if (isset($pref['eventpost_printlists']) && ($pref['eventpost_printlists']>0) && USER) + { + return ""; + } +SC_END + +SC_BEGIN EC_NAV_BUT_ENTEREVENT + global $EC_NAV_BUT_ENTEREVENT, $pref, $prop; + $EC_NAV_BUT_ENTEREVENT = ""; if (check_class($pref['eventpost_admin']) || getperms('0')){ // start no admin preference - $NAV_BUT_ENTEREVENT .= ""; + $EC_NAV_BUT_ENTEREVENT .= ""; } - return $NAV_BUT_ENTEREVENT; + return $EC_NAV_BUT_ENTEREVENT; SC_END -SC_BEGIN NAV_LINKCURRENTMONTH - global $NAV_LINKCURRENTMONTH, $month, $nowmonth, $year, $nowyear, $current, $ds; - $NAV_LINKCURRENTMONTH = ""; +SC_BEGIN EC_NAV_LINKCURRENTMONTH + global $EC_NAV_LINKCURRENTMONTH, $month, $nowmonth, $year, $nowyear, $current, $ds; + $EC_NAV_LINKCURRENTMONTH = ""; if ($month != $nowmonth || $year != $nowyear || $ds == 'one'){ - $NAV_LINKCURRENTMONTH = ""; + $EC_NAV_LINKCURRENTMONTH = ""; } - return $NAV_LINKCURRENTMONTH; + return $EC_NAV_LINKCURRENTMONTH; SC_END -SC_BEGIN NAV_CATEGORIES - global $NAV_CATEGORIES, $sql, $pref, $_POST, $cal_super; - $NAV_CATEGORIES = "\n\n"; $event_cat_id = ( isset($_POST['event_cat_ids']) && $_POST['event_cat_ids'] ? $_POST['event_cat_ids'] : null); - $cal_arg = ($cal_super ? "" : " find_in_set(event_cat_class,'".USERCLASS_LIST."') "); + $cal_arg = ($cal_super ? "" : " find_in_set(event_cat_class,'".USERCLASS_LIST."') AND "); + $cal_arg .= "(event_cat_name != '".EC_DEFAULT_CATEGORY."') "; $sql->db_Select("event_cat", "*", $cal_arg); while ($row = $sql->db_Fetch()){ if ($row['event_cat_id'] == $event_cat_id){ - $NAV_CATEGORIES .= ""; + $EC_NAV_CATEGORIES .= "\n"; }else{ - $NAV_CATEGORIES .= ""; + $EC_NAV_CATEGORIES .= "\n"; } } - $NAV_CATEGORIES .= ""; - return $NAV_CATEGORIES; + $EC_NAV_CATEGORIES .= "\n"; + return $EC_NAV_CATEGORIES; SC_END // CALENDAR SHOWEVENT ------------------------------------------------------------ -SC_BEGIN SHOWEVENT_IMAGE - global $SHOWEVENT_IMAGE, $ev; - if($ev['event_cat_icon'] && file_exists(e_PLUGIN."calendar_menu/images/".$ev['event_cat_icon'])){ - $img = ""; - }else{ - $img = ""; - } - return $img; - //return ""; -SC_END - -SC_BEGIN SHOWEVENT_INDICAT - global $SHOWEVENT_INDICAT, $ev; - return $ev['indicat']; -SC_END - -SC_BEGIN SHOWEVENT_HEADING - global $SHOWEVENT_HEADING, $ev, $datearray, $c; - $linkut = mktime(0 , 0 , 0 , $datearray['mon'], $c, $datearray['year']); - if(isset($ev['fulltopic']) && $ev['fulltopic']) - { // Used on first day - $show_title = $ev['event_title']; +SC_BEGIN EC_SHOWEVENT_IMAGE + global $ev; + if($ev['event_cat_icon'] && file_exists(e_PLUGIN."calendar_menu/images/".$ev['event_cat_icon'])) + { + $img = ""; } else { - if (strlen($ev['event_title']) > 10) - { - $show_title = substr($ev['event_title'], 0, 10) . "..."; - } - else - { - $show_title = $ev['event_title']; - } + $img = ""; + } + return $img; +SC_END + +SC_BEGIN EC_SHOWEVENT_INDICAT + global $ev; + return $ev['indicat']; +SC_END + +SC_BEGIN EC_SHOWEVENT_HEADING + global $ev, $datearray, $c, $tp; + $linkut = mktime(0 , 0 , 0 , $datearray['mon'], $c, $datearray['year']); + $show_title = $tp->toHTML($ev['event_title'],FALSE,'TITLE'); // Remove entities in case need to truncate + if(isset($ev['fulltopic']) && !$ev['fulltopic'] && (strlen($show_title) > 10)) + { + $show_title = substr($show_title, 0, 10) . "..."; } if($ev['startofevent']) { - if (isset($ev['is_recent'])) - { - return "".$show_title.""; - } - else - { - return "".$show_title.""; - } + return "".$show_title.""; } else { @@ -181,23 +175,13 @@ SC_BEGIN SHOWEVENT_HEADING } SC_END -SC_BEGIN CALENDAR_CALENDAR_RECENT_ICON - global $ev, $imode; - if (!isset($ev['is_recent'])) return ""; -// $recent_icon = e_PLUGIN."calendar_menu/images/recent_icon.png"; - $recent_icon = e_IMAGE."packs/".$imode."/generic/new.png"; - if (file_exists($recent_icon)) - { - return " "; - } - return "R"; -SC_END - -// CALENDAR CALENDAR ------------------------------------------------------------ -SC_BEGIN CALENDAR_CALENDAR_HEADER_DAY - global $CALENDAR_CALENDAR_HEADER_DAY, $day, $pref, $week; +//------------------------------------------ +// CALENDAR CALENDAR - 'Big' calendar +//------------------------------------------ +SC_BEGIN EC_CALENDAR_CALENDAR_HEADER_DAY + global $day, $pref; if(isset($pref['eventpost_lenday']) && $pref['eventpost_lenday']) { return "".substr($day,0,$pref['eventpost_lenday']).""; @@ -208,94 +192,319 @@ SC_BEGIN CALENDAR_CALENDAR_HEADER_DAY } SC_END -SC_BEGIN CALENDAR_CALENDAR_DAY_TODAY_HEADING - global $CALENDAR_CALENDAR_DAY_TODAY_HEADING, $startt, $c, $days; +SC_BEGIN EC_CALENDAR_CALENDAR_DAY_TODAY_HEADING + global $startt, $c, $days; return "".$days[($c-1)]." [".EC_LAN_TODAY."]"; SC_END -SC_BEGIN CALENDAR_CALENDAR_DAY_EVENT_HEADING - global $CALENDAR_CALENDAR_DAY_EVENT_HEADING, $startt, $c, $days; +SC_BEGIN EC_CALENDAR_CALENDAR_DAY_EVENT_HEADING + global $startt, $c, $days; return "".$days[($c-1)].""; SC_END -SC_BEGIN CALENDAR_CALENDAR_DAY_EMPTY_HEADING - global $CALENDAR_CALENDAR_DAY_EMPTY_HEADING, $startt, $c, $days; +SC_BEGIN EC_CALENDAR_CALENDAR_DAY_EMPTY_HEADING + global $startt, $c, $days; return "".$days[($c-1)].""; SC_END - -// EVENT LIST ------------------------------------------------ -SC_BEGIN EVENTLIST_CAPTION - global $EVENTLIST_CAPTION, $ds, $months, $selected_mon, $dayslo, $selected_day, $monthstart; - if ($ds == 'one') +SC_BEGIN EC_CALENDAR_CALENDAR_RECENT_ICON + global $ev; + if (!isset($ev['is_recent'])) return ""; + if (!$ev['startofevent']) return ""; // Only display on first day of multi-day events +// $recent_icon = e_PLUGIN."calendar_menu/images/recent_icon.png"; + $recent_icon = e_IMAGE."generic/".IMODE."/new.png"; + if (file_exists($recent_icon)) { - $EVENTLIST_CAPTION = EC_LAN_111.$months[$selected_mon-1]." ".$selected_day; + return " "; } - elseif ($ds != 'event') - { - $EVENTLIST_CAPTION = EC_LAN_112.$months[date("m", $monthstart)-1]; - } - return $EVENTLIST_CAPTION; + return "R"; SC_END -// EVENT ARCHIVE ------------------------------------------------------------ -SC_BEGIN EVENTARCHIVE_CAPTION - global $EVENTARCHIVE_CAPTION, $num; +//------------------------------------------ +// EVENT ARCHIVE (list of next events at bottom of event list) +//------------------------------------------ +SC_BEGIN EC_EVENTARCHIVE_CAPTION + global $EC_EVENTARCHIVE_CAPTION, $num; if ($num == 0) { - $EVENTARCHIVE_CAPTION = EC_LAN_137; + $EC_EVENTARCHIVE_CAPTION = EC_LAN_137; } else { - $EVENTARCHIVE_CAPTION = str_replace("-NUM-", $num, EC_LAN_62); + $EC_EVENTARCHIVE_CAPTION = str_replace("-NUM-", $num, EC_LAN_62); } - return $EVENTARCHIVE_CAPTION; + return $EC_EVENTARCHIVE_CAPTION; SC_END -SC_BEGIN EVENTARCHIVE_DATE - global $EVENTARCHIVE_DATE, $thisevent, $ecal_class; +SC_BEGIN EC_EVENTARCHIVE_DATE + global $EC_EVENTARCHIVE_DATE, $thisevent, $ecal_class; $startds = $ecal_class->event_date_string($thisevent['event_start']); - $EVENTARCHIVE_DATE = "".$startds.""; - return $EVENTARCHIVE_DATE; + $EC_EVENTARCHIVE_DATE = "".$startds.""; + return $EC_EVENTARCHIVE_DATE; SC_END -SC_BEGIN EVENTARCHIVE_DETAILS - global $EVENTARCHIVE_DETAILS, $thisevent, $tp; +SC_BEGIN EC_EVENTARCHIVE_DETAILS + global $EC_EVENTARCHIVE_DETAILS, $thisevent, $tp; $number = 40; $rowtext = $tp->toHTML($thisevent['event_details'], TRUE, "nobreak"); $rowtext = strip_tags($rowtext); $words = explode(" ", $rowtext); - $EVENTARCHIVE_DETAILS = implode(" ", array_slice($words, 0, $number)); + $EC_EVENTARCHIVE_DETAILS = implode(" ", array_slice($words, 0, $number)); if(count($words) > $number){ - $EVENTARCHIVE_DETAILS .= " ".EC_LAN_133." "; + $EC_EVENTARCHIVE_DETAILS .= " ".EC_LAN_133." "; } - return $EVENTARCHIVE_DETAILS; + return $EC_EVENTARCHIVE_DETAILS; SC_END -SC_BEGIN EVENTARCHIVE_EMPTY - global $EVENTARCHIVE_EMPTY; +SC_BEGIN EC_EVENTARCHIVE_EMPTY + global $EC_EVENTARCHIVE_EMPTY; return EC_LAN_37; SC_END -SC_BEGIN EVENTARCHIVE_HEADING - global $EVENTARCHIVE_HEADING, $thisevent; - $EVENTARCHIVE_HEADING = $thisevent['event_title']; - return $EVENTARCHIVE_HEADING; +SC_BEGIN EC_EVENTARCHIVE_HEADING + global $EC_EVENTARCHIVE_HEADING, $thisevent; + $EC_EVENTARCHIVE_HEADING = $thisevent['event_title']; + return $EC_EVENTARCHIVE_HEADING; SC_END +//------------------------------------------ +// EVENT LIST +//------------------------------------------ +SC_BEGIN EC_EVENTLIST_CAPTION + global $EC_EVENTLIST_CAPTION, $ds, $months, $selected_mon, $selected_day, $monthstart; + if ($ds == 'one') + { + $EC_EVENTLIST_CAPTION = EC_LAN_111.$months[$selected_mon-1]." ".$selected_day; + } + elseif ($ds != 'event') + { + $EC_EVENTLIST_CAPTION = EC_LAN_112.$months[date("m", $monthstart)-1]; + } + return $EC_EVENTLIST_CAPTION; +SC_END -// EVENT SHOWEVENT ------------------------------------------------------------ -SC_BEGIN EVENT_RECENT_ICON - global $thisevent, $ecal_class, $imode; - if (($ecal_class->max_recent_show == 0) || (time() - $thisevent['event_datestamp']) > $ecal_class->max_recent_show) return ""; -// Can use the generic icon, or a calendar-specific one - $recent_icon = e_IMAGE."packs/".$imode."/generic/new.png"; -// $recent_icon = e_PLUGIN."calendar_menu/images/recent_icon.png"; +//------------------------------------------ +// EVENT SHOWEVENT (Detail of individual events in Event List) +//------------------------------------------ +// Some of these shortcodes also used by big calendar + +SC_BEGIN EC_EVENT_RECENT_ICON + global $thisevent; + if (!isset($thisevent['is_recent'])) return; + $recent_icon = EC_RECENT_ICON; + if (file_exists($recent_icon)) + { + return " "; + } + return ""; +SC_END + +SC_BEGIN EC_EVENT_HEADING_DATE + global $thisevent, $ecal_class; + $startds = $ecal_class->event_date_string($thisevent['event_start']); + return $startds; +SC_END + +SC_BEGIN EC_EVENT_DATE_START + global $thisevent, $ecal_class; + $startds = $ecal_class->event_date_string($thisevent['event_start']); + return $startds; +SC_END + +SC_BEGIN EC_EVENT_TIME_START + global $thisevent, $ecal_class; + if ($thisevent['event_allday'] == 1) return ""; + $startds = $ecal_class->time_string($thisevent['event_start']); + return $startds; +SC_END + +SC_BEGIN EC_EVENT_DATE_END + global $thisevent, $ecal_class; +// if (intval($thisevent['event_end']/86400) == intval($thisevent['event_start']/86400)) return ""; // No end date if same day +// if ($thisevent['event_allday'] ||($thisevent['event_end'] == $thisevent['event_start'])) return ""; + if ($thisevent['event_end'] == $thisevent['event_start']) return ""; + $endds = $ecal_class->event_date_string($thisevent['event_end']); + return $endds; +SC_END + +SC_BEGIN EC_EVENT_TIME_END + global $thisevent, $ecal_class; + if ($thisevent['event_allday'] ||($thisevent['event_end'] == $thisevent['event_start'])) return ""; + $endds = $ecal_class->time_string($thisevent['event_end']); + return $endds; +SC_END + +SC_BEGIN EC_EVENT_TITLE + global $thisevent, $tp; + return $thisevent['event_title']; +SC_END + +SC_BEGIN EC_EVENT_CAT_ICON + global $thisevent; + if ($thisevent['event_cat_icon'] && file_exists(e_PLUGIN."calendar_menu/images/".$thisevent['event_cat_icon'])) + { + return " "; + } + else + { + return ""; + } +SC_END + +SC_BEGIN EC_EVENT_ID + global $thisevent; + return "calevent".$thisevent['event_id']; +SC_END + +SC_BEGIN EC_EVENT_DISPLAYSTYLE + global $EC_EVENT_DISPLAYSTYLE, $ds; + if (($ds=="event") || ($ds=="one")){ + $EC_EVENT_DISPLAYSTYLE = "show"; + }else{ + $EC_EVENT_DISPLAYSTYLE = "none"; + } + return $EC_EVENT_DISPLAYSTYLE; +SC_END + +SC_BEGIN EC_EVENT_DETAILS + global $thisevent, $tp; + return $tp->toHTML($thisevent['event_details'], TRUE, 'BODY'); +SC_END + +SC_BEGIN EC_EVENT_CATEGORY + global $EC_EVENT_CATEGORY, $thisevent; + $EC_EVENT_CATEGORY = $thisevent['event_cat_name']; + return $EC_EVENT_CATEGORY; +SC_END + +SC_BEGIN EC_EVENT_LOCATION + global $EC_EVENT_LOCATION, $thisevent; + if ($thisevent['event_location'] == "") + { + $EC_EVENT_LOCATION = ""; + } + else + { + $EC_EVENT_LOCATION = $thisevent['event_location']; + } + return $EC_EVENT_LOCATION; +SC_END + +SC_BEGIN EC_EVENT_AUTHOR + global $thisevent; + $lp = explode(".", $thisevent['event_author'],2); + if (preg_match("/[0-9]+/", $lp[0])) + { + $event_author_id = $lp[0]; + $event_author_name = $lp[1]; + } + if(USER) + { + $EC_EVENT_AUTHOR = "".$event_author_name.""; + } + else + { + $EC_EVENT_AUTHOR = $event_author_name; + } + return $EC_EVENT_AUTHOR; +SC_END + +SC_BEGIN EC_EVENT_CONTACT + global $EC_EVENT_CONTACT, $thisevent,$tp; + if ($thisevent['event_contact'] == "") + { + $EC_EVENT_CONTACT = ""; + } + else + { + $EC_EVENT_CONTACT = $tp->toHTML($thisevent['event_contact'],TRUE,'LINKTEXT'); + } + return $EC_EVENT_CONTACT; +SC_END + +SC_BEGIN EC_EVENT_THREAD + global $thisevent; + return (isset($thisevent['event_thread']) && ($thisevent['event_thread'] != "")) ? " ".EC_LAN_39."" : ""; +SC_END + +SC_BEGIN EC_EVENT_OPTIONS + global $EC_EVENT_OPTIONS, $thisevent, $event_author_name, $cal_super; + if (USERNAME == $event_author_name || $cal_super) + { + $EC_EVENT_OPTIONS = "".EC_LAN_35 . "  ".EC_LAN_36.""; + } + return $EC_EVENT_OPTIONS; +SC_END + +SC_BEGIN EC_EC_EVENT_LINK + global $thisevent, $PLUGINS_DIRECTORY; + $cal_dayarray = getdate($thisevent['event_start']); + $cal_linkut = mktime(0 , 0 , 0 , $cal_dayarray['mon'], $cal_dayarray['mday'], $cal_dayarray['year']).".one"; // ALways need "one" +// return " ".SITEURL.$PLUGINS_DIRECTORY. "calendar_menu/event.php?".$cal_linkut." "; + return " ".$pref['siteurl'].$PLUGINS_DIRECTORY. "calendar_menu/event.php?".$cal_linkut." "; +SC_END + + +SC_BEGIN EC_EVENT_EVENT_DATE_TIME + global $thisevent, $tp, $EVENT_EVENT_DATETIME; + $et = 0; + if (intval($thisevent['event_end']/86400) == intval($thisevent['event_start']/86400)) $et += 1; + if ($thisevent['event_allday']) $et += 2; + return $tp->parseTemplate($EVENT_EVENT_DATETIME[$et]); +SC_END + + +SC_BEGIN EC_EVENT_SHORT_DATE + global $thisevent, $ecal_class; + return $ecal_class->next_date_string($thisevent['event_start']); +SC_END + + +SC_BEGIN EC_IFNOT_ALLDAY + global $thisevent, $tp; + if ($thisevent['event_allday']) return; + if (trim($parm) == "") return; + return $tp->parseTemplate('{'.$parm.'}'); +SC_END + +SC_BEGIN EC_IF_ALLDAY + global $thisevent, $tp; + if (!$thisevent['event_allday']) return; + if (trim($parm) == "") return; + return $tp->parseTemplate('{'.$parm.'}'); +SC_END + + +SC_BEGIN EC_IFNOT_SAMEDAY + global $thisevent, $tp; + if (intval($thisevent['event_end']/86400) == intval($thisevent['event_start']/86400)) return ""; + if (!$thisevent['event_allday']) return; + if (trim($parm) == "") return; + return $tp->parseTemplate('{'.$parm.'}'); +SC_END + +SC_BEGIN EC_IF_SAMEDAY + global $thisevent, $tp; + if (intval($thisevent['event_end']/86400) != intval($thisevent['event_start']/86400)) return ""; + if (!$thisevent['event_allday']) return; + if (trim($parm) == "") return; + return $tp->parseTemplate('{'.$parm.'}'); +SC_END + + +// FORTHCOMINT EVENTS MENU +//-------------------------------------------- + +SC_BEGIN EC_NEXT_EVENT_RECENT_ICON + global $thisevent; + if (!$pref['eventpost_fe_showrecent']) return; + if (!isset($thisevent['is_recent'])) return; + $recent_icon = EC_RECENT_ICON; if (file_exists($recent_icon)) { return " "; @@ -303,175 +512,304 @@ SC_BEGIN EVENT_RECENT_ICON return ""; SC_END -SC_BEGIN EVENT_HEADING_DATE - global $thisevent, $ecal_class; - $startds = $ecal_class->event_date_string($thisevent['event_start']); - return $startds; +SC_BEGIN EC_NEXT_EVENT_TIME + global $cal_row, $ecal_class; + if ($cal_row['event_allday'] != 1) return $ecal_class->time_string($cal_row['event_start']); else return ''; SC_END -SC_BEGIN EVENT_DATE_START - global $thisevent, $ecal_class; - $startds = $ecal_class->event_date_string($thisevent['event_start']); - return $startds; +SC_BEGIN EC_NEXT_EVENT_DATE + global $cal_row, $ecal_class; + return $ecal_class->next_date_string($cal_row['event_start']); SC_END -SC_BEGIN EVENT_TIME_START +SC_BEGIN EC_NEXT_EVENT_TITLE + global $pref, $cal_row; + if (isset($pref['eventpost_namelink']) && ($pref['eventpost_namelink'] == '2') && (isset($cal_row['event_thread']) && ($cal_row['event_thread'] != ""))) + { + $fe_event_title = ""; + } + else + { + $fe_event_title = ""; + } + $fe_event_title .= $cal_row['event_title'].""; + return $fe_event_title; +SC_END + +SC_BEGIN EC_NEXT_EVENT_ICON + global $pref, $cal_row; + $fe_icon_file = ""; + if ($pref['eventpost_showcaticon'] == 1) + { + if($cal_row['event_cat_icon'] && file_exists(e_PLUGIN."calendar_menu/images/".$cal_row['event_cat_icon'])) + { + $fe_icon_file = e_PLUGIN_ABS."calendar_menu/images/".$cal_row['event_cat_icon']; + } + else + { + $fe_icon_file = THEME_ABS."images/".(defined("BULLET") ? BULLET : "bullet2.gif"); + } + } + return $fe_icon_file; +SC_END + +SC_BEGIN EC_NEXT_EVENT_GAP + global $cal_totev; + if ($cal_totev) return "

"; else return ""; +SC_END + + +// Event mailout shortcodes +//-------------------------- +SC_BEGIN EC_MAIL_HEADING_DATE + global $thisevent, $ecal_class; + if (isset($parm) && ($parm !== "")) + { + return strftime($parm,$thisevent['event_start']); + } + else + { + return $ecal_class->event_date_string($thisevent['event_start']); + } +SC_END + +SC_BEGIN EC_MAIL_DATE_START + global $thisevent, $ecal_class; + if (isset($parm) && ($parm !== "")) + { + return strftime($parm,$thisevent['event_start']); + } + else + { + return $ecal_class->event_date_string($thisevent['event_start']); + } +SC_END + +SC_BEGIN EC_MAIL_TIME_START global $thisevent, $ecal_class; if ($thisevent['event_allday'] == 1) return ""; $startds = $ecal_class->time_string($thisevent['event_start']); return $startds; SC_END -SC_BEGIN EVENT_DATE_END +SC_BEGIN EC_MAIL_DATE_END global $thisevent, $ecal_class; if ($thisevent['event_allday'] ||($thisevent['event_end'] == $thisevent['event_start'])) return ""; - $endds = $ecal_class->event_date_string($thisevent['event_end']); - return $endds; + if (isset($parm) && ($parm !== "")) + { + return strftime($parm,$thisevent['event_end']); + } + else + { + return $ecal_class->event_date_string($thisevent['event_end']); + } SC_END -SC_BEGIN EVENT_TIME_END +SC_BEGIN EC_MAIL_TIME_END global $thisevent, $ecal_class; if ($thisevent['event_allday'] ||($thisevent['event_end'] == $thisevent['event_start'])) return ""; $endds = $ecal_class->time_string($thisevent['event_end']); return $endds; SC_END -SC_BEGIN EVENT_TITLE +SC_BEGIN EC_MAIL_TITLE global $thisevent; return $thisevent['event_title']; SC_END -SC_BEGIN EVENT_CAT_ICON - global $thisevent; - if ($thisevent['event_cat_icon'] && file_exists(e_PLUGIN."calendar_menu/images/".$thisevent['event_cat_icon'])) - { - return " "; - } - else - { - return ""; - } -SC_END -SC_BEGIN EVENT_ID +SC_BEGIN EC_MAIL_ID global $thisevent; return "calevent".$thisevent['event_id']; SC_END -SC_BEGIN EVENT_DISPLAYSTYLE - global $EVENT_DISPLAYSTYLE, $ds; - if (($ds=="event") || ($ds=="one")){ - $EVENT_DISPLAYSTYLE = "show"; - }else{ - $EVENT_DISPLAYSTYLE = "none"; - } - return $EVENT_DISPLAYSTYLE; -SC_END -SC_BEGIN EVENT_DETAILS +SC_BEGIN EC_MAIL_DETAILS global $EVENT_DETAILS, $thisevent, $tp; - return $tp->toHTML($thisevent['event_details'], TRUE); + return $tp->toHTML($thisevent['event_details'], TRUE,'BODY, no_make_clickable'); SC_END -SC_BEGIN EVENT_CATEGORY + +SC_BEGIN EC_MAIL_CATEGORY global $EVENT_CATEGORY, $thisevent; - $EVENT_CATEGORY = $thisevent['event_cat_name']; + $EVENT_CATEGORY = $thisevent['event_cat_name']; return $EVENT_CATEGORY; SC_END -SC_BEGIN EVENT_LOCATION +SC_BEGIN EC_MAIL_LOCATION global $EVENT_LOCATION, $thisevent; - if ($thisevent['event_location'] == ""){ - $EVENT_LOCATION = ""; - }else{ - $EVENT_LOCATION = $thisevent['event_location']; + if ($thisevent['event_location'] == "") + { + $EVENT_LOCATION = ""; + } + else + { + $EVENT_LOCATION = $thisevent['event_location']; } return $EVENT_LOCATION; SC_END -SC_BEGIN EVENT_AUTHOR - global $EVENT_AUTHOR, $event_author_id, $event_author_name; - if(USER){ - $EVENT_AUTHOR = "".$event_author_name.""; - }else{ - $EVENT_AUTHOR = $event_author_name; - } - return $EVENT_AUTHOR; -SC_END -SC_BEGIN EVENT_CONTACT - global $EVENT_CONTACT, $thisevent,$tp; - if ($thisevent['event_contact'] == ""){ - //$EVENT_CONTACT = EC_LAN_38; // Not Specified ; - $EVENT_CONTACT = ""; - }else{ - $EVENT_CONTACT = $tp->toHTML($thisevent['event_contact'],TRUE); - } - return $EVENT_CONTACT; -SC_END - -SC_BEGIN EVENT_THREAD - global $EVENT_THREAD, $thisevent; - return (isset($thisevent['event_thread']) && ($thisevent['event_thread'] != "")) ? " ".EC_LAN_39."" : ""; -SC_END - -SC_BEGIN EVENT_OPTIONS - global $EVENT_OPTIONS, $thisevent, $event_author_name, $cal_super, $imode; - if (USERNAME == $event_author_name || $cal_super){ - $EVENT_OPTIONS = "".EC_LAN_35 . "  ".EC_LAN_36.""; - } - return $EVENT_OPTIONS; -SC_END - - - - -SC_BEGIN NEXT_EVENT_TIME - global $cal_row, $ecal_class; - if ($cal_row['event_allday'] != 1) return $ecal_class->time_string($cal_row['event_start']); else return ''; -SC_END - -SC_BEGIN NEXT_EVENT_DATE - global $cal_row, $ecal_class; - return $ecal_class->next_date_string($cal_row['event_start']); -SC_END - -SC_BEGIN NEXT_EVENT_TITLE - global $pref, $cal_row; - if (isset($pref['eventpost_namelink']) && ($pref['eventpost_namelink'] == '2') && (isset($cal_row['event_thread']) && ($cal_row['event_thread'] != ""))) - { - $fe_event_title = ""; - } - else - { - $fe_event_title = ""; - } - $fe_event_title .= $cal_row['event_title'].""; - return $fe_event_title; -SC_END - -SC_BEGIN NEXT_EVENT_ICON - global $pref, $cal_row, $ecal_dir; - $fe_icon_file = ""; - if ($pref['eventpost_showcaticon'] == 1) - { - if($cal_row['event_cat_icon'] && file_exists($ecal_dir."images/".$cal_row['event_cat_icon'])) +SC_BEGIN EC_MAIL_CONTACT + global $MAIL_CONTACT, $thisevent,$tp; + if ($thisevent['event_contact'] == "") { - $fe_icon_file = $ecal_dir."images/".$cal_row['event_cat_icon']; + $MAIL_CONTACT = ""; } else { - $fe_icon_file = THEME."images/".(defined("BULLET") ? BULLET : "bullet2.gif"); + $MAIL_CONTACT = $tp->toHTML($thisevent['event_contact'],TRUE,"LINKTEXT"); } + return $MAIL_CONTACT; +SC_END + +SC_BEGIN EC_MAIL_THREAD + global $thisevent; + return (isset($thisevent['event_thread']) && ($thisevent['event_thread'] != "")) ? $thisevent['event_thread'] : ""; +SC_END + +SC_BEGIN EC_MAIL_LINK + global $thisevent, $PLUGINS_DIRECTORY, $pref; + $cal_dayarray = getdate($thisevent['event_start']); + $cal_linkut = mktime(0 , 0 , 0 , $cal_dayarray['mon'], $cal_dayarray['mday'], $cal_dayarray['year']).".one"; // ALways need "one" +// return " ".SITEURL.$PLUGINS_DIRECTORY. "calendar_menu/event.php?".$cal_linkut." "; + return " ".$pref['siteurl'].$PLUGINS_DIRECTORY. "calendar_menu/event.php?".$cal_linkut." "; +SC_END + + +SC_BEGIN EC_MAIL_SHORT_DATE + global $thisevent, $ecal_class; + return $ecal_class->next_date_string($thisevent['event_start']); +SC_END + +// Codes can be used to return a LAN to help with multi-language +SC_BEGIN EC_MAIL_SUBJECT + return EC_MAILOUT_SUBJECT; +SC_END + + +// Specific to the 'listings' page +//-------------------------------- +SC_BEGIN EC_PR_LIST_TITLE + global $ec_list_title; + return $ec_list_title; +SC_END + + +SC_BEGIN EC_PR_CAT_LIST + global $ec_category_list; + if (is_array($ec_category_list)) + return implode(", ",$ec_category_list); + else + return $ec_category_list; +SC_END + + +SC_BEGIN EC_PR_CHANGE_YEAR + global $ec_year_change, $thisevent_start_date; + if ($ec_year_change) return $thisevent_start_date['year']; +SC_END + + +SC_BEGIN EC_PR_CHANGE_MONTH + global $ec_month_change, $thisevent_start_date; + if ($ec_month_change) return $thisevent_start_date['month']; +SC_END + + +SC_BEGIN EC_PR_LIST_START + global $ecal_class, $ec_start_date; + if (isset($parm) && ($parm !== "")) + { + return strftime($parm,$ec_start_date); + } + else + { + return $ecal_class->event_date_string($ec_start_date); } - return $fe_icon_file; SC_END -SC_BEGIN NEXT_EVENT_GAP - global $cal_totev; - if ($cal_totev) return "

"; else return ""; + +SC_BEGIN EC_PR_LIST_END + global $ecal_class, $ec_end_date; + if (isset($parm) && ($parm !== "")) + return strftime($parm,$ec_end_date); + else + return $ecal_class->event_date_string($ec_end_date); SC_END +SC_BEGIN EC_NOW_DATE + global $ecal_class; + if (isset($parm) && ($parm !== "")) + return strftime($parm,time()); + else + return $ecal_class->event_date_string(time()); +SC_END + + +SC_BEGIN EC_NOW_TIME + global $ecal_class; + if (isset($parm) && ($parm !== "")) + return strftime($parm,time()); + else + return $ecal_class->time_string(time()); +SC_END + + +SC_BEGIN EC_PRINT_BUTTON + global $ec_output_type; + if ($ec_output_type != 'print') return; + return ""; +SC_END + + +SC_BEGIN EC_IF_PRINT + global $ec_output_type, $tp; + if ($ec_output_type != 'print') return; + if (trim($parm) == "") return; + return $tp->parseTemplate('{'.$parm.'}'); +SC_END + +SC_BEGIN EC_IFNOT_PRINT + global $ec_output_type, $tp; + if ($ec_output_type == 'print') return; + if (trim($parm) == "") return; + return $tp->parseTemplate('{'.$parm.'}'); +SC_END + +SC_BEGIN EC_IF_DISPLAY + global $ec_output_type, $tp; + if ($ec_output_type != 'display') return; + if (trim($parm) == "") return; + return $tp->parseTemplate('{'.$parm.'}'); +SC_END + +SC_BEGIN EC_IFNOT_DISPLAY + global $ec_output_type, $tp; + if ($ec_output_type == 'display') return; + if (trim($parm) == "") return; + return $tp->parseTemplate('{'.$parm.'}'); +SC_END + +SC_BEGIN EC_IF_PDF + global $ec_output_type, $tp; + if ($ec_output_type != 'pdf') return; + if (trim($parm) == "") return; + return $tp->parseTemplate('{'.$parm.'}'); +SC_END + +SC_BEGIN EC_IFNOT_PDF + global $ec_output_type, $tp; + if ($ec_output_type == 'pdf') return; + if (trim($parm) == "") return; + return $tp->parseTemplate('{'.$parm.'}'); +SC_END + +SC_BEGIN EC_PDF_OPTS + global $ec_pdf_options; + $ec_pdf_options = $parm; +SC_END + */ ?> \ No newline at end of file diff --git a/e107_plugins/calendar_menu/calendar_sql.php b/e107_plugins/calendar_menu/calendar_sql.php index 8a965266f..f410b0f59 100644 --- a/e107_plugins/calendar_menu/calendar_sql.php +++ b/e107_plugins/calendar_menu/calendar_sql.php @@ -14,7 +14,8 @@ CREATE TABLE event ( event_thread varchar(100) NOT NULL default '', event_rec_m 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;, CREATE TABLE event_cat ( event_cat_id smallint(5) unsigned NOT NULL auto_increment, diff --git a/e107_plugins/calendar_menu/calendar_template.php b/e107_plugins/calendar_menu/calendar_template.php index 2d41d9011..7f8a9a814 100644 --- a/e107_plugins/calendar_menu/calendar_template.php +++ b/e107_plugins/calendar_menu/calendar_template.php @@ -11,64 +11,66 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/calendar_template.php,v $ -| $Revision: 1.1.1.1 $ -| $Date: 2006-12-02 04:34:46 $ -| $Author: mcfly_e107 $ +| $Revision: 1.2 $ +| $Date: 2007-07-13 19:37:52 $ +| $Author: e107steved $ | -| 10.11.06 steved - mods for next CVS release +----------------------------------------------------------------------------+ */ 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 ------------------------------------------------------------ -$sc_style['PREV_MONTH']['pre'] = ""; -$sc_style['PREV_MONTH']['post'] = ""; +$sc_style['EC_PREV_MONTH']['pre'] = ""; +$sc_style['EC_PREV_MONTH']['post'] = ""; -$sc_style['CURRENT_MONTH']['pre'] = ""; -$sc_style['CURRENT_MONTH']['post'] = ""; +$sc_style['EC_CURRENT_MONTH']['pre'] = ""; +$sc_style['EC_CURRENT_MONTH']['post'] = ""; -$sc_style['NEXT_MONTH']['pre'] = ""; -$sc_style['NEXT_MONTH']['post'] = ""; +$sc_style['EC_NEXT_MONTH']['pre'] = ""; +$sc_style['EC_NEXT_MONTH']['post'] = ""; -$sc_style['PREV_YEAR']['pre'] = ""; -$sc_style['PREV_YEAR']['post'] = ""; +$sc_style['EC_PREV_YEAR']['pre'] = ""; +$sc_style['EC_PREV_YEAR']['post'] = ""; -$sc_style['MONTH_LIST']['pre'] = ""; -$sc_style['MONTH_LIST']['post'] = ""; +$sc_style['EC_MONTH_LIST']['pre'] = ""; +$sc_style['EC_MONTH_LIST']['post'] = ""; -$sc_style['NEXT_YEAR']['pre'] = ""; -$sc_style['NEXT_YEAR']['post'] = ""; +$sc_style['EC_NEXT_YEAR']['pre'] = ""; +$sc_style['EC_NEXT_YEAR']['post'] = ""; -// $CALENDAR_TIME_TABLE = "
- - - + + + \n - - - + + + \n
{PREV_MONTH}{CURRENT_MONTH}{NEXT_MONTH}{EC_PREV_MONTH}{EC_CURRENT_MONTH}{EC_NEXT_MONTH}
{PREV_YEAR}{MONTH_LIST}{NEXT_YEAR}{EC_PREV_YEAR}{EC_MONTH_LIST}{EC_NEXT_YEAR}
"; -// NAVIGATION BUTTONS ------------------------------------------------------------ +// NAVIGATION BUTTONS //$sc_style['NAV_LINKCURRENTMONTH']['pre'] = ""; //$sc_style['NAV_LINKCURRENTMONTH']['post'] = ""; -$sc_style['NAV_LINKCURRENTMONTH']['pre'] = ""; -$sc_style['NAV_LINKCURRENTMONTH']['post'] = ""; +$sc_style['EC_NAV_LINKCURRENTMONTH']['pre'] = ""; +$sc_style['EC_NAV_LINKCURRENTMONTH']['post'] = ""; $CALENDAR_NAVIGATION_TABLE = "
- +\n
{NAV_CATEGORIES} {NAV_BUT_ALLEVENTS} {NAV_BUT_VIEWCAT} {NAV_BUT_ENTEREVENT} {NAV_BUT_SUBSCRIPTION} {NAV_LINKCURRENTMONTH}{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}
@@ -77,26 +79,26 @@ $CALENDAR_NAVIGATION_TABLE = " // EVENT LIST ------------------------------------------------------------ -$sc_style['EVENTLIST_CAPTION']['pre'] = ""; -$sc_style['EVENTLIST_CAPTION']['post'] = ":

\n"; +$sc_style['EC_EVENTLIST_CAPTION']['pre'] = ""; +$sc_style['EC_EVENTLIST_CAPTION']['post'] = ":

\n"; -$EVENT_EVENTLIST_TABLE_START = "{EVENTLIST_CAPTION}"; +$EVENT_EVENTLIST_TABLE_START = "
{EC_EVENTLIST_CAPTION}"; $EVENT_EVENTLIST_TABLE_END = "
"; // EVENT ARCHIVE ------------------------------------------------------------ -$sc_style['EVENTARCHIVE_CAPTION']['pre'] = ""; -$sc_style['EVENTARCHIVE_CAPTION']['post'] = "\n"; +$sc_style['EC_EVENTARCHIVE_CAPTION']['pre'] = ""; +$sc_style['EC_EVENTARCHIVE_CAPTION']['post'] = "\n"; -$EVENT_ARCHIVE_TABLE_START = "
{EVENTARCHIVE_CAPTION}"; +$EVENT_ARCHIVE_TABLE_START = "
{EC_EVENTARCHIVE_CAPTION}"; $EVENT_ARCHIVE_TABLE = " - - + + \n"; //
{EVENTARCHIVE_DETAILS} -$EVENT_ARCHIVE_TABLE_EMPTY = "\n"; +$EVENT_ARCHIVE_TABLE_EMPTY = "\n"; $EVENT_ARCHIVE_TABLE_END = "
{EVENT_RECENT_ICON}{EVENTARCHIVE_DATE}{EVENTARCHIVE_HEADING}{EC_EVENT_RECENT_ICON}{EC_EVENTARCHIVE_DATE}{EC_EVENTARCHIVE_HEADING}
{EVENTARCHIVE_EMPTY}
{EC_EVENTARCHIVE_EMPTY}
"; @@ -105,77 +107,98 @@ $EVENT_ARCHIVE_TABLE_END = ""; $EVENT_EVENT_TABLE_START = ""; $EVENT_EVENT_TABLE_END = "
"; -$sc_style['EVENT_HEADING_DATE']['pre'] = ""; -$sc_style['EVENT_HEADING_DATE']['post'] = ""; +$sc_style['EC_EVENT_HEADING_DATE']['pre'] = ""; +$sc_style['EC_EVENT_HEADING_DATE']['post'] = ""; -$sc_style['EVENT_DETAILS']['pre'] = ""; -$sc_style['EVENT_DETAILS']['post'] = "\n"; +$sc_style['EC_EVENT_DETAILS']['pre'] = ""; +$sc_style['EC_EVENT_DETAILS']['post'] = "\n"; -$sc_style['EVENT_LOCATION']['pre'] = "".EC_LAN_32." "; -$sc_style['EVENT_LOCATION']['post'] = ""; +$sc_style['EC_EVENT_LOCATION']['pre'] = "".EC_LAN_32." "; +$sc_style['EC_EVENT_LOCATION']['post'] = ""; -$sc_style['EVENT_AUTHOR']['pre'] = "".EC_LAN_31." "; -$sc_style['EVENT_AUTHOR']['post'] = " "; +$sc_style['EC_EVENT_AUTHOR']['pre'] = "".EC_LAN_31." "; +$sc_style['EC_EVENT_AUTHOR']['post'] = " "; -$sc_style['EVENT_CONTACT']['pre'] = "".EC_LAN_33." "; -$sc_style['EVENT_CONTACT']['post'] = " "; +$sc_style['EC_EVENT_CONTACT']['pre'] = "".EC_LAN_33." "; +$sc_style['EC_EVENT_CONTACT']['post'] = " "; -$sc_style['EVENT_THREAD']['pre'] = ""; -$sc_style['EVENT_THREAD']['post'] = "\n"; +$sc_style['EC_EVENT_THREAD']['pre'] = ""; +$sc_style['EC_EVENT_THREAD']['post'] = "\n"; -$sc_style['EVENT_CATEGORY']['pre'] = "".EC_LAN_30." "; -$sc_style['EVENT_CATEGORY']['post'] = " "; +$sc_style['EC_EVENT_CATEGORY']['pre'] = "".EC_LAN_30." "; +$sc_style['EC_EVENT_CATEGORY']['post'] = " "; -$sc_style['EVENT_DATE_START']['pre'] = (isset($thisevent['event_allday']) && $thisevent['event_allday']) ? "".EC_LAN_68." " : "".EC_LAN_29." "; -$sc_style['EVENT_DATE_START']['post'] = ""; +$sc_style['EC_EVENT_DATE_START']['pre'] = ""; +$sc_style['EC_EVENT_DATE_START']['post'] = ""; -$sc_style['EVENT_TIME_START']['pre'] = EC_LAN_144; -$sc_style['EVENT_TIME_START']['post'] = ""; +$sc_style['EC_EVENT_TIME_START']['pre'] = ""; +$sc_style['EC_EVENT_TIME_START']['post'] = ""; -$sc_style['EVENT_DATE_END']['pre'] = "".EC_LAN_69." "; -$sc_style['EVENT_DATE_END']['post'] = ""; +$sc_style['EC_EVENT_DATE_END']['pre'] = ""; +$sc_style['EC_EVENT_DATE_END']['post'] = ""; -$sc_style['EVENT_TIME_END']['pre'] = EC_LAN_144; -$sc_style['EVENT_TIME_END']['post'] = ""; +$sc_style['EC_EVENT_TIME_END']['pre'] = ""; +$sc_style['EC_EVENT_TIME_END']['post'] = ""; +$sc_style['EC_EVENT_EVENT_DATE_TIME']['pre'] = "".EC_LAN_29." "; +$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} ".EC_LAN_69." {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} ".EC_LAN_69." {EC_EVENT_DATE_END}"; +$EVENT_EVENT_DATETIME[3] = "{EC_EVENT_DATE_START}"; $EVENT_EVENT_TABLE = " - -
{EVENT_RECENT_ICON}{EVENT_CAT_ICON}{EVENT_HEADING_DATE}{EVENT_TIME_START} - {EVENT_TITLE}
-
- - - \n - - {EVENT_DETAILS} - {EVENT_THREAD} -
{EVENT_AUTHOR} {EVENT_CAT_ICON} {EVENT_CATEGORY} {EVENT_CONTACT} {EVENT_OPTIONS}
{EVENT_DATE_START}{EVENT_TIME_START} {EVENT_DATE_END}{EVENT_TIME_END}
{EVENT_LOCATION}
-
- + +
{EC_EVENT_RECENT_ICON}{EC_EVENT_CAT_ICON}{EC_EVENT_HEADING_DATE}{EC_IFNOT_ALLDAY=EC_EVENT_TIME_START} - {EC_EVENT_TITLE}
+
+ + + \n + + {EC_EVENT_DETAILS} + {EC_EVENT_THREAD} +
{EC_EVENT_AUTHOR} {EC_EVENT_CAT_ICON} {EC_EVENT_CATEGORY} {EC_EVENT_CONTACT} {EC_EVENT_OPTIONS}
{EC_EVENT_EVENT_DATE_TIME}
{EC_EVENT_LOCATION}
+
+ \n "; -// CALENDAR SHOW EVENT ------------------------------------------------------------ -$sc_style['CALENDAR_CALENDAR_RECENT_ICON']['pre'] = ""; -$sc_style['CALENDAR_CALENDAR_RECENT_ICON']['post'] = ""; -$CALENDAR_SHOWEVENT = "{CALENDAR_CALENDAR_RECENT_ICON}\n
{SHOWEVENT_IMAGE}{SHOWEVENT_INDICAT}{SHOWEVENT_HEADING}
"; - - - -// CALENDAR CALENDAR ------------------------------------------------------------ +//------------------------------------------ +// CALENDAR CALENDAR - 'Big' calendar +//------------------------------------------ $CALENDAR_CALENDAR_START = "
-"; +
+++++++++"; $CALENDAR_CALENDAR_END = " \n
"; -$CALENDAR_CALENDAR_DAY_NON = ""; +// 'Empty' cells where there's not a day at all +$CALENDAR_CALENDAR_DAY_NON = ""; //header row $CALENDAR_CALENDAR_HEADER_START = ""; -$CALENDAR_CALENDAR_HEADER = "{CALENDAR_CALENDAR_HEADER_DAY}"; +$CALENDAR_CALENDAR_HEADER = "{EC_CALENDAR_CALENDAR_HEADER_DAY}"; $CALENDAR_CALENDAR_HEADER_END = "\n"; @@ -183,30 +206,38 @@ $CALENDAR_CALENDAR_WEEKSWITCH = "\n"; //today $CALENDAR_CALENDAR_DAY_TODAY = " - -{CALENDAR_CALENDAR_DAY_TODAY_HEADING}"; + +{EC_CALENDAR_CALENDAR_DAY_TODAY_HEADING}"; //day has events $CALENDAR_CALENDAR_DAY_EVENT = " - -{CALENDAR_CALENDAR_DAY_EVENT_HEADING}"; + +{EC_CALENDAR_CALENDAR_DAY_EVENT_HEADING}"; // no events and not today $CALENDAR_CALENDAR_DAY_EMPTY = " - -{CALENDAR_CALENDAR_DAY_EMPTY_HEADING}"; + +{EC_CALENDAR_CALENDAR_DAY_EMPTY_HEADING}"; $CALENDAR_CALENDAR_DAY_END = ""; -//==================================================================== -// Calendar menu templates +// CALENDAR SHOW EVENT +$sc_style['EC_CALENDAR_CALENDAR_RECENT_ICON']['pre'] = ""; +$sc_style['EC_CALENDAR_CALENDAR_RECENT_ICON']['post'] = ""; +$CALENDAR_SHOWEVENT = "{EC_CALENDAR_CALENDAR_RECENT_ICON}\n
{EC_SHOWEVENT_IMAGE}{EC_SHOWEVENT_INDICAT}{EC_SHOWEVENT_HEADING}
"; + + +//------------------------------------------ +// 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 = "
"; -$CALENDAR_MENU_TABLE_START = ""; +$CALENDAR_MENU_TABLE_START = "
"; // colgroup doesn't work! $CALENDAR_MENU_END = "
"; // Blank cells at beginning and end -$CALENDAR_MENU_DAY_NON = "
"; +$CALENDAR_MENU_DAY_NON = "
"; //header row $CALENDAR_MENU_HEADER_START = "\n"; @@ -219,11 +250,12 @@ $CALENDAR_MENU_WEEKSWITCH = "\n"; // Start and end CSS for date cells - six cases to decode, determined by array index: // 1 - Today, no events -// 2 - Some other day, no events (or no icon defined) -// 3 - Today with events (and icon defined) -// 4 - Some other day with events (and icon defined) -// 5 - today 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 (and icon defined) +// 2 - Some other day, no events +// 3 - Today with events +// 4 - Some other day with events +// 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 + //today, no events $CALENDAR_MENU_DAY_START['1'] = ""; @@ -233,14 +265,15 @@ $CALENDAR_MENU_DAY_START['2'] = " db_Select("plugin", "*", "plugin_path = 'calendar_menu' AND plugin_installflag = '1' ")) - { - return; - } +if (isset($pref['plug_installed']) +{ + 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_DISPLAYSTYLE = ($arr[2] ? "" : "none"); diff --git a/e107_plugins/calendar_menu/e_notify.php b/e107_plugins/calendar_menu/e_notify.php index e098c7682..ca778d32c 100644 --- a/e107_plugins/calendar_menu/e_notify.php +++ b/e107_plugins/calendar_menu/e_notify.php @@ -11,9 +11,9 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/e_notify.php,v $ -| $Revision: 1.1.1.1 $ -| $Date: 2006-12-02 04:34:46 $ -| $Author: mcfly_e107 $ +| $Revision: 1.2 $ +| $Date: 2007-07-13 19:37:52 $ +| $Author: e107steved $ +----------------------------------------------------------------------------+ */ diff --git a/e107_plugins/calendar_menu/e_rss.php b/e107_plugins/calendar_menu/e_rss.php index 7d3559875..e6db67896 100644 --- a/e107_plugins/calendar_menu/e_rss.php +++ b/e107_plugins/calendar_menu/e_rss.php @@ -1,9 +1,28 @@ diff --git a/e107_plugins/calendar_menu/ec_pf_page.php b/e107_plugins/calendar_menu/ec_pf_page.php new file mode 100644 index 000000000..ffc2cc818 --- /dev/null +++ b/e107_plugins/calendar_menu/ec_pf_page.php @@ -0,0 +1,424 @@ +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'] = "
"; +if (!count($EVENT_CAL_PDF_BODY)) $EVENT_CAL_PDF_BODY['default'] = "{EC_MAIL_DATE_START} {EC_MAIL_TIME_START} {EC_MAIL_TITLE}
"; +if (!count($EVENT_CAL_PDF_FOOTER)) $EVENT_CAL_PDF_FOOTER['default'] = "
"; +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."
"; +} + +$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 = "
+
+ + + + + "; + $cal_text .= " + + + + + + + + + "; + if (isset($EVENT_CAL_PDF_NAMES) && is_array($EVENT_CAL_PDF_NAMES) && (count($EVENT_CAL_PDF_NAMES) > 1)) + { // Offer choice of templates + $cal_text .= " + + + \n"; + } + // Radio buttons to select output type + $cal_text .= " + + "; + + $cal_text .= ""; + + $cal_text .= "
".EC_LAN_153.""; + $cal_text .= gen_drop(FALSE)."
".EC_LAN_154."".gen_drop(TRUE)."
".EC_LAN_155.""; + $cal_text .= $tp->parseTemplate('{EC_NAV_CATEGORIES=nosubmit}',FALSE,$calendar_shortcodes); + $cal_text .= "
".EC_LAN_157."
".EC_LAN_158.""; + $cal_text .= " + ".EC_LAN_159."
+ ".EC_LAN_160."
"; + if ($ec_enable_pdf) + { + $cal_text .= " ".EC_LAN_161; + } + $cal_text .="
"; + $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."

"; + 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 .= "
\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)."
"; +// echo "End date: ".strftime("%d-%m-%Y %H:%M:%S",$ec_end_date)."
"; +// echo "Template: ".$ec_pdf_template,"
"; +// echo "Header: ".$EVENT_CAL_PDF_HEADER[$ec_pdf_template]."
"; +// echo "Body: ".$EVENT_CAL_PDF_BODY[$ec_pdf_template]."
"; +// echo "Footer: ".$EVENT_CAL_PDF_FOOTER[$ec_pdf_template]."
"; + + foreach ($tim_arr as $tim => $ptr) + { + $ev_list[$ptr]['event_start'] = $tim; + $thisevent = $ev_list[$ptr]; +// echo "Event: ".$thisevent['event_start']." ".$thisevent['event_title']."
"; + // 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 .= "
\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 = "\n"; + return $text; +} +?> diff --git a/e107_plugins/calendar_menu/ec_pf_template.php b/e107_plugins/calendar_menu/ec_pf_template.php new file mode 100644 index 000000000..ff7e61b89 --- /dev/null +++ b/e107_plugins/calendar_menu/ec_pf_template.php @@ -0,0 +1,86 @@ +'; +$sc_style['EC_PR_CHANGE_YEAR']['post'] = ''; +$sc_style['EC_PR_CHANGE_MONTH']['pre'] = '
'; +$sc_style['EC_PR_CHANGE_MONTH']['post'] = '
'; +$sc_style['EC_PRINT_BUTTON']['pre'] = "
"; +$sc_style['EC_PRINT_BUTTON']['post'] = "
"; +$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'] = "

"; +$sc_style['EC_PR_LIST_TITLE']['post'] = "

"; + +// - Default style - very basic +$EVENT_CAL_PDF_NAMES['default'] = EC_LAN_165; +$EVENT_CAL_PDF_HEADER['default'] = "{EC_PR_LIST_TITLE}
{EC_PR_CAT_LIST}
".EC_LAN_168."{EC_PR_LIST_START=%d-%m-%Y}
".EC_LAN_169."{EC_PR_LIST_END=%d-%m-%Y}
"; +$EVENT_CAL_PDF_BODY['default'] = "{EC_PR_CHANGE_YEAR}{EC_PR_CHANGE_MONTH}{EC_MAIL_SHORT_DATE} {EC_MAIL_TIME_START} {EC_MAIL_TITLE}
\n"; +$EVENT_CAL_PDF_FOOTER['default'] = "---End of List---
{EC_IFNOT_DISPLAY=EC_NOW_DATE}{EC_IFNOT_DISPLAY=EC_NOW_TIME}
{EC_PRINT_BUTTON}"; + + +// - A simple tabular style +$ec_template_styles['simple']['EC_PR_CHANGE_YEAR']['pre'] = "
"; +$ec_template_styles['simple']['EC_PR_CHANGE_YEAR']['post'] = '
'; +$ec_template_styles['simple']['EC_PR_CHANGE_MONTH']['pre'] = ''; +$ec_template_styles['simple']['EC_PR_CHANGE_MONTH']['post'] = ''; + +$EVENT_CAL_PDF_NAMES['simple'] = EC_LAN_166; +$EVENT_CAL_PDF_HEADER['simple'] = "{EC_IF_PRINT=LOGO} + + "; +$EVENT_CAL_PDF_BODY['simple'] = "{EC_PR_CHANGE_YEAR} + \n"; +$EVENT_CAL_PDF_FOOTER['simple'] = "
".EC_LAN_163."
".EC_LAN_168."{EC_PR_LIST_START=%d-%m-%Y}
".EC_LAN_169."{EC_PR_LIST_END=%d-%m-%Y}
{EC_PR_CHANGE_MONTH} {EC_MAIL_DATE_START=%a %d}{EC_MAIL_TIME_START}{EC_MAIL_TITLE}


{EC_IFNOT_DISPLAY=EC_NOW_DATE}{EC_IFNOT_DISPLAY=EC_NOW_TIME}
{EC_PRINT_BUTTON}"; + + +// - A tabular style with lines round the cells +$ec_template_styles['tlinclines']['EC_PR_CHANGE_YEAR']['pre'] = "
"; +$ec_template_styles['tlinclines']['EC_PR_CHANGE_YEAR']['post'] = '
'; + +$EVENT_CAL_PDF_NAMES['tlinclines'] = EC_LAN_167; +$EVENT_CAL_PDF_HEADER['tlinclines'] = " + + "; +$EVENT_CAL_PDF_BODY['tlinclines'] = "{EC_PR_CHANGE_YEAR} + \n"; +$EVENT_CAL_PDF_FOOTER['tlinclines'] = "
".EC_LAN_163."
".EC_LAN_168."{EC_PR_LIST_START=%d-%m-%Y}
".EC_LAN_169."{EC_PR_LIST_END=%d-%m-%Y}
{EC_MAIL_DATE_START}{EC_MAIL_TIME_START}{EC_MAIL_TITLE}


{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'] = "
"; +$ec_template_styles['tlinccatlines']['EC_PR_CHANGE_YEAR']['post'] = '
'; + +$EVENT_CAL_PDF_NAMES['tlinccatlines'] = EC_LAN_171; +$EVENT_CAL_PDF_HEADER['tlinccatlines'] = " + + "; +$EVENT_CAL_PDF_BODY['tlinccatlines'] = "{EC_PR_CHANGE_YEAR} + \n"; +$EVENT_CAL_PDF_FOOTER['tlinccatlines'] = "
".EC_LAN_163."
".EC_LAN_168."{EC_PR_LIST_START=%d-%m-%Y}
".EC_LAN_169."{EC_PR_LIST_END=%d-%m-%Y}
{EC_MAIL_DATE_START=%D %d %b}{EC_MAIL_TIME_START}{EC_MAIL_CATEGORY}{EC_MAIL_TITLE}


{EC_IFNOT_DISPLAY=EC_NOW_DATE=%d-%m-%y}{EC_IFNOT_DISPLAY=EC_NOW_TIME}{EC_PRINT_BUTTON}"; + +?> \ No newline at end of file diff --git a/e107_plugins/calendar_menu/ecal_class.php b/e107_plugins/calendar_menu/ecal_class.php index b7023c61d..48d569998 100644 --- a/e107_plugins/calendar_menu/ecal_class.php +++ b/e107_plugins/calendar_menu/ecal_class.php @@ -11,15 +11,13 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/ecal_class.php,v $ -| $Revision: 1.1.1.1 $ -| $Date: 2006-12-02 04:34:47 $ -| $Author: mcfly_e107 $ +| $Revision: 1.2 $ +| $Date: 2007-07-13 19:37:52 $ +| $Author: e107steved $ | -| Event calendar class for gradual enhancement -| (Some bits may be usefully transferred to common code later) -| -| 11.11.06 - Add date formatting options -| - Add notify +| Event calendar class: +| Pre-calculates/caches many useful values +| Implements functions used in most of the code | +----------------------------------------------------------------------------+ */ @@ -27,11 +25,14 @@ /* Preferences used: 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 - - date() returns formatted date/time string */ + +if (!defined('e107_INIT')) { exit; } + +if (!defined("EC_DEFAULT_CATEGORY")) { define('EC_DEFAULT_CATEGORY',"Default"); } + class ecal_class { // 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 $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 $max_recent_show; // Time in seconds for showing 'recent events' + var $date_separator = '-'; // Used for separating off fields on date entry + 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() { // Constructor 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->site_timedate = $this->time_now + ($pref['time_offset'] * 3600); // Check sign of offset $this->user_timedate = $this->time_now + TIMEOFFSET; @@ -86,14 +107,19 @@ Preferences used: $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 (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']; - } - else - { - $this->max_recent_show = 0; + if ($pref['eventpost_recentshow'] == 'LV') + { + if (USER) $this->max_recent_show = time() - USERLV; + } + else + { + $this->max_recent_show = 3600 * $pref['eventpost_recentshow']; + } } + switch ($pref['eventpost_timedisplay']) { case 2 : @@ -102,28 +128,44 @@ Preferences used: case 3 : $this->time_format_string = $pref['eventpost_timecustom']; // custom display if (isset($this->time_format_string)) break; + case 4 : + $this->time_format_string = "%H:%M"; // 24-hour display with separator + break; default : $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 case 2 : - $this->cal_format_string = "d-m-Y"; - $this->dcal_format_string = "%d-%m-%Y"; + $this->cal_format_string = "d".$this->date_separator."m".$this->date_separator."Y"; + $this->dcal_format_string = "%d".$this->date_separator."%m".$this->date_separator."%Y"; $this->java_format_code = 2; break; case 3 : - $this->cal_format_string = "m-d-Y"; - $this->dcal_format_string = "%m-%d-%Y"; + $this->cal_format_string = "m".$this->date_separator."d".$this->date_separator."Y"; + $this->dcal_format_string = "%m".$this->date_separator."%d".$this->date_separator."%Y"; $this->java_format_code = 3; break; default : // 'original' defaults - $this->cal_format_string = "Y-m-d"; - $this->dcal_format_string = "%Y-%m-%d"; + $this->cal_format_string = "Y".$this->date_separator."m".$this->date_separator."d"; + $this->dcal_format_string = "%Y".$this->date_separator."%m".$this->date_separator."%d"; $this->java_format_code = 1; } + if (!isset($pref['eventpost_dateevent'])) $pref['eventpost_dateevent'] = 1; switch ($pref['eventpost_dateevent']) { // Event list date display case 0 : @@ -139,6 +181,7 @@ Preferences used: $this->event_date_format_string = "%A %d %B %Y"; } + if (!isset($pref['eventpost_datenext'])) $pref['eventpost_datenext'] = 1; switch ($pref['eventpost_datenext']) { // Forthcoming event date display case 0 : @@ -156,45 +199,68 @@ Preferences used: default : $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) { // 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) { // 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) { // 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) { // 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) { // Turns a date as entered in the calendar into a time stamp (for event entry) - global $pref; - $tmp = explode("-", $date_string); - switch ($pref['eventpost_datedisplay']) + $tmp = explode($this->date_separator, $date_string); + switch ($this->java_format_code) { 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 : - 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 : - 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) { // All calendar-related logging intentionally passed through a single point to maintain control // (so we could also add other info if we wanted) @@ -203,22 +269,27 @@ Preferences used: // 2 - edit event // 3 - delete event // 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', '2' => 'Event Calendar - edit 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 $cmessage = $log_titles[$event_type]."
"; if ($event_start > 0) + { $cmessage .= "Event Start: ".strftime("%d-%B-%Y",$event_start)."
"; + $cmessage .= "Event Link: ".$pref['siteurl'].$PLUGINS_DIRECTORY. "calendar_menu/event.php?".$event_start."
"; + } else $cmessage .= "Event Start unknown
"; $edata_ec = array("cmessage" => $cmessage, "ip" => getip()); switch ($event_type) { + case 5 : case 1 : $e_event -> trigger("ecalnew", $edata_ec); break; case 2 : @@ -233,13 +304,378 @@ Preferences used: case 2 : break; // Continue default : return; // Invalid or undefined option } - $log_titles = array( '1' => 'Event Calendar - add event', - '2' => 'Event Calendar - edit event', - '3' => 'Event Calendar - delete event', - '4' => 'Event Calendar - Bulk Delete' + $log_titles = array( '1' => 'Event Calendar - add event'.strftime("%d-%B-%Y",$event_start), + '2' => 'Event Calendar - edit event'.strftime("%d-%B-%Y",$event_start), + '3' => 'Event Calendar - delete event'.strftime("%d-%B-%Y",$event_start), + '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); } - } + + + + 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."
"; + $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']."
"; + // 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."
"; + $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."
"; + + 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']."
"; + $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
"; + } + + 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."
"; + 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']."
"; + + if ((count($ret) == 0) || ($ts > $ret[count($ret)-1]['event_start'])) + { // Can just add on end +// echo "Add at end
"; + $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
"; + } + 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."
"; + } + } + } + if (count($ret) > $num_event) + { // Knock one off the end +// echo "Delete, count is ".count($ret)."
"; + 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 ?> diff --git a/e107_plugins/calendar_menu/event.php b/e107_plugins/calendar_menu/event.php index 3b027faab..5a8083aeb 100644 --- a/e107_plugins/calendar_menu/event.php +++ b/e107_plugins/calendar_menu/event.php @@ -11,15 +11,16 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/event.php,v $ -| $Revision: 1.1.1.1 $ -| $Date: 2006-12-02 04:34:47 $ -| $Author: mcfly_e107 $ +| $Revision: 1.2 $ +| $Date: 2007-07-13 19:37:52 $ +| $Author: e107steved $ | -| 09.11.06 - Started next batch of mods +To do: + 1. Clear array variables after use - ev_list, tim_arr +----------------------------------------------------------------------------+ */ require_once("../../class2.php"); -require_once(e_PLUGIN."calendar_menu/calendar_shortcodes.php"); +if (!isset($pref['plug_installed']['calendar_menu'])) header("Location: ".e_BASE."index.php"); if (isset($_POST['viewallevents'])) { // Triggered from NAV_BUT_ALLEVENTS @@ -36,53 +37,71 @@ if (isset($_POST['subs'])) Header("Location: ".e_PLUGIN."calendar_menu/subscribe.php"); } -@include_lan(e_PLUGIN."calendar_menu/languages/".e_LANGUAGE.".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"); define("PAGE_NAME", EC_LAN_80); require_once(e_PLUGIN.'calendar_menu/ecal_class.php'); global $ecal_class; -$ecal_class = new ecal_class; +//$ecal_class = new ecal_class; +if (!is_object($ecal_class)) $ecal_class = new ecal_class; $cal_super = $ecal_class->cal_super; +require_once(e_PLUGIN."calendar_menu/calendar_shortcodes.php"); require_once(e_HANDLER."calendar/calendar_class.php"); $cal = new DHTML_Calendar(true); -$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)); +$mult_count = 0; -/* -// enter new category into db -if (isset($_POST['ne_cat_create'])) -{ - if ($_POST['ne_new_category'] != "") - { - $sql->db_Insert("event_cat", "0, '".$tp->toDB($_POST['ne_new_category'])."', '".$tp->toDB($_POST['ne_new_category_icon'])."', '0', '0', '0', '0', '', '', '0', '0', '0', '".time()."', '0' "); - header("location:event.php?".$_POST['qs'].".m1"); - } - else - { - header("location:event.php?".$_POST['qs'].".m3"); - } -} -*/ +// Array links db field names to internal variables +$ev_fields = array( + 'event_id' => 'id', + 'event_start' => 'ev_start', + 'event_end' => 'ev_end', + 'event_allday' => 'ev_allday', + 'event_recurring' => 'recurring', + 'event_title' => 'ev_title', + 'event_location' => 'ev_location', + 'event_details' => 'ev_event', +// 'event_author' => 'ne_author', - not needed - its always the user creating the event + 'event_contact' => 'ev_email', + 'event_category' => 'ev_category', + 'event_thread' => 'ev_thread' +); + +//-------------------------------------- // Event to add or update -if ((isset($_POST['ne_insert']) || isset($_POST['ne_update'])) && USER == true) +//-------------------------------------- +if ($cal_super && (isset($_POST['ne_insert']) || isset($_POST['ne_update']))) { + $ev_start = $ecal_class->make_date($_POST['ne_hour'], $_POST['ne_minute'],$_POST['start_date']); if (($_POST['ne_event'] == "") || !isset($_POST['qs'])) - { // Problem - tell user to go away - header("location:event.php?".$ev_start.".m3"); + { // Problem - tell user to go away - fields are blank (mostly checked by JS) + header("location:event.php?".$ev_start.".0.m3"); + } + elseif (!isset($_POST['ne_category']) || (intval($_POST['ne_category']) == 0)) + { + header("location:event.php?".$ev_start.".0.m6"); } else { - $ev_start = $ecal_class->make_date($_POST['ne_hour'], $_POST['ne_minute'],$_POST['start_date']); $ev_end = $ecal_class->make_date($_POST['end_hour'], $_POST['end_minute'],$_POST['end_date']); $ev_title = $tp->toDB($_POST['ne_title']); $ev_location = $tp->toDB($_POST['ne_location']); $ev_event = $tp->toDB($_POST['ne_event']); + $ev_email = $tp -> toDB($_POST['ne_email']); + $ev_category = intval($_POST['ne_category']); + $ev_thread = $tp -> toDB($_POST['ne_thread']); $temp_date = getdate($ecal_class->make_date(0,0,$_POST['start_date'])); + $ev_allday = intval($_POST['allday']); + $recurring = intval($_POST['ec_recur_type']); + if ($recurring >= 100) $recurring += intval($_POST['ec_recur_week']) - 100; + // if ($_POST['recurring'] == 1) { $rec_m = $temp_date['mday']; // Day of month @@ -97,31 +116,90 @@ if ((isset($_POST['ne_insert']) || isset($_POST['ne_update'])) && USER == true) $report_msg = '.m3'; if (isset($_POST['ne_insert'])) { // Bits specific to inserting a new event - $qry = " 0, '".intval($ev_start)."', '".intval($ev_end)."', '".intval($_POST['allday'])."', '".intval($_POST['recurring'])."', '".time()."', '$ev_title', '$ev_location', '$ev_event', '".USERID.".".USERNAME."', '".$tp -> toDB($_POST['ne_email'])."', '".intval($_POST['ne_category'])."', '".$tp -> toDB($_POST['ne_thread'])."', '".intval($rec_m)."', '".intval($rec_y)."' "; + $qs = preg_replace("/ne./i", "", $_POST['qs']); + if ($_POST['ec_gen_multiple']) + { + $mult_count = $ecal_class->gen_recur($ev_start,$ev_end,$recurring,$ev_start,$ev_end); + } + if ($mult_count <= 1) + { + $qry = " 0, '".intval($ev_start)."', '".intval($ev_end)."', '".$ev_allday."', '".$recurring."', '".time()."', '$ev_title', '$ev_location', '$ev_event', '".USERID.".".USERNAME."', '".$ev_email."', '".$ev_category."', '".$ev_thread."', '".intval($rec_m)."', '".intval($rec_y)."' "; $sql->db_Insert("event", $qry); $ecal_class->cal_log(1,'db_Insert',$qry, $ev_start); - $qs = preg_replace("/ne./i", "", $_POST['qs']); $report_msg = '.m4'; + } } if (isset($_POST['ne_update'])) { // Bits specific to updating an existing event - $qry = "event_start='".intval($ev_start)."', event_end='".intval($ev_end)."', event_allday='".intval($_POST['allday'])."', event_recurring='".intval($_POST['recurring'])."', event_datestamp= '".time()."', event_title= '$ev_title', event_location='$ev_location', event_details='$ev_event', event_contact='".$tp -> toDB($_POST['ne_email'])."', event_category='".intval($_POST['ne_category'])."', event_thread='".$tp -> toDB($_POST['ne_thread'])."', event_rec_m='".intval($rec_m)."', event_rec_y='".intval($rec_y)."' WHERE event_id='".intval($_POST['id'])."' "; + $qry = "event_start='".intval($ev_start)."', event_end='".intval($ev_end)."', event_allday='".$ev_allday."', event_recurring='".$recurring."', event_datestamp= '".time()."', event_title= '$ev_title', event_location='$ev_location', event_details='$ev_event', event_contact='".$ev_email."', event_category='".$ev_category."', event_thread='".$ev_thread."', event_rec_m='".intval($rec_m)."', event_rec_y='".intval($rec_y)."' WHERE event_id='".intval($_POST['id'])."' "; $sql->db_Update("event", $qry); $ecal_class->cal_log(2,'db_Update',$qry, $ev_start); $qs = preg_replace("/ed./i", "", $_POST['qs']); $report_msg = '.m5'; } + if ($mult_count <= 1) + { // Now clear cache - just do the lot for now - get clever later $e107cache->clear('nq_event_cal'); header("location:event.php?".$ev_start.".".$qs.$report_msg); + } } } + + $action = ""; // Remove notice require_once(HEADERF); +if ($mult_count > 1) +{ // Need to handle writing of multiple events - display confirmation form + $message = str_replace('-NUM-',count($mult_count),EC_LAN_88); + $text = " +
+ + "; + if ($ev_allday) + { + $text .= " + + "; + } + else + { + $text .= " + + "; + } + $text .= " + + + + + "; + + // Only display for forum thread/link if required. No point if not wanted + if (isset($pref['eventpost_forum']) && $pref['eventpost_forum'] == 1) + { + $text .= ""; + } + $text .= " +
".$message."
".EC_LAN_89."
".EC_LAN_173." ".$ecal_class->event_date_string($ev_start)." ".EC_LAN_175."
".EC_LAN_174." ".$ecal_class->event_date_string($ev_end)." ".EC_LAN_175."
".EC_LAN_173." ".$ecal_class->event_date_string($ev_start)." ".$ecal_class->time_string($ev_start)." "."
".EC_LAN_174." ".$ecal_class->event_date_string($ev_end)." ".$ecal_class->time_string($ev_end)." "."
".EC_LAN_176."".$ecal_class->get_recur_text($recurring)."
".EC_LAN_70."".$ev_title."
".EC_LAN_52."".$ecal_class->get_category_text($ev_category)."
".EC_LAN_32."".$ev_location."
".EC_LAN_57."".$ev_event."
".EC_LAN_58." ".$ev_thread."
".EC_LAN_59."".$ev_email."
+ + + "; + foreach ($ev_fields as $k => $v) + { + $text .= ""; + } + $text .= "
"; + + $ns->tablerender(EC_LAN_179, $text); + require_once(FOOTERF); + exit; +} + if (isset($_POST['jump'])) { $smarray = getdate(mktime(0, 0, 0, $_POST['jumpmonth'], 1, $_POST['jumpyear'])); @@ -134,10 +212,10 @@ else { $qs = explode(".", e_QUERY); $action = $qs[0]; // Often a date if just viewing - $ds = (isset($qs[1]) ? $qs[1] : ""); - $eveid = (isset($qs[2]) ? $qs[2] : ""); + $ds = varset($qs[1],""); + $eveid = varset($qs[2], ""); } - + if ($action == "") { $month = $ecal_class->cal_date['mon']; @@ -145,15 +223,54 @@ else } else { - $smarray = getdate($action); + if (is_numeric($action)) $smarray = getdate($action); else $smarray = getdate($ds); $month = $smarray['mon']; $year = $smarray['year']; } } -if (isset($_POST['confirm'])) -{ +if ($cal_super) +{ // Bits relating to 'delete event', and generation of multiple events + if ($action == 'mc') + { + if (isset($_POST['mc_cancel'])) + { + $message = EC_LAN_179; + } + elseif (isset($_POST['mc_accept'])) + { // Go for it! Write lots of events + // Start by reading all the info from the hidden fields + $wr_record = array(); + foreach ($ev_fields as $k => $v) + { + $wr_record[$k] = $tp->toDB($_POST['ev_'.$k]); + } + $wr_record['event_author'] = USERID.".".USERNAME; + $wr_record['event_datestamp'] = time(); + $mult_count = $ecal_class->gen_recur($wr_record['event_start'],$wr_record['event_end'],$wr_record['event_recurring'],$wr_record['event_start'],$wr_record['event_end']); + $wr_record['event_recurring'] = 0; // Individual events are non-recurring! + + // Now write all the entries + $wc = 0; + foreach ($mult_count as $mc) + { + $wr_record['event_start'] = $mc; + $wr_record['event_end'] = merge_date_time($mc,$wr_record['event_end']); +// echo "Write record: ".$wr_record['event_start']." to ".$wr_record['event_end']."
"; + if ($sql->db_Insert("event", $wr_record)) $wc++; + } + $ecal_class->cal_log(5,'db_Insert',$qry, $ev_start); + + $message = str_replace('-NUM-',$wc,EC_LAN_41); + if ($wc != count($mult_count)) $message .= "

".(count($mult_count)-$wc)." ".EC_LAN_180; + } + $action = ''; + } + + + if (isset($_POST['confirm'])) + { $qry = "event_id='".intval($_POST['existing'])."' "; if ($sql->db_Delete("event", $qry)) { @@ -164,11 +281,11 @@ if (isset($_POST['confirm'])) { $message = EC_LAN_109; //Unable to Delete event for some mysterious reason } -} + } -if ($action == "de") -{ // Delete event - show confirmation form + if ($action == "de") + { // Delete event - show confirmation form $text = "
".EC_LAN_48."

@@ -182,34 +299,32 @@ if ($action == "de") $ns->tablerender(EC_LAN_46, $text); // Confirm Delete Event require_once(FOOTERF); exit; -} + } -if (isset($_POST['cancel'])) -{ // Delete Cancelled + if (isset($_POST['cancel'])) + { // Delete Cancelled $message = EC_LAN_47; -} + } +} // End - if ($cal_super) // set up data arrays ---------------------------------------------------------------------------------- -// (some of these are only used in the shortcodes) -if ($pref['eventpost_weekstart'] == 'sun') -{ - $days = Array(EC_LAN_25, EC_LAN_19, EC_LAN_20, EC_LAN_21, EC_LAN_22, EC_LAN_23, EC_LAN_24); -} -else -{ - $days = Array(EC_LAN_19, EC_LAN_20, EC_LAN_21, EC_LAN_22, EC_LAN_23, EC_LAN_24, EC_LAN_25); -} -$dayslo = array('1.', '2.', '3.', '4.', '5.', '6.', '7.', '8.', '9.', '10.', '11.', '12.', '13.', '14.', '15.', '16.', '17.', '18.', '19.', '20.', '21.', '22.', '23.', '24.', '25.', '26.', '27.', '28.', '29.', '30.', '31.'); +// (these used in the nav shortcodes) $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); $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); // ---------------------------------------------------------------------------------------------------------- // Messages acknowledging actions -$poss_message = array('m1' => EC_LAN_41, 'm2' => EC_LAN_42, 'm3' => EC_LAN_43, 'm4' => EC_LAN_44, 'm5' => EC_LAN_45); -if (isset($qs[2])) if (isset($poss_message[$qs[2]])) $message = $poss_message[$qs[2]]; +$poss_message = array('m1' => EC_LAN_41, 'm2' => EC_LAN_42, 'm3' => EC_LAN_43, 'm4' => EC_LAN_44, 'm5' => EC_LAN_45, + 'm6' => EC_LAN_145, 'm7' => 'Could have saved -NUM- events'); +if (isset($qs[2])) if (isset($poss_message[$qs[2]])) +{ + $message = $poss_message[$qs[2]]; + $ec = varset($qs[3],0); + if ($ec) $message = str_replace('-NUM-',$ec,$message); +} if (isset($message)) { @@ -217,18 +332,25 @@ if (isset($message)) } -// enter new event form +function merge_date_time($date, $time) +{ + return ((86400*intval($date/86400)) + ($time % 86400)); +} + +//------------------------------------- +// enter new event form +//------------------------------------- if ($action == "ne" || $action == "ed") { - if ($ecal_class->cal_super || check_class($pref['eventpost_admin'])) - { -function make_calendar($boxname, $boxvalue) -{ - global $ecal_class, $cal; + if ($ecal_class->cal_super || check_class($pref['eventpost_admin'])) + { + function make_calendar($boxname, $boxvalue) + { + global $ecal_class, $cal; unset($cal_options); unset($cal_attrib); - $cal_options['firstDay'] = 0; + $cal_options['firstDay'] = $ecal_class->ec_first_day_of_week; $cal_options['showsTime'] = false; $cal_options['showOthers'] = true; $cal_options['weekNumbers'] = false; @@ -238,82 +360,149 @@ function make_calendar($boxname, $boxvalue) $cal_attrib['name'] = $boxname; $cal_attrib['value'] = $boxvalue; return $cal->make_input_field($cal_options, $cal_attrib); -} + } -function make_hourmin($boxname,$cur_hour,$cur_minute) -{ - global $pref; - if (isset($pref['eventpost_fivemins'])) $incval = 5; else $incval = 1; - $retval = " \n + function make_hourmin($boxname,$cur_hour,$cur_minute) + { + global $pref; + if (isset($pref['eventpost_fivemins'])) $incval = 5; else $incval = 1; + $retval = " \n \n"; - return $retval; -} + for($count = "00"; $count <= "59"; $count+= $incval) + { + $val = sprintf("%02d", $count); + $retval .= "\n"; + } + $retval .= "\n"; + return $retval; + } + + function recur_select($curval) + { + global $ecal_class; + while ($curval > 150) { $curval -= 100; } // Could have values up to about 406 + $ret = "\n"; + return $ret; + } + + + function recur_week_select($curval) + { + global $ecal_class; + $disp = $curval < 100 ? " style='display:none;'" : ""; + $curval -= intval($curval % 10); // Should make it an exact multiple of 100 + $ret = "\n"; + return $ret; + } - if ($action == "ed") - { // Editing existing event - read from database - $sql->db_Select("event", "*", "event_id='".intval($qs[1])."' "); - list($null, $ne_start, $ne_end, $allday, $recurring, $ne_datestamp, $ne_title, $ne_location, $ne_event, $ne_author, $ne_email, $ne_category, $ne_thread) = $sql->db_Fetch(); + switch ($action) + { + case "ed" : // Editing existing event - read from database + $sql->db_Select("event", "*", "event_id='".intval($qs[1])."' "); + list($null, $ne_start, $ne_end, $allday, $recurring, $ne_datestamp, $ne_title, $ne_location, $ne_event, $ne_author, $ne_email, $ne_category, $ne_thread) = $sql->db_Fetch(); - $smarray = getdate($ne_start); - $ne_hour = $smarray['hours']; - $ne_minute = $smarray['minutes']; - $ne_startdate = $ecal_class->full_date($ne_start); + $smarray = $ecal_class->gmgetdate($ne_start); + $ne_hour = $smarray['hours']; + $ne_minute = $smarray['minutes']; + $ne_startdate = $ecal_class->full_date($ne_start); - $smarray = getdate($ne_end); - $end_hour = $smarray['hours']; - $end_minute = $smarray['minutes']; - $ne_enddate = $ecal_class->full_date($ne_end); - } - else - { // New event - initialise everything - $smarray = getdate($qs[1]); - $month = $smarray['mon']; - $year = $smarray['year']; - $ne_startdate = $ecal_class->full_date($qs[1]); + $smarray = $ecal_class->gmgetdate($ne_end); + $end_hour = $smarray['hours']; + $end_minute = $smarray['minutes']; + $ne_enddate = $ecal_class->full_date($ne_end); - $ne_hour = $smarray['hours']; - $ne_minute = $smarray['minutes']; + $caption = EC_LAN_66; // edit Event + break; + + case "ne" : // New event - initialise everything + $smarray = $ecal_class->gmgetdate($qs[1]); + $month = $smarray['mon']; + $year = $smarray['year']; + $ne_startdate = $ecal_class->full_date($qs[1]); - $end_hour = $smarray['hours']; - $end_minute = $smarray['minutes']; - $ne_enddate = $ecal_class->full_date($qs[1]); - } + $ne_hour = $smarray['hours']; + $ne_minute = $smarray['minutes']; - $text = " + $end_hour = $smarray['hours']; + $end_minute = $smarray['minutes']; + $ne_enddate = $ecal_class->full_date($qs[1]); + $recurring = 0; + $caption = EC_LAN_28; // Enter New Event + + default : + $caption = EC_LAN_83; + } + + + $text = " "; - $text .= " + $text .= "
- "; +
"; - if ($action == "ed") - { - $caption = EC_LAN_66; // edit Event + $text .= " + - - - - - - + - - - - - - - - + + + - - - - + + - "; - // * *BK* Check if the add class is appropriate for adding new categories - // * *BK* It will default to everybody class when created. Need to go in to admin categories if - // * *BK* you want to change read class. - if (FALSE && check_class($pref['eventpost_addcat']) && $action != "ed") - { - require_once(e_HANDLER."file_class.php"); - $fi = new e_file; - $imagelist = $fi->get_files(e_PLUGIN."calendar_menu/images", "\.\w{3}$"); - $text .= " - - - - "; - } + "; $text .= " - - - - + - - - - "; - // * *BK* - // * *BK* Only display for forum thread if it is required. No point in being in if not wanted - // * *BK* or if forums are inactive - // * *BK* + "; + + // Only display for forum thread/link if required. No point if not wanted if (isset($pref['eventpost_forum']) && $pref['eventpost_forum'] == 1) { $text .= " - - - - "; + "; } - // * *BK* - // * *BK* If the user is logged in and has their email set plus the field is empty then put in - // * *BK* their email address. They can always take it out if they want, its not a required field + + // If the user is logged in and has their email set plus the field is empty then put in + // their email address. They can always take it out if they want, its not a required field if (empty($ne_email) && ($action == "ne") && defined('USEREMAIL')) { $ne_email = USEREMAIL; } $text .= " - - - @@ -538,6 +659,7 @@ function make_hourmin($boxname,$cur_hour,$cur_minute) } } // End of "Enter New Event + //----------------------------------------------- // show events // $month, $year have the month required @@ -564,7 +686,14 @@ if ($nextmonth == 13) $nextyear = ($year + 1); } -$prop = mktime(0, 0, 0, $month, 1, $year); // Sets start date for new event entry +if ($ds == 'one') +{ + $prop = gmmktime(0, 0, 0, $month, $smarray['mday'], $year); // Sets start date for new event entry - exact day of month +} +else +{ + $prop = gmmktime(0, 0, 0, $month, 1, $year); // Sets start date for new event entry - beginning of month +} $next = mktime(0, 0, 0, $nextmonth, 1, $nextyear); // Used by nav buttons $nowmonth = $ecal_class->cal_date['mon']; $nowyear = $ecal_class->cal_date['year']; @@ -594,31 +723,39 @@ $text2 .= $tp -> parseTemplate($CALENDAR_NAVIGATION_TABLE, FALSE, $calendar_shor // ****** CAUTION - the category dropdown also used $sql object - take care to avoid interference! -$event = array(); -$extra = ''; +$ev_list = array(); + if ($ds == "event") -{ // Show single event +{ // Show single event - bit of a special case + $ec_err = FALSE; $qry = " - SELECT e.*, ec.* + SELECT e.*, ec.event_cat_name,ec.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='".intval($eveid)."' {$ecal_class->extra_query} "; $sql2->db_Select_gen($qry); - $row = $sql2->db_Fetch(); - if ($row['event_recurring']=='1') // Single event, selected by ID. So day/month must match + $thisevent = $sql2->db_Fetch(); + // Recurring events - $action has the actual date required (no time) - could be one of a potentially large number of dates it referred to + if ($thisevent['event_recurring']>='1') // Single event, selected by ID. So day/month must match { - $row['event_start'] = mktime(0,0,0,$row['event_rec_y'],$row['event_rec_m'],$year); - $row['event_end'] = $row['event_start']; + $temp_arr = $ecal_class->gen_recur($thisevent['event_start'],$thisevent['event_end'],$thisevent['event_recurring'],$action,$action+86400); // Array of start times - hopefully just one! + if (count($temp_arr) == 1) + { + $thisevent['event_start'] = $temp_arr[0]; + $thisevent['event_end'] = merge_date_time($action,$thisevent['event_end']); + } + else + { // Error + $ec_err = TRUE; + } } - $event[] = $row; - $next10_start = $event[0]['event_start']; + $next10_start = $thisevent['event_start'] +1; $text2 .= $tp -> parseTemplate($EVENT_EVENT_TABLE_START, FALSE, $calendar_shortcodes); - $text2 .= show_event($event); + if ($ec_err) $text2.= "Software Error
"; else $text2 .= $tp -> parseTemplate($EVENT_EVENT_TABLE, FALSE, $calendar_shortcodes); $text2 .= $tp -> parseTemplate($EVENT_EVENT_TABLE_END, FALSE, $calendar_shortcodes); - } else { @@ -631,142 +768,76 @@ else $end_time = $action + 86399; $next10_start = $end_time + 1; $cap_title = " - ".$months[$selected_mon-1]." ".$selected_day; - $extra = " OR (e.event_rec_y = ".intval($selected_mon)." AND e.event_rec_m = ".intval($selected_day).") "; } else { // Display whole of selected month - $start_time = $monthstart; - $end_time = $monthend; - $next10_start = $end_time + 1; - $cap_title = ''; - $extra = " OR e.event_rec_y = ".intval($month)." "; + $start_time = $monthstart; + $end_time = $monthend; + $next10_start = $end_time + 1; + $cap_title = ''; } +// echo "Start: ".$start_time." End: ".$end_time." Cat_filter: ".$cat_filter."
"; + // We'll need virtually all of the event-related fields, so get them regardless + $ev_list = $ecal_class->get_events($start_time, $end_time, FALSE, $cat_filter, TRUE, '*', 'event_cat_name,event_cat_icon'); - $qry = " - SELECT e.*, ec.* - FROM #event as e - LEFT JOIN #event_cat as ec ON e.event_category = ec.event_cat_id WHERE (e.event_recurring = '0' AND - ((e.event_start >= ".intval($start_time)." AND e.event_start <= ".intval($end_time).") - 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).") ) - {$extra}) - {$category_filter} - {$ecal_class->extra_query} - ORDER BY e.event_start ASC - "; - -// Query generates a list of event IDs in $idarray which meet the criteria. -// $idarray has one primary index location for each day of month, then secondary for events. - if ($cal_count=$sql->db_Select_gen($qry)) +// echo count($ev_list)." records found
"; + +// Now go through and multiply up any recurring records + $tim_arr = array(); + foreach ($ev_list as $k=>$event) { - while ($row = $sql->db_Fetch()) - { - if ($row['event_recurring']=='1') // Recurring events - { - if (($row['event_rec_y'] == $month) && (!in_array($row['event_id'], $idArray))) // Only allow one instance of each recurring event - { - $tmp = getdate($row['event_start']); - $row['event_start'] = mktime($tmp['hours'],$tmp['minutes'],0,$row['event_rec_y'],$row['event_rec_m'],$year); - $row['event_end'] = $row['event_start']; - $events[$row['event_rec_m']][] = $row; - $idArray[] = $row['event_id']; - } - } - else - { - if ($ds == 'one') - { - if (!isset($idArray) || !is_array($idArray) || !in_array($row['event_id'], $idArray)) - { - $events[$selected_day][] = $row; - $idArray[] = $row['event_id']; - } - } - else - { // Multiple events - if ($row['event_start'] < intval($start_time)) - { - $start_day = "1"; // Event starts before this month - } - else - { - $tmp = getdate($row['event_start']); - $start_day = $tmp['mday']; - } - if ($row['event_end'] < $row['event_start']) - { // End date before start date - $end_day = $start_day; - } - else - { - if ($row['event_end'] > intval($end_time)) - { - $end_day = "31"; // Event ends after this month - } - else - { - $tmp = getdate($row['event_end']); - $end_day = $tmp['mday']; - } - } - for ($i = $start_day; $i <= $end_day; $i++) - { - if (!isset($idArray) || !is_array($idArray) || !in_array($row['event_id'], $idArray)) - { - $events[$i][] = $row; - $idArray[] = $row['event_id']; - } - } - } - } - } + if (is_array($event['event_start'])) + { + foreach ($event['event_start'] as $t) + { + $tim_arr[$t] = $k; + } + } + else + { + $tim_arr[$event['event_start']] = $k; + } } -} + + // Add a sort in here + ksort($tim_arr); - -// event list -if(isset($events) && is_array($events)) -{ +// display event list for current month + if(count($tim_arr)) + { $text2 .= $tp -> parseTemplate($EVENT_EVENTLIST_TABLE_START, FALSE, $calendar_shortcodes); - foreach ($events as $dom => $event){ - $text2 .= show_event($event); + foreach ($tim_arr as $tim => $ptr) + { + $ev_list[$ptr]['event_start'] = $tim; +// $text2 .= show_event($ev_list[$ptr]); + $thisevent = $ev_list[$ptr]; + $text2 .= $tp -> parseTemplate($EVENT_EVENT_TABLE, FALSE, $calendar_shortcodes); } $text2 .= $tp -> parseTemplate($EVENT_EVENTLIST_TABLE_END, FALSE, $calendar_shortcodes); + } } -/* -$nextmonth = mktime(0, 0, 0, $month + 1, 1, $year)-1; -if (!isset($next10_start)) -{ - $next10_start = $nextmonth; -} -*/ +// Now display next 10 events +//echo "Next 10 start: ".$next10_start."
"; +$ev_list = $ecal_class->get_n_events(10, $next10_start, $next10_start+86400000, $cat_filter, TRUE, + 'event_id,event_start, event_title', 'event_cat_name, event_cat_icon'); -// Show next 10 events after current event/day/month (doesn't show recurring events) -$qry = " -SELECT e.* FROM #event AS e -LEFT JOIN #event_cat AS ec ON e.event_category = ec.event_cat_id -WHERE e.event_start > '".intval($next10_start)."' {$ecal_class->extra_query} {$category_filter} -ORDER BY e.event_start ASC -LIMIT 0, 10 -"; -$num = $sql->db_Select_gen($qry); +$num = count($ev_list); if ($num != 0) { - $gen = new convert; - $archive_events = ""; -// while ($events = $sql->db_Fetch()) - while ($thisevent = $sql->db_Fetch()) - { - $archive_events .= $tp -> parseTemplate($EVENT_ARCHIVE_TABLE, FALSE, $calendar_shortcodes); - } + $archive_events = ""; + foreach ($ev_list as $thisevent) + { +// echo "Event start: ".$thisevent['event_start']."
"; + $archive_events .= $tp -> parseTemplate($EVENT_ARCHIVE_TABLE, FALSE, $calendar_shortcodes); + } } else { - $archive_events = $tp -> parseTemplate($EVENT_ARCHIVE_TABLE_EMPTY, FALSE, $calendar_shortcodes); + $archive_events = $tp -> parseTemplate($EVENT_ARCHIVE_TABLE_EMPTY, FALSE, $calendar_shortcodes); } $text2 .= $tp -> parseTemplate($EVENT_ARCHIVE_TABLE_START, FALSE, $calendar_shortcodes); @@ -776,79 +847,20 @@ $text2 .= $tp -> parseTemplate($EVENT_ARCHIVE_TABLE_END, FALSE, $calendar_shortc $caption = EC_LAN_80; // "Event List"; $ns->tablerender($caption.(isset($cap_title) ? $cap_title : ""), $text2); + +// Claim back memory no longer required +unset($ev_list); +unset($text2); + require_once(FOOTERF); -// Display one event in a form which can be expanded. -function show_event($day_events) -{ - global $tp, $cal_super, $_POST, $ds, $thisevent, $EVENT_ID, $EVENT_EVENT_TABLE, $calendar_shortcodes, $event_author_id, $event_author_name; - $text2 = ""; - foreach($day_events as $event) - { - $thisevent = $event; - $gen = new convert; - $lp = explode(".", $thisevent['event_author'],2); - if (preg_match("/[0-9]+/", $lp[0])) - { - $event_author_id = $lp[0]; - $event_author_name = $lp[1]; - } - $text2 .= $tp -> parseTemplate($EVENT_EVENT_TABLE, FALSE, $calendar_shortcodes); - } - return $text2; -} - function headerjs() { - global $cal; - $script = $cal->load_files(); -/* - $script .= " - "; -*/ - return $script; + global $cal; + $script = $cal->load_files(); + return $script; } ?> diff --git a/e107_plugins/calendar_menu/images/recent_icon.png b/e107_plugins/calendar_menu/images/recent_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..7bc0a49d8b79f6a0b25d75c0698b2b2fd2500066 GIT binary patch literal 329 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|oCO|{#S9GG9U#p3v`^C$Bv|4a zQR1ARo125PVuugp3H2O{dFoXnFJaIQ^|@?EI=it&eFd2Lwx$!e~KZHvSirfpas|NJ+j z)(!z}hU#3!$(ej?r?=kQ!sd{9`{kFZk_WzMh)NmU7IhU}w9jg))d$D!!xs!5df#PO XAZV;IdrF!((8mm(u6{1-oD!M \ No newline at end of file diff --git a/e107_plugins/calendar_menu/next_event_menu.php b/e107_plugins/calendar_menu/next_event_menu.php index 9eae4b77a..206d8eddb 100644 --- a/e107_plugins/calendar_menu/next_event_menu.php +++ b/e107_plugins/calendar_menu/next_event_menu.php @@ -11,11 +11,10 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/next_event_menu.php,v $ -| $Revision: 1.1.1.1 $ -| $Date: 2006-12-02 04:34:47 $ -| $Author: mcfly_e107 $ +| $Revision: 1.2 $ +| $Date: 2007-07-13 19:37:52 $ +| $Author: e107steved $ | -| 09.11.06 - Cache support added, templating/shortcode tweaks +----------------------------------------------------------------------------+ */ @@ -27,7 +26,7 @@ $ecal_dir = e_PLUGIN . "calendar_menu/"; global $ecal_class; 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"; @@ -41,18 +40,11 @@ $ecal_class = new ecal_class; include_lan(e_PLUGIN."calendar_menu/languages/".e_LANGUAGE.".php"); // Values defined through admin pages -$menu_title = $pref['eventpost_menuheading']; -$days_ahead = $pref['eventpost_daysforward']; -$show_count = $pref['eventpost_numevents']; -$show_recurring = $pref['eventpost_checkrecur']; -$link_in_heading = $pref['eventpost_linkheader']; - -// 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 +$menu_title = varset($pref['eventpost_menuheading'],EC_LAN_140); +$days_ahead = varset($pref['eventpost_daysforward'],30); // Number of days ahead to go +$show_count = varset($pref['eventpost_numevents'],3); // Number of events to show +$show_recurring = varset($pref['eventpost_checkrecur'],1); // Zero to exclude recurring events +$link_in_heading = varset($pref['eventpost_linkheader'],0); // Zero for simple heading, 1 to have clickable link require($ecal_dir."calendar_shortcodes.php"); @@ -65,55 +57,8 @@ else require($ecal_dir."calendar_template.php"); } -$site_time = $ecal_class->cal_timedate; -$end_time = $site_time + (86400 * $days_ahead); - - -// 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}"; +$start_time = $ecal_class->cal_timedate; +$end_time = $start_time + (86400 * $days_ahead) - 1; $cal_totev = 0; @@ -121,26 +66,29 @@ $cal_text = ''; $cal_row = array(); 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) { - while ($cal_row = $sql->db_Fetch()) - { - $cal_totev --; // Can use this to modify inter-event gap - $cal_text .= $tp->parseTemplate($EVENT_CAL_FE_LINE,FALSE,$calendar_shortcodes); - } + foreach ($ev_list as $cal_row) + { + $cal_totev --; // Can use this to modify inter-event gap + $cal_text .= $tp->parseTemplate($EVENT_CAL_FE_LINE,TRUE,$calendar_shortcodes); + } } else { + if ($pref['eventpost_fe_hideifnone']) return ''; $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) { - $calendar_title = "" . $menu_title . ""; + $calendar_title = "" . $calendar_title . ""; } // 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'); $cache_data = ob_get_flush(); // Get the page content, and display it $e107cache->set($cache_tag, $cache_data); // Save to cache - + +unset($ev_list); ?> \ No newline at end of file diff --git a/e107_plugins/calendar_menu/plugin.php b/e107_plugins/calendar_menu/plugin.php index 75afb1263..cd689382a 100644 --- a/e107_plugins/calendar_menu/plugin.php +++ b/e107_plugins/calendar_menu/plugin.php @@ -11,60 +11,91 @@ | GNU General Public License (http://gnu.org). | | $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 -| $Date: 2007-04-12 08:46:08 $ -| $Author: lisa_ $ +| $Revision: 1.5 $ +| $Date: 2007-07-13 19:37:52 $ +| $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; } -// 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"); +// Plugin info +// ----------- +include_lan(e_PLUGIN."calendar_menu/languages/".e_LANGUAGE.".php"); $eplug_name = EC_ADLAN_1; -$eplug_version = "3.6"; +$eplug_version = "3.70"; $eplug_author = "jalist / cameron / McFly / Barry / Lisa_ / steved"; $eplug_url = "http://e107.org"; $eplug_email = "jalist@e107.org"; $eplug_description = EC_LAN_107; -$eplug_compatible = "e107v7"; +$eplug_compatible = "e107v8"; $eplug_readme = "readme.pdf"; -// leave blank if no readme file $eplug_compliant = TRUE; +$eplug_folder = "calendar_menu"; // Name of the plugin's folder -// Name of the plugin's folder ------------------------------------------------------------------------------------- -$eplug_folder = "calendar_menu"; +$eplug_menu_name = "calendar_menu"; // Name of menu item for plugin +$eplug_conffile = "admin_config.php"; // Name of the admin configuration file -// Name of menu item for plugin ---------------------------------------------------------------------------------- -$eplug_menu_name = "calendar_menu"; +$eplug_icon = $eplug_folder."/images/calendar_32.png"; // 32x32 icon +$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"; -$eplug_icon_small = $eplug_folder."/images/calendar_16.png"; -$eplug_caption = EC_LAN_81; // "Configure Event Calendar"; +//--------------------------------------- +// Get version of installed plugin +//--------------------------------------- +// 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; -$ecalSQL->db_Select("plugin", "plugin_version", "plugin_path='calendar_menu' AND plugin_installflag > 0"); -list($ecalVer) = $ecalSQL->db_Fetch(); -$ecalVer = preg_replace("/[a-zA-z\s]/", '', $ecalVer); +list($$ecal_ver_num,$ecal_ver_alpha) = explode(" ", $ecal_ver); +$ecal_ver_num = intval((100*$ecal_ver_num) + 0.1); // Pull out numeric version as integer +$ecal_ver_alpha = trim($ecal_ver_alpha); // Release candidate etc -// List of preferences ----------------------------------------------------------------------------------------------- +//echo "Calendar Version: ".$ecal_ver." Numeric: ".$ecal_ver_num." Alpha: ".$ecal_ver_alpha." Mode: ".$ec_mode."
"; + + +// 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( "eventpost_admin" => 0, "eventpost_adminlog" => 0, "eventpost_showeventcount" => 1, +"eventpost_showmouseover" => 0, "eventpost_forum" => 1, "eventpost_recentshow" => 0, "eventpost_super" => 0, @@ -81,7 +112,7 @@ $eplug_prefs = array( "eventpost_datenext" => 1, "eventpost_eventdatecustom" => "%A %d %B %Y", "eventpost_nextdatecustom" => "%d %b", -"eventpost_mailsubject" => EC_ADLAN_A12, +"eventpost_mailsubject" => EC_ADLAN_A12." - {EC_MAIL_TITLE}", "eventpost_mailfrom" => EC_ADLAN_A151, "eventpost_mailaddress" => EC_ADLAN_A152, "eventpost_asubs" => 1, @@ -92,13 +123,20 @@ $eplug_prefs = array( "eventpost_checkrecur" => 1, "eventpost_linkheader" => 0, "eventpost_fe_set" => "", +"eventpost_fe_hideifnone" => '0', +"eventpost_fe_showrecent" => 0, "eventpost_showcaticon" => 0, +"eventpost_printlists" => 1, "eventpost_namelink" => 1 ); -// List of table names ----------------------------------------------------------------------------------------------- + +// List of table names +//-------------------- $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( "CREATE TABLE ".MPREFIX."event ( 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_cat int(10) unsigned NOT NULL default '0', 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/"; $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_perms = "Everyone"; // Everyone, Guest, Member, Admin +$eplug_link_perms = "everyone"; // Everyone, Guest, Member, Admin -// 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."; +// 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."; // upgrading ... // -$upgrade_add_prefs = ""; -$upgrade_remove_prefs = ""; +$upgrade_add_prefs = array(); +$upgrade_remove_prefs = array(); $upgrade_alter_tables = array(); $version_notes = ""; +//---------------------------------------------------- +// Solely for upgrades after here +//---------------------------------------------------- + if (!function_exists('create_ec_log_dir')) { -function create_ec_log_dir() -{ -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."
"; - } - } - if (!is_dir($cal_log_dir)) + function create_ec_log_dir($eplug_folder) { - $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."
"; + } + } + 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."
"; + } + if (!is_writable($cal_log_dir."/")) + { + $response .= EC_ADLAN_A155; + } + } return $response; } - -// Now check directory permissions - if (!is_writable($cal_log_dir."/")) - { - if (!chmod($cal_log_dir,0666)) - { - $response = EC_ADLAN_A154."
"; - } - if (!is_writable($cal_log_dir."/")) - { - $response .= EC_ADLAN_A155; - } - } - return $response; -} } - -if ($ecalVer < 3.5) -{ -// To version 3.5 - -$upgrade_alter_tables = array( +// Note: Decimal points removed from version number, two decimal places implied +if ($ecal_ver_num < 350) +{ // To version 3.50 +// echo "Add for V3.5
"; +$upgrade_alter_tables = array_merge($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_subs 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', PRIMARY KEY (event_subid) ) TYPE=MyISAM;" -); +)); $version_notes .= "3.5
".EC_ADLAN_A156."
"; } -// 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
"; +$upgrade_alter_tables = array_merge($upgrade_alter_tables,array( "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_force_class int(10) unsigned NOT NULL default '0'" -); +)); $verprefs = array( "eventpost_adminlog" => 0, "eventpost_showeventcount" => 1, @@ -257,11 +300,11 @@ $upgrade_alter_tables = array( "eventpost_recentshow" => 0, "eventpost_dateevent" => 1, "eventpost_datenext" => 1, - "eventpost_eventdatecustom" => "&A %d %B %Y", + "eventpost_eventdatecustom" => "%A %d %B %Y", "eventpost_nextdatecustom" => "%d %b", "eventpost_menulink" => 0 ); - $upgrade_add_prefs .= $verprefs; - $version_notes .= "3.6
".EC_ADLAN_A156."
".create_ec_log_dir()."
+ $upgrade_add_prefs = array_merge($upgrade_add_prefs,$verprefs); + $version_notes .= "3.6
".EC_ADLAN_A156."
".create_ec_log_dir($eplug_folder)."
Configure
"; $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
"; + $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 .= "3.7
".EC_ADLAN_A164; +} + $eplug_upgrade_done = EC_LAN_108."
".$version_notes; diff --git a/e107_plugins/calendar_menu/readme.pdf b/e107_plugins/calendar_menu/readme.pdf index 365d7f3b3e7221b0c7fa934dd91d55d885387f21..4928a546e2101e829fbe42a354f3c5c307cc13d4 100644 GIT binary patch delta 202 zcmV;*05$*a+5?FKkVt=7ljODve(ztQ$Mw;&c!-jcC!dKcPMkQC!&RUmL>N*7iCZ~Mpf&FcB;y)Rtx_~q(( z(UzwFZ}=tr`}(H%;L11iow~Af#nq!#Rd!uxS~vWz3hTO37uG`mudPgRb+dZ#*SD^I zSh>YXATM literal 60782 zcma&NRZv_(+pax>ySqbh83^uf!Ck_j2_g944gy|Au;?f%^SlNLV6hAyCw;*ZW#D6QwQ<0bl;qX0b+PmO z$RPHwMUPk6-pSL}oq<=`$=cIa(e|C|ds}H~EDuk2TWe=5U)YKHa_Y7)W#?Hb#I3gk z5$jdw6vc&f835gXI;E3i1e2lZ@hNKGB2;-srh`y zIp>vM9fj_>K~+g*3D=q{Y3QFDKOH`kZhLUqGkgaV+Q_N2YiA2Nh&nuvu0HCWire7W z0vF>eto3P=J|*iqS1xZQmwbMZ{`~AG^FHHR`R`SnRoPLL+E&70ps}FW*TD9d4e}@a z1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D1obppyzajtG7jB>{_Y>S}=8F-ocf@uN}lHrIjz ztT8d6&+0NqLrEf6QPRP}hjRNLP;Fn$0o>D1OU&;uP^wGJU&3;*9T*9#W=ALF+81q| z(nOk3i5JYM1Y>h|@uq%K(N8-)D#66NyLdzNA)WJcEZ#T`{X6-JdZ!m}3M>vWLFf}$ z)i2&quELT6JhC()CYcv)^!}HDNq2PdMwa=hI?id`ju|lTXU@#X@E;GTtdN8y=gk2msn6AAaN7?qiu z%Ov6XY)>8|MsZXHZb!r6=tzgd?hx%93)>AGJDih-iwdZWoaxI3Bl+2xgQKI>hxTTB zv)nfLF2&hkFGYPZk|+X|v72d=@sa~Rp2&Mlo+=X+_;mu4jF(vC=*E|(2T_6))+QM* zne9OxibYS56%EAruU>ju+qGp+($guP6=3@^ z$Y53=^RhuEu%Kv>v8>siC;^RtNspIs8_8&omw1OoCcq<+COxPYIhGB+ureo@edZ-e zG?xW@fpw*&EPTH-${fI%mx7 zbUKii+fWBD$pFA683eMqZ4OZs&1D^m(m~%lt$i;Fu+wF%1Ev`;H<)CC0~aLt(#-`Y z?BSYZqJ*sE20cyy56v=J!2KjGYEuWiH#hS1pq s)-m=89*>W~uhJ73dqSSu!yr_XUnt1;xx7AtilQP&ye&LDc6^-ezxT|-Jpcdz diff --git a/e107_plugins/calendar_menu/search/search_parser.php b/e107_plugins/calendar_menu/search/search_parser.php index c08aadbb0..234318365 100644 --- a/e107_plugins/calendar_menu/search/search_parser.php +++ b/e107_plugins/calendar_menu/search/search_parser.php @@ -11,9 +11,9 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/search/search_parser.php,v $ -| $Revision: 1.1.1.1 $ -| $Date: 2006-12-02 04:34:50 $ -| $Author: mcfly_e107 $ +| $Revision: 1.2 $ +| $Date: 2007-07-13 19:37:52 $ +| $Author: e107steved $ +----------------------------------------------------------------------------+ */ diff --git a/e107_plugins/calendar_menu/subs_menu.php b/e107_plugins/calendar_menu/subs_menu.php index 29a3d14d4..8ee50cd7d 100644 --- a/e107_plugins/calendar_menu/subs_menu.php +++ b/e107_plugins/calendar_menu/subs_menu.php @@ -11,42 +11,54 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/subs_menu.php,v $ -| $Revision: 1.1.1.1 $ -| $Date: 2006-12-02 04:34:49 $ -| $Author: mcfly_e107 $ -| -| 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 **** +| $Revision: 1.2 $ +| $Date: 2007-07-13 19:37:52 $ +| $Author: e107steved $ | +----------------------------------------------------------------------------+ */ if (!defined('e107_INIT')) { exit; } -// This menu can be called from a cron job - see readme.rtf -$run_from_menu = function_exists("parseheader"); // Use this to suppress logging in 'through' path -$ec_dir = e_PLUGIN . "calendar_menu/"; -// Check if we are going to do the notify +// This menu is best called from a cron job - see readme.pdf +global $ec_default_msg_1, $ec_default_msg_2, $ec_log_requirement, $ec_debug_level, $ec_run_from_menu, $tp; -$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")."
"; + +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 list($day,$month,$year) = explode("-",e_QUERY); if (!isset($year) || ($year == 0)) $year = date("Y"); @@ -55,24 +67,52 @@ if (($debug_level > 0) && e_QUERY) } else { // 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'; - if (!$run_from_menu) + global $ec_log_requirement, $ec_run_from_menu; + if ($ec_log_requirement == 0) return; + if ($ec_run_from_menu && ($log_always == FALSE)) return; +// echo "Logging: ".$log_text."
"; + 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!
"; + $ec_log_requirement = 0; + return; + } + } + + if (fwrite($handle,$log_text) == FALSE) + { + $ec_log_requirement = 0; + echo "File write failed!
"; + } + + 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); + $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 $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 @@ -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 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 -//$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 event_cat_today < " . intval($cal_starttime) . " and event_start >= (" . intval($cal_starttime) . ") and event_start < (86400+" . intval($cal_starttime) . ") and 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 event_cat_today < " . intval($cal_starttime) . " and event_start >= (" . intval($cal_starttime) ." + 86400 ) and event_start < (" . intval($cal_starttime) ." + 172800) and 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; - if (fwrite($handle," .. completed at ".date("D j M Y G:i:s")."\r\n") === false) $log_requirement = 0; - fclose($handle); + $e107cache->set("nomd5_cal_subs", time(),TRUE); } // 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 send_mailshot($cal_query, $shot_type, $msg_num) +function ec_send_mailshot($cal_query, $shot_type, $msg_num, $calendar_shortcodes) { global $sql, $sql2; - global $log_requirement, $log_filename, $debug_level; - global $pref; - global $run_from_menu; + global $ec_debug_level, $ec_log_requirement; + global $pref, $tp, $thisevent; + 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; - if (fwrite($handle,"\r\n Starting emails for ".$shot_type." at ".date("D j M Y G:i:s")) === false) $log_requirement = 0; - if ($debug_level >= 2) - { - if (fwrite($handle,"\r\n Query is: ".$cal_query."\r\n") === false) $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 ($ec_debug_level >= 2) subs_log_a_line("\r\n Query is: ".$cal_query."\r\n",FALSE,FALSE); } -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 - if ($log_requirement > 1) - { - 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; - } + if ($ec_log_requirement > 1) + subs_log_a_line(" - ".$num_cat_proc." categories found to process\r\n",FALSE,TRUE); + require_once(e_HANDLER . "mail.php"); while ($cal_row = $sql->db_Fetch()) { // Process one event at a time + $thisevent = $cal_row; // Used for shortcodes extract($cal_row); - if ($log_requirement > 1) - { - if (fwrite($handle," Processing event: ".$event_title." \r\n") === false) $log_requirement = 0; - } - + subs_log_a_line(" Processing event: ".$event_title." \r\n",FALSE,TRUE); + + // Note that event processed, and generate the email if ($msg_num == 1) + { $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 + { $sql2->db_Update("event_cat", "event_cat_today=" . time() . " where event_cat_id=" . intval($event_cat_id)); - - -// Start of next try on query +// $cal_msg = $event_title . "\n\n" . $event_cat_msg2; + $cal_msg = $event_cat_msg2; + 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: // 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 @@ -206,42 +282,31 @@ if ($num_cat_proc = $sql->db_Select_gen($cal_query)) 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 ($log_requirement > 1) - { - if (fwrite($handle," - ".$num_shots." emails found to send\r\n") === false) $log_requirement = 0; - } - while ($cal_emrow = $sql2->db_Fetch()) - { - extract($cal_emrow); - if ($msg_num == 1) - $cal_msg = $event_title . "\n\n" . $event_cat_msg1; + subs_log_a_line(" - ".$num_shots." emails found to send\r\n",FALSE,TRUE); + + while ($cal_emrow = $sql2->db_Fetch()) + { + extract($cal_emrow); + if ($ec_debug_level == 0) + $send_result = sendemail($user_email, $cal_title, $cal_msg, $user_name, $pref['eventpost_mailaddress'], $pref['eventpost_mailfrom']); else - $cal_msg = $event_title . "\n\n" . $event_cat_msg2; - if ($debug_level == 0) $send_result = sendemail($user_email, $pref['eventpost_mailsubject'], $cal_msg, $user_name, $pref['eventpost_mailaddress'], $pref['eventpost_mailfrom']); - if ($log_requirement > 1) + $send_result = " **DEBUG**"; + if ($ec_log_requirement > 1) { - $log_string = " Send to: ".$user_email." Name: ".$user_name; - if ($debug_level > 0) - { $log_string .= " *DEBUG* -"; } - else - { $log_string .= " Result = ".$send_result." -"; } - if (fwrite($handle,$log_string) === false) $log_requirement = 0; + subs_log_a_line(" Send to: ".$user_email." Name: ".$user_name." Result = ".$send_result."\r\n",FALSE,TRUE); } } } } // 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; - fclose($handle); + subs_log_a_line(" Completed emails for ".$shot_type." at ".date("D j M Y G:i:s")."\r\n",TRUE,TRUE); } } } diff --git a/e107_plugins/calendar_menu/subscribe.php b/e107_plugins/calendar_menu/subscribe.php index 4eb9175e9..46b6ed1a4 100644 --- a/e107_plugins/calendar_menu/subscribe.php +++ b/e107_plugins/calendar_menu/subscribe.php @@ -11,14 +11,15 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/subscribe.php,v $ -| $Revision: 1.2 $ -| $Date: 2007-01-28 11:40:20 $ +| $Revision: 1.3 $ +| $Date: 2007-07-13 19:37:52 $ | $Author: e107steved $ | +----------------------------------------------------------------------------+ */ 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);
".EC_LAN_72." ".EC_LAN_67." "; - } elseif ($action == "ne") - { - $caption = EC_LAN_28; // Enter New Event - } - else - { - $caption = EC_LAN_83; - } - - $text .= " -
".EC_LAN_72." ".EC_LAN_67." "; - - - $text .= make_calendar("start_date",$ne_startdate)."   ".EC_LAN_73." ".make_calendar("end_date",$ne_enddate); - $text .= " -
".EC_LAN_71." - ".EC_LAN_67; - + $text .= make_calendar("start_date",$ne_startdate)."   ".EC_LAN_73." ".make_calendar("end_date",$ne_enddate); + $text .= "
".EC_LAN_71." ".EC_LAN_67; $text .= make_hourmin("ne_",$ne_hour,$ne_minute)."  ".EC_LAN_73.make_hourmin('end_',$end_hour,$end_minute); - $text .= "
"; - $text .= EC_LAN_64." -
".EC_LAN_65.""; - $text .= ""; - $text .= EC_LAN_63." -
".EC_LAN_70." * + $text .= "
"; + $text .= EC_LAN_64." +
".EC_LAN_65.""; + $text .= recur_week_select($recurring)."  ".recur_select($recurring); + $disp = $recurring && ($action == 'ne') ? '' : " style='display:none;'"; + $text .= "".EC_LAN_86.""; + $text .= "
".EC_LAN_63." +
".EC_LAN_70." * -
".EC_LAN_52." +
".EC_LAN_52." -
".EC_LAN_53." ".EC_LAN_54." - "; - $text .= "
".EC_LAN_55; - $text .= " "; - $text .= " "; - $text .= ""; - $text .= "
-
-
".EC_LAN_32." +
".EC_LAN_32." -
".EC_LAN_57." * +
".EC_LAN_57." * -
".EC_LAN_58." +
".EC_LAN_58." -
".EC_LAN_59." +
".EC_LAN_59."