New Calendar Mod: QCalendar with Ajax [Updated v1.0.8]

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.

New Calendar Mod: QCalendar with Ajax [Updated v1.0.8]

Postby JensZ » Mon Jan 29, 2007 15:17

Hi,

Latest version: v.1.0.8

I have made an attempt to write another calendar module that supports ajax as well as all of the features included in Ionrocks calendar mod. Check it out at http://www.ikfrej.se/index.php?downloads. Please be advised that this is an beta release.

The QCalendar includes the following features:
* Uses Ajax, thanks to Mike West (http://mikewest.org/archive/datarequestor)
* Export to iCal using iCalcreator, thanks to Kjell-Inge
Gustafsson (http://www.kigkonsult.se/iCalcreator/index.php)
* Overlib for tooltip texts, thanks to Erik Bosrup
(http://www.bosrup.com/web/overlib/)
* PopupWindows, thanks to Matt Kruse
(http://www.mattkruse.com/javascript/calendarpopup/)
* Handles single events and recurring events.
* Templates
* Language support (only English and Swedish at the moment)
* Straight-forward administration

Frontend replacement tag:
{QCAL[:calendar_id[:lang_id[:main_template[:event_template[:css]]]]]}
where:
calendar_id - the calendar category Id OR calendar name
lang_id - the language id, e.g "en", "se", etc
main_template - the main template file name
event_template - the event template file name
css - the main CSS class name

Code: Select all
// Show events in all calendar categories with default settings
{QCAL}     

// Show calendar with calendar category id 1
{QCAL:1}

// Show calendar with calendar category name 'MyCalendar'
{QCAL:MyCalendar}

// Show calendar with calendar id 1, english language
{QCAL:1:en}

// Show calendar with calendar id 1, english language, and the file
//my.template.php as the main template file. Please see
//include/inc_module/mod_qcal/inc_front/tmpl for sample templates.
{QCAL:1:en:my.template.php}

// Show calendar with calendar id 1, english language, the file
//my.template.php as the main template file, and my.event.template.php
//as your event template file.
{QCAL:1:en:my.template.php:my.event.template.php}


Frontend demo:
http://www.ikfrej.se
http://www.ikfrej.se/index.php?yearcalendar

Download:
http://www.ikfrej.se/index.php?downloads

Screenshots:
Image

Image

Image

Cheers,

Jens
Last edited by JensZ on Mon Feb 04, 2008 09:40, edited 7 times in total.
JensZ
 
Posts: 136
Joined: Wed Feb 16, 2005 11:18
Location: Stockholm, Sweden

Wohooo

Postby phalancs » Mon Jan 29, 2007 15:34

Wohooo,

great man! Much appreciated :)
2008
User avatar
phalancs
 
Posts: 493
Joined: Thu Feb 19, 2004 04:09
Location: Hamburg, Germany

Postby Klappstuhl28 » Mon Jan 29, 2007 16:40

looks good - thumbs up :D
Lars

Don't say you don't have enough time. You have exactly the same number of hours per day that were given to Helen Keller, Pasteur, Michaelangelo, Mother Teresa, Leonardo da Vinci, Thomas Jefferson, and Albert Einstein. - H. Jackson Brown -

http://www.creategg.de -
User avatar
Klappstuhl28
 
Posts: 817
Joined: Fri Mar 04, 2005 00:58
Location: Hamburg

Postby JensZ » Tue Jan 30, 2007 10:01

Fixed some errors, so now we're up to version 1.0.1.
JensZ
 
Posts: 136
Joined: Wed Feb 16, 2005 11:18
Location: Stockholm, Sweden

Postby JensZ » Thu Feb 08, 2007 10:58

Now up to 1.0.3:

2007-01-30 Jens Zetterström Version 1.0.1
* Fix error with event sets record count
* Add copy events to another calendar category
* Add form headings
2007-02-07 Jens Zetterström Version 1.0.2
* Fix week start day
* Fix validation error for time duration (18:00-20:00 is ok)
2007-02-08 Jens Zetterström Version 1.0.3
* Fix event list for frontend
* Add new setting "show all categories"
* Change event templates
* Allow links in event detail description
JensZ
 
Posts: 136
Joined: Wed Feb 16, 2005 11:18
Location: Stockholm, Sweden

Postby JensZ » Wed Feb 28, 2007 15:19

Version 1.0.4 ready!

2007-02-27 Jens Zetterström Version 1.0.4
* Added setting to use ajax call when opening events in frontend
* Step one for themes; CSS file templates
* Fixed XmlHttpRequest issue with encoding charsets
* Upgraded datarequestor to 1.6
* Fixed IE javascript error when switching calendar in
backend using dropdown.

Enjoy,

Jens
JensZ
 
Posts: 136
Joined: Wed Feb 16, 2005 11:18
Location: Stockholm, Sweden

Postby JensZ » Mon Mar 05, 2007 08:25

Sorry, the zip file was missing a few javascript files that I for some reason thought was part of the phpwcms package. However, they are not so I have now uploaded version 1.0.5 to my server http://www.ikfrej.se/?downloads. Alternatively, download AnchorPosition.js, CalendarPopup.js, and PopupWindow.js from http://www.mattkruse.com/javascript/calendarpopup/source.html and store them in include/inc_js.

Hope this will get your installation working!

/Jens
JensZ
 
Posts: 136
Joined: Wed Feb 16, 2005 11:18
Location: Stockholm, Sweden

Postby WeirdJerk » Thu Mar 08, 2007 15:46

Hi there,

first: Thank you very much for your great work.

I installed the calendar as described in the readme, and things seemed to work out fine. But when trying to creae a new calendar, i get this message:

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /*/*****/htdocs/phpwcms/include/inc_module/mod_qcal/inc_lib/QCalendar.php on line 434
Error:SELECT event.*, cat.name as catName FROM DB_PREPENDphpwcms_cm_events AS event INNER JOIN DB_PREPENDphpwcms_cm_categories AS cat ON cat.id = event.category WHERE approved = 1 AND ((MONTH(date) + (YEAR(date) * 12)) <= (3 + (2007 * 12))) AND ((MONTH(DATE_ADD(date, INTERVAL(span - 1) DAY)) + (YEAR(DATE_ADD(date, INTERVAL(span - 1) DAY)) * 12)) >= (3 + (2007 * 12))) ORDER BY date ASC, time ASC



Any idea, whats wrong ? Creation of database fields with install.sql worked with no error messages.

Thanks in advance,

WJ
WeirdJerk
 
Posts: 8
Joined: Fri Oct 14, 2005 07:57

Postby DeXXus » Thu Mar 08, 2007 20:30

JenZ has a couple choices to edit for correction. He ~may~ decide to append a <space> to:
Code: Select all
$dbPrefix = DB_PREPEND;

In the meantime you can ~try~ editing "/include/inc_module/mod_qcal/conf.inc.php"

FIND:
Code: Select all
$tables['events'] = $dbPrefix."phpwcms_cm_events";
$tables['categories'] = $dbPrefix."phpwcms_cm_categories";

REPLACE WITH:
Code: Select all
$tables['events'] = $dbPrefix." phpwcms_cm_events";
$tables['categories'] = $dbPrefix." phpwcms_cm_categories";

NOTE the single <space> before the text 'phpwcms'. This would be temprary, until JenZ decides how to handle that concatenation.
Single-quotes and Double-quotes usage should be "standardized", particularly regarding strings versus variables, etc. :wink:
User avatar
DeXXus
 
Posts: 2168
Joined: Fri Nov 28, 2003 05:20
Location: USA - Florida

Postby JensZ » Fri Mar 09, 2007 08:43

Hello,

Unfortunately I don't think what Dexxus suggested will solve the issue. There should not be a space after DB_PREPEND.

The qcalendar was developed on an unofficial 1.2.7, and I think there have been some changes in 1.2.8 with regards to how the database connection is being done, as well as the setting of the DB_PREPEND define. If you look in qcal.php (in the phpwcms root dir), I include default.inc.php, where the database connection used to be done. However, in 1.2.8 there is a new file called include/inc_lib/dbcon.inc.php where this is being done. This file must be included in qcal.php for this to work. In my next release, I will try to make qcalendar version-independent, but I currently do not have a 1.2.8+ running.

Add the following line to qcal.php:
Code: Select all
require("include/inc_lib/dbcon.inc.php");


Maybe, you'll need to keep default.inc.php or maybe it needs to be removed, I don't know.

There's another bug in include/inc_module/mod_qcal/inc_html/frontend.inc.html. Replace:
Code: Select all
<script language="javaScript" src="include/inc_module/mod_calendar/inc_js/overlib.js"></script>


with:
Code: Select all
<script language="javaScript" src="include/inc_js/overlib.js"></script>


All of this will be fixed in a coming release (it might be a little while). Sorry for the inconvenience, but I'm not really proud of my testing skills, I just hack my way through life.

Cheers,

Jens
JensZ
 
Posts: 136
Joined: Wed Feb 16, 2005 11:18
Location: Stockholm, Sweden

Postby WeirdJerk » Fri Mar 09, 2007 10:07

Hello,

thanks for the quick help. The code changes altered the situation a bit. The Calendar is correctly displayed in the backend. Alas i still get an error message, when trying to Create a new Calendar or try clicking anywhere on the calendar:

Error:SELECT event.*, cat.name as catName FROM DB_PREPENDphpwcms_cm_events AS event INNER JOIN DB_PREPENDphpwcms_cm_categories AS cat ON cat.id = event.category WHERE approved = 1 AND ((MONTH(date) + (YEAR(date) * 12)) <= (3 + (2007 * 12))) AND ((MONTH(DATE_ADD(date, INTERVAL(span - 1) DAY)) + (YEAR(DATE_ADD(date, INTERVAL(span - 1) DAY)) * 12)) >= (3 + (2007 * 12))) ORDER BY date ASC, time ASCTable 'sql*****.DB_PREPENDphpwcms_cm_events' doesn't exist


I looked up in the sqp db and found both date and time table in phpwcms_cm_events
date is of "date" type and time is "varchar(100)"


Any ideas what could be wrong ?
WeirdJerk
 
Posts: 8
Joined: Fri Oct 14, 2005 07:57

Postby JensZ » Fri Mar 09, 2007 10:15

It looks like you still have the same problem. The problem is this part:

Code: Select all
DB_PREPENDphpwcms_cm_events


It seems like it doesn't know what DB_PREPEND is. When you click on 'New Calendar' or any link for that matter there is an ajax call to the qcal.php script. Here you must include the file that defines DB_PREPEND and stores the db connection in the $db variable. Find the file that does this in your installation and include it in qcal.php.

Sorry that's all I can think of at the moment.

Jens
JensZ
 
Posts: 136
Joined: Wed Feb 16, 2005 11:18
Location: Stockholm, Sweden

Postby WeirdJerk » Fri Mar 09, 2007 15:11

JensZ wrote:It looks like you still have the same problem. The problem is this part:

Code: Select all
DB_PREPENDphpwcms_cm_events


It seems like it doesn't know what DB_PREPEND is. When you click on 'New Calendar' or any link for that matter there is an ajax call to the qcal.php script. Here you must include the file that defines DB_PREPEND and stores the db connection in the $db variable. Find the file that does this in your installation and include it in qcal.php.

Sorry that's all I can think of at the moment.

Jens


Hmh i think conf.inc.php does that ? It is "required once" in qcal.php and gets DB name correctly so i am quit confused why it doesnt get the DB_PREPEND right.

*confused*

Maybe something important is different with the 1.3.0 im running now. Ill have a look :-)
WeirdJerk
 
Posts: 8
Joined: Fri Oct 14, 2005 07:57

Postby JensZ » Fri Mar 09, 2007 15:27

Well, in 1.3.0 it seems to be defined in dbcon.inc.php:

Code: Select all
define ('DB_PREPEND', $phpwcms["db_prepend"] ? $phpwcms["db_prepend"].'_' : '');


Try messing with $phpwcms["db_prepend"] and echo($phpwcms["db_prepend"]) as well as echo(DB_PREPEND) to see what it gives you!

//Jens
JensZ
 
Posts: 136
Joined: Wed Feb 16, 2005 11:18
Location: Stockholm, Sweden

Postby DeXXus » Fri Mar 09, 2007 17:50

Sorry, I didn't mean to confuse or give out bad info. I don't use the mod and did just a cursory look and shot off my mouth! :oops:
User avatar
DeXXus
 
Posts: 2168
Joined: Fri Nov 28, 2003 05:20
Location: USA - Florida

Next

Return to hacks & enhancements

Who is online

Users browsing this forum: Alexa [Bot] and 0 guests