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-15-2010 09:11 AM

Quote:

Originally Posted by Bram H (Post 2122030)
We have multiple calendar events per day, and for today it only shows 1 event out of 4

Not sure then there whats happening as we have it set to pull all events on the preset day from the main calendar but n saying that we do only run one event at a set date!
Sorry i cant be more helpful but after a quick look around seems there is a few problems with the date discrepancy on vbull for this type of mod...Only other thing you could try would be copy the original upcoming event code and test that.

Zweeper 11-15-2010 02:17 PM

Quote:

Originally Posted by rammieone (Post 2118637)
Well this may be of help then fella and it works well as i have used it
https://vborg.vbsupport.ru/showthrea...light=birthday


quite nice, thats true. but i would rather the birthdays in the calender widget as well.

dcuellar 11-15-2010 04:26 PM

This one works well. Anyway to have an image above the event in the forum block. Would be nice for it to automatically pull an image posted in the calendar event.

dcuellar 11-15-2010 04:30 PM

Also, I just noticed that the date shown on the forum block is one day before it is set in the calendar.

dcuellar 11-16-2010 01:31 AM

Got both of my above comments to work.

Here you go for those interested (change what's in Red):
Code:

ob_start();


//  %d
$show_count = 1;

$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%s %s %s",date("j",$event['dateline_from'])+1, date("S",$event['dateline_from']), date("M",$event['dateline_from']), date("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;

What this does is add a picture centered above the upcoming event. The picture is uploaded to 'images/' as event.jpg. You can change that to whatever you want. It also corrects the issue I had with the date. It's now projecting the proper date.

What I'd really like to do is replace the code related to the image with a piece of code that uses an image that was either attached or placed between img tags in the event.

NOTE:
I changed the number of events to display to 1.
I do not need the range on my forum so I did not test that part.

ProFifaLeagues 11-16-2010 04:38 AM

Cheers dcuellar I have added that info in the 1st post and given you credit as it will help many!

dcuellar 11-16-2010 04:03 PM

Quote:

Originally Posted by rammieone (Post 2122306)
Cheers dcuellar I have added that info in the 1st post and given you credit as it will help many!

Cool. Hope it helps others. I'm talking to some friends of mine to see if the image can be auto generated if an image is included in a calendar event. That way we don't have to change the picture everytime a new event is up. That will also allow us to do more than one event on the block at a time.

Wish me luck.

COL NIL SATIS 11-16-2010 06:14 PM

Nice one mate..sounds cool that does!!

ProFifaLeagues 11-16-2010 06:34 PM

Quote:

Originally Posted by dcuellar (Post 2122507)
Cool. Hope it helps others. I'm talking to some friends of mine to see if the image can be auto generated if an image is included in a calendar event. That way we don't have to change the picture everytime a new event is up. That will also allow us to do more than one event on the block at a time.

Wish me luck.


Be great to have that option mate keep us informed!!!:up:

dcuellar 11-19-2010 06:36 PM

Update: I'm trying to get this thing to work but I need help from someone who knows how to deal with plugins.
Update 2: Sorry guys, I gave in. I hired a coder to complete this for me. Unfortunately, I cannot post the code here. :( He may do the custom work for you if you are really interested. Look for the member called Gio~logist.


All times are GMT. The time now is 04:24 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.01059 seconds
  • Memory Usage 1,745KB
  • 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_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)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