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 think that some coders already know the answer, but do not show us how?
a friend of mine has been added to my code (or the entire code) =
PHP Code:
ob_start();
$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);
Set your GMT time, standard for me + 1 (change it) and it should work.
if a coder could take the data from the + or - GMT time and replacing the code in my (+ 1)then it should work. but what I was thinking. is that the data is taken from a wrong place.
@ragtek - If all this was documented somewhere so that i could have referenced , Sadly there is none. Also i wrote it for personal use and it server my purpose.
@ragtek - If all this was documented somewhere so that i could have referenced , Sadly there is none. Also i wrote it for personal use and it server my purpose.
Yea, i know what you mean.
If i code something for me, i also don't code it "the vB way" (for example i don't creat options,.don't use the permissionsystem,etc..) but if i want to release it here, i have to make it userfriendly.
but is there a possibility to change the language of the Datetime Format??
Diplayed is: From 8th Jan 2010 to 8th Jan 2010
I want to have: Am 08.01.2010 von 08:00Uhr bis 20:00Uhr
or: Am 08. Jan. 2010 von 08:00 bis 20:00 Uhr
I use a german board, so i like to have the german dateformat!
I hope someone can help...?
Just found the answer by myself:
Quote:
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);
if($event['dateline_to'] == 0 )
{
$format = sprintf("Am %s",date('d. M. Y H:i',$event['dateline_from']));
} else {
$format = sprintf("Am %s bis %s",date('d. M. Y H:i',$event['dateline_from']),date('d. M. Y H:i',$event['dateline_to']));
}
but is there a possibility to change the language of the Datetime Format??
Diplayed is: From 8th Jan 2010 to 8th Jan 2010
I want to have: Am 08.01.2010 von 08:00Uhr bis 20:00Uhr
or: Am 08. Jan. 2010 von 08:00 bis 20:00 Uhr
I use a german board, so i like to have the german dateformat!
I hope someone can help...?
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);