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
  #2  
Old 02-20-2010, 05:48 PM
Bouncer222 Bouncer222 is offline
 
Join Date: Oct 2009
Posts: 705
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is it possible to use this with vbadvanced as a module?
Reply With Quote
  #3  
Old 02-20-2010, 06:02 PM
cory_booth cory_booth is offline
 
Join Date: Jul 2006
Posts: 224
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Most likey, but unfortunately I am not using VBadvanced...
If I remember right, you could load php files as modules.

So take the code, drop the first line ob_start and the last two lines...
Save as a php file and then try loading as a module...
Reply With Quote
  #4  
Old 03-15-2010, 02:42 AM
SuperGLS SuperGLS is offline
 
Join Date: Nov 2004
Posts: 126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Gonna try this and see how it works. Thanks!
Reply With Quote
  #5  
Old 03-19-2010, 11:15 PM
4thstar 4thstar is offline
 
Join Date: Sep 2004
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thankyou this works well, i have one small issue though that you may be able to help with please.

this displays upcoming events but it does not show an event for the day itself, if you have an event on the 20th and it is the 20th it wont show that event, for us the events are on in the evening so during that day we would still like to show it as being an upcoming event,

i edited this bit from
PHP Code:
$and=" and dateline_from > '".$sdate."'" 
to
PHP Code:
$and=" and dateline_from >= '".$sdate."'" 

thankyou
Kind Regards
Carl
Reply With Quote
  #6  
Old 04-27-2010, 08:43 AM
NashChristian's Avatar
NashChristian NashChristian is offline
 
Join Date: Jul 2007
Location: Nashville, TN
Posts: 292
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks!
Reply With Quote
  #7  
Old 04-30-2010, 07:13 PM
NashChristian's Avatar
NashChristian NashChristian is offline
 
Join Date: Jul 2007
Location: Nashville, TN
Posts: 292
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by 4thstar View Post
This displays upcoming events but it does not show an event for the day itself, if you have an event on the 20th and it is the 20th it wont show that event, for us the events are on in the evening so during that day we would still like to show it as being an upcoming event,

i edited this bit from
PHP Code:
$and=" and dateline_from > '".$sdate."'" 
to
PHP Code:
$and=" and dateline_from >= '".$sdate."'" 
Hello,

I implemented this modification, as I too want to post events from the current day as well as future dates. I'm having one problem with this, for some reason, though it will list events that are occuring TODAY, it displays TOMORROW's date next to it. Does anyone know how I can fix this?

Here are a couple screen shots (look at the top listing on the widget):





The dates are correct for every day's events except TODAY's. I need to find a solution for this. Any help would be appreciated.

Thanks!
Jeff
Reply With Quote
  #8  
Old 05-01-2010, 02:08 AM
HobbesGTS HobbesGTS is offline
 
Join Date: Mar 2008
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there anyway to modify this code to get it to display a custom field as well?
Reply With Quote
  #9  
Old 05-01-2010, 04:20 AM
NashChristian's Avatar
NashChristian NashChristian is offline
 
Join Date: Jul 2007
Location: Nashville, TN
Posts: 292
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Now I'm confused! Ok, I couldn't figure out how to get yesterdays events (04-30-10) to display with yesterday's date (they showed 05-01-10), SO I reverted to Cory's original code (without the '>=' mod), the results have me scrathing my head.

I cleared my CMS cache and tested this using a couple different browsers, here's what I found (the top two events listed are actually 04-30-10 events):



NOTHING CHANGED. Which confuses me for two reasons. The first, is since I'm running the original code without the slightest change, why am I the only one claiming to have a problem with this. Second, it was my understanding that events for TODAY would NOT show up with this widget, which is why 4thstar added the '>=' mod.

Is anyone else experiencing similar difficulties?

Another thing that has me scratching my head, is now that the clock reads 12:20 AM, and the day has effectively changed to 05-01-10 (first day of the month) the events listed for TODAY display the correct date (05-01-10) in the widget.



Is this just some sort of "end-of-the-month bug"? Has anyone else noticed this or come up with some sort of work-around?

Help me out here people, I'm confused.

Thanks!
Jeff
Reply With Quote
  #10  
Old 05-01-2010, 04:48 AM
NashChristian's Avatar
NashChristian NashChristian is offline
 
Join Date: Jul 2007
Location: Nashville, TN
Posts: 292
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Actually, upon further investigation, I see that I'm having the same problem on SEVERAL of my upcoming event posts with this widget. Here are two screen shots that illustrate this problem (compare the event dates with those displayed in the widget above):





This isn't happening on EVERY event, however it is happening on close to 50% of them! I don't think the date syntax works in this code. I appreciate what it is trying to accomplish, instead of listing it in long form like the other mod out there, I really prefer the short format, but I don't think it works right. When the date is off, it is always off by exactly 1 day.

Is anyone using this with a site that posts a lot of events, and can you provide a link to your site so I can compare the widget dates to the actual calendar event dates? I'd be curious to see how this is working for other people.

What a shame! I really like this mod, and don't want to use the long form date range display.

Bummer!
Jeff
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 01:29 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.04309 seconds
  • Memory Usage 2,342KB
  • Queries Executed 24 (?)
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
  • (5)bbcode_php
  • (1)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
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • 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