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)

ProFifaLeagues 11-20-2010 10:47 AM

Cheers for the info dcuellar!!!

starman? 11-26-2010 02:25 PM

I'm still watching this one.

CybaGirl 11-28-2010 05:48 AM

Thanks works well apart from not displaying more than one event on the same day.

I don't suppose anyone has worked out how to do this yet?

Installed on version 4.0.3 BTW.

Sorry never mind it does display more than one event from the same day!

:).

ProFifaLeagues 11-29-2010 01:43 PM

Quote:

Originally Posted by CybaGirl (Post 2126602)
Thanks works well apart from not displaying more than one event on the same day.

I don't suppose anyone has worked out how to do this yet?

Installed on version 4.0.3 BTW.

Sorry never mind it does display more than one event from the same day!

:).

Should show all the days events on 4.0.3 :up:

CybaGirl 12-16-2010 10:08 AM

Hello seem to have found a small issues since moving our forum to a VPS but still staying with the same host.

The issue I have come across is that it is reporting the date a day later in the forum sideblock.

For example if an event in the calendar is scheduled for the 25th of December. The sideblock is saying that the event is happening on the 26th of December.

But when you click on the event in the sideblock and you are taken to your calendar it is taking you to the actual date of the event which in this case is the 25th of December.

So for some reason it is showing the event date in the sideblock as a day later.

Does anyone know how I might be able to correct this please?

Thank you.

ProFifaLeagues 12-20-2010 07:29 AM

CybaGirl i will be more then happy to come take a look if needed just pm me the details

CybaGirl 12-21-2010 01:01 AM

Ok I finally figured out what the problem was.

Has something to do with the calling of the date in the code.

Here is the first part of dcuellar's original code that I changed that uses an image.

Although this change seems to make no difference. But I still changed it anyway.

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);

Here is the new code and the section I changed is highlighted in red.

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);

This next change in the code is what made the difference.

Here is the area of the second part of dcuellar's original code that I changed.

Code:

        $format = sprintf("On %s%s %s %s",date("j",$event['dateline_from'])+1, date("S",$event['dateline_from']), date("M",$event['dateline_from']), date("Y",$event['dateline_from']));

This is how it now looks.

Code:

        $format = sprintf("On %s",date('jS M Y',$event['dateline_from']));

Once I made the above change the date being posted in the side block is now being posted as the same date as whats in the calendar.

I hope this helps others that may come across this same issue.

Here is the complete code so you can just copy and paste it into your Sideblock Manager.

Code:

ob_start();


//  %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",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"><center><a href="calendar.php?do=getinfo&e=%d"><img src="http://www.YourForum.com/forum/images/event.jpg" width="200px" alt="Upcoming Event"/><h4 class="cms_widget_post_header">%s</a></h4>
            <p class="cms_widget_post_content">%s</p></center>
        </div>
        ',$event['eventid'],$event['title'],$format);

}
$output = $output_bits;


ob_end_clean();
return $output;


:)

ProFifaLeagues 12-21-2010 05:28 AM

Superb CybaGirl Much thanks!!!

Thr33 12-22-2010 04:53 PM

is there a way to show the times of the event? i have multiple events on the same day but at different hours, would be nice to show the hours also.

wampforum 12-23-2010 02:26 PM

instalkled this but have a coupe of questions - my dates are 1 day too early - even if I try the alternate code its still showing wrong (I prefer the layout on the first code anyway) is there a way to adjust this?

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


All times are GMT. The time now is 03:13 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.01115 seconds
  • Memory Usage 1,747KB
  • 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
  • (5)bbcode_code_printable
  • (1)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