vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   vBulletin CMS Widgets - Upcoming Events (https://vborg.vbsupport.ru/showthread.php?t=231365)

ngcoders 12-27-2009 10:00 PM

Upcoming Events
 
1 Attachment(s)
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(); 


RickyG 12-28-2009 12:09 AM

Where is this pulling from?

steven s 12-28-2009 12:30 AM

Nice start but it's pulling events from 2005. :)

Conner85 12-28-2009 01:25 AM

I posted a test event for Dec. 28th, 2009 and on the widget it posts the date you posted the event on, not the actual event date.

Example: I posted an event for Dec. 28th, 2009 just now (which is the 27th), and in the widget it says Dec. 27th, 2009.

Is there any way for it to show the real date of the event?

MattZ DSLR 12-28-2009 01:50 AM

Great future mod
showing events from last year
do you have a fix for it?

ngcoders 12-28-2009 03:44 AM

Should be fixed now

TheSupportForum 12-28-2009 05:17 AM

Quote:

Originally Posted by ngcoders (Post 1940005)
Should be fixed now

any chance of getting this to work in forum blocks as well

this widget doesnt work correctly for CMS due to it only showing date and not event name

Conner85 12-28-2009 06:30 AM

I'm still getting the date the event was posted, not the date of the event.

Zweeper 12-28-2009 07:07 AM

nice!!

astrid1 12-28-2009 08:22 AM

Where do I set the events are a general?


All times are GMT. The time now is 09:40 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01661 seconds
  • Memory Usage 1,745KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete