1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-05 14:17:49 +02:00

Event Calendar V3.70

This commit is contained in:
e107steved
2007-07-13 19:37:52 +00:00
parent 028713a8f9
commit ce3916797e
22 changed files with 3325 additions and 1619 deletions

View File

@@ -11,19 +11,18 @@
| 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")) {
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 = "<div style='text-align:center'>
<form method='post' action='".e_SELF."?backdel.{$qs[1]}'>
<form method='post' action='".e_SELF."?backdel.{$ec_qs[1]}'>
<table style='width:97%' class='fborder'>
<tr>
<td class='forumheader3' style='width:100%;vertical-align:top;rext-align:center;'>".EC_ADLAN_A150.$old_string." </td>
@@ -167,7 +175,7 @@ if(isset($qs[0]) && ($qs[0] == "confdel"))
// Prompt to clear cache
if (isset($qs[0]) && ($qs[0] == "confcache"))
if (isset($ec_qs[0]) && ($ec_qs[0] == "confcache"))
{
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."?cachedel'>
@@ -182,16 +190,42 @@ if (isset($qs[0]) && ($qs[0] == "confcache"))
}
if (isset($message))
// Just delete odd email subscriptions
if (isset($ec_qs[0]) && isset($ec_qs[2]) && isset($ec_qs[3]) && ($ec_qs[0] == 'subs') && ($ec_qs[2] == 'del') && is_numeric($ec_qs[3]))
{
$ns->tablerender("", "<div style='text-align:center'><b>$message</b></div>");
if ($sql->db_Delete("event_subs","event_subid='{$ec_qs[3]}'"))
$message = EC_ADLAN_A180.$ec_qs[3];
else
$message = EC_ADLAN_A181.$ec_qs[3];
}
if (isset($message) && ($message != ""))
{
$ns->tablerender("", "<div style='text-align:center'><b>{$message}</b></div>");
$message = "";
}
//category
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 .= "<tr><td class='forumheader3' colspan='2'><strong>".EC_ADLAN_A26."</strong></td></tr>";
@@ -247,14 +279,27 @@ if(isset($qs[0]) && $qs[0] == "cat")
event_cat_addclass='".intval($_POST['event_cat_addclass'])."',
event_cat_lastupdate='".time()."'
where event_cat_id='$calendarmenu_id'";
if ($calendarmenu_db->db_Update("event_cat", $calendarmenu_args)){
// Changes saved
if ($calendarmenu_db->db_Update("event_cat", $calendarmenu_args))
{ // Changes saved
$calendarmenu_msg .= "<tr><td class='forumheader3' colspan='2'><b>".EC_ADLAN_A28."</b></td></tr>";
}else{
}
else
{
$calendarmenu_msg .= "<tr><td class='forumheader3' colspan='2'><b>".EC_ADLAN_A29."</b></td></tr>";
}
}
// Now see if we need to send a test email
if (isset($_POST['send_email_1'])) $ecal_send_email = 1;
if (isset($_POST['send_email_2'])) $ecal_send_email = 2;
if ($ecal_send_email != 0)
{
$calendarmenu_action = 'dothings'; // This forces us back to category edit screen
$_POST['calendarmenu_selcat'] = $calendarmenu_id; // Record number to use
$_POST['calendarmenu_recdel'] = '1'; // This forces re-read of the record
}
}
// We are creating, editing or deleting a record
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."<br /><br />";
$send_result = sendemail($user_email, $cal_title, $cal_msg, $user_name, $pref['eventpost_mailaddress'], $pref['eventpost_mailfrom']);
if ($send_result)
$calendarmenu_msg .= "<tr><td class='forumheader3' colspan='2'><strong>".EC_ADLAN_A187.$ecal_send_email."</strong></td></tr>";
else
$calendarmenu_msg .= "<tr><td class='forumheader3' colspan='2'><strong>".EC_ADLAN_A188.$ecal_send_email."</strong></td></tr>";
}
break;
}
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"))
{
// delete the record
if ($_POST['calendarmenu_okdel'] == '1'){
if ($calendarmenu_db->db_Select("event", "event_id", " where event_category='$calendarmenu_id'", "nowhere")){
$calendarmenu_msg .= "<tr><td class='forumheader3' colspan='2'><strong>".EC_ADLAN_A59."</strong></td></tr>";
}else{
if ($calendarmenu_db->db_Delete("event_cat", " event_cat_id='$calendarmenu_id'")){
}
else
{
if ($calendarmenu_db->db_Delete("event_cat", " event_cat_id='{$calendarmenu_id}'"))
{
$calendarmenu_msg .= "<tr><td class='forumheader3' colspan='2'><strong>".EC_ADLAN_A30."</strong></td></tr>";
}else{
}
else
{
$calendarmenu_msg .= "<tr><td class='forumheader3' colspan='2'><strong>".EC_ADLAN_A32."</strong></td></tr>";
}
}
}else{
}
else
{
$calendarmenu_msg .= "<tr><td class='forumheader3' colspan='2'><strong>".EC_ADLAN_A31."</strong></td></tr>";
}
$calendarmenu_dodel = TRUE;
@@ -310,7 +407,6 @@ if(isset($qs[0]) && $qs[0] == "cat")
{
require_once(e_HANDLER."file_class.php");
$calendarmenu_text .= "
<form id='calformupdate' method='post' action='".e_SELF."?cat'>
<table style='width:97%;' class='fborder'>
@@ -375,17 +471,31 @@ if(isset($qs[0]) && $qs[0] == "cat")
</tr>
<tr>
<td class='forumheader3' style='width:20%'>".EC_ADLAN_A83."</td>
<td class='forumheader3'><input type='text' size='4' maxlength='5' class='tbox' name='event_cat_ahead' value='$event_cat_ahead' /></td>
<td class='forumheader3'><input type='text' size='4' maxlength='5' class='tbox' name='event_cat_ahead' value='{$event_cat_ahead}' /></td>
</tr>
<tr>
<td class='forumheader3' style='width:20%;vertical-align:top;'>".EC_ADLAN_A84."</td>
<td class='forumheader3'><textarea rows='5' cols='80' class='tbox' name='event_cat_msg1' >".$event_cat_msg1."</textarea></td>
<td class='forumheader3' style='width:20%;vertical-align:top;'>".EC_ADLAN_A84;
if ($calendarmenu_do == 1)
$calendarmenu_text .= "<br /><br /><br /><input type='submit' name='send_email_1' value='".EC_ADLAN_A186."' class='tbox' />";
$calendarmenu_text .= "</td>
<td class='forumheader3'><textarea rows='5' cols='80' class='tbox' name='event_cat_msg1' >".$event_cat_msg1."</textarea>";
if ($event_cat_name != EC_DEFAULT_CATEGORY)
$calendarmenu_text .= "<br /><span class='smalltext'><em>".EC_ADLAN_A189."</em></span>";
$calendarmenu_text .= "
</td>
</tr>
<tr>
<td class='forumheader3' style='width:20%;vertical-align:top;'>".EC_ADLAN_A117."</td>
<td class='forumheader3'><textarea rows='5' cols='80' class='tbox' name='event_cat_msg2' >".$event_cat_msg2."</textarea></td>
<td class='forumheader3' style='width:20%;vertical-align:top;'>".EC_ADLAN_A117;
if ($calendarmenu_do == 1)
$calendarmenu_text .= "<br /><br /><br /><input type='submit' name='send_email_2' value='".EC_ADLAN_A186."' class='tbox' />";
$calendarmenu_text .= "</td>
<td class='forumheader3'><textarea rows='5' cols='80' class='tbox' name='event_cat_msg2' >".$event_cat_msg2."</textarea>";
if ($event_cat_name != EC_DEFAULT_CATEGORY)
$calendarmenu_text .= "<br /><span class='smalltext'><em>".EC_ADLAN_A189."</em></span>";
$calendarmenu_text .= "
</td>
</tr>
<tr><td colspan='2' style='text-align:center' class='fcaption'><input type='submit' name='submits' value='".EC_LAN_77."' class='tbox' /></td></tr>
<tr><td colspan='2' style='text-align:center' class='fcaption'><input type='submit' name='submits' value='".EC_LAN_77."' class='button' /></td></tr>
</table>
</form>";
}
@@ -437,7 +547,7 @@ if(isset($qs[0]) && $qs[0] == "cat")
}
if(isset($calendarmenu_text))
{
$ns->tablerender(EC_ADLAN_A19, $calendarmenu_text);
$ns->tablerender("<div style='text-align:center'>".EC_ADLAN_1." - ".EC_ADLAN_A19."</div>", $calendarmenu_text);
}
}
@@ -445,7 +555,7 @@ if(isset($qs[0]) && $qs[0] == "cat")
// FORTHCOMING EVENTS OPTIONS
// ====================================================
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';
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A103."<br /><span class='smalltext'><em>".EC_ADLAN_A107."</em></span></td>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A103."</td>
<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='checkbox' name='eventpost_fe_checkrecur' value='1' ".($pref['eventpost_checkrecur']==1?" checked='checked' ":"")." /></td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A107."</td>
<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='checkbox' name='eventpost_fe_hideifnone' value='1' ".($pref['eventpost_fe_hideifnone']==1?" checked='checked' ":"")." /></td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A199."</td>
<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='checkbox' name='eventpost_fe_showrecent' value='1' ".($pref['eventpost_fe_showrecent']==1?" checked='checked' ":"")." /></td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A130."<br /></td>
<td style='width:60%;vertical-align:top;' class='forumheader3'>
@@ -511,8 +631,8 @@ if (!isset($pref['eventpost_namelink'])) $pref['eventpost_namelink'] = '1';
// Now display all the current categories as checkboxes
$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';
</form>
</div>";
$ns->tablerender("<div style='text-align:center'>".EC_ADLAN_A100."</div>", $text);
$ns->tablerender("<div style='text-align:center'>".EC_ADLAN_1." - ".EC_ADLAN_A100."</div>", $text);
} // End of Forthcoming Events Menu Options
@@ -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 = "<div style='text-align:center'>
<form method='post' action='".e_SELF."?maint'>
@@ -570,7 +690,7 @@ if((isset($qs[0]) && $qs[0] == "maint"))
<tr><td colspan='2' style='text-align:center' class='fcaption'><input class='button' type='submit' name='deleteold' value='".EC_ADLAN_A145."' /></td></tr>
</table></form></div><br /><br />";
$ns->tablerender("<div style='text-align:center'>".EC_ADLAN_A144."</div>", $text);
$ns->tablerender("<div style='text-align:center'>".EC_ADLAN_1." - ".EC_ADLAN_A141."</div>", $text);
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."?maint'>
@@ -579,36 +699,125 @@ if((isset($qs[0]) && $qs[0] == "maint"))
<tr><td colspan='2' style='text-align:center' class='fcaption'><input class='button' type='submit' name='cache_clear' value='".EC_ADLAN_A161."' /></td></tr>
</table></form></div>";
$ns->tablerender("<div style='text-align:center'>".EC_ADLAN_A159."</div>", $text);
$ns->tablerender("<div style='text-align:center'>".EC_ADLAN_1." - ".EC_ADLAN_A159."</div>", $text);
}
// ====================================================
// SUBSCRIPTIONS OPTIONS
// ====================================================
if((isset($ec_qs[0]) && $ec_qs[0] == "subs"))
{
$from = 0;
$amount = 20; // Number per page - could make configurable later if required
if (isset($ec_qs[1])) $from = $ec_qs[1];
$num_entry = $sql->db_Count("event_subs", "(*)", ""); // Just count the lot
$qry = "SELECT es.*, u.user_id, u.user_name, u.user_class, ec.event_cat_id, ec.event_cat_name, ec.event_cat_class FROM #event_subs AS es
LEFT JOIN #user AS u ON es.event_userid = u.user_id
LEFT JOIN #event_cat AS ec ON es.event_cat = ec.event_cat_id
ORDER BY u.user_id
LIMIT {$from}, {$amount} ";
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."?subs.".$from."'>
<table style='".USER_WIDTH."' class='fborder'>
<colgroup>
<col style='width:10%; vertical-align:top;' />
<col style='width:20%; vertical-align:top;' />
<col style='width:30%; vertical-align:top;' />
<col style='width:30%; vertical-align:top;' />
<col style='width:10%; vertical-align:top;' />
</colgroup>";
if (!$sql->db_Select_gen($qry))
{
$text .= "<tr><td colspan='5' class='forumheader'>".EC_ADLAN_A174."</td></tr>";
$num_entry = 0;
}
else
{
$text .= "<tr><td class='forumheader'>".EC_ADLAN_A175."</td><td class='forumheader'>".EC_ADLAN_A176."</td>
<td class='forumheader'>".EC_ADLAN_A177."</td><td class='forumheader'>".EC_ADLAN_A178."</td><td class='forumheader'>".EC_ADLAN_A179."</td></tr>";
while ($row = $sql->db_Fetch())
{
// Columns - UID, User name, Category name, Action
$problems = "";
if (!isset($row['user_id']) || ($row['user_id'] == 0) || (!isset($row['user_name'])) || ($row['user_name'] == ""))
$problems = EC_ADLAN_A198;
if (!check_class($row['event_cat_class'],$row['user_class']))
{
if ($problems != "") $problems .= "<br />";
$problems .= EC_ADLAN_A197;
}
$text .= "
<tr>
<td class='forumheader3'>".$row['user_id']."</td>
<td class='forumheader3'>".$row['user_name']."</td>
<td class='forumheader3'>".$row['event_cat_name']."</td>
<td class='forumheader3'>".$problems."</td>
<td class='forumheader3' style='text_align:center'><a href='".e_SELF."?".$ec_qs[0].".".$from.".del.".$row['event_subid']."'>
<img src='".e_IMAGE."admin_images/delete_16.png' alt='".LAN_DELETE."' title='".LAN_DELETE."' /></a></td>
</tr>";
} // End while
// Next-Previous. ==========================
if ($num_entry > $amount)
{
$parms = "{$num_entry},{$amount},{$from},".e_SELF."?".$ec_qs[0].".[FROM]";
$text .= "<br />".$tp->parseTemplate("{NEXTPREV={$parms}}");
}
}
$text .= "</table></form></div>";
$text .= "&nbsp;&nbsp;&nbsp;".str_replace("--NUM--", $num_entry, EC_ADLAN_A182);
$ns->tablerender("<div style='text-align:center'>".EC_ADLAN_1." - ".EC_ADLAN_A173."</div>", $text);
}
// ========================================================
// MAIN OPTIONS MENU
// ========================================================
if(!isset($qs[0]) || (isset($qs[0]) && $qs[0] == "config")){
if(!isset($ec_qs[0]) || (isset($ec_qs[0]) && $ec_qs[0] == "config"))
{
function select_day_start($val)
{
if ($val == 'sun') $val = 0; elseif ($val == 'mon') $val = 1; // Legacy values
$ret = "<select name='eventpost_weekstart' class='tbox'>\n";
$ret .= "<\select>\n";
foreach (array(EC_LAN_18,EC_LAN_12,EC_LAN_13,EC_LAN_14,EC_LAN_15,EC_LAN_16,EC_LAN_17) as $k => $v)
{
$sel = ($val == $k) ? " selected='selected'" : "";
$ret .= "<option value='{$k}'{$sel}>{$v}</option>\n";
}
return $ret;
}
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."'>
<table style='width:97%' class='fborder'>
<table style='width:97%' class='fborder'><colgroup>
<col style='width:40%;vertical-align:top;' /><col style='width:60%;vertical-align:top;' /></colgroup>
<tr><td style='vertical-align:top;' colspan='2' class='fcaption'>".EC_LAN_78." </td></tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_LAN_76." </td>
<td style='width:60%;vertical-align:top;' class='forumheader3'>". r_userclass("eventpost_admin", $pref['eventpost_admin'], "off", 'public, nobody, member, admin, classes')."
<td class='forumheader3'>".EC_LAN_76." </td>
<td class='forumheader3'>". r_userclass("eventpost_admin", $pref['eventpost_admin'], "off", 'public, nobody, member, admin, classes')."
</td>
</tr>
";
$text .= "
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_LAN_104." </td>
<td style='width:60%;vertical-align:top;' class='forumheader3'>". r_userclass("eventpost_super", $pref['eventpost_super'], "off", 'public, nobody, member, admin, classes')."
<td class='forumheader3'>".EC_LAN_104." </td>
<td class='forumheader3'>". r_userclass("eventpost_super", $pref['eventpost_super'], "off", 'public, nobody, member, admin, classes')."
</td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A134."</td>
<td style='width:60%;vertical-align:top;' class='forumheader3'>
<td class='forumheader3'>".EC_ADLAN_A134."</td>
<td class='forumheader3'>
<select name='eventpost_adminlog' class='tbox'>
<option value='0' ".($pref['eventpost_adminlog']=='0'?" selected='selected' ":"")." >". EC_ADLAN_A87." </option>
<option value='1' ".($pref['eventpost_adminlog']=='1'?" selected='selected' ":"")." >".EC_ADLAN_A135." </option>
@@ -619,44 +828,46 @@ $text .= "
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A165."</td>
<td style='width:60%;vertical-align:top;' class='forumheader3'>
<td class='forumheader3'>".EC_ADLAN_A165."</td>
<td class='forumheader3'>
<select name='eventpost_menulink' class='tbox'>
<option value='0' ".($pref['eventpost_menulink']=='0'?" selected='selected' ":"")." >".EC_LAN_80." </option>
<option value='1' ".($pref['eventpost_menulink']=='1'?" selected='selected' ":"")." >".EC_LAN_83." </option>
<option value='2' ".($pref['eventpost_menulink']=='2'?" selected='selected' ":"")." >".EC_ADLAN_A185." </option>
</select>
</td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A140."</td>
<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='checkbox' name='eventpost_showeventcount' value='1' ".($pref['eventpost_showeventcount']==1?" checked='checked' ":"")." /></td>
<td class='forumheader3'>".EC_ADLAN_A183."</td>
<td class='forumheader3'><input class='tbox' type='checkbox' name='eventpost_showmouseover' value='1' ".($pref['eventpost_showmouseover']==1?" checked='checked' ":"")." />
<span class='smalltext'><em>".EC_ADLAN_A184."</em></span></td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_LAN_102."</td>
<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='checkbox' name='eventpost_forum' value='1' ".($pref['eventpost_forum']==1?" checked='checked' ":"")." /></td>
<td class='forumheader3'>".EC_ADLAN_A140."</td>
<td class='forumheader3'><input class='tbox' type='checkbox' name='eventpost_showeventcount' value='1' ".($pref['eventpost_showeventcount']==1?" checked='checked' ":"")." /></td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A171."</td>
<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='text' name='eventpost_recentshow' size='10' value='".$pref['eventpost_recentshow']."' maxlength='5' />
<td class='forumheader3'>".EC_LAN_102."</td>
<td class='forumheader3'><input class='tbox' type='checkbox' name='eventpost_forum' value='1' ".($pref['eventpost_forum']==1?" checked='checked' ":"")." /></td>
</tr>
<tr>
<td class='forumheader3'>".EC_ADLAN_A171."</td>
<td class='forumheader3'><input class='tbox' type='text' name='eventpost_recentshow' size='10' value='".$pref['eventpost_recentshow']."' maxlength='5' />
<span class='smalltext'><em>".EC_ADLAN_A172."</em></span>
</td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_LAN_114."</td>
<td style='width:60%;vertical-align:top;' class='forumheader3'>
<select name='eventpost_weekstart' class='tbox'>
<option value='sun' ".($pref['eventpost_weekstart']=='sun'?" selected='selected' ":"")." >".EC_LAN_115."</option>
<option value='mon' ".($pref['eventpost_weekstart']=='mon'?" selected='selected' ":"")." >".EC_LAN_116."</option>
</select>
</td>
<td class='forumheader3'>".EC_LAN_114."</td>
<td class='forumheader3'>".select_day_start($pref['eventpost_weekstart'])."</td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_LAN_117."<br /></td>
<td style='width:60%;vertical-align:top;' class='forumheader3'>
<td class='forumheader3'>".EC_LAN_117."<br /></td>
<td class='forumheader3'>
<select name='eventpost_lenday' class='tbox'>
<option value='1' ".($pref['eventpost_lenday']=='1'?" selected='selected' ":"")." > 1 </option>
<option value='2' ".($pref['eventpost_lenday']=='2'?" selected='selected' ":"")." > 2 </option>
@@ -666,8 +877,8 @@ $text .= "
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_LAN_118."<br /></td>
<td style='width:60%;vertical-align:top;' class='forumheader3'>
<td class='forumheader3'>".EC_LAN_118."<br /></td>
<td class='forumheader3'>
<select name='eventpost_dateformat' class='tbox'>
<option value='my' ".($pref['eventpost_dateformat']=='my'?" selected='selected' ":"")." >".EC_LAN_119."</option>
<option value='ym' ".($pref['eventpost_dateformat']=='ym'?" selected='selected' ":"")." >".EC_LAN_120."</option>
@@ -676,29 +887,35 @@ $text .= "
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A133."<br /></td>
<td style='width:60%;vertical-align:top;' class='forumheader3'>
<td class='forumheader3'>".EC_ADLAN_A133."<br /></td>
<td class='forumheader3'>
<select name='eventpost_datedisplay' class='tbox'>
<option value='1' ".($pref['eventpost_datedisplay']=='1'?" selected='selected' ":"")." > yyyy-mm-dd </option>
<option value='1' ".($pref['eventpost_datedisplay']=='1'?" selected='selected' ":"")." > yyyy-mm-dd</option>
<option value='2' ".($pref['eventpost_datedisplay']=='2'?" selected='selected' ":"")." > dd-mm-yyyy</option>
<option value='3' ".($pref['eventpost_datedisplay']=='3'?" selected='selected' ":"")." > mm-dd-yyyy</option>
<option value='4' ".($pref['eventpost_datedisplay']=='4'?" selected='selected' ":"")." > yyyy.mm.dd</option>
<option value='5' ".($pref['eventpost_datedisplay']=='5'?" selected='selected' ":"")." > dd.mm.yyyy</option>
<option value='6' ".($pref['eventpost_datedisplay']=='6'?" selected='selected' ":"")." > mm.dd.yyyy</option>
<option value='7' ".($pref['eventpost_datedisplay']=='7'?" selected='selected' ":"")." > yyyy/mm/dd</option>
<option value='8' ".($pref['eventpost_datedisplay']=='8'?" selected='selected' ":"")." > dd/mm/yyyy</option>
<option value='9' ".($pref['eventpost_datedisplay']=='9'?" selected='selected' ":"")." > mm/dd/yyyy</option>
</select>
</td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A138."</td>
<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='checkbox' name='eventpost_fivemins' value='1' ".($pref['eventpost_fivemins']==1?" checked='checked' ":"")." />&nbsp;&nbsp;<span class='smalltext'><em>".EC_ADLAN_A139."</em></span>
<td class='forumheader3'>".EC_ADLAN_A138."</td>
<td class='forumheader3'><input class='tbox' type='checkbox' name='eventpost_fivemins' value='1' ".($pref['eventpost_fivemins']==1?" checked='checked' ":"")." />&nbsp;&nbsp;<span class='smalltext'><em>".EC_ADLAN_A139."</em></span>
</td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A122."<br />
<td class='forumheader3'>".EC_ADLAN_A122."<br />
<span class='smalltext'><em>".EC_ADLAN_A124."</em></span>".$ecal_class->time_string($ecal_class->time_now)."<br />
<span class='smalltext'><em>".EC_ADLAN_A125."</em></span>".$ecal_class->time_string($ecal_class->site_timedate)."<br />
<span class='smalltext'><em>".EC_ADLAN_A126."</em></span>".$ecal_class->time_string($ecal_class->user_timedate)."
</td>
<td style='width:60%;vertical-align:top;' class='forumheader3'>
<td class='forumheader3'>
<select name='eventpost_caltime' class='tbox'>
<option value='1' ".($pref['eventpost_caltime']=='1'?" selected='selected' ":"")." > Server </option>
<option value='2' ".($pref['eventpost_caltime']=='2'?" selected='selected' ":"")." > Site </option>
@@ -708,12 +925,13 @@ $text .= "
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A123."<br />
<td class='forumheader3'>".EC_ADLAN_A123."<br />
<span class='smalltext'><em>".EC_ADLAN_A127."</em></span>
</td>
<td style='width:60%;vertical-align:top;' class='forumheader3'>
<td class='forumheader3'>
<select name='eventpost_timedisplay' class='tbox'>
<option value='1' ".($pref['eventpost_timedisplay']=='1'?" selected='selected' ":"")." > 24-hour </option>
<option value='1' ".($pref['eventpost_timedisplay']=='1'?" selected='selected' ":"")." > 24-hour hhmm </option>
<option value='4' ".($pref['eventpost_timedisplay']=='4'?" selected='selected' ":"")." > 24-hour hh:mm </option>
<option value='2' ".($pref['eventpost_timedisplay']=='2'?" selected='selected' ":"")." > 12-hour </option>
<option value='3' ".($pref['eventpost_timedisplay']=='3'?" selected='selected' ":"")." > Custom </option>
</select>
@@ -723,10 +941,10 @@ $text .= "
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A166."<br />
<td class='forumheader3'>".EC_ADLAN_A166."<br />
<span class='smalltext'><em>".EC_ADLAN_A169."</em></span>
</td>
<td style='width:60%;vertical-align:top;' class='forumheader3'>
<td class='forumheader3'>
<select name='eventpost_dateevent' class='tbox'>
<option value='1' ".($pref['eventpost_dateevent']=='1'?" selected='selected' ":"")." > dayofweek day month yyyy </option>
<option value='2' ".($pref['eventpost_dateevent']=='2'?" selected='selected' ":"")." > dyofwk day mon yyyy </option>
@@ -739,10 +957,10 @@ $text .= "
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A167."<br />
<td class='forumheader3'>".EC_ADLAN_A167."<br />
<span class='smalltext'><em>".EC_ADLAN_A170."</em></span>
</td>
<td style='width:60%;vertical-align:top;' class='forumheader3'>
<td class='forumheader3'>
<select name='eventpost_datenext' class='tbox'>
<option value='1' ".($pref['eventpost_datenext']=='1'?" selected='selected' ":"")." > dd month </option>
<option value='2' ".($pref['eventpost_datenext']=='2'?" selected='selected' ":"")." > dd mon </option>
@@ -756,32 +974,43 @@ $text .= "
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A95."</td>
<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='checkbox' name='eventpost_asubs' value='1' ".($pref['eventpost_asubs']==1?" checked='checked' ":"")." />&nbsp;&nbsp;<span class='smalltext'><em>".EC_ADLAN_A96."</em></span>
<td class='forumheader3'>".EC_ADLAN_A193."<br /></td>
<td class='forumheader3'>
<select name='eventpost_printlists' class='tbox'>
<option value='0' ".($pref['eventpost_printlists']=='0'?" selected='selected' ":"")." >". EC_ADLAN_A194." </option>
<option value='1' ".($pref['eventpost_printlists']=='1'?" selected='selected' ":"")." >".EC_ADLAN_A195." </option>
<option value='2' ".($pref['eventpost_printlists']=='2'?" selected='selected' ":"")." >".EC_ADLAN_A196." </option>
</select>
</td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A92."</td>
<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='text' name='eventpost_mailfrom' size='60' value='".$pref['eventpost_mailfrom']."' maxlength='100' />
<td class='forumheader3'>".EC_ADLAN_A95."</td>
<td class='forumheader3'><input class='tbox' type='checkbox' name='eventpost_asubs' value='1' ".($pref['eventpost_asubs']==1?" checked='checked' ":"")." />&nbsp;&nbsp;<span class='smalltext'><em>".EC_ADLAN_A96."</em></span>
</td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A91."</td>
<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='text' name='eventpost_mailsubject' size='60' value='".$pref['eventpost_mailsubject']."' maxlength='100' />
<td class='forumheader3'>".EC_ADLAN_A92."</td>
<td class='forumheader3'><input class='tbox' type='text' name='eventpost_mailfrom' size='60' value='".$pref['eventpost_mailfrom']."' maxlength='100' />
</td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A93."</td>
<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='text' name='eventpost_mailaddress' size='60' value='".$pref['eventpost_mailaddress']."' maxlength='100' />
<td class='forumheader3'>".EC_ADLAN_A91."</td>
<td class='forumheader3'><input class='tbox' type='text' name='eventpost_mailsubject' size='60' value='".$pref['eventpost_mailsubject']."' maxlength='100' />
</td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A114."<br /></td>
<td style='width:60%;vertical-align:top;' class='forumheader3'>
<td class='forumheader3'>".EC_ADLAN_A93."</td>
<td class='forumheader3'><input class='tbox' type='text' name='eventpost_mailaddress' size='60' value='".$pref['eventpost_mailaddress']."' maxlength='100' />
</td>
</tr>
<tr>
<td class='forumheader3'>".EC_ADLAN_A114."<br /></td>
<td class='forumheader3'>
<select name='eventpost_emaillog' class='tbox'>
<option value='0' ".($pref['eventpost_emaillog']=='0'?" selected='selected' ":"")." >". EC_ADLAN_A87." </option>
<option value='1' ".($pref['eventpost_emaillog']=='1'?" selected='selected' ":"")." >".EC_ADLAN_A115." </option>
@@ -795,7 +1024,7 @@ $text .= "
</form>
</div>";
$ns->tablerender("<div style='text-align:center'>".EC_LAN_78."</div>", $text);
$ns->tablerender("<div style='text-align:center'>".EC_ADLAN_1." - ".EC_LAN_78."</div>", $text);
}
@@ -821,6 +1050,9 @@ function admin_config_adminmenu()
$var['maint']['text'] = EC_ADLAN_A141;
$var['maint']['link'] ="admin_config.php?maint";
$var['subs']['text'] = EC_ADLAN_A173;
$var['subs']['link'] ="admin_config.php?subs";
show_admin_menu(EC_ADLAN_A12, $action, $var);
}

View File

@@ -11,17 +11,16 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/calendar.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:46 $
| $Author: mcfly_e107 $
|
| 11.11.06 - steved - mods for next CVS release
| $Revision: 1.2 $
| $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");
require_once(e_PLUGIN."calendar_menu/calendar_shortcodes.php");
if (isset($_POST['viewallevents']))
{
@@ -35,8 +34,12 @@ if (isset($_POST['subs']))
{
Header("Location: " . e_PLUGIN . "calendar_menu/subscribe.php");
}
if (isset($_POST['printlists']))
{
Header("Location: " . e_PLUGIN . "calendar_menu/ec_pf_page.php");
}
@include_lan(e_PLUGIN."calendar_menu/languages/".e_LANGUAGE.".php");
include_lan(e_PLUGIN."calendar_menu/languages/".e_LANGUAGE.".php");
define("PAGE_NAME", EC_LAN_121);
require_once('ecal_class.php');
@@ -51,21 +54,14 @@ else
require(e_PLUGIN."calendar_menu/calendar_template.php");
}
$num = (isset($_POST['num']) && $_POST['num'] ? $_POST['num'] : "");
$category_filter = "";
if ((isset($_POST['event_cat_ids']) && $_POST['event_cat_ids'] != "all"))
{
$category_filter = " AND (e.event_category = '".$_POST['event_cat_ids']."') ";
}
$cat_filter = intval(varset($_POST['event_cat_ids'],0));
require_once(HEADERF);
// get current date information ---------------------------------------------------------------------
// get date within area to display
$qs = explode(".", e_QUERY);
if($qs[0] == "")
if(varset($qs[0],'') == "")
{ // Show current month
$datearray = $ecal_class->cal_date;
}
@@ -73,52 +69,51 @@ else
{ // Get date from query
$datearray = getdate($qs[0]);
}
$month = $datearray['mon'];
$year = $datearray['year'];
// set up arrays for calender display ------------------------------------------------------------------
if($pref['eventpost_weekstart'] == 'sun') {
$week = Array(EC_LAN_25, EC_LAN_19, EC_LAN_20, EC_LAN_21, EC_LAN_22, EC_LAN_23, EC_LAN_24);
} else {
$week = Array(EC_LAN_19, EC_LAN_20, EC_LAN_21, EC_LAN_22, EC_LAN_23, EC_LAN_24, EC_LAN_25);
// Note: A lot of the following variables are used within the shortcodes
$month = $datearray['mon']; // Number of month being shown
$year = $datearray['year']; // Number of year being shown
$monthstart = mktime(0, 0, 0, $month, 1, $year); // Start of month to be shown
$monthend = mktime(0, 0, 0, $month + 1, 1, $year) - 1; // End of month to be shown
$prevmonth = $month-1;
$prevyear = $year;
if ($prevmonth == 0)
{
$prevmonth = 12;
$prevyear = $year-1;
}
$previous = mktime(0, 0, 0, $prevmonth, 1, $prevyear); // Used by nav
$nextmonth = $month + 1;
$nextyear = $year;
if ($nextmonth == 13)
{
$nextmonth = 1;
$nextyear = $year + 1;
}
$next = mktime(0, 0, 0, $nextmonth, 1, $nextyear);
$py = $year-1; // Number of previous year for nav
$prevlink = mktime(0, 0, 0, $month, 1, $py);
$ny = $year + 1; // Number of next year for nav
$nextlink = mktime(0, 0, 0, $month, 1, $ny);
$prop = gmmktime(0, 0, 0, $month, 1, $year); // Sets start date for new event entry
$nowmonth = $ecal_class->cal_date['mon'];
$nowyear = $ecal_class->cal_date['year'];
$nowday = $ecal_class->cal_date['mday'];
// set up arrays for calendar display ------------------------------------------------------------------
// $months is used in the navigator buttons. $monthabb is used for month list
$months = Array(EC_LAN_0, EC_LAN_1, EC_LAN_2, EC_LAN_3, EC_LAN_4, EC_LAN_5, EC_LAN_6, EC_LAN_7, EC_LAN_8, EC_LAN_9, EC_LAN_10, EC_LAN_11);
$monthabb = Array(EC_LAN_JAN, EC_LAN_FEB, EC_LAN_MAR, EC_LAN_APR, EC_LAN_MAY, EC_LAN_JUN, EC_LAN_JUL, EC_LAN_AUG, EC_LAN_SEP, EC_LAN_OCT, EC_LAN_NOV, EC_LAN_DEC);
$days = array(EC_LAN_DAY_1, EC_LAN_DAY_2, EC_LAN_DAY_3, EC_LAN_DAY_4, EC_LAN_DAY_5, EC_LAN_DAY_6, EC_LAN_DAY_7, EC_LAN_DAY_8, EC_LAN_DAY_9, EC_LAN_DAY_10, EC_LAN_DAY_11, EC_LAN_DAY_12, EC_LAN_DAY_13, EC_LAN_DAY_14, EC_LAN_DAY_15, EC_LAN_DAY_16, EC_LAN_DAY_17, EC_LAN_DAY_18, EC_LAN_DAY_19, EC_LAN_DAY_20, EC_LAN_DAY_21, EC_LAN_DAY_22, EC_LAN_DAY_23, EC_LAN_DAY_24, EC_LAN_DAY_25, EC_LAN_DAY_26, EC_LAN_DAY_27, EC_LAN_DAY_28, EC_LAN_DAY_29, EC_LAN_DAY_30, EC_LAN_DAY_31);
// show events-------------------------------------------------------------------------------------------
$monthstart = mktime(0, 0, 0, $month, 1, $year); // Start of month to be shown
$firstdayarray = getdate($monthstart);
$monthend = mktime(0, 0, 0, $month + 1, 1, $year) - 1; // End of month to be shown
$prevmonth = ($month-1);
$prevyear = $year;
if ($prevmonth == 0)
{
$prevmonth = 12;
$prevyear = ($year-1);
}
$previous = mktime(0, 0, 0, $prevmonth, 1, $prevyear); // Used by nav
$nextmonth = ($month + 1);
$nextyear = $year;
if ($nextmonth == 13)
{
$nextmonth = 1;
$nextyear = ($year + 1);
}
$next = mktime(0, 0, 0, $nextmonth, 1, $nextyear);
$py = $year-1;
$prevlink = mktime(0, 0, 0, $month, 1, $py);
$ny = $year + 1;
$nextlink = mktime(0, 0, 0, $month, 1, $ny);
$prop = mktime(0, 0, 0, $month, 1, $year); // Sets start date for new event entry
$nowmonth = $ecal_class->cal_date['mon'];
$nowyear = $ecal_class->cal_date['year'];
$nowday = $ecal_class->cal_date['mday'];
//-------------------------------------------------
// Start calculating text to display
//-------------------------------------------------
// time switch buttons
$cal_text = $tp -> parseTemplate($CALENDAR_TIME_TABLE, FALSE, $calendar_shortcodes);
@@ -126,86 +121,59 @@ $cal_text = $tp -> parseTemplate($CALENDAR_TIME_TABLE, FALSE, $calendar_shortcod
// navigation buttons
$nav_text = $tp -> parseTemplate($CALENDAR_NAVIGATION_TABLE, FALSE, $calendar_shortcodes);
// get events from selected
$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_id != ''
AND ((e.event_start >= ".intval($monthstart)." AND e.event_start <= ".intval($monthend).")
OR (e.event_end >= ".intval($monthstart)." AND e.event_end <= ".intval($monthend).")
OR (e.event_start <= ".intval($monthstart)." AND e.event_end >= ".intval($monthend).")
OR (e.event_recurring = '1' AND e.event_rec_y = ".intval($month).")) {$category_filter}
{$ecal_class->extra_query}
ORDER BY e.event_start";
// We'll need virtually all of the event-related fields, so get them regardless. Just cut back on category fields
$ev_list = $ecal_class->get_events($monthstart, $monthend, FALSE, $cat_filter, TRUE, '*', 'event_cat_name,event_cat_icon');
if ($sql->db_Select_gen($qry))
{
while ($row = $sql->db_Fetch())
// We create an array $events[] which has a 'primary' index of each day of the current month - 1..31 potentially
// For each day there is then a sub-array entry for each event
// Note that the new class-based retrieval adds an 'is_recent' flag to the data if changed according to the configured criteria
$events = array();
foreach ($ev_list as $row)
{
// check for recurring events in this month
if($row['event_recurring']=='1')
$row['startofevent'] = TRUE; // This sets 'large print' and so on for the first day of an event
// check for recurring events in this month (could also use is_array($row['event_start']) as a test)
if($row['event_recurring'] != '0')
{ // There could be several dates for the same event, if its a daily/weekly event
$t_start = $row['event_start'];
foreach ($t_start as $ev_start)
{
if ($month == $row['event_rec_y'])
{ // Change it into an event that happens today
$row['event_start'] = mktime(0,0,0,$row['event_rec_y'],$row['event_rec_m'],$year);
$row['event_end'] = $row['event_start'];
// Need to save event, copy marker for date
$row['event_start'] = $ev_start;
$events[date('j',$ev_start)][] = $row;
}
}
else
{ // Effectively create a null event
$row['event_start'] = 0;
$row['event_end'] = 0;
}
}
{ // Its a 'normal' event
$tmp = date('j',$row['event_start']); // Day of month for start
$tmp2 = date('j',$row['event_end']); // Day of month for end
$evf = getdate($row['event_start']);
$tmp = $evf['mday']; // Day of month for start
$eve = getdate($row['event_end']);
$tmp2 = $eve['mday']; // Day of month for end
$tmp3 = date("t", $monthstart); // number of days in this month
if ((($ecal_class->max_recent_show != 0) && (time() - $row['event_datestamp']) <= $ecal_class->max_recent_show)) $row['is_recent'] = TRUE;
//1) start in month, end in month
if(($row['event_start']>=$monthstart && $row['event_start']<=$monthend) && $row['event_end']<=$monthend)
{
if(($row['event_start']>=$monthstart) && ($row['event_start']<=$monthend))
{ // Start within month
$events[$tmp][] = $row;
for ($c=($tmp+1); $c<($tmp2+1); $c++)
$tmp++;
if ($row['event_end']>$monthend)
{ // End outside month
$tmp2 = date("t", $monthstart); // number of days in this month
}
}
else
{ // Start before month
$tmp = 1;
if ($row['event_end']>$monthend)
{ // End outside month
$tmp2 = date("t", $monthstart); // number of days in this month
}
}
// Now put in markers for all 'non-start' days within current month
$row['startofevent'] = FALSE;
for ($c= $tmp; $c<=$tmp2; $c++)
{
$row['event_true_end'][$c] = ($c!=$tmp2 ? 1 : 2);
$events[$c][] = $row;
}
}
}
//2) start in month, end after month
}
elseif(($row['event_start']>=$monthstart && $row['event_start']<=$monthend) && $row['event_end']>=$monthend)
{
$events[$tmp][] = $row;
for ($c=($tmp+1); $c<=$tmp3; $c++)
{
$row['event_true_end'][$c] = 1;
$events[$c][] = $row;
}
//3) start before month, end in month
}
elseif($row['event_start']<=$monthstart && ($row['event_end']>=$monthstart && $row['event_end']<=$monthend))
{
for ($c=1; $c<=$tmp2; $c++)
{
$row['event_true_end'][$c] = ($c!=$tmp2 ? 1 : 2);
$events[$c][] = $row;
}
//4) start before month, end after month
}
elseif($row['event_start']<=$monthstart && $row['event_end']>=$monthend)
{
for ($c=1; $c<=$tmp3; $c++){
$row['event_true_end'][$c] = 1;
$events[$c][] = $row;
}
}
}
}
// ****** CAUTION - the category dropdown also used $sql object - take care to avoid interference!
@@ -216,79 +184,66 @@ $numberdays = date("t", $start); // number of days in this month
$text = "";
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_START, FALSE, $calendar_shortcodes);
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_HEADER_START, FALSE, $calendar_shortcodes);
foreach($week as $day)
for ($i = 0; $i < 7; $i++)
{
$day = $ecal_class->day_offset_string($i);
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_HEADER, FALSE, $calendar_shortcodes);
}
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_HEADER_END, FALSE, $calendar_shortcodes);
$calmonth = $datearray['mon'];
$calday = $datearray['mday'];
$calyear = $datearray['year'];
if ($pref['eventpost_weekstart'] == 'mon')
{
$firstdayoffset = ($firstdayarray['wday'] == 0 ? $firstdayarray['wday']+6 : $firstdayarray['wday']-1);
}
else
{
$firstdayoffset = $firstdayarray['wday'] ;
}
// Calculate number of days to skip before 'real' days on first line of calendar
$firstdayoffset = date('w',$start) - $ecal_class->ec_first_day_of_week;
if ($firstdayoffset < 0) $firstdayoffset+= 7;
for ($c=0; $c<$firstdayoffset; $c++)
{
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_DAY_NON, FALSE, $calendar_shortcodes);
}
$loop = $firstdayoffset;
for ($c = 1; $c <= $numberdays; $c++)
{
$dayarray = getdate($start + (($c-1) * 86400));
$stopp = mktime(24, 0, 0, $calmonth, $c, $calyear);
$startt = mktime(0, 0, 0, $calmonth, $c, $calyear);
{ // Loop through the number of days in this month
$startt = $start; // Used by shortcodes - start of current day
$stopp = $start + 86399; // End of current day
$got_ev = array_key_exists($c, $events) && is_array($events[$c]) && count($events[$c]) > 0; // Flag set if events today
// Highlight the current day.
if ($dayarray['mon'] == $calmonth)
{
if ($nowday == $c && $calmonth == $nowmonth && $calyear == $nowyear)
{
//today
if ($nowday == $c && $month == $nowmonth && $year == $nowyear)
{ //today
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_DAY_TODAY, FALSE, $calendar_shortcodes);
}
elseif(isset($events[$c]) && is_array($events[$c]) && !empty($events[$c]) && count($events[$c]) > 0)
{
//day has events
elseif ($got_ev)
{ //day has events
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_DAY_EVENT, FALSE, $calendar_shortcodes);
}
else
{
// no events and not today
{ // no events and not today
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_DAY_EMPTY, FALSE, $calendar_shortcodes);
}
// if there are events then list them
if (array_key_exists($c, $events))
if ($got_ev)
{
foreach($events[$c] as $ev)
{
//if ($event_true_end[$c][$a]){
if(isset($ev['event_true_end']) && $ev['event_true_end'])
{
//$ev['indicat'] = ($ev['event_true_end']==1 ? "->" : "|");
$ev['indicat'] = "";
$ev['imagesize'] = "4";
$ev['fulltopic'] = FALSE;
$ev['startofevent'] = FALSE;
}
else
if ($ev['startofevent'])
{
$ev['indicat'] = "";
$ev['imagesize'] = "8";
$ev['fulltopic'] = TRUE;
$ev['startofevent'] = TRUE;
}
else
{
$ev['indicat'] = "";
$ev['imagesize'] = "4";
$ev['fulltopic'] = FALSE;
}
$text .= $tp -> parseTemplate($CALENDAR_SHOWEVENT, FALSE, $calendar_shortcodes);
}
}
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_DAY_END, FALSE, $calendar_shortcodes);
}
$loop++;
if ($loop == 7)
{
@@ -298,21 +253,24 @@ for ($c = 1; $c <= $numberdays; $c++)
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_WEEKSWITCH, FALSE, $calendar_shortcodes);
}
}
$start += 86400;
}
//remainder cells to end the row properly with empty cells
if($loop!=0)
{
$remainder = 7-$loop;
for ($c=0; $c<$remainder; $c++)
for ($c=$loop; $c<7; $c++)
{
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_DAY_NON, FALSE, $calendar_shortcodes);
}
}
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_END, FALSE, $calendar_shortcodes);
$caption = EC_LAN_79; // "Calendar View";
$nav = $cal_text . $nav_text . $text;
$ns->tablerender($caption, $nav);
$ns->tablerender(EC_LAN_79, $cal_text . $nav_text . $text);
// Claim back memory from key variables
unset($ev_list);
unset($text);
require_once(FOOTERF);

View File

@@ -11,39 +11,25 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/calendar_menu.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 $
|
| 22.10.06 steved - Various tidying up, additional options supported
| 24.10.06 steved - templated, various cleaning up
| 06.11.06 steved - template file integrated with other calendar files
| 09.11.06 steved - Caching added, other mods to templates etc
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
$ecal_dir = e_PLUGIN . "calendar_menu/";
require_once($ecal_dir.'ecal_class.php');
$ecal_class = new ecal_class;
if (!isset($ecal_class) || !is_object($ecal_class)) $ecal_class = new ecal_class;
$cache_tag = "nq_event_cal_cal";
// See if the page is already in the cache
if($cacheData = $e107cache->retrieve($cache_tag, $ecal_class->max_cache_time))
{
echo $cacheData;
return;
}
include_lan($ecal_dir."languages/".e_LANGUAGE.".php");
global $ecal_dir, $tp;
if (is_readable(THEME."calendar_template.php"))
{
require(THEME."calendar_template.php");
@@ -52,87 +38,55 @@ else
{ // Needs to be require - otherwise not loaded if two menus use it
require($ecal_dir."calendar_template.php");
}
$show_recurring = TRUE; // Could be pref later
$cat_filter = ''; // Could be another pref later.
$cal_datearray = $ecal_class->cal_date;
$cal_current_month = $cal_datearray['mon'];
$cal_current_year = $cal_datearray['year'];
$numberdays = date("t", $ecal_class->cal_date); // number of days in this month
$numberdays = date("t", $ecal_class->cal_timedate); // number of days in this month
$cal_monthstart = mktime(0, 0, 0, $cal_current_month, 1, $cal_current_year); // Time stamp for first day of month
$cal_firstdayarray = getdate($cal_monthstart);
$cal_monthend = mktime(0, 0, 0, $cal_current_month + 1, 1, $cal_current_year) -1; // Time stamp for last day of month
$cal_qry = "SELECT e.event_rec_m, e.event_rec_y, e.event_start, e.event_end, e.event_datestamp, ec.*
FROM #event as e LEFT JOIN #event_cat as ec ON e.event_category = ec.event_cat_id
WHERE ((e.event_start >= {$cal_monthstart} AND e.event_start <= {$cal_monthend}) OR (e.event_rec_y = {$cal_current_month}))
{$ecal_class->extra_query} order by e.event_start";
//$cal_thismonth = $cal_datearray['mon'];
$cal_thisday = $cal_datearray['mday']; // Today
$cal_events = array();
$cal_titles = array();
$cal_recent = array();
$cal_totev = 0;
if ($cal_totev = $sql->db_Select_gen($cal_qry))
{
while ($cal_row = $sql->db_Fetch())
$ev_list = $ecal_class->get_events($cal_monthstart, $cal_monthend, FALSE, $cat_filter, $show_recurring,
'event_start, event_thread, event_title, event_recurring, event_allday', 'event_cat_icon');
$cal_totev = count($ev_list);
foreach ($ev_list as $cal_row)
{
if ($cal_row['event_rec_y'] == $cal_current_month)
{ // Recurring events
$cal_start_day = $cal_row['event_rec_m'];
}
else
{ // 'normal' events
$cal_tmp = getdate($cal_row['event_start']);
if ($cal_tmp['mon'] == $cal_current_month)
if (is_array($cal_row['event_start'])) $temp = $cal_row['event_start']; else $temp = array($cal_row['event_start']);
foreach ($temp as $ts)
{
$cal_start_day = $cal_tmp['mday'];
}
else
{
$cal_start_day = 1;
}
}
$cal_start_day = date('j',$ts); // Day of month for start
// Mark start day of each event
$cal_events[$cal_start_day][] = $cal_row['event_cat_icon']; // Will be overwritten if several events on same day
if ((($ecal_class->max_recent_show != 0) && (time() - $cal_row['event_datestamp']) <= $ecal_class->max_recent_show)) $cal_events[$cal_start_day]['is_recent'] = TRUE;
$cal_events[$cal_start_day][] = $cal_row['event_cat_icon']; // Only first is actually used
if (isset($cal_row['is_recent'])) $cal_recent[$cal_start_day] = TRUE;
$cal_titles[$cal_start_day][] = $cal_row['event_title']; // In case titles displayed on mouseover
}
}
if ($pref['eventpost_weekstart'] == 'sun')
{
$cal_week = array(EC_LAN_25, EC_LAN_19, EC_LAN_20, EC_LAN_21, EC_LAN_22, EC_LAN_23, EC_LAN_24);
}
else
{
$cal_week = array(EC_LAN_19, EC_LAN_20, EC_LAN_21, EC_LAN_22, EC_LAN_23, EC_LAN_24, EC_LAN_25);
}
}
// set up month array for calendar display
$cal_months = array(EC_LAN_0, EC_LAN_1, EC_LAN_2, EC_LAN_3, EC_LAN_4, EC_LAN_5, EC_LAN_6, EC_LAN_7, EC_LAN_8, EC_LAN_9, EC_LAN_10, EC_LAN_11);
$calendar_title = "<a class='forumlink' href='".e_PLUGIN."calendar_menu/";
if ($pref['eventpost_menulink'] == 1)
{
$calendar_title .= "calendar.php' >";
}
else
{
$calendar_title .= "event.php' >";
}
if ($pref['eventpost_dateformat'] == 'my')
{
$calendar_title .= $cal_months[$cal_datearray['mon']-1] ." ". $cal_current_year . "</a>";
$calendar_title = $cal_months[$cal_current_month-1] ." ". $cal_current_year;
}
else
{
$calendar_title .= $cal_current_year ." ". $cal_months[$cal_datearray['mon']-1] . "</a>";
$calendar_title = $cal_current_year ." ". $cal_months[$cal_current_month-1];
}
switch ($pref['eventpost_menulink'])
{
case 0 : $calendar_title = "<a {$CALENDAR_MENU_HDG_LINK_CLASS} href='".e_PLUGIN."calendar_menu/event.php' >".$calendar_title."</a>";
break;
case 1 : $calendar_title = "<a {$CALENDAR_MENU_HDG_LINK_CLASS} href='".e_PLUGIN."calendar_menu/calendar.php' >".$calendar_title."</a>";
break;
default : ;
}
$cal_text = $CALENDAR_MENU_START;
if ($pref['eventpost_showeventcount']=='1')
{
if ($cal_totev)
@@ -145,68 +99,64 @@ if ($pref['eventpost_showeventcount']=='1')
}
$cal_text .= "<br /><br />";
}
$cal_start = $cal_monthstart; // First day of month as time stamp
// Start the table
$cal_text .= $CALENDAR_MENU_TABLE_START;
// Open header row
$cal_text .= $CALENDAR_MENU_HEADER_START;
// Now do the headings
foreach($cal_week as $cal_day)
// Now do the headings (days of week)
for ($i = 0; $i < 7; $i++)
{
$cal_day = $ecal_class->day_offset_string($i);
$cal_text .= $CALENDAR_MENU_HEADER_FRONT;
$cal_text .= substr($cal_day, 0, $pref['eventpost_lenday']);
// $cal_text .= substr($cal_day, 0, $pref['eventpost_lenday']);
$cal_text .= substr($cal_day, 0, 1); // Unlikely to have room for more than 1 letter
$cal_text .= $CALENDAR_MENU_HEADER_BACK;
}
$cal_text .= $CALENDAR_MENU_HEADER_END; // Close off header row, open first date row
$cal_thismonth = $cal_datearray['mon'];
$cal_thisday = $cal_datearray['mday']; // Today
if ($pref['eventpost_weekstart'] == 'mon')
{
$firstdayoffset = ($cal_firstdayarray['wday'] == 0 ? $cal_firstdayarray['wday'] + 6 : $cal_firstdayarray['wday']-1);
}
else
{
$firstdayoffset = $cal_firstdayarray['wday'];
}
// Calculate number of days to skip before 'real' days on first line of calendar
$firstdayoffset = date('w',$cal_start) - $ecal_class->ec_first_day_of_week;
if ($firstdayoffset < 0) $firstdayoffset+= 7;
for ($cal_c = 0; $cal_c < $firstdayoffset; $cal_c++)
{
$cal_text .= $CALENDAR_MENU_DAY_NON;
}
$cal_loop = $firstdayoffset;
// Now do the days of the month
for($cal_c = 1; $cal_c <= 31; $cal_c++)
for($cal_c = 1; $cal_c <= $numberdays; $cal_c++)
{ // Four cases to decode:
// 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)
$cal_dayarray = getdate($cal_start + (($cal_c-1) * 86400));
// 2 - Some other day, no events
// 3 - Today with events
// 4 - Some other day with events
// 5 - Today with recently added events
// 6 - Some other day with recently added events
// $cal_dayarray = getdate($cal_start + (($cal_c-1) * 86400));
$cal_css = 2; // The default - not today, no events
if ($cal_dayarray['mon'] == $cal_thismonth)
{ // Dates match for this month
$cal_img = $cal_c; // Default 'image' is the day of the month
$cal_event_count = 0;
$title = "";
if ($cal_thisday == $cal_c) $cal_css = 1;
$cal_linkut = mktime(0 , 0 , 0 , $cal_dayarray['mon'], $cal_c, $cal_datearray['year']).".one"; // ALways need "one"
$cal_linkut = mktime(0 , 0 , 0 , $cal_current_month, $cal_c, $cal_current_year).".one"; // Always need "one"
if (array_key_exists($cal_c, $cal_events))
{
$cal_event_icon = e_PLUGIN . "calendar_menu/images/" . $cal_events[$cal_c]['0'];
{ // There are events today
$cal_event_icon = "calendar_menu/images/" . $cal_events[$cal_c]['0']; // Icon file could be NULL
$cal_event_count = count($cal_events[$cal_c]); // See how many events today
if (!empty($cal_events[$cal_c]) && is_file($cal_event_icon))
if ($cal_event_count)
{ // Show icon if it exists
$cal_css += 2; // Gives 3 for today, 4 for other day
if (isset($pref['eventpost_showmouseover']) && ($pref['eventpost_showmouseover'] == 1))
{
$cal_ins = " title='";
foreach ($cal_titles[$cal_c] as $cur_title)
{ // New line would be better, but doesn't get displayed
$title .= $cal_ins.$cur_title;
$cal_ins = ", ";
}
$title .= "'";
}
else
{
if ($cal_event_count == 1)
{
$title = " title='1 ".EC_LAN_135."' ";
@@ -215,9 +165,10 @@ for($cal_c = 1; $cal_c <= 31; $cal_c++)
{
$title = " title='{$cal_event_count} " . EC_LAN_106 . "' ";
}
$cal_img = "<img style='border:0' src='{$cal_event_icon}' alt='' />";
}
if (is_file(e_PLUGIN.$cal_event_icon)) $cal_img = "<img style='border:0' src='".e_PLUGIN_ABS.$cal_event_icon."' alt='' />";
//height='10' width='10'
if (isset($cal_events[$cal_c]['is_recent']) && $cal_events[$cal_c]['is_recent'])
if (isset($cal_recent[$cal_c]) && $cal_recent[$cal_c])
{
$cal_css += 2;
}
@@ -234,9 +185,7 @@ for($cal_c = 1; $cal_c <= 31; $cal_c++)
$cal_text .= $CALENDAR_MENU_WEEKSWITCH;
}
}
}
}
if ($cal_loop != 0)
{
for($cal_a = ($cal_loop + 1); $cal_a <= 7; $cal_a++)
@@ -246,12 +195,11 @@ for($cal_a = ($cal_loop + 1); $cal_a <= 7; $cal_a++)
}
// Close table
$cal_text .= $CALENDAR_MENU_END;
// Now handle the data, cache as well
ob_start(); // Set up a new output buffer
$ns->tablerender($calendar_title, $cal_text, 'calendar_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);
unset($cal_text);
?>

View File

@@ -11,11 +11,10 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/calendar_shortcodes.php,v $
| $Revision: 1.2 $
| $Date: 2006-12-07 15:41:50 $
| $Author: sweetas $
| $Revision: 1.3 $
| $Date: 2007-07-13 19:37:52 $
| $Author: e107steved $
|
| 10.11.06 - mods for next CVS release
+----------------------------------------------------------------------------+
*/
@@ -24,180 +23,165 @@ include_once(e_HANDLER.'shortcode_handler.php');
$calendar_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__);
/*
// TIME SWITCH BUTTONS ------------------------------------------------
SC_BEGIN PREV_MONTH
global $PREV_MONTH, $previous, $months, $prevmonth;
SC_BEGIN EC_PREV_MONTH
global $previous, $months, $prevmonth;
return "<a href='".e_SELF."?".$previous."'>&lt;&lt; ".$months[($prevmonth-1)]."</a>";
SC_END
SC_BEGIN NEXT_MONTH
global $NEXT_MONTH, $next, $months, $nextmonth;
SC_BEGIN EC_NEXT_MONTH
global $next, $months, $nextmonth;
return "<a href='".e_SELF."?".$next."'> ".$months[($nextmonth-1)]." &gt;&gt;</a>";
SC_END
SC_BEGIN CURRENT_MONTH
global $CURRENT_MONTH, $pref, $months, $month, $year;
if($pref['eventpost_dateformat'] == 'my') {
$CURRENT_MONTH = $months[($month-1)]." ".$year;
} else {
$CURRENT_MONTH = $year." ".$months[($month-1)];
SC_BEGIN EC_CURRENT_MONTH
global $EC_CURRENT_MONTH, $pref, $months, $month, $year;
if($pref['eventpost_dateformat'] == 'my')
{
$EC_CURRENT_MONTH = $months[($month-1)]." ".$year;
}
return $CURRENT_MONTH;
else
{
$EC_CURRENT_MONTH = $year." ".$months[($month-1)];
}
return $EC_CURRENT_MONTH;
SC_END
SC_BEGIN PREV_YEAR
global $PREV_YEAR, $prevlink, $py;
SC_BEGIN EC_PREV_YEAR
global $prevlink, $py;
return "<a href='".e_SELF."?".$prevlink."'>&lt;&lt; ".$py."</a>";
SC_END
SC_BEGIN NEXT_YEAR
global $NEXT_YEAR, $nextlink, $ny;
SC_BEGIN EC_NEXT_YEAR
global $nextlink, $ny;
return "<a href='".e_SELF."?".$nextlink."'>".$ny." &gt;&gt;</a>";
SC_END
SC_BEGIN MONTH_LIST
global $MONTH_LIST, $year, $monthjump, $monthabb;
$MONTH_LIST = "";
SC_BEGIN EC_MONTH_LIST
global $EC_MONTH_LIST, $year, $monthjump, $monthabb;
$EC_MONTH_LIST = "";
for ($ii = 0; $ii < 12; $ii++)
{
$m = $ii + 1;
$monthjump = mktime(0, 0, 0, $m, 1, $year);
$MONTH_LIST .= "<a href='".e_SELF."?".$monthjump."'>".$monthabb[$ii]."</a> &nbsp;";
$EC_MONTH_LIST .= "<a href='".e_SELF."?".$monthjump."'>".$monthabb[$ii]."</a> &nbsp;";
}
return $MONTH_LIST;
return $EC_MONTH_LIST;
SC_END
// NAVIGATION BUTTONS ------------------------------------------------
SC_BEGIN NAV_BUT_ALLEVENTS
global $NAV_BUT_ALLEVENTS;
SC_BEGIN EC_NAV_BUT_ALLEVENTS
$allevents = (e_PAGE == "event.php" ? EC_LAN_96 : EC_LAN_93);
return "<input class='button' type='submit' style='width:140px;' name='viewallevents' value='".$allevents."' title='".$allevents."' />";
SC_END
SC_BEGIN NAV_BUT_VIEWCAT
global $NAV_BUT_VIEWCAT;
SC_BEGIN EC_NAV_BUT_VIEWCAT
//return "<input type='hidden' name='do' value='vc' /><input class='button' type='submit' style='width:140px;' name='viewcat' value='".EC_LAN_92."' />";
return "<input type='hidden' name='do' value='vc' />";
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 = "<input class='button' type='submit' style='width:140px;' name='subs' value='".EC_LAN_123."' />";
return "<input class='button' type='submit' style='width:140px;' name='subs' value='".EC_LAN_123."' />";
}
return $NAV_BUT_SUBSCRIPTION;
SC_END
SC_BEGIN NAV_BUT_ENTEREVENT
global $NAV_BUT_ENTEREVENT, $pref, $prop;
$NAV_BUT_ENTEREVENT = "<input type='hidden' name='enter_new_val' value='".$prop."' />";
SC_BEGIN EC_NAV_BUT_PRINTLISTS
global $pref;
if (isset($pref['eventpost_printlists']) && ($pref['eventpost_printlists']>0) && USER)
{
return "<input class='button' type='submit' style='width:140px;' name='printlists' value='".EC_LAN_164."' />";
}
SC_END
SC_BEGIN EC_NAV_BUT_ENTEREVENT
global $EC_NAV_BUT_ENTEREVENT, $pref, $prop;
$EC_NAV_BUT_ENTEREVENT = "<input type='hidden' name='enter_new_val' value='".$prop."' />";
if (check_class($pref['eventpost_admin']) || getperms('0')){
// start no admin preference
$NAV_BUT_ENTEREVENT .= "<input class='button' type='submit' style='width:140px;' name='doit' value='".EC_LAN_94."' />";
$EC_NAV_BUT_ENTEREVENT .= "<input class='button' type='submit' style='width:140px;' name='doit' value='".EC_LAN_94."' />";
}
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 = "<input class='button' type='button' style='width:140px;' name='cur' value='".EC_LAN_40."' onclick=\"javascript:document.location='".e_SELF."?$current'\" />";
$EC_NAV_LINKCURRENTMONTH = "<input class='button' type='button' style='width:140px;' name='cur' value='".EC_LAN_40."' onclick=\"javascript:document.location='".e_SELF."?$current'\" />";
}
return $NAV_LINKCURRENTMONTH;
return $EC_NAV_LINKCURRENTMONTH;
SC_END
SC_BEGIN NAV_CATEGORIES
global $NAV_CATEGORIES, $sql, $pref, $_POST, $cal_super;
$NAV_CATEGORIES = "<select name='event_cat_ids' class='tbox' style='width:140px;' onchange='this.form.submit()' ><option class='tbox' value='all'>".EC_LAN_97."</option>";
SC_BEGIN EC_NAV_CATEGORIES
global $EC_NAV_CATEGORIES, $sql, $pref, $_POST, $cal_super;
(isset($parm) && ($parm == 'nosubmit')) ? $insert = '' : $insert = "onchange='this.form.submit()'";
$EC_NAV_CATEGORIES = "<select name='event_cat_ids' class='tbox' style='width:140px;' {$insert} >\n<option value='all'>".EC_LAN_97."</option>\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 .= "<option class='tbox' value='".$row['event_cat_id']."' selected='selected'>".$row['event_cat_name']."</option>";
$EC_NAV_CATEGORIES .= "<option class='tbox' value='".$row['event_cat_id']."' selected='selected'>".$row['event_cat_name']."</option>\n";
}else{
$NAV_CATEGORIES .= "<option value='".$row['event_cat_id']."'>".$row['event_cat_name']."</option>";
$EC_NAV_CATEGORIES .= "<option value='".$row['event_cat_id']."'>".$row['event_cat_name']."</option>\n";
}
}
$NAV_CATEGORIES .= "</select>";
return $NAV_CATEGORIES;
$EC_NAV_CATEGORIES .= "</select>\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'])){
SC_BEGIN EC_SHOWEVENT_IMAGE
global $ev;
if($ev['event_cat_icon'] && file_exists(e_PLUGIN."calendar_menu/images/".$ev['event_cat_icon']))
{
$img = "<img style='border:0' src='".e_PLUGIN."calendar_menu/images/".$ev['event_cat_icon']."' alt='' height='".$ev['imagesize']."' width='".$ev['imagesize']."' />";
}else{
}
else
{
$img = "<img src='".THEME."images/".(defined("BULLET") ? BULLET : "bullet2.gif")."' alt='' style='border:0; vertical-align:middle;' />";
}
return $img;
//return "<img style='border:0' src='".e_PLUGIN."calendar_menu/images/".$ev['event_cat_icon']."' alt='' height='".$ev['imagesize']."' width='".$ev['imagesize']."' />";
SC_END
SC_BEGIN SHOWEVENT_INDICAT
global $SHOWEVENT_INDICAT, $ev;
SC_BEGIN EC_SHOWEVENT_INDICAT
global $ev;
return $ev['indicat'];
SC_END
SC_BEGIN SHOWEVENT_HEADING
global $SHOWEVENT_HEADING, $ev, $datearray, $c;
SC_BEGIN EC_SHOWEVENT_HEADING
global $ev, $datearray, $c, $tp;
$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'];
}
else
$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))
{
if (strlen($ev['event_title']) > 10)
{
$show_title = substr($ev['event_title'], 0, 10) . "...";
}
else
{
$show_title = $ev['event_title'];
}
$show_title = substr($show_title, 0, 10) . "...";
}
if($ev['startofevent'])
{
if (isset($ev['is_recent']))
{
return "<b><a title='{$ev['event_title']}' href='".e_PLUGIN."calendar_menu/event.php?".$linkut.".event.".$ev['event_id']."'><span class='mediumtext'>".$show_title."</span></a></b>";
}
else
{
return "<b><a title='{$ev['event_title']}' href='".e_PLUGIN."calendar_menu/event.php?".$linkut.".event.".$ev['event_id']."'><span class='mediumtext'>".$show_title."</span></a></b>";
}
}
else
{
return "<a title='{$ev['event_title']}' href='".e_PLUGIN."calendar_menu/event.php?".$linkut.".event.".$ev['event_id']."'><span class='smalltext'>".$show_title."</span></a>";
}
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 "<img style='border:0' src='".$recent_icon."' alt='' /> ";
}
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 "<strong>".substr($day,0,$pref['eventpost_lenday'])."</strong>";
@@ -208,94 +192,111 @@ 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 "<b><a href='".e_PLUGIN."calendar_menu/event.php?".$startt."'>".$days[($c-1)]."</a></b> <span class='smalltext'>[".EC_LAN_TODAY."]</span>";
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 "<a href='".e_PLUGIN."calendar_menu/event.php?".$startt.".one'>".$days[($c-1)]."</a>";
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 "<a href='".e_PLUGIN."calendar_menu/event.php?".$startt."'>".$days[($c-1)]."</a>";
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 "<img style='border:0' src='".$recent_icon."' alt='' /> ";
}
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 = "<a href='event.php?".$thisevent['event_start'].".event.".$thisevent['event_id']."'>".$startds."</a>";
return $EVENTARCHIVE_DATE;
$EC_EVENTARCHIVE_DATE = "<a href='event.php?".$thisevent['event_start'].".event.".$thisevent['event_id']."'>".$startds."</a>";
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 "<img style='border:0' src='".$recent_icon."' alt='' /> ";
@@ -303,45 +304,47 @@ SC_BEGIN EVENT_RECENT_ICON
return "";
SC_END
SC_BEGIN EVENT_HEADING_DATE
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 EVENT_DATE_START
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 EVENT_TIME_START
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 EVENT_DATE_END
SC_BEGIN EC_EVENT_DATE_END
global $thisevent, $ecal_class;
if ($thisevent['event_allday'] ||($thisevent['event_end'] == $thisevent['event_start'])) return "";
// 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 EVENT_TIME_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 EVENT_TITLE
global $thisevent;
SC_BEGIN EC_EVENT_TITLE
global $thisevent, $tp;
return $thisevent['event_title'];
SC_END
SC_BEGIN EVENT_CAT_ICON
SC_BEGIN EC_EVENT_CAT_ICON
global $thisevent;
if ($thisevent['event_cat_icon'] && file_exists(e_PLUGIN."calendar_menu/images/".$thisevent['event_cat_icon']))
{
@@ -353,90 +356,173 @@ SC_BEGIN EVENT_CAT_ICON
}
SC_END
SC_BEGIN EVENT_ID
SC_BEGIN EC_EVENT_ID
global $thisevent;
return "calevent".$thisevent['event_id'];
SC_END
SC_BEGIN EVENT_DISPLAYSTYLE
global $EVENT_DISPLAYSTYLE, $ds;
SC_BEGIN EC_EVENT_DISPLAYSTYLE
global $EC_EVENT_DISPLAYSTYLE, $ds;
if (($ds=="event") || ($ds=="one")){
$EVENT_DISPLAYSTYLE = "show";
$EC_EVENT_DISPLAYSTYLE = "show";
}else{
$EVENT_DISPLAYSTYLE = "none";
$EC_EVENT_DISPLAYSTYLE = "none";
}
return $EVENT_DISPLAYSTYLE;
return $EC_EVENT_DISPLAYSTYLE;
SC_END
SC_BEGIN EVENT_DETAILS
global $EVENT_DETAILS, $thisevent, $tp;
return $tp->toHTML($thisevent['event_details'], TRUE);
SC_BEGIN EC_EVENT_DETAILS
global $thisevent, $tp;
return $tp->toHTML($thisevent['event_details'], TRUE, 'BODY');
SC_END
SC_BEGIN EVENT_CATEGORY
global $EVENT_CATEGORY, $thisevent;
$EVENT_CATEGORY = $thisevent['event_cat_name'];
return $EVENT_CATEGORY;
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 EVENT_LOCATION
global $EVENT_LOCATION, $thisevent;
if ($thisevent['event_location'] == ""){
$EVENT_LOCATION = "";
}else{
$EVENT_LOCATION = $thisevent['event_location'];
SC_BEGIN EC_EVENT_LOCATION
global $EC_EVENT_LOCATION, $thisevent;
if ($thisevent['event_location'] == "")
{
$EC_EVENT_LOCATION = "";
}
return $EVENT_LOCATION;
SC_END
SC_BEGIN EVENT_AUTHOR
global $EVENT_AUTHOR, $event_author_id, $event_author_name;
if(USER){
$EVENT_AUTHOR = "<a href='".e_BASE."user.php?id.".$event_author_id."'>".$event_author_name."</a>";
}else{
$EVENT_AUTHOR = $event_author_name;
else
{
$EC_EVENT_LOCATION = $thisevent['event_location'];
}
return $EVENT_AUTHOR;
return $EC_EVENT_LOCATION;
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);
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];
}
return $EVENT_CONTACT;
if(USER)
{
$EC_EVENT_AUTHOR = "<a href='".e_BASE."user.php?id.".$event_author_id."'>".$event_author_name."</a>";
}
else
{
$EC_EVENT_AUTHOR = $event_author_name;
}
return $EC_EVENT_AUTHOR;
SC_END
SC_BEGIN EVENT_THREAD
global $EVENT_THREAD, $thisevent;
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'] != "")) ? "<a href='{$thisevent['event_thread']}'><img src='".e_PLUGIN."forum/images/".IMODE."/e.png' alt='' style='border:0; vertical-align:middle;' width='16' height='16' /></a> <a href='{$thisevent['event_thread']}'>".EC_LAN_39."</a>" : "";
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 = "<a href='event.php?ed.".$thisevent['event_id']."'><img style='border:0;' src='".e_IMAGE."packs/".$imode."/admin_images/edit_16.png' title='".EC_LAN_35."' alt='".EC_LAN_35 . "'/></a>&nbsp;&nbsp;<a href='".e_PLUGIN."calendar_menu/event.php?de.".$thisevent['event_id']."'><img style='border:0;' src='".e_IMAGE."packs/".$imode."/admin_images/delete_16.png' title='".EC_LAN_36."' alt='".EC_LAN_36."'/></a>";
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 = "<a href='event.php?ed.".$thisevent['event_id']."'><img style='border:0;' src='".e_IMAGE."admin_images/edit_16.png' title='".EC_LAN_35."' alt='".EC_LAN_35 . "'/></a>&nbsp;&nbsp;<a href='".e_PLUGIN."calendar_menu/event.php?de.".$thisevent['event_id']."'><img style='border:0;' src='".e_IMAGE."admin_images/delete_16.png' title='".EC_LAN_36."' alt='".EC_LAN_36."'/></a>";
}
return $EVENT_OPTIONS;
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 NEXT_EVENT_TIME
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 "<img style='border:0' src='".$recent_icon."' alt='' /> ";
}
return "";
SC_END
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 NEXT_EVENT_DATE
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 NEXT_EVENT_TITLE
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'] != "")))
{
@@ -450,28 +536,280 @@ SC_BEGIN NEXT_EVENT_TITLE
return $fe_event_title;
SC_END
SC_BEGIN NEXT_EVENT_ICON
global $pref, $cal_row, $ecal_dir;
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($ecal_dir."images/".$cal_row['event_cat_icon']))
if($cal_row['event_cat_icon'] && file_exists(e_PLUGIN."calendar_menu/images/".$cal_row['event_cat_icon']))
{
$fe_icon_file = $ecal_dir."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."images/".(defined("BULLET") ? BULLET : "bullet2.gif");
$fe_icon_file = THEME_ABS."images/".(defined("BULLET") ? BULLET : "bullet2.gif");
}
}
return $fe_icon_file;
SC_END
SC_BEGIN NEXT_EVENT_GAP
SC_BEGIN EC_NEXT_EVENT_GAP
global $cal_totev;
if ($cal_totev) return "<br /><br />"; 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 EC_MAIL_DATE_END
global $thisevent, $ecal_class;
if ($thisevent['event_allday'] ||($thisevent['event_end'] == $thisevent['event_start'])) return "";
if (isset($parm) && ($parm !== ""))
{
return strftime($parm,$thisevent['event_end']);
}
else
{
return $ecal_class->event_date_string($thisevent['event_end']);
}
SC_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 EC_MAIL_TITLE
global $thisevent;
return $thisevent['event_title'];
SC_END
SC_BEGIN EC_MAIL_ID
global $thisevent;
return "calevent".$thisevent['event_id'];
SC_END
SC_BEGIN EC_MAIL_DETAILS
global $EVENT_DETAILS, $thisevent, $tp;
return $tp->toHTML($thisevent['event_details'], TRUE,'BODY, no_make_clickable');
SC_END
SC_BEGIN EC_MAIL_CATEGORY
global $EVENT_CATEGORY, $thisevent;
$EVENT_CATEGORY = $thisevent['event_cat_name'];
return $EVENT_CATEGORY;
SC_END
SC_BEGIN EC_MAIL_LOCATION
global $EVENT_LOCATION, $thisevent;
if ($thisevent['event_location'] == "")
{
$EVENT_LOCATION = "";
}
else
{
$EVENT_LOCATION = $thisevent['event_location'];
}
return $EVENT_LOCATION;
SC_END
SC_BEGIN EC_MAIL_CONTACT
global $MAIL_CONTACT, $thisevent,$tp;
if ($thisevent['event_contact'] == "")
{
$MAIL_CONTACT = "";
}
else
{
$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);
}
SC_END
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 "<input type='button' value='".EC_LAN_162."' onClick='window.print()' />";
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
*/
?>

View File

@@ -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,

View File

@@ -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'] = "<span class='defaulttext'>";
$sc_style['PREV_MONTH']['post'] = "</span>";
$sc_style['EC_PREV_MONTH']['pre'] = "<span class='defaulttext'>";
$sc_style['EC_PREV_MONTH']['post'] = "</span>";
$sc_style['CURRENT_MONTH']['pre'] = "<b>";
$sc_style['CURRENT_MONTH']['post'] = "</b>";
$sc_style['EC_CURRENT_MONTH']['pre'] = "<b>";
$sc_style['EC_CURRENT_MONTH']['post'] = "</b>";
$sc_style['NEXT_MONTH']['pre'] = "<span class='defaulttext'>";
$sc_style['NEXT_MONTH']['post'] = "</span>";
$sc_style['EC_NEXT_MONTH']['pre'] = "<span class='defaulttext'>";
$sc_style['EC_NEXT_MONTH']['post'] = "</span>";
$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'] = "";
//<table style='width:98%;' class='fborder'>
$CALENDAR_TIME_TABLE = "
<table cellpadding='0' cellspacing='1' class='fborder' style='width:100%'>
<tr>
<td class='forumheader' style='width:18%; text-align:left'>{PREV_MONTH}</td>
<td class='fcaption' style='width:64%; text-align:center'>{CURRENT_MONTH}</td>
<td class='forumheader' style='width:18%; text-align:right'>{NEXT_MONTH}</td>
<td class='forumheader' style='width:18%; text-align:left'>{EC_PREV_MONTH}</td>
<td class='fcaption' style='width:64%; text-align:center'>{EC_CURRENT_MONTH}</td>
<td class='forumheader' style='width:18%; text-align:right'>{EC_NEXT_MONTH}</td>
</tr>\n
<tr>
<td class='forumheader3' style='text-align:left'>{PREV_YEAR}</td>
<td class='fcaption' style='text-align:center; vertical-align:middle'>{MONTH_LIST}</td>
<td class='forumheader3' style='text-align:right'>{NEXT_YEAR}</td>
<td class='forumheader3' style='text-align:left'>{EC_PREV_YEAR}</td>
<td class='fcaption' style='text-align:center; vertical-align:middle'>{EC_MONTH_LIST}</td>
<td class='forumheader3' style='text-align:right'>{EC_NEXT_YEAR}</td>
</tr>\n
</table>";
// NAVIGATION BUTTONS ------------------------------------------------------------
// NAVIGATION BUTTONS
//$sc_style['NAV_LINKCURRENTMONTH']['pre'] = "<span class='button' style='width:120px; '>";
//$sc_style['NAV_LINKCURRENTMONTH']['post'] = "</span>";
$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 = "
<div style='text-align:center; margin-bottom:20px;'>
<form method='post' action='" . e_SELF . "?" . e_QUERY . "' id='calform'>
<table border='0' cellpadding='0' cellspacing='0' style='width:100%;'>
<tr>
<td style='text-align:center;'>{NAV_CATEGORIES} {NAV_BUT_ALLEVENTS} {NAV_BUT_VIEWCAT} {NAV_BUT_ENTEREVENT} {NAV_BUT_SUBSCRIPTION} {NAV_LINKCURRENTMONTH}</td>
<td style='text-align:center;'>{EC_NAV_CATEGORIES} {EC_NAV_BUT_ALLEVENTS} {EC_NAV_BUT_VIEWCAT} {EC_NAV_BUT_ENTEREVENT} {EC_NAV_BUT_SUBSCRIPTION} {EC_NAV_BUT_PRINTLISTS} {EC_NAV_LINKCURRENTMONTH}</td>
</tr>\n
</table>
</form>
@@ -77,26 +79,26 @@ $CALENDAR_NAVIGATION_TABLE = "
// EVENT LIST ------------------------------------------------------------
$sc_style['EVENTLIST_CAPTION']['pre'] = "<tr><td class='fcaption' colspan='2'>";
$sc_style['EVENTLIST_CAPTION']['post'] = ":<br /><br /></td></tr>\n";
$sc_style['EC_EVENTLIST_CAPTION']['pre'] = "<tr><td class='fcaption' colspan='2'>";
$sc_style['EC_EVENTLIST_CAPTION']['post'] = ":<br /><br /></td></tr>\n";
$EVENT_EVENTLIST_TABLE_START = "<table style='width:100%' class='fborder'>{EVENTLIST_CAPTION}";
$EVENT_EVENTLIST_TABLE_START = "<table style='width:100%' class='fborder'>{EC_EVENTLIST_CAPTION}";
$EVENT_EVENTLIST_TABLE_END = "</table>";
// EVENT ARCHIVE ------------------------------------------------------------
$sc_style['EVENTARCHIVE_CAPTION']['pre'] = "<tr><td colspan='2' class='fcaption'>";
$sc_style['EVENTARCHIVE_CAPTION']['post'] = "</td></tr>\n";
$sc_style['EC_EVENTARCHIVE_CAPTION']['pre'] = "<tr><td colspan='2' class='fcaption'>";
$sc_style['EC_EVENTARCHIVE_CAPTION']['post'] = "</td></tr>\n";
$EVENT_ARCHIVE_TABLE_START = "<br /><table style='width:100%' class='fborder'>{EVENTARCHIVE_CAPTION}";
$EVENT_ARCHIVE_TABLE_START = "<br /><table style='width:100%' class='fborder'>{EC_EVENTARCHIVE_CAPTION}";
$EVENT_ARCHIVE_TABLE = "
<tr>
<td style='width:35%; vertical-align:top' class='forumheader3'>{EVENT_RECENT_ICON}{EVENTARCHIVE_DATE}</td>
<td style='width:65%' class='forumheader3'>{EVENTARCHIVE_HEADING}</td>
<td style='width:35%; vertical-align:top' class='forumheader3'>{EC_EVENT_RECENT_ICON}{EC_EVENTARCHIVE_DATE}</td>
<td style='width:65%' class='forumheader3'>{EC_EVENTARCHIVE_HEADING}</td>
</tr>\n";
//<br />{EVENTARCHIVE_DETAILS}
$EVENT_ARCHIVE_TABLE_EMPTY = "<tr><td colspan='2' class='forumheader3'>{EVENTARCHIVE_EMPTY}</td></tr>\n";
$EVENT_ARCHIVE_TABLE_EMPTY = "<tr><td colspan='2' class='forumheader3'>{EC_EVENTARCHIVE_EMPTY}</td></tr>\n";
$EVENT_ARCHIVE_TABLE_END = "</table>";
@@ -105,50 +107,66 @@ $EVENT_ARCHIVE_TABLE_END = "</table>";
$EVENT_EVENT_TABLE_START = "<table style='width:100%' class='fborder' cellspacing='0' cellpadding='0'>";
$EVENT_EVENT_TABLE_END = "</table>";
$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'] = "<tr><td colspan='2' class='forumheader3'>";
$sc_style['EVENT_DETAILS']['post'] = "</td></tr>\n";
$sc_style['EC_EVENT_DETAILS']['pre'] = "<tr><td colspan='2' class='forumheader3'>";
$sc_style['EC_EVENT_DETAILS']['post'] = "</td></tr>\n";
$sc_style['EVENT_LOCATION']['pre'] = "<b>".EC_LAN_32."</b> ";
$sc_style['EVENT_LOCATION']['post'] = "";
$sc_style['EC_EVENT_LOCATION']['pre'] = "<b>".EC_LAN_32."</b> ";
$sc_style['EC_EVENT_LOCATION']['post'] = "";
$sc_style['EVENT_AUTHOR']['pre'] = "<b>".EC_LAN_31."</b> ";
$sc_style['EVENT_AUTHOR']['post'] = "&nbsp;";
$sc_style['EC_EVENT_AUTHOR']['pre'] = "<b>".EC_LAN_31."</b> ";
$sc_style['EC_EVENT_AUTHOR']['post'] = "&nbsp;";
$sc_style['EVENT_CONTACT']['pre'] = "<b>".EC_LAN_33."</b> ";
$sc_style['EVENT_CONTACT']['post'] = "&nbsp;";
$sc_style['EC_EVENT_CONTACT']['pre'] = "<b>".EC_LAN_33."</b> ";
$sc_style['EC_EVENT_CONTACT']['post'] = "&nbsp;";
$sc_style['EVENT_THREAD']['pre'] = "<tr><td colspan='2' class='forumheader3'><span class='smalltext'>";
$sc_style['EVENT_THREAD']['post'] = "</span></td></tr>\n";
$sc_style['EC_EVENT_THREAD']['pre'] = "<tr><td colspan='2' class='forumheader3'><span class='smalltext'>";
$sc_style['EC_EVENT_THREAD']['post'] = "</span></td></tr>\n";
$sc_style['EVENT_CATEGORY']['pre'] = "<b>".EC_LAN_30."</b> ";
$sc_style['EVENT_CATEGORY']['post'] = "&nbsp;";
$sc_style['EC_EVENT_CATEGORY']['pre'] = "<b>".EC_LAN_30."</b> ";
$sc_style['EC_EVENT_CATEGORY']['post'] = "&nbsp;";
$sc_style['EVENT_DATE_START']['pre'] = (isset($thisevent['event_allday']) && $thisevent['event_allday']) ? "<b>".EC_LAN_68."</b> " : "<b>".EC_LAN_29."</b> ";
$sc_style['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'] = "<b>".EC_LAN_69."</b> ";
$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'] = "<b>".EC_LAN_29."</b> ";
$sc_style['EC_EVENT_EVENT_DATE_TIME']['post'] = "";
$sc_style['EC_IFNOT_ALLDAY']['pre'] = EC_LAN_144;
$sc_style['EC_IFNOT_ALLDAY']['post'] = "";
// The $EVENT_EVENT_DATETIME strings are used with the EC_EVENT_EVENT_DATE_TIME shortcode.
// There are four cases, each with a corresponding index into $EVENT_EVENT_DATETIME:
// 0 - Normal event, starting and finishing on different dates (the 'original' default)
// 1 - Normal event, starting and finishing on the same day
// 2 - All-day event, starting and finishing on different days
// 3 - All-day event, starting and finishing on the same day
$EVENT_EVENT_DATETIME[0] = "{EC_EVENT_DATE_START}".EC_LAN_144."{EC_EVENT_TIME_START}<b> ".EC_LAN_69."</b> {EC_EVENT_DATE_END}{EC_IFNOT_ALLDAY=EC_EVENT_TIME_END}";
$EVENT_EVENT_DATETIME[1] = "{EC_EVENT_DATE_START} ".EC_LAN_84." {EC_EVENT_TIME_START}".EC_LAN_85."{EC_EVENT_TIME_END}";
$EVENT_EVENT_DATETIME[2] = "{EC_EVENT_DATE_START} <b>".EC_LAN_69."</b> {EC_EVENT_DATE_END}";
$EVENT_EVENT_DATETIME[3] = "{EC_EVENT_DATE_START}";
$EVENT_EVENT_TABLE = "
<tr>
<td >
<div title='".EC_LAN_132."' class='fcaption' style='cursor:pointer; text-align:left; border:0px solid #000;' onclick=\"expandit('{EVENT_ID}')\">{EVENT_RECENT_ICON}{EVENT_CAT_ICON}{EVENT_HEADING_DATE}{EVENT_TIME_START}&nbsp;-&nbsp;{EVENT_TITLE}</div>
<div id='{EVENT_ID}' style='display:{EVENT_DISPLAYSTYLE}; padding-top:10px; padding-bottom:10px; text-align:left;'>
<div title='".EC_LAN_132."' class='fcaption' style='cursor:pointer; text-align:left; border:0px solid #000;' onclick=\"expandit('{EC_EVENT_ID}')\">{EC_EVENT_RECENT_ICON}{EC_EVENT_CAT_ICON}{EC_EVENT_HEADING_DATE}{EC_IFNOT_ALLDAY=EC_EVENT_TIME_START}&nbsp;-&nbsp;{EC_EVENT_TITLE}</div>
<div id='{EC_EVENT_ID}' style='display:{EC_EVENT_DISPLAYSTYLE}; padding-top:10px; padding-bottom:10px; text-align:left;'>
<table style='width:100%;' cellspacing='0' cellpadding='0'>
<tr><td colspan='2' class='forumheader3'>{EVENT_AUTHOR} {EVENT_CAT_ICON} {EVENT_CATEGORY} {EVENT_CONTACT} {EVENT_OPTIONS}</td></tr>
<tr><td colspan='2' class='forumheader3'>{EVENT_DATE_START}{EVENT_TIME_START} {EVENT_DATE_END}{EVENT_TIME_END}</td></tr>\n
<tr><td colspan='2' class='forumheader3'>{EVENT_LOCATION}</td></tr>
{EVENT_DETAILS}
{EVENT_THREAD}
<tr><td colspan='2' class='forumheader3'>{EC_EVENT_AUTHOR} {EC_EVENT_CAT_ICON} {EC_EVENT_CATEGORY} {EC_EVENT_CONTACT} {EC_EVENT_OPTIONS}</td></tr>
<tr><td colspan='2' class='forumheader3'>{EC_EVENT_EVENT_DATE_TIME}</td></tr>\n
<tr><td colspan='2' class='forumheader3'>{EC_EVENT_LOCATION}</td></tr>
{EC_EVENT_DETAILS}
{EC_EVENT_THREAD}
</table>
</div>
</td>
@@ -156,26 +174,31 @@ $EVENT_EVENT_TABLE = "
";
// CALENDAR SHOW EVENT ------------------------------------------------------------
$sc_style['CALENDAR_CALENDAR_RECENT_ICON']['pre'] = "<td style='vertical-align:top; color: #0; background-color: #ff00; width:10px;'>";
$sc_style['CALENDAR_CALENDAR_RECENT_ICON']['post'] = "</td>";
$CALENDAR_SHOWEVENT = "<table cellspacing='0' cellpadding='0' style='width:100%;'><tr>{CALENDAR_CALENDAR_RECENT_ICON}<td style='vertical-align:top; width:10px;'>{SHOWEVENT_IMAGE}</td><td style='vertical-align:top; width:2%;'>{SHOWEVENT_INDICAT}</td><td style='vertical-align:top;'>{SHOWEVENT_HEADING}</td></tr>\n</table>";
// CALENDAR CALENDAR ------------------------------------------------------------
//------------------------------------------
// CALENDAR CALENDAR - 'Big' calendar
//------------------------------------------
$CALENDAR_CALENDAR_START = "
<div style='text-align:center'>
<table cellpadding='0' cellspacing='1' class='fborder' style='background-color:#DDDDDD; width:100%'>";
<table cellpadding='0' cellspacing='1' class='fborder' style='background-color:#DDDDDD; width:100%'>
<colgroup>
<col style='width:14%; padding-bottom:0px;padding-right:0px; margin-right:0px; padding:2px;' />
<col style='width:14%; padding-bottom:0px;padding-right:0px; margin-right:0px; padding:2px;' />
<col style='width:14%; padding-bottom:0px;padding-right:0px; margin-right:0px; padding:2px;' />
<col style='width:14%; padding-bottom:0px;padding-right:0px; margin-right:0px; padding:2px;' />
<col style='width:14%; padding-bottom:0px;padding-right:0px; margin-right:0px; padding:2px;' />
<col style='width:14%; padding-bottom:0px;padding-right:0px; margin-right:0px; padding:2px;' />
<col style='width:14%; padding-bottom:0px;padding-right:0px; margin-right:0px; padding:2px;' />
</colgroup>";
$CALENDAR_CALENDAR_END = "
</tr>\n</table></div>";
$CALENDAR_CALENDAR_DAY_NON = "<td style='width:12%;height:60px;'></td>";
// 'Empty' cells where there's not a day at all
$CALENDAR_CALENDAR_DAY_NON = "<td style='width:14%;height:90px;'></td>";
//header row
$CALENDAR_CALENDAR_HEADER_START = "<tr>";
$CALENDAR_CALENDAR_HEADER = "<td class='fcaption' style='z-index: -1; background-color:#000; color:#FFF; width:90px; height:20px; text-align:center; vertical-align:middle;'>{CALENDAR_CALENDAR_HEADER_DAY}</td>";
$CALENDAR_CALENDAR_HEADER = "<td class='fcaption' style='z-index: -1; background-color:#000; color:#FFF; width:90px; height:20px; text-align:center; vertical-align:middle;'>{EC_CALENDAR_CALENDAR_HEADER_DAY}</td>";
$CALENDAR_CALENDAR_HEADER_END = "</tr>\n<tr>";
@@ -183,30 +206,38 @@ $CALENDAR_CALENDAR_WEEKSWITCH = "</tr>\n<tr>";
//today
$CALENDAR_CALENDAR_DAY_TODAY = "
<td class='forumheader3' style='vertical-align:top; width:14%; height:90px; padding-bottom:0px;padding-right:0px; margin-right:0px; padding:2px;'>
<span style='z-index: 2; position:relative; top:1px; height:10px;padding-right:0px'>{CALENDAR_CALENDAR_DAY_TODAY_HEADING}</span>";
<td class='forumheader3' style='vertical-align:top;height:90px;'>
<span style='z-index: 2; position:relative; top:1px; height:10px;padding-right:0px'>{EC_CALENDAR_CALENDAR_DAY_TODAY_HEADING}</span>";
//day has events
$CALENDAR_CALENDAR_DAY_EVENT = "
<td class='forumheader3' style='z-index: 1;vertical-align:top; width:14%; height:90px; padding-bottom:0px;padding-right:0px; margin-right:0px; padding:2px;'>
<span style='z-index: 2; position:relative; top:1px; height:10px;padding-right:0px'><b>{CALENDAR_CALENDAR_DAY_EVENT_HEADING}</b></span>";
<td class='forumheader3' style='z-index: 1;vertical-align:top;height:90px;'>
<span style='z-index: 2; position:relative; top:1px; height:10px;padding-right:0px'><b>{EC_CALENDAR_CALENDAR_DAY_EVENT_HEADING}</b></span>";
// no events and not today
$CALENDAR_CALENDAR_DAY_EMPTY = "
<td class='forumheader2' style='z-index: 1;vertical-align:top; width:14%; height:90px;padding-bottom:0px;padding-right:0px; margin-right:0px; padding:2px;'>
<span style='z-index: 2; position:relative; top:1px; height:10px;padding-right:0px'><b>{CALENDAR_CALENDAR_DAY_EMPTY_HEADING}</b></span>";
<td class='forumheader2' style='z-index: 1;vertical-align:top;height:90px;'>
<span style='z-index: 2; position:relative; top:1px; height:10px;padding-right:0px'><b>{EC_CALENDAR_CALENDAR_DAY_EMPTY_HEADING}</b></span>";
$CALENDAR_CALENDAR_DAY_END = "</td>";
//====================================================================
// Calendar menu templates
// CALENDAR SHOW EVENT
$sc_style['EC_CALENDAR_CALENDAR_RECENT_ICON']['pre'] = "<td style='vertical-align:top; color: #0; background-color: #ff00; width:10px;'>";
$sc_style['EC_CALENDAR_CALENDAR_RECENT_ICON']['post'] = "</td>";
$CALENDAR_SHOWEVENT = "<table cellspacing='0' cellpadding='0' style='width:100%;'><tr>{EC_CALENDAR_CALENDAR_RECENT_ICON}<td style='vertical-align:top; width:10px;'>{EC_SHOWEVENT_IMAGE}</td><td style='vertical-align:top; width:2%;'>{EC_SHOWEVENT_INDICAT}</td><td style='vertical-align:top;'>{EC_SHOWEVENT_HEADING}</td></tr>\n</table>";
//------------------------------------------
// Calendar menu - 'Small' calendar
//------------------------------------------
$CALENDAR_MENU_HDG_LINK_CLASS = "class='forumlink'"; // Class, and optional style, for menu heading if its a clickable link
$CALENDAR_MENU_START = "<div style='text-align:center'>";
$CALENDAR_MENU_TABLE_START = "<table cellpadding='0' cellspacing='1' style='width:100%' class='fborder'>";
$CALENDAR_MENU_TABLE_START = "<table cellpadding='0' cellspacing='1' style='width:100%;' class='fborder'>"; // colgroup doesn't work!
$CALENDAR_MENU_END = "</tr></table></div>";
// Blank cells at beginning and end
$CALENDAR_MENU_DAY_NON = "<td class='forumheader3' style='padding:1px; text-align:center'><br /></td>";
$CALENDAR_MENU_DAY_NON = "<td class='forumheader3' style='width:14.28%; padding:1px; text-align:center; '><br /></td>";
//header row
$CALENDAR_MENU_HEADER_START = "<tr>\n";
@@ -219,11 +250,12 @@ $CALENDAR_MENU_WEEKSWITCH = "</tr>\n<tr>";
// Start and end CSS for date cells - six cases to decode, determined by array index:
// 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'] = "<td class='indent' style='width:14.28%; padding:1px; text-align:center; '>";
@@ -233,14 +265,15 @@ $CALENDAR_MENU_DAY_START['2'] = "<td class='forumheader3' style='width:14.28%; p
//day has events - same whether its today or not
$CALENDAR_MENU_DAY_START['3'] = "<td class='indent' style='width:14.28%; padding:1px; text-align:center; '>";
$CALENDAR_MENU_DAY_START['4'] = "<td class='indent' style='width:14.28%; padding:1px; text-align:center;'>";
$CALENDAR_MENU_DAY_START['4'] = "<td class='indent' style='width:14.28%; padding:1px; text-align:center; '>";
// day has events, one which is recently added/updated
$CALENDAR_MENU_DAY_START['5'] = "<td class='indent' style='width:14.28%; padding:1px; text-align:center; '>";
$CALENDAR_MENU_DAY_START['6'] = "<td class='indent' style='width:14.28%; padding:1px; text-align:center;'>";
$CALENDAR_MENU_DAY_START['6'] = "<td class='indent' style='width:14.28%; padding:1px; text-align:center; '>";
// Example highlight using background colour:
//$CALENDAR_MENU_DAY_START['5'] = "<td class='indent' style='width:14.28%; padding:1px; text-align:center; background-color: #FF8000;'>";
//$CALENDAR_MENU_DAY_START['6'] = "<td class='indent' style='width:14.28%; padding:1px; text-align:center; background-color: #FF0000; '>";
$CALENDAR_MENU_DAY_END['1'] = "</td>";
$CALENDAR_MENU_DAY_END['2'] = "</td>";
$CALENDAR_MENU_DAY_END['3'] = "</td>";
@@ -250,19 +283,19 @@ $CALENDAR_MENU_DAY_END['6'] = "</td>";
//============================================================================
// Next event menu template
$sc_style['NEXT_EVENT_TIME']['pre'] = EC_LAN_144;
$sc_style['NEXT_EVENT_TIME']['post'] = "";
$sc_style['EC_NEXT_EVENT_TIME']['pre'] = EC_LAN_144;
$sc_style['EC_NEXT_EVENT_TIME']['post'] = "";
// Following are original styles
//$sc_style['NEXT_EVENT_ICON']['pre'] = "<img style='border:0px' src='";
//$sc_style['NEXT_EVENT_ICON']['post'] = "' alt='' />&nbsp;";
// Following to 'float right' on a larger icon
$sc_style['NEXT_EVENT_ICON']['pre'] = "<img style='clear: right; float: left; margin: 0px 3px 0px 0px; padding:1px; border: 0px;' src='";
$sc_style['NEXT_EVENT_ICON']['post'] = "' alt='' />";
$sc_style['EC_NEXT_EVENT_ICON']['pre'] = "<img style='clear: right; float: left; margin: 0px 3px 0px 0px; padding:1px; border: 0px;' src='";
$sc_style['EC_NEXT_EVENT_ICON']['post'] = "' alt='' />";
if (!isset($EVENT_CAL_FE_LINE))
{
$EVENT_CAL_FE_LINE = "{NEXT_EVENT_ICON}{NEXT_EVENT_DATE}{NEXT_EVENT_TIME}<br /><strong>{NEXT_EVENT_TITLE}</strong>{NEXT_EVENT_GAP}";
$EVENT_CAL_FE_LINE = "{EC_NEXT_EVENT_RECENT_ICON}{EC_NEXT_EVENT_ICON}{EC_NEXT_EVENT_DATE}{EC_NEXT_EVENT_TIME}<br /><strong>{EC_NEXT_EVENT_TITLE}</strong>{EC_NEXT_EVENT_GAP}";
}

View File

@@ -1,11 +1,36 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/e_list.php,v $
| $Revision: 1.2 $
| $Date: 2007-07-13 19:37:52 $
| $Author: e107steved $
|
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
if (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");

View File

@@ -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 $
+----------------------------------------------------------------------------+
*/

View File

@@ -1,9 +1,28 @@
<?php
// Reflects updates to CVS version 1.3 made 29.10.2006
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/e_rss.php,v $
| $Revision: 1.2 $
| $Date: 2007-07-13 19:37:52 $
| $Author: e107steved $
|
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
if (isset($pref['plug_installed']) && !isset($pref['plug_installed']['calendar_menu'])) return;
//##### create feed for admin, return array $eplug_rss_feed --------------------------------
$feed['name'] = EC_ADLAN_A12;
$feed['url'] = 'calendar'; //the identifier for the rss feed url

View File

@@ -0,0 +1,72 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/ec_mailout_template.php,v $
| $Revision: 1.1 $
| $Date: 2007-07-13 19:37:52 $
| $Author: e107steved $
|
+----------------------------------------------------------------------------+
This template is used during the subscription mailouts - it is inserted at the front of the text
defined for each category.
Main purpose is to define the 'pre' and 'post' styles, but it can be used much as any E107 template
*/
if (!defined('e107_INIT')) { exit; }
$sc_style['EC_MAIL_HEADING_DATE']['pre'] = "";
$sc_style['EC_MAIL_HEADING_DATE']['post'] = "";
$sc_style['EC_MAIL_SHORT_DATE']['pre'] = "";
$sc_style['EC_MAIL_SHORT_DATE']['post'] = "";
$sc_style['EC_MAIL_TITLE']['pre'] = "";
$sc_style['EC_MAIL_TITLE']['post'] = "";
$sc_style['EC_MAIL_ID']['pre'] = "";
$sc_style['EC_MAIL_ID']['post'] = "";
$sc_style['EC_MAIL_DETAILS']['pre'] = "";
$sc_style['EC_MAIL_DETAILS']['post'] = "";
$sc_style['EC_MAIL_LOCATION']['pre'] = EC_LAN_32." ";
$sc_style['EC_MAIL_LOCATION']['post'] = "";
$sc_style['EC_MAIL_AUTHOR']['pre'] = EC_LAN_31." ";
$sc_style['EC_MAIL_AUTHOR']['post'] = "";
$sc_style['EC_MAIL_CONTACT']['pre'] = EC_LAN_33." ";
$sc_style['EC_MAIL_CONTACT']['post'] = "";
$sc_style['EC_MAIL_THREAD']['pre'] = "";
$sc_style['EC_MAIL_THREAD']['post'] = "";
$sc_style['EC_MAIL_LINK']['pre'] = "";
$sc_style['EC_MAIL_LINK']['post'] = "";
$sc_style['EC_MAIL_CATEGORY']['pre'] = "";
$sc_style['EC_MAIL_CATEGORY']['post'] = "";
$sc_style['EC_MAIL_DATE_START']['pre'] = (isset($thisevent['event_allday']) && $thisevent['event_allday']) ? EC_LAN_68." " : EC_LAN_29." ";
$sc_style['EC_MAIL_DATE_START']['post'] = "";
$sc_style['EC_MAIL_TIME_START']['pre'] = EC_LAN_144;
$sc_style['EC_MAIL_TIME_START']['post'] = "";
$sc_style['EC_MAIL_DATE_END']['pre'] = EC_LAN_69." ";
$sc_style['EC_MAIL_DATE_END']['post'] = "";
$sc_style['EC_MAIL_TIME_END']['pre'] = EC_LAN_144;
$sc_style['EC_MAIL_TIME_END']['post'] = "";
?>

View File

@@ -0,0 +1,424 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jali.@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/ec_pf_page.php,v $
| $Revision: 1.1 $
| $Date: 2007-07-13 19:37:52 $
| $Author: e107steved $
|
| Generate a printer-friendly page of calendar events
| Query is: ec_pf_page.php?ssssss.eeeeee[[[.cat].template].output]
|
| Date format is yyyymmdd or yyyymm to make it easy to generate fixed queries.
| cat is a number corresponding to a category ID. '*' or blank gives all categories
| template determines output style ('*' selects the default template)
| output can be 'display' (default), 'print' or 'pdf'
|
| Mostly the template can use the EVENT and MAIL shortcodes - pretty much anything that
| uses $thisevent as a parameter. MAIL is best since it's never used elsewhere at the same time
+----------------------------------------------------------------------------+
*/
require_once("../../class2.php");
if (!isset($pref['plug_installed']['calendar_menu'])) header("Location: ".e_BASE."index.php");
include_lan(e_PLUGIN."calendar_menu/languages/".e_LANGUAGE.".php");
define("PAGE_NAME", EC_LAN_80);
require_once(e_PLUGIN.'calendar_menu/ecal_class.php');
$ecal_class = new ecal_class;
require_once(e_PLUGIN."calendar_menu/calendar_shortcodes.php");
$message = "";
unset($ec_qs);
if (e_QUERY) $ec_qs = explode(".", e_QUERY);
else
{
if (!isset($pref['eventpost_printlists']) || ($pref['eventpost_printlists'] == 0))
header("location:".SITEURL); // If disabled, just go back to index page
}
if (isset($_POST['set_dates']) && isset($_POST['start_date']) && (isset($_POST['end_date'])))
{
$ec_qs[0] = $_POST['start_date'];
$ec_qs[1] = $_POST['end_date'];
if (isset($_POST['event_cat_ids']))
{
$ec_qs[2] = $_POST['event_cat_ids'];
if ($ec_qs[2] == 'all') $ec_qs[2] = '*';
}
if (isset($_POST['template_choice'])) $ec_qs[3] = $_POST['template_choice'];
}
if (!isset($ec_qs[3])) $ec_qs[3] = 'default'; // Template
if (isset($_POST['output_type'])) $ec_qs[4] = $_POST['output_type'];
if (!isset($ec_qs[4]) || (($ec_qs[4]) != 'print') && ($ec_qs[4] != 'pdf') ) $ec_qs[4] = 'display';
global $cal_super, $calendar_shortcodes;
$cal_super = $ecal_class->cal_super;
// Get templates, since we may have to give a choice if we're displaying something
// Actually load three in order so they can accumulate, and give the option of overriding other settings
$EVENT_CAL_PDF_HEADER = array();
$EVENT_CAL_PDF_BODY = array();
$EVENT_CAL_PDF_FOOTER = array();
if (is_readable(e_PLUGIN."calendar_menu/ec_pf_template.php")) require_once(e_PLUGIN."calendar_menu/ec_pf_template.php");
if (is_readable(e_PLUGIN."calendar_menu/ec_pf_user_template.php")) require_once(e_PLUGIN."calendar_menu/ec_pf_user_template.php");
if (is_readable(THEME."ec_pf_template.php")) require_once(THEME."ec_pf_template.php");
// Hard-coded alternatives
if (!count($EVENT_CAL_PDF_HEADER)) $EVENT_CAL_PDF_HEADER['default'] = "<br />";
if (!count($EVENT_CAL_PDF_BODY)) $EVENT_CAL_PDF_BODY['default'] = "{EC_MAIL_DATE_START} {EC_MAIL_TIME_START} {EC_MAIL_TITLE}<br />";
if (!count($EVENT_CAL_PDF_FOOTER)) $EVENT_CAL_PDF_FOOTER['default'] = "<br />";
if (!count($EVENT_CAL_PDF_NAMES)) $ec_pdf_template = 'default';
// If one name only, we just assign that
if (count($EVENT_CAL_PDF_NAMES) == 1)
{
$ec_pdf_template = array_pop(array_keys($EVENT_CAL_PDF_NAMES));
// echo "Assign template: ".$ec_pdf_template."<br />";
}
$ec_enable_pdf = ($pref['eventpost_printlists'] > 1) && is_readable(e_PLUGIN."pdf/e107pdf.php");
if (!isset($ec_qs[0]) || !isset($ec_qs[1]))
{
// Put up a prompt to get the view period
require_once(HEADERF);
$cal_text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."'>
<table style='".USER_WIDTH."' class='fborder'>
<colgroup>
<col width = '60%';vertical-align:top; />
<col width = '40%';vertical-align:top; />
</colgroup>";
$cal_text .= "<tr>
<td class='forumheader3'>".EC_LAN_153."</td>
<td class='forumheader3' style='text_align:center'>";
$cal_text .= gen_drop(FALSE)."</td>
</tr><tr>
<td class='forumheader3'>".EC_LAN_154."</td>
<td class='forumheader3' style='text_align:center'>".gen_drop(TRUE)."</td>
</tr><tr>
<td class='forumheader3'>".EC_LAN_155."</td>
<td class='forumheader3' style='text_align:center'>";
$cal_text .= $tp->parseTemplate('{EC_NAV_CATEGORIES=nosubmit}',FALSE,$calendar_shortcodes);
$cal_text .= "</td>
</tr>";
if (isset($EVENT_CAL_PDF_NAMES) && is_array($EVENT_CAL_PDF_NAMES) && (count($EVENT_CAL_PDF_NAMES) > 1))
{ // Offer choice of templates
$cal_text .= "<tr>
<td class='forumheader3'>".EC_LAN_157."</td>
<td class='forumheader3' style='text_align:center'><select name='template_choice' class='tbox' style='width:140px;' >\n";
foreach($EVENT_CAL_PDF_NAMES as $ec_template_name => $ec_template_choice)
{
$cal_text .= "<option value='{$ec_template_name}'>{$ec_template_choice}</option>\n";
}
$cal_text .= "</select></td>
</tr>\n";
}
// Radio buttons to select output type
$cal_text .= "<tr>
<td class='forumheader3'>".EC_LAN_158."</td>
<td class='forumheader3' style='text_align:center'>";
$cal_text .= "
<input type='radio' name='output_type' value='display' checked='checked' /> ".EC_LAN_159."<br />
<input type='radio' name='output_type' value='print' /> ".EC_LAN_160."<br />";
if ($ec_enable_pdf)
{
$cal_text .= "<input type='radio' name='output_type' value='pdf' /> ".EC_LAN_161;
}
$cal_text .="</td></tr>";
$cal_text .= "<tr><td colspan='2' style='text-align:center' class='fcaption'><input class='button' type='submit' name='set_dates' value='".EC_LAN_156."' /></td></tr>";
$cal_text .= "</table></form></div>";
$ns->tablerender(EC_LAN_150, $cal_text);
require_once(FOOTERF);
exit;
}
if (!is_numeric($ec_start_date = decode_date($ec_qs[0],FALSE)))
{
$message = $ec_start_date;
}
elseif (!is_numeric($ec_end_date = decode_date($ec_qs[1],TRUE)))
{
$message = $ec_end_date;
}
elseif ($ec_start_date >= $ec_end_date)
{
$message = EC_LAN_151;
}
elseif (($ec_end_date - $ec_start_date) > 366*86400)
{
$message = EC_LAN_152;
}
// That's the vetting of the query done (as much as we'll do)
if ($message !== "")
{
require_once(HEADERF);
$ns->tablerender(EC_LAN_80, $message);
require_once(FOOTERF);
exit;
}
global $ec_current_month, $thisevent_start_date, $thisevent_end_date, $ec_output_type, $ec_category_list, $ec_list_title;
$ec_output_type = $ec_qs[4];
if (isset($ec_qs[5])) $ec_list_title = $ec_qs[5]; else $ec_list_title = EC_LAN_163;
$ec_list_title = str_replace('_',' ',$ec_list_title);
if (($ec_output_type == 'pdf') && !$ec_enable_pdf) $ec_output_type = 'display';
if ($ec_output_type == 'display') require_once(HEADERF);
// Allow a number of categories separated by a '&'
$cat_filter = 0;
$ec_category_list = EC_LAN_97; // Displayable version of categories - default to 'all'
if (isset($ec_qs[2]) && ($ec_qs[2] != '*'))
{
$ec_category_list = array();
$temp = explode('&',$ec_qs[2]);
foreach($temp as $t1)
{
if (!is_numeric($t1)) unset($t1);
}
// Now look up the category names in the database - check access rights at the same time
$temp = array(); // Accumulate valid category IDs
$cal_qry = "SELECT event_cat_id, event_cat_name FROM #event_cat WHERE find_in_set(event_cat_id, '{$ec_qs[2]}') ".$ecal_class->extra_query;
if ($sql->db_Select_gen($cal_qry))
{
while ($thiscat = $sql->db_Fetch())
{
$temp [] = $thiscat['event_cat_id'];
$ec_category_list[] = $thiscat['event_cat_name'];
}
$cat_filter = implode(',',$temp); // Gives us a comma separated numeric set of categories
}
else
{
echo EC_LAN_100."<br /><br />";
exit;
}
}
// $ec_start_date - earliest date of period
// $ec_end_date - latest date of period
// We'll potentially need virtually all of the event-related fields, so get them regardless. Just cut back on category fields
$ev_list = $ecal_class->get_events($ec_start_date, $ec_end_date, FALSE, $cat_filter, TRUE, '*', 'event_cat_name,event_cat_icon');
// Now go through and multiply up any recurring records
$tim_arr = array();
foreach ($ev_list as $k=>$event)
{
if (is_array($event['event_start']))
{
foreach ($event['event_start'] as $t)
{
$tim_arr[$t] = $k;
}
}
else
{
$tim_arr[$event['event_start']] = $k;
}
}
ksort($tim_arr); // Sort into time order
if (isset($ec_qs[3])) $ec_pdf_template = $ec_qs[3];
if (!isset($ec_pdf_template) || !array_key_exists($ec_pdf_template,$EVENT_CAL_PDF_NAMES)) $ec_pdf_template = 'default';
// These available to templates/shortcodes to pick up change of start day/month/year
global $ec_last_year, $ec_last_month, $ec_last_day, $ec_year_change, $ec_month_change, $ec_day_change;
global $ec_start_date, $ec_end_date, $ec_pdf_options;
$ec_last_year = 0;
$ec_last_month = 0;
$ec_last_day = 0;
$ec_pdf_options = ""; // Can configure the PDF driver
$cal_text = "";
$cal_totev = count($ev_list);
if ($cal_totev > 0)
{
if (isset($ec_template_styles[$ec_pdf_template]) && is_array($ec_template_styles[$ec_pdf_template]))
{
$ec_current_overrides = $ec_template_styles[$ec_pdf_template]; // Possible array of codes to override standard $sc_style
$sc_style = array_merge($sc_style,$ec_current_overrides); // Override as necessary
}
// If printing, wrap in a form so the button works
if ($ec_output_type == 'print') $cal_text .= "<form action=''>\n";
// Add header
$cal_text .= $tp->parseTemplate($EVENT_CAL_PDF_HEADER[$ec_pdf_template],TRUE,$calendar_shortcodes);
// Debug code
// echo "Start date: ".strftime("%d-%m-%Y %H:%M:%S",$ec_start_date)."<br />";
// echo "End date: ".strftime("%d-%m-%Y %H:%M:%S",$ec_end_date)."<br />";
// echo "Template: ".$ec_pdf_template,"<br />";
// echo "Header: ".$EVENT_CAL_PDF_HEADER[$ec_pdf_template]."<br />";
// echo "Body: ".$EVENT_CAL_PDF_BODY[$ec_pdf_template]."<br />";
// echo "Footer: ".$EVENT_CAL_PDF_FOOTER[$ec_pdf_template]."<br />";
foreach ($tim_arr as $tim => $ptr)
{
$ev_list[$ptr]['event_start'] = $tim;
$thisevent = $ev_list[$ptr];
// echo "Event: ".$thisevent['event_start']." ".$thisevent['event_title']."<br />";
// Decode dates into individual fields - we're bound to want them
$thisevent_start_date = $ecal_class->gmgetdate($thisevent['event_start']);
$thisevent_end_date = $ecal_class->gmgetdate($thisevent['event_end']);
$ec_year_change = ($ec_last_year != $thisevent_start_date['year']);
$ec_month_change = ($ec_last_month != $thisevent_start_date['mon']);
$ec_day_change = ($ec_last_day != $thisevent_start_date['mday']);
$cal_totev --; // Can use this to modify inter-event gap
$cal_text .= $tp->parseTemplate($EVENT_CAL_PDF_BODY[$ec_pdf_template],FALSE,$calendar_shortcodes);
$ec_last_year = $thisevent_start_date['year'];
$ec_last_month = $thisevent_start_date['mon'];
$ec_last_day = $thisevent_start_date['mday'];
}
// Add footer
$cal_text .= $tp->parseTemplate($EVENT_CAL_PDF_FOOTER[$ec_pdf_template],FALSE,$calendar_shortcodes);
if ($ec_output_type == 'print') $cal_text .= "</form>\n";
}
else
{
$cal_text.= EC_LAN_148;
}
switch ($ec_output_type)
{
case 'display':
$ns->tablerender(EC_LAN_80, $cal_text, 'ec_pf_page');
require_once(FOOTERF);
break;
case 'print' :
echo $cal_text;
break;
case 'pdf' :
$lan_file = e_PLUGIN."pdf/languages/".e_LANGUAGE.".php";
include_once(file_exists($lan_file) ? $lan_file : e_PLUGIN."pdf/languages/English.php");
define('FPDF_FONTPATH', 'font/');
require_once(e_PLUGIN."pdf/ufpdf.php"); //require the ufpdf class
require_once(e_PLUGIN."pdf/e107pdf.php"); //require the e107pdf class
if ($ec_pdf_options == "")
$pdf = new e107PDF();
else
$pdf = new e107PDF($ec_pdf_options);
// $text = array($text, $creator, $author, $title, $subject, $keywords, $url);
$text = array($cal_text,'', '', EC_LAN_163,'','',e_SELF.e_QUERY);
$pdf->makePDF($text);
break;
}
function decode_date($date_string,$last_day = FALSE)
{ // Decode a date string
if (strpos($date_string,'now') === 0)
{ // decode special dates
$today = getdate();
$date_string = trim(substr($date_string,3)); // Knock off the 'now'
if (($date_string != '') && ($date_string[0] == '+'))
{
$date_string = trim(substr($date_string,1)); // Knock off the '+'
if (is_numeric($date_string) && ($date_string >= 0) && ($date_string <= 12))
{
$today['mon'] += $date_string;
if ($today['mon'] > 12)
{
$today['mon'] -= 12;
$today['year'] += 1;
}
}
else
{
return EC_LAN_149;
}
}
$date_string = $today['year'].$today['mon'];
}
if (ctype_digit($date_string))
{
$month = 0;
$day = 1;
if (strlen($date_string) == 5) $date_string = substr_replace($date_string,'0',-1,0);
if (strlen($date_string) == 8)
{
$day = substr($date_string,-2,2);
if ($last_day) $day += 1;
}
elseif (strlen($date_string) == 6)
{
if ($last_day) $month = 1;
}
else
{ // Error
return EC_LAN_149;
}
$month += substr($date_string,4,2);
$year = substr($date_string,0,4);
$temp = mktime(0,0,0,$month,$day,$year);
if ($last_day) $temp -= 1; // Always do this to get whole of last day
return $temp;
}
else
{ // Error
return EC_LAN_149;
}
}
// Generate monthly drop-down - FALSE = first, TRUE = last
// For the first date we want beginning of previous year to end of current year
// For the last date we want end of next
function gen_drop($drop_type)
{
$text = "<select name='".($drop_type ? 'end_date' : 'start_date')."' class='tbox' style='width:140px;' >\n";
if ($drop_type)
{
$start_date = strtotime("-3 months");
$match_date = strtotime("+3 months"); // Propose 3-month list
}
else
{
$start_date = strtotime("-9 months");
// $match_date = strtotime("-1 months");
$match_date = time(); // Use current month for start date
}
// Get date to be 1st of month
$date = getdate($match_date);
$match_date = mktime(0,0,0,$date['mon'],1,$date['year'],FALSE);
for ($i = 0; $i < 24; $i++)
{
$sel_text = (($match_date == $start_date) ? "selected='selected'" : "");
$date = getdate($start_date);
$text .= "<option value = '{$date['year']}{$date['mon']}' {$sel_text}>{$date['month']} {$date['year']} </option>\n";
$start_date = mktime(0,0,0,$date['mon']+1,1,$date['year'],FALSE);
}
$text .= "</select>\n";
return $text;
}
?>

View File

@@ -0,0 +1,86 @@
<?php
/*
Templates file for the event calendar listings (display/print/pdf).
There can be more than one template defined, in which case they are selectable.
There are four strings to define:
$EVENT_CAL_PDF_NAMES[] - a 'user-friendly' name/description (shown in selection box)
$EVENT_CAL_PDF_HEADER[] - the template for the header - displayed once at the top pf the list
$EVENT_CAL_PDF_BODY[] - template for each individual entry
$EVENT_CAL_PDF_FOOTER[] - template for a footer (to close off the list)
The array index defines the name of the template - if there is an entry in the $EVENT_CAL_PDF_NAMES[]
array, there must be a corresponding entry in each of the other three arrays.
There are two ways of managing the styling of the various shortcodes:
a) The $sc_style array works in the usual way, and should be used where the styling is the same
for all templates, or where you can set a 'default' styling which applies to most uses of the shortcode
b) An $ec_template_styles array sets styles for an individual template. This need only contain the
styles which override a default $sc_style entry.
*/
if (!defined('e107_INIT')) { exit; }
if (!defined("USER_WIDTH")){ define("USER_WIDTH","width:auto"); }
$sc_style['EC_PR_CHANGE_YEAR']['pre'] = '<br /><em><strong>';
$sc_style['EC_PR_CHANGE_YEAR']['post'] = '</strong></em>';
$sc_style['EC_PR_CHANGE_MONTH']['pre'] = '<br /><strong>';
$sc_style['EC_PR_CHANGE_MONTH']['post'] = '</strong><br />';
$sc_style['EC_PRINT_BUTTON']['pre'] = "<br /><div style='text-align:center'>";
$sc_style['EC_PRINT_BUTTON']['post'] = "</div>";
$sc_style['EC_NOW_DATE']['pre'] = EC_LAN_170;
$sc_style['EC_NOW_DATE']['post'] = "";
$sc_style['EC_NOW_TIME']['pre'] = EC_LAN_144;
$sc_style['EC_NOW_TIME']['post'] = "";
$sc_style['EC_PR_CAT_LIST']['pre'] = EC_LAN_172;
$sc_style['EC_PR_CAT_LIST']['post'] = "";
$sc_style['EC_PR_LIST_TITLE']['pre'] = "<h3>";
$sc_style['EC_PR_LIST_TITLE']['post'] = "</h3>";
// - Default style - very basic
$EVENT_CAL_PDF_NAMES['default'] = EC_LAN_165;
$EVENT_CAL_PDF_HEADER['default'] = "{EC_PR_LIST_TITLE}<br />{EC_PR_CAT_LIST}<br />".EC_LAN_168."{EC_PR_LIST_START=%d-%m-%Y}<br />".EC_LAN_169."{EC_PR_LIST_END=%d-%m-%Y}<br />";
$EVENT_CAL_PDF_BODY['default'] = "{EC_PR_CHANGE_YEAR}{EC_PR_CHANGE_MONTH}{EC_MAIL_SHORT_DATE} {EC_MAIL_TIME_START} {EC_MAIL_TITLE}<br />\n";
$EVENT_CAL_PDF_FOOTER['default'] = "---End of List---<br />{EC_IFNOT_DISPLAY=EC_NOW_DATE}{EC_IFNOT_DISPLAY=EC_NOW_TIME}<br />{EC_PRINT_BUTTON}";
// - A simple tabular style
$ec_template_styles['simple']['EC_PR_CHANGE_YEAR']['pre'] = "<tr><td colspan='4'><em><strong><br />";
$ec_template_styles['simple']['EC_PR_CHANGE_YEAR']['post'] = '</strong></em></td></tr>';
$ec_template_styles['simple']['EC_PR_CHANGE_MONTH']['pre'] = '<strong>';
$ec_template_styles['simple']['EC_PR_CHANGE_MONTH']['post'] = '</strong>';
$EVENT_CAL_PDF_NAMES['simple'] = EC_LAN_166;
$EVENT_CAL_PDF_HEADER['simple'] = "{EC_IF_PRINT=LOGO}<table border='0px' cellspacing='10px' cellpadding='5px'>
<colgroup> <col width='15%'><col width='10%'><col width='10%'><col width='65%'></colgroup>
<tr ><td colspan='4' style='text-align:center'>".EC_LAN_163."<br />".EC_LAN_168."{EC_PR_LIST_START=%d-%m-%Y}<br />".EC_LAN_169."{EC_PR_LIST_END=%d-%m-%Y}</td></tr>";
$EVENT_CAL_PDF_BODY['simple'] = "{EC_PR_CHANGE_YEAR}<tr><td>{EC_PR_CHANGE_MONTH}&nbsp;</td>
<td>{EC_MAIL_DATE_START=%a %d}</td><td>{EC_MAIL_TIME_START}</td><td>{EC_MAIL_TITLE}</td></tr>\n";
$EVENT_CAL_PDF_FOOTER['simple'] = "</table><br /><br />{EC_IFNOT_DISPLAY=EC_NOW_DATE}{EC_IFNOT_DISPLAY=EC_NOW_TIME} <br />{EC_PRINT_BUTTON}";
// - A tabular style with lines round the cells
$ec_template_styles['tlinclines']['EC_PR_CHANGE_YEAR']['pre'] = "<tr><td colspan='3'><em><strong><br />";
$ec_template_styles['tlinclines']['EC_PR_CHANGE_YEAR']['post'] = '</strong></em></td></tr>';
$EVENT_CAL_PDF_NAMES['tlinclines'] = EC_LAN_167;
$EVENT_CAL_PDF_HEADER['tlinclines'] = "<table border='1px' cellspacing='0px' cellpadding='5px'>
<colgroup> <col width='22%'><col width='8%'><col width='70%'></colgroup>
<tr ><td colspan='4' style='text-align:center'>".EC_LAN_163."<br />".EC_LAN_168."{EC_PR_LIST_START=%d-%m-%Y}<br />".EC_LAN_169."{EC_PR_LIST_END=%d-%m-%Y}<br /></td></tr>";
$EVENT_CAL_PDF_BODY['tlinclines'] = "{EC_PR_CHANGE_YEAR}<tr>
<td>{EC_MAIL_DATE_START}</td><td>{EC_MAIL_TIME_START}</td><td>{EC_MAIL_TITLE}</td></tr>\n";
$EVENT_CAL_PDF_FOOTER['tlinclines'] = "</table><br /><br />{EC_IFNOT_DISPLAY=EC_NOW_DATE=%d-%m-%y}{EC_IFNOT_DISPLAY=EC_NOW_TIME}{EC_PRINT_BUTTON}";
// - A tabular style with lines round the cells and categories
$ec_template_styles['tlinccatlines']['EC_PR_CHANGE_YEAR']['pre'] = "<tr><td colspan='4'><em><strong><br />";
$ec_template_styles['tlinccatlines']['EC_PR_CHANGE_YEAR']['post'] = '</strong></em></td></tr>';
$EVENT_CAL_PDF_NAMES['tlinccatlines'] = EC_LAN_171;
$EVENT_CAL_PDF_HEADER['tlinccatlines'] = "<table border='1px' cellspacing='0px' cellpadding='5px'>
<colgroup> <col width='12%'><col width='8%'><col width='18%'><col width='62%'></colgroup>
<tr ><td colspan='4' style='text-align:center'>".EC_LAN_163."<br />".EC_LAN_168."{EC_PR_LIST_START=%d-%m-%Y}<br />".EC_LAN_169."{EC_PR_LIST_END=%d-%m-%Y}<br /></td></tr>";
$EVENT_CAL_PDF_BODY['tlinccatlines'] = "{EC_PR_CHANGE_YEAR}<tr>
<td>{EC_MAIL_DATE_START=%D %d %b}</td><td>{EC_MAIL_TIME_START}</td><td>{EC_MAIL_CATEGORY}</td><td>{EC_MAIL_TITLE}</td></tr>\n";
$EVENT_CAL_PDF_FOOTER['tlinccatlines'] = "</table><br /><br />{EC_IFNOT_DISPLAY=EC_NOW_DATE=%d-%m-%y}{EC_IFNOT_DISPLAY=EC_NOW_TIME}{EC_PRINT_BUTTON}";
?>

View File

@@ -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 $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 showing 'recent events'
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'];
if ($pref['eventpost_recentshow'] == 'LV')
{
if (USER) $this->max_recent_show = time() - USERLV;
}
else
{
$this->max_recent_show = 0;
$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]."<br />";
if ($event_start > 0)
{
$cmessage .= "Event Start: ".strftime("%d-%B-%Y",$event_start)."<br />";
$cmessage .= "Event Link: ".$pref['siteurl'].$PLUGINS_DIRECTORY. "calendar_menu/event.php?".$event_start." <br />";
}
else
$cmessage .= "Event Start unknown<br />";
$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."&nbsp;\n".$event_string,4);
}
function get_category_text($ev_cat)
{
global $sql;
if (!isset($this->cat_text_cache[$ev_cat]))
{
$sql->db_Select('event_cat','event_cat_name',"event_cat_id='{$ev_cat}'");
$row = $sql->db_Fetch();
$this->cat_text_cache[$ev_cat] = $row['event_cat_name'];
}
return $this->cat_text_cache[$ev_cat];
}
// Implements a version of getdate that expects a GMT date and doesn't do TZ/DST adjustments
// time() -date('Z') gives the correction to 'null out' the TZ and DST adjustments that getdate() does
function gmgetdate($date)
{
return getdate($date-date('Z'));
}
//------------------------------------------------
// Recurring event handling
//------------------------------------------------
// Generate a list of recurring events based on a 'first event' date, an interval and start/finish times
// Returns an array of times
function gen_recur_regular($first_event, $last_event, $interval, $start_time, $end_time)
{
if ($last_event < $end_time) $end_time = $last_event;
$ret = array();
$first_event = $first_event + ceil(($start_time-$first_event)/$interval)*$interval;
while ($first_event <= $end_time)
{
$ret[] = $first_event;
$first_event += $interval;
}
return $ret;
}
function add_dates($main_date,$adder)
{ // Adds an offset of months and years to a date
if ($adder['mon'])
{
$main_date['mon'] += $adder['mon'];
if ($main_date['mon'] > 12)
{
$main_date['mon'] -= 12;
$main_date['year']++;
}
}
if ($adder['year']) $main_date['year'] += $adder['year'];
return $main_date;
}
// Generate a list of recurring events based on a 'first event' date, an interval type and start/finish window
// For day number, '0' = 'Sunday'
function gen_recur($first_event, $last_event, $interval_type, $start_time, $end_time)
{
if ($last_event < $end_time) $end_time = $last_event;
$ret = array();
$week_offset = 0;
if ($interval_type >= 100)
{
$week_offset = intval($interval_type /100);
$day_number = $interval_type % 10; // Gives 0..6 in practice; potentially 0..9
$interval_type = 100;
}
if ($first_event > $end_time) return $ret;
$interval = array('5' => 28*86400, '6' => 14*86400, '7' => 7*86400, '8' => 86400);
// Do the easy ones first
if (array_key_exists($interval_type, $interval)) return $this->gen_recur_regular($first_event, $last_event, $interval[$interval_type], $start_time, $end_time);
// We're messing around with months and years here
$inc_array['year'] = 0;
$inc_array['mon'] = 0;
// Find the first date which is within, or close to, scope (N.B. may not be one)
$event = $this->gmgetdate($first_event);
$temp = $this->gmgetdate($start_time);
$event['year'] = $temp['year']; // Use the year from the start window
if ($event['mon'] > $temp['mon']) $event['year']--; // Handle situation where event later in year than desired window
switch ($interval_type)
{
case 1 : // Annual
$inc_array['year'] = 1;
break;
case 2 : // Biannual
$inc_array['mon'] = 6;
break;
case 3 : // Quarterly
$inc_array['mon'] = 3;
break;
case 4 : // Monthly
$inc_array['mon'] = 1;
break;
case 100 : // Monthly on nth Sunday in month
case 101 : // Monthly on nth Monday in month
case 102 : // Monthly on nth Tuesday in month
case 103 : // Monthly on nth Wednesday in month
case 104 : // Monthly on nth Thursday in month
case 105 : // Monthly on nth Friday in month
case 106 : // Monthly on nth Saturday in month
// echo "Specific day of month: ".$day_number."<br />";
$inc_array['mon'] = 1;
$event['mon'] = $temp['mon'];
$event['year'] = $temp['year'];
$event['mday'] = 1; // Start calculating from first day of each month
break;
default :
return FALSE; // Invalid interval type
}
// echo "First date: ".$event['mon']."-".$event['year']."<br />";
// Now loop through using the increment - we may discard a few, but getting clever may be worse!
$cont = TRUE;
do {
$tstamp = gmmktime($event['hours'],$event['minutes'],$event['seconds'],$event['mon'],$event['mday'],$event['year']);
if ($interval_type >= 100)
{ // $tstamp has the first of the month
// $dofwk = gmdate('w',$tstamp);
$day_diff = $day_number - gmdate('w',$tstamp);
if ($day_diff <0) $day_diff += 7;
$day_diff += (7 * $week_offset) - 7;
// echo "Day difference = ".$day_diff." Stamp=".$tstamp." Week day: ".$dofwk."<br />";
$tstamp += $day_diff*86400;
}
if ($tstamp >= $start_time)
{
if ($tstamp <= $end_time)
{
$ret[] = $tstamp;
}
else
{
$cont = FALSE;
}
}
$event = $this->add_dates($event,$inc_array);
} while ($cont);
return $ret;
}
// Generate comma separated list of fields for table, with optional alias prefix.
function gen_field_list($table, $list, $must_have = '')
{
if ($list == '*') return $table ? $table.".*" : '*';
$ret = '';
$pad = '';
$temp = explode(',',$list);
for ($i = 0; $i < count($temp); $i++) $temp[$i] = trim($temp[$i]);
if ($must_have)
{
$mharr = explode(',',$must_have);
foreach ($mharr as $mh)
{
if (!in_array(trim($mh), $temp)) $temp[] = trim($mh);
}
}
foreach ($temp as $fld)
{
if ($fld)
{
if ($table) $fld = $table.'.'.$fld;
$ret .= $pad.$fld;
$pad = ', ';
}
}
return $ret;
}
// Read a list of events between start and end dates
// If $start_only is TRUE, only searches based on the start date/time
// Potential option to hook in other routines later
function get_events($start_time, $end_time, $start_only=FALSE, $cat_filter=0, $inc_recur=FALSE, $event_fields='*', $cat_fields='*')
{
global $sql;
$ret = array();
$cat_lj = '';
$category_filter = '';
$extra = '';
$so = '';
$event_fields = $this->gen_field_list('e',$event_fields,'event_start,event_end,event_datestamp');
if ($cat_fields)
{
$cat_fields = ', '.$this->gen_field_list('ec',$cat_fields);
$cat_lj = ' LEFT JOIN #event_cat as ec ON e.event_category = ec.event_cat_id ';
}
if ($cat_filter && ($cat_filter != '*')) $category_filter = " AND find_in_set(e.event_category, '".$cat_filter."') ";
if ($inc_recur) $extra = " OR (e.event_recurring >'0' AND (e.event_start <= ".intval($end_time)." AND e.event_end >= ".intval($start_time).")) ";
/*
if (!$start_only) $so = "OR (e.event_end >= ".intval($start_time)." AND e.event_end <= ".intval($end_time).")
OR (e.event_start <= ".intval($start_time)." AND e.event_end >= ".intval($end_time).") ";
$qry = "SELECT {$event_fields}{$cat_fields} FROM #event as e {$cat_lj}
WHERE (
(e.event_recurring = '0' AND ((e.event_start >= ".intval($start_time)." AND e.event_start <= ".intval($end_time).") {$so}))
{$extra})
{$category_filter}
{$this->extra_query}
ORDER BY e.event_start ASC
";
*/
$so = $start_only ? 'start' : 'end';
$qry = "SELECT {$event_fields}{$cat_fields} FROM #event as e {$cat_lj}
WHERE (
(e.event_recurring = '0' AND ((e.event_{$so} >= ".intval($start_time)." AND e.event_start <= ".intval($end_time).")))
{$extra})
{$category_filter}
{$this->extra_query}
ORDER BY e.event_start ASC
";
if ($sql->db_Select_gen($qry))
{
while ($row = $sql->db_Fetch())
{
// Always add the 'is_recent' marker if required
if ((($this->max_recent_show != 0) && (time() - $row['event_datestamp']) <= $this->max_recent_show)) $row['is_recent'] = TRUE;
if ($row['event_recurring'] == 0)
{
$ret[] = $row;
}
else
{ // Recurring events to handle
$temp = $this->gen_recur($row['event_start'],$row['event_end'],$row['event_recurring'],$start_time,$end_time);
if (count($temp))
{
$row['event_start'] = $temp; // Have an array of start times
$ret[] = $row;
}
}
}
}
return $ret;
}
// Function to return up to a maximum number of events between a given start and end date
// It always uses the event start date only
// It tries to keep the actual number of events in memory to a minimum by discarding when it can.
// Once there are $num_events read, it pulls in the $end_time to speed up checks
function get_n_events($num_event, $start_time, $end_time, $cat_filter=0, $inc_recur=FALSE, $event_fields='*', $cat_fields='*')
{
global $sql;
$ret = array();
$cat_lj = '';
$category_filter = '';
$extra = '';
$event_fields = $this->gen_field_list('e',$event_fields,'event_start,event_end,event_datestamp,event_recurring');
if ($cat_fields)
{
$cat_fields = ', '.$this->gen_field_list('ec',$cat_fields);
$cat_lj = ' LEFT JOIN #event_cat as ec ON e.event_category = ec.event_cat_id ';
}
if ($cat_filter) $category_filter = " AND find_in_set(e.event_category, '".$cat_filter."') ";
if ($inc_recur) $extra = " OR (e.event_recurring >'0' AND (e.event_start <= ".intval($end_time)." AND e.event_end >= ".intval($start_time).")) ";
$qry = "SELECT {$event_fields}{$cat_fields} FROM #event as e {$cat_lj}
WHERE (
(e.event_recurring = '0' AND (e.event_start >= ".intval($start_time)." AND e.event_start <= ".intval($end_time).") )
{$extra})
{$category_filter}
{$this->extra_query}
ORDER BY e.event_start ASC
";
// echo "get_n_events Query: ".$qry."<br />";
if ($sql->db_Select_gen($qry))
{
while ($row = $sql->db_Fetch())
{
// Always add the 'is_recent' marker if required
if ((($this->max_recent_show != 0) && (time() - $row['event_datestamp']) <= $this->max_recent_show)) $row['is_recent'] = TRUE;
unset($temp);
if ($row['event_recurring'] == 0)
{
// echo "Standard: ".$row['event_start']." ".$row['event_title']."<br />";
$temp = array($row['event_start']);
}
else
{ // Recurring events to handle
// echo "Recurring: ".$row['event_start']." ".$row['event_title']." - ".$row['event_recurring']." - ";
$temp = $this->gen_recur($row['event_start'],$row['event_end'],$row['event_recurring'],$start_time,$end_time);
// echo count($temp)."results generated<br />";
}
if (count($temp))
{ // We have one or more events to add to the array
foreach ($temp as $ts)
{
// echo "Process: ".$ts." ".$row['event_start']." ".$row['event_title']." ".$end_time."<br />";
if ($ts <= $end_time) // We may have pulled in $end_time from the value passed initially
{
$row['event_start'] = $ts; // Fill this in - may be a recurring event
// echo "Add: ".$row['event_start']." ".$row['event_title']."<br />";
if ((count($ret) == 0) || ($ts > $ret[count($ret)-1]['event_start']))
{ // Can just add on end
// echo "Add at end<br />";
$ret[] = $row;
}
else
{ // Find a slot
$i = count($ret);
while (($i > 0) && ($ret[$i-1]['event_start'] > $ts)) $i--;
// $i has the number of the event before which to insert this new event.
if ($i == 0)
{
array_unshift($ret,$row); // Just insert at beginning
// echo "Insert at front<br />";
}
else
{ // Proper insert needed just before element $i
// $tmp = array_unshift(array_slice($ret, $i),$row);
// array_splice($ret, $i, count($ret), $tmp);
array_splice($ret, $i, count($ret), array_merge(array($row),array_slice($ret, $i)));
// echo "Insert at ".$i."<br />";
}
}
}
if (count($ret) > $num_event)
{ // Knock one off the end
// echo "Delete, count is ".count($ret)."<br />";
if ($ret[count($ret)-1]['event_start'] < $end_time) $end_time = $ret[count($ret)-1]['event_start']; // Pull in end time if we can
array_pop($ret);
}
}
}
}
}
return $ret;
} // End - function get_n_events()
function get_recur_text($recurring)
{
if ($recurring >= 100)
{
return $this->recur_week[100*intval($recurring/100)]." ".$this->recur_type[100+($recurring % 10)];
}
else
{
return $this->recur_type[$recurring];
}
}
}// End - class definition
?>

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 B

View File

@@ -11,13 +11,10 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/languages/English.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 $
|
| Various mods by steved:
| a) To reflect updates
| b) To reflect CVS update to version 1.14 made 29.10.06
+----------------------------------------------------------------------------+
*/
@@ -113,7 +110,7 @@ define('EC_LAN_37', "None Listed.");
define('EC_LAN_38', "Not specified");
define('EC_LAN_39', "Click here for more information");
define('EC_LAN_40', "Current Month");
define('EC_LAN_41', "New category created.");
define('EC_LAN_41', "Total -NUM- individual events created");
define('EC_LAN_42', "Event cannot end before it starts.");
define('EC_LAN_43', "You left required field(s) blank.");
define('EC_LAN_44', "New event created and entered into database.");
@@ -135,7 +132,7 @@ define('EC_LAN_59', "Contact email:");
define('EC_LAN_60', "Update Event");
define('EC_LAN_61', "Go");
define('EC_LAN_62', "Next -NUM- Events ...");
define('EC_LAN_63', "Check this if event happens on same day every year, e.g. birthday");
define('EC_LAN_63', "Select repeating events between start and end dates. Start and end time as set");
define('EC_LAN_64', "Check for an all-day event");
define('EC_LAN_65', "Recurring:");
define('EC_LAN_66', "Edit Event");
@@ -146,22 +143,7 @@ define('EC_LAN_70', "Event Title:");
define('EC_LAN_71', "Event Time:");
define('EC_LAN_72', "Event Date:");
define('EC_LAN_73', "End:");
//define('edesc_LAN_0', "Count Down");
//define('edesc_LAN_1', "Still ");
//define('edesc_LAN_2', "before event on ".SITENAME);
//define('edesc_LAN_3', "sec");
//define('edesc_LAN_4', "secs");
//define('edesc_LAN_5', "min");
//define('edesc_LAN_6', "mins");
//define('edesc_LAN_7', "h");
//define('edesc_LAN_8', "h");
//define('edesc_LAN_9', "day");
//define('edesc_LAN_10', "days");
define('EC_LAN_VIEWCALENDAR', "View Calendar");
define('EC_LAN_VIEWALLEVENTS', "View all events");
define('EC_LAN_ALLEVENTS', "All events");
define('EC_LAN_74', "View Category");
// ADMIN
define('EC_LAN_75', "Calendar settings updated.");
define('EC_LAN_76', "Events can be added by:");
define('EC_LAN_77', "Update Settings");
@@ -171,17 +153,15 @@ define('EC_LAN_80', "Event List");
define('EC_LAN_81', "Configure Event Calendar");
define('EC_LAN_82', "To activate please go to your menus screen and select the calendar_menu into one of your menu areas.");
define('EC_LAN_83', "Calendar");
define('EC_LAN_84', " from ");
define('EC_LAN_85', " until ");
define('EC_LAN_86', "Individual events from entry");
define('EC_LAN_87', "By checking this box you may generate a large number of individual events, which you will have to edit or delete individually if they are wrong");
define('EC_LAN_88', "You have chosen to generate -NUM- individual events.");
define('EC_LAN_89', "If the entry is wrong, you will have to edit or delete the entries individually");
//define('EC_LAN_84', "Css element to use for day header");
//define('EC_LAN_85', "Default is 'forumheader'");
//define('EC_LAN_86', "Css element to use for day list");
//define('EC_LAN_87', "Default is 'forumheader3'");
//define('EC_LAN_88', "Css element to use for selected day");
//define('EC_LAN_89', "Default is 'indent'");
// *BK* Corrections to hard coding by Barry
define('EC_LAN_90', "Choose");
define('EC_LAN_91', "None defined");
define('EC_LAN_91', "Admin must define first");
define('EC_LAN_92', "View Category");
define('EC_LAN_93', "View Events List");
define('EC_LAN_94', "Enter New Event");
@@ -190,7 +170,7 @@ define('EC_LAN_96', "View Calendar");
define('EC_LAN_97', "All");
define('EC_LAN_98', "Required fields left blank");
define('EC_LAN_99', "Event must either be an all day event or finish after it starts");
//define('EC_LAN_100', "Categories can be added by");
define('EC_LAN_100', "Invalid Category Selection");
//define('EC_LAN_101', "Set to inactive to disable on the new event form.");
define('EC_LAN_102', "Show link to 'more information' with events");
//define('EC_LAN_103', "On new event entry form.");
@@ -229,13 +209,52 @@ define('EC_LAN_135', "Event");
define('EC_LAN_136', "Category Description");
define('EC_LAN_137', "Future Events");
// Added 12.07.06 for next_event_menu.php
define('EC_LAN_140', "Forthcoming Events");
define('EC_LAN_141', "No forthcoming events");
define('EC_LAN_142', "Only registered and logged in users can subscribe to events");
define('EC_LAN_143', "Facility not available");
define('EC_LAN_144', " at ");
define('EC_LAN_145', "You must specify a category for the event");
define('EC_LAN_146', "Advance notice of calendar event");
define('EC_LAN_147', "Calendar event today or tomorrow");
define('EC_LAN_148', "No events in specified date range");
define('EC_LAN_149', "Invalid date format");
define('EC_LAN_150', "Enter start and end date for list");
define('EC_LAN_151', "End date after start date");
define('EC_LAN_152', "Maximum one year's events");
define('EC_LAN_153', "Start Date (first day of): ");
define('EC_LAN_154', "End Date (last day of): ");
define('EC_LAN_155', "Category: ");
define('EC_LAN_156', "Create List");
define('EC_LAN_157', "Layout Options:");
define('EC_LAN_158', "Output: ");
define('EC_LAN_159', "Display ");
define('EC_LAN_160', "Print ");
define('EC_LAN_161', "PDF ");
define('EC_LAN_162', "Print this page");
define('EC_LAN_163', "Event Listing");
define('EC_LAN_164', "Printable Lists");
define('EC_LAN_165', "Default Listing");
define('EC_LAN_166', "Tabular List no lines");
define('EC_LAN_167', "Tabular List with lines");
define('EC_LAN_168', "From: ");
define('EC_LAN_169', "To: ");
define('EC_LAN_170', "Printed on: ");
define('EC_LAN_171', "List including category");
define('EC_LAN_172', "Event Categories: ");
define('EC_LAN_173', "First event starts: ");
define('EC_LAN_174', "Last event ends: ");
define('EC_LAN_175', "All Day");
define('EC_LAN_176', "Recurring pattern: ");
define('EC_LAN_177', "Cancel Entry");
define('EC_LAN_178', "Accept Entries");
define('EC_LAN_179', "Confirmation of multiple event entry");
define('EC_LAN_180', " RECORDS NOT SAVED - DB UPDATE ERROR");
define('EC_LAN_VIEWCALENDAR', "View Calendar");
define('EC_LAN_VIEWALLEVENTS', "View all events");
define('EC_LAN_ALLEVENTS', "All events");
define('EC_ADLAN_A10', "Configuration");
define('EC_ADLAN_A11', "Categories");
@@ -263,7 +282,7 @@ define('EC_ADLAN_A31', "Tick the confirm box to delete");
define('EC_ADLAN_A32', "Unable to delete this category");
define('EC_ADLAN_A33', "None defined");
define('EC_ADLAN_A34', "Calendar Administrator Class");
define('EC_ADLAN_A35', "");
//define('EC_ADLAN_A35', "");
define('EC_ADLAN_A59', "Category is in use. Can not delete.");
define('EC_ADLAN_A80', "Visible to");
@@ -285,7 +304,6 @@ define('EC_ADLAN_A95', "Enable manual subscriptions");
define('EC_ADLAN_A96', "Disabling this removes the subscriptions button and overrides the category manual subscription setting.");
//define('EC_ADLAN_A97', "If set to force subscriptions this category will not be displayed in the available subscription list for the user.");
// Added from here 12.07.06 for forthcoming events and mailout upgrades
define('EC_ADLAN_A100', "Forthcoming Events");
define('EC_ADLAN_A101', "Days to look forward:");
define('EC_ADLAN_A102', "Number of events to display:");
@@ -293,7 +311,7 @@ define('EC_ADLAN_A103', "Include recurring events:");
define('EC_ADLAN_A104', "Title is link to events list:");
define('EC_ADLAN_A105', "Configure Forthcoming Events Menu");
define('EC_ADLAN_A106', "Menu has to be enabled on the 'Menu' page");
define('EC_ADLAN_A107', "Will not work reliably if looking forward more than 59 days");
define('EC_ADLAN_A107', "Hide menu if no events to show");
define('EC_ADLAN_A108', "Menu Heading");
define('EC_ADLAN_A109', "Forthcoming Events preferences updated");
@@ -363,8 +381,35 @@ define('EC_ADLAN_A168', "Custom date uses the format in the box on the right");
define('EC_ADLAN_A169', "Determines date display format for event listings");
define('EC_ADLAN_A170', "Determines date display format for forthcoming events menu");
define('EC_ADLAN_A171', "Flag recently added/updated events");
define('EC_ADLAN_A172', "Value is time from update in hours; zero to disable");
define('EC_ADLAN_A172', "Value is time from update in hours; zero to disable, 'LV' to show from user's last visit");
define('EC_ADLAN_A173', "Subscriptions");
define('EC_ADLAN_A174', "No subscription entries found");
define('EC_ADLAN_A175', "UID");
define('EC_ADLAN_A176', "User Name");
define('EC_ADLAN_A177', "Category");
define('EC_ADLAN_A178', "Problems");
define('EC_ADLAN_A179', "Actions");
define('EC_ADLAN_A180', "Deleted subscription record no ");
define('EC_ADLAN_A181', "Delete failed for record no ");
define('EC_ADLAN_A182', "Total --NUM-- entries in database");
define('EC_ADLAN_A183', "Calendar Menu mouseover shows event title");
define('EC_ADLAN_A184', "may not work with all browsers");
define('EC_ADLAN_A185', "Nothing");
define('EC_ADLAN_A186', "Update settings\nand send test\nemail to self");
define('EC_ADLAN_A187', "Test email sent - ");
define('EC_ADLAN_A188', "Error sending test email - ");
define('EC_ADLAN_A189', "If the message is left blank, the message from the 'Default' category will be used");
define('EC_ADLAN_A190', "Default category - mailout messages are used if none defined for any other category");
define('EC_ADLAN_A191', "Details of event for test email");
define('EC_ADLAN_A192', "Test event location");
define('EC_ADLAN_A193', "Allow users to display/print/PDF lists");
define('EC_ADLAN_A194', "None");
define('EC_ADLAN_A195', "Display/Print");
define('EC_ADLAN_A196', "Display/Print/PDF");
define('EC_ADLAN_A197', "No class membership");
define('EC_ADLAN_A198', "Invalid User");
define('EC_ADLAN_A199', "Show 'recent' icon");
// Notify
define("NT_LAN_EC_1", "Event Calendar Events");
@@ -376,5 +421,8 @@ define("NT_LAN_EC_6", "Event Calendar - Event added");
define("NT_LAN_EC_7", "New event posted");
define("NT_LAN_EC_8", "Event Calendar - Event modified");
// Prefs - language defines can be used in various places where text is set through the admin screens
define('EC_MAILOUT_SUBJECT', "Advice of calendar event"); // USe shortcode EC_MAIL_SUBJECT
?>

View File

@@ -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())
foreach ($ev_list as $cal_row)
{
$cal_totev --; // Can use this to modify inter-event gap
$cal_text .= $tp->parseTemplate($EVENT_CAL_FE_LINE,FALSE,$calendar_shortcodes);
$cal_text .= $tp->parseTemplate($EVENT_CAL_FE_LINE,TRUE,$calendar_shortcodes);
}
}
else
{
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 = "<a class='forumlink' href='" . e_PLUGIN . "calendar_menu/event.php' >" . $menu_title . "</a>";
$calendar_title = "<a class='forumlink' href='" . e_PLUGIN . "calendar_menu/event.php' >" . $calendar_title . "</a>";
}
// Now handle the data, cache as well
@@ -149,5 +97,6 @@ $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);
?>

View File

@@ -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."<br />";
// Work out query to insert default category here, so we only have to modify one place.
require_once('ecal_class.php'); // Gets the define for the 'Default' category
$ec_insert_entries = "INSERT INTO ".MPREFIX."event_cat (event_cat_name, event_cat_description, event_cat_ahead, event_cat_msg1, event_cat_msg2, event_cat_lastupdate)
VALUES ('".EC_DEFAULT_CATEGORY."', '".EC_ADLAN_A190."', 5,
'Forthcoming event:\n\n{EC_MAIL_CATEGORY}\n\n{EC_MAIL_TITLE} on {EC_MAIL_HEADING_DATE}{EC_MAIL_TIME_START}\n\n".
"{EC_MAIL_DETAILS}\n\nFor further details: {EC_EVENT_LINK=Click Here}\n\nor {EC_MAIL_CONTACT} for further information.', ".
"'Calendar event imminent:\n\n{EC_MAIL_CATEGORY}\n\n{EC_MAIL_TITLE} on {EC_MAIL_HEADING_DATE}{EC_MAIL_TIME_START}\n\n{EC_MAIL_DETAILS}\n\n".
"For further details see the calendar entry on the web site:\n{EC_MAIL_LINK=Click Here}\n\n {EC_MAIL_CONTACT} for further details',
'".intval(time())."') ";
// List of preferences
// -------------------
$eplug_prefs = array(
"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,37 +180,41 @@ $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_url = "".$ec_dir."calendar.php";
$eplug_link_perms = "Everyone"; // Everyone, Guest, Member, Admin
$eplug_link_perms = "everyone"; // Everyone, Guest, Member, Admin
// Text to display after plugin successfully installed ------------------------------------------------------------------
// Text to display after plugin successfully installed
//----------------------------------------------------
$eplug_done = EC_LAN_82; // "To activate please go to your menus screen and select the calendar_menu into one of your menu areas.";
// 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';
function create_ec_log_dir($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))
@@ -186,7 +228,7 @@ $cal_log_dir = e_PLUGIN.$eplug_folder.'/log';
return $response;
}
// Now check directory permissions
// Now check directory permissions
if (!is_writable($cal_log_dir."/"))
{
if (!chmod($cal_log_dir,0666))
@@ -199,15 +241,14 @@ $cal_log_dir = e_PLUGIN.$eplug_folder.'/log';
}
}
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<br />";
$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 .= "<u>3.5</u><br />".EC_ADLAN_A156."<br />";
}
// To version 3.6 - fair number of tweaks overall
if ($ecalVer < 3.6)
// To version 3.60 - fair number of tweaks overall
if ($ecal_ver_num < 360)
{
$upgrade_alter_tables = array(
// echo "Add for V3.6<br />";
$upgrade_alter_tables = array_merge($upgrade_alter_tables,array(
"ALTER TABLE ".MPREFIX."event_cat DROP event_cat_force",
"ALTER TABLE ".MPREFIX."event_cat 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 .= "<u>3.6</u><br />".EC_ADLAN_A156."<br />".create_ec_log_dir()."<br />
$upgrade_add_prefs = array_merge($upgrade_add_prefs,$verprefs);
$version_notes .= "<u>3.6</u><br />".EC_ADLAN_A156."<br />".create_ec_log_dir($eplug_folder)."<br />
<a href='".e_PLUGIN_ABS.$eplug_folder."/".$eplug_conffile."'>Configure</a><br />";
$upgrade_remove_prefs = array(
@@ -274,6 +317,22 @@ $upgrade_alter_tables = array(
}
// Mods for 3.70 - not much
if ($ecal_ver_num < 370)
{
// echo "Add for V3.7<br />";
$upgrade_alter_tables = array_merge($upgrade_alter_tables,array($ec_insert_entries)); // Add the 'default' category
$verprefs = array(
"eventpost_showmouseover" => 0,
"eventpost_fe_hideifnone" => '0',
"eventpost_fe_showrecent" => 0,
"eventpost_printlists" => 1
);
$upgrade_add_prefs = array_merge($upgrade_add_prefs,$verprefs);
$version_notes .= "<u>3.7</u><br />".EC_ADLAN_A164;
}
$eplug_upgrade_done = EC_LAN_108."<br />".$version_notes;

View File

@@ -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 $
+----------------------------------------------------------------------------+
*/

View File

@@ -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")."<br />";
if ($ec_run_from_menu)
{
if ($cacheData = $e107cache->retrieve("nomd5_cal_subs",$ecal_class->max_cache_time, TRUE)) exit;
}
@include_lan(e_PLUGIN."calendar_menu/languages/".e_LANGUAGE.".php"); // May be needed for mailouts
if (!isset($calendar_shortcodes)) require(e_PLUGIN."calendar_menu/calendar_shortcodes.php");
if (is_readable(THEME."ec_mailout_template.php"))
{ // Has to be require
require(THEME."ec_mailout_template.php");
}
else
{
require(e_PLUGIN."calendar_menu/ec_mailout_template.php");
}
$ec_debug_level = 0; // Set to 1 or 2 to suppress actual sending of emails
$ec_default_msg_1 = "";
$ec_default_msg_2 = "";
if (($ec_debug_level > 0) && e_QUERY)
{ // Run with query of ?dd-mm[-yy] to test specific date
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."<br />";
static $handle = NULL;
$log_filename = e_PLUGIN."calendar_menu/log/calendar_mail.txt";
if ($handle == NULL)
{
if (!($handle = fopen($log_filename, "a")))
{ // Problem creating file?
echo "File open failed!<br />";
$ec_log_requirement = 0;
return;
}
}
if (fwrite($handle,$log_text) == FALSE)
{
$ec_log_requirement = 0;
echo "File write failed!<br />";
}
if ($close_after)
{
if (!($handle = fopen($log_filename, 'a'))) $log_requirement = 0;
if (fwrite($handle,"\r\n\r\nMail subscriptions run started at ".date("D j M Y G:i:s")) === false) $log_requirement = 0;
fclose($handle);
$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));
// $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);
// Start of next try on query
// 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;
}
subs_log_a_line(" - ".$num_shots." emails found to send\r\n",FALSE,TRUE);
while ($cal_emrow = $sql2->db_Fetch())
{
extract($cal_emrow);
if ($msg_num == 1)
$cal_msg = $event_title . "\n\n" . $event_cat_msg1;
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);
}
}
}

View File

@@ -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);