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

Reply
 
Thread Tools
[WIDGET] Upcoming Events Details »»
[WIDGET] Upcoming Events
Version: 1.00, by cory_booth cory_booth is offline
Developer Last Online: Jun 2013 Show Printable Version Email this Page

Category: vBulletin CMS Widgets - Version: 4.0.2 Rating:
Released: 02-19-2010 Last Update: Never Installs: 103
Re-useable Code Is in Beta Stage  
No support by the author.

Another upcoming events widget...
I am really waiting for someone to kickout an integrated calendar/events widget...
But until then, I am using this PHP widget for my events. I saw a few others on here, but they were not quite what I was looking for...

Feel free to use/hack/slash this code for your own use...

Navigate to AdminCP -> CMS -> Widgets.
Create a PHP Type Widget and paste the below code.

PHP Code:
ob_start();
global 
$db,$vbulletin;
$calendarid="1";
$per_page "10";
//################################################
$d=date("d");
$m=date("m");
$y=date("y");
$sdate mktime(000date("$m"), date("$d"),  date("$y"));
$edate mktime(000date("$m"), date("31"),  date("$y"));
$and=" and dateline_from > '".$sdate."'";

$getevents=$db->query_read("SELECT eventid, title, dateline_from from " TABLE_PREFIX "event WHERE calendarid='".$calendarid."' $and order by dateline_from ASC LIMIT $per_page");
$count=0;
if(!
$db->num_rows($getevents))
{
}
else
{
WHILE (
$events=$db->fetch_array($getevents))
{
$dtitle=$events['title'];
$did=$events['eventid'];
$date vbdate('m-d-y
'
,$events['dateline_from'], false,true,false,true);
if (
$count 2){$class="alt2";}else {$class="alt1";}
$year=date("Y");
$pagetitle $f;
$pagetitle .= " ";
$pagetitle.=$year;
$eventbits .="<tr><td nowrap class=''><strong>".$date.":</strong></td><td width='100%' class=''><a href='calendar.php?do=getinfo&e=$did&c=".$calendarid."'>".$dtitle."</a></td></tr>";
$count++;
}
}
echo 
"<table align='center' width='100%'>";
echo 
$eventbits;
echo 
"</table>";
$db->free_result($getevents);
unset(
$events);
$output=ob_get_contents();
ob_end_clean(); 

Screenshots

File Type: jpg events.jpg (20.3 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 10-16-2010, 05:39 PM
Lexor Lexor is offline
 
Join Date: Oct 2010
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I installed the widget on 4.0.7
But when i adde an area in my cms and want to choose it i became an error message like this:

Call to undefined function vbgmdate() in /www/htdocs/XXX/XXXX/packages/vbcms/widget/execphp.php(194) : eval()'d code on line 43

Can you help ?
Reply With Quote
  #23  
Old 02-16-2011, 12:55 PM
TCB's Avatar
TCB TCB is offline
 
Join Date: Jun 2004
Location: the Netherlands
Posts: 193
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Looks and works great. Thanks
Reply With Quote
  #24  
Old 03-26-2011, 06:03 AM
Eq4bits Eq4bits is offline
 
Join Date: May 2006
Posts: 468
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by NashChristian View Post
Alright, at least I'm not going crazy. I did some research at our neighboring events widget mod, and found that they have encounterd the exact same problem, with a solution outlined here.

My GMT is -6, so whenever an event is scheduled to begin at 6pm or later, it displays the date for the following day.

Now, I just need to figure out how to apply this same solution to this mod.

At least there is hope.
Jeff
I went with the other code as well, set the GMT offset to match my site's 'time'.
Had to laugh tho when I went to check to see if it was displaying right.
Display for 'today' was perfect... but April 1st events showed as being
Quote:
On 32th Mar 2011
Not sure if that's an intentional 'funny' or something weird because March has 31 days... and I don't have have any events for the 29th, 30th or 31st. the wording is a bit 'fonky' for 2nd displaying as '2th' and 3rd displaying as '3th'. Also only 1 event per date is showing when I know at least one has 2 events scheduled
Reply With Quote
  #25  
Old 06-24-2011, 03:58 PM
Eq4bits Eq4bits is offline
 
Join Date: May 2006
Posts: 468
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by SuperGLS View Post
Also, I wish the colon had a space on the RIGHT instead of the LEFT. Any ideas?
I was able to add a space *after* the colon (but unable to remove the space to the left by changing
THIS
Code:
$eventbits .="<tr><td nowrap class=''><strong>".$date.":</align></td><td width='100%' class=''><a href='calendar.php?do=getinfo&e=$did&c=".$calendarid."'>".$dtitle."</a></td></tr>";
TO THIS
Code:
$eventbits .="<tr><td nowrap class=''><strong>".$date.":</strong></td><td width='100%' class=''>&npsb;<a href='calendar.php?do=getinfo&e=$did&c=".$calendarid."'>".$dtitle."</a></td></tr>";
Reply With Quote
  #26  
Old 06-25-2011, 12:54 AM
Eq4bits Eq4bits is offline
 
Join Date: May 2006
Posts: 468
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I finally got mine to pull the 'current' date & it's events

FIND:
PHP Code:
ob_start(); 
global 
$db,$vbulletin
$calendarid="1"
$per_page "10"
CHANGE TO:
PHP Code:
ob_start();
global 
$db,$vbulletin;
$mydate =  mktime(000date("m"), date("d")-1date("Y"));
$calendarid="1";
$per_page "10"
FIND:
PHP Code:
$getevents=$db->query_read("SELECT eventid, title, dateline_from from " TABLE_PREFIX "event WHERE calendarid='".$calendarid."' $and order by dateline_from ASC LIMIT $per_page"); 
CHANGE TO:
PHP Code:
$getevents=$db->query_read("SELECT * FROM ".TABLE_PREFIX."event WHERE calendarid='".$calendarid."' AND visible= '1' AND (dateline_from >= '$mydate' || (  dateline_from >= '$mydate' AND dateline_to <= '$mydate' )) ORDER BY dateline_from ASC LIMIT $per_page"); 
Reply With Quote
3 благодарности(ей) от:
fookaa, Kahmy, SilverBoy
  #27  
Old 06-01-2012, 05:28 PM
Onkeltyson Onkeltyson is offline
 
Join Date: Dec 2009
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for that
Reply With Quote
  #28  
Old 08-04-2012, 11:04 AM
ReBe ReBe is offline
 
Join Date: Jul 2007
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have some recurring entrys, but in the widget only the first from the recurring entrys are shown. Is there a solution for it?
Reply With Quote
  #29  
Old 08-08-2012, 01:00 PM
barnsi barnsi is offline
 
Join Date: Dec 2011
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

changed to
PHP Code:
$date vbdate('j. F Y 
vor dem "j." muss das Hochkomma stehen, wird hier leider nicht richtig dargestellt.
Das ergibt dann die Anzeige: "9. August 2012" statt "08.09.12"
Reply With Quote
  #30  
Old 08-09-2012, 08:01 AM
Arrogant-One's Avatar
Arrogant-One Arrogant-One is offline
 
Join Date: Jul 2007
Location: Brisbane
Posts: 196
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by cory_booth View Post
Create a PHP Type Widget and paste the below code.
Hi Cory.

How do I do this exactly? I am a bit of a novice at vB but have learned some stuff. Editting templates is a breeze. Is this like that?

What do you mean by 'Create a PHP Type Widget'
Reply With Quote
  #31  
Old 08-17-2012, 08:11 PM
otterag otterag is offline
 
Join Date: Feb 2011
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The calendar im trying to show events for is almost all recurring events and this mod does not show any of them.

Is there a way to pull those for the dates that they actually occur on with out having to redo the entire calendar day by day?

here is a screen shot of the mod on the left and the calendar on the right.

http://armadagames.com/forums/images...s_calendar.jpg
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 03:54 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.04764 seconds
  • Memory Usage 2,365KB
  • 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
  • (2)bbcode_code
  • (6)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
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (3)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
  • 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
  • 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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete