Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Pages: [1] 2 3 ... 8

Author Topic: [ADDON] - sNews Calendar - with Integrated Admin - 1.6  (Read 46020 times)

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
[ADDON] - sNews Calendar - with Integrated Admin - 1.6
« on: September 08, 2008, 10:04:50 pm »

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
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 Events
Several 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. GMT
New 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 IE6... 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:
Code: [Select]

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:

Code: [Select]
<?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):
Code: [Select]
<?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_save

c) In function pages() - At the end, just before the closing curly-bracket, insert these strings to add the "Events" link in the pages menu:
Code: [Select]
<?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:
Code: [Select]
<?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:
Code: [Select]
<?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:
Code: [Select]
<?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:
Code: [Select]
echo '</p></fieldset>';

and replace it with the following:
Code: [Select]
# 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.
« Last Edit: January 17, 2009, 05:47:04 pm by Keyrocks »
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

jlhaslip

  • Sr. Member
  • ****
  • Karma: 16
  • Posts: 374
    • My snews with AEF Forum site
Re: [ADDON] sNews Calendar - with Integrated Admin - 1.6
« Reply #1 on: September 09, 2008, 07:35:40 am »

Karma to Keyrocks...

Any chance of a Demo on this one?
Logged
Yes! I have no siggy.

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: [ADDON] sNews Calendar - with Integrated Admin - 1.6
« Reply #2 on: September 09, 2008, 04:18:39 pm »

Karma to Keyrocks...
Any chance of a Demo on this one?

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 - (one year passed) access by special request only.
« Last Edit: November 22, 2009, 06:20:32 pm by Keyrocks »
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

funlw65

  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Re: [ADDON] sNews Calendar - with Integrated Admin - 1.6
« Reply #3 on: September 09, 2008, 06:20:39 pm »

I'm running Ubuntu 8.04 on a G4 Mac.
I have the following problems:
- Without javascript enabled, clicking on events links would lead me to a "request... not found"
- With javascript enabled, events links are not clickable. I can click on calendar but popups show nothing, only a title.

Is about testing site. It requires Java?
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: [ADDON] sNews Calendar - with Integrated Admin - 1.6
« Reply #4 on: September 09, 2008, 06:27:38 pm »

Well... it runs fine for me with my environment (XP machine viewing in IE7).
Javascript does need to be enabled to run properly.

Event links are using the exact same script used in the default sNews 1.6 to expand and collapse the Admin Panels. If those are working for you in your environment... then the Event Links should too?
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

funlw65

  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Re: [ADDON] sNews Calendar - with Integrated Admin - 1.6
« Reply #5 on: September 09, 2008, 07:06:42 pm »

Well... it runs fine for me with my environment (XP machine viewing in IE7).
Javascript does need to be enabled to run properly.

Event links are using the exact same script used in the default sNews 1.6 to expand and collapse the Admin Panels. If those are working for you in your environment... then the Event Links should too?

sNews is working fine but nothing related to calendar. But my system is not a usual one. Maybe somebody will try from a linux PC station (not Mac one)


Edit:
------------------------------------
Nope, not even in Win XP SP2 with last version of firefox. In ie7 works only popups and displaying correctly the event. But those links, when I click on them, I get a message in IE status bar: Page error
« Last Edit: September 09, 2008, 07:25:50 pm by funlw65 »
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: [ADDON] - sNews Calendar - with Integrated Admin - 1.6
« Reply #6 on: September 10, 2008, 02:29:07 am »

Nope, not even in Win XP SP2 with last version of firefox. In ie7 works only popups and displaying correctly the event. But those links, when I click on them, I get a message in IE status bar: Page error

Hey.. you're right... something isn't working... let me have a look... :o

MYSTERY BUG SOLVED
The functions required the addition of a small jscript toggle_id function into the calendar module's snewscal_js.php file and adding the function-name into the <head> section of the sNews index.php file... so that the side-bar Event Titles and the Month/Year titles on the Events page can expand & collapse independently.

The online demo is now functioning OK and the module download ZIP has been updated.   :)
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

jlhaslip

  • Sr. Member
  • ****
  • Karma: 16
  • Posts: 374
    • My snews with AEF Forum site
Re: [ADDON] - sNews Calendar - with Integrated Admin - 1.6
« Reply #7 on: September 10, 2008, 06:14:54 am »

Oops!
I am not getting any detail when I click on a date that should contain some event details.

Linux Ubuntu 8.04 / ff3
« Last Edit: September 18, 2008, 02:46:05 am by jlhaslip »
Logged
Yes! I have no siggy.

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: [ADDON] - sNews Calendar - with Integrated Admin - 1.6
« Reply #8 on: September 10, 2008, 02:56:30 pm »

Oops!
I am not getting any detail when I clck on a date that should contain some event details.
Linux Ubuntu 8.04 / ff3

Try doing this when you are on "Home". As I noted in the explanation notes at the top of my first post:
Quote from: Keyrocks
The popup (browser window) only displays the day's events when the viewer is on the Home Page. I've not yet figured out how to overcome this small drawback.

... I think the problem is within the jscript function popupEvent(day, month, year, w, h) (within function cal_js in the calendar/snewscal_js.php file... but I haven't yet figured it out... I'm not too good with jscript.

My get-around for this is... when using Bakercad's Switcherizer2 Templates system... is by having one template dedicated to the Home page and only using the calendar's month-view block in that template's index.php file. This is what led me to create the Event Title List (under the month-view block) and the Events Page... they both work fine no matter what page you are on.

Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

funlw65

  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Re: [ADDON] - sNews Calendar - with Integrated Admin - 1.6
« Reply #9 on: September 10, 2008, 04:32:09 pm »

Sir, not even in home page. Both Linux and XP, with ff3 .

The toogle is working. Now, is reversed. Toogle is working, calendar not.
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: [ADDON] - sNews Calendar - with Integrated Admin - 1.6
« Reply #10 on: September 10, 2008, 05:52:42 pm »

Sir, not even in home page. Both Linux and XP, with ff3 .
The toogle is working. Now, is reversed. Toogle is working, calendar not.

Strange... it is fine with IE7.
I may not have time to figure this out for some time... I am leaving on a long trip early tomorrow morining and will not be back for a week.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

jlhaslip

  • Sr. Member
  • ****
  • Karma: 16
  • Posts: 374
    • My snews with AEF Forum site
Re: [ADDON] - sNews Calendar - with Integrated Admin - 1.6
« Reply #11 on: September 10, 2008, 06:26:41 pm »

same results from the Home page.
Logged
Yes! I have no siggy.

Nicu Alecu

  • Full Member
  • ***
  • Karma: 12
  • Posts: 224
    • BLUEBYTE.ro // IT consultant
Re: [ADDON] - sNews Calendar - with Integrated Admin - 1.6
« Reply #12 on: September 11, 2008, 11:47:02 am »

same results from the Home page.
I confirm that! On Ubu 7.10 + Opera 9.51 (or FF2) and on XP with anything I throw at it.
Logged

nuno

  • Jr. Member
  • **
  • Karma: 1
  • Posts: 52
Re: [ADDON] - sNews Calendar - with Integrated Admin - 1.6
« Reply #13 on: September 17, 2008, 05:42:53 pm »

I've just got this installed and it works perfectly with IE but in Firefox... when I click on a date for the event details, in the pop up box all that appears is the header - 'Event Details' and the background graphics

Anyone else experienced this?
Logged

funlw65

  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Re: [ADDON] - sNews Calendar - with Integrated Admin - 1.6
« Reply #14 on: September 17, 2008, 06:07:49 pm »

I've just got this installed and it works perfectly with IE but in Firefox... when I click on a date for the event details, in the pop up box all that appears is the header - 'Event Details' and the background graphics

Anyone else experienced this?

Nuno, just wait, Keyrocks will solve this. Also, if you read the other comments, you can find the answers...
Logged
Pages: [1] 2 3 ... 8