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)

Stadler 06-04-2010 02:23 PM

Nice widget, but it won't show 'All Day'-events.

To fix this find:
Code:

$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);
and replace it with:
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);
HTH,
Christian Stadler

schlottkej 06-04-2010 02:25 PM

Quote:

Originally Posted by Leeleemu (Post 2048154)
I second this, would be a great addition :)

In fact is there an area which is dedicated on creating certain forum blocks?

No, I don't believe there is. Would be great to see one.

Leeleemu 06-05-2010 08:03 AM

Quote:

Originally Posted by nader (Post 1956354)
how can fix to show the event of current day?

Anyone, for instance the Cotto v Foreman fight has been on the widget all week but now its come to the day of the fight it has disappeared, therefore, is there any way to keep today's event on the widget?

Stadler 06-05-2010 10:11 AM

Quote:

Originally Posted by Leeleemu (Post 2048660)
Anyone, for instance the Cotto v Foreman fight has been on the widget all week but now its come to the day of the fight it has disappeared, therefore, is there any way to keep today's event on the widget?

It this an 'All Day'-event? Then check my post and see if that fixes it for you.

Leeleemu 06-06-2010 03:25 PM

Quote:

Originally Posted by Stadler (Post 2048694)
It this an 'All Day'-event? Then check my post and see if that fixes it for you.

Sadly no dice. It turns my whole Front page off giving it an error. :confused:

Stadler 06-09-2010 11:36 PM

Try again. I fixed a typo in my post above. It should work now.

your24hourstore 06-10-2010 08:59 PM

1 Attachment(s)
ahha i just noticed something

the problem only occurs if you don't use ranged events and set an end date ...

to make it work correctly you have to have a starting and ending day.
so the weird thing happens only on single all day events
haven't tried reoccurring yet !
works i figured it out now

installed

Leeleemu 06-13-2010 09:45 AM

Quote:

Originally Posted by Stadler (Post 2051269)
Try again. I fixed a typo in my post above. It should work now.

Nope doesnt work. This is annoying.

Thanks for helping though Stadler. :)

vilhiem 06-13-2010 02:29 PM

The two issues that seem to persist are:

(1) Getting re-curring events to display after the initial day (even though I have specific date ranges); and
(2) Getting the current day's events to display

Otherwise, it's a great mod and in spite of these issues, I use it on my main page.

Think it's funny that vBulletin does not provide this as a built-in feature (similar to their built-in feature that displays recent posts)

Stadler 06-13-2010 10:15 PM

Quote:

Originally Posted by Leeleemu (Post 2052890)
Nope doesnt work. This is annoying.

Thanks for helping though Stadler. :)

What 'doesnt work'? Can you please be more specific?

[Edit:]Here's the full code in my widget:
PHP Code:

ob_start();


//  %d
$show_count 5;

$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'] == )
     {
         
$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.php5?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(); 



All times are GMT. The time now is 08:18 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.01294 seconds
  • Memory Usage 1,759KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)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