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.
User avatar
StudioZ
Posts: 802
Joined: Fri 28. May 2004, 19:57
Location: Québec, Canada
Contact:

Post by StudioZ »

Hal, have you added this line to your config.inc.php file?:

Code: Select all

$phpwcms["calendar_mod"]      = 1;
Image
PhpWCMS Evangelist, -- iRoutier.com Running phpWCMS 1.4.2, r354 -> Great Version!!!!
hal
Posts: 66
Joined: Mon 9. Feb 2004, 22:07

Post by hal »

news.

I created the tables manually now, but still in the admin area nothing happens if I click the calendar mod button - no calendar appears.

Any ideas???

I can provide a login to my cms install if necessary to have a look.
User avatar
StudioZ
Posts: 802
Joined: Fri 28. May 2004, 19:57
Location: Québec, Canada
Contact:

Post by StudioZ »

My PHP knowledge is limited at this moment (and for a while... I guess. I am too old now :wink:), but if anyone is willing to help out IronRock get the Calendar running in Localization mode, I am willing to output the French localization (language file) for it :wink:

Cheers,
Last edited by StudioZ on Thu 18. Nov 2004, 20:32, edited 1 time in total.
Image
PhpWCMS Evangelist, -- iRoutier.com Running phpWCMS 1.4.2, r354 -> Great Version!!!!
User avatar
StudioZ
Posts: 802
Joined: Fri 28. May 2004, 19:57
Location: Québec, Canada
Contact:

Post by StudioZ »

Please check your PM Hal ;)
Image
PhpWCMS Evangelist, -- iRoutier.com Running phpWCMS 1.4.2, r354 -> Great Version!!!!
trip
Posts: 657
Joined: Tue 17. Feb 2004, 09:56
Location: Cape Town, South Africa
Contact:

Post by trip »

Hi
is it possible to click on an event name and only have this event displayed?

TriP
jimbOO
Posts: 35
Joined: Tue 31. Aug 2004, 23:09

Post by jimbOO »

trip wrote:Hi
is it possible to click on an event name and only have this event displayed?
great question TRIP!!!!
i'm also interested in that option!
:lol:

ionrock, it's your turn!
:wink:
screem of the butterfly
kac
Posts: 29
Joined: Tue 16. Mar 2004, 21:04

Post by kac »

Hal, did you manage to get your problem fixed? I'm having the same issues trying to install the calendar. Let me know how you fixed it.

Thanks,

Ken
ionrock
Posts: 279
Joined: Fri 20. Feb 2004, 17:04

Post by ionrock »

In order to display just that events it is not very hard to add. It would probably be a pretty easy task for someone who is not well versed in php but I am not able to make updates to the code now. I have too much work to do at the moment. With that said, if someone wants to make the change and start the localization stuff, please feel free. If I have time I will make an effort but b/w classes, music/touring, and research I am just too swamped.

Sorry for not having more time. If someone does want to "maintain" the code and needs some help just let me know where you are having problems and we will sort them out.
Kvist
Posts: 87
Joined: Sat 30. Oct 2004, 04:19
Location: Denmark
Contact:

A little help needed!

Post by Kvist »

I have been fighting an unfair battle to install the calendar mod, but it just doesn't seem to work. It appears in the mod section of my admin, but when I push the link, it just shows me the credits of Jerome's GT mod. Nothing happens. Here is what I did:

1. First I added _ to the ends of the prefixes in mod_calendar/inc_lib/main.config.php.

2. Then I opened the phpwcms.php file and added

Code: Select all

// CALENDAR MODULE...
	
	// you take this line and add it to your /include/inc_conf/conf.inc.php file
	$phpwcms["calendar_mod"] = 1; // enable calendar mod = 1, disable = 0
	
	if ($phpwcms["calendar_mod"]) { // enabled/disable Calendar Module
		$subnav .= subnavtext("Calendar Module", "phpwcms.php?do=modules&p=300", $p, "300", 0);
	}
right after

Code: Select all

case "modules":		//modules
	$wcsnav["modules"] = "".$wcsnav["modules"]."";
	if($phpwcms["gt_mod"]) { //enabled/disable GT MOD
		$subnav .= subnavtext($BL['be_subnav_graphicaltext_mod'], "phpwcms.php?do=modules&p=2", $p, "2", 0);
	}
BEFORE the break; part.

3. After that I added

Code: Select all

case 300: // Caledar Mod 
	if ($phpwcms["calendar_mod"]) { //enabled/disable calendar mod
		include_once("./include/inc_module/mod_calendar/main.inc.php");
	}
break;
right after

Code: Select all

case 2:	 // Graphical Text MOD
									 if($phpwcms["gt_mod"]) { //enabled/disable GT MOD
									 	include_once("./include/inc_module/mod_graphical_text/main.inc.php");
									 }
									 break;
							default: echo 'Thanks to J&eacute;r&ocirc;me for his <a href="phpwcms.php?do=modules&p=2">Graphical Text MOD</a>.';
									 echo '<br>&nbsp;<br>Other modules might follow. GT MOD will be moved to admin section.';
						}
break;
4. Then I uploaded the mod_calendar library and files to /include/inc_module/ and tried to activate the module from my admin.

If I try to call the install.php file manually, it shows me the following:
Warning: main(PHPWCMS_ROOT/include/inc_module/mod_calendar/inc_lib/main.config.php): failed to open stream: No such file or directory in /customers/kvistnet.dk/kvistnet.dk/httpd.www/include/inc_module/mod_calendar/install/config.php on line 2

Warning: main(): Failed opening 'PHPWCMS_ROOT/include/inc_module/mod_calendar/inc_lib/main.config.php' for inclusion (include_path='.:/usr/lib/php') in /customers/kvistnet.dk/kvistnet.dk/httpd.www/include/inc_module/mod_calendar/install/config.php on line 2

Calendar Module Administration Area

Welcome to the calendar module. You can add/edit/delete items on the calendar as well as add categories to different events.

To install the mod make sure you have read the readme for the changes that needed to be made to the base. Once that is done you can click the button below to setup the database.
"BUTTON"
And when I press the button to install the script it gives me the following errors:
Warning: main(PHPWCMS_ROOT/include/inc_module/mod_calendar/inc_lib/main.config.php): failed to open stream: No such file or directory in /customers/kvistnet.dk/kvistnet.dk/httpd.www/include/inc_module/mod_calendar/install/config.php on line 2

Warning: main(): Failed opening 'PHPWCMS_ROOT/include/inc_module/mod_calendar/inc_lib/main.config.php' for inclusion (include_path='.:/usr/lib/php') in /customers/kvistnet.dk/kvistnet.dk/httpd.www/include/inc_module/mod_calendar/install/config.php on line 2

Warning: mysql_query(): Access denied for user: 'kvistnet.dk@localhost' (Using password: NO) in /customers/kvistnet.dk/kvistnet.dk/httpd.www/include/inc_module/mod_calendar/install/install.php on line 6

Warning: mysql_query(): A link to the server could not be established in /customers/kvistnet.dk/kvistnet.dk/httpd.www/include/inc_module/mod_calendar/install/install.php on line 6
Error creating the events table: Access denied for user: 'kvistnet.dk@localhost' (Using password: NO)
--------------------------------------------------------------------------------
CREATE TABLE `` ( `id` int(11) NOT NULL auto_increment, `date` date NOT NULL default '0000-00-00', `span` int(11) NOT NULL default '1', `time` varchar(100) NOT NULL default '', `title` varchar(150) NOT NULL default '', `category` int(11) NOT NULL default '0', `price` varchar(60) NOT NULL default '', `location` varchar(100) NOT NULL default '', `description` text NOT NULL, `extrainfo` text NOT NULL, `approved` tinyint(1) NOT NULL default '0', `setid` int(11) NOT NULL default '0', `userId` int(11) NOT NULL default '0', PRIMARY KEY (`id`), KEY `id` (`id`) )
kvistnet.dk@localhost isn't my username for my DB - where can I change this information? I was under the impression that the calendar mod got its information from phpWCMS, but that's apparently not the case...!?

Now my question is - what did I do wrong? Why won't it work?

Any help would be greatly appreciated!

PS: I'm running the latest phpWCMS with all patches installed.

/Kvist
http://www.kvistnet.dk
hal
Posts: 66
Joined: Mon 9. Feb 2004, 22:07

Post by hal »

@ Kvist

This is pretty much the same history as I have.

I was able to eliminate the error messages depending in line 2 of install/config.php by specifying the path. In my case it looks like this:

include ("../inc_lib/main.config.php");

This makes the 1st 3 error messages disappear.

After that I get a similar thing as you except that in my case not the username seems to be the problem but the database name and/ or path. The error message line is:

Error creating the events table: No Database Selected

Underneath this I get the same text as yours.

Seems to be the same problem that the mod is uable to retrieve information from conf.inc.php - but why???? Other users seem not to have our problems :(

@ kac

No, i haven't. :cry: :cry:

@ StudioZ

thanks for you help. I had all the files compared with mine using winmerge and they were identical - so I used the same. But unfortunately it didn't work.

So I'm lost now and I guess I will not be able to use the calendar - espacially as I'm lacking the skills and the time to solve this problem by myself.

Probably for a php/mySQL capable person this might be not a big deal - for me at least it is.
ionrock
Posts: 279
Joined: Fri 20. Feb 2004, 17:04

Post by ionrock »

One thing I noticed is that you put the variable that is supposed to go in the conf.inc.php file directly in the phpwcms.php file. While it does make some sense, there is a good chance that the script never actually reaches the point where that variable is added. This could cause some problems. What I mean is you could run into some scope issues. I don't know if that is the case for sure but I would imagine it could be. If you can, email me a copy of your files and I can take a look. This goes out to anyone else having trouble.
hal
Posts: 66
Joined: Mon 9. Feb 2004, 22:07

Post by hal »

I have now a solution for my case. A friend of mine who is capable of php programming redid some entries and now it works. Below I post the relevant code:

1. The database info was included in mod_calendar/install/install.php

Code: Select all

<?php
include ("../inc_lib/main.config.php");

// open the connection to MySQL database
$phpwcms["db_host"]           = "localhost";
$phpwcms["db_user"]           = "your_username";
$phpwcms["db_pass"]           = "your_password";
$phpwcms["db_table"]          = "your_database_name";


$db = mysql_connect($phpwcms["db_host"], $phpwcms["db_user"], $phpwcms["db_pass"]);

mysql_select_db($phpwcms["db_table"],$db);

//from here it was identical with the original file

2. The entries in phpwcms.php have been set as follows (for orientation I also included the surroundings, like a block above and/ or a line below etc., although they have not been changed):


a) Entry starting around line 70:

Code: Select all

	case "files":		//files
						$wcsnav["files"] = "<strong class=\"navtexta\">".$wcsnav["files"]."</strong>";
						$subnav .= subnavtext($BL['be_subnav_file_center'], "phpwcms.php?do=files", $p, "", 0);
						$subnav .= subnavtext($BL['be_subnav_file_ftptakeover'], "phpwcms.php?do=files&p=8", $p, "8", 0);
						break;
	
	case "modules":		//modules
						$wcsnav["modules"] = "<strong class=\"navtexta\">".$wcsnav["modules"]."</strong>";
						if($phpwcms["gt_mod"]) { //enabled/disable GT MOD
							$subnav .= subnavtext($BL['be_subnav_graphicaltext_mod'], "phpwcms.php?do=modules&p=2", $p, "2", 0);
						}
						
						// CALENDAR MODULE...
	
						// you take this line and add it to your /include/inc_conf/conf.inc.php file
						//$phpwcms["calendar_mod"] = 1; // enable calendar mod = 1, disable = 0
	
						if ($phpwcms["calendar_mod"]) { // enabled/disable Calendar Module
						$subnav .= subnavtext("Calendar", "phpwcms.php?do=modules&p=3", $p, "3", 0);
						}		
						break;
						
	case "messages":	//messages
b) Entry starting around line 350

Code: Select all

("./include/inc_tmpl/message.subscribersimport.tmpl.php");
									break;
						}
						break;
		
		case "modules":	//Modules
						switch ($p) {
							case 2:	 // Graphical Text MOD
									 if($phpwcms["gt_mod"]) { //enabled/disable GT MOD
									 	include_once("./include/inc_module/mod_graphical_text/main.inc.php");
										}
										 break;
							case 3: // Caledar Mod 
									if ($phpwcms["calendar_mod"]) { //enabled/disable calendar mod
									include_once("./include/inc_module/mod_calendar/main.inc.php");
									}		 
									 break;
									 
							default: echo 'Thanks to J&eacute;r&ocirc;me for his <a href="phpwcms.php?do=modules&p=2"		>Graphical Text MOD</a>.';
									 echo '<br>&nbsp;<br>Other modules might follow. GT MOD will be moved to admin section.';
						
						break;
		
							
						}
						break;

		
		
		
		
		case "admin":	//Administration
@ ionrock:

in mod_calendar/app-header.php there is a line

Code: Select all

require_once "Mail.php"; // PEAR mail class
and we were not sure what this might be for as there is no mail.php in phpwcms or the mod. So we set the // in front (sorry - don't know the english term/word for that). Could you please explain. Thanks.
ionrock
Posts: 279
Joined: Fri 20. Feb 2004, 17:04

Post by ionrock »

Yeah, originally the mod included a system for vendors. Each vendor had their own profile that they could add special events to along with a request that the even show up on the main calendar of the site. They also had scheduling info in the calendar but that didn't work as well so I had to change it ;)

Mail.php is part of PEAR. It is just an email module that allows for some more flexibility than other solutions. I used it to send mail to all the vendors. You don't need it but if you ever look into doing large applications in php, PEAR has some good modules.
Kvist
Posts: 87
Joined: Sat 30. Oct 2004, 04:19
Location: Denmark
Contact:

Oh

Post by Kvist »

Thanks for sharing Hal!

Only thing is; I have no idea how to put your suggestions into use. How did you do it and is your calendar working properly now?

If you have an extra few minutes one of the next days, then could you please describe to me how you got it to work - step by step?

If I had much knowledge of PHP it would be easy to figure out, but sadly that's not the case - yet.

Maybe an event calender will be included in the next release, rendering the installation of this mod futile. I am SO looking forward to the next release and it looks as if it'll be released around x-mas... YAY!

/Kvist
hal
Posts: 66
Joined: Mon 9. Feb 2004, 22:07

Post by hal »

@ Kvist
Actually my description overwrites parts of ionrocks installation instructions.

I could try to change them accordingly but I am afraid a bit it might confuse the users of the board if there are two different installation instructions circling around - also I don't want to "correct" ionrocks work in any ways - it was just because it didn't work for me - thats all.

I sent you a pm with the changed instruction. Hope it will help.
Post Reply