Tourcalendar V1

I saw this at a point and couldn’t remember whose code it was so I developed it from the ground up for Delta Virtual with links to new and previous months. I see I’ve used the same base code you did.

http://virtualdelta…ndex.php/events

I’ll see to submit a pull request and update it with the links

Sava, I would be very interested in the code for the buttons that allow the next or previous month. Would you be able to share that with me?

Oh hey, I see you released that custom module to the public. Was a bit tough trying to code those events to show up in the right date

People wanted it when they heard what it does, so instead of keeping it to myself I let others have it too

I know the last post in this thread was 2013 but I would like to know if anyone got the previous and next month tabs working?

Thanks!

Sava did you share any were the code for the next month buttons my friend

Hello everyone, as you can put the buttons or links up / down to display the previous or next month? thanks for any response ..

best regards

I have been unable to get any events to display other than those of the current month. When viewing months other than the current month, the current month’s events displayed - same current month’s events no matter what month I selected. After finding a blog by a gentleman named David Walsh (possible original code for the php calendar) and doing a bit of reading of the comments there, I was able to get all events to show in their correct month.

I am not a PHP coder. I only edited one existing file in Strider’s original package. There may be a more efficient way to achieve the same outcome I was able to attain.

There are just a few minor changes/additions to the code in “TourCalendar.tpl”. The attached fie contains my edited file. Of course, the calendar display is specific to my site and the format may not match yours - this includes everything between the <style> </style> tags near the top of the file - so don’t change that in your file if your calendar display already fits well with your site.

Changes which corrected my issue from above are between " /* keep going with days… */" and " /** QUERY THE DATABASE …"

[TourCalendar.zip](< base_url >/applications/core/interface/file/attachment.php?id=1562)

Ok so is anyone else getting the calling static error now days? I know this is old news but I have been away from coding for some time and I am out of touch. How did everyone fix this issue?

Notice : Undefined index: month in /home/xxxxxx/public_html/xxxxxxx/core/templates/TourCalendar.php on line 24

Notice : Undefined index: year in /home/xxxxxxx/public_html/xxxxxx/core/templates/TourCalendar.php on line 25

Strict Standards : Non-static method EventsData::get_upcoming_events_dates() should not be called statically in /home/xxxxx/public_html/xxxxxx/core/templates/TourCalendar.php on line 83

**EDIT**

I fixed the lines 24 and 25 error by using a

$month = (int) (!empty($_GET['month']) ? $_GET['month'] : date('m'));
$year = (int) (!empty($_GET['year']) ? $_GET['year'] : date('Y'));

instead of the supplied

$month = (int) ($_GET['month'] ? $_GET['month'] : date('m'));
$year = (int) ($_GET['year'] ? $_GET['year'] : date('Y'));

I still have the static error going on

**EDIT**

All fixed

Try this version

https://github.com/web541/Tcal

It’s just going into the data class and changing public function to public static function

EDIT: Now that I look at your post now, not sure where you got the supplied date line from.

I think I used a very old version. None the less, I now got the static thing fixed as well as the date ordeal. Took me a minute to figure it out. :slight_smile:

I’ll go grab that one from Git to make sure I got an up to date version.

Thanks!

Try this version

https://github.com/web541/Tcal

It’s just going into the data class and changing public function to public static function

EDIT: Now that I look at your post now, not sure where you got the supplied date line from.

I believe the date lines come from the tpl file that someone uploaded on the last page to show previous month and next month as well as current month.

I believe the date lines come from the tpl file that someone uploaded on the last page to show previous month and next month as well as current month.

Interesting, I got the one from ProAvia (which is the one I think you were talking about) and the date lines only showed the date(‘m’), etc. and not the lines above.

Anyway, glad you got it sorted!

1 Like

Sorry to revive an old thread but I am experiencing the same issues as above and was wondering if there was any fix? I change the “public function” to public static function after getting;

 

Strict Standards: Non-static method EventsData::get\_upcoming\_events\_dates() should not be called statically in

 

But then get the following error:

 

Fatal error: Using $this when not in object context in

Using SimPilot’s 5.5.2, php version 5.4.

16 minutes ago, skyguyt said:

Sorry to revive an old thread but I am experiencing the same issues as above and was wondering if there was any fix? I change the “public function” to public static function after getting;

 

Strict Standards: Non-static method EventsData::get_upcoming_events_dates() should not be called statically in

 

But then get the following error:

 

Fatal error: Using $this when not in object context in

Using SimPilot’s 5.5.2, php version 5.4.

Well, fixed all errors. I had been using the old EventsData class file, uploaded the new one, changed all of the “public function” to “public static function” values, and it all shows correctly! Now the only thing left is figuring out why it somehow is not connected to the database anymore. Admin module won’t push anything to the database after this change and even though there is something in the database from before I fixed the first reported error, it does not show on the website. 

 

The search continues lol. 

18 minutes ago, skyguyt said:

Well, fixed all errors. I had been using the old EventsData class file, uploaded the new one, changed all of the “public function” to “public static function” values, and it all shows correctly! Now the only thing left is figuring out why it somehow is not connected to the database anymore. Admin module won’t push anything to the database after this change and even though there is something in the database from before I fixed the first reported error, it does not show on the website. 

 

The search continues lol. 

FIXED!

 

The EventsData.class.php needed the added 

".TABLE\_PREFIX."

added before each of the db calls. Utilize all other fixes in this thread and then also add the change and you should be golden. 

 

Too much coding, not enough coffee. Hopefully this helps others!