-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
LATEST REVISIONS:January 17.09 - Displaying Month View in French:In answer to a request for help from Sven... to convert the calendar month-view block so it displays in French rather than English... Poppoll added & modified conversion scripts (used in the events_list.php file) so you can change the month-names in variable values as you wish. The posts on this begin
Here and
here. NOTE: this has not been added to the current Download; the modifications can be easily made to your existing calendar files.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
October 02.08 - Removing an Image from Existing EventsSeveral days ago Poppoll noted that we needed a solution to the fact that this Calendar module had no easy way of removing an image from an event once it was added to it. This drawback has existed in the original Calendar script from the start. I've applied a solution as
explained here and have updated the online demo so anyone interested can test it out to see how it works now. I've also updated the current Download as well.
September 24.08 at 6:40 p.m. GMT - minor changes in calendar files (
noted by Rui Mendes):
- events_admin.php - 4 XHTML validation fixes.
- events_list.php - changed "sub" to "drop" in 4 locations,
makes expandable Event Titles and Month/Year titles work independent of "sub" panels in Admin >> Settings panel.
- and 3 language variables added (for snews.php) in Step 3 b) (below).
New Users: Follow the installation instructions as provided.
Existing Users: To update: download a fresh ZIP and replace your calendar/events_admin.php & events_list.php files and...
- Add the 3 additional language variables (last 3) in Step 3 b) (below).
September 23.08 at 2:15 p.m. GMT - minor changes in calendar/snewscal_js.php and Global Variables (for snews.php).
Solves the last IE7 bug - popup now displays event data from any sNews page. (revisions by Rui Mendes)
New Users: Follow the installation instructions as provided.
Existing Users: To update: download a fresh ZIP and replace your calendar/snewscal_js.php file with the new one and...
- Re-do the Globals section for snews.php in Step 3 a) (below).
September 22.08 at 3:25 p.m. GMT - minor changes in calendar/style.css file to center day letters in month-view block.
To update, download a fresh ZIP and replace your calendar/style.css file with the new one.
September 22.08 at 2:00 a.m. GMTNew Users: Follow the instructions as revised.
Existing Users: The complete file-set has been revised.
To update, download a fresh ZIP and replace the complete file-set in your calendar folder.
1 - Re-do Step 3 a) - the global variables section has been revised.
2 - Re-do Step 4 a) - changed the variable name in the stylesheet path from
$ev_images_root to
$calendar_root.
The online demo and download ZIP are being updated on a regular basis as improvements are added. The file-set can be updated easily by over-writing existing files in the calendar folder. Improvements are mainly:
- correcting odd quirks that surfaced after integrating the original 3rd-party script to run in sNews 1.6,
- moving styling out of various functions where it was in-line... into the calendar/style.css file.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
sNews Compatibility: While this Addon is posted as available for sNews 1.6, it will likely also (not tested yet) work with 1.7RC and it should be fine with 1.5.31.
This Calendar module improves on its
non-integrated predecessor, the first being that its Administration panels are now fully integrated into the sNews Admin system. As well, I've managed to shave about 30KB (or more) off the overall package script, reduced the number of files required, and made the overall installation simpler.
This Module displays a calendar month-view block in a location within your template's (index.php) side-bar. When events are available on given days, the day cells in the block are highlighted, and clicking the day-cell opens a pop-up to display the day's events. This is handled by the popup.php file in the calendar module folder.
Browser Compatibility: As with its non-integrated predecessor, The Event Popup (browser window) only displays the day's events when the viewer is on the Home Page in IE7 (still looking for a solution). The Event Popup is working fine in FF, Safari, Chrome, Opera 9.0 and IE
6... on any sNews page.
Additional Functions: I've also included a couple of new functions in calendar/events_list.php that I
posted previously as an addon to the
previous Calendar Addon.
event_title_list - displays a list of Event Titles for the current month, under the calendar block. Clicking on any Event
Title expands to show the event's details... the time, date, location and description. A link to the other function is provided at
the end of the Event Title List. When an event passes, it is dropped from the list.
events_list - displays a page - similar to an Archive page - which lists expandable Month/Year Titles for all months
containing events that have not yet occured. Clicking any Month/Year title expands to show the events for that month. Once an
event passes, it is dropped from the list. Once a month passes, it is also dropped from the list.
The CSS styles for the month view block, the events list functions and admin panels are all consolidated in one calendar/style.css file.
DEMO: You can test-run a
Fresh 1.6 Demo Here... a default install of sNews 1.6 with only the Calendar Module added in.
Login is: test | test - for a limited time only.
Step 1 - the ZIP Package:Download the
Calendar Zip file to a safe place on your hard drive, un-zip it there and copy the calendar folder (and its contents) into your site project's root directory.
Step 2 - Add Events Table to Database:The sNews Calendar uses a new table, to be added to your database:
CREATE TABLE `events` (
event_id int(11) NOT NULL auto_increment,
location varchar(255) collate utf8_unicode_ci NOT NULL default '',
title varchar(255) collate utf8_unicode_ci NOT NULL default '',
event text collate utf8_unicode_ci NOT NULL,
picture_1 varchar(255) collate utf8_unicode_ci NOT NULL default '',
picture_2 varchar(255) collate utf8_unicode_ci NOT NULL default '',
`day` int(4) NOT NULL default '0',
`month` int(4) NOT NULL default '0',
`year` int(4) NOT NULL default '0',
`date` varchar(128) collate utf8_unicode_ci NOT NULL default '0',
`time` varchar(255) collate utf8_unicode_ci NOT NULL default '0',
PRIMARY KEY (event_id)
);
Step 3 - snews.php modifications:a) Global Variables - The Calendar module requires the following convenient variables so you can change the footer-line in the Calendar's Admin Panels... and change the name of the calendar folder to something else without having to make changes in the calendar module's files.
Copy this (excluding the PHP-tags) just below the // DATABASE VARIABLES function at the top of snews.php:
<?php
# GLOBAL VARIABLES - sNews Calendar
// sNews root/calendar root - Enables popup content from any sNews page. (in snewscal_js.php, function popupEvent)
$module_path = 'snews16/calendar';
// module's folder name. Used in <head> of index.php & module files.
$module_root = 'calendar';
$calendar_root = $module_root; // used only in sNews index.php for calendar's stylesheet path.
// 3 strings, for footer line in Calendar Events Panels (template_footer() in events_admin.php)
$ver = "1.6"; // defines module version #
$module_name = 'sNews Calendar '.$ver; // defines site-name & adds version # to it
$source_name = '<a href="http://snews.ca" title="sNews.ca">keyrocks</a>'; // defines source-name
?>
(NOTE - Now that the dbase queries in all functions have been re-written to be sNews compatable, the database connection scriipt that was included in the above section is now redundant and has been removed
as of October 6/08. If you still have it in your installation, refreshing your files with the latest download will eliminate the need for it.)
b) Add New language variables to the language variables array (excluding the PHP-tags):
<?php
# sNews Calendar
$l['eventList'] = 'Calendar Events by month:';
$l['events_list'] = 'Calendar Events by month'; // added Sept.20/08 to show in breadcrumbs when on that page.
$l['events2'] = 'Events'; // for link in function pages
$l['ev_click'] = 'Click to view';
$l['ev_date'] = 'Date';
$l['ev_details'] = 'Details';
$l['ev_link'] = 'View all Events...';
$l['ev_time'] = 'Time';
$l['ev_when'] = 'When';
$l['ev_where'] = 'Where';
$l['event_list'] = 'Events List';
$l['event_new'] = 'Add New Event';
$l['event_edit'] = 'Edit Event';
?>
and... near the bottom of the languages array, add the following to the end of the
$l['cat_listSEF'] string...
events_list,event_list,event_edit,event_new,event_update,event_delete,event_savec) In function pages() - At the end, just before the closing curly-bracket, insert these strings to add the "Events" link in the pages menu:
<?php
# sNews Calendar
$class = ($categorySEF == 'events_list') ? ' class="current"': '';
echo '<li><a'.$class.' href="'.db('website').'events_list/" title="'.l('events2').'">'.l('events2').'</a></li>';
?>
d) - Insert before // CENTER (function center() - to include the calendar's functions:
<?php
# sNews Calendar files - 4
include('calendar/snewscal_js.php');
include('calendar/showcal.php');
include('calendar/events_admin.php');
include('calendar/events_list.php'); // July 21.08 - Events List mod
?>
e) In function center() - search for:
case 'editcomment': edit_comment(); return; break; and, below it, insert these new case-strings:
<?php
# sNews Calendar - 6 strings
case 'event_list': event_list(); return; break;
case 'event_edit': event_edit(); return; break;
case 'event_new': event_new(); return; break;
case 'event_update': event_update(); return; break;
case 'event_delete': event_delete(); return; break;
case 'event_save': event_save(); return; break;
?>
... and a little further down in function center(), search for:
case 'contact': contact(); break; and insert this case-string below it:
<?php
# sNews Calendar - 1 string
case 'events_list': events_list(); break;
?>
f) - In the // ADMINISTRATION FORM function - We need a text link in the Main Admin Panel, under the "Pages New - View" links, to open the Calendar Admin Panel. About 17 strings down in the function... find:
echo '</p></fieldset>';
and replace it with the following:
# sNews Calendar - link to Calendar Events Manager Panel:
echo '</p><p>Calendar: <a href="event_list/" title="Events Admin Panel">Event Admin Panel</a>';
echo '</p></fieldset>';
Step 4 - index.php (template) modifications:a) Insert the Calendar CSS stylesheet link - just under the existing CSS stylesheet links in the <head> of your file:
<link rel="stylesheet" type="text/css" href="<?php echo ''.$calendar_root.''; ?>/style.css" media="screen" />b) Javascript function-name inserts: (updated: Sept. 29.08 - added
red part)
Just before the closing </head> tag... insert
<?php cal_js(); toggle_id(); return_confirm(); ?>.
And... just after the opening <body> tag... insert
<?php echo '<div>'; calbody_js(); echo '</div>'; ?> These call necessary javascript into action from the calendar/snewscal_js.php file.
c) Calendar block function-name insert:If you are using another template (already ported to run sNews), then you would choose the most appropriate location in your template's side-bar. This applies to the default sNews 1.6 template file - insert it somewhere within
<div id="left"> ... probably just under it so the month-view calendar block and event title list will display there until you get used to how it works.
<?php month_current(); ?>
<?php event_title_list(); ?> And... if you are installing this on a hosted server (online), remember to change (chmod) the folder permissions on the
calendar/event_images folder to 777.