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);
This is the code with the hz line, items you will need to change: which calendar, how many events, and location of the hz line image; the date format used is: m/d/Y if you'd rather dashes just change the '/'s to '-'s; if you'd rather d/m/Y then switch it to that display instead in both locations.
$query = sprintf(" SELECT * FROM ".TABLE_PREFIX."event WHERE visible = 1 AND calendarid='".$calendarid."' AND (dateline_from >= '$mydate' || (dateline_from >= '$mydate' AND dateline_to <= '$mydate' ) || ('$mydate' BETWEEN dateline_from AND dateline_to)) ORDER BY dateline_from ASC LIMIT $show_count");
This is the code with the hz line, items you will need to change: which calendar, how many events, and location of the hz line image; the date format used is: m/d/Y if you'd rather dashes just change the '/'s to '-'s; if you'd rather d/m/Y then switch it to that display instead in both locations.
Attached is a hz line image you can feel free to use:
thanks for this will get it changed ASAP... wonder if you coudl help with 2 other things, tried to do it myself but just crashes
1. How do I add a link/button at the bottom of the widget called somethign like "Add an Event" which simply will link to the http://****.com/calender.php?
thanks for this will get it changed ASAP... wonder if you coudl help with 2 other things, tried to do it myself but just crashes
1. How do I add a link/button at the bottom of the widget called somethign like "Add an Event" which simply will link to the http://****.com/calender.php?
2. Add a small icon image next to all events ( ).
Any help is much appreciated
Superb Idea that and one i would love to know how to implement too:up:
$query = sprintf(" SELECT * FROM ".TABLE_PREFIX."event WHERE visible = 1 AND calendarid='".$calendarid."' AND (dateline_from >= '$mydate' || (dateline_from >= '$mydate' AND dateline_to <= '$mydate' ) || ('$mydate' BETWEEN dateline_from AND dateline_to)) ORDER BY dateline_from ASC LIMIT $show_count");
you'll need to put your calendar id # in and the # of events to show, as well as the addy/location of where you have the hz-line.png and the light-color-calendar.gif located in your files. I've attached the hz-line.png and the light-color-calendar.gif (Thanks for the gif level8 )
I'm still trying to get a clickable 'button'/image for the bottom for 'add new event' but, so far I've only been able to add that to each and every event listed (which seems a bit redundant to me); I'll continue to play with the code when I can to see if I can get it to display a single 'button'/image after the list of events. No promises
Tr@de.. I know you can add custom fields to the event and Ive seen people import this on the events list (i.e. webpage link) for external events.. however finding anyone to help with the code has been difficult
This is if you want an external link added (as well as a new calendar icon that is not a link itself... perhaps a bit more 'pleasing to the eye' to some (I also edited out the 'On' preceeding the date because it bugged me )
$query = sprintf(" SELECT * FROM ".TABLE_PREFIX."event WHERE visible = 1 AND calendarid='".$calendarid."' AND (dateline_from >= '$mydate' || (dateline_from >= '$mydate' AND dateline_to <= '$mydate' ) || ('$mydate' BETWEEN dateline_from AND dateline_to)) ORDER BY dateline_from ASC LIMIT $show_count");
Also attaching new calendar image and a 'shorter' hz-line image as the previous one was too wide to display correctly in the widget when on certain size sidebars/columns
if anyone can help all we are working on now is getting the "external link" to be a custom field path... so you will keep the word "External link" however this will link to whatever the web path has been listed in the custom field.... any help appreciated