Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Daniel15 on January 29, 2007, 11:54:55 PM

Title: Enhanced Calendar
Post by: Daniel15 on January 29, 2007, 11:54:55 PM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=648)

I am no longer developing this mod, and am looking for someone else to continue its development. Please PM me if you're interested.

This mod will enhance the display of your calendar
Screenshot (click for large version):
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.dansoftaustralia.net%2Fimages%2Fscreenshots%2Fsmfmods%2FCalendarSmall.png&hash=1fe250c16faaf3ac7c7748251fb65dc4e5e6da64) (http://www.dansoftaustralia.net/images/screenshots/smfmods/CalendarLarge.png)

This mod is based on code from JayBachatero (http://www.simplemachines.org/community/index.php?action=profile;u=4365).

Changelog
Version 1.0
- Initial release.
Title: Re: IPB-style Calendar
Post by: RoarinRow on January 30, 2007, 12:52:44 AM
Dang, looks great, thank you!  Jay is in the clear on this one   :P
Title: Re: IPB-style Calendar
Post by: buhaychat.com on January 30, 2007, 01:07:17 AM
Looks great, thanks! Two thumbs up!
Title: Re: IPB-style Calendar
Post by: thefley on January 30, 2007, 11:14:50 AM
I am getting an error installing it,

Installing this package will perform the following actions:  Type Action Description
1. Execute Modification - Modification parse error  

can you tell me what I am doing wrong?
Title: Re: IPB-style Calendar
Post by: @ngel on January 30, 2007, 12:30:38 PM
A little thing to "change" :

Displays the days of the next month in the "week" presentation (see snapshot)

Thanks for this mods
Title: Re: IPB-style Calendar
Post by: @ngel on January 30, 2007, 02:31:39 PM
Error in debug mode :

http://www.mysite.com/forum/index.php?show_debug=1;action=calendar;year=2006;month=12;week=48 
2: Invalid argument supplied for foreach()
Fichier: path/forum/Themes/default/Calendar.template.php (eval?)
Ligne: 256

Title: Re: IPB-style Calendar
Post by: babjusi on January 30, 2007, 03:37:24 PM
I just installed this mod, it went smooth. I like it, cool mod
Title: Re: IPB-style Calendar
Post by: thefley on January 30, 2007, 04:43:15 PM
Quote from: thefley on January 30, 2007, 11:14:50 AM
I am getting an error installing it,

Installing this package will perform the following actions:  Type Action Description
1. Execute Modification - Modification parse error  

can you tell me what I am doing wrong?
anyone have an idea what I need to do?
Title: Re: IPB-style Calendar
Post by: babjusi on January 30, 2007, 04:56:45 PM
Quote from: thefley on January 30, 2007, 04:43:15 PM
Quote from: thefley on January 30, 2007, 11:14:50 AM
I am getting an error installing it,

Installing this package will perform the following actions:  Type Action Description
1. Execute Modification - Modification parse error  

can you tell me what I am doing wrong?
anyone have an idea what I need to do?

What version of SMF are you using?
Title: Re: IPB-style Calendar
Post by: Lamarck on January 30, 2007, 05:23:20 PM
QuoteI am getting an error installing it,

Installing this package will perform the following actions:  Type Action Description
1. Execute Modification - Modification parse error

can you tell me what I am doing wrong?

I'm having the same problem in SMF 1.1.1.
Title: Re: IPB-style Calendar
Post by: Daniel15 on January 30, 2007, 08:13:08 PM
Quote from: thefley on January 30, 2007, 11:14:50 AM
I am getting an error installing it,

Installing this package will perform the following actions:  Type Action Description
1. Execute Modification - Modification parse error  

can you tell me what I am doing wrong?
Make sure your Packages directory is CHMODded to 0777. Try creating a 'temp' directory inside the Packages directory, and CHMOD it to 0777

Quote from: @ngel on January 30, 2007, 02:31:39 PM
Error in debug mode :

http://www.mysite.com/forum/index.php?show_debug=1;action=calendar;year=2006;month=12;week=48 
2: Invalid argument supplied for foreach()
Fichier: path/forum/Themes/default/Calendar.template.php (eval?)
Ligne: 256


Please blame Jay for this :D
Seriously though, I'll take a look when I have a bit more free time (just started school again today)
Title: Re: Enhanced Calendar
Post by: SWTrisha on January 30, 2007, 10:35:05 PM
Man I just keep bringing you bad news. Well I got a an error on trying to download this mod too.

QuoteInstalling this package will perform the following actions:  Type Action Description
1. Execute Modification ./Sources/Calendar.php Test successful
2. Execute Modification ./Themes/default/Calendar.template.php Test failed

help please. :)
Title: Re: Enhanced Calendar
Post by: Daniel15 on January 30, 2007, 11:16:35 PM
What version of SMF are you using? Any other mods installed?
Title: Re: Enhanced Calendar
Post by: SWTrisha on January 30, 2007, 11:25:51 PM
QuoteWhat version of SMF are you using? Any other mods installed

1.1.1   and yes
Title: Re: Enhanced Calendar
Post by: Daniel15 on January 31, 2007, 03:26:47 AM
Quote from: SWTrisha on January 30, 2007, 11:25:51 PM
QuoteWhat version of SMF are you using? Any other mods installed

1.1.1   and yes
Do any of the mods edit Calendar.template.php? Could you please attach your Calendar.template.php file here, so I can take a look at it? L)
Title: Re: Enhanced Calendar
Post by: Lamarck on January 31, 2007, 07:04:54 AM
QuoteMake sure your Packages directory is CHMODded to 0777. Try creating a 'temp' directory inside the Packages directory, and CHMOD it to 0777

Still don't working :(.
Title: Re: Enhanced Calendar
Post by: texterted on January 31, 2007, 10:45:25 AM
Another great mod!

Nice one Daniel15 :) Works great on my default themed 1.1.1

Cheers mate
Eddy
Title: Re: Enhanced Calendar
Post by: SWTrisha on January 31, 2007, 12:55:51 PM
QuoteDo any of the mods edit Calendar.template.php? Could you please attach your Calendar.template.php file here, so I can take a look at it? L) 


<a href="http://www.alittlebitofmagick.com/Mythica/Themes/default/Calendar.template.zip "></a>
Title: Re: Enhanced Calendar
Post by: Vinspire on January 31, 2007, 09:57:01 PM
This mod is looking good :)
Title: Re: Enhanced Calendar
Post by: Zwerko on February 03, 2007, 04:14:17 AM
Quote from: Daniel15 on January 30, 2007, 08:13:08 PM
Quote from: thefley on January 30, 2007, 11:14:50 AM
I am getting an error installing it,

Installing this package will perform the following actions:  Type Action Description
1. Execute Modification - Modification parse error  

can you tell me what I am doing wrong?
Make sure your Packages directory is CHMODded to 0777. Try creating a 'temp' directory inside the Packages directory, and CHMOD it to 0777

Hi,
I still getting same error when I installing it. I have done all u suggested, and SMF is 1.1.1.  I have attached screenshot.  
Title: Re: Enhanced Calendar
Post by: lexhair on February 03, 2007, 12:02:19 PM
Fantastic! Thank you for the mod.
Title: Re: Enhanced Calendar
Post by: SWTrisha on February 03, 2007, 02:41:03 PM
just checkin to see if you had time to go over my calender.php to see why I can't get your mod to install. I know your a very busy guy. Just checking :)
Title: Re: Enhanced Calendar
Post by: Daniel15 on February 03, 2007, 10:36:35 PM
Yeah, I'm very busy at the moment. I'll try to look at it as soon as possible.
Title: Re: Enhanced Calendar
Post by: Jim R on February 04, 2007, 09:27:43 AM
It installed great for me, still using 1.1 rc3, and it's a great look.  I know others here have bigger fish to fry, like getting it installed, but are there any plans to provide tags or categories to events, coupled with some SSI code to enable the posting of different events based on the tag or category?

:)
Title: Re: Enhanced Calendar
Post by: [Lucien] on February 06, 2007, 08:34:24 AM
Quote from: Zwerko on February 03, 2007, 04:14:17 AM
Quote from: Daniel15 on January 30, 2007, 08:13:08 PM
Quote from: thefley on January 30, 2007, 11:14:50 AM
I am getting an error installing it,

Installing this package will perform the following actions:  Type Action Description
1. Execute Modification - Modification parse error  

can you tell me what I am doing wrong?
Make sure your Packages directory is CHMODded to 0777. Try creating a 'temp' directory inside the Packages directory, and CHMOD it to 0777

Hi,
I still getting same error when I installing it. I have done all u suggested, and SMF is 1.1.1.  I have attached screenshot. 

I have the same problem :( The only thing i changed in the calendar are the colors of the letters..
But that's should'nt be a problem i hope?
Title: Re: Enhanced Calendar
Post by: Jiveturkey on February 07, 2007, 09:51:57 AM
It installed fine for me but the the default calendar is still showing up.  Am I missing a simple step here?

I'm running 1.1.1

Here's the other mods that I'm running.

1.     Googlebot & Spiders Mod      2.0.2      
2.    Users Online Today Mod    1.4.0    
4.    Lots_o_Smileys    1.0    
5.    Spam Me Not Mod    1.02    
6.    Enhanced Calendar    1.0    
7.    Enchanced post template    1.0.2    
8.    nwsw.nwswAdminAttachAnything
Title: Re: Enhanced Calendar
Post by: jonasrafe on February 08, 2007, 02:35:17 AM
Any idea if Kindred's showcal mod for Joomla would interfere with the enhanced calendar?  I'm running Joomla 1.0.12, SMF 1.1.1, and Orstio's bridge 1.1.6, and would be interested in using this mod.
Title: Re: Enhanced Calendar
Post by: tarsia on February 09, 2007, 07:39:27 PM
Hi,

for everbody who is getting the 'Modification parse error'. The error occurres in some (many) other mods, too.
As far as i know it depends on the php-version. => php 4 is ok , php 5 not.

I didn't found a workaround yet. In my point of view it is a SMF bug, but the SMF-Development-Team seems not to be interrestet in it (as far as i read in other topics).

tarsia
Title: Re: Enhanced Calendar
Post by: Daniel15 on February 09, 2007, 07:52:24 PM
Quotebut are there any plans to provide tags or categories to events, coupled with some SSI code to enable the posting of different events based on the tag or category?
I don't have time to do this, although someone else might :). Make a post in the Mods Request board.

QuoteIt installed fine for me but the the default calendar is still showing up.  Am I missing a simple step here?
If you're not using the default theme, does your custom theme have a Calendar.template.php file? If so, try copying the Calendar.template.php file from Themes/default/Calendar.template.php to Themes/[name of your theme]/Calendar.template.php.

QuoteAny idea if Kindred's showcal mod for Joomla would interfere with the enhanced calendar?
No idea, sorry (I haven't tested it)

Quotefor everbody who is getting the 'Modification parse error'. The error occurres in some (many) other mods, too.
As far as i know it depends on the php-version. => php 4 is ok , php 5 not.

I didn't found a workaround yet. In my point of view it is a SMF bug, but the SMF-Development-Team seems not to be interrestet in it (as far as i read in other topics).
The SMF Development Team are currently working on fixing this issue. It doesn't seem to occur for everyone, however (I use PHP 5.2.0 and have not experienced this issue).
Title: Re: Enhanced Calendar
Post by: jonasrafe on February 10, 2007, 02:31:59 AM
I tried installing the mod, and got the following error:


2.   Execute Modification   ./Themes/default/Calendar.template.php   Test failed


I don't have anything in SMF that should have altered my calendar template, so it seems as if there is a compatibility issue with the Joomla integration.
Title: Re: Enhanced Calendar
Post by: Jiveturkey on February 10, 2007, 12:37:38 PM
Freakin' sweet. 

Moving the php files from default did it.  It still doesn't look as slick but that's probably because of the template that I'm using.
Title: Re: Enhanced Calendar
Post by: Achilles991 on February 10, 2007, 07:19:46 PM
Hello all, i have truble with this mod because i have language where Thursday begins with character Č and i think that cause problem check it here http://www.schoolnparty.com/forum/index.php?action=calendar
Please tell me how can i fix it. As fast as possible. Thanks
Title: Re: Enhanced Calendar
Post by: Achilles991 on February 10, 2007, 07:25:09 PM
In IE i see this ļ/td> and in Opera i see
Title: Re: Enhanced Calendar
Post by: Daniel15 on February 10, 2007, 07:46:35 PM
Quote from: Achilles991 on February 10, 2007, 07:19:46 PM
Hello all, i have truble with this mod because i have language where Thursday begins with character Č and i think that cause problem check it here http://www.schoolnparty.com/forum/index.php?action=calendar
Please tell me how can i fix it. As fast as possible. Thanks
All the days of the month appear properly for me (Opera 9.10, Windows XP):
Quote
Ponedeljak   Utorak   Sreda   Četvrtak   Petak   Subota   Nedelja
Title: Re: Enhanced Calendar
Post by: Achilles991 on February 10, 2007, 07:52:23 PM
Quote from: Daniel15 on February 10, 2007, 07:46:35 PM
Quote from: Achilles991 on February 10, 2007, 07:19:46 PM
Hello all, i have truble with this mod because i have language where Thursday begins with character Č and i think that cause problem check it here http://www.schoolnparty.com/forum/index.php?action=calendar
Please tell me how can i fix it. As fast as possible. Thanks
All the days of the month appear properly for me (Opera 9.10, Windows XP):
Quote
Ponedeljak   Utorak   Sreda   Četvrtak   Petak   Subota   Nedelja

Yes that is ok, but in small month calendars, next to the bigger one, is problem.
You can see there
QuoteP U S Č P S N
but Č is bugged! check that please.
Title: Re: Enhanced Calendar
Post by: Achilles991 on February 10, 2007, 07:55:26 PM
That is not character "I", that is bug. Check same page in IE, there you will see part of HTML code like ļ/td> that looks like part of table.
Title: Re: Enhanced Calendar
Post by: Daniel15 on February 10, 2007, 08:59:01 PM
It looks like you have the encoding type set to UTF-8 rather than ISO-8859-9, which could be what's causing this (my test installation uses ISO-8859-9, and it works fine).

Please try this:
In Themes/default/Calendar.template.php, find:

substr($txt['days'][$day], 0, 1)


Replace with:

htmlentities(substr($txt['days'][$day], 0, 1))


This should work for you :)
Title: Re: Enhanced Calendar
Post by: Achilles991 on February 10, 2007, 09:31:09 PM
I see different but only in one month, but still not working. I edited calendar.template.php as you said and still no results. <?php// Version: 1.1; Calendar// The main calendar - January, for example.function template_main(){ global $context, $settings, $options, $txt, $scripturl, $modSettings; echo ' <div style="padding: 3px;">', theme_linktree(), '</div> <table cellspacing="4" cellpadding="2" width="100%"> <tr> <td valign="top"> <table cellspacing="1" cellpadding="2" width="100%">'; // The previous month if (isset($context['previous_calendar'])) { echo ' <tr> <td> <table class="bordercolor" cellspacing="1" cellpadding="2" width="100%"> <tr class="titlebg"> <td align="center" colspan="8" style="padding: 5px;"> ', $txt['months_titles'][$context['current_month_prev']], ' ', $context['current_year_prev'], ' </td> </tr> <tr> <td class="titlebg2">&nbsp;</td>'; // Show each day of the week. foreach ($context['week_days'] as $day) echo ' <td class="titlebg2" width="14%" align="left">', substr($txt['days'][$day], 0, 1), '</td>'; echo ' </tr>'; /* Each week in weeks contains the following: days (a list of days), number (week # in the year.) */ foreach ($context['prevMonthWeeks'] as $week) { echo ' <tr> <td class="titlebg2"><a href="', $week['week'], '">&raquo;</a></td>'; /* Every day has the following: day (# in month), is_today (is this day *today*?), is_first_day (first day of the week?), holidays, events, birthdays. (last three are lists.) */ foreach ($week['days'] as $day) { // If this is today, make it a different color and show a border. echo ' <td valign="top" align="right" style="height: auto; padding: 2px;" class="', $day['is_today'] ? 'calendar_today' : (empty($day['day']) ? 'windowbg3' : 'windowbg'), '">'; // Skip it if it should be blank - it's not a day if it has no number. if (!empty($day['day'])) echo $day['day']; echo ' </td>'; } echo ' </tr>'; } echo ' </table> </td> </tr> <tr> <td>&nbsp;</td> </tr>'; } // Current month echo ' <tr> <td> <table class="bordercolor" cellspacing="1" cellpadding="2" width="100%">'; echo' <tr class="titlebg"> <td align="center" colspan="8" style="padding: 5px;"> ', $txt['months_titles'][$context['current_month']], ' ', $context['current_year'], ' </td> </tr> <tr> <td class="titlebg2">&nbsp;</td>'; // Show each day of the week. foreach ($context['week_days'] as $day) echo ' <td class="titlebg2" width="14%" align="center">', htmlentities(substr($txt['days'][$day], 0, 1)), '</td>'; echo ' </tr>'; /* Each week in weeks contains the following: days (a list of days), number (week # in the year.) */ foreach ($context['weeks'] as $week) { // This is used to highlight the current week. $currentWeek = isset($_REQUEST['week']) && $_REQUEST['week'] == $week['number']; echo ' <tr class="bordercolor" cellspacing="1" cellpadding="2"> <td class="titlebg2"><a href="', $week['week'], '">&raquo;</a></td>'; /* Every day has the following: day (# in month), is_today (is this day *today*?), is_first_day (first day of the week?), holidays, events, birthdays. (last three are lists.) */ foreach ($week['days'] as $day) { // If this is today, make it a different color and show a border. echo ' <td valign="top" align="right" style="height: auto; padding: 2px;" class="', $day['is_today'] ? 'calendar_today' : (empty($day['day']) ? 'windowbg3' : ($currentWeek ? 'windowbg2' : 'windowbg')), '">'; // Skip it if it should be blank - it's not a day if it has no number. if (!empty($day['day'])) echo $day['day']; echo ' </td>'; } echo ' </tr>'; } echo ' </table> </td> </tr>'; if (isset($context['next_calendar'])) { echo ' <tr> <td>&nbsp;</td> </tr> <tr> <td> <table class="bordercolor" cellspacing="1" cellpadding="2" width="100%">'; echo' <tr class="titlebg"> <td align="center" colspan="8" style="padding: 5px;"> ', $txt['months_titles'][$context['current_month_next']], ' ', $context['current_year_next'], ' </td> </tr> <tr> <td class="titlebg2">&nbsp;</td>'; // Show each day of the week. foreach ($context['week_days'] as $day) echo ' <td class="titlebg2" width="14%" align="center">', substr($txt['days'][$day], 0, 1), '</td>'; echo ' </tr>'; /* Each week in weeks contains the following: days (a list of days), number (week # in the year.) */ foreach ($context['nextMonthWeeks'] as $week) { echo ' <tr> <td class="titlebg2"><a href="', $week['week'], '">&raquo;</a></td>'; /* Every day has the following: day (# in month), is_today (is this day *today*?), is_first_day (first day of the week?), holidays, events, birthdays. (last three are lists.) */ foreach ($week['days'] as $day) { // If this is today, make it a different color and show a border. echo ' <td valign="top" align="right" style="height: auto; padding: 2px;" class="', $day['is_today'] ? 'calendar_today' : ((empty($day['day']) || isset($_REQUEST['week']) && $week['week'] == $_REQUEST['week']) ? 'windowbg3' : 'windowbg'), '">'; // Skip it if it should be blank - it's not a day if it has no number. if (!empty($day['day'])) echo $day['day']; echo ' </td>'; } echo ' </tr>'; } echo ' </table> </td> </tr>'; } echo' </table> </td> <td width="80%" valign="top"> <table cellspacing="1" cellpadding="2" width="100%" class="bordercolor">'; if (isset($_REQUEST['week']) && (int) $_REQUEST['week'] <= 53 && (int)$_REQUEST['week'] > 0) { // Set the vars used for prev and next week vars if ($_REQUEST['week'] == 1 && isset($context['prevMonthWeeks'][53]['week'])) { $prevWeek = 53; $prevWeeks = isset($context['weeks'][$prevWeek]['week']) ? 'weeks' : 'prevMonthWeeks'; } elseif ($_REQUEST['week'] == 1 && isset($context['weeks'][52]['week'])) { $prevWeek = 52; $prevWeeks = isset($context['weeks'][$prevWeek]['week']) ? 'weeks' : 'prevMonthWeeks'; } else { $prevWeek = $_REQUEST['week'] - 1; $prevWeeks = isset($context['weeks'][$prevWeek]['week']) ? 'weeks' : 'prevMonthWeeks'; } // Next week vars if ($_REQUEST['week'] == 52 && isset($context['weeks'][53]['week'])) { $nextWeek = 53; $nextWeeks = 'weeks'; } elseif ($_REQUEST['week'] == 53) { $nextWeek = 1; $nextWeeks = isset($context['weeks'][$nextWeek]['week']) ? 'weeks' : 'nextMonthWeeks'; } else { $nextWeek = $_REQUEST['week'] + 1; $nextWeeks = isset($context['weeks'][$nextWeek]['week']) ? 'weeks' : 'nextMonthWeeks'; } echo ' <tr class="titlebg"> <td style="font-size: large;" align="center" colspan="7"> <a href="', $context[$prevWeeks][$prevWeek]['week'], '">&laquo;</a> &nbsp;', $txt['months_titles'][$context['current_month']], ' ', $context['current_year'], '&nbsp; <a href="', $context[$nextWeeks][$nextWeek]['week'], '">&raquo;</a> </td> </tr>'; // This var is used to determine if the first day of week is sunday or monday $weekOffset = !empty($options['calendar_start_day']) ? $options['calendar_start_day'] : 0; foreach ($context['weeks'][$_REQUEST['week']]['days'] as $day) { echo ' <tr class="windowbg3"> <td style="padding: 5px; font-size: small; font-weight: bold;" colspan="2"> <div style="text-align: left; margin: 0;"> ', $txt['days'][$weekOffset], ' ', !empty($day['day']) ? '<span style="float: right;"><a href="' . $scripturl . '?action=calendar;sa=post;month=' . $context['current_month'] . ';year=' . $context['current_year'] . ';day=' . $day['day'] . ';sesc=' . $context['session_id'] . '">' . $txt['calendar23'] . '</a></span>' : '', ' </div> </td>'; echo ' </tr>'; echo ' <tr class="windowbg2"> <td width="5%" align="center" class="', empty($day['day']) ? 'windowbg2' : 'windowbg', '" style="padding: 4px; font-size: small;"> ', empty($day['day']) ? '&nbsp;' : $day['day'], ' </td> <td width="95%">'; // Are there any holidays? if (!empty($day['holidays'])) echo ' <div class="smalltext" style="color: #', $modSettings['cal_holidaycolor'], ';">', $txt['calendar5'], ' ', implode(', ', $day['holidays']), '</div>'; // Show any birthdays... if (!empty($day['birthdays'])) { echo ' <div class="smalltext"> <span style="color: #', $modSettings['cal_bdaycolor'], ';">', $txt['calendar3'], '</span> '; /* Each of the birthdays has: id, name (person), age (if they have one set?), and is_last. (last in list?) */ foreach ($day['birthdays'] as $member) echo ' <a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['name'], isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] ? '' : ', '; echo ' </div>'; } // Any special posted events? if (!empty($day['events'])) { echo ' <div class="smalltext"> <span style="color: #', $modSettings['cal_eventcolor'], ';">', $txt['calendar4'], '</span>'; /* The events are made up of: title, href, is_last, can_edit (are they allowed to?), and modify_href. */ foreach ($day['events'] as $event) { // If they can edit the event, show a star they can click on.... if ($event['can_edit']) echo ' <a href="', $event['modify_href'], '" style="color: #FF0000;">*</a> '; echo ' ', $event['link'], $event['is_last'] ? '' : ', '; } echo ' </div>'; } echo ' </td> </tr>'; if ($context['last_day'] == $day['day']) echo ' <tr class="titlebg2"> <td height="10" colspan="2"></td> </tr>'; // This is used to set the offset between days depending if a week starts on sunday or monday $weekOffset++; if ($weekOffset == 7) $weekOffset = 0; } } else { echo ' <tr>'; // Show each day of the week. foreach ($context['week_days'] as $day) echo ' <td class="titlebg2" width="14%" align="center">', $txt['days'][$day], '</td>'; echo ' </tr>'; /* Each week in weeks contains the following: days (a list of days), number (week # in the year.) */ foreach ($context['weeks'] as $week) { echo ' <tr>'; /* Every day has the following: day (# in month), is_today (is this day *today*?), is_first_day (first day of the week?), holidays, events, birthdays. (last three are lists.) */ foreach ($week['days'] as $day) { // If this is today, make it a different color and show a border. echo ' <td valign="top" style="height: 100px; padding: 2px;" class="', $day['is_today'] ? 'calendar_today' : (empty($day['day']) ? 'windowbg3' : 'windowbg'), '">'; // Skip it if it should be blank - it's not a day if it has no number. if (!empty($day['day'])) { // Should the day number be a link? if (!empty($modSettings['cal_daysaslink']) && $context['can_post']) echo ' <a href="', $scripturl, '?action=calendar;sa=post;month=', $context['current_month'], ';year=', $context['current_year'], ';day=', $day['day'], ';sesc=', $context['session_id'], '">', $day['day'], '</a>'; else echo ' ', $day['day']; // Is this the first day of the week? (and are we showing week numbers?) if ($day['is_first_day']) echo ' <span class="smalltext"> - ', $txt['calendar51'], ' ', $week['number'], '</span>'; // Are there any holidays? if (!empty($day['holidays'])) echo ' <div class="smalltext" style="color: #', $modSettings['cal_holidaycolor'], ';"> ', $txt['calendar5'], ' ', implode(', ', $day['holidays']), ' </div>'; // Show any birthdays... if (!empty($day['birthdays'])) { echo ' <div class="smalltext"> <span style="color: #', $modSettings['cal_bdaycolor'], ';">', $txt['calendar3'], '</span> '; /* Each of the birthdays has: id, name (person), age (if they have one set?), and is_last. (last in list?) */ foreach ($day['birthdays'] as $member) echo ' <a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['name'], isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] ? '' : ', '; echo ' </div>'; } // Any special posted events? if (!empty($day['events'])) { echo ' <div class="smalltext"> <span style="color: #', $modSettings['cal_eventcolor'], ';">', $txt['calendar4'], '</span>'; /* The events are made up of: title, href, is_last, can_edit (are they allowed to?), and modify_href. */ foreach ($day['events'] as $event) { // If they can edit the event, show a star they can click on.... if ($event['can_edit']) echo ' <a href="', $event['modify_href'], '" style="color: #FF0000;">*</a> '; echo ' ', $event['link'], $event['is_last'] ? '' : ', '; } echo ' </div>'; } } echo ' </td>'; } echo ' </tr>'; } } echo ' </table> </td> </tr> </table> <form action="', $scripturl, '?action=calendar" method="post" accept-charset="', $context['character_set'], '"> <table cellspacing="0" cellpadding="3" width="100%" class="tborder" style="border-top: 0;"> <tr class="titlebg2"> <td>'; // Is there a calendar for last month to look at? if (isset($context['previous_calendar'])) echo ' <b><a href="', $context['previous_calendar']['href'], '">&#171; ', $txt['months_short'][$context['previous_calendar']['month']], ' ', $context['previous_calendar']['year'], '</a></b>'; echo ' </td> <td align="center">'; // Show a little "post event" button? if ($context['can_post']) echo ' <a href="', $scripturl, '?action=calendar;sa=post;month=', $context['current_month'], ';year=', $context['current_year'], ';sesc=', $context['session_id'], '">', create_button('calendarpe.gif', 'calendar23', 'calendar23', 'align="middle"'), '</a>'; echo ' </td> <td align="center"> <select name="month">'; // Show a select box with all the months. foreach ($txt['months'] as $number => $month) echo ' <option value="', $number, '"', $number == $context['current_month'] ? ' selected="selected"' : '', '>', $month, '</option>'; echo ' </select>&nbsp; <select name="year">'; // Show a link for every year..... for ($year = $modSettings['cal_minyear']; $year <= $modSettings['cal_maxyear']; $year++) echo ' <option value="', $year, '"', $year == $context['current_year'] ? ' selected="selected"' : '', '>', $year, '</option>'; echo ' </select>&nbsp; <input type="submit" value="', $txt[305], '" /> </td> <td align="center">'; // Show another post button just for symmetry. if ($context['can_post']) echo ' <a href="', $scripturl, '?action=calendar;sa=post;month=', $context['current_month'], ';year=', $context['current_year'], ';sesc=', $context['session_id'], '">', create_button('calendarpe.gif', 'calendar23', 'calendar23', 'align="middle"'), '</a>'; echo ' </td> <td align="', !$context['right_to_left'] ? 'right' : 'left', '">'; // Is there a calendar for next month? if (isset($context['next_calendar'])) echo ' <b><a href="', $context['next_calendar']['href'], '">' . $txt['months_short'][$context['next_calendar']['month']] . ' ' . $context['next_calendar']['year'] . ' &#187;</a></b>'; echo ' </td> </tr> </table> </form>';}// Template for posting a calendar event.function template_event_post(){ global $context, $settings, $options, $txt, $scripturl, $modSettings; // Start the javascript for drop down boxes... echo ' <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[ var monthLength = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; function generateDays() { var days = 0, selected = 0; var dayElement = document.getElementById("day"), yearElement = document.getElementById("year"), monthElement = document.getElementById("month"); monthLength[1] = 28; if (yearElement.options[yearElement.selectedIndex].value % 4 == 0) monthLength[1] = 29; selected = dayElement.selectedIndex; while (dayElement.options.length) dayElement.options[0] = null; days = monthLength[monthElement.value - 1]; for (i = 1; i <= days; i++) dayElement.options[dayElement.length] = new Option(i, i); if (selected < days) dayElement.selectedIndex = selected; } function toggleLinked(form) { form.board.disabled = !form.link_to_board.checked; } function saveEntities() { document.forms.postevent.evtitle.value = document.forms.postevent.evtitle.value.replace(/&#/g, "&#38;#"); } // ]]></script> <form action="', $scripturl, '?action=calendar;sa=post" method="post" name="postevent" accept-charset="', $context['character_set'], '" onsubmit="submitonce(this);saveEntities();" style="margin: 0;"> <table width="55%" align="center" cellpadding="0" cellspacing="3"> <tr> <td valign="bottom" colspan="2"> ', theme_linktree(), ' </td> </tr> </table>'; if (!empty($context['event']['new'])) echo ' <input type="hidden" name="eventid" value="', $context['event']['eventid'], '" />'; // Start the main table. echo ' <table border="0" width="55%" align="center" cellspacing="1" cellpadding="3" class="bordercolor"> <tr class="titlebg"> <td>', $context['page_title'], '</td> </tr> <tr> <td class="windowbg"> <table border="0" cellpadding="3" width="100%">'; if (!empty($context['post_error']['messages'])) { echo ' <tr> <td></td> <td> ', $context['error_type'] == 'serious' ? '<b>' . $txt['error_while_submitting'] . '</b>' : '', ' <div style="color: red; margin: 1ex 0 2ex 3ex;"> ', implode('<br />', $context['post_error']['messages']), ' </div> </td> </tr>'; } echo ' <tr> <td align="right"> <b', isset($context['post_error']['no_event']) ? ' style="color: red;"' : '', '>', $txt['calendar12'], '</b> </td> <td class="smalltext"> <input type="text" name="evtitle" maxlength="30" size="30" value="', $context['event']['title'], '" style="width: 90%;" /> </td> </tr><tr> <td></td> <td class="smalltext"> <input type="hidden" name="calendar" value="1" />', $txt['calendar10'], '&nbsp; <select name="year" id="year" onchange="generateDays();">'; // Show a list of all the years we allow... for ($year = $modSettings['cal_minyear']; $year <= $modSettings['cal_maxyear']; $year++) echo ' <option value="', $year, '"', $year == $context['event']['year'] ? ' selected="selected"' : '', '>', $year, '</option>'; echo ' </select>&nbsp; ', $txt['calendar9'], '&nbsp; <select name="month" id="month" onchange="generateDays();">'; // There are 12 months per year - ensure that they all get listed. for ($month = 1; $month <= 12; $month++) echo ' <option value="', $month, '"', $month == $context['event']['month'] ? ' selected="selected"' : '', '>', $txt['months'][$month], '</option>'; echo ' </select>&nbsp; ', $txt['calendar11'], '&nbsp; <select name="day" id="day">'; // This prints out all the days in the current month - this changes dynamically as we switch months. for ($day = 1; $day <= $context['event']['last_day']; $day++) echo ' <option value="', $day, '"', $day == $context['event']['day'] ? ' selected="selected"' : '', '>', $day, '</option>'; echo ' </select> </td> </tr>'; // If events can span more than one day then allow the user to select how long it should last. if (!empty($modSettings['cal_allowspan'])) { echo ' <tr> <td align="right"><b>', $txt['calendar54'], '</b></td> <td class="smalltext"> <select name="span">'; for ($days = 1; $days <= $modSettings['cal_maxspan']; $days++) echo ' <option value="', $days, '"', $context['event']['span'] == $days ? ' selected="selected"' : '', '>', $days, '</option>'; echo ' </select> </td> </tr>'; } // If this is a new event let the user specify which board they want the linked post to be put into. if ($context['event']['new']) { echo ' <tr> <td align="right"><b>', $txt['calendar_link_event'], '</b></td> <td class="smalltext"> <input type="checkbox" class="check" name="link_to_board" checked="checked" onclick="toggleLinked(this.form);" /> </td> </tr> <tr> <td align="right"><b>', $txt['calendar13'], '</b></td> <td class="smalltext"> <select id="board" name="board" onchange="this.form.submit();">'; foreach ($context['event']['boards'] as $board) echo ' <option value="', $board['id'], '"', $board['id'] == $context['event']['board'] ? ' selected="selected"' : '', '>', $board['cat']['name'], ' - ', $board['prefix'], $board['name'], '</option>'; echo ' </select> </td> </tr>'; } echo ' <tr align="center"> <td colspan="2"> <input type="submit" value="', empty($context['event']['new']) ? $txt[10] : $txt[105], '" />'; // Delete button? if (empty($context['event']['new'])) echo ' <input type="submit" name="deleteevent" value="', $txt['calendar22'], '" onclick="return confirm(\'', $txt['calendar_confirm_delete'], '\');" />'; echo ' <input type="hidden" name="sc" value="', $context['session_id'], '" /> <input type="hidden" name="eventid" value="', $context['event']['eventid'], '" /> </td> </tr>'; echo ' </table> </td> </tr> </table> </form>';}?>
This is how my calendar.template.php looks like...
Title: Re: Enhanced Calendar
Post by: Daniel15 on February 10, 2007, 10:08:07 PM
The code I mentioned appears a few times - Make sure you edit all of them ;)
Title: Re: Enhanced Calendar
Post by: Achilles991 on February 10, 2007, 10:09:32 PM
ok i will, but i am not sure that it will fix the problem.
Title: Re: Enhanced Calendar
Post by: Achilles991 on February 10, 2007, 10:13:12 PM
Now i've got some strange symbol. I see Ä, not Č
Title: Re: Enhanced Calendar
Post by: Niteblade on February 11, 2007, 07:57:56 PM
Quote from: Zwerko on February 03, 2007, 04:14:17 AM
Quote from: Daniel15 on January 30, 2007, 08:13:08 PM
Quote from: thefley on January 30, 2007, 11:14:50 AM
I am getting an error installing it,

Installing this package will perform the following actions:  Type Action Description
1. Execute Modification - Modification parse error  

can you tell me what I am doing wrong?
Make sure your Packages directory is CHMODded to 0777. Try creating a 'temp' directory inside the Packages directory, and CHMOD it to 0777

Hi,
I still getting same error when I installing it. I have done all u suggested, and SMF is 1.1.1.  I have attached screenshot. 

Sometimes "Modification Parse Error" happens using a PHP 5.2.0 environment. If you can, switch to a PHP v4.4.4 environment and retry.
Title: Re: Enhanced Calendar
Post by: Daniel15 on February 12, 2007, 04:13:30 AM
Quote from: Achilles991 on February 10, 2007, 10:13:12 PM
Now i've got some strange symbol. I see Ä, not Č

Hmmm... I honestly have no idea what to do, then (I'm not very experienced with other languages and their use). Maybe someone on the Turkish board could help you with this?
Title: Re: Enhanced Calendar
Post by: URPG on February 13, 2007, 06:08:26 AM
This does work with 1.1.2. i guess?

All we need now is a "post reoccuring event" button for things that happen every week or month :)
Title: Re: Enhanced Calendar
Post by: perplexed on February 13, 2007, 07:19:33 AM
Someone could try it on 1.1.2 and report back :)
Title: Re: Enhanced Calendar
Post by: growwl on February 14, 2007, 10:20:38 AM
any news on this?
Title: Re: Enhanced Calendar
Post by: Zwerko on February 14, 2007, 03:13:04 PM
Quote from: nite0859 on February 11, 2007, 07:57:56 PM
Sometimes "Modification Parse Error" happens using a PHP 5.2.0 environment. If you can, switch to a PHP v4.4.4 environment and retry.

I don't think that my host will do this just for me. I will wait this mod to become compatible with php5.2.0
Title: Re: Enhanced Calendar
Post by: Daniel15 on February 15, 2007, 12:22:39 AM
QuoteI will wait this mod to become compatible with php5.2.0
It's not a problem with this mod; it's a problem with SMF itself.
Title: Re: Enhanced Calendar
Post by: growwl on February 15, 2007, 06:10:57 AM
will there be an updated version for smf 1.1.2?
Title: Re: Enhanced Calendar
Post by: Zwerko on February 15, 2007, 11:31:10 AM
ok i have updated my smf to 1.1.2 and now this mod is not compatible with this version of SMF.... :( ::)
Title: Re: Enhanced Calendar
Post by: Publius Scipio on February 15, 2007, 06:14:58 PM
I have 1.1.2 installed. I got following message:

QuoteThe package you are trying to download or install is either corrupt or not compatible with this version of SMF.
Title: Re: Enhanced Calendar
Post by: Daniel15 on February 16, 2007, 03:05:30 AM
Ok, I uploaded an updated package which should install on SMF 1.1.2 (I didn't test it myself, but it should work)

Quote from: Achilles991 on February 10, 2007, 10:13:12 PM
Now i've got some strange symbol. I see Ä, not Č
Please try the latest package (version 1.1). JayBachatero told me about a fix for this, and I implemented his fix :).
Title: Re: Enhanced Calendar
Post by: Publius Scipio on February 16, 2007, 06:05:05 AM
Thanks, it working now. Looks great. :)
Title: Re: Enhanced Calendar
Post by: Mick. on February 17, 2007, 10:22:05 AM
Daniel thans for this sweet mod but i get this error.

2. Execute Modification ./Themes/default/Calendar.template.php Test failed  
Title: Re: Enhanced Calendar
Post by: ametzler on February 18, 2007, 11:12:02 AM
I have it working great in my theme, the only issue I am having is the smaller calendars off to the left are really wide, you can see it here: http://forum.thejediismway.org/index.php?action=calendar

Where would I need to go in the Calendar.template.php to fix that?  Thanks in advance for the help!!
Title: Re: Enhanced Calendar
Post by: MarkRH on February 20, 2007, 02:10:51 AM
Decided to try this mod out and the test execution fails on default/Calendar.template.php

I am running version 1.1.2 and have the following mods installed:

Mod Name Version 
1. Users Online Today Mod 1.4.0 [ Uninstall ]
2. User Email System 1.1.3 [ Uninstall ]
3. URL Popup 1.0 [ Uninstall ]
4. Member Color Link 1.8.7 [ Uninstall ]
5. EmailFlash 1.0 [ Uninstall ]
6. SMF 1.1.1 Update Package 1.1.1 [ Uninstall ]
7. Color Bar 2.0 [ Uninstall ]
8. SMF 1.1.2 Update Package 1.1.2

It looks like the Member Color Link mod did modify the Calendar.template.php file.  I am doing a test install locally using Windows XP, Apache 1.3.33, and PHP 4.4.4.  Possible there is a conflict with that mod.  I renamed the backup Calendar.template.php~ to Calendar.template.php and the test passed.  Doing a file comparision, one line is different.

<a href="', $scripturl, '?action=profile;u=', $member['id'], '">', (!empty($member['color']) ? '<font color="'.$member['color'].'">' : ''), $member['name'], isset($member['age']) ? ' (' . $member['age'] . ')' : '', (!empty($member['color']) ? '</font>' : ''), '</a>', $member['is_last'] ? '' : ', ';

and

<a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['name'], isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] ? '' : ', ';

I might try applying the Calendar mod, see what it changes and then manually merge the two.

Weird, the Enhanced Calendar mod does not change that line.  All I did was place that back into the spot where it should be.
Title: Re: Enhanced Calendar
Post by: lexhair on March 11, 2007, 07:45:17 PM
Just noticed it doesn't validate XHTML 1.0 w/ my Babylon theme (http://nymisoa.com/forums/index.php?action=calendar). SMF ver 1.1.1.

Edit: found the problem. It was in calendar.template.php. I deleted cellspacing="1" cellpadding="2" from <tr class="bordercolor"  cellspacing="1" cellpadding="2"> and it validates. Doesn't appear to have torqued up the calendar format at all. This tag was added by the mod.
Title: Re: Enhanced Calendar
Post by: ra-punzel72 on March 16, 2007, 10:07:00 AM
1.1.2
Modifikation Parse-Error

"Make sure your Packages directory is CHMODded to 0777. Try creating a 'temp' directory inside the Packages directory, and CHMOD it to 0777" -> done

No change after installation
No mods installed that change the calendar

Title: Re: Enhanced Calendar
Post by: Mick. on March 19, 2007, 10:22:50 PM
Quote from: MarkRH on February 20, 2007, 02:10:51 AM
Decided to try this mod out and the test execution fails on default/Calendar.template.php

I am running version 1.1.2 and have the following mods installed:

Mod Name Version 
1. Users Online Today Mod 1.4.0 [ Uninstall ]
2. User Email System 1.1.3 [ Uninstall ]
3. URL Popup 1.0 [ Uninstall ]
4. Member Color Link 1.8.7 [ Uninstall ]
5. EmailFlash 1.0 [ Uninstall ]
6. SMF 1.1.1 Update Package 1.1.1 [ Uninstall ]
7. Color Bar 2.0 [ Uninstall ]
8. SMF 1.1.2 Update Package 1.1.2

It looks like the Member Color Link mod did modify the Calendar.template.php file.  I am doing a test install locally using Windows XP, Apache 1.3.33, and PHP 4.4.4.  Possible there is a conflict with that mod.  I renamed the backup Calendar.template.php~ to Calendar.template.php and the test passed.  Doing a file comparision, one line is different.

<a href="', $scripturl, '?action=profile;u=', $member['id'], '">', (!empty($member['color']) ? '<font color="'.$member['color'].'">' : ''), $member['name'], isset($member['age']) ? ' (' . $member['age'] . ')' : '', (!empty($member['color']) ? '</font>' : ''), '</a>', $member['is_last'] ? '' : ', ';

and

<a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['name'], isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] ? '' : ', ';

I might try applying the Calendar mod, see what it changes and then manually merge the two.

Weird, the Enhanced Calendar mod does not change that line.  All I did was place that back into the spot where it should be.

Cool. I did the same thing you did. It worked for me.  Thnx for the tip.
Title: Re: Enhanced Calendar
Post by: SpelingMistakes on March 30, 2007, 07:22:08 AM
I have problem with this – All work fine, but I can see events on main board – Calendar itself work good – but I can make it shows on main board – any suggestion?

I am on smf 1.1.2
Title: Re: Enhanced Calendar
Post by: SpelingMistakes on March 30, 2007, 07:37:09 AM
My mistake – Sorry to all

Simply last event in March was ended yesterday - I didn't noticed that next was scheduled around 16 or 17 April, which left field for upcoming events empty :(

:( Sorry


Question

Can I solve my problem of events which repeat every year – I didn't notice that in this mod! – Am I push to install another one or?
Title: Re: Enhanced Calendar
Post by: Zuma on April 02, 2007, 03:00:06 PM
Hi, package was installed fine, but I'm getting this error trying to display Calendar:

QuoteParse error: syntax error, unexpected $end, expecting ',' or ')' in /home/mfclanc/public_html/forum2/Sources/Calendar.php on line 689

I went to check Calendar.php file, the code ends in line 689 like this:

// If you're not allowed to edit any events, you have to be the poster.
if ($_REQUEST['eventid'] > 0 && !allowedTo('calendar_edit_any'))
{
// Get the event's poster.
$request = db_query("
SELECT ID_MEMBER
FROM {$db_prefix}calendar
WHERE ID_EVENT = $_REQUEST[eventid]
LIMIT 1", __FILE__, __LINE__);
list ($pos
Title: Re: Enhanced Calendar
Post by: Zuma on April 05, 2007, 03:22:11 PM
Could anybody help me?

All I need is the rest of the code... if anyone could copy and paste both calendar.php and calendar.template.php here that would help a lot. =p

ty

Title: Re: Enhanced Calendar
Post by: Zuma on April 09, 2007, 10:30:05 PM
No help then =/

alright I'll just uninstall the mod, anyway thanks for making it.
Title: Re: Enhanced Calendar
Post by: gdoermann on May 08, 2007, 10:08:59 PM
I love this mod.  I think it would be nice to have a few other features though... (I don't know php yet... so... I just have to request them here).  It would be nice to have:

- Print preview and calender printing
- Attendee's list
- Add times to entries
- Maybe a quick add at the bottom
Title: Re: Enhanced Calendar
Post by: RoarinRow on May 08, 2007, 10:27:08 PM
Quote from: The_Abhorred on April 08, 2007, 04:41:45 PM
i need to move the enchanced sidebar thing to the right, because my tinyportal panels are on the left, thanks

I wanted to keep this mod, but my Tiny Portal blocks kept pushing the page out making people scroll left to right.

Anyone have a fix for this?
Title: Re: Enhanced Calendar
Post by: babjusi on May 11, 2007, 12:21:26 AM
Quote from: RoarinRow on May 08, 2007, 10:27:08 PM
Quote from: The_Abhorred on April 08, 2007, 04:41:45 PM
i need to move the enchanced sidebar thing to the right, because my tinyportal panels are on the left, thanks

I wanted to keep this mod, but my Tiny Portal blocks kept pushing the page out making people scroll left to right.

Anyone have a fix for this?

I have this mod and TinyPortal as well, and it hasn''t given me any kind of problem so far.
Title: Re: Enhanced Calendar
Post by: RoarinRow on May 11, 2007, 12:49:17 AM
Quote from: babjusi on May 11, 2007, 12:21:26 AM
Quote from: RoarinRow on May 08, 2007, 10:27:08 PM
Quote from: The_Abhorred on April 08, 2007, 04:41:45 PM
i need to move the enchanced sidebar thing to the right, because my tinyportal panels are on the left, thanks

I wanted to keep this mod, but my Tiny Portal blocks kept pushing the page out making people scroll left to right.

Anyone have a fix for this?

I have this mod and TinyPortal as well, and it hasn''t given me any kind of problem so far.

probably depends on what theme you're using.  i'm using Azure_TP.
Title: Re: Enhanced Calendar
Post by: babjusi on May 11, 2007, 01:22:40 AM
Quote from: RoarinRow on May 11, 2007, 12:49:17 AM
Quote from: babjusi on May 11, 2007, 12:21:26 AM
Quote from: RoarinRow on May 08, 2007, 10:27:08 PM
Quote from: The_Abhorred on April 08, 2007, 04:41:45 PM
i need to move the enchanced sidebar thing to the right, because my tinyportal panels are on the left, thanks

I wanted to keep this mod, but my Tiny Portal blocks kept pushing the page out making people scroll left to right.

Anyone have a fix for this?

I have this mod and TinyPortal as well, and it hasn''t given me any kind of problem so far.

probably depends on what theme you're using.  i'm using Azure_TP.

That could be it then, I am using the default theme.
What language are u using as a default for your forum, by the way?
Title: Re: Enhanced Calendar
Post by: RoarinRow on May 11, 2007, 02:31:08 AM
Quote from: babjusi on May 11, 2007, 01:22:40 AM
Quote from: RoarinRow on May 11, 2007, 12:49:17 AM
Quote from: babjusi on May 11, 2007, 12:21:26 AM
Quote from: RoarinRow on May 08, 2007, 10:27:08 PM
Quote from: The_Abhorred on April 08, 2007, 04:41:45 PM
i need to move the enchanced sidebar thing to the right, because my tinyportal panels are on the left, thanks

I wanted to keep this mod, but my Tiny Portal blocks kept pushing the page out making people scroll left to right.

Anyone have a fix for this?

I have this mod and TinyPortal as well, and it hasn''t given me any kind of problem so far.

probably depends on what theme you're using.&nbsp; i'm using Azure_TP.

That could be it then, I am using the default theme.
What language are u using as a default for your forum, by the way?

English 
Title: Re: Enhanced Calendar
Post by: manudevil on May 23, 2007, 11:50:42 AM
It is a great mod, which works well on 1.1.2, in french, and with other themes. Thanks !

http://alter-tare.manudevil.info
http://forum.crazy-orc.org
Title: Re: Enhanced Calendar manual installation for smf 1.1.2
Post by: Pierre29200 on June 14, 2007, 09:19:27 AM
I am getting an error installing it on SMF 1.1.2

Installing this package will perform the following actions: 
Type Action Description
1. Execute Modification - Modification parse error

So after to try many thing among them unstall other mods, chmod to 777 Packages, create a new temp folder inside Packages with 777 chmod, i decide to install manually using SMF Package Parser (http://modparser.dev.dansoftaustralia.net/)

So i modify manually the two files supplied in this mod :
Sources/calendar.php
Themes/default/Calendar.template.php

I keep the original files with the names :
Sources/calendar.php~
Themes/default/Calendar.template.php~

I put in a zip files these 4 files - two original files and the two modified files - and the copy of SMF Package Parser who show every modification.

Hoping it helps,

Pierre
Title: Re: Enhanced Calendar
Post by: nunomoc on June 14, 2007, 10:37:12 AM
I don't know if it's just me but I've tried to install it through the Package Manager and it gave me an error.

I decided to do it manually and I've detected the problem...

On the file install.xml where it says:

Quote<operation>
         <search position="before"><![CDATA[
            'birthdays' => !empty($bday[$date]) ? $bday[$date] : array()
         );
      }
   }
]]></search>

Should be :

Quote<operation>
         <search position="after"><![CDATA[
            'birthdays' => !empty($bday[$date]) ? $bday[$date] : array()
         );
      }
   }
]]></search>

With this little modification the MOD works perfect on my system. Hope it helps!  :D
Title: Re: Enhanced Calendar
Post by: Pierre29200 on June 14, 2007, 01:09:50 PM
Quote from: nunomoc on June 14, 2007, 10:37:12 AM
I don't know if it's just me but I've tried to install it through the Package Manager and it gave me an error.

I decided to do it manually and I've detected the problem...

On the file install.xml where it says:

Quote<operation>
         <search position="before"><![CDATA[
            'birthdays' => !empty($bday[$date]) ? $bday[$date] : array()
         );
      }
   }
]]></search>

Should be :

Quote<operation>
         <search position="after"><![CDATA[
            'birthdays' => !empty($bday[$date]) ? $bday[$date] : array()
         );
      }
   }
]]></search>

With this little modification the MOD works perfect on my system. Hope it helps!  :D

I was very interesting with your experience.
So i decide to verify for me.
So :
1) i try to replace the code :
'birthdays' => !empty($bday[$date]) ? $bday[$date] : array()

);

}

by copy and past from my Calendar.php file into install.xml file of the Calendar_1-1.zip mod.

I compress again the package and want install it :
It does not work but the install error was different. So i find it very strange it was not the same error than for original zip file.

2) I do your modification in the install.xml file
i replace before by after.
It seems  bad for me because when i read this topic :
http://docs.simplemachines.org/index.php?topic=402.0
i can read that :
after - Find the code and add the specified code before it (same as <add before>...</add before>)
before - Find the code and add the specified code after it (same as <add after>...</add after>)
So i can understand why your solution works but i want to try it.
So i compress the files of the mod with modified install.xml file as you tell.
And i can install the mod without error !
But, when i want display Calendar, it's impossible because parse error.
I think it's not the good solution but you help me to understand !
So i do a third thing :

3) After unzip the mod that i download, i compress it again and try to install my zipped file.
I install that without error and it works here :
http://psychostages.org/forum/index.php?action=calendar

So we can do the following conclusion :
the problem is only with some strange thing according to compression of this mod.

So i joined my zipped file mod for who wants try it !
When you unzip, it's exactly the original files !

Enjoy !

Pierre

Title: Re: Enhanced Calendar
Post by: nunomoc on June 14, 2007, 01:37:30 PM
Pierre, my advice to you is to get the original files and do the manual install.
Do not try to install it through the Package Manager.
Do the manual install following all the steps with the modification I told above.

Another option you can do is try my altered files. Maybe they'll help you.

Title: Re: Enhanced Calendar
Post by: nunomoc on June 14, 2007, 01:54:42 PM
For those of you getting the error after install I'll try to explain better:

On the installation file (install.xml) there is a step that orders the following:

Quote<operation>
         <search position="before"><![CDATA[
            'birthdays' => !empty($bday[$date]) ? $bday[$date] : array()
         );
      }
   }
]]></search>

This means that according to this step, the following code will be placed before 'birthdays'.

Quote// Iterate through each week.
   $context['prevMonthWeeks'] = array();
   for ($nRowPrev = 0; $nRowPrev < $nRowsPrev; $nRowPrev++)
   {
      // This is the week number assigned as a key to limit results to a certain week.
      $number = $firstDayOfPrevMonth['weekNum'] + $nRowPrev + $nWeekAdjust&nbsp; + ($curPage['month'] == 1 ? -1 : 0);;

      // Start off the week - and don't let it go above 52, since that's the number of weeks in a year.
      $context['prevMonthWeeks'][$number] = array(
         'days' => array(),
         'number' => $firstDayOfPrevMonth['weekNum'] + $nRowPrev + $nWeekAdjust,
         'week' => $scripturl . '?action=calendar;year=' . $curPagePrev['year'] . ';month=' . $curPagePrev['month'] . ';week=' . $number,
      );
      // Handle the dreaded "week 53", it can happen, but only once in a blue moon ;)
      if ($context['prevMonthWeeks'][$number]['number'] == 53 && $nShiftPrev != 4)
         $context['prevMonthWeeks'][$number]['number'] = 1;

      // And figure out all the days.
      for ($nCol = 0; $nCol < 7; $nCol++)
      {
         $nDay = ($nRowPrev * 7) + $nCol - $nShiftPrev + 1;

         if ($nDay < 1 || $nDay > $context['last_day_prev'])
            $nDay = 0;

         $date = sprintf('%04d-%02d-%02d', $curPagePrev['year'], $curPagePrev['month'], $nDay);

         $context['prevMonthWeeks'][$number]['days'][$nCol] = array(
            'day' => $nDay,
            'date' => $date,
            'is_today' => $date == $today['date'],
            'is_first_day' => !empty($modSettings['cal_showweeknum']) && (($firstDayOfPrevMonth['dayOfWeek'] + $nDay - 1) % 7 == $nStartDay),
         );
      }
   }

   $context['nextMonthWeeks'] = array();
   for ($nRowNext = 0; $nRowNext < $nRowsNext; $nRowNext++)
   {
      // This is the week number assigned as a key to limit results to a certain week.
      $number = $firstDayOfNextMonth['weekNum'] + $nRowNext + $nWeekAdjust + ($curPage['month'] == 12 ? 1 : 0);

      // Start off the week - and don't let it go above 52, since that's the number of weeks in a year.
      $context['nextMonthWeeks'][$number] = array(
         'days' => array(),
         'number' => $firstDayOfNextMonth['weekNum'] + $nRowNext + $nWeekAdjust,
         'week' => $scripturl . '?action=calendar;year=' . $curPageNext['year'] . ';month=' . $curPageNext['month'] . ';week=' . $number,

      );
      // Handle the dreaded "week 53", it can happen, but only once in a blue moon ;)
      if ($context['nextMonthWeeks'][$number]['number'] == 53 && $nShiftNext != 4)
         $context['nextMonthWeeks'][$number]['number'] = 1;

      // And figure out all the days.
      for ($nCol = 0; $nCol < 7; $nCol++)
      {
         $nDay = ($nRowNext * 7) + $nCol - $nShiftNext + 1;

         if ($nDay < 1 || $nDay > $context['last_day_prev'])
            $nDay = 0;

         $date = sprintf('%04d-%02d-%02d', $curPageNext['year'], $curPageNext['month'], $nDay);

         $context['nextMonthWeeks'][$number]['days'][$nCol] = array(
            'day' => $nDay,
            'date' => $date,
            'is_today' => $date == $today['date'],
            'is_first_day' => !empty($modSettings['cal_showweeknum']) && (($firstDayOfNextMonth['dayOfWeek'] + $nDay - 1) % 7 == $nStartDay),
            'week' => $scripturl . '?action=calendar;year=' . $curPageNext['year'] . ';month=' . $curPageNext['month'] . ';week=' . $number,
         );
      }
   }

If you let do the install through the package manager you'll get errors because the code in pink is incorrect.
It shouldn't place the code above before 'birthdays' but after that code. So, if you do a manual install try searching the position after the following code and add the code above. If you're having problems with the file is because probably you already have the code inserted before birthdays. So please cut the code from the wrong place and paste it after...

Below you have what should be the correct order on the install file. It worked for me when I did the manual install. I did not install this package through the package manager.

Quote<operation>
         <search position="after"><![CDATA[
            'birthdays' => !empty($bday[$date]) ? $bday[$date] : array()
         );
      }
   }
]]></search>

So, looking at this post, please edit your calendar.php file, search for birthdays and retrieve the code in red that has been wrongly placed before birthdays and paste it after the code in blue.
Title: Re: Enhanced Calendar
Post by: tpruessner on June 18, 2007, 01:56:22 PM
Type Action Description
1. Execute Modification - Modification parse error

I am getting this error and I am having a hard time figuring out what exactly I need to do?  There are several fixes but which one is the one I need to do?

Thank you!
Title: Re: Enhanced Calendar
Post by: Reekie_Red on July 05, 2007, 11:11:00 PM
Nice mod. I got it to work, and it's especially handy for me as I'm running a soccer website and it's quite a handy feature to have to display fixtures.

Couple of queries ... what's the point in the small calendars to the left of the main one? They appear to do nothing! Is my calendar installed incorrectly? All I see is the two side calendars with no notification of whether there's something happening on a particular date.

Also, is there any way of getting, say, the next 3 or 4 days of the calendar that have entries in them to appear at the top of the index?

fyi my site is www.donstalk.co.uk and the calendar link has been changed, so now it's called "Fixtures"
Title: Re: Enhanced Calendar
Post by: Reekie_Red on July 08, 2007, 11:14:30 PM
Any ideas? Basically I am seeing "Upcoming Calendar" events at the foot of my index page.

But none of these calendar events have DATES! This is pretty useless when people viewing my site want to be able to see WHEN these events happen ... rather than just seeing that they're happening soon.

Perhaps if there's a way of extending the amount of text I can enter into each date ... does anyone know how I can alter the template so that I can type more into each event so that I can, for example, type in the date of the event?

Or perhaps have the actual date of the even appearing on my index page?

www.donstalk.co.uk
Title: Re: Enhanced Calendar (additional field, time to show?)
Post by: wjhdiz on July 13, 2007, 09:40:44 AM
Hi,

Is there a way to add additional fields to make the calendar like:

http://supercali.inforest.com/demo_calendar/

Any suggestions are greatly appreciated.

Jimmy
Title: Re: Enhanced Calendar
Post by: erlend_sh on August 04, 2007, 02:20:46 PM
1) Is this mod compatible with 1.1.3?
2) Has someone else picked up the development of this mod yet since Daniel15 left it?
Title: Re: Enhanced Calendar
Post by: JoannaGlass on August 21, 2007, 10:41:16 AM
Quote from: Sadr on August 04, 2007, 02:20:46 PM
1) Is this mod compatible with 1.1.3?
2) Has someone else picked up the development of this mod yet since Daniel15 left it?

Ditto?
Title: Re: Enhanced Calendar
Post by: Tony Reid on August 21, 2007, 10:50:34 AM
Quote from: JoannaGlass on August 21, 2007, 10:41:16 AM
Quote from: Sadr on August 04, 2007, 02:20:46 PM
1) Is this mod compatible with 1.1.3?
2) Has someone else picked up the development of this mod yet since Daniel15 left it?

Ditto?

This mod runs fine on 1.1.3
Title: Re: Enhanced Calendar
Post by: ES23 on September 02, 2007, 12:20:27 AM
I'm using SMF 1.1.3 with Mambo 4.6.2,using SMF-Mambo Bridge 1.1 by Orstio.I have clear out quite alot of errors already but it's reported on my smf forum log some of the following errors:

http://www.website.com/forums/index.php?option=com_smf&amp;Itemid=4&amp;Itemid=4&amp;action=calendar&amp;year=2006&amp;month=9&a
2: Invalid argument supplied for foreach()
File: /var/www/html/forums/Themes/default/Calendar.template.php (main sub template - eval?)
Line: 256

http://www.website.com/forums/index.php?option=com_smf&amp;Itemid=4&amp;Itemid=4&amp;action=calendar&amp;year=2009&amp;month=12&amp;w
8: Undefined offset: 1
File: /var/www/html/forums/Themes/default/Calendar.template.php (main sub template - eval?)
Line: 250

http://www.website.com/forums/index.php?option=com_smf&amp;Itemid=4&amp;Itemid=4&amp;action=calendar&amp;year=2006&amp;month=1&amp;wee
8: Undefined offset: 6
File: /var/www/html/forums/Themes/default/Calendar.template.php (main sub template - eval?)
Line: 248

http://www.website.com/forums/index.php?option=com_smf&amp;Itemid=4&amp;Itemid=4&amp;action=calendar&amp;year=2005&amp;month=12&amp;we
8: Undefined offset: 1
File: /var/www/html/forums/Themes/default/Calendar.template.php (main sub template - eval?)
Line: 250

http://www.website.com/forums/index.php?option=com_smf&amp;Itemid=4&amp;Itemid=4&amp;action=calendar&amp;year=2005&amp;month=12&amp;we
8: Undefined offset: 48
File: /var/www/html/forums/Themes/default/Calendar.template.php (main sub template - eval?)
Line: 250

Here is my calendar.template.php file:

<?php// Version: 1.1; Calendar// The main calendar - January, for example.function template_main(){ global $context, $settings, $options, $txt, $scripturl, $modSettings, $func; echo ' <div style="padding: 3px;">', theme_linktree(), '</div> <table cellspacing="4" cellpadding="2" width="100%"> <tr> <td valign="top"> <table cellspacing="1" cellpadding="2" width="100%">'; // The previous month if (isset($context['previous_calendar'])) { echo ' <tr> <td> <table class="bordercolor" cellspacing="1" cellpadding="2" width="100%"> <tr class="titlebg"> <td align="center" colspan="8" style="padding: 5px;"> ', $txt['months_titles'][$context['current_month_prev']], ' ', $context['current_year_prev'], ' </td> </tr> <tr> <td class="titlebg2">&nbsp;</td>'; // Show each day of the week. foreach ($context['week_days'] as $day) echo ' <td class="titlebg2" width="14%" align="left">', $func['substr']($txt['days'][$day], 0, 1), '</td>'; echo ' </tr>'; /* Each week in weeks contains the following: days (a list of days), number (week # in the year.) */ foreach ($context['prevMonthWeeks'] as $week) { echo ' <tr> <td class="titlebg2"><a href="', $week['week'], '">&raquo;</a></td>'; /* Every day has the following: day (# in month), is_today (is this day *today*?), is_first_day (first day of the week?), holidays, events, birthdays. (last three are lists.) */ foreach ($week['days'] as $day) { // If this is today, make it a different color and show a border. echo ' <td valign="top" align="right" style="height: auto; padding: 2px;" class="', $day['is_today'] ? 'calendar_today' : (empty($day['day']) ? 'windowbg3' : 'windowbg'), '">'; // Skip it if it should be blank - it's not a day if it has no number. if (!empty($day['day'])) echo $day['day']; echo ' </td>'; } echo ' </tr>'; } echo ' </table> </td> </tr> <tr> <td>&nbsp;</td> </tr>'; } // Current month echo ' <tr> <td> <table class="bordercolor" cellspacing="1" cellpadding="2" width="100%">'; echo' <tr class="titlebg"> <td align="center" colspan="8" style="padding: 5px;"> ', $txt['months_titles'][$context['current_month']], ' ', $context['current_year'], ' </td> </tr> <tr> <td class="titlebg2">&nbsp;</td>'; // Show each day of the week. foreach ($context['week_days'] as $day) echo ' <td class="titlebg2" width="14%" align="center">', $func['substr']($txt['days'][$day], 0, 1), '</td>'; echo ' </tr>'; /* Each week in weeks contains the following: days (a list of days), number (week # in the year.) */ foreach ($context['weeks'] as $week) { // This is used to highlight the current week. $currentWeek = isset($_REQUEST['week']) && $_REQUEST['week'] == $week['number']; echo ' <tr class="bordercolor" cellspacing="1" cellpadding="2"> <td class="titlebg2"><a href="', $week['week'], '">&raquo;</a></td>'; /* Every day has the following: day (# in month), is_today (is this day *today*?), is_first_day (first day of the week?), holidays, events, birthdays. (last three are lists.) */ foreach ($week['days'] as $day) { // If this is today, make it a different color and show a border. echo ' <td valign="top" align="right" style="height: auto; padding: 2px;" class="', $day['is_today'] ? 'calendar_today' : (empty($day['day']) ? 'windowbg3' : ($currentWeek ? 'windowbg2' : 'windowbg')), '">'; // Skip it if it should be blank - it's not a day if it has no number. if (!empty($day['day'])) echo $day['day']; echo ' </td>'; } echo ' </tr>'; } echo ' </table> </td> </tr>'; if (isset($context['next_calendar'])) { echo ' <tr> <td>&nbsp;</td> </tr> <tr> <td> <table class="bordercolor" cellspacing="1" cellpadding="2" width="100%">'; echo' <tr class="titlebg"> <td align="center" colspan="8" style="padding: 5px;"> ', $txt['months_titles'][$context['current_month_next']], ' ', $context['current_year_next'], ' </td> </tr> <tr> <td class="titlebg2">&nbsp;</td>'; // Show each day of the week. foreach ($context['week_days'] as $day) echo ' <td class="titlebg2" width="14%" align="center">', $func['substr']($txt['days'][$day], 0, 1), '</td>'; echo ' </tr>'; /* Each week in weeks contains the following: days (a list of days), number (week # in the year.) */ foreach ($context['nextMonthWeeks'] as $week) { echo ' <tr> <td class="titlebg2"><a href="', $week['week'], '">&raquo;</a></td>'; /* Every day has the following: day (# in month), is_today (is this day *today*?), is_first_day (first day of the week?), holidays, events, birthdays. (last three are lists.) */ foreach ($week['days'] as $day) { // If this is today, make it a different color and show a border. echo ' <td valign="top" align="right" style="height: auto; padding: 2px;" class="', $day['is_today'] ? 'calendar_today' : ((empty($day['day']) || isset($_REQUEST['week']) && $week['week'] == $_REQUEST['week']) ? 'windowbg3' : 'windowbg'), '">'; // Skip it if it should be blank - it's not a day if it has no number. if (!empty($day['day'])) echo $day['day']; echo ' </td>'; } echo ' </tr>'; } echo ' </table> </td> </tr>'; } echo' </table> </td> <td width="80%" valign="top"> <table cellspacing="1" cellpadding="2" width="100%" class="bordercolor">'; if (isset($_REQUEST['week']) && (int) $_REQUEST['week'] <= 53 && (int)$_REQUEST['week'] > 0) { // Set the vars used for prev and next week vars if ($_REQUEST['week'] == 1 && isset($context['prevMonthWeeks'][53]['week'])) { $prevWeek = 53; $prevWeeks = isset($context['weeks'][$prevWeek]['week']) ? 'weeks' : 'prevMonthWeeks'; } elseif ($_REQUEST['week'] == 1 && isset($context['weeks'][52]['week'])) { $prevWeek = 52; $prevWeeks = isset($context['weeks'][$prevWeek]['week']) ? 'weeks' : 'prevMonthWeeks'; } else { $prevWeek = $_REQUEST['week'] - 1; $prevWeeks = isset($context['weeks'][$prevWeek]['week']) ? 'weeks' : 'prevMonthWeeks'; } // Next week vars if ($_REQUEST['week'] == 52 && isset($context['weeks'][53]['week'])) { $nextWeek = 53; $nextWeeks = 'weeks'; } elseif ($_REQUEST['week'] == 53) { $nextWeek = 1; $nextWeeks = isset($context['weeks'][$nextWeek]['week']) ? 'weeks' : 'nextMonthWeeks'; } else { $nextWeek = $_REQUEST['week'] + 1; $nextWeeks = isset($context['weeks'][$nextWeek]['week']) ? 'weeks' : 'nextMonthWeeks'; } echo ' <tr class="titlebg"> <td style="font-size: large;" align="center" colspan="7"> <a href="', $context[$prevWeeks][$prevWeek]['week'], '">&laquo;</a> &nbsp;', $txt['months_titles'][$context['current_month']], ' ', $context['current_year'], '&nbsp; <a href="', $context[$nextWeeks][$nextWeek]['week'], '">&raquo;</a> </td> </tr>'; // This var is used to determine if the first day of week is sunday or monday $weekOffset = !empty($options['calendar_start_day']) ? $options['calendar_start_day'] : 0; foreach ($context['weeks'][$_REQUEST['week']]['days'] as $day) { echo ' <tr class="windowbg3"> <td style="padding: 5px; font-size: small; font-weight: bold;" colspan="2"> <div style="text-align: left; margin: 0;"> ', $txt['days'][$weekOffset], ' ', !empty($day['day']) ? '<span style="float: right;"><a href="' . $scripturl . '?action=calendar;sa=post;month=' . $context['current_month'] . ';year=' . $context['current_year'] . ';day=' . $day['day'] . ';sesc=' . $context['session_id'] . '">' . $txt['calendar23'] . '</a></span>' : '', ' </div> </td>'; echo ' </tr>'; echo ' <tr class="windowbg2"> <td width="5%" align="center" class="', empty($day['day']) ? 'windowbg2' : 'windowbg', '" style="padding: 4px; font-size: small;"> ', empty($day['day']) ? '&nbsp;' : $day['day'], ' </td> <td width="95%">'; // Are there any holidays? if (!empty($day['holidays'])) echo ' <div class="smalltext" style="color: #', $modSettings['cal_holidaycolor'], ';">', $txt['calendar5'], ' ', implode(', ', $day['holidays']), '</div>'; // Show any birthdays... if (!empty($day['birthdays'])) { echo ' <div class="smalltext"> <span style="color: #', $modSettings['cal_bdaycolor'], ';">', $txt['calendar3'], '</span> '; /* Each of the birthdays has: id, name (person), age (if they have one set?), and is_last. (last in list?) */ foreach ($day['birthdays'] as $member) echo ' <a href="', $scripturl, '?action=profile;u=', $member['id'], '">', (!empty($member['color']) ? '<span style="color:'.$member['color'].';">' : ''), $member['name'], isset($member['age']) ? ' (' . $member['age'] . ')' : '', (!empty($member['color']) ? '</span>' : ''), '</a>', $member['is_last'] ? '' : ', '; echo ' </div>'; } // Any special posted events? if (!empty($day['events'])) { echo ' <div class="smalltext"> <span style="color: #', $modSettings['cal_eventcolor'], ';">', $txt['calendar4'], '</span>'; /* The events are made up of: title, href, is_last, can_edit (are they allowed to?), and modify_href. */ foreach ($day['events'] as $event) { // If they can edit the event, show a star they can click on.... if ($event['can_edit']) echo ' <a href="', $event['modify_href'], '" style="color: #FF0000;">*</a> '; echo ' ', $event['link'], $event['is_last'] ? '' : ', '; } echo ' </div>'; } echo ' </td> </tr>'; if ($context['last_day'] == $day['day']) echo ' <tr class="titlebg2"> <td height="10" colspan="2"></td> </tr>'; // This is used to set the offset between days depending if a week starts on sunday or monday $weekOffset++; if ($weekOffset == 7) $weekOffset = 0; } } else { echo ' <tr>'; // Show each day of the week. foreach ($context['week_days'] as $day) echo ' <td class="titlebg2" width="14%" align="center">', $txt['days'][$day], '</td>'; echo ' </tr>'; /* Each week in weeks contains the following: days (a list of days), number (week # in the year.) */ foreach ($context['weeks'] as $week) { echo ' <tr>'; /* Every day has the following: day (# in month), is_today (is this day *today*?), is_first_day (first day of the week?), holidays, events, birthdays. (last three are lists.) */ foreach ($week['days'] as $day) { // If this is today, make it a different color and show a border. echo ' <td valign="top" style="height: 100px; padding: 2px;" class="', $day['is_today'] ? 'calendar_today' : (empty($day['day']) ? 'windowbg3' : 'windowbg'), '">'; // Skip it if it should be blank - it's not a day if it has no number. if (!empty($day['day'])) { // Should the day number be a link? if (!empty($modSettings['cal_daysaslink']) && $context['can_post']) echo ' <a href="', $scripturl, '?action=calendar;sa=post;month=', $context['current_month'], ';year=', $context['current_year'], ';day=', $day['day'], ';sesc=', $context['session_id'], '">', $day['day'], '</a>'; else echo ' ', $day['day']; // Is this the first day of the week? (and are we showing week numbers?) if ($day['is_first_day']) echo ' <span class="smalltext"> - ', $txt['calendar51'], ' ', $week['number'], '</span>'; // Are there any holidays? if (!empty($day['holidays'])) echo ' <div class="smalltext" style="color: #', $modSettings['cal_holidaycolor'], ';"> ', $txt['calendar5'], ' ', implode(', ', $day['holidays']), ' </div>'; // Show any birthdays... if (!empty($day['birthdays'])) { echo ' <div class="smalltext"> <span style="color: #', $modSettings['cal_bdaycolor'], ';">', $txt['calendar3'], '</span> '; /* Each of the birthdays has: id, name (person), age (if they have one set?), and is_last. (last in list?) */ foreach ($day['birthdays'] as $member) echo ' <a href="', $scripturl, '?action=profile;u=', $member['id'], '">', (!empty($member['color']) ? '<span style="color:'.$member['color'].';">' : ''), $member['name'], isset($member['age']) ? ' (' . $member['age'] . ')' : '', (!empty($member['color']) ? '</span>' : ''), '</a>', $member['is_last'] ? '' : ', '; echo ' </div>'; } // Any special posted events? if (!empty($day['events'])) { echo ' <div class="smalltext"> <span style="color: #', $modSettings['cal_eventcolor'], ';">', $txt['calendar4'], '</span>'; /* The events are made up of: title, href, is_last, can_edit (are they allowed to?), and modify_href. */ foreach ($day['events'] as $event) { // If they can edit the event, show a star they can click on.... if ($event['can_edit']) echo ' <a href="', $event['modify_href'], '" style="color: #FF0000;">*</a> '; echo ' ', $event['link'], $event['is_last'] ? '' : ', '; } echo ' </div>'; } } echo ' </td>'; } echo ' </tr>'; } } echo ' </table> </td> </tr> </table> <form action="', $scripturl, '?action=calendar" method="post" accept-charset="', $context['character_set'], '"> <table cellspacing="0" cellpadding="3" width="100%" class="tborder" style="border-top: 0;"> <tr class="titlebg2"> <td>'; // Is there a calendar for last month to look at? if (isset($context['previous_calendar'])) echo ' <b><a href="', $context['previous_calendar']['href'], '">&#38;#171; ', $txt['months_short'][$context['previous_calendar']['month']], ' ', $context['previous_calendar']['year'], '</a></b>'; echo ' </td> <td align="center">'; // Show a little "post event" button? if ($context['can_post']) echo ' <a href="', $scripturl, '?action=calendar;sa=post;month=', $context['current_month'], ';year=', $context['current_year'], ';sesc=', $context['session_id'], '">', create_button('calendarpe.gif', 'calendar23', 'calendar23', 'align="middle"'), '</a>'; echo ' </td> <td align="center"> <select name="month">'; // Show a select box with all the months. foreach ($txt['months'] as $number => $month) echo ' <option value="', $number, '"', $number == $context['current_month'] ? ' selected="selected"' : '', '>', $month, '</option>'; echo ' </select>&nbsp; <select name="year">'; // Show a link for every year..... for ($year = $modSettings['cal_minyear']; $year <= $modSettings['cal_maxyear']; $year++) echo ' <option value="', $year, '"', $year == $context['current_year'] ? ' selected="selected"' : '', '>', $year, '</option>'; echo ' </select>&nbsp; <input type="submit" value="', $txt[305], '" /> </td> <td align="center">'; // Show another post button just for symmetry. if ($context['can_post']) echo ' <a href="', $scripturl, '?action=calendar;sa=post;month=', $context['current_month'], ';year=', $context['current_year'], ';sesc=', $context['session_id'], '">', create_button('calendarpe.gif', 'calendar23', 'calendar23', 'align="middle"'), '</a>'; echo ' </td> <td align="', !$context['right_to_left'] ? 'right' : 'left', '">'; // Is there a calendar for next month? if (isset($context['next_calendar'])) echo ' <b><a href="', $context['next_calendar']['href'], '">' . $txt['months_short'][$context['next_calendar']['month']] . ' ' . $context['next_calendar']['year'] . ' &#38;#187;</a></b>'; echo ' </td> </tr> </table> </form>';}// Template for posting a calendar event.function template_event_post(){ global $context, $settings, $options, $txt, $scripturl, $modSettings; // Start the javascript for drop down boxes... echo ' <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[ var monthLength = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; function generateDays() { var days = 0, selected = 0; var dayElement = document.getElementById("day"), yearElement = document.getElementById("year"), monthElement = document.getElementById("month"); monthLength[1] = 28; if (yearElement.options[yearElement.selectedIndex].value % 4 == 0) monthLength[1] = 29; selected = dayElement.selectedIndex; while (dayElement.options.length) dayElement.options[0] = null; days = monthLength[monthElement.value - 1]; for (i = 1; i <= days; i++) dayElement.options[dayElement.length] = new Option(i, i); if (selected < days) dayElement.selectedIndex = selected; } function toggleLinked(form) { form.board.disabled = !form.link_to_board.checked; } function saveEntities() { document.forms.postevent.evtitle.value = document.forms.postevent.evtitle.value.replace(/&#38;#/g, "&#38;#38;#"); } // ]]></script> <form action="', $scripturl, '?action=calendar;sa=post" method="post" name="postevent" accept-charset="', $context['character_set'], '" onsubmit="submitonce(this);saveEntities();" style="margin: 0;"> <table width="55%" align="center" cellpadding="0" cellspacing="3"> <tr> <td valign="bottom" colspan="2"> ', theme_linktree(), ' </td> </tr> </table>'; if (!empty($context['event']['new'])) echo ' <input type="hidden" name="eventid" value="', $context['event']['eventid'], '" />'; // Start the main table. echo ' <table border="0" width="55%" align="center" cellspacing="1" cellpadding="3" class="bordercolor"> <tr class="titlebg"> <td>', $context['page_title'], '</td> </tr> <tr> <td class="windowbg"> <table border="0" cellpadding="3" width="100%">'; if (!empty($context['post_error']['messages'])) { echo ' <tr> <td></td> <td> ', $context['error_type'] == 'serious' ? '<b>' . $txt['error_while_submitting'] . '</b>' : '', ' <div style="color: red; margin: 1ex 0 2ex 3ex;"> ', implode('<br />', $context['post_error']['messages']), ' </div> </td> </tr>'; } echo ' <tr> <td align="right"> <b', isset($context['post_error']['no_event']) ? ' style="color: red;"' : '', '>', $txt['calendar12'], '</b> </td> <td class="smalltext"> <input type="text" name="evtitle" maxlength="30" size="30" value="', $context['event']['title'], '" style="width: 90%;" /> </td> </tr><tr> <td></td> <td class="smalltext"> <input type="hidden" name="calendar" value="1" />', $txt['calendar10'], '&nbsp; <select name="year" id="year" onchange="generateDays();">'; // Show a list of all the years we allow... for ($year = $modSettings['cal_minyear']; $year <= $modSettings['cal_maxyear']; $year++) echo ' <option value="', $year, '"', $year == $context['event']['year'] ? ' selected="selected"' : '', '>', $year, '</option>'; echo ' </select>&nbsp; ', $txt['calendar9'], '&nbsp; <select name="month" id="month" onchange="generateDays();">'; // There are 12 months per year - ensure that they all get listed. for ($month = 1; $month <= 12; $month++) echo ' <option value="', $month, '"', $month == $context['event']['month'] ? ' selected="selected"' : '', '>', $txt['months'][$month], '</option>'; echo ' </select>&nbsp; ', $txt['calendar11'], '&nbsp; <select name="day" id="day">'; // This prints out all the days in the current month - this changes dynamically as we switch months. for ($day = 1; $day <= $context['event']['last_day']; $day++) echo ' <option value="', $day, '"', $day == $context['event']['day'] ? ' selected="selected"' : '', '>', $day, '</option>'; echo ' </select> </td> </tr>'; // If events can span more than one day then allow the user to select how long it should last. if (!empty($modSettings['cal_allowspan'])) { echo ' <tr> <td align="right"><b>', $txt['calendar54'], '</b></td> <td class="smalltext"> <select name="span">'; for ($days = 1; $days <= $modSettings['cal_maxspan']; $days++) echo ' <option value="', $days, '"', $context['event']['span'] == $days ? ' selected="selected"' : '', '>', $days, '</option>'; echo ' </select> </td> </tr>'; } // If this is a new event let the user specify which board they want the linked post to be put into. if ($context['event']['new']) { echo ' <tr> <td align="right"><b>', $txt['calendar_link_event'], '</b></td> <td class="smalltext"> <input type="checkbox" class="check" name="link_to_board" checked="checked" onclick="toggleLinked(this.form);" /> </td> </tr> <tr> <td align="right"><b>', $txt['calendar13'], '</b></td> <td class="smalltext"> <select id="board" name="board" onchange="this.form.submit();">'; foreach ($context['event']['boards'] as $board) echo ' <option value="', $board['id'], '"', $board['id'] == $context['event']['board'] ? ' selected="selected"' : '', '>', $board['cat']['name'], ' - ', $board['prefix'], $board['name'], '</option>'; echo ' </select> </td> </tr>'; } echo ' <tr align="center"> <td colspan="2"> <input type="submit" value="', empty($context['event']['new']) ? $txt[10] : $txt[105], '" />'; // Delete button? if (empty($context['event']['new'])) echo ' <input type="submit" name="deleteevent" value="', $txt['calendar22'], '" onclick="return confirm(\'', $txt['calendar_confirm_delete'], '\');" />'; echo ' <input type="hidden" name="sc" value="', $context['session_id'], '" /> <input type="hidden" name="eventid" value="', $context['event']['eventid'], '" /> </td> </tr>'; echo ' </table> </td> </tr> </table> </form>';}?>

I've checked with Orstio and he replied me that most probably it's the calendar mod error rather than the bridge error so I posted here.Can someone pls advise?Thanks :)
Title: Re: Enhanced Calendar
Post by: stummihouse on October 25, 2007, 06:54:38 AM
hello.

it seems it dont work on  1.1.4
Title: Re: Enhanced Calendar
Post by: jdvarner on December 03, 2007, 09:15:13 PM
love this calendar. has anyone figured out how to extend the events past 14 days? some events like tournaments go longer then 14 days. just curious if this has been done.
Title: Re: Enhanced Calendar
Post by: perplexed on February 03, 2008, 08:04:20 PM
Quote from: jdvarner on December 03, 2007, 09:15:13 PM
love this calendar. has anyone figured out how to extend the events past 14 days? some events like tournaments go longer then 14 days. just curious if this has been done.

you can do that in calendar settings in the Admin panel
Title: Re: Enhanced Calendar
Post by: evulness on March 10, 2008, 12:46:27 PM
does anyone know how to get the current month calendar to display correctly?
not index.php?action=calendar, thats fine.... i want the mini current month calendar in a tinyportal block.  i'm trying to use:

if (isset($context['current_month']))
{
echo '<table cellspacing="1" cellpadding="2" width="100%">';
// Current month
echo '
<tr>
<td>
<table class="bordercolor" cellspacing="1" cellpadding="2" width="100%">';
echo'
<tr class="titlebg">
<td align="center" colspan="8" style="padding: 5px;">
', $txt['months_titles'][$context['current_month']], ' ', $context['current_year'], '
</td>
</tr>
<tr>
<td class="titlebg2"> </td>';


// Show each day of the week.
foreach ($context['week_days'] as $day)
echo '
<td class="titlebg2" width="14%" align="center">', $func['substr']($txt['days'][$day], 0, 1), '</td>';

echo '
</tr>';

/* Each week in weeks contains the following:
days (a list of days), number (week # in the year.) */
foreach ($context['weeks'] as $week)
{
// This is used to highlight the current week.
$currentWeek = isset($_REQUEST['week']) && $_REQUEST['week'] == $week['number'];

echo '
<tr class="bordercolor" cellspacing="1" cellpadding="2">
<td class="titlebg2"><a href="', $week['week'], '">»</a></td>';


/* Every day has the following:
day (# in month), is_today (is this day *today*?), is_first_day (first day of the week?),
holidays, events, birthdays. (last three are lists.) */
foreach ($week['days'] as $day)
{
// If this is today, make it a different color and show a border.
echo '
<td valign="top" align="right" style="height: auto; padding: 2px;" class="', $day['is_today'] ? 'calendar_today' : (empty($day['day']) ? 'windowbg3' : ($currentWeek ? 'windowbg2' : 'windowbg')), '">';

// Skip it if it should be blank - it's not a day if it has no number.
if (!empty($day['day']))
echo
$day['day'];

echo '
</td>';
}

echo '
</tr>';
}

echo '
</table>';
}

i get no errors, but my block is empty, except 100%wide alternate colored cells....


i have my own calendar script i wrote for a diferent website, but it doesn't use a database, and i'm not editing it to work for smf, when i should be able to display a mini calendar like used on the default template.
Title: Re: Enhanced Calendar
Post by: CrazyHorse80 on July 20, 2008, 10:35:38 AM
Is it possible to modify this to show events highligting days in small calendars in the left?
Bye,
PS
Title: Re: Enhanced Calendar
Post by: denzil69 on October 08, 2008, 07:21:46 PM
is there a way of showing events on the calendar for guests, but when they click on the event, if they are not members they are sent to a log in page?

ie, they view the calendar, shows XXXX event over a few days, they click on event but cannot view it until they sign up.

its probably a no brainer but i cannot remember where to find the option to use it this way.

cheers gang
Title: Re: Enhanced Calendar
Post by: Moondust on March 29, 2009, 04:18:46 PM
Does this mod work in version 1.1.8? Is there another enhanced calendar mod available?
Title: Re: Enhanced Calendar
Post by: Tiribulus on April 06, 2009, 09:45:53 PM
Quote from: Moondust on March 29, 2009, 04:18:46 PM
Does this mod work in version 1.1.8? >>>

Does for me, straight install, no edits and I have about 1000 mods installed already
Title: Re: Enhanced Calendar
Post by: Ammoratti on December 29, 2009, 12:58:13 AM
Verified:  Mod installed flawlessly on version 1.1.11.
Title: Re: Enhanced Calendar
Post by: GarfieldP on May 30, 2010, 09:21:00 AM
really good mod! I like it alot