MyBB Community Forums

Full Version: MyBB calendar limited to 4yrs with 'jump' and 6yrs with 'month>>' ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
.
When try to 'jump' to month, the years do not go beyond 2018, ie 4yrs out ?
When use 'month>>' buttons, will only get to Jan 2020.
How to change 'jump' and/or extent of calendar 'month>> button, to maybe 50yrs out ?
In one particular case, need to set reminder date (even though the 'Calendar' will not send a reminder Sad ) for 12/16/2020.
Couldnt find any posts with MyBB forums 'search', but may have missed something ?
Thoughts on how/where, if possible, to change code, etc ?
Look for this line in calendar.php

// Construct option list for years
	for($i = my_date('Y'); $i < (my_date('Y') + 5); ++$i)
	

Change 5 to a higher number. It will go that many years in advance - 1. Note that this code appears multiple times in the file so you may want to use search & replace if you can.
.
Thank you for the direction.
Seemed to work fine after dbl checked all locations of...
(my_date('Y') + 5)
...and changed to...
Quote:(my_date('Y') + 50)
But, even though the 'jump' showed the additional years, when clicked on 2020 (then 'Go'), the calendar didnt change to that year, it stayed on 2014.
Thoughts ?
Locate this line in calendar.php

// Incoming year?
	if($mybb->input['year'] && $mybb->input['year'] <= my_date("Y")+5)

Change 5 to a higher value. It is in the file a couple times. What I did to quickly find that was a search for if($mybb->input['year']
.
Thanks much, that did it, found a couple more lines of code with that tip !
With that said, when went to the calendar to post a reminder (to renew a non-profit domain registration), in 2020 on 12/16, it came back with...
Confused
Quote:Please correct the following errors before continuing:
Events can only be created in the next 5 years. Please select a reasonable start year from the list.
...and of course the list showed thru 2063.
Dbl checked calendar.php and the only other 5s could find were '5_years' repeat things.
Similar results with template calendar_addevent.
Thoughts ?

(2014-07-31, 09:34 AM)dragonexpert Wrote: [ -> ]Locate this line in calendar.php
// Incoming year?
	if($mybb->input['year'] && $mybb->input['year'] <= my_date("Y")+5 
Change 5 to a higher value. It is in the file a couple times. What I did to quickly find that was a search for if($mybb->input['year']
Open /inc/datahandlers/event.php.

Find:
if($event['start_date']['year'] > date("Y") + 5)
And Also find this:
if($event['end_date']['year'] > date("Y") + 5)

Change the 5 to a higher number. Hopefully that solves the issue.
Think that did it !!!
Shy
As a followup...
Trying to determine how to get from calendar.php to event.php, ie for php 'training' Blush
Looking at calendar.php...
require_once "./global.php";
require_once MYBB_ROOT."inc/functions_calendar.php";
require_once MYBB_ROOT."inc/functions_post.php";
require_once MYBB_ROOT."inc/class_parser.php";
...couldnt find any ref to event.php.
Also took a look at the above files and couldnt find any event.php ref.
Where should I be looking ?

(2014-08-01, 01:56 PM)dragonexpert Wrote: [ -> ]Open /inc/datahandlers/event.php.
Find:
if($event['start_date']['year'] > date("Y") + 5)
And Also find this:
if($event['end_date']['year'] > date("Y") + 5)
Change the 5 to a higher number. Hopefully that solves the issue.
.
Always follow code from the top. It is about 5% of the way down in calendar.php.
.
Got it !
// Set up event handler.
	require_once MYBB_ROOT."inc/datahandler.php";
	require_once MYBB_ROOT."inc/datahandlers/event.php";
Thanks much !
Class dismissed Wink
Take care !

(2014-08-01, 05:57 PM)dragonexpert Wrote: [ -> ]Always follow code from the top. It is about 5% of the way down in calendar.php.