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)

Ruhl49 02-26-2011 03:49 PM

Still one day off, i.e. it's on the calendar for the 27th, but the "Upcoming Events" widget shows "26th Feb 2011"...

jgt58 02-26-2011 03:57 PM

same here , had to disable

jgt58 02-26-2011 04:15 PM

Quote:

Originally Posted by NiCForce (Post 1944388)
I think that some coders already know the answer, but do not show us how?
a friend of mine has been added to my code (or the entire code) =




PHP Code:

ob_start(); 

$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'] == 
     { 
$datefrom date('j',$event['dateline_from']); 
$datefrom $datefrom+1;
         
$format sprintf("On ".$datefrom."th %s",date('M Y',$event['dateline_from'])); 
     } else { 
$datefrom date('j',$event['dateline_from']); 
$datefrom $datefrom 1;
$dateto date('j',$event['dateline_to']); 
$dateto $dateto 1;
         
$format sprintf("From ".$datefrom."th %s to ".$dateto."th %s",date('M Y',$event['dateline_from']),date('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(); 

Set your GMT time, standard for me + 1 (change it) and it should work.
if a coder could take the data from the + or - GMT time and replacing the code in my (+ 1)then it should work. but what I was thinking. is that the data is taken from a wrong place.

guys , just fyi , this code fixed my block.

lsgworldl 02-27-2011 06:39 AM

after i added this all i got was a white screen to my site

otterag 03-01-2011 05:20 PM

first i want to say that is a great mod. i have a few questions though.
- Is there a way to change the information that is displayed in the widget box. instead of having it show the date ranges of the event i would like to see it display the Date of the next event upcoming along with the day of the week and the start time

Example
Currently it shows
"Name of Event"
"From 4th March 2011 to 4th July 2011"

What i would like it to show would be
"Name of Event"
"Friday, March 4th @ 3:00pm"

wonderfulwat 03-28-2011 05:52 AM

I have this on the cms homepage (www.WonderfulWaterloo.com), but I'd like to know how I can have it show up on the forumdisplay template. For example, I want it to show up on this page: www.wonderfulwaterloo.com/election

mmcguire 04-26-2011 10:16 PM

Quote:

Originally Posted by jgt58 (Post 2167176)
guys , just fyi , this code fixed my block.

Thank you, this worked perfectly.

tomsch 04-28-2011 11:32 PM

ok I know why we are having troubles with some of the dates being a day behind.

In my opinion there is a bug in the calendar. when you post a range event is puts in a time zone entry and if DST is active.

a single event does not.

i will be posting a bug report for this.

as a work around just add the missing data to the fields and all works well

does any know how to use the utz and dst fields to adjust our times??

tomsch 04-29-2011 12:20 AM

Code:

ob_start();
global $db,$vbulletin;

//  %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'] == 0 )
    {
        $format = sprintf("On %s",vbdate('D M jS Y',$event['dateline_from'],false,true,false,true));
    } else {
        $format = sprintf("From %s to %s",vbdate('D M jS Y',$event['dateline_from'],false,true,false,true),vbdate('jS M 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">%s</a></h4>
            <p class="cms_widget_post_content">%s</p>
        </div>
        ',$event['eventid'],$event['title'],$format);

}
$output = $output_bits;

ob_end_clean();


see if this work around solves the problem

tomsch 05-05-2011 12:20 AM

Quote:

Originally Posted by tomsch (Post 2189852)
Code:

ob_start();
global $db,$vbulletin;

//  %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'] == 0 )
    {
        $format = sprintf("On %s",vbdate('D M jS Y',$event['dateline_from'],false,true,false,true));
    } else {
        $format = sprintf("From %s to %s",vbdate('D M jS Y',$event['dateline_from'],false,true,false,true),vbdate('jS M 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">%s</a></h4>
            <p class="cms_widget_post_content">%s</p>
        </div>
        ',$event['eventid'],$event['title'],$format);

}
$output = $output_bits;

ob_end_clean();


in this widget the %d is the placeholder for todays date.

can anyone tell me where the placeholder is being set to the date??


All times are GMT. The time now is 09:00 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.01310 seconds
  • Memory Usage 1,766KB
  • 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
  • (3)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