RSS

LuxCal Forum

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

User:   Password:   Remember Me?   
LuxCal Forum / General / Support / Show user in hover box
Posted:  19 Apr 2013 10:24
Morning!

I have enabled the user to be shown in views on the settings panel, and this shows who added/edited the event on upcoming & changes views.

Is it easily possible to also show this in the hover box of an event, which would be a lot more helpful to my lot wink

In fact I only would like to show who added the event, it does not matter if it has been edited or not.

Another option would be to add a new data field to show the organiser, but don't really want to go to those lengths (even if i could biggrin )

Thanks in advance

John
Posted:  20 Apr 2013 10:23
I should have said that I did have a look around and found this in the installation guide:-

showAdEd: Specifies whether the date/user added/edited of an event should be shown in the hoverbox in the various views, in the Upcoming Events view, in the Changes view and in email notification messages.

There are a number of instances of showAdEd in settings.php, but I am very reluctant to play around making changes on a functioning system without knowing what I am really doing... sad

John
Posted:  20 Apr 2013 21:39   Last Edited By: Roel B.
Hi John,
A couple of LuxCal versions ago several users opted for removing this data from the hoverbox and to always show this data in the event window. Furthermore, on the admin's Settings page the display of the date added/edited and the user who added/edited the event can be enabled for the following pages: Upcoming Events, Changes, Text Search, RSS feeds and email reminders.
So, we're  afraid we will have to disappoint you. This info has been removed from the hoverbox; if enabled by the admin, it is however shown on the pages listed above.
(With some PHP skills this can be easily added again to the hoverbox. If you want to know how let me know.)
Roel
Posted:  22 Apr 2013 11:07
Thanks Roel,

Yes I would like to give it a try if you don't mind giving me a pointer into how to put this into the hover box cool

Kind regards - John
Posted:  22 Apr 2013 17:29   Last Edited By: Roel B.
Hi John,

Add the following line of code in the file 'views/month.php' just before or after line 44 (depending on where you want this to be displayed):
  if ($set['showAdEd']) { $popText .= '<br>'.$xx['vws_added'].': '.IDtoDD($evt['ada']).' ('.$evt['una'].')'; }

Piece of cake, isn't it?

On the admin's Settings page, under views, 'Show date event added/edited' should be set to 'yes'.
Regards,
Roel
Posted:  23 Apr 2013 13:42
Works perfectly!

You are definitely on my Christmas card list biggrin

Kind regards - John
Posted:  23 Apr 2013 17:55   Last Edited By: Roel B.
Great John, I'm looking forward to get your Christmas card!
Roel
Posted:  05 Jun 2013 08:18
I applied the above solution for displaying the user in hover text and it is working for me too. Thank for this!
But now here's another one: is it possible to show the posting hour of an event too?

Thanks!
Posted:  05 Jun 2013 09:51
I'm sorry, but I will have to disappoint you here. The posting hour is not stored in the database.
The posting date or the last-edited date would be possible with a minor program change.
Roel
Posted:  05 Jun 2013 11:00
As a matter of fact I made a few changes... the the database, in the table events I changed 'a_date' field to DATETIME from DATE. When adding events this should make the database to store the posting time too, right?
And then in file month.php I changed the line:
if ($set['showAdEd']) { $popText .= '<br>'.$xx['vws_added'].': '.IDtoDD($evt['ada']).' ('.$evt['una'].')'; }

to

if ($set['showAdEd']) { $popText .= '<br>'.$xx['vws_added'].': '.IDtoDD($evt['ada']). " hour: " . date ('H:i', $evt['ada']) . ' ('.$evt['una'].')'; }

I tried this but I get the same hour for any event I add, I guess I have to change something into the data inserting part too. Maybe I'll add one more field  into the event table, especially for the time data.
Posted:  05 Jun 2013 21:39   Last Edited By: Roel B.
Hi there,

"this should make the database to store the posting time too, right?" No. not right! The format in the db is right, but then you should also
1. store the date and the time in this field when adding (and editing) events. In file pages/events.php on line 377 (and maybe line 384)
2. in the file common/retrieve.php retrieve the date and the time and store it for instance in $evt['adt']
3. use the value $evt['adt'] in views/month.php (rather than the value $evt['ada'])

Programming ain't always easy, it's an art wink
Roel
Posted:  06 Jun 2013 13:30   Last Edited By: futurebreeze
I know it is an art, but beyond art it is hard to understand somebody's else code :).
You say the format of "a_date"  field is right for storing time too. I'd say it is not, as far as I know the DATE type can store the date only (DATETIME would be the right one for my purposes). Anyway, I think I can't use a_date to store date and time because further the data of this field is formatted in date style later in PHP code with IDtoDD function.
I tried to add another field (for instance "a_time") but just adding the field into the "events" table made the Lux Cal inoperable, I think the script checks the fields before executing anything. As I said, it is hard to understand somebody's code smile.
Posted:  06 Jun 2013 21:28
I didn't say the format of "a_date"  field is right for storing time too. But you said in your one but last post that you changed the 'a_date' field to DATETIME. I just followed up on this and meant that if you change this field to DATETIME, you should also store the time in it and retrieve the time from it.
It's good that you mention the IDtoDD (ISO Date to Display Date) function, because if you change the format of the a_date field, its content cannot be formatted by IDtoDD anymore.
After having given it a second thought, I think it's probably easier to add another field a_time and use the function ITtoDT (ISO Time to Display Time) to format this time correctly for display.
The fact that adding this field to the events table made the calendar inoperable is because in the pages/event.php script on line 368 (for example) a new event is inserted in the db by specifying all fields in the SQL query. So here you should add in the correct sequence the time.
You should do the same on line 384 of the event.php script and on line 244 of the pages/importCSV.php script and on line 450 of the pages/importICS.php script.
Once you've done all that, you have the new field a_time available in the db with the "time added".
Now you have to take care that the field a_time is retrieved from the database and stored in $evt['a_time'] for further use. This should be done in the common/retrieve.php script. And then of course change the scripts where you want to use this time.

I fully agree it's hard to understand the code of somebody else wink
Roel