Previous Thread
Next Thread
Print Thread
Rate Thread
#318032 07/24/2009 8:24 AM
Joined: Sep 1999
Posts: 76
Power User
Power User
Offline
Joined: Sep 1999
Posts: 76
This custom island displays the last N number of public events from your Calendar. Clicking on the event's title takes you to forum post or calendar entry, depending on how the event was created.

The code for the custom island is attached. Configure the date format you wish to use along with the number of items to display in the header of the code.

Formatting of the island is controlled via two new CSS classes you need to create in your site's stylesheet (Styles > Extra Properties):

.event_item - applies to each event
.event_today - only applies to events occuring "today" (i.e. useful for highlighting)

The classes I've defined on my site are:

Code
.event_item {
padding-bottom: 5px;
}

.event_today {
font-weight: bold;
border-left: 4px solid red;
padding-left: 2px;
background-color: #ffd1d1;
}
and the results can be seen in the attached screenshot.

Version 2 Update
Added version 2 of the Events Island code with the following changes:
  • Only shows events from today onwards
  • List sorted in ascending order (i.e. nearest event on top)
  • Configurable display limit (set to 0 for no limit)


Version 3 Update
  • Display custom message if no future events found
Attachments
events_island_code.txt (1.8 KB, 21 downloads)
Events island code
SHA1: 75f2c761ec74a0e0b62a85b3163379982286988f
events_island.png (11.15 KB, 146 downloads)
events island screenshot
events_island_v2.png (6.01 KB, 93 downloads)
events island v2 screenshot
events_island_code_v3.txt (2.43 KB, 10 downloads)
Events Island code v3
SHA1: 8d30b590eb6a42e2787cd7c63531a47b4fb7d64b

Last edited by Myke; 10/26/2009 7:41 AM. Reason: added ver 3
Sponsored Links
Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
I like it; thanks Myke


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Joined: Oct 2007
Posts: 10
Newbie
Newbie
Offline
Joined: Oct 2007
Posts: 10
Neat neat neat - fantastically simple and effective idea


I don't do a lot, but i do do this
Joined: Jan 2000
Posts: 254
Likes: 4
Beta Tester
Beta Tester
Joined: Jan 2000
Posts: 254
Likes: 4
Will this work for external islands?
Meaning formatting and guests viewing?
And last question is how to modify it to post from the current day to future dates. Past dates would be useless for me.

Last edited by Ruben Rocha; 07/28/2009 3:31 PM.

There is no such thing as stupid questions.
Just stupid answers.
Joined: Mar 2007
Posts: 94
Power User
Power User
Joined: Mar 2007
Posts: 94
how do I get this to show the next event at the top of the list? reverse the order?

also..., it isn't showing any of the events for next month, first event it is listing is in october...?

Sponsored Links
Joined: Sep 1999
Posts: 76
Power User
Power User
Offline
Joined: Sep 1999
Posts: 76
Originally Posted by Ruben Rocha
Will this work for external islands?
Meaning formatting and guests viewing?
Sorry, but I'm not sure. I've never used an external island personally. Give it a try and see?

Quote
And last question is how to modify it to post from the current day to future dates. Past dates would be useless for me.
I've attached version 2 to the original post which does this.

That is, it shows the closest event to "today" at the top of the list, and all future events beneath it in chronological order.

I've also modified the code such that if you want no limit to the number of events showing, set the $eventTotal value to 0.

Joined: Sep 1999
Posts: 76
Power User
Power User
Offline
Joined: Sep 1999
Posts: 76
Originally Posted by badfrog
how do I get this to show the next event at the top of the list? reverse the order?
You may be interested in ver 2 of this mod which only shows events from "today" onwards (i.e. doesn't show any past events). I've updated the original post with new attachments.

Quote
also..., it isn't showing any of the events for next month, first event it is listing is in october...?

Are you sure you've created "public" events in the month of September? If so, then check that your $eventTotal value isn't too low.

Better yet, you might want to try ver 2 of the mod instead.

Joined: Mar 2007
Posts: 94
Power User
Power User
Joined: Mar 2007
Posts: 94
sweet! V2 is showing events in the correct order and is showing everything in my calendar.

nice work and ty for the effort!

Joined: Mar 2007
Posts: 94
Power User
Power User
Joined: Mar 2007
Posts: 94
ok... i just noticed that when I click on some of the events, it takes me to a random thread.. totally unrelated to the event posting.. am rebuilding posts and topics, etc, will see if that fixes it.

Joined: Mar 2007
Posts: 94
Power User
Power User
Joined: Mar 2007
Posts: 94
rebuilding didn't fix it... if I click on the event from teh event island, it takes me to some random post, if I go to the calendar and click on the event, it takes me to the correct listing.

Sponsored Links
Joined: Sep 1999
Posts: 76
Power User
Power User
Offline
Joined: Sep 1999
Posts: 76
Really sorry, but there was an error in the v2 code I attached.

It's now been fixed, so try again.

Joined: Mar 2007
Posts: 94
Power User
Power User
Joined: Mar 2007
Posts: 94
no need to be sorry!

ok, linking seems correct now..
BUT...
I have output set to 5, and it is showing me 16....

Joined: Sep 1999
Posts: 76
Power User
Power User
Offline
Joined: Sep 1999
Posts: 76
badfrog, ok try v2 again! I had mistakingly left off the limit handling in the query.

Note to self: Developing and posting from different computers without proper version control is always a bad idea smile

Myke #318163 08/23/2009 11:43 PM
Joined: Mar 2007
Posts: 94
Power User
Power User
Joined: Mar 2007
Posts: 94
ding ding ding ding!
we have a winner!

thanx Myke!

Joined: Sep 1999
Posts: 76
Power User
Power User
Offline
Joined: Sep 1999
Posts: 76
Updated to version 3 which will display a custom message when no events are found. Edit the $noEventsMsg variable in the code header as required.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
JAISP
JAISP
PA
Posts: 449
Joined: February 2008
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)