PunBB Resource

Your ultimate PunBB resource!

Keywords:

    (Extended)

You are not logged in.

#1 2007-12-06 20:44:16

Koos
Administrator
Registered: 2007-01-14
Posts: 525
Website

Calendar Categories Add-on 1.1.0

Code:

##
##        Mod title:  Calendar Categories Add-on
##
##      Mod version:  1.1.0
##   Works on PunBB:  1.2.*
##     Release date:  2007-12-06
##           Author:  Koos (pampoen10@yahoo.com)
##
##      Description:  Adds category functionality to Calendar 2.0.8a with
##                    full permission control.
##
##   Affected files:  calendar.php
##                    calendar/config.php
##                    calendar/header.php
##                    lang/English/calendar.php
##                    plugins/AP_Calendar_Settings.php
##                    style/imports/Oxygen_cs.css
##                                     
##       Affects DB:  New tables:
##                       'calendar_categories'
##                       'calendar_perms'
##                    New column in 'calendar' table:
##                       'cat_id'
##
##            Notes:  The functionality for tracking Posts/Topics
##                    and Birthdays has been removed.
##
##       DISCLAIMER:  Please note that "mods" are not officially supported by
##                    PunBB. Installation of this modification is done at your
##                    own risk. Backup your forum database and any and all
##                    applicable files before proceeding.
##
##     Contributors:  seesaw
##

Download here

Offline

 

#2 2007-12-06 20:45:24

Koos
Administrator
Registered: 2007-01-14
Posts: 525
Website

Re: Calendar Categories Add-on 1.1.0

This add-on is for Calendar 2.0.8a - and has been thoroughly tested. It can also be easily uninstalled if wanted.

If you've got Calendar-2.0.7 installed, you must use the readme for calendar-2.0.7.

Features:
* Very easy and quick to install and uninstall
* Can add an unlimited number of categories
* Can specify which categories the different user groups can view/add events to
* Includes all the fixes made in Calendar-2.0.8a beta Patch v18
* Note: The functionality for tracking Posts/Topics and Birthdays has been removed.


1. Displaying Upcoming Events in the Announcements

The following modification will allow you to display a list of upcoming events in the Announcements. Only the events for which the user has permission will be shown. There are two styles to choose from:

Style 1 - Table style

Screenshot


Code:

#
#---------[ 1. OPEN ]-----------------------------------------------
#

footer.php


#
#---------[ 2. FIND (line: 33) ]-----------------------------------------------
#

// END SUBST - <pun_main>


#
#---------[ 3. AFTER, ADD ]-----------------------------------------------
#

// START SUBST - <upevents>

$cal_gid = (!empty($pun_user['g_id'])) ? $pun_user['g_id'] : "3";

// Generate an array with the categories user has permission to view
if ($pun_user['g_id'] == PUN_ADMIN)
{
    $result = $db->query('SELECT cat_id, cat_name, disp_position FROM '.$db->prefix.'calendar_categories ORDER BY disp_position') or error('Unable to fetch category list', __FILE__, __LINE__, $db->error());
}
else
{
    $result = $db->query('SELECT ct.cat_id, ct.cat_name, ct.disp_position, pm.read_cat, pm.post_cat FROM '.$db->prefix.'calendar_categories AS ct LEFT OUTER JOIN '.$db->prefix.'calendar_perms AS pm ON (ct.cat_id=pm.cat_id AND (pm.group_id="'.$cal_gid.'" OR pm.group_id is NULL)) WHERE (pm.read_cat=1 OR pm.read_cat is NULL) ORDER BY ct.disp_position') or error('Unable to fetch group category permission list', __FILE__, __LINE__, $db->error());
}

$num_catsb = $db->num_rows($result);

for ($i = 0; $i < $num_catsb; ++$i)
{
    $cat_listb[] = $db->fetch_row($result);
}

$events= $db->query('SELECT date, id, title, cat_id FROM '.$db->prefix.'calendar WHERE (date >= CURDATE()) AND  (date <= DATE_ADD(CURDATE(), INTERVAL 7 DAY)) ORDER BY date ASC') or error ('Unable to fetch date and events: '.$db->error());

    while ($cur_event = $db->fetch_assoc($events))
    {
        if ($pun_config['o_censoring'] == '1')
            $cur_event['title'] = censor_words($cur_event['title']);
        
        $subject_truncated = pun_htmlspecialchars($cur_event['title']);
        $dateformatted = preg_replace("/-/", ".", $cur_event['date']);

        // Determine if the user has permission to view the event
        for ($i = 0; $i < $num_catsb; ++$i)
        {
            if ($cur_event['cat_id'] == $cat_listb[$i][0])
            {
                $cal_permb = 1;
            }
        }
    
        if ($cal_permb == 1)
        {
            $cur_event_ar[] = ('<a href="'.$pun_config['o_base_url'].'/calendar.php?view=event&amp;type='.$cur_event['cat_id'].'&amp;date='.$dateformatted.'&amp;id='.$cur_event['id'].'" title="'.pun_htmlspecialchars($cur_event['title']).'">'.$subject_truncated.'</a> - '.$dateformatted.'<br />'."\n");
            $cur_event_it = implode($cur_event_ar);
        }

        $cal_permb = 0;
            
    }   //----End While-----------------------
    
    $tpl_main = str_replace('<upevents>',$cur_event_it, $tpl_main);

// END SUBST - <upevents>


#
#---------[ 4. OPEN ]-----------------------------------------------
#

header.php


#
#---------[ 5. FIND (line: 206) ]----------------------------------------------
#

            <div><?php echo $pun_config['o_announcement_message'] ?></div>


#
#---------[ 6. REPLACE WITH ]-----------------------------------------------
#

                <div>
                <table>
                    <tr>
                        <td style="width: 65%"><?php echo $pun_config['o_announcement_message'] ?>
                        </td>
                        <td style="width: 35%" valign="top">
                            <h2><span>Upcoming Events</span></h2><upevents>
                        </td>
                    </tr>
                </table>
                </div>


#
#---------[ 7. SAVE/UPLOAD ]-----------------------------------------------
#

Upload files to forum root.

Style 2 - Horizontal style

Screenshot

Code:

#
#---------[ 1. OPEN ]-----------------------------------------------
#

footer.php


#
#---------[ 2. FIND (line: 33) ]-----------------------------------------------
#

// END SUBST - <pun_main>


#
#---------[ 3. AFTER, ADD ]-----------------------------------------------
#

// START SUBST - <upevents>

$cal_gid = (!empty($pun_user['g_id'])) ? $pun_user['g_id'] : "3";

// Generate an array with the categories user has permission to view
if ($pun_user['g_id'] == PUN_ADMIN)
{
    $result = $db->query('SELECT cat_id, cat_name, disp_position FROM '.$db->prefix.'calendar_categories ORDER BY disp_position') or error('Unable to fetch category list', __FILE__, __LINE__, $db->error());
}
else
{
    $result = $db->query('SELECT ct.cat_id, ct.cat_name, ct.disp_position, pm.read_cat, pm.post_cat FROM '.$db->prefix.'calendar_categories AS ct LEFT OUTER JOIN '.$db->prefix.'calendar_perms AS pm ON (ct.cat_id=pm.cat_id AND (pm.group_id="'.$cal_gid.'" OR pm.group_id is NULL)) WHERE (pm.read_cat=1 OR pm.read_cat is NULL) ORDER BY ct.disp_position') or error('Unable to fetch group category permission list', __FILE__, __LINE__, $db->error());
}

$num_catsb = $db->num_rows($result);

for ($i = 0; $i < $num_catsb; ++$i)
{
    $cat_listb[] = $db->fetch_row($result);
}

$events= $db->query('SELECT date, id, title, cat_id FROM '.$db->prefix.'calendar WHERE (date >= CURDATE()) AND  (date <= DATE_ADD(CURDATE(), INTERVAL 7 DAY)) ORDER BY date ASC') or error ('Unable to fetch date and events: '.$db->error());

    while ($cur_event = $db->fetch_assoc($events))
    {
        if ($pun_config['o_censoring'] == '1')
            $cur_event['title'] = censor_words($cur_event['title']);
            
        $subject_truncated = pun_htmlspecialchars($cur_event['title']);
        $dateformatted = preg_replace("/-/", ".", $cur_event['date']);

            // Determine if the user has permission to view the event
            for ($i = 0; $i < $num_catsb; ++$i)
            {
                if ($cur_event['cat_id'] == $cat_listb[$i][0])
                {
                    $cal_permb = 1;
                }
            }
    
        if ($cal_permb == 1)
        {
            $cur_event_ar[] = '<a href="'.$pun_config['o_base_url'].'/calendar.php?view=event&amp;type='.$cur_event['cat_id'].'&amp;date='.$dateformatted.'&amp;id='.$cur_event['id'].'" title="'.pun_htmlspecialchars($cur_event['title']).'">'.$subject_truncated.'</a> - '.$dateformatted; 
            $cur_event_it = implode(' &bull; ', $cur_event_ar)."\n";
        }

        $cal_permb = 0;
            
    }   //----End While-----------------------
    
    $tpl_main = str_replace('<upevents>',$cur_event_it, $tpl_main);

// END SUBST - <upevents>


#
#---------[ 4. OPEN ]-----------------------------------------------
#

header.php


#
#---------[ 5. FIND (line: 206) ]----------------------------------------------
#

            <div><?php echo $pun_config['o_announcement_message'] ?></div>


#
#---------[ 6. REPLACE WITH ]-----------------------------------------------
#

                <div>
                    <?php echo $pun_config['o_announcement_message'] ?>
                    <p><br /><strong>Upcoming Events</strong><br /><upevents></p>
                </div>


#
#---------[ 7. SAVE/UPLOAD ]-----------------------------------------------
#

Upload files to forum root.

2. Integrating the Easy BBCode mod into the calendar

If you've got the Easy BBCode mod installed, you can easily integrate it into the calendar. Just make the following modifications:

Code:

#
#---------[ 1. OPEN ]-----------------------------------------------------------
#

calendar.php


#
#---------[ 2. FIND (line: 553) ]-----------------------------------------------
#

                        <div class="txtarea">


#
#---------[ 3. AFTER, ADD ]--------------------------------------------------
#

                        <?php require PUN_ROOT.'mod_easy_bbcode.php'; ?>


#
#---------[ 4. FIND (line: 905) ]-----------------------------------------------
#

                        <div class="txtarea">


#
#---------[ 5. AFTER, ADD ]--------------------------------------------------
#
        
                        <?php require PUN_ROOT.'mod_easy_bbcode.php'; ?>


#
#---------[ 6. SAVE/UPLOAD ]-------------------------------------------------
#

Upload file to forum root.

3. 'Update annual events' tool

A tool that allows you to move all events containing a certain string in the event title or body to any year you specify.
Click here for more details.

Last edited by Koos (2009-09-06 00:54:40)

Offline

 

#3 2007-12-07 07:49:30

seesaw
Member
Registered: 2007-04-27
Posts: 164

Re: Calendar Categories Add-on 1.1.0

Thanks Koos for your work on this. Great stuff, as usual.

Offline

 

#4 2008-02-18 15:47:47

seesaw
Member
Registered: 2007-04-27
Posts: 164

Re: Calendar Categories Add-on 1.1.0

The amended code in v1.1.0 causes a problem for me.

The Javascript that attempts to do fancy things with the display of the minicals generates a 404 error when I try and run calendar.php:

Not Found
The requested URL /puncal/< was not found on this server.

The URL in question that calendar.php generates looks like:

Code:

http://localhost/puncal/<?=$GLOBALS[callget_res_page_name]?>

Removing the offending php block in calendar.php that calls get_resolution.php etc makes the problem go away.

A simpler way to address the issue of sub-optimal display of the mini-cals at <800 width may be to change the code in calendar.php to only display 3 months of minicals in that view, rather than the default  6 months worth.

Also there is a minor issue with calendar.php and weekly views I just came across that causes a problem with the latest v1.1.0 of the calendar-category addon, and indeed with the calendar in its normal, non-category version.

It can be reproduced easily: if you go to the current month, then choose Weekly view, then keep clicking 'Previous week' until you leave 2008 and go into 2007.

You will notice that the URL in the last week of 2008 looks something like:

Code:

calendar.php?type=all&week=2008.0

but as you move into 2007 the URL becomes:

Code:

calendar.php?type=all&week=2008.-1

which the calendar.php code can't handle, and so the week on display goes really weird, showing:

January 1970
Thursday
1   

January 1970
Thursday
1   

January 1970
Thursday
1   

January 1970
Thursday
1   

January 1970
Thursday
1   

January 1970
Thursday
1   

January 1970
Thursday
1   

instead of displaying the 3rd or 4th last week of 2007. The mistake is in the code that constructs dates in the Weekly View section of calendar.php. SOmehow that code isn't as elegant as the monthly view code, which doesn't have this problem.

This is not a show-stopper, but it means if people want to browse previous weeks events they can't do so using this means past the current calendar year.

Last edited by seesaw (2008-02-18 15:49:53)

Offline

 

#5 2008-03-24 15:38:52

Koos
Administrator
Registered: 2007-01-14
Posts: 525
Website

Re: Calendar Categories Add-on 1.1.0

seesaw wrote:

The amended code in v1.1.0 causes a problem for me.

The Javascript that attempts to do fancy things with the display of the minicals generates a 404 error when I try and run calendar.php...

Did you get this error when running the calendar on your localhost or website host server? I get the same error on my localhost - but not on my website host server. Might consider removing the 'fancy' javascript that detects the user's screen resolution.

seesaw wrote:

Also there is a minor issue with calendar.php and weekly views I just came across that causes a problem with the latest v1.1.0 of the calendar-category addon, and indeed with the calendar in its normal, non-category version.

It can be reproduced easily: if you go to the current month, then choose Weekly view, then keep clicking 'Previous week' until you leave 2008 and go into 2007...

I was not able to replicate this error - either in the Calendar Patch or this add-on. All events displayed fine for me.

Offline

 

#6 2008-03-24 19:13:14

seesaw
Member
Registered: 2007-04-27
Posts: 164

Re: Calendar Categories Add-on 1.1.0

Koos wrote:

Might consider removing the 'fancy' javascript that detects the user's screen resolution.

That would probably be a good solution. I'm not a big fan of using javascript to do stuff like that when simpler code kludges might address the problem smile

Koos also wrote:

I was not able to replicate this error - either in the Calendar Patch or this add-on. All events displayed fine for me.

Interesting. I must try it again with a completely clean, vanilla install and see what happens - maybe my page code has become a tad mangled over time, thereby causing this erratic behaviour.

Offline

 

#7 2008-03-26 22:36:18

Ememone
Member
Registered: 2008-03-16
Posts: 18

Re: Calendar Categories Add-on 1.1.0

Have I all upgrades what is in patch v10 When i install it ?

Offline

 

#8 2008-03-30 21:26:37

Koos
Administrator
Registered: 2007-01-14
Posts: 525
Website

Re: Calendar Categories Add-on 1.1.0

Ememone wrote:

Have I all upgrades what is in patch v10 When i install it ?

Yes, this mod includes all the fixes made in Patch v10.

Offline

 

#9 2008-04-01 19:10:26

Ememone
Member
Registered: 2008-03-16
Posts: 18

Re: Calendar Categories Add-on 1.1.0

THX, great work man!

Offline

 

#10 2008-04-13 22:31:27

Ememone
Member
Registered: 2008-03-16
Posts: 18

Re: Calendar Categories Add-on 1.1.0

Hey Koos - look!
When I click link to EVENT in Announcement - then there are details of this EVENT in this link. And when I click link to EVENT in Calendar - then there are details of more EVENTS from this day. I would like to have all the same links in Announcement and Calendar. All link may be to details of this one current EVENT - not to details of more EVENTS of this day. How can I change it?

Offline

 

#11 2008-04-14 09:36:13

StevenBullen
Moderator
Registered: 2005-09-13
Posts: 300
Website

Re: Calendar Categories Add-on 1.1.0

Im sure that the calendar mod has a few security flaws. I could be wrong... but sure I read it somewhere.


Blog - Follow Me and FluxBB on Twitter

Offline

 

#12 2008-04-14 12:19:22

seesaw
Member
Registered: 2007-04-27
Posts: 164

Re: Calendar Categories Add-on 1.1.0

StevenBullen wrote:

Im sure that the calendar mod has a few security flaws. I could be wrong... but sure I read it somewhere.

Some work was done to fix several apparent flaws in 2007 that were pointed out in the main calendar thread - this add-on integrates that batch of fixes to the underlying calendar code.

If you know of any other bugs or vulns - especially big, honking ones - drop Koos a line directly perhaps. There may be some still lurking around, no doubt.

Offline

 

#13 2008-04-14 16:13:30

StevenBullen
Moderator
Registered: 2005-09-13
Posts: 300
Website

Re: Calendar Categories Add-on 1.1.0

Nah he could well have them covered. Like I say... it was something I read a while ago. Good old koos... big_smile


Blog - Follow Me and FluxBB on Twitter

Offline

 

#14 2008-04-16 15:24:16

FatalCure
New member
Registered: 2008-04-16
Posts: 4

Re: Calendar Categories Add-on 1.1.0

Is there any way I can get users to register for events, I'm using the calendar for a gaming site for upcoming wars/scrims etc, would be good if users could hit a button that makred them as coming to the event, or not coming, or even just being able to write comments on events to do this, atm, it looks like I have to make a new thread for every event and then linking that thread in the calendar.

Cheers.

Offline

 

#15 2008-04-17 01:11:30

seesaw
Member
Registered: 2007-04-27
Posts: 164

Re: Calendar Categories Add-on 1.1.0

FatalCure wrote:

...or even just being able to write comments on events to do this, atm, it looks like I have to make a new thread for every event and then linking that thread in the calendar.

That would be handy. The calendar in SMF forums - http://www.simplemachines.org - has this feature ('Link an existing topic to the calendar') and it is indeed a very sensible thing to have in an event calendar.

Most forum calandars - including the current punbb calendar mod - evolved out of tools to display birthdays and track user posts only, so an ability to link events to topics wasn't really needed. But for an event calendar, linking topics to events has utility.

SMF does event calendaring from calendar to forum topic. You go into the calendar, post an event, it has an option of 'Link Event To Post', with a drop-down dialog that lets you select which existing forum to post the event in. If you tick that option and then proceed, it opens a second page which lets you create a normal forum topic in the selected forum which is then linked automatically to the calendar event on a certain day.

Then when you browse the calendar, the event description is a direct link to the forum topic itself - there is no separate description of the event in the calendar itself.

Since the calendar in SMF doesn't normally let you record any calendar information other than title, it is sensible for it to use topic posts for the event description.

It would be good to alter the existing punbb calendar mod 'post/edit an event' form to allow the creation of forum topics linked to events in the same way as SMF does it.

Indeed, it might have some advantages doing it that way as you then just use existing punbb database structures and permissions to manage event postings, and only store the topic link in the calendar database, rather than store everything relating to the event (topic, description etc) in it.

Offline

 

#16 2008-04-18 19:43:07

Koos
Administrator
Registered: 2007-01-14
Posts: 525
Website

Re: Calendar Categories Add-on 1.1.0

Ememone wrote:

Hey Koos - look!
When I click link to EVENT in Announcement - then there are details of this EVENT in this link. And when I click link to EVENT in Calendar - then there are details of more EVENTS from this day. I would like to have all the same links in Announcement and Calendar. All link may be to details of this one current EVENT - not to details of more EVENTS of this day. How can I change it?

Hi Ememone - make the following modifications to view only one event at a time when clicking on it in either the month view or week view:

Code:

#
#---------[ 1. OPEN ]-----------------------------------------------
#

calendar.php


#
#---------[ 2. FIND (line: 1405) ]----------------------------------------------
#

        //Find the events for "said" day
$add_cond = ($type=="all") ? ' AND ('.$cat_cond.')' : ' AND cat_id = '.$type;

$sql = 'SELECT id, title, DAYOFMONTH(date) as day FROM '.$db->prefix.'calendar WHERE MONTH(date) = '.$month.' AND (YEAR(date) = '.$year.' OR YEAR(date) = "0000")'.$add_cond;


        $result = $db->query($sql) or error('Unable to fetch calendar dates', __FILE__, __LINE__, $db->error());

        $dates = array('','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','');
        
        $add_cond2 = ($type=="all") ? "" : "&amp;type=".$type;
        while($dates_list = $db->fetch_assoc($result)){
            $dates[$dates_list['day']] .= "<a href='calendar.php?view=event".$add_cond2."&amp;date=".$year.".".$month.".".$dates_list['day']."'>".$dates_list['title']."</a><br />";
        }

?>


#
#---------[ 3. REPLACE WITH ]-----------------------------------------------
#

        //Find the events for "said" day
$add_cond = ($type=="all") ? ' AND ('.$cat_cond.')' : ' AND cat_id = '.$type;

$sql = 'SELECT id, title, cat_id, DAYOFMONTH(date) as day FROM '.$db->prefix.'calendar WHERE MONTH(date) = '.$month.' AND (YEAR(date) = '.$year.' OR YEAR(date) = "0000")'.$add_cond;


        $result = $db->query($sql) or error('Unable to fetch calendar dates', __FILE__, __LINE__, $db->error());

        $dates = array('','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','');
        
        while($dates_list = $db->fetch_assoc($result)){
            $dates[$dates_list['day']] .= "<a href='calendar.php?view=event&amp;type=".$dates_list['cat_id']."&amp;date=".$year.".".$month.".".$dates_list['day']."&amp;id=".$dates_list['id']."'>".$dates_list['title']."</a><br />";
        }

?>


#
#---------[ 4. FIND (line: 1198) ]----------------------------------------------
#

        //Find the events for "said" day (selected week)
        $strWhere = 'WHERE date >= "'.$strdate .'" AND date <= DATE_ADD("'.$strdate.'", INTERVAL 8 DAY )'.$add_cond;
        $strQuery = 'SELECT id, title, DAYOFMONTH(date) as day, date FROM '.$db->prefix.'calendar '.$strWhere;
              $result = $db->query($strQuery) or
                          error('Unable to fetch calendar dates', __FILE__, __LINE__, $db->error());
        $dates = array('','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','');
        
        $add_cond2 = ($type=="all") ? "" : "&amp;type=".$type;
        while($dates_list = $db->fetch_assoc($result)){
            $dates[$dates_list['day']] .= "*<a href='calendar.php?view=event".$add_cond2."&amp;date=".str_replace("-", ".", $dates_list['date'])."'>".$dates_list['title']."</a>&nbsp;&nbsp;";
        }

?>


#
#---------[ 5. REPLACE WITH ]-----------------------------------------------
#

        //Find the events for "said" day (selected week)
        $strWhere = 'WHERE date >= "'.$strdate .'" AND date <= DATE_ADD("'.$strdate.'", INTERVAL 8 DAY )'.$add_cond;
        $strQuery = 'SELECT id, title, cat_id, DAYOFMONTH(date) as day, date FROM '.$db->prefix.'calendar '.$strWhere;
              $result = $db->query($strQuery) or
                          error('Unable to fetch calendar dates', __FILE__, __LINE__, $db->error());
        $dates = array('','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','');
        
        while($dates_list = $db->fetch_assoc($result)){
            $dates[$dates_list['day']] .= "*<a href='calendar.php?view=event&amp;type=".$dates_list['cat_id']."&amp;date=".str_replace("-", ".", $dates_list['date'])."&amp;id=".$dates_list['id']."'>".$dates_list['title']."</a>&nbsp;&nbsp;";
        }

?>


#
#---------[ 6. SAVE/UPLOAD ]-----------------------------------------------
#

Upload file to forum root.

Last edited by Koos (2008-04-18 21:18:33)

Offline

 

#17 2008-04-18 19:47:20

Koos
Administrator
Registered: 2007-01-14
Posts: 525
Website

Re: Calendar Categories Add-on 1.1.0

FatalCure wrote:

Is there any way I can get users to register for events, I'm using the calendar for a gaming site for upcoming wars/scrims etc, would be good if users could hit a button that makred them as coming to the event, or not coming, or even just being able to write comments on events to do this, atm, it looks like I have to make a new thread for every event and then linking that thread in the calendar.

Cheers.

This might be useful indeed. Will look into this when I get a chance.

seesaw wrote:

The calendar in SMF forums - http://www.simplemachines.org - has this feature ('Link an existing topic to the calendar') and it is indeed a very sensible thing to have in an event calendar.
...

Thanks for the tip - I will look at how SMF does it to get some ideas.

Offline

 

#18 2008-04-25 15:20:59

Ememone
Member
Registered: 2008-03-16
Posts: 18

Re: Calendar Categories Add-on 1.1.0

Big thanks Koos - it is working...
When I click link to EVENT in Calendar (or in Announcement) then I will be linked to forum thread - it is possible to make that change?

Last edited by Ememone (2008-04-25 15:29:21)

Offline

 

#19 2008-04-25 19:54:22

Koos
Administrator
Registered: 2007-01-14
Posts: 525
Website

Re: Calendar Categories Add-on 1.1.0

Ememone wrote:

Big thanks Koos - it is working...
When I click link to EVENT in Calendar (or in Announcement) then I will be linked to forum thread - it is possible to make that change?

This is what seesaw was talking about above. It is certainly possible - I will try to implement this feature into the Calendar when I get a chance.

Offline

 

#20 2008-07-16 19:17:58

Koos
Administrator
Registered: 2007-01-14
Posts: 525
Website

Re: Calendar Categories Add-on 1.1.0

Calendar Categories Add-on v1.1.1 now available.

Here are the changes made:

1. Fixed a bug which made it impossible to add events if there is only one calendar category.

2. Updated the get_resolution.php script so that it will now work in PHP5 - but turned it off by default, since it might still not work on some servers. Can be turned on in the Calendar Settings in the Admin control panel.

3. Now possible to enable/disable the 'Days to view' drop down menu on the 'day view' page in the Calendar Settings in the Admin control panel.

4. Some other minor changes.

Offline

 

#21 2008-09-20 11:48:00

Passa
New member
Registered: 2008-06-01
Posts: 5

Re: Calendar Categories Add-on 1.1.0

Hi, I'm now running this categories mod just so I could get the stuff on the front page..

There are a few issues with version 1.1.1. Firstly, it seems as soon as I add another category, the buttons on the bottom of the page for adding and editing events disappear (also there are no boxes to select event categories with adding or editing).

My other issue is the disappearance of birthdays. Even in the options now, it shows this for the birthdays function:
http://img146.imageshack.us/img146/7938/birthdaysrp8.jpg
Weird.

Also one of my biggest gripes.. a rather large flaw in the upcoming events modification. It seems to add events based on how many days they are away... this is silly since event heavy weeks will look ridiculous. It should instead show the upcoming 10 (or whatever) events.. could someone possibly explain how to fix this (the changes to the header/footer php file I'm assuming)?
http://img209.imageshack.us/img209/347/upcomingix7.jpg

Thanks.

Last edited by Passa (2008-09-20 11:48:33)

Offline

 

#22 2008-10-01 22:17:00

Koos
Administrator
Registered: 2007-01-14
Posts: 525
Website

Re: Calendar Categories Add-on 1.1.0

Passa wrote:

Firstly, it seems as soon as I add another category, the buttons on the bottom of the page for adding and editing events disappear (also there are no boxes to select event categories with adding or editing).

You can only ADD/EDIT/DELETE categories in the Calendar Settings of the Admin Control Panel. To add events to an category, the category has to be selected first on the calendar page, and one can then add an event by clicking on the day number in the month view - or the 'Add event' link at the bottom of the Calendar page.

Passa wrote:

My other issue is the disappearance of birthdays. Even in the options now, it shows this for the birthdays function:

As noted in the readme of this mod, the functionality for displaying Birthdays has been removed. I will probably remove the birthdays option in the calendar settings in the next release.

Passa wrote:

Also one of my biggest gripes.. a rather large flaw in the upcoming events modification. It seems to add events based on how many days they are away... this is silly since event heavy weeks will look ridiculous. It should instead show the upcoming 10 (or whatever) events.. could someone possibly explain how to fix this (the changes to the header/footer php file I'm assuming)?

This can be done quite easily by adding the 'LIMIT 10' statement for instance to limit to 10 events. Here is how:

Code:

#
#---------[ 1. OPEN ]-----------------------------------------------
#

footer.php


#
#---------[ 2. FIND ]-----------------------------------------------
#

$events= $db->query('SELECT date, id, title, cat_id FROM '.$db->prefix.'calendar WHERE (date >= CURDATE()) AND  (date <= DATE_ADD(CURDATE(), INTERVAL 7 DAY)) ORDER BY date ASC') or error ('Unable to fetch date and events: '.$db->error());


#
#---------[ 3. REPLACE WITH ]-----------------------------------------------
#

$events= $db->query('SELECT date, id, title, cat_id FROM '.$db->prefix.'calendar WHERE (date >= CURDATE()) AND  (date <= DATE_ADD(CURDATE(), INTERVAL 7 DAY)) ORDER BY date ASC LIMIT 10') or error ('Unable to fetch date and events: '.$db->error());


#
#---------[ 4. SAVE/UPLOAD ]-------------------------------------------------
#

Upload file to forum root.

Offline

 

#23 2008-11-22 18:15:17

Koos
Administrator
Registered: 2007-01-14
Posts: 525
Website

Re: Calendar Categories Add-on 1.1.0

Calendar Categories Add-on v1.1.2 now available.

This update just to bring this mod up to date with all the changes made in Calendar-2.0.8a beta Patch v13.

Here are the changes made:

1. Made a style correction to the 'Week view' page. Previously the table would not adjust to 100% width in Firefox3.

2. Made many changes to the English lang file - to be more in keeping with the punbb way of display text, e.g. 'Current month' instead of 'Current Month'.

3. Made some changes to the calendar's Admin Control Panel.

4. Added the attribute rel="nofollow" to some links to prevent bots and spiders from trying to crawl all the dynamically generated calendar pages.

5. Some other minor changes.

Offline

 

#24 2008-11-23 00:10:06

twohawks
Member
From: Nevada, USA
Registered: 2006-09-21
Posts: 239

Re: Calendar Categories Add-on 1.1.0

Hey Koos,
So I do not have to install this in order to be able to figure what it does, can you explain a little more about what this mod to Cal does, especially in terms of:
1) are these 'categories' taken from the forums, or are they custom created in Calendar, or both?
2a) you state  "Notes:  The functionality for tracking Posts/Topics and Birthdays has been removed",
so does this mean this functionality no longer applies, or is it picked up in some other way (replaced)?
2b) Are categories now 'grouped events' kind of thing?
2c)  What happens with topics/posts?
3) how are categories selected when viewing a calendar... is it through the drop-down menu as before like with topics/posts, events?

...and, well, maybe you could just describe this a little better? I am trying to envision its potential use and advantages.

THANKS!

Last edited by twohawks (2008-11-23 00:13:14)


TwoHawks
Love is the Function
No Form is the Tool

Offline

 

#25 2008-11-23 08:43:00

seesaw
Member
Registered: 2007-04-27
Posts: 164

Re: Calendar Categories Add-on 1.1.0

1) are these 'categories' taken from the forums, or are they custom created in Calendar, or both?
2a) you state  "Notes:  The functionality for tracking Posts/Topics and Birthdays has been removed",
so does this mean this functionality no longer applies, or is it picked up in some other way (replaced)?
2b) Are categories now 'grouped events' kind of thing?
2c)  What happens with topics/posts?
3) how are categories selected when viewing a calendar... is it through the drop-down menu as before like with topics/posts, events?

Hi twohawks!

You can visualize much of what this addon does by looking at some of the screenshots Koos has included in the 'Download' section for the mod.

While I don't want to speak for Koos...

(1) event categories are arbitrarily created, via the admin control panel for the calendar;

(2) This mod turns the calendar pretty much exclusively into a very simple event calendar, designed to record things like 'Community Meeting' 21/12/08, 'Symphony in the Park' 3/1/09 etc under various event categories (eg 'Community' or 'Music'), and that's all it does. This means the ability to track birthdays and the chronology of forum posts (which is what the original calendar did) isn't in this mod of the calendar - ie has been removed. So all that other stuff will no longer work if you install this mod. However with careful installation over the top of an existing calendar install you could probably preserve these functions of the base calendar code.

(2b) I don't think so but I'm not sure what this means.

(2c) The chronology of topics & posts per day etc isn't recorded in this mod, neither is there any link between forum topics/posts and what the events calendar records.

(3) Yes, event categories to display can be selected via a drop down on the various pages of the calendar (month/week/day, as well as in the Add/edit events form) - eg view Event category: 'All | Community | Music'.

I think that's right.

Offline

 

Board footer

Based on PunBB
© Copyright 2002–2005 Rickard Andersson

© Copyright 2004–2006 Kristoffer Jansson

User contributed files are property of their respective owners.