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.
  #106  
Old 25 Sep 2012, 00:22
CSS59 CSS59 is offline
 
Join Date: Nov 2004
Originally Posted by CSS59 View Post
How do I get it to show Date first and then Event name please?
anyone please?
Reply With Quote
  #107  
Old 18 Nov 2012, 09:14
Thommy Thommy is offline
 
Join Date: Nov 2010
Nice Mod! Works fine and easy for 4.2.0 PL2!!!

Is there a way to change Date Format in German?
Now is: 1st Dec.
Perfect for me is: 1. Dezember (or 1. Dez)
Reply With Quote
  #108  
Old 18 Nov 2012, 09:23
ProFifaLeagues's Avatar
ProFifaLeagues ProFifaLeagues is offline
 
Join Date: Aug 2009
Real name: Rob
Originally Posted by Thommy View Post
Nice Mod! Works fine and easy for 4.2.0 PL2!!!

Is there a way to change Date Format in German?
Now is: 1st Dec.
Perfect for me is: 1. Dezember (or 1. Dez)


Sorry Thommy I have never Used the German format so know little about it at all sir.
If i can find any info I will be sure to post back for you
Reply With Quote
  #109  
Old 18 Nov 2012, 21:27
Thommy Thommy is offline
 
Join Date: Nov 2010
THX for your answer!

I found followings works:

search in your code this: %s",date('jS M Y'
and change it to: %s",date('j. F Y'

Before change: 1st. Dec 2012
After Change: 1. December 2012

At last change Phrases from December to Dezember (for German)
Reply With Quote
  #110  
Old 10 Dec 2012, 16:49
PoorGuysGarage PoorGuysGarage is offline
 
Join Date: Nov 2012
couldnt get it to work

i'm thinking it has something to do with the following :


Specify the content you want to display. If this is PHP code, use a return statement to send your output to the block. For example:

$my_output = 'Hello, world.';
return $my_output;

I'm guessing i need to imput this somewhere in the code?
Reply With Quote
  #111  
Old 11 Jan 2013, 19:29
zapiy zapiy is offline
 
Join Date: Jul 2008
Can i use this on VBadvanced as a module is some way please?
Reply With Quote
  #112  
Old 05 Feb 2013, 17:56
CptBogo CptBogo is offline
 
Join Date: May 2007
Real name: Ryan
i have modified this a little bit for my forum and i thought i would share.

instead of

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

i used

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

this does a couple things different.

first i changed the format to look like 'On 5th Feb, 2013 at 8:00 PM'. the end date wasnt as important to us as the time the event started so i added the time and removed the end date.

second it uses the vbulletin 'vbdate' function instead of the PHP 'date' function. this will automatically change the date to the users timezone instead of using the servers timezone. remember to set 'Cache Time' to 0 in the forum block settings or else it will cache someone elses timezone and be incorrect for every other user.

hope this helps someone else trying to do something similar.

and a screenshot of how it looks on my forum.
Reply With Quote
  #113  
Old 06 Feb 2013, 03:02
Filip Filip is offline
 
Join Date: Feb 2007
Real name: Filip
Is there a simple way to have the date being displayed in a other language than english?
Reply With Quote
  #114  
Old 06 Feb 2013, 13:20
rhody401's Avatar
rhody401 rhody401 is offline
 
Join Date: Feb 2012
I like the changes you made a couple posts before this one(VBDATE), but it still seems to show one day earlier than the scheduled date. (for all events on my calendar)

I have the cache set to 0, etc.

Any ideas why? Are you having the same issue?
Reply With Quote
  #115  
Old 06 Feb 2013, 18:36
CptBogo CptBogo is offline
 
Join Date: May 2007
Real name: Ryan
Originally Posted by Filip View Post
Is there a simple way to have the date being displayed in a other language than english?
if the user logged into vbulletin has another language set in their profile the vbdate function should adjust it for their language. you might want to change the format the date is displayed in though vbdate("format here", time())
if you are familiar with PHP you might want to have a look at these functions:
http://www.php.net/manual/en/function.setlocale.php
http://www.php.net/manual/en/function.strftime.php
they work together, you use the first function to set the language you want to use and the second function creates the date string based on the language you defined in the first function. note that the vbdate function includes those 2 functions in it.


Originally Posted by rhody401 View Post
I like the changes you made a couple posts before this one(VBDATE), but it still seems to show one day earlier than the scheduled date. (for all events on my calendar)

I have the cache set to 0, etc.

Any ideas why? Are you having the same issue?
i did not have this issue. however it looks like others have been experiencing it. there are a couple solutions in this thread. but the easiest is probably:

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

this simply adds 1 day(in seconds) to the events timestamp so when it gets the formatted date string its +1 day


also for those interested i have updated my own code to show 'Today', 'Tomorrow', etc instead of the day, month and year. if the date is more then a week in the future it will display the full day, month, year format(February 6th, 2013).


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





Edit: I have discovered an issue where full day events that do not have a start time specified dont display correctly. for example the last event in my screenshot, "Starcraft II Risk", should start at 12AM on Saturday and not on Friday. i do not currently have a way to fix this but when i do i will post an update.

Last edited by CptBogo; 06 Feb 2013 at 18:56.
Reply With Quote
  #116  
Old 22 Feb 2013, 22:59
ITMerc ITMerc is offline
 
Join Date: Feb 2013
Hi folks! How/where would you modify the code to insert a page break so you'd have an empty line between the date of the first event and the description/title of the NEXT event... I want to visually separate them.
Reply With Quote
  #117  
Old 04 Mar 2013, 10:01
Hawkinz Hawkinz is offline
 
Join Date: Feb 2012
My block doesn't show up when PHP is selected. Any ideas? cheers

Last edited by Hawkinz; 04 Mar 2013 at 14:42.
Reply With Quote
  #118  
Old 21 Mar 2013, 15:27
rhody401's Avatar
rhody401 rhody401 is offline
 
Join Date: Feb 2012
Question Excluding certain entries based on a string of text?

I have modified this a bit to make it in a format for USA Month Day Year, and some other small changes. (my modified code below)

It would be REALLY nice if I could find a way to have it exclude some calendar items that have a specific string of text in the title. I just don't know where to put the hook to make this happen. Any suggestions appreciated! THANK YOU

example: If a calendar event has "BOARD MEETING" anywhere in the TITLE, it gets overlooked/ignored by this code. It displays everything else, but these events.

Here is my (current/modified from above) code:

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

Thanks in advance if anyone has the time to look at this and give some advice.

Much appreciated!
Rhody
Reply With Quote
  #119  
Old 01 Apr 2013, 13:00
CptBogo CptBogo is offline
 
Join Date: May 2007
Real name: Ryan
Originally Posted by rhody401 View Post
I have modified this a bit to make it in a format for USA Month Day Year, and some other small changes. (my modified code below)

It would be REALLY nice if I could find a way to have it exclude some calendar items that have a specific string of text in the title. I just don't know where to put the hook to make this happen. Any suggestions appreciated! THANK YOU

example: If a calendar event has "BOARD MEETING" anywhere in the TITLE, it gets overlooked/ignored by this code. It displays everything else, but these events.

Here is my (current/modified from above) code:


Thanks in advance if anyone has the time to look at this and give some advice.

Much appreciated!
Rhody

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

i have added a simple check if(!strpos($event['title'], "BOARD MEETING")) which says if the title does not contain BOARD MEETING. if it does have BOARD MEETING it skips the event and moves to the next one.

i havnt tested it but it should work.

Last edited by CptBogo; 10 Apr 2013 at 19:16.
Reply With Quote
  #120  
Old 01 Apr 2013, 14:45
rhody401's Avatar
rhody401 rhody401 is offline
 
Join Date: Feb 2012
Thank you thank you thank you!

I had to take out the first few characters on top, and it is case sensitive, but very workable for what i'm trying to fix. I will fix the calendar entries to be the correct case, so they get ignored.

It does work!

Rhody
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 22:57.

Layout Options | Width: Wide Color: