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 Forum Sideblocks - UpComing Events SideBlock/Bar With/Without Image (https://vborg.vbsupport.ru/showthread.php?t=253239)

netzwart 08-31-2011 09:19 AM

Quote:

Originally Posted by wampforum (Post 2138107)
Second thing is there a way to make it pull dates from a single calendar? At the moment it also pulls from a private calendar

Change the code like this:

$query = sprintf("SELECT * FROM ".TABLE_PREFIX."event WHERE visible = 1 AND calendarid = X AND (dateline_from > '%d' || ( dateline_from > '%d' AND dateline_to > '%d' )) ORDER BY dateline_from ASC LIMIT %d",TIMENOW,TIMENOW,TIMENOW,$show_count);

X should be the ID of the calendar you want the events to be taken from.

I am not a professional programmer, i. e. an expert should have a look at it.

Netzwart

bposner 09-21-2011 08:06 PM

I've updated this widget with the code that was suppose to fix the date issue (displays one day behind) but this code did not fix the date issue.
Suggestions?
Thanks!

fookaa 12-07-2011 06:35 PM

Hi...

Is there a ay to get it to show the time also ??

rhody401 02-22-2012 10:47 AM

I tried all above variations, and the dates were still sometimes off one day.

My solution: I took out dates entirely, and I took out the images as well. Now it is just one line per event, with a descriptive link to the calendar. It's nice and compact.

Even though it required some tweaking, this code is fantastic and exactly what I was looking for.

THANK YOU!

Mike

rhody401 02-22-2012 04:11 PM

I wouldn't mind shrinking the print a bit, and adding a space between each entry. I couldn't figure that out, however.

It appears to be using block_html template. I can call this up, but don't want to change something that may hurt other areas of the system.

Any advice appreciated.

ProFifaLeagues 02-22-2012 06:57 PM

Quote:

Originally Posted by rhody401 (Post 2302311)
I wouldn't mind shrinking the print a bit, and adding a space between each entry. I couldn't figure that out, however.

It appears to be using block_html template. I can call this up, but don't want to change something that may hurt other areas of the system.

Any advice appreciated.

You could Just use simple Html markups to change the text sizes and add line breaks:up:

rhody401 02-23-2012 06:24 PM

The solution was simple. Thank you!

This "lite" version is what I applied, with slight modifications to reduce the text size, eliminate the images/missing image errors, and eliminate the misbehaving single date field.

I have only had my VB forum license for a week, but have learned so much from these forums that has helped me customize and configure it.

Thanks to all

PHP Code:

ob_start(); 

//  %d 
$show_count 4

$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(" "); 
//         $format = sprintf("On %s",date('jS M Y',$event['dateline_from']));   <-- broken/disabled
     
} 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"><center><a href="calendar.php?do=getinfo&e=%d"><h4 class="cms_widget_post_header"><font size="2">%s</font></a></h4> 
            <p class="cms_widget_post_content"><font size="1">%s </font></p><p><font size="1">&nbsp;</font></p></center> 
        </div> 
        '
,$event['eventid'],$event['title'],$format); 


$output $output_bits

ob_end_clean(); 
return 
$output


mgurain 04-29-2012 10:54 AM

Could this be supported to make it work in 4.1.12 ?

Regards,,

rhody401 04-30-2012 01:59 PM

I'm using it with 4.1.12 PL1

ProFifaLeagues 04-30-2012 02:29 PM

Quote:

Originally Posted by mgurain (Post 2324571)
Could this be supported to make it work in 4.1.12 ?

Regards,,

Confirmed working in 4.1.12


All times are GMT. The time now is 04:57 AM.

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.01857 seconds
  • Memory Usage 1,753KB
  • 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
  • (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
  • (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