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! > Who's Online?
Guppy Queen (New Admin) 4/8/2009 11:58 AM EST : Who's Online?
Guppy Queen
Posts: 41034
Zomgawsh Poster

Is there a script where it will make all the names in Who's Online in one line (with the mail icon included)? Instead of stacked.

http://img56.imageshack.us/img56/7505/picture3q.jpg

http://img56.imageshack.us/img56/4203/picture4s.jpg
TopBottom

Mottie (MVP) 4/10/2009 6:34 PM EST : RE: Who's Online?
GuildPortal MVP
Mottie
Posts: 3883
Zomgawsh Poster

Hi Guppy!

I wrote this script to do just what you wanted. I've also included a way to turn the mail icons on and off in case you don't want them to show.

Modifying the Who's Online Content Box

Online Box
(no icons)
Online Box
(w/ icons)

The Code

<script type="text/javascript">
$(document).ready(function() {
 var findOnlineBox = "Online";
 var includeMailIcon = true;

// ********************************
// Don't change anything below this line
// ********************************
 $('.ContentBox').each(function(){
  var bx = $(this);
  if ($(this).find('.ContentBoxTitle').text().match(findOnlineBox)){
   bx.find('.ContentTable').parent().prepend("<div id='onlineList'></div>");
   var newbx = bx.find("#onlineList");
   var txt = '';
   bx.find('.ContentTable').css('display','none').find('tr').each(function(){
       var tmp = $(this).find('td:eq(0) img').attr('alt').replace(/Send/,'').replace(/ a private message/,'');
    if (includeMailIcon){
     $(this).find('td:eq(0) a').append(tmp);
    } else {
     $(this).find('td:eq(0) a').html(tmp);
    }
    txt += $(this).find('td:eq(0)').html().replace(/&nbsp;/,'') + ', ';
   })
   newbx.html(txt.substring(0,txt.length-2));
  }
 })
})
</script>
Customizing the Code

  • Change the variable to match the title you have on your "Who's Online" content box.

    var findOnlineBox = "Online";

    For Guppy Queen, you just need to change this to "Holo-filming"... the text is case-sensitive.

  • Include the mail icon with the name by setting the "includeMailIcon" variable to true

     var includeMailIcon = true;

  • Add the code to your header HTML, footer, or to any available Free Form Text/HTML box on the page where you have your "Who's Online" box.
TopBottom

Guppy Queen (New Admin) 4/10/2009 7:14 PM EST : RE: Who's Online?
Guppy Queen
Posts: 41034
Zomgawsh Poster

Your the best Mottie

Thank you
TopBottom

Mottie (MVP) 4/24/2009 1:29 AM EST : RE: Who's Online?
GuildPortal MVP
Mottie
Posts: 3883
Zomgawsh Poster

RedRydur discovered that editing the content of the Who's online box gives you an option to make the list comma delimited... So you don't need to use this code!
TopBottom

Guppy Queen (New Admin) 4/24/2009 2:38 AM EST : RE: Who's Online?
Guppy Queen
Posts: 41034
Zomgawsh Poster

I saw this Mottie, but I don't like it. What that does it make all of the Who's Online comma deleted. With your script I can only do that to certain content pages and still keep the mail style on other content pages.
TopBottom

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