Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Updated to work with Vanilla 2.3

This isn't my work, this is the old calendar plugin from R_J over here: https://open.vanillaforums.com/addon/eventcalendar-plugin

 

I've made it work and fixed a few little issues, I was in need of something like this and couldn't find anything else so I fixed the issues that were stopping this from working and I will likely update it a little further and fix the visual of it.

 

Note that I am not a PHP developer so it can be slow, if you're able to help with it then by all means, please do!

 

FIXES:

  • Fixed event calandar layout links. (they no longer present an error page when you click them)
  • Fixed settings page error, no manual edit should be required

 

TODO:

  • Make numbered links, link to actual event listings somehow.
  • Improve visual style and styling for easy customization.
  • Include an "upcoming events" module.
  • FIX Bug on event creation.

 

Hopefully some of you will find the small fixes useful, I am aware that it has a small bug.

 

Bug: If you create a discussion from the category that you set to your default for the event listings then you will have to change the option and change it back to your default category for it to work. Example: I set my settings to default to an events category and no other categories, if I post a discussion from the event categories and "events" is already selected in the drop down then I will have to change it to something else and back again for it to work. I have no idea why this bug is there but so long as you know about it, it's only a minor inconvenience. I will fix this eventually!

 

Note:
If for some reason you still get an error when you go to the settings then just edit your config manually and place this in there:
$Configuration['Plugins']['EventCalendar']['CategoryIDs'] = array('1', '2');
You shouldn't have to do that though.

 

Kind Regards,
Patrick.

«1

Comments

  • R_JR_J Ex-Fanboy Munich Admin

    Oh man, I'm really sorry! I've done some additional work on that plugin but haven't uploaded it here: https://github.com/R-J/EventCalendar I've increased the version number so I guess I was feeling much better with the GitHub version than with the version here.

    I feel really sorry that you worked your way through code where it eventually might not be needed. If you give feedback as to what is not working in the GitHub version, I'll try to fix it and I will upload it here.

    If you feel like you already invested enough time and you are happy with what you have, I can surely understand that, too.


    By the way: Vanilla doesn't allow to save arrays to the config. That might be a reason for the problem. One workaround is to serialize an array before you save it to the config.

  • @R_J said:
    Oh man, I'm really sorry! I've done some additional work on that plugin but haven't uploaded it here: https://github.com/R-J/EventCalendar I've increased the version number so I guess I was feeling much better with the GitHub version than with the version here.

    I feel really sorry that you worked your way through code where it eventually might not be needed. If you give feedback as to what is not working in the GitHub version, I'll try to fix it and I will upload it here.

    If you feel like you already invested enough time and you are happy with what you have, I can surely understand that, too.

    By the way: Vanilla doesn't allow to save arrays to the config. That might be a reason for the problem. One workaround is to serialize an array before you save it to the config.

     

    It took me a little while to understand and some of it I still don't understand ... I wish I could have found this sooner but don't worry about it.

     

    Thanks for the link, I'll try it out and if I have any ideas will get back to you.

     

    ~ Patrick

  • @R_J said:
    Oh man, I'm really sorry! I've done some additional work on that plugin but haven't uploaded it here: https://github.com/R-J/EventCalendar I've increased the version number so I guess I was feeling much better with the GitHub version than with the version here.

    I feel really sorry that you worked your way through code where it eventually might not be needed. If you give feedback as to what is not working in the GitHub version, I'll try to fix it and I will upload it here.

    If you feel like you already invested enough time and you are happy with what you have, I can surely understand that, too.


    By the way: Vanilla doesn't allow to save arrays to the config. That might be a reason for the problem. One workaround is to serialize an array before you save it to the config.

    Hi, I've downloaded your version from github, but I don't understand how to add an event. I think the problem is that I'm not able to properly select the category in the configuration. I can put a check on the category, and save... but if I come back into the configuration, it's not checked, so my selection isn't saving.

    I'm on version 2.3, and using the EventCalendar from your github

  • @R_J, any help with the Event Calendar from github? I'm not able to get it to work

    thanks.
    Ricardo

  • R_JR_J Ex-Fanboy Munich Admin

    Be patient and give me some time! I will look at it but I'm a little bit short in time right now. Although I've looked at the problem yesterday, I didn't found a quick fix.

    I guess that the main problem is that the category ids cannot be saved to the config as an array any more. But if you now the CategoryIDs where you like to use events you might be able to add the config entry manually like that:
    $Configuration['EventCalendar']['CategoryIDs'] = array('3', '5');

  • Thanks R_J, I apologize for my lack of patience. I'll give that a try and post back.

  • I manually set the config as suggested, and now the category in the configuration screen does show checked.

    However, the problem is that when I click on the event calendar link (url "/eventcalendar") it just spins and nothing happens (page never renders).

    Anyway I know you're super busy, I just wanted to provide feedback and will wait until you have some time available.

    Thanks for your awesome help.

  • R_JR_J Ex-Fanboy Munich Admin

    @rkleemann said:
    However, the problem is that when I click on the event calendar link (url "/eventcalendar") it just spins and nothing happens (page never renders).

    Thanks for the feedback! In fact I have fixed the settings screen and afterwards faced the same problem.

    I found out that somehow the events do not get fetched from the database and there is an infinite loop when you call the events page when there is no event available. I've changed it so that there no is a small and ugly note, telling that there are no events.

    Next thing I would have to check is why getting events from the database fails.

  • I really appreciate your feedback, thanks!

  • Hi just checking in if any updates... =)

  • R_JR_J Ex-Fanboy Munich Admin

    There is a small glitch: when you save your settings it looks as if it wasn't successful. But reloading the screen will prove the contrary.

    But otherwise you should be able to have a working calendar!

  • Thanks R_J! Is it updated in github?

  • Thanks R_J for your update. I'm trying it out now. What I notice is that if I'm in the category for which I've enabled a calendar, and I click to create a new discussion, the Event Date doesn't show up. I have to use the drop-down to switch to another category, then back to the enabled category. That's when I see the Event Date option show up

  • Some additional feedback... it seems there's no way to create a new discussion that doesn't get tagged as a calendar event.

    When I click to start a new discussion in a category that has EventCalendar enabled, it automatically treats the discussion as an event to be added to the calendar.

    Shouldn't there be a checkbox to signal a calendar event?

    Thanks!

  • another observation, when going to /eventcalendar, it shows the current month layout correctly, but is displaying the month name incorrectly in the title (displaying previous month's name)

  • @rkleemann said:
    another observation, when going to /eventcalendar, it shows the current month layout correctly, but is displaying the month name incorrectly in the title (displaying previous month's name)

    This one was actually due to timezone... the code calculates the time value for 00:00:00 of the first day of the month. If the discussion board is in a different timezone then it could translate to the last day of the previous month

  • @rkleemann said:

    @rkleemann said:
    another observation, when going to /eventcalendar, it shows the current month layout correctly, but is displaying the month name incorrectly in the title (displaying previous month's name)

    This one was actually due to timezone... the code calculates the time value for 00:00:00 of the first day of the month. If the discussion board is in a different timezone then it could translate to the last day of the previous month

    I'm ressurecting this thread out of nowhere to see if anyone ever figured out the timezone issue? Why can't the calendar seem to callback the right date. It throws the event on the day before the date it is placed, and the calendar shifts to either the 2nd or 30th date when clicked on. feel free to visit my site and look at the issue thestrangeattractor.xyz/forum
    I too am running into this problem and it's seriously frustrating. What are the fixes for this. Pic is related.

  • I think what goes wrong is that the client and the server timezones do not match.

    If you fill in 30th of August, the server thinks it's their equivalent of the 30th of August (whatever timezone that may be). Then it uses GDN_translate in a discussion to put out a time, but GDN_translate uses javascript + client timezone to translate the server time to client time (which is a day too early).

    I think a potential fix would involve a type=hidden input field in the discussion form named offset, which value is set by javascript to new Date().getTimezoneOffset();

    The server can then use that value to translate the value you put in to the actually correct server equivalent.

    Bad at explaining the exact problem. @R_J you get what I'm trying to say or is it better if I code what I think will fix the problem so you can reverse engineer what the problem was?

  • where would I put the code in for this input field? and what code would you put exactly if you had to?

  • R_JR_J Ex-Fanboy Munich Admin

    @Caylus said:

    Bad at explaining the exact problem. @R_J you get what I'm trying to say

    Yes, I do and it sounds reasonable. I'm not sure though if I can think of any way to solve that problem.

    @Caylus said:

    is it better if I code what I think will fix the problem so you can reverse engineer what the problem was?

    If you have a solution in mind, feel free to create a pull request on the GitHub repo.

    Okay, I need to think about that: The users hour offset and timezone should be enclosed in every controller. So if I accept a date from the user, it should substract/add the users hour offset before saving the date, correct? Let me have a try...

Sign In or Register to comment.