• Welcome to Simple Machines Community Forum. Please login or sign up.

[SOLVED][CALENDAR] Data from two tables

Started by n-joy, October 01, 2012, 04:45:34 PM

Previous topic - Next topic

n-joy

October 01, 2012, 04:45:34 PM Last Edit: October 02, 2012, 07:10:46 PM by n-joy
Hi there, I'm facing the following problem:

-I have two tables with events.
->One contains the regular, standard events such as birthdays and holidays.: id_event, start_date, end_date, title, ...
->The other one contains a list with summer camps: id_camp, start_date, end_date, title ...

I want them both to show up at the calendar.

Is there any (easy) way to achieve this? Basic data, such as start and end date are in the same format. I just need to join those tables somehow. However, I don't want to put the summer camps into the standard event list. I need them seperated.

Any help would be appreciated! Thanks in advance.  :)


Kindred

short answer... NO. There is no easy way to do this.

You would have to write your own code -- and re-write the calendar code, fairly significantly, I would think...
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.<br /><br />"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

n-joy

Quote from: Kindred on October 02, 2012, 04:12:31 PM
short answer... NO. There is no easy way to do this.

You would have to write your own code -- and re-write the calendar code, fairly significantly, I would think...

Thanks for your reply. :)
I found a workaround for my problem. I will mark this thread as solved.

Kindred

I am glad you found a solution. Care to share in case anyone else needs to do something similar?
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.<br /><br />"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

n-joy

It's not a perfect solution, but it does the job.
I added another column in the smf_event table, indicating the type of an event with an integer.
Then I modified Subs_Calendar.php and made the system do a check for that integer before extracting the data it needs.
The integer refers to the table we want to extract data from. :)

Advertisement: