Jump to Main Content
Content > XOOPS > Calendar - piCal
Calendar - piCal

piCal is the best general calendaring module that I have found. Recurring appointments and more. Permissions for submissions, editing, approving. Great for communities or single users, and supports the iCal format.

Latest Version: 0.92 | Website


The piCal module uses the iCal format to provide a multi-user, multi-category calendar that can be used for individuals or communities. Among its many features are:

  • Permissioning Globally, by Category
  • Multiple Categories per event
  • Recurring Events
  • Notification of new events globally, by category
  • Mini-calendar Block
  • Extendable Mini-calendar block showing newly added content by module (through plugins)
  • Many other blocks
  • Supports iCal format standard


Installation and upgrades are an easy process. I've used this module since v0.7 on a number of sites and all the updates/upgrades have only required copying the files and updating the module in the Administrator. Note that there is a "common" directory added to the XOOPS root for this module, which includes jscalendar (a javascript calendar tool).



As usual, I've modified the the templates a little bit. Besides the XOOPS templates, there are also some "pattemplate" templates stored in the skin directory. The skin may be specified in the preferences -- the skin name is the name of the directory in the images directory. I recommend that you keep the default skin directory and copy a new one to another directory to prevent loss from overwrites. Unfortunately, as some of the display HTML is embedded in the code, to get things to look the way you want, you will have to delve into code some, too:

  • List View - i forget
  • Yearly View
    • ./images/<skin>/yearly.tmpl.html - main display
    • ./images/<skin>/minical_for_yearly.tmpl.html - individual month mini calendars
  • Monthly View
    • ./images/<skin>/monthly.tmpl.html - main display
    • ./class/piCal.php get_monthly_html function - the HTML for the large calendar {CALENDAR_BODY} used in monthly.tmpl.html
    • ./images/<skin>/minical_for_monthly.tmpl.html - individual month mini calendars
  • Weekly view
    • ./images/<skin>/weekly.tmpl.html - main display (wraps piCal.php get_weekly_html)
    • ./class/piCal.php get_weekly_html function
  • Daily View
    • ./images/<skin>/daily.tmpl.html - main display (wraps piCal.php get_daily_html)
    • ./class/piCal.php get_dailly_html function
  • View/Create/Edit Entries:
    • View: ./class/piCal.php get_schedule_view_html function
    • Create/Edit: ./class/piCal.php get_schedule_edit_html function
  • Blocks
    • MiniCalendar - ./images/<skin>/minical.tmpl.html
    • Month - ./images/<skin>/block_monthly.tmpl.html
  • Locales
    • locales/usa.php - defined holidays and such....

So, now for a short rant.... So, why do this? Is this a port of some other software, or something else? Blah! Great that it supports iCal formats, though, which, to me, is its biggest strengths, being able to manage a calendar more efficiently this way. I must admit, the more I got into changing this modules presentation output, the more I thought I ought to look at another module. Until I realized once again, all this module brings to the XOOPS solution. Sigh. To get the colors to work the way I thought they should in monthly view, I had to re-arrange a little bit of code related to the color stuff. Again, if using templates and solely passing data, then it would work a lot better.

Defects/Enhancement Requests

Smarty Templates

The piCal module doesn't fully use the XOOPS smarty template system. Blah! It should, but likely a bit of programming involved.

Minical Block Shows Target Date

The Minical(endar) Block shows the target date rather than the calendar date, so that calendar changes when someone is using the calendar. Since it's a cached block, then it shows the wrong month to users periodically. Seem strange. It would be nice to be able to choose, but apparently, this is a feature. I prefer it show the current date and not the "target_date". So, I added a couple lines in blocks/pical_mini_calendar.php to do such.


I'd like to have a WYSIWYG editor for this instead of the standard XOOPS DHTML editor. I found some instructions for Koivi, and adapted them for FCKeditor. This required two changes — one for editing (piCal.php) and one for displaying (piCal_xoops.php).

In class/piCal.php around lines 2079-2084, find these:

  $GLOBALS["description_text"] = $description;
  $description_textarea = ob_get_contents();

replace with:

  if ( is_readable(XOOPS_ROOT_PATH . "/class/xoopseditor/fckeditor/formfckeditor.php") ) {
    include_once(XOOPS_ROOT_PATH . "/class/xoopseditor/fckeditor/formfckeditor.php");
    $editor_configs = array();
    $editor_configs["name"] = "description_text";
    $editor_configs["value"] = $description;
    $editor_configs["rows"] = 35;
    $editor_configs["cols"] = 60;
    $editor_configs["width"] = "100%";
    $editor_configs["height"] = "400px";
    $editor = new XoopsFormFckeditor($editor_configs,true);
    $description_textarea = $editor->render();
  } else {
    include_once( XOOPS_ROOT_PATH . "/include/xoopscodes.php" ) ;
    $GLOBALS["description_text"] = $description;
    $description_textarea = ob_get_contents();

In class/piCal_xoops.php, around line 15 (in function textarea_sanitizer_for_show), find: 

  return $myts->displayTarea($data,0,1,1,1,1);

replace with:

  if ( is_readable(XOOPS_ROOT_PATH . "/class/xoopseditor/fckeditor/formfckeditor.php") ) {
    return $myts->displayTarea($data,1,1,1,1,0);
  } else {
    return $myts->displayTarea($data,0,1,1,1,1);

Note: you may need to edit the location of fckeditor depending on which version you have implemented, and you may want to change the size of the text box using the $editor_configs variables passed.

Description Empty on Edit

Upon editing an entry, the description box was empty (in XOOPS 2.3.2b). This was a XOOPS defect fixed in 2.3.3. Whew!

Warning MyTextSanitizer::MakeTboxData4Show

I was getting some errors on installation in 2.3.x. I found an article that showed me how to fix it:

pical/class/pical_xoops.php, line 33, change return $myts->makeTboxData4Show( $data ) ; to return $data;

CSS Layout Problems

For some reason, I was having problems getting the jscalendar CSS to show correctly; I was having a conflict of some sort, which I thought was jQuery related, but it was CSS related. When I loaded the module header (with the calendar CSS) before the theme CSS, I was having major layout problems. Loaded after the theme CSS, I then was getting a transparent box. I ended up removing the title="system" portion of the CSS specification which fixed it. I use title="Default" for my theme css - and then also have some others as needed for screen readers, printing, etc. The fix is on line 127 (for XOOPS 2.3.x or better), just after for other versions of XOOPS.

Other Pages
Previous Page XOOPS 2.4.x Upgrade xForms - XOOPS Contact Us and Form Mail Next Page
Comments are solely the opionion of the author and not to be construed as the opinion of anyone else.



(c) 2006-2007 - Mark Boyden
Privacy - Legal Stuff - Contacts