Version: 1.10, by ProFifaLeagues
Developer Last Online: Nov 2023
Category: vBulletin Forum Sideblocks -
Version: 4.0.0
Rating:
Released: 11-05-2010
Last Update: Never
Installs: 96
Re-useable Code Translations
No support by the author.
Upcoming Events in Forum Block/Sidebar
Add the "Upcoming Events" in the forum side block
(Added as a few people seem to have issues with other mods the same)
Start by logging into your Admin cp
Goto Forums and moderators - Forum Blocks Manager and add a new Block.
Call the Block Upcoming Events(Or what ever suits your liking)
Set the block to Active
And use PhP Format.
Now add the content below :
PHP Code:
ob_start();
// %d $show_count = 5;
$query = sprintf("SELECT * FROM ".TABLE_PREFIX."event WHERE visible = 1 AND (dateline_from > '%d' || ( dateline_from < '%d' AND dateline_to > '%d' )) ORDER BY dateline_from ASC LIMIT %d",TIMENOW,TIMENOW,TIMENOW,$show_count);
Then just make sure the template to use is set to Block_HTML
This will then show the latest upcoming event from your calendar with multi-day events shown until the last day of the event.
Update Thanks to dcuellar
What this does is add a picture centered above the upcoming event. The picture is uploaded to 'images/' as event.jpg. You can change that to whatever you want. It also corrects the issue I had with the date. It's now projecting the proper date.
NOTE:
I changed the number of events to display to 1.
I do not need the range on my forum so I did not test that part.
Here you go for those interested (change what's in Red):
PHP Code:
ob_start();
// %d $show_count = 1;
$query = sprintf("SELECT * FROM ".TABLE_PREFIX."event WHERE visible = 1 AND (dateline_from > '%d' || ( dateline_from > '%d' AND dateline_to > '%d' )) ORDER BY dateline_from ASC LIMIT %d",TIMENOW,TIMENOW,TIMENOW,$show_count);
Thanks go to cybaGirl for this fix:
Anyone who has the date showing as the day before can use this code in there forum block.
PHP Code:
ob_start();
// %d $show_count = 5;
$query = sprintf("SELECT * FROM ".TABLE_PREFIX."event WHERE visible = 1 AND (dateline_from > '%d' || ( dateline_from < '%d' AND dateline_to > '%d' )) ORDER BY dateline_from ASC LIMIT %d",TIMENOW,TIMENOW,TIMENOW,$show_count);
instalkled this but have a coupe of questions - my dates are 1 day too early - even if I try the alternate code its still showing wrong (I prefer the layout on the first code anyway) is there a way to adjust this?
Second thing is there a way to make it pull dates from a single calendar? At the moment it also pulls from a private calendar
In regards dates are 1 day too early - if any changes are made to the events or calendar: Once the changes are complete: See if saving the widget block again - this may fix it.
I changed
HTML Code:
$format = sprintf("From %s to %s",date('jS M
Layout : I perfer not to have the word
Quote:
From
to
HTML Code:
$format = sprintf(" %s to %s",date('jS M
Sorry! I have not played/seen with the layout on the first code.
I can't get this to work. If I load the code with the images... the dates are correct. when loading the code without images (which is what I want)... it is a day to early. This is worthless if the dates aren't correct.
Anybody have this working without images where the dates are correct? If so... can you please post your code?
Second thing is there a way to make it pull dates from a single calendar? At the moment it also pulls from a private calendar
Yes, I would also like to be able to pull events from a single calendar if possible. I have looked at the code but can't identify anything that looks like a calendar id