Sign Up! Login: Password: New User? Forgot? Support
Top Mods!
Wowhead Search
by sonofsamedi
Digital Clock
by Wolfar15
Admin Forums
Welcome to the GuildPortal Help Community! These forums are for admin-to-admin help.
Available Forums
Forums : Voodoo Tech and Scripter's Den of Scriptniquity > Events Widget - Hiding Elements
Mottie (MVP) 1/25/2010 1:48 PM EST : Events Widget - Hiding Elements
GuildPortal MVP
Mottie
Posts: 3883
Zomgawsh Poster

Events Widget - Hiding Elements

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".
TopBottom

Aggrehstix (New Admin) 3/27/2010 1:16 PM EST : RE: Events Widget - Hiding Elements
Aggrehstix
Posts: 182
Posts With Wolves

I want to hide the legend and the most recent post section on my forums.

The reason I want to do this is because it shows up when I create multiple forums on my main forum page. 

example:

Forums page
->Recruitment Forum
        ->application
                                 
                                   
->Officer Forum
        ->officer phone numbers
        ->general discussions
                                  
                                   
->General Forum
        ->general discussions
        ->pvp discussions
        ->pve discussions
                                  
                                   


now in between each forum page (the section highlighted in yellow) displays an "Icon Legend for Forums" section and "Most Recent Posts" section as well.

I want all of these to be removed.
TopBottom

Mottie (MVP) 3/27/2010 4:27 PM EST : RE: Events Widget - Hiding Elements
GuildPortal MVP
Mottie
Posts: 3883
Zomgawsh Poster

Hi Aggrehstix!

You can actually hide those sections using CSS. Add the following CSS to your control panel (Control Panel > Custom HTML & Script > Custom CSS > CSS Additions to Standard)
#ctl00_ContentPlaceHolder1_ctl01_pnlMostRecent, #ctl00_ContentPlaceHolder1_ctl01_pnlForumLegend { display: none; }
TopBottom

Aggrehstix (New Admin) 3/27/2010 7:15 PM EST : RE: Events Widget - Hiding Elements
Aggrehstix
Posts: 182
Posts With Wolves

This does not seem to be working.  I went in as you told me I copied and pasted.  I also split them to create two lines of code like you have.  I checked off enable and i unchecked it and neither option worked.


Also could you include the code to hide the search bar as well please.

Thank you for your assistance.
TopBottom

Mottie (MVP) 3/28/2010 9:44 AM EST : RE: Events Widget - Hiding Elements
GuildPortal MVP
Mottie
Posts: 3883
Zomgawsh Poster

Hi Aggrehstix!

Weird, I posted an answer here earlier and I actually saw it here, but now it's gone

Anyway, I forgot since you have multiple copies of your forums that the ID of each copy will be different. Actually, I'm not sure how you got three different copies to show different content without using some scripting.

Since I can't see your forum page since it's not visible to public, so I will tell you how to change the CSS below to work...
  • Go to your forum page, then use the browsers view source. Use Ctrl-F to find each of the following (there should be 3 copies): "pnlMostRecent", "pnlForumLegend" and "pnlForumSearchForm"

  • When you find the ID in the source, modify the ID in the CSS below to match what you find. I'm not sure if the first, second or both IDs in red will change, but just make sure it matches.

    #ctl00_ContentPlaceHolder1_ctl01_pnlMostRecent,
    #ctl00_ContentPlaceHolder1_ctl01_pnlForumLegend,
    #ctl00_ContentPlaceHolder1_ctl01_pnlForumSearchForm,
    #ctl00_ContentPlaceHolder1_ctl01_pnlMostRecent,
    #ctl00_ContentPlaceHolder1_ctl01_pnlForumLegend,
    #ctl00_ContentPlaceHolder1_ctl01_pnlForumSearchForm,
    #ctl00_ContentPlaceHolder1_ctl01_pnlMostRecent,
    #ctl00_ContentPlaceHolder1_ctl01_pnlForumLegend,
    #ctl00_ContentPlaceHolder1_ctl01_pnlForumSearchForm { display: none; }

  • Paste your completed CSS into the CSS Additions to Standard tab
TopBottom

Aggrehstix (New Admin) 3/28/2010 8:59 PM EST : RE: Events Widget - Hiding Elements
Aggrehstix
Posts: 182
Posts With Wolves

Awesome It worked thank you sooo much.


Ok now I am running into an issue where I want my Different forum sections to display different forums.

I have a:

Recruit Forum
Officer Forum
General Forum


I want each of these forums to have their own categories/forum subjects posted within.  Is this not possible.  Because when I create in my control panel and place a General Forums Widget, Recruitment Forums Wiget, and Officers Forum Widget all the posted categories are copied to the other forum widgets.  I dont want them to share the same information I want different information posted in each forum section.


by the way i set forums to be public for now.

TopBottom

Mottie (MVP) 3/28/2010 9:33 PM EST : RE: Events Widget - Hiding Elements
GuildPortal MVP
Mottie
Posts: 3883
Zomgawsh Poster

Hi Aggrehstix!

GuildPortal isn't set up to allow you to add three forum widgets on the same page and contain different information. If you want to have 3 different forums, you could set up 3 forum groups from the edit button at the bottom of the forum widget.
TopBottom

Aggrehstix (New Admin) 3/29/2010 2:33 AM EST : RE: Events Widget - Hiding Elements
Aggrehstix
Posts: 182
Posts With Wolves

Ok thank you for all of your assistance.
TopBottom

Admins Online
There are   members online.
So-and-so has logged on!
%title%
%message%