Installing Quick Calendar
Installing the quick calendar is easy. Follow the steps below:
- Make sure your have LAMP running.
- 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.
- Download the source code from here
- Unzip the downloaded code into a directory of your choice.
- Rename config.bak.php to config.php. Configure config.php with the right db and path details.
- 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.
- Lets try to insert a ’small’ calendar. Paste the following code into the page where you want your calendar to appear:
- If you want to customise the calendar, you need to have the right parameters for the initQCalendar() function depending on the theme you choose:
- That’s it. The best way to learn is to look at the demos. Duplicate the theme in the demo and play around.
<?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.
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.












January 13th, 2009 at 5:44 am
The call to initialize the calendar should be
initQCalendar(), not initQCalendarTheme()!
January 13th, 2009 at 12:50 pm
hey, tks for pointing out the typo!
January 13th, 2009 at 6:48 pm
No problem… thanks for writing the module! It’s great.
January 21st, 2009 at 5:20 am
In your installation instructions there is file required in the root folder init.php. That file was not included in the download. Is there something I am missing?
jon
January 21st, 2009 at 1:05 pm
Looks great, but there is no init.php on the .zip download. Should we rename some other file or something? (sorry for this noob question)
January 22nd, 2009 at 10:13 am
I’ve just updated the installation text… Yes, the init.php has been renamed to controller.php. You can copy the demo code to your live file.
January 23rd, 2009 at 12:40 pm
This calendar is great. Will you release it in other languages eventually?
January 31st, 2009 at 11:39 pm
Hey,
Thanks for this app! it looks great!
I just installed it as per the instructions, however the javascript doesn’t seem to be working. Nothing happens when I click the next/previous links. I tried in FireFox and IE..any ideas?
February 7th, 2009 at 4:38 pm
I installed the 2.4 version and I have the same problem as Laurie above. I get the following link in the address field: http://familjenstarck.se/Calendar/quickCalendar/#
And the javascript error is:
Row: 68
Character: 2
Error: Access denied
Code: 0
URL: http://familjenstarck.se/Calendar/quickCalendar
I have just copied your code from number 6 above into a file called index.php
Thank you for a great app!
February 7th, 2009 at 5:00 pm
its a good code but I think it needs to be changed abit to avoid magic quotes.
February 7th, 2009 at 5:13 pm
I had the same problem Laurie. All you have to do is do a find/replace on <?= and change it to <?php echo on the phtml files and on the controller.php and it works a treat.
February 8th, 2009 at 10:17 pm
tks cookie for the tip. yes laurie, can you check if you have the php directive short_open_tag set to 1 (done via php.ini or .htaccess). It should be 1 by default but some host turn it off.
February 12th, 2009 at 6:36 am
Thanks Buddy for the great tool.
It has great flexibility, and easily editable css.
March 23rd, 2009 at 3:58 pm
Thanks for the calendar
Anyway to put the div with addition info always visible by default and change the content only when mouseover another links?
Thanks
April 3rd, 2009 at 1:25 pm
I get this error: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /var/www/qcalendar/controller.php on line 95
When I try to include the stuff into a page.
April 5th, 2009 at 11:03 pm
hi daniel, did you download the sql included in the download? did you configure config.php with the right mysql details?
April 6th, 2009 at 1:26 pm
First of all this is gr8!!
thank u for creating this calendar!
but i have some major problem!
Notice: Use of undefined constant QCALENDAR_SYS_PATH – assumed ‘QCALENDAR_SYS_PATH’ in *………..*\html\qcalendar\controller.php on line 25
Warning: require_once(./config.php) [function.require-once]: failed to open stream: No such file or directory in *———–*\html\qcalendar\controller.php on line 26
any help!
April 7th, 2009 at 10:03 am
did you setup the path to the folder correctly?
April 8th, 2009 at 8:01 am
hi again.
i’m facing a huge problem!
answering ur question yes i did
i’m using IIS first to test locally before uploading.
I installed the DB in my mysql engine
here is the problem!
code:
define(QCALENDAR_WEB_PATH,’http://localhost/greenfields/html/qcalendar’);
i tried
define(‘QCALENDAR_WEB_PATH’,'http://localhost/greenfields/html/qcalendar’);
it worked but no css!! there is no style in the calendar
i tried to do it manually!
i faced another problem
i realized that the date won’t dispaly!(blank) the year and the month!
i’m using ’small’ theme
plz help!
April 10th, 2009 at 12:02 am
hi genius,
for this part:
define(QCALENDAR_WEB_PATH,’http://localhost/greenfields/html/qcalendar’);
If you see the config.php,
it should be something like this
// CONFIGURE WEB LOCATION FROM ROOT
define(QCALENDAR_WEB_PATH,’/qcalendar’);
where
/qcalendar is the web location from “document root”
May 6th, 2009 at 2:41 am
For the uninitiated this distribution is a Gordian Knot. I am jealous of those who have their calendars working.
Apart from the cong.bak.php, I have a collection of PHP files, text files and folders all with numbers in parentheses. The text files are mostly information – license, e-mail, etc. The folders have a JavaScript file, themes, some other PHP files related to updates and, at the root of the installation there are five more config.php files with numbers in the filenames, i.e config(14).php.
There is no init.php nor controller.php anywhere to be found.
I am working with an XAMPP installation on a Windows XP sp3 laptop.
Please expand and clarify.
May 6th, 2009 at 2:55 am
Hold on.I downloaded the package again and it’s all different. Let’s see what happens.
May 7th, 2009 at 3:55 pm
This seems like a really useful application but I’m struggling to get it working. My problem is there is no CSS. I’ve read the above post, but couldn’t understand them. I’m using mac os x and have installed everything locally. Please help.
May 7th, 2009 at 10:25 pm
Ignore last post. I was being stupid. Got css working. However, still not fully operational eg if I click on next month nothing happens…
May 8th, 2009 at 3:07 pm
Please could someone help. I have the calendar displaying correctly, the long description is showing up as a tooltip, but none of the Ajax is working. I can’t change month or return to todays date.
May 14th, 2009 at 7:40 am
hi musonic80, if you can provide a link to your site will be great.
May 14th, 2009 at 9:59 pm
Hi there,
I have two questions. I chose ‘complex’ in the init,
initQCalendar(‘init’,'qCalendarSmall’, $cssCalendar, ‘myContentSmall’, $cssLongDesc, 0,0,0,0,0);
and get two errors:
require_once(/home/cpl/html/qcalendar/themes/complex/model/Calendar.php) [function.require-once]: failed to open stream
I looked in the complex folder and the only thing in it is demo.php.
Second question, is it possible to incorporate events that repeat every week?
Right now I have to make an event every week, where as the week just repeats every tuesday.
Thanks!
MK
May 21st, 2009 at 3:39 pm
Great tool, have done some modifications to pull events out of another data source.
Would be useful to have a week start feature (unless it’s there and i’ve missed it) to be able to make it start on mondays rather than sundays.
May 28th, 2009 at 7:07 am
hi GC,
changing the week start feature is in the demo.
June 6th, 2009 at 1:50 am
I’m having a similar error as others. Everything is setup and working correctly but, for some reason the events are not displaying.
I can add events easily through the admin page and these are updated to the MySQL database correctly. The only problem is that when I display the calendar no events are shown.
Please help.
June 6th, 2009 at 3:42 pm
Okay, I solved this problem and thought I should post this as nobody else has offered up a solution.
1) Each event must be assigned to a category. Choosing Category “All” does not seem to work.
2) Leading zeros should not be present in the dates and will cause the SQL to not correctly find the dates.
Hope this helps.
July 1st, 2009 at 6:07 am
when i try to use, this is happen
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\SITES\demolaycataguases\templates\siteground\calendario\QCalendarBase.php on line 138
July 10th, 2009 at 10:35 pm
Great little program, just need some cleanup here and their.
I tried the demos standard and small they works great, but for some reason the tiny demo won’t work. It displayed with the links and looks good and clean without any javascript errors, but when clik on the links nothing happens. Are there any known problems or solutions?
July 26th, 2009 at 12:23 pm
Great calendar thanks very much!
I know I am duplicating an earlier post, but to get your style working, you need to edit the file called ‘config.php’ find the line that says:
// CONFIGURE WEB LOCATION FROM ROOT
define(QCALENDAR_WEB_PATH,’yourPathToCalendarHere’);
Change yourPathToCalendarHere to the location that you have installed qCalendar relative to the file that you are running qCalendar from, for example. This is my structure:
index.php // This is the file that, when run, has the calendar
|__qCalendar // The dir that has the calendar config files
So, I need to have the line:
// CONFIGURE WEB LOCATION FROM ROOT
define(QCALENDAR_WEB_PATH,’qCalendar’);
If you are looking at the calendar from within the qCalendar folder, you need to have it like this:
// CONFIGURE WEB LOCATION FROM ROOT
define(QCALENDAR_WEB_PATH,’.');
Thanks again!
July 27th, 2009 at 3:01 pm
Hi All,
Trying to get this to work desperately but month and todays date aren’t showing. It’s not styled either.
I’ve installed it locally into htdocs/qcalendar and altered config.php to:
define(QCALENDAR_WEB_PATH,’/qcalendar’);
but to no avail. Have setup DB and also an index.php file with:
initQCalendar(’small’,'qCalendarSmall’, $cssCalendar, ‘myContentSmall’, $cssLongDesc, 0,0,0,0,0);
Would love to get this working. Any help is much appreciated!
Many thanks
July 28th, 2009 at 8:16 pm
For the demos to work properly on some PHP installations make sure to use “<?php echo” instead of “<?=”.
Either that or enable short open tags within php.ini. Using short tags is discouraged when developing code meant for redistribution since short tags may not be supported on the target server. As in my case. Thank you for this application, it may prove useful.
July 30th, 2009 at 11:23 pm
hi manny,
thats why you need “short_open_tag=1″ in php.ini or .htaccess file. Or like you said, change all “=” to “
August 4th, 2009 at 11:43 am
Thanks for the replies. I’ve changed all instances of <?= to <?php
I sadly still don’t see the month or today is. They’re blank.
Sorry!
August 24th, 2009 at 11:36 am
@jarvo
The fact you’re seeing the calendar at all means you have short tags enabled, otherwise you’d just see the code as it was typed.
Anyway, where is your index.php file located? in the htdocs folder, or htdocs/qcalendar folder?
From what I can see in your config.php file, the index file should be in the htdocs folder.
Hope that helps!
September 15th, 2009 at 4:18 pm
is there a admin interface or where can i edit my events?
September 15th, 2009 at 11:31 pm
I don’t know if anyone has already mentioned this, because I am too lazy to read all the comments.
In config.php and controller.php all the names in all constant definitions should be in quotes: define(‘QCALENDAR_WEB_PATH’,'qcalendar’);
Otherwise php displays annoying notices that the constants are undefined. That is if you have set error reporting level in the php.ini to display notices. It’s practically nothing but I thought it’s worth mentioning.
Thanks for the great, awesome, super-duper calendar! I love it!
October 3rd, 2009 at 9:53 am
Hi. Great calendar thanks.
My prev/next links are not working.
I’ve changed all <?= to <?php echo
Any other ideas?
Thanks
November 11th, 2009 at 5:33 pm
Hey, is it possible to change the language of the calendar?
I’d like to translate this calendar to portuguese!
November 17th, 2009 at 10:04 am
Hi i want to ask only one question. My firefox error console give me that error “displayQCalendar is not defined” and My prev/next links are not working. Please help me bpeh. “short_open_tag=1? and change all “<?php echo” instead of “<?=” like this file
November 17th, 2009 at 10:06 am
that doesn’t working !!!
November 17th, 2009 at 10:47 pm
Like so many other I am not able to see any style on the calendar.
This is how it looks: http://i48.tinypic.com/9uc4xv.png
November 18th, 2009 at 12:08 am
Ok guys, I finally got it to work.
1. You’ve got to open longdesc.phtml and calendar.phtl with your preferred text editor, (I use Scite): http://i49.tinypic.com/29kxvt3.png
2. Replace ALL!! the <?= into <?php echo:
From this: http://i46.tinypic.com/2eq3mhh.png
Into this: http://i45.tinypic.com/30m64o3.png
(You have to do this for calendar.phtml, longdesc.html, config.php and controller.php)
3. First extract your qCalendar.zip to htdocs/qCalendar:
http://i45.tinypic.com/2nvs29w.png
4. Then create your index.php file: (remember to change the path.
http://i48.tinypic.com/2z9jxhv.png
5. Save the index file in the htdocs directory
http://i45.tinypic.com/2w2h56o.png
6. Finished.
November 18th, 2009 at 2:08 pm
Hey i had same error zap. Error is Displayqcalendar not defined in my error console. Please help
November 28th, 2009 at 7:44 am
hi there bpeh,
i just found your calendar and it was great. Just what i needed.
After downloading the .zip file, I have successfully created the database on phpmyadmin and place it on my rootfolder. But there are things that i don’t undersdand. Which files are needed to be edited? Is it only the config.php? and Which values will i be replacing on:
1. define(‘QCALENDAR_WEB_PATH’,”);
2. define(QCALENDAR_SYS_PATH, dirname(__FILE__));
3. require_once(QCALENDAR_SYS_PATH.’/config.php’);
4. define(QCALENDAR_TABLE,’qcalendar’);
I placed the unzip folder in> “C:\wamp\www\ReservationSystem\qcalendarV2.5″
and when running it on localhost here is the URL>
“http://localhost/ReservationSystem/qcalendarV2.5/QCalendarBase.php”
Please help me sir. I really need it. Thanks in advance and have a blessed day!!
-singing_bee?
December 8th, 2009 at 9:01 am
Star,
If you’re still trying to fix this, I had the same problem as you tonight. To fix it, in config.php, be sure that
define(QCALENDAR_WEB_PATH,
sets the path to the qcalendar directory *from your web root* (not document root as bpeh wrote elsewhere.) it has to be a relative, not absoulute, path.
for example, if the absolute path is /home/myname/public_html/qcalendar, then
define(QCALENDAR_WEB_PATH,’/qcalendar’);
works; hope this helps.
January 24th, 2010 at 9:50 am
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.
January 25th, 2010 at 1:34 am
I noticed that Sunday displays twice on the Standard calendar. How do you correct this?
February 23rd, 2010 at 5:14 am
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
February 25th, 2010 at 10:27 am
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
February 25th, 2010 at 10:36 am
Ok, forget it…..It’s my own fault…..
March 9th, 2010 at 7:46 pm
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.
March 20th, 2010 at 12:18 pm
I am indebted to this blog and its comment posters for enlightening me .
April 25th, 2010 at 7:13 am
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!
May 11th, 2010 at 11:04 pm
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.
May 13th, 2010 at 3:45 am
I have problems displaying the long description of an event, do not show me accents or ñ
I can do?
thanks
June 8th, 2010 at 11:51 pm
I have the same problem of Yedi! Can the creator of this amazing script solve the problem?? I hope so
June 13th, 2010 at 2:58 pm
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,
July 1st, 2010 at 6:32 pm
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)
http://www.azhowto.com/quick-calendar/
Thanks,
Jesse