An Event Calendar Mod

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
1996 328ti
Posts: 317
Joined: Mon 19. Apr 2004, 06:10
Location: Greenville, SC USA
Contact:

Post by 1996 328ti »

In an attempt to get this working AGAIN.
I've installed the event calendar.
I am able to add events in the admin section.

One thing I noticed many of the lines of code read
'./include' whereas non calendar sections simply read 'include'.

In an attemt to undertstand the RT, the sample tag shows up as the tag itself.
I figured {Cal_Month} should at least show up but it also displays {Cal_Month}


My test site is at
http://wcms.nccbmwcca.org/index.php?id=28,480,0,0,1,0
to demonstrate.
User avatar
jsw_nz
Posts: 907
Joined: Fri 2. Apr 2004, 02:42
Location: New Zealand

Post by jsw_nz »

Would be nice if the wee bugs are eliminated from this mod....since it is so elegant....if anybody has tweaked the code and can psot an update, would be great.....

1996 328ti
I do appreciate your dilema.....sorry but I have not really looked into the innerworkings of the code....perhaps others will respond...or better yet..provide a stable release....

Perhaps I am wrong...but seems that there is none...
(I am willing to eat my words - - :D ) if such exists.

Cheers
User avatar
Kosse
Posts: 1066
Joined: Thu 9. Sep 2004, 12:08
Location: Brussels, Belgium
Contact:

Post by Kosse »

Hi, a little late but I'm just messing with the calendar MOD (nice job Ionrock and StudioZ !).
Thx to all posters who have helped me install and use this nice MOD, will be uploaded very soon (i'm using it on a 1.2.3 & 1.2.1 dev)

I saw this:
oeconom wrote:
Mobius wrote:Is it possible to start the calendar wint Monday?
Fi yes, how?
That's what I'd like to have, too!
Felix
I think :oops: I found a solution:
Go to > include> inc_module > mod_calendar > inc_lib > calendar.classes.php

Go to line 123 (more or less)
Find the function to make the calendar:

Code: Select all

	function make_calendar($month, $year, $category, $alias=0) {
		$previousmonth = date("n", mktime(0,0,0,$month-1,1,$year));
		$previousyear  = date("Y", mktime(0,0,0,$month-1,1,$year));
		$nextmonth = date("n", mktime(0,0,0,$month+1,1,$year));
		$nextyear  = date("Y", mktime(0,0,0,$month+1,1,$year));
		
		// $monthname = date("F Y", mktime(0,0,0, $month, 1, $year));
		$thisYear =  date("Y", mktime(0,0,0, $month, 1, $year));
		$thisMonth = $this->langInfo[strtolower(date("M", mktime(0,0,0, $month, 1, $year)))];
		$daysinmonth = date("t", mktime(0,0,0,$month,1,$year));
		$startday = date("w", mktime(0,0,0,$month,1,$year));
		$activedays = $this->getactivedays($month, $year, $category);
		$j=0;
		$weeks = "";
		for ($i=0; $i < $startday; $i++) { <------- THIS LINE !!!
Look at last line where $i=0, replace with $i=1

Code: Select all

for for ($i=1; $i < $startday; $i++) { 
Then, find more or less at line 188 (just after the form):

Code: Select all

$days = array("sun", "mon", "tue", "wed", "thu", "fri", "sat");   
		for ($i=0; $i<7; $i++) {
			$calendar .= "<td class="dayname">" . substr($this->langInfo[$days[$i]], 0, 1) . "</td>\n";
REPLACE WITH:

Code: Select all

		$days = array("mon", "tue", "wed", "thu", "fri", "sat", "sun");   
		for ($i=0; $i<8; $i++) {
			$calendar .= "<td class="dayname">" . substr($this->langInfo[$days[$i]], 0, 3) . "</td>\n";
On last line, I replaced 1 by 3
It's to have 3 letters in my days: mon, tue, wed...

Hope that helped.
Cheers
User avatar
jsw_nz
Posts: 907
Joined: Fri 2. Apr 2004, 02:42
Location: New Zealand

Post by jsw_nz »

Hi Kosse,

So it does in fact work.......hmmm.
Are you working on core modifications to it...or were you mentioning that you will be uploading your installation. since you mention that you will posting it in near future.

I would be VERY interested to give this a go....
so let the community know when the newest modifications (if there are any) are complete.

Will watch this thread.

Cheers,
John

BTW: Is the original link to this mod (at ionrocks site) the lastest release or have there been newer releases? (just asking) :D
http://ionrock.org/downloads/calendar_m ... onrock.zip
User avatar
Kosse
Posts: 1066
Joined: Thu 9. Sep 2004, 12:08
Location: Brussels, Belgium
Contact:

Post by Kosse »

Hi jsw_nz,

It does... but I have to admit that it wasn't without messing a little (...) with the code. But basically, it works well if u follow Yves instructions. (except of the PEAR mail quoted in this thread, I had to comment that line as well)

I downloaded several releases but that who seemed to work the best was the one published on StudioZ site.
Realized it is not very obvious to install
I have updated the .zip file and setup a demo calendar on my site:

http://www.malouin.ws/design/downloads-phpwcms.phtml
Download "calendar_mod_v2.01_ionrock.zip"

You can look (but tomorrow -as I am testing CSS and stuff-, it will be different I guess so I'll edit this post when done) here: [edited]
http://www.mjlaloy.be/mjlaloy/index.php?agenda

I'll post the package that worked for me here as well.
But the best result I've seen so far is ... Ionrocks ;)

Cheers
Last edited by Kosse on Fri 16. Sep 2005, 10:53, edited 1 time in total.
User avatar
jsw_nz
Posts: 907
Joined: Fri 2. Apr 2004, 02:42
Location: New Zealand

Post by jsw_nz »

Hi Kosse,

Looking good....so that is the 'modified' calendar mod....just what I am looking for. And thanks for the link to StudioZ website/download. I was completely unaware of this. (Still looks like his version is under construction in right sidebar..)

BIG THanKS :D

Update:

Another ?
You mention "Yves (StudioZ's) instructions" -
are they included in the zip, or are they online?
User avatar
Kosse
Posts: 1066
Joined: Thu 9. Sep 2004, 12:08
Location: Brussels, Belgium
Contact:

Post by Kosse »

Included in the zip file, there is a html instructions page.

No thanks, I've been messign with it sunday and tonight, so if I can come with a clean output it is my DUTY to post it here, as you guys post all what you do and help others out... :P

Cheers
User avatar
jsw_nz
Posts: 907
Joined: Fri 2. Apr 2004, 02:42
Location: New Zealand

Post by jsw_nz »

Great Kosse

I think I will wait for your post.
Very Much Appreciated.... :D :D...but no rush either...
I plan to post my shopping cart hack sometime,
but I do realise the time it takes to get kinks out of it.

Cheers from the other side of the world
John :D
User avatar
Kosse
Posts: 1066
Joined: Thu 9. Sep 2004, 12:08
Location: Brussels, Belgium
Contact:

Post by Kosse »

Thx for the encouragments John, though Ionrock and STudioZ deserve all the credit, I'm just trying to use their stuff... ;)

Well, so far...

I've managed to:
- install it (reading StudioZ instructions)
- customize it (messing with the code, for ex. start week on monday an such...)
- customize css and look and feel (at least frontend, backend is ok)
- play with the templates StudioZ provides on his site

I've NOT managed to:
- link to 1 event only (the links are to ALL events in the current month)
- get the edit_set EDITED though it's ok to publish, but not edit (edit_set: wich allows you to post an event that repeats itself ...say weekly or monthly, I coudn't edit it properly, some Mysql mistake...)

BUT I managed to:
- add the [ID alias] [/ID] replacement tag in an event, wich allows me to bypass the fact that I can't link to only 1 event. But when I come to think of it it's a kinda plus because then I link to a "normal" article with all the rich features PHPWCMS provides :D

I will try to clean a little all of it then post it here. (link still valid, I'm tired, got to get some sleep... domani work --> on the same , am I a lucky guy :) ... or what?

I guess I am, with all this pple helping each others out, I just love it!

Cheers
cbmr777
Posts: 11
Joined: Thu 25. Aug 2005, 21:25
Location: U.S.
Contact:

Post by cbmr777 »

I must say I am totally lost. :oops: I got it where it shows up in my modules and I can add an event (although I can't put any ' in the descriptions of the event. I want this calendar to show up on the homepage on the side right bar. I put this in my homepage template:

<p>The Hogue Calendar</p>
<p>{CAL:24:/include/inc_modules/mod_calendar/inc_front/templates/front.template.php:/include/inc_modules/mod_calendar/inc_front/templates/default.event.template:0:0}</P>

Frankly, I don't know what I am doing wrong... could someone hold my hand and walk me through the rest of this mod setup?

http://www.hoguechronicle.com/index.php
TIA!
Christine
Zym0tiC
Posts: 13
Joined: Tue 2. Aug 2005, 16:33

Post by Zym0tiC »

Is it possible to use this mod to create some sort of weblog. So that the articles I created in a specific category will be added tot the calender?
jami
Posts: 36
Joined: Mon 18. Apr 2005, 18:23
Location: Berlin

Problem wegen edit/delete Event gelöst!

Post by jami »

Hallo Felix,

hatte das selbe Problem wie Du.
Du musst erst eine Kategorie erstellen damit man die Events löschen kann.
Also Kategorie erstellen und dann das Event mit entsprechender Kategorie.
Dann kann man die Events erst bearbeiten. Warum das so ist kann ich nicht genau sagen da ich nicht viel Ahnung von php und sql habe, ich denke aber mal das es ein Fehler der Abfrage ist.
Die alten Events must Du manuel in der Datenbank löschen.

Jetzt habe ich auch eine Frage.
Wie kann ich einen Button einbauen damit der Kalender wieder auf den aktuellen Monat springt? Also wo muss welcher Code eingesetzt werden?

Grüße an alle im Forum

jami

DEV_1.2.5 mit cm-mod
meridiaan
Posts: 2
Joined: Wed 8. Dec 2004, 12:06

not working

Post by meridiaan »

Yesterday I installed the Ionrock Calendar Mod following the instructions in the zip file. In the backend I see the Calendar Module link but when I click on it, nothing happens actually.
I am using phpwcms DEV 1.2.5.
I tried also commenting the first line in app-header.php like volkman explained but didnt work again.
Does anybody have an idea?

Image
Blalo
Posts: 4
Joined: Tue 8. Mar 2005, 10:10

Some solutions

Post by Blalo »

Hi there,

I've been struggling with this mod for a couple of days now, but got it working under 1.2.5DEV. There was one thing though: I couldn't edit an event! Adding was no problem, but as soon as I tried to edit an event, I got told that "There are currently no events in the calendar." Which was not true, of course... Now... it appears that if you don't use any categories, you can add events, but you can't edit them. As soon as you add just a single category, then add an event under this category and then click on edit... then it appears on your screen... A small bug, I would say... :wink:

For all of you who get anoying messages like "Warning: strtotime() [function.strtotime]: Called with an empty time parameter." in the backend, when adding (and probably editing) an event: there is a simple way to get rid of these messages, by suppressing error messages for the strtotime()-function. For this, edit your main.functions.php in the inc_lib folder and then add a @ right in front of each strtotime function (lines 79, 87, 95 and 111). In other words: each strtotime becomes @strtotime. It's not an actual solution, but it works for me...

Regards,
Jochem.
User avatar
Kosse
Posts: 1066
Joined: Thu 9. Sep 2004, 12:08
Location: Brussels, Belgium
Contact:

Post by Kosse »

For those who follow this thread...

Here is my calendar.classes.php modified so as you can add/edit events and events set, as well as use " I'm on the Boat " (The quote brought me a Mysql error, so I messed with the file and came up with a solution for me --> don't know if it will work for all of u, let me know).
I also started the day with monday (not sunday, see previous post).

The file is quite big to post here so you can download it @ http://www.piezoworks.be/stuff/calendar_classes.rar

Made several changes to the file, the idea is the same as the one explained in http://www.phpwcms.de/forum/viewtopic.p ... 2&start=45

In addition I edited the func.inc.php from the inc_front in order to use the [ID xx]the name of the article or more info here[/ID] replacement tag and be able to link to a complete article.

I simply added

Code: Select all

//parses complete list of preg_replace definitions
$content["all"]	= preg_replace('/\[ID (\d+)\](.*?)\[\/ID\]/e', 'get_article_idlink($1, "$2", $db);', $content["all"]);
$content["all"]	= str_replace('{SITE}', PHPWCMS_URL, $content["all"]);
$content["all"] = html_parser($content["all"]);
at the end of the file (before the ?> of course) ;)

Cheers
Post Reply