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);
Since DST started, though, I've noticed that sometimes events display as an hour later than they should, and sometimes they're fine. By default there's an 'ignore DTS' checkbox that is checked when creating a calendar event, but that doesn't really seem to affect what's displaying on the sidebar widget.
I'm not remotely a coder, but basically I can't figure out the interaction between the calendar's automatic DST stuff and the user profiles and this widget. Any suggestions?