Installing Quick Calendar

Installing the quick calendar is easy. Follow the steps below:

  1. Make sure your have LAMP running.
  2. If using PHP 4, need to have magic_quote off. Check that the php directive short_open_tag is 1 (editable via php.ini or .htaccess). The phpinfo() function reveals all your settings.
  3. Download the source code from here
  4. Unzip the downloaded code into a directory of your choice.
  5. Rename config.bak.php to config.php. Configure config.php with the right db and path details.
  6. There should be a sql file in the dowloaded code. Run the sql in your server to create the sample tables and data. You can of course empty the tables and populate with new data later.
  7. Lets try to insert a ‘small’ calendar. Paste the following code into the page where you want your calendar to appear:
  8. <?php
    require_once('path_to/controller.php');
    $cssCalendar= 'float:left;margin-right:30px;';
    $cssLongDesc='float:left;margin-left:50px;width:400px';
    // configure calendar theme
    initQCalendar('small','qCalendarSmall', $cssCalendar, 'myContentSmall', $cssLongDesc, 0,0,0,0,0);
    ?>

    make sure the 'path_to' is the system path to your quick calendar directory.

  9. If you want to customise the calendar, you need to have the right parameters for the initQCalendar() function depending on the theme you choose:

  10. initQCalendar(theme, divCalendar, calendarCss, divLongDesc, longDescCss, day, month, year, category_id, ajax)

    where

    'theme': name of the theme you want to use. It is the directory name under the themes directory.

    'divCalendar': name of the div you want to use to wrap around the calendar.

    'calendarCSS': CSS for DivCalendar above.

    'divLongDesc': name of the div where you want the long description to populate. This can be a new div or an existing one in the page. If it is a new div, you need to create one as shown in the sample above.

    'longDescCss': CSS for the Long Description.

    'day': current day. Leave 0 as the default.

    'month': current month. Leave 0 as the default.

    'year': current year. Leave 0 as the default.

    'category_id': 0 means show all categories.

    'ajax': Determines if this is an ajax call or not. Leave 0 as the default.

  11. That’s it. The best way to learn is to look at the demos. Duplicate the theme in the demo and play around.
Like it.? Share it:

72 Responses to Installing Quick Calendar

  1. Lady V

    Hello –

    I am trying to get the long description to view in an existing div but no matter what I do (edit css, add name of div to calendar funtion) it continues to display in the default location. What am I doing wrong?

    Thanks.

  2. Lady V

    I noticed that Sunday displays twice on the Standard calendar. How do you correct this?

  3. Jordan

    Hey, I’m trying to get this thing working and running into a few issues..

    There’s no style on any of the calendar themes I try – does anyone know what needs to be edited to make them work?

    Also, the next/previous month/years are doing nothing. Once again, anyone with any ideas how to make this work?

    I’ve tried with short_open_tag set to 1, and at zero with <?= replaced by <?php echo in the controller.php, calendar.phtml and longdesc.phtml

    Everything else (as far as I can tell) seems to be working so I’d be great if someone could help with the above.

    Jordan

  4. Bas

    First of all, very nice Calender! Perfectly fits my needs. Only i’m getting an error:

    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\wamp\www\wp-kalender\QCalendarBase.php on line 138

    Any suggestions on this error?

    While running the specific query in phpMyAdmin i get results as expected though.

    grt Bas

  5. Bas

    Ok, forget it…..It’s my own fault…..

  6. metrathon

    Fixes (for XAMPP / Windows)

    1. To display styles. Go to controller.php and change the “/qcalendar” to “qcalendar” or whatever your folder is named. Just make sure you remove the “/”.

    Example:
    // CONFIGURE WEB LOCATION FROM ROOT
    define(QCALENDAR_WEB_PATH,’/what_ever_your_folder_is’);

    to

    // CONFIGURE WEB LOCATION FROM ROOT
    define(QCALENDAR_WEB_PATH,’what_ever_your_folder_is’);

    This will also take care of the popus when you click the days.

    2. Next/previous month/year not working. You need to:
    – Change all “<?=” to “<?php echo” in controller.php and themes/XXX/view/calendar.phtml and longdesc.phtml, where XXX is your style (small, rounded, etc).
    – Change all “href=”#” to “href=”javascript: void();”.

    Do this and you’ll have a functional smart calendar. It took me some time to figure these out.

  7. Lola Minvielle

    I am indebted to this blog and its comment posters for enlightening me .

  8. zac

    This looks great. Is there any documentation anywhere that shows how to use this with a CMS? I would like to build this into the WordPress theme I am making but I need some help getting started. Thanks!

  9. GetCreative

    I noticed that others had the question about two Sundays on the Standard calendar…I was looking for the answer to this for a while too. The fix is to open calendar.phtml and change the line:

    SunMonTueWedThurFriSun

    to:

    SunMonTueWedThurFriSat

    in the themes/standard/view directory.

  10. Yedi

    I have problems displaying the long description of an event, do not show me accents or ñ
    I can do?
    thanks

  11. Rikochett

    I have the same problem of Yedi! Can the creator of this amazing script solve the problem?? I hope so 🙂

  12. Chi Melville

    I’m trying to display only the events for a specific category on the calendar. I have a number of departments associated with the category_id and am setting a variable that calls the category_id. I know the variable if working as I can print it on the calendar page. I have added the variable to the query on the QCalendarBase.php file but it’s not recognizing the variable. If I replace the variable with the number of the category_id, then it works and displays only those events. So I’m stumped as to why it works when referencing the number but not the variable.

    Anybody have a suggestion?

    Thanks in advance,

  13. Jesse

    I’m using a modified version of the rounded corners calendar and noticed if the page the calendar is placed on is partially scrolled the descriptions floating pop up is way off target. Anyone figure out a work around to keep it fixed to the date selected?

    Check this (scroll down and rollover date)
    https://www.azhowto.com/quick-calendar/

    Thanks,
    Jesse

  14. Rick

    I was going to code my own calendar, but then I realized how much work it would be. I looked at several free PHP calendars and I decided that yours fit the look and feel of my site the best. I had to make a number of modifications, like the “change <?= to <?php echo" in a number of files. I also had a hard time getting the path to the CSS and JS correct. However, in three days working on it when I had a chance, I have a really nice and functional calendar of events on my site. The job on my part is to populate the database.

    Thank you!

    You can see the calendar at http://www.coloradotravelmaster.com
    Look under the "what you need" menu for events. I might change the name to "calendar of events", so I did not provide a link to the specific page.

    It's all about search engine optimization…

    Thanks again,
    Rick

  15. andy

    hi, first of all. Thanks for the great application. Now

    I got these errors below. Please help me. I tried all I could for hours thx :).

    Notice: Use of undefined constant QCALENDAR_SYS_PATH – assumed ‘QCALENDAR_SYS_PATH’ in C:\wamp\www\qcalendar\controller.php on line 24

    Notice: Use of undefined constant QCALENDAR_WEB_PATH – assumed ‘QCALENDAR_WEB_PATH’ in C:\wamp\www\qcalendar\config.php on line 23

    Notice: Use of undefined constant QCALENDAR_TABLE – assumed ‘QCALENDAR_TABLE’ in C:\wamp\www\qcalendar\config.php on line 32

    Notice: Use of undefined constant QCALENDAR_CAT_TABLE – assumed ‘QCALENDAR_CAT_TABLE’ in C:\wamp\www\qcalendar\config.php on line 3

  16. bpeh

    hi rick, nice calendar you have there.

    hi andy, you can turn the php notice error off easily in php.ini or in the .htaccess file. As a good practice, I will need to define the constant before using it. will fix that in the next version if i have the time.

  17. Sam

    Was not sure what you meant by “make sure the ‘path_to’ is the system path to your quick calendar directory.” So do you mean the ‘path_to’ is changed or the ‘/controller.php’);’ is changed to the relevant directory?

  18. Sailen

    Thank you for such a good event calender..i am using Rounded Corners Calendar in my website…all things are working good but i have a proble.I want to customize the event detail ..when i click on a event the event detail will be shown in another td if event is there either shown no event is there..it is possible??if then please suggest me??

  19. Sailen

    i want this type of customization on (http://www.cechollywood.org) Rounded Corners Calendar
    plz help me out of that

  20. DdK

    Ji,
    To solve the constants undefined errors I had to place the constants between quotes:
    1. define(‘QCALENDAR_WEB_PATH’,’/qcalendar’);
    2. define(‘QCALENDAR_SYS_PATH’, dirname(__FILE__));
    3. define(‘QCALENDAR_TABLE’,’qcalendar’);

    see also the PHP manual http://www.php.net/manual/en/function.define.php

    If you’re giving the included demo’s a try, don’t forget to adjust QCALENDAR_WEB_PATH in the config file.

    Tested with xampp 1.7.4

  21. andra

    hi, how do i place this code on codeigniter?
    i need this type of calendar
    can u help me plz?
    thank you,,

  22. memp500

    hi I’m using PHP6, month and next year do not work. I can do? …. please urgent help.

    entire calendar looks great and appears in the index.php but does not work next month and year as well as does not show the events in the long description.

    I followed all the steps for installation and does not work yet.