Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons

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
  #32  
Old 12-31-2009, 07:35 PM
gruftiradio gruftiradio is offline
 
Join Date: Dec 2009
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can the Widget show the Time of Event, not the date?
Reply With Quote
  #33  
Old 01-01-2010, 12:34 PM
S1OPP S1OPP is offline
 
Join Date: Jun 2005
Posts: 25
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed and working great.

Q: Is there a simple way to get it to include upcoming birthdays?
Reply With Quote
  #34  
Old 01-01-2010, 10:00 PM
NiCForce NiCForce is offline
 
Join Date: Dec 2009
Location: belgie
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

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

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

     if(
$event['dateline_to'] == 
     { 
$datefrom date('j',$event['dateline_from']); 
$datefrom $datefrom+1;
         
$format sprintf("On ".$datefrom."th %s",date('M Y',$event['dateline_from'])); 
     } else { 
$datefrom date('j',$event['dateline_from']); 
$datefrom $datefrom 1;
$dateto date('j',$event['dateline_to']); 
$dateto $dateto 1;
         
$format sprintf("From ".$datefrom."th %s to ".$dateto."th %s",date('M Y',$event['dateline_from']),date('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(); 
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.
Reply With Quote
  #35  
Old 01-03-2010, 02:28 PM
ragtek ragtek is offline
 
Join Date: Mar 2006
Location: austria, croatia
Posts: 1,630
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You should use the eventcache instead of selecting the events from the database!

Also you don't take care of the showupcoming Option and the calendarpermissions....
Also you should use the vbulletin dateformat instead of hardcoding
Reply With Quote
  #36  
Old 01-05-2010, 01:27 AM
ngcoders ngcoders is offline
 
Join Date: Dec 2009
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@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.
Reply With Quote
  #37  
Old 01-05-2010, 06:58 AM
ragtek ragtek is offline
 
Join Date: Mar 2006
Location: austria, croatia
Posts: 1,630
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ngcoders View Post
@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 because youre users can change the time zone, you should take care of this


For timeformating you can use the vbdate function: http://members.vbulletin.com/api/vBu...functionvbdate

hope that helps
Reply With Quote
  #38  
Old 01-05-2010, 05:36 PM
ngcoders ngcoders is offline
 
Join Date: Dec 2009
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks ill keep that in mind , When more vb4 details are available will update accordingly.
Reply With Quote
  #39  
Old 01-06-2010, 04:50 PM
oechertigger oechertigger is offline
 
Join Date: Dec 2009
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great App! THX

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

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

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

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']));
}

$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();
Reply With Quote
  #40  
Old 01-06-2010, 05:40 PM
Bitti Bitti is offline
 
Join Date: Oct 2006
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Great App! THX

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

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

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

if(
$event['dateline_to'] == )
{
$format sprintf("Am %s"vbdate(VB::$vbulletin->options['dateformat'],$event['dateline_from']));
} else {
$format sprintf("Vom %s bis %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(); 
Reply With Quote
  #41  
Old 01-06-2010, 06:17 PM
nealohara's Avatar
nealohara nealohara is offline
 
Join Date: Aug 2002
Location: Dublin, Ireland
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice. Is there a way of refining this a little?

Let's say we've got a room booked on Thursday the 7th January between 20:00 and 21:00 and we add it to the default calendar. Currently what we get is

Event
7th Jan 2010 to 7th Jan 2010


ideally I'd like it to display as follows:

Event
7th Jan 2010 between 20:00 and 21:00


The dates and times are all stored as variables but I don't want to screw it up

Any ideas?
Reply With Quote
Reply

Thread Tools

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:53 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.04562 seconds
  • Memory Usage 2,377KB
  • 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
  • (3)bbcode_php
  • (3)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