Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Upcoming Events Details »»
Upcoming Events
Version: 1.00, by ngcoders ngcoders is offline
Developer Last Online: Sep 2012 Show Printable Version Email this Page

Category: vBulletin CMS Widgets - Version: 4.0.0 Rating:
Released: 12-27-2009 Last Update: Never Installs: 348
Auto-Templates
 
No support by the author.

Upcoming Events

Released 28/12/2009
By Vikas - http://www.ngcoders.com

Installation
  • 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);

$event_get vB::$db->query_read($query);

$output_bits '';
while(
$event vB::$db->fetch_array($event_get)) {

     if(
$event['dateline_to'] == )
     {
         
$format sprintf("On %s",date('jS M Y',$event['dateline_from']));
     } else {
         
$format sprintf("From %s to %s",date('jS M Y',$event['dateline_from']),date('jS M Y',$event['dateline_to']));
     }
     
     
$output_bits .= sprintf('
        <div class = "cms_widget_post_bit"><h4 class="cms_widget_post_header"><a href="calendar.php?do=getinfo&e=%d">%s</a></h4>
            <p class="cms_widget_post_content">%s</p>
        </div>
        '
,$event['eventid'],$event['title'],$format);

}
$output $output_bits;

ob_end_clean(); 

Screenshots

File Type: jpg events.jpg (14.8 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
2 благодарности(ей) от:
level8, Toorak Times

Comments
  #22  
Old 12-29-2009, 04:23 AM
ngcoders ngcoders is offline
 
Join Date: Dec 2009
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

IT works fine for me , maybe it has to do with the Time setting on your server. The DST setting please look into it.
Reply With Quote
  #23  
Old 12-29-2009, 05:00 AM
Conner85 Conner85 is offline
 
Join Date: Jan 2008
Posts: 129
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It shouldn't matter what our DST settings are set to (for my problem anyway). The fact of the matter is, when I post an event for .. lets say.. January 1st, 2010, It displays the time the event was posted, not the date of the event.
Reply With Quote
  #24  
Old 12-29-2009, 06:15 AM
Radek Klein Radek Klein is offline
 
Join Date: Nov 2008
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works perfectly on my site, thank you.
Reply With Quote
  #25  
Old 12-29-2009, 11:21 AM
wacodep wacodep is offline
 
Join Date: Mar 2005
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ngcoders View Post
IT works fine for me , maybe it has to do with the Time setting on your server. The DST setting please look into it.
If it had anything to do with the DST or time setting on the server, then the calendar itself (not just the widget, but the vB calendar) would be displaying the events on the wrong date, too.

But it's not.

FYI: All events are showing up correctly on the calendar *and* the server time and DST is set correctly.
Reply With Quote
  #26  
Old 12-29-2009, 03:35 PM
imagirlgeek imagirlgeek is offline
 
Join Date: Jan 2009
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by wacodep View Post
If it had anything to do with the DST or time setting on the server, then the calendar itself (not just the widget, but the vB calendar) would be displaying the events on the wrong date, too.

But it's not.

FYI: All events are showing up correctly on the calendar *and* the server time and DST is set correctly.
I have the same issue. I have an upcoming event in the calendar scheduled for January 23rd, but on upcoming events it lists January 22nd.
Reply With Quote
  #27  
Old 12-29-2009, 04:07 PM
imagirlgeek imagirlgeek is offline
 
Join Date: Jan 2009
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay, I found something.

If my event is a Single, all day event, it shows up on Upcoming Events a day early.

However, if I change it to a Ranged event (start time and end time), I get an option to change the time zone. It defaults to GMT. I change it to GMT-5 and it displays correctly in Upcoming Events.

I'm not sure why I don't have the option to set a time zone on a Single, all day event. Nor do I understand why vB4 stores it in the database as GMT unless I choose a Ranged event.

Is there anyway to compensate for this?
Reply With Quote
  #28  
Old 12-29-2009, 04:22 PM
ngcoders ngcoders is offline
 
Join Date: Dec 2009
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The GMT setting should have been there in both or should be there in none, only vb4 guys can answer why is it so.
Reply With Quote
  #29  
Old 12-29-2009, 05:56 PM
wacodep wacodep is offline
 
Join Date: Mar 2005
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The problem appears to be a VB bug.

When setting a "Single, All Day Event", vBulletin still sets a start and end datetime, but the END datetime is being set for the DAY BEFORE the event's start datetime. No idea why it is doing this, but it appears to be a bug.
Reply With Quote
  #30  
Old 12-29-2009, 06:02 PM
wacodep wacodep is offline
 
Join Date: Mar 2005
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The single day and ranged events seem OK, but the way this widget displays the start and end datetimes for a recurring event is confusing.

If you have an recurring event that occurs once a week for 2 years, it looks like this in the widget:

Event Name X
From 2nd Jan 2010 to 2nd Jan 2012


This makes it look like the event is ranged event, taking place for two years solid, every day.

Recurring events should show up not as a range, but as a single event for each day they occur, such as:

Event Name X
On 2nd Jan 2010

Event Name X
On 9th Jan 2010

Event Name X
On 16th Jan 2010
Reply With Quote
  #31  
Old 12-29-2009, 06:45 PM
NickyNet NickyNet is offline
 
Join Date: Oct 2001
Location: Vienna, .at
Posts: 101
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nice mod! thank you for that!

but just one more info:
recurring events which are setup before "today", will not be shown.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:46 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04834 seconds
  • Memory Usage 2,345KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (2)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete