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
  #192  
Old 12-30-2010, 03:01 PM
level8 level8 is offline
 
Join Date: Sep 2008
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

please help with one more bit of info

by default it list the NAME/DATE... I have a custom field (a website link) to fill in when people add an event. I can get a third line to display (below code) but what to I do to make the info in this field appear in the link?

code I have used is:
Quote:
<p class="cms_widget_post_content" style="font-size:9px; margin-bottom:5px"><a href="#">homepage</a></p>
</div>
What would I need to change the # to to make the info in my customfieldid=2 appear???

any help appreciated.
Reply With Quote
  #193  
Old 01-30-2011, 12:24 PM
Mark4865's Avatar
Mark4865 Mark4865 is offline
 
Join Date: Sep 2010
Location: South-Africa
Posts: 289
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there a way to get the event to still show on the day it is taking place and only go away the day after
Reply With Quote
  #194  
Old 01-30-2011, 02:10 PM
JimboSlice JimboSlice is offline
 
Join Date: Jan 2011
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mse2k View Post
This is my code. It shows all upcomming events and the events on the actually day. But it shows not only 2 how in $show_count, it shows all. Can you help me. THX
I have looked at cant find the cause, if someone else can help that would be great.
Reply With Quote
  #195  
Old 02-11-2011, 05:00 PM
JimboSlice JimboSlice is offline
 
Join Date: Jan 2011
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can someone fix mse2k code so it doesnt show all events?
Reply With Quote
  #196  
Old 02-16-2011, 11:17 AM
JimboSlice JimboSlice is offline
 
Join Date: Jan 2011
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

does anyone have one of these that works correctly with vb 4.1.x?
Reply With Quote
  #197  
Old 02-16-2011, 04:17 PM
ngcoders ngcoders is offline
 
Join Date: Dec 2009
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by JimboSlice View Post
does anyone have one of these that works correctly with vb 4.1.x?
Yep it works fine.
Reply With Quote
  #198  
Old 02-16-2011, 05:18 PM
JimboSlice JimboSlice is offline
 
Join Date: Jan 2011
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

the dates are always a day off, or doesnt show todays events, only future.
Reply With Quote
  #199  
Old 02-23-2011, 09:43 AM
alexm's Avatar
alexm alexm is offline
 
Join Date: Apr 2005
Location: United Kingdom
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by JimboSlice View Post
doesnt show todays events, only future.
Quote:
Originally Posted by Mark4865 View Post
Is there a way to get the event to still show on the day it is taking place and only go away the day after
I think there is an error in the SQL query. It needs greater than or equal and less than or equal operators to include the current day, and the part for ranged events the operators were the wrong way round.

Try replacing the query with this:

Code:
$query = sprintf("SELECT * FROM ".TABLE_PREFIX."event WHERE visible = 1 AND (dateline_from >= '%1\$d' || (  dateline_from <= '%1\$d' AND dateline_to >= '%1\$d' ) || (dateline_to = 0 AND DATE(FROM_UNIXTIME(dateline_from)) = DATE(FROM_UNIXTIME(%1\$d)))) ORDER BY dateline_from ASC LIMIT %2\$d",TIMENOW,$show_count);
This should display all day events before and on the day they are happening, and ranged events before and WHILE they are happening.

Alex
Reply With Quote
  #200  
Old 02-24-2011, 06:57 AM
ash50210 ash50210 is offline
 
Join Date: Feb 2011
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

HI all,

after spend time reading all thread from pg 1 until 14 finally i was successfully made it happen. Thanks to all that contribute the idea here. so i would like to share the coding as per below:

----------------------------------------------------------------------------------------------------------------------

ob_start();

// %d
$show_count = 100;

$query = sprintf("SELECT * FROM ".TABLE_PREFIX."event WHERE visible = 1 AND (dateline_from >= '%1\$d' || ( dateline_from <= '%1\$d' AND dateline_to >= '%1\$d' ) || (dateline_to = 0 AND DATE(FROM_UNIXTIME(dateline_from)) = DATE(FROM_UNIXTIME(%1\$d)))) ORDER BY dateline_from ASC LIMIT %2\$d",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("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();
return $output;
---------------------------------------------------------------------------------------------------------------------
This code suppose can show u all range of events.
cheers!
Reply With Quote
  #201  
Old 02-24-2011, 11:51 AM
JimboSlice JimboSlice is offline
 
Join Date: Jan 2011
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

the dates are all wrong when its displayed on my page. In fact, tomorrows events show as happening today and the date listed is todays date, instead of tomorrows.
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 05:19 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.05877 seconds
  • Memory Usage 2,355KB
  • 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_code
  • (1)bbcode_php
  • (5)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
  • (2)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