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 : Pimp My Site! > Hide Comment link.
539934927_Inactive (New Admin) 9/9/2008 3:08 AM EST : Hide Comment link.

539934927_Inactive
Posts: 20
Becoming Adept!

I was surprized when I searched for this and didn't find. I want to hide the add comment link that goes under the news feed and the voting polls and what not. I don't have any need for them!

Anyone know how to make them go away?

TopBottom

Everdark (MVP) 9/9/2008 10:51 AM EST : RE: Hide Comment link.
GuildPortal MVP
Everdark
Posts: 3951
Zomgawsh Poster

When you enter or edit a News article, there is a box you can uncheck:

  Allow members to comment on this news item

"The person who says it cannot be done should not interrupt the person doing it." 

 
Everdark (T), Evadarr, Nevinn (AC), Soninn, Croninn, Zakarr, Avirded (SC)
TopBottom

539934927_Inactive (New Admin) 9/9/2008 5:53 PM EST : RE: Hide Comment link.

539934927_Inactive
Posts: 20
Becoming Adept!

That works for news! Great!

How about thumbnail gallery pictures?
Calender Entries?

I know there is some way to do a .hide command. Anyone know how that works?
TopBottom

Grymn (New Admin) 9/19/2008 2:24 AM EST : RE: Hide Comment link.
Grymn
Posts: 580
Zomgawsh Poster

I'd like to know how to do this for the quotes content box, as well.

Anyone?
TopBottom

Mottie (MVP) 9/19/2008 4:30 AM EST : RE: Hide Comment link.
GuildPortal MVP
Mottie
Posts: 3883
Zomgawsh Poster

I'll work on this when I get back... heading out for the weekend! Have a great one everybody!
TopBottom

Mottie (MVP) 10/6/2008 7:01 AM EST : Hide Comment links
GuildPortal MVP
Mottie
Posts: 3883
Zomgawsh Poster

Here ya go... sorry it took me so long 

Blackskull Clan Denboss asked about hiding the comments in thethumbnail gallery pictures... I couldn't find this at all. Could youtell me the type box and what you clicked on to get to this?

How to Hide Comments

You can just remove the portion of the script that hides comment links you want to keep. Add the code to your header or footer area.

The Code
<script type="text/javascript">
$(document).ready(function() {
var temp;
 $("a").each(function() {
  temp = ($(this).attr("href") == null) ? " " : $(this).attr("href");

// Hide Calendar Event Comment
  if ($(this).attr("id").match("_lnkAddComment")) {
   $(this).css("display","none")
  }


// Hide Quote Comments
  if (temp.match("Comments.aspx") && temp.match("QUOTESSML")) { hideComments($(this)) }


// Hide Voting Poll Comments
  if (temp.match("Comments.aspx") && temp.match("GUILDPOLL")) { hideComments($(this)) }


// Hide Info Section Comments
 $(document).bind('reveal.facebox', function() {
  $("#facebox").find("a").each(function() {
   if ($(this).attr("target").match("_commentWindow")) { hideComments($(this)) }
  });
 });


  function hideComments (x) {
   x.css("display","none");
   x.parent().html( x.parent().html().replace("[","").replace("]","") );
  }
 });
});
</script>
Customizing
  • Removing the colorized portion of the script will keep your commenting functionality for that type of box. Remove it or comment it out (using double slashes "//" at the beginning of the line)

    • Calendar Events - this portion is in teal,  it only removes the "Add Comments" link.

    • Quotes - this portion is in blue, it removes the "[ x Comments ]" from the Quotes box only.

    • Voting - this portion is in purple, it removes the "[ x Comments ]" from the Voting Polls box only.

    • Info Section - this portion is in green, it removes the "[ x Comments ]" from ALL popup boxes (facebox).


How to Open Comments in a popup window

This script changes all comment links to open a popup window instead ofa new tab/window. This includes the information box window (facebox).Add the code to your header or footer area.

The Code
<script type="text/javascript">
$(document).ready(function() {
 $("a").each(function() {
  if ($(this).attr("target").match("_commentWindow")) { makePopupWindow($(this),'_commentWindow',600,300); }
 });
 $(document).bind('reveal.facebox', function() {
  $("#facebox").find("a").each(function() {
   if ($(this).attr("target").match("_commentWindow")) { makePopupWindow($(this),'_commentWindow',600,300); }
  });
 });
 function makePopupWindow (linkEl,pName,pWidth,pHeight) {
  var temp = "toolbar=0,status=0,resizable=1,scrollbars=1,width=" + pWidth + ",height=" + pHeight;
  linkEl.click (function(){
   var w = window.open (linkEl.attr("href"),pName,temp);
   w.focus();
   return false;
  });
 }
});
</script>
Customizing
  • There isn't a lot to change in this code.

  • If you want to adjust the pop up window size, change the width and height in the code above (in red). Default width is 600 pixels and height is 300 pixels.

  • The popup window is made resizable and will have scroll bars because of the code in blue above. Remove this if you want to remove the scrollbars. (0 = off, 1 = on).
Edit (10/9/08): Added a portion to remove info section comments.
Edit (10/10/08): Added the "How to Opent Comments in a popup window" section.
Edit (10/10/08): Added text to make the popup window have scroll bars 
TopBottom

Avandius (New Admin) 10/8/2008 9:02 AM EST : RE: Hide Comment links
Avandius
Posts: 337
Fingers of Fury!

While on this topic, any idea how to add the rel="facebox" to a comment link? Or at least make it pop up in a new smaller window, around 600px width.
TopBottom

Mottie (MVP) 10/10/2008 5:30 AM EST : Hide or popup comment links
GuildPortal MVP
Mottie
Posts: 3883
Zomgawsh Poster

Hi Avandius!

I've figured out and updated the post above on how to hide comments or make them popup in a new window. It's been tested on FF, IE and Chrome.

The only thing I wasn't able to do was to add a note inside the popup window as to what section you're commenting on.
TopBottom

Avandius (New Admin) 10/10/2008 7:40 AM EST : RE: Hide or popup comment links
Avandius
Posts: 337
Fingers of Fury!

You've just built half my site!

Question, is it possible to add a scroll bar to this window? Right now if you have many comments you cant scroll down without dragging the text. Also is it possible to make it appear in a facebox rather than window?

Woot! Thanks again!
TopBottom

Mottie (MVP) 10/10/2008 7:58 AM EST : RE: Hide or popup comment links
GuildPortal MVP
Mottie
Posts: 3883
Zomgawsh Poster

Added to the script above... all I added was the text in blue.
TopBottom

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