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
  #92  
Old 03-09-2010, 02:11 PM
unfv unfv is offline
 
Join Date: Apr 2008
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by S1OPP View Post
Installed and working great.

Q: Is there a simple way to get it to include upcoming birthdays?
yeah please, can someone help us with this?

Thanks
Reply With Quote
  #93  
Old 03-11-2010, 05:12 AM
Guust Guust is offline
 
Join Date: Mar 2010
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi
Firstly, I love the widget and so far it (kind of) works.

The small problem I have is that it does not seem to adjust for my Default Time Zone Offset, which is GMT + 10. So the homepage says an event is on the 10th and the calendar says it is on the 11th depending on the time of day you visit the site.

Check it out here:
http://www.2cv.com.au/content.php
and here
http://www.2cv.com.au/calendar.php?do=getinfo&e=1

Any fixes anybody ?

UPDATE: The answer is in this post: https://vborg.vbsupport.ru/showpost....8&postcount=33
I just replaced the code provided by NGCoders with the code provided by NicForce and all is good!
Reply With Quote
  #94  
Old 03-11-2010, 08:04 AM
Chrissy_Ratbag Chrissy_Ratbag is offline
 
Join Date: Dec 2009
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I get the following parsing error

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/rat10541/public_html/forum2010/includes/class_core.php(4033) : eval()'d code on line 14

Can anyone help?
Reply With Quote
  #95  
Old 03-14-2010, 06:04 PM
Blue91's Avatar
Blue91 Blue91 is offline
 
Join Date: Apr 2002
Posts: 117
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Guust View Post

UPDATE: The answer is in this post: https://vborg.vbsupport.ru/showpost....8&postcount=33
I just replaced the code provided by NGCoders with the code provided by NicForce and all is good!
Same here. NicForce's code worked for me. Thanks to both coders.
Reply With Quote
  #96  
Old 03-26-2010, 08:11 PM
SimplyJoe SimplyJoe is offline
 
Join Date: Feb 2010
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm using a hybrid of NicForce's code (formatted to provide the date format that I want), but I noticed that if you are not logged on, the dates are 24 hours ahead (so a July 3rd event will show on July 4), but if you log on, the dates are correct.

here is my code, but I still can figure this out. I don't see anything that tells me to be logged in or not.

ob_start();

// %d
$show_count = 15;

$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)) {
$tz_offset = 86400;
if($event['dateline_to'] == 0 )
{
$format = sprintf("On %s", vbdate(VB::$vbulletin->options['dateformat'],$event['dateline_from']+$tz_offset));
} else {
$format = sprintf("From %s to %s", vbdate(VB::$vbulletin->options['dateformat'],$event['dateline_from']), vbdate(VB::$vbulletin->options['dateformat'],$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();


Thanks in advance.
Reply With Quote
  #97  
Old 03-26-2010, 10:45 PM
Guust Guust is offline
 
Join Date: Mar 2010
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by SimplyJoe View Post
I'm using a hybrid of NicForce's code
Not that I really understand anything of this, but the major difference between the original code and NicForce's is that the code adds +1 to the date from and the date to. It seems you do not make a time adjustment like that, if I look over your code (not that I understand the coding).
I set it at +1 although my GMT = +10. Maybe the +1 refers to a date (a day) and not an hour.
I also found that when you use an event which covers more than one day, you might have to be creative with the begin and end dates.
Reply With Quote
  #98  
Old 03-27-2010, 01:13 AM
SimplyJoe SimplyJoe is offline
 
Join Date: Feb 2010
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You are correct, I do not use the plus one, because that was giving me the reverse effect.
Reply With Quote
  #99  
Old 03-30-2010, 05:19 PM
karlm's Avatar
karlm karlm is offline
 
Join Date: Jul 2006
Location: England
Posts: 447
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Seems to be working for me, thank you!
Reply With Quote
  #100  
Old 04-02-2010, 08:09 AM
Peter Lo Peter Lo is offline
 
Join Date: Feb 2007
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I tried this widget using the default code at Post #1. Setting an event say from 2 April 2010 to 4 April 2010; when 2 April comes (ie today) the whole event no longer appears.

Shouldn't it only disappear after 4th april?
Reply With Quote
  #101  
Old 04-02-2010, 12:46 PM
Guust Guust is offline
 
Join Date: Mar 2010
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Peter Lo View Post
I tried this widget using the default code at Post #1. Setting an event say from 2 April 2010 to 4 April 2010; when 2 April comes (ie today) the whole event no longer appears.

Shouldn't it only disappear after 4th april?
Use https://vborg.vbsupport.ru/showpost....8&postcount=33 instead
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:52 PM.


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,342KB
  • 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
  • (4)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