RSS

LuxCal Forum

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

User:   Password:   Remember Me?   
LuxCal Forum / General / Support / Show Category Instead of Title
Posted:  17 Dec 2015 17:39
Hello All,
If updated the calendar for most of the changes I need but I'm stumped with this one.
On the calendar we'd like to show the category instead of the title. Also on the hoover we'd like the category first and the title second.
Is that possible?
Posted:  20 Dec 2015 21:00   Last Edited By: Roel B.
That will mean some code changes.
The full event layout is configurable via the admin's Settings page, Except the event title sad
We thought the title would always be the first thing to show.
I've no time to re-code this. If you are familiar with PHP programming and plan to change this yourself, let me know and I will give you some hints.
Roel
Posted:  13 Jan 2016 16:54
Hi Roel, Just getting back to this after the holidays. I've made some other minor changes in the code but could use some hints on this particular issue. Your help would be greatly appreciated. smile
wnewt
Posted:  14 Jan 2016 20:59   Last Edited By: Roel B.
Ok Wnewt, so you are familiar with PHP programming. Great, let's get started.

Intro
In the files year.php, month.php and dw_functions.php you will find a "showEvents" function; they do as the name suggests, they show the events for a specific date. The array  $evt holds all event fields which have been retrieved from the database for a specific day. Each events starts with the title, which is held in the array entry $evt['tix']; all other fields of the event are generated via the 'makeE()' function, which is part if the common/toolbox.php file. This makeE function produces the event fields as specified on the admin's Settings page. In the makeE() function, the category name is taken from the array entry $evt['cnm'] (cat name).

Hints
I suggest to . . .
1. change in the year.php, month.php and dw_functions.php files all $evt['tix'] vars into $evt['cnm']. Once you've done this, you will already see in year, month, week and day view the title replaced by the category name.
2. in the toolbox.php file change line 132 from . . .
$eArray[] = "{$xx['evt_category']}: {$evt['cnm']}"; break;
to . . .
$eArray[] = $evt['tix']; break;
and change line 154 from . . .
$eArray[] = "<tr><td>{$xx['evt_category']}:</td><td>{$evt['cnm']}</td></tr>"; break;
to . . .
$eArray[] = "<tr><td>{$xx['evt_title']}:</td><td>{$evt['tix']}</td></tr>"; break;

So now you have swapped the event title and the event category in year, month, week and day view in the view itself and in the hoverbox.
Because you've only changed year, month, week and day view, you should do a global search through all files and see where else $evt['tix'] is used and then decide if it has to be replaced by $evt['cnm'] or not.

Note: If you are not using the latest LuxCal version, then in the above text you should replace 'tix' by 'tit.
Hope this helps,
Roel
Posted:  25 Jan 2016 21:01
Thank you very much for the help!!!  Now to figure out how to sort Category. smile
Posted:  25 Jan 2016 21:44
Ah, found the answer on someone else's post. Thanks for the great calendar!!!