Sign Up! Login: Password: New User? Forgot? Support
Code 
 
 
Forums 
Forums : Calendar & Events > Events Widget - Hiding Elements
Mottie (SuperAdmin) 1/25/2010 1:50 PM EST : Events Widget - Hiding Elements
ACK!
Mottie
Posts: 3884

0
Like

0
Dislike

Events Widget - Hiding Elements

GuildPortal admin site link to the original post

This script does two things:
  1. Hide events that are X number of months in the future
  2. Hide the user that added the event (optional)
Note: I've been trying to make it easier for people to add code to their site, so you'll be seeing a lot less code in the future.

Before After

Code

Add this code to a Free Form Text/HTML widget on the same page as the event widget (while the editor is in BOTH <> HTML & Raw/Script mode) or to the Footer Area (less preferred)
<script type="text/javascript" src="http://www.axiomfiles.com/Files/258012/events-posts-min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
 hideNewEvents({
  hideNewMonths: 3,   // hide events more than x # of months in the future
  hideUser:      true // hide the user that added the event
 });
})
</script>
Customizing

  • Select the number of months of events to show in the event widget. Selecting a larget number will not add more events to the widget, this script only works with what is already shown and modifies the contents. The "hideNewMonths" variable (in red) sets the number of months to show in the widget.
    hideNewMonths: 3,
  • To hide the user's name that added the event, set the "hideUser" variable to true (in red). Setting this variable to false will stop the script from modifying the default widget display.

Edit (2/4/2010): Added a note to make sure the editor is in <> HTML mode and Raw/Script mode when adding the code.
Edit (3/17/2010): Updated the code to work with the change in layout of the event widget. Also, reduced the size of the file making it "events-posts-min.js".
Characters: Mottie Motty Mortie Ooshiny Mot Fudgems
TopBottom

 
 
Key 
New posts No new posts
New posts ( popular ) No new posts ( popular )
New posts ( sticky ) No new posts ( sticky )
New posts ( locked ) No new posts ( locked )
 
 
Who's Online 
There are   members online.
 
 
So-and-so has logged on!
%title%
%message%