MyBB Community Forums

Full Version: Calendar on portal
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
How do I add the calendar on the portal?
I think you'd need a plugin (which doesn't exist) or some PHP code and the PHP in Templates plugin.
There is a calendar on portal plugin but it uses a LOT of queries - I think it is for 1.4 - on mybb central.
This would be incredibly easy if we could use :

{$mini_calendars}

On the portal page. That would sort out the whole problem instantly. But i dont think there is an easy way to obtain that thing and get it to display in the portal. The only real other way is write your own PHP code from the ground up look at how MyBB makes its calendar.

Line 2023 of calendar.php down i think:

// Showing a calendar

Remove all the template relate stuff from it. And revert it back to purely a query scrip that echo's its results in a table format. And with the php in templates plugin php include this were you wish.
well, I had a look in the pro_portal code (that has a minicalendar) - I got a very dodgy plugin to load - added 9 queries. Sad
(2012-06-11, 02:36 AM)Leefish Wrote: [ -> ]well, I had a look in the pro_portal code (that has a minicalendar) - I got a very dodgy plugin to load - added 9 queries. Sad

Its not really dodgy coding i think, the calendar how small it be, needs to load in the birthdays all the events the weeks/ days etc. all from queries to different databases. For example birthdays is from users and events from events.

I didnt look at it myself but i think the calendar (especially the week few) has a lot of queries. Compared to just a normal thread. And if this is not the case. Then i hope in 1.8 they let us use the variable {$mini_calendars} or a replacement for the portal for it. Would be really useful to have so.
I did not mean the pro_portal coding was dodgy - I meant my plugin was Big Grin

I will try and work on it, but if I can't get that count down I will abandon it as I would never slap 9 queries on a landing page without a really good reason.
(2012-06-11, 01:16 PM)Leefish Wrote: [ -> ]I did not mean the pro_portal coding was dodgy - I meant my plugin was Big Grin

I will try and work on it, but if I can't get that count down I will abandon it as I would never slap 9 queries on a landing page without a really good reason.

You probably could get it down by just removing things like the birthday query from the calendar. Meaning those would no longer apear on the calendar.
They already are not on the calendar. There are things like upcoming events and the calendar permissions though.
Can you share your block Lee?

OP: Try this http://mods.mybb.com/view/upcoming-events
Pages: 1 2 3