LuxCal Forum

The place for questions, suggestions and news about the LuxCal Event Calendar

User:   Password:   Remember Me?   
LuxCal Forum / General / Support / custom event - additional Category fields
Posted:  05 Dec 2011 14:30   Last Edited By: Roel B.
I want to add some additional Category fields, Category 2, Category 3 and Category 4 to an Event.  Between Venue and Description I would like 4 different Category drop downs instead only 1 as there is now.  What would I need to change to do this?  I can see I would need to change eventform2.php for the display of the Add Event window. Looks like the events table would also need to be changed to add the additional category columns.
What else would need to be changed?
Posted:  05 Dec 2011 18:11   Last Edited By: Roel B.
Hi Erik,
There are lots of things to change; not too complicated, but on many different places.
I would suggest to start with the changes required to input the 4 event cats:
- MySQL database: add 3 more event cats to the events table    (as you said in your post)
- retrieve.php     (the function which retrieves data from the database - the hart of the system)
- event.php    (gets event data - via retrieve - for eventform2 and validates and saves new/edited event data in the database)
- eventform2.php    (the form used to display/enter/edit event data)
and thereafter change the files which are using the event cats for display purposes:
- here I suggest to use a text crawler, e.g. TextCrawler from Digital Volcano (excellent freeware), and search all calendar files for cid (category id), and maybe another few keywords to find the places where the category id is used.

If it helps, I can send you a description of the database tables. If you want this, send me your email address (via the Contact Us page).
Posted:  05 Dec 2011 22:06
Not only am I adding Category fields, but I am also removing several fields for instance Venue, Description, and Send Mail from the Add Event Window.  Will that affect the display of events? 

I have modified eventform2 and event and am able store information in tables.  I created a separate table to store the additional category fields.  I wanted to alter the existing code the least.  I am able to store new event information in the database, but the new events are not displayed in the calendar.  I am not seeing any error messages.  Would you have any ideas why the events are no longer displaying?
Posted:  05 Dec 2011 22:18   Last Edited By: Roel B.
it seems

while ($row = mysql_fetch_assoc($rSet)) 

returns no results in my modified retrieve.php even though there are events in the database.

I think I see a problem.  category_id becomes set to 0 for the events I modified.  Whereas it seems category_id should never be set to 0.
I fixed it by manually setting cid, since I delete Category from the Add Event window and it's not getting set, causing it to default to 0 and then no events will be returned in retrieve and so no events will be displayed in the calendar.
Posted:  21 Jan 2012 00:22
Erik, if your changes were successful could you possible PLEASE give us 9the community) a petty good overview of the process you used to add fields to the events and category type structures... I know a few that are struggling with this (including me)
Posted:  21 Jan 2012 02:37
and what is <?php catMenu($cid); ?> in evenform2?
Posted:  21 Jan 2012 12:45
<?php catMenu($cid); ?> is calling the function catMenu() defined at the top of the script event.php.
This function produces the options (the categories that can be selected) in the select statement in eventform2.php. (this is the drop-down list from which the user can select an event category)
The argument $cid is the currently active cat id.
Posted:  24 Jan 2012 02:54
almost realised a new field but i`m afraid of the new versions that will damage my work