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
  #282  
Old 04-24-2012, 08:14 PM
Eq4bits Eq4bits is offline
 
Join Date: May 2006
Posts: 468
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is the code with the hz line, items you will need to change: which calendar, how many events, and location of the hz line image; the date format used is: m/d/Y if you'd rather dashes just change the '/'s to '-'s; if you'd rather d/m/Y then switch it to that display instead in both locations.
PHP Code:
ob_start(); 
global 
$db,$vbulletin;


$mydate =  mktime(000date("m"), date("d")-1date("Y"));
$calendarid="1";
$show_count =6

$query sprintf("    SELECT * FROM ".TABLE_PREFIX."event 
                    WHERE visible = 1 
                    AND calendarid='"
.$calendarid."' 
                                        AND (dateline_from >= '
$mydate' || (dateline_from >= '$mydate' AND dateline_to <= '$mydate' ) || ('$mydate' BETWEEN dateline_from AND dateline_to)) 
                    ORDER BY dateline_from ASC LIMIT 
$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",vbdate('m/d/Y',$event['dateline_from'],false,true,false,true)); 
     } else { 
         
$format sprintf("From %s to %s",vbdate('m/d/Y',$event['dateline_from'],false,true,false,true),vbdate('m.d',$event['dateline_to'],false,true,false,true)); 
     } 
      
     
$output_bits .= sprintf(
        <div class = "cms_widget_post_bit"><img src="images/****/hz-line.png"><br><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(); 
Attached is a hz line image you can feel free to use:
Attached Images
File Type: png hz-line.png (161 Bytes, 34 views)
Reply With Quote
Благодарность от:
Elenna
  #283  
Old 04-25-2012, 09:01 AM
level8 level8 is offline
 
Join Date: Sep 2008
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Eq4bits View Post
This is the code with the hz line, items you will need to change: which calendar, how many events, and location of the hz line image; the date format used is: m/d/Y if you'd rather dashes just change the '/'s to '-'s; if you'd rather d/m/Y then switch it to that display instead in both locations.
Attached is a hz line image you can feel free to use:
thanks for this will get it changed ASAP... wonder if you coudl help with 2 other things, tried to do it myself but just crashes


1. How do I add a link/button at the bottom of the widget called somethign like "Add an Event" which simply will link to the http://****.com/calender.php?

2. Add a small icon image next to all events ( ).

Any help is much appreciated
Reply With Quote
  #284  
Old 04-25-2012, 09:12 AM
ProFifaLeagues's Avatar
ProFifaLeagues ProFifaLeagues is offline
 
Join Date: Aug 2009
Location: Uk
Posts: 1,191
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by level8 View Post
thanks for this will get it changed ASAP... wonder if you coudl help with 2 other things, tried to do it myself but just crashes


1. How do I add a link/button at the bottom of the widget called somethign like "Add an Event" which simply will link to the http://****.com/calender.php?

2. Add a small icon image next to all events ( ).

Any help is much appreciated

Superb Idea that and one i would love to know how to implement too:up:
Reply With Quote
  #285  
Old 04-27-2012, 03:13 AM
Eq4bits Eq4bits is offline
 
Join Date: May 2006
Posts: 468
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

here is code for adding a small icon in front of each event listed:

to have it as a clickable link to the listed event use
PHP Code:
ob_start();
global 
$db,$vbulletin;

$mydate =  mktime(000date("m"), date("d")-1date("Y"));
$calendarid="1";
$show_count =6;

$query sprintf("    SELECT * FROM ".TABLE_PREFIX."event
                    WHERE visible = 1
                    AND calendarid='"
.$calendarid."'
                                        AND (dateline_from >= '
$mydate' || (dateline_from >= '$mydate' AND dateline_to <= '$mydate' ) || ('$mydate' BETWEEN dateline_from AND dateline_to))
                    ORDER BY dateline_from ASC LIMIT 
$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",vbdate('m/d/Y',$event['dateline_from'],false,true,false,true));
     } else {
         
$format sprintf("From %s to %s",vbdate('m/d/Y',$event['dateline_from'],false,true,false,true),vbdate('m/d/Y',$event['dateline_to'],false,true,false,true));
     }
      
     
$output_bits .= sprintf('
        <div class = "cms_widget_post_bit"><h4 class="cms_widget_post_header"><a href="calendar.php?do=getinfo&e=%d"><img src="images/*****/light-color-calendar.gif"
style="border: 0px solid; border: 0px solid; width: 16px; height: 16px;">%s</a></h4>
            <p class="cms_widget_post_content">%s</p><img src="images/*****/hz-line.png" align="top">
         </div>
        '
,$event['eventid'],$event['title'],$format);

}

$output $output_bits;

ob_end_clean(); 
you'll need to put your calendar id # in and the # of events to show, as well as the addy/location of where you have the hz-line.png and the light-color-calendar.gif located in your files. I've attached the hz-line.png and the light-color-calendar.gif (Thanks for the gif level8 )



I'm still trying to get a clickable 'button'/image for the bottom for 'add new event' but, so far I've only been able to add that to each and every event listed (which seems a bit redundant to me); I'll continue to play with the code when I can to see if I can get it to display a single 'button'/image after the list of events. No promises
Attached Images
File Type: png hz-line.png (159 Bytes, 0 views)
Reply With Quote
Благодарность от:
ProFifaLeagues
  #286  
Old 04-27-2012, 05:43 AM
Tri@de's Avatar
Tri@de Tri@de is offline
 
Join Date: Sep 2003
Posts: 168
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There's a way to put an external link (got inside the event) instead of a link to the calendar event?
Reply With Quote
  #287  
Old 04-27-2012, 06:31 AM
level8 level8 is offline
 
Join Date: Sep 2008
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

BIG THANKS TO Eq4bits amazing work

Tr@de.. I know you can add custom fields to the event and Ive seen people import this on the events list (i.e. webpage link) for external events.. however finding anyone to help with the code has been difficult
Reply With Quote
  #288  
Old 04-28-2012, 01:09 PM
Eq4bits Eq4bits is offline
 
Join Date: May 2006
Posts: 468
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is if you want an external link added (as well as a new calendar icon that is not a link itself... perhaps a bit more 'pleasing to the eye' to some (I also edited out the 'On' preceeding the date because it bugged me )



PHP Code:
ob_start(); 
global 
$db,$vbulletin;


$mydate =  mktime(000date("m"), date("d")-1date("Y"));
$calendarid="1";
$show_count =6

$query sprintf("    SELECT * FROM ".TABLE_PREFIX."event 
                    WHERE visible = 1 
                    AND calendarid='"
.$calendarid."' 
                                        AND (dateline_from >= '
$mydate' || (dateline_from >= '$mydate' AND dateline_to <= '$mydate' ) || ('$mydate' BETWEEN dateline_from AND dateline_to)) 
                    ORDER BY dateline_from ASC LIMIT 
$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("%s",vbdate('m/d/Y',$event['dateline_from'],false,true,false,true)); 
     } else { 
         
$format sprintf("From %s to %s",vbdate('m.d',$event['dateline_from'],false,true,false,true),vbdate('m.d',$event['dateline_to'],false,true,false,true)); 
     } 
      
     
$output_bits .= sprintf(
<div class="cms_widget_post_bit">
<h4 class="cms_widget_post_header">
<table>
<tbody>
<tr>
<td><img src="images/*****/cal.png" align:"center"=""
v-align:"middle"="">&nbsp;&nbsp;</td>
<td><a href="calendar.php?do=getinfo&amp;e=%d">%s</a><br>
<small><small><a href="http://*********">External Link</a></small></small>
<p class="cms_widget_post_content">%s</p>
</td>
</tr>
<tr align="center">
<td colspan="2" style="vertical-align: top;">
<h4 class="cms_widget_post_header"><img alt="line"
src="images/*****/hz-line.png" align="middle"></h4>
</td>
</tr>
</tbody>
</table>
</h4>
</div>
'
,$event['eventid'],$event['title'],$format); }

$output $output_bits

ob_end_clean(); 
Also attaching new calendar image and a 'shorter' hz-line image as the previous one was too wide to display correctly in the widget when on certain size sidebars/columns
Attached Images
File Type: png hz-line.png (159 Bytes, 0 views)
Reply With Quote
  #289  
Old 04-28-2012, 01:28 PM
mrt12345's Avatar
mrt12345 mrt12345 is offline
 
Join Date: Feb 2009
Posts: 93
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks , but can you tell me the image path where to upload the new icons. Thanks:up:
Reply With Quote
  #290  
Old 04-28-2012, 01:37 PM
mrt12345's Avatar
mrt12345 mrt12345 is offline
 
Join Date: Feb 2009
Posts: 93
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok thanks i figured it out, nice job, just fill in all the ********
Reply With Quote
  #291  
Old 04-29-2012, 07:26 AM
level8 level8 is offline
 
Join Date: Sep 2008
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

if anyone can help all we are working on now is getting the "external link" to be a custom field path... so you will keep the word "External link" however this will link to whatever the web path has been listed in the custom field.... any help appreciated
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 10:17 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.06302 seconds
  • Memory Usage 2,427KB
  • 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
  • (4)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
  • (4)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (4)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