Goto Admincp->vBullietin CMS->Widgets->Create New Widget
Choose PHP Direct Execution as Widget's Type
Place a Title. eg Upcoming Events. Keep it short as this is what will appear as title on your pages.
Click Save
Click Configure on the right of the new created widget.
Remove the default code that appears. Be sure to not leave behind even a single letter.
Copy and Paste the code that you can find below.
Leave the template name as is (vbcms_widget_execphp_page)
Click Save
Goto Admincp->vBullietin CMS->Layout Manager
Click Go on the Default Layout
Add the Widget to your Layout
Click Save
That's all !!
PHP Code
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);
I hear you on the Calendar. It's really pitiful. I voted for your Jira. I also entered in a Jira a long time ago, would everyone vote for that one as well?
$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);
and replace it with:
Code:
$query = sprintf("SELECT * FROM ".TABLE_PREFIX."event WHERE visible = 1 AND (dateline_from > '%1\$d' || ( dateline_from > '%1\$d' AND dateline_to < '%1\$d' ) || (dateline_to = 0 AND DATE(FROM_UNIXTIME(dateline_from)) = DATE(FROM_UNIXTIME(%1\$d)))) ORDER BY dateline_from ASC LIMIT %2\$d",TIMENOW,$show_count);
HTH,
Christian Stadler
Thank you this fixed my issues. Been combing through this thread post by post and this is what fixed it for me.
Stupid question but I run 3 different event calendars, so if I create 3 different upcoming event widgets with 3 diffrent titles, how do I make each widget only check the right calendar for events??
Stupid question but I run 3 different event calendars, so if I create 3 different upcoming event widgets with 3 diffrent titles, how do I make each widget only check the right calendar for events??
Actually not a stupid question. There's a lot of requests about enhancing the Calendar, as it currently provides very little in the way of configuration, features, etc.
You'll need to submit an enhancement request to get any changes to the calendar (or other products). I'd suggest doing that on vb.com, not here. There are at least two outstanding extensive calendar enhancement request in the Tracker. I submitted this one:
I'd recommend adding your requirement to either/both (via comments) and be sure to 'vote' for each. The more peoiple vote the more likely it'll get assigned to a developer!
thanks for quick response Kurt, does this current widget in this post allow me to run 3 calendars with 3 different titled widgets and if so how do I get the correct one to know which calendar to take events off.??
thanks for quick response Kurt, does this current widget in this post allow me to run 3 calendars with 3 different titled widgets and if so how do I get the correct one to know which calendar to take events off.??
Well, if you read the detail of the Jira items, there isnt anything in there for support for multiple calendars. I would like that too, and I would strongly recommend you add your comments and suggestions directly to the Jira on vb.com rather than posting here.
This is my code. It shows all upcomming events and the events on the actually day. But it shows not only 2 how in $show_count, it shows all. Can you help me. THX
Quote:
ob_start();
// %d
$show_count = 2;
$query = sprintf("SELECT * FROM ".TABLE_PREFIX."event
WHERE visible = 1
AND (dateline_from >= '%d' || dateline_to >= '%d' )
ORDER BY dateline_from ASC LIMIT %d",TIMENOW,TIMENOW,TIMENOW,$show_count);
How can I manage repeated events?
i.e. I want to display "each tuesday" for a repeated meeting
I set an if about recurring and then I should pick the recuroption............ but how can I treat something like "1|4"?
Unfortunately the mod doesnt do that. There has been several items added to the bug Tracker on vb.com that are related to your problem. I strongly encourage everyone to vote for BOTH items as many sites require more sophisticated Calendar support.