Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
UpComing Events SideBlock/Bar With/Without Image Details »
UpComing Events SideBlock/Bar With/Without Image
Mod Version: 1.10, by ProFifaLeagues (Coder/Designer) ProFifaLeagues is offline
Developer Last Online: Feb 2020 I like it Show Printable Version Email this Page

vB Version: 4.0.0 Rating: (16 votes - 4.31 average) Installs: 95
Released: 06 Nov 2010 Last Update: Never Downloads: 0
Not Supported Re-usable Code Translations  

Upcoming Events in Forum Block/Sidebar



Add the "Upcoming Events" in the forum side block
(Added as a few people seem to have issues with other mods the same)

Start by logging into your Admin cp

Goto Forums and moderators - Forum Blocks Manager and add a new Block.
Call the Block Upcoming Events(Or what ever suits your liking)
Set the block to Active
And use PhP Format.

Now add the content below :

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Then just make sure the template to use is set to Block_HTML

This will then show the latest upcoming event from your calendar with multi-day events shown until the last day of the event.



Update Thanks to dcuellar
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.


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.
Here you go for those interested (change what's in Red):

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Thanks go to cybaGirl for this fix:
Anyone who has the date showing as the day before can use this code in there forum block.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Download Now

Only licensed members can download files, Click Here for more information.

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • If you like this modification support the author by donating.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
  #46  
Old 08 Feb 2011, 08:26
Raul7 Raul7 is offline
 
Join Date: Mar 2005
Originally Posted by rammieone View Post
Something i have'nt looked at mate but your welcome to have a go and do some testing to get it working on a non vbull page.
here is a the query for anyone intrested, as you see its very basic , you need to add the styling code on top of it, the reason i am not adding mine is everyone page is differing ! btw i am using Event forum, if u r not, take out any reference to lv_vb_eventforums_threadid !


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

i aint any advance PHP coder, so excuse my code if its very basic
Reply With Quote
  #47  
Old 08 Feb 2011, 11:49
Mark4865's Avatar
Mark4865 Mark4865 is offline
 
Join Date: Sep 2010
Hello All,

Great mod and good work by all who contributed.

I have a few questions (you are talking to a technical idiot please bear that in mind when answering)

Will this work as a widget in CMS
Is there a way to have images to the left and event data on the right (any chance someone can show me full code to do this PLEASE)
If someone has worked out how to get it to work for single calendars please advise I run two calendars and would like to have a widget for each of them.

Many thanks in advance to anyone who takes the time to answer me
Reply With Quote
  #48  
Old 08 Feb 2011, 20:50
bitbender's Avatar
bitbender bitbender is offline
 
Join Date: Jan 2002
Real name: Philip
I have a similar need, Mark4 - good of ya to ask - I was just searching for that function.

and btw - it works just fine in CMS - Just remember to return a variable of $results as instructed. The scripts above in the root post refer to $output..

1_ Admin CP - CMS - Widget Manager - Create Widget - Direct PHP execution type - Give it a title.
2) Select configure from the list after the addd of the widget and the code above of your choice. I will assume you know how to copy the code block and paste it.

3) In your pasted block, scroll all the way to the end - If the one you copied ends like this
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.



Then change it to this:
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Save it, and then add the block to a page layout you are using. Worked just like that for me in 4.1.1

now, to customize it by event

Cheers
__________________

www.bitbenderforums.com Vb 4.1.3
www.jamgoodbluegrass.com vb 4.1.10

Last edited by bitbender; 08 Feb 2011 at 21:14. Reason: I found what I was looking :)
Reply With Quote
  #49  
Old 09 Feb 2011, 07:33
Raul7 Raul7 is offline
 
Join Date: Mar 2005
2 questions :

1- ) can someone explain what is // %d ? I am just trying to learn

2-) another issue i have right now is when an even is on Feb 9th, as soon as clock turn to FEB 9th, the even is gone, is it possible to keep it until end of the current date?

Thanks,
Reply With Quote
  #50  
Old 09 Feb 2011, 12:44
Mark4865's Avatar
Mark4865 Mark4865 is offline
 
Join Date: Sep 2010
Hello BitBender

thanks for info, cutting and pasting just about covers my technical knowlege so I can manage that thanks.

I want a widget with images but the image on the left and text on the right, but the text should be limited to the title only that will take you to the event if click on it. Any chance you can help me with the code required to acheive that result?

Sorry I know I am asking a lot here
Reply With Quote
  #51  
Old 09 Feb 2011, 12:46
Mark4865's Avatar
Mark4865 Mark4865 is offline
 
Join Date: Sep 2010
2-) another issue i have right now is when an even is on Feb 9th, as soon as clock turn to FEB 9th, the even is gone, is it possible to keep it until end of the current date?

Second that important point for me as well
Reply With Quote
  #52  
Old 10 Feb 2011, 13:45
bitbender's Avatar
bitbender bitbender is offline
 
Join Date: Jan 2002
Real name: Philip
Hi Mark --

Getting that image like you want it is going to be some template work as they are calling a function to make that line up. To do what is wanted we'd have to track back, clone the function and makes changes, then change the widget to call your new function. I'd have to dig into that and I'm a bit crunched for time for the next 10 days or so.

Btw - Never change the base VBulletin templates - always make a new style and then modify the template to be changed in YOUR style - Save you it will, at upgrade time - bcause the default VB style will always work. I learned many years ago not to try to fool mother nature

Now, you may ask, how in tarnation would I do that? Simple - Export the default style to your 'puter as an xml file and then reimport it - following the guideline below;

Create a new style with no parent style and give it a NEW name - Like "MarksTest".

Leave it as non-selectable by users.
================================================
Now - You have your own little test style that you can do what you want with and no one but yor hairdresser will know for sure Once you get stuff like you want, you can publish your style to your community by making it selectable. Or cast it into the unknown depths of the bit-bucket and start over.

2nd post - Check your recurring dates/times - make sure the end time is beyond what you are looking at. On the site I am building, there is an event that takes place this evening, but my calendar shows it and so does this mod as a widget in the CMS.

--> I also added location selection logic to seperate by location (based upon a rexexp i am looking for in the title field) so that I can list music events by location on location specific CMS pages, or lump them all together in a sidebar by using the basic widget above.
__________________

www.bitbenderforums.com Vb 4.1.3
www.jamgoodbluegrass.com vb 4.1.10

Last edited by bitbender; 10 Feb 2011 at 13:56.
Reply With Quote
  #53  
Old 10 Feb 2011, 16:08
Mark4865's Avatar
Mark4865 Mark4865 is offline
 
Join Date: Sep 2010
thanks for all the effort and info will have to think seriously about this as I dont want to mess with templates
Reply With Quote
  #54  
Old 11 Feb 2011, 07:12
Mark4865's Avatar
Mark4865 Mark4865 is offline
 
Join Date: Sep 2010
Am I to understand this will work fine if I dont want the images on the side but leave them as is in their current position??

I just want the event title, date of event and a thumbnail picture, is that possible?? If so please advise exact code I need. Thanks in advance sorry for all the questions.

Mark
Reply With Quote
  #55  
Old 11 Feb 2011, 21:22
way2xtreme way2xtreme is offline
 
Join Date: Oct 2006
hi, is there a way to show just the starting date for an event the carries over 2 days. I'd like to make this look tidy and neat.. thanks
Reply With Quote
  #56  
Old 11 Mar 2011, 20:43
otterag otterag is offline
 
Join Date: Feb 2011
a problem i am having with this is that i have not found a mod that will show a recurring event in an upcoming event widget on a daily basis instead of the range of its repeats.
I have the same type of event occuring every Friday at 3:00pm and instead of making 1 event for each Friday for the entire year i have made 1 that recurs every Friday for the rest of the year and my upcoming events widget shows instead Friday March 1st - 700pm it shows From March 1st to March 31st

is there any way to change the display output on this

from current
Event Name
From 1st March 2011 to 31st March 2011

to
Event Name
March 1st - 7:00pm

this is something that is really bothering me and i cant figure out how to make the changes after reading these boards for a few days and looking at the code. help would be greatly appreciated.

Last edited by otterag; 11 Mar 2011 at 20:53.
Reply With Quote
  #57  
Old 21 Mar 2011, 00:47
southeastminis southeastminis is offline
 
Join Date: Mar 2011
I've installed this and it works great, however I am trying to change the color of the background (where the events are actually posted.)

Anyone know what Stylevar this would be under?
Reply With Quote
  #58  
Old 27 Apr 2011, 13:00
Mark4865's Avatar
Mark4865 Mark4865 is offline
 
Join Date: Sep 2010
Hello everyone need help please.

I have used this in the CMS with a few changes (images on right text on left) works great BUT cant get images to show. They show up fine in the actual event but not in the widget here is an example of my image address for one image http://www.mywebsite.co.za/temp%20lo...Beach_2010.jpg

this is the code I have used, how do I get the image to show

ob_start();


// %d
$show_count = 10;


$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"><a href="calendar.php?do=getinfo&e=%d"><img src="http://www.YourForum.com/forum/images/event.jpg" width="75" height="60" alt="Upcoming Event" HSPACE="7" VSPACE="3" align="left"/><h4 class="cms_widget_post_header"><b>%s</b></a></h4>
<p class="cms_widget_post_content"><b>%s</b></p>

</div> <BR/><BR/>
',$event['eventid'],$event['title'],$format);

}
$output = $output_bits;


ob_end_clean();
return $output;
Reply With Quote
  #59  
Old 28 Apr 2011, 05:01
Voeltz Voeltz is offline
 
Join Date: Apr 2011
This.. is.. AMAZING!! thanks, works wonderfully:
http://goo.gl/p2SqP
Reply With Quote
  #60  
Old 06 May 2011, 23:58
tomsch tomsch is offline
 
Join Date: May 2003
http://www.vbulletin.org/forum/showthread.php?t=231365

this post has a corrected query that take into account time zone and dst.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 06:48.

Layout Options | Width: Wide Color: