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! > Calendar Event Signups
Mottie (MVP) 2/26/2010 3:49 PM EST : RE: Calendar Event Signups (Vanguard)
GuildPortal MVP
Mottie
Posts: 3883
Zomgawsh Poster

LOTRO | Vanguard | WoW

Calendar Event Signups - Vanguard version

This script modifies your calendar event signups so that it includes the class (text or icon, taken straight from the roster page) and character level to make it easier for raid planners to better determine their needs. I've included before and after screenshots below (with text or icons).

People who are not listed in the guild roster will have an unknown class and level (displayed as a question mark).

The Code
<!--
************************************
Calendar Event Signups
-= Add character Level & Class =-
************************************ -->
<div id="tmproster" style="display:none"></div>
<script type="text/javascript">
var rosterPage = 'http://guildportal.com/... myGuildRosterPage';
var addIcons = true;
var iconWidth = 24;
var iconHeight = 24;
var iconRootURL = 'http://www.axiomfiles.com/Files/278466/icon_Vanguard_';

// ***************************
// Don't change anything below
// ***************************
var cn,loc,lvl,cls,clsu,t;
$(document).ready(function(){
// rosterPage = rosterPage.substring(rosterPage.lastIndexOf('/Guild.aspx'),rosterPage.length);
 $('#tmproster').load(rosterPage + ' table[id*=grdRoster]',updateClass);
})
function updateClass(){
 // make all names lower case
 $('#tmproster').find('table[id*=grdRoster]').find('tr').each(function(){
  $(this).find('td:eq(0) a').text( $(this).find('td:eq(0) a').text().toLowerCase() );
 })
 if (addIcons) {
  cls = 'Class';
 } else {
  cls = '';
 }
 // Add columns
 $('div[id*="_signupsHolder"]')
  .find('tr.ContentBoxTitle td:eq(0)').attr('colspan','7').end()
  .find('tr:gt(0)').each(function(){
   $(this).find('td:eq(1)')
    .before('<td class="cclass" valign="middle" align="center"></td>')
    .after('<td class="clvl" align="center"></td>');
  })
 // Add header info
  .end().find('.cclass:eq(0)').html(cls)
  .end().find('.clvl:eq(0)').html('Level');
 // Add info to signups
 $('div[id*="_signupsHolder"]').find('.NormGridRow,.AltGridRow').each(function(){
  cn = $(this).find('td:eq(2) a').text().toLowerCase();
  loc = $('#tmproster').find('a[title*="view this character"]:contains("' + cn + '")').closest('tr');
  if (loc.length > 1) loc = getExactName(loc,cn);
  lvl = (loc.length && loc.find('td:eq(3)').text().replace(/\xa0/g,'')!='') ? loc.find('td:eq(3)').text() : '?';
  if (addIcons) {
   cls = (loc.length) ? loc.find('td:eq(2)').text() : '';
   clsu = (cls.replace(/\xa0/g,'')=='') ? 'http://www.axiomfiles.com/Files/278466/icon_unknown.gif' : iconRootURL + cls + '.gif';
   t = '<img class="tooltip" width="' + iconWidth + '" height="' + iconHeight + '" title="';
   t += (cls.replace(/\xa0/g,'')=='') ? 'Unknown' : cls;
   t += '" src="' + clsu + '">';
   $(this).find('.cclass').html(t);
  } else {
   cls = (loc.length && loc.find('td:eq(2)').text().replace(/\xa0/g,'')!='') ? loc.find('td:eq(2)').text() : '?';
   $(this).find('td:eq(2)').append(' <span class="loClass">(' + cls + ')</span>');
  }
  $(this).find('.clvl').html(lvl);
 })
}
function getExactName(el,en){
 for (var j=0; j < el.length; j++){
  if ($(el[j]).find('td:eq(0) a').text().toLowerCase() == en) return $(el[j])
 }
}
</script>
Customizing
  • You must replace the "rosterPage" variable to point to your guild site's roster page (replace the URL in orange)

    var rosterPage = 'http://guildportal.com/... myGuildRosterPage';

  • Choose to include icons in the signup by setting the "addIcons" variable to true. If false, it will display the class as text.

    var addIcons = true;

  • If using icons, you can set their height and width with the "iconWidth" and "iconHeight" variables.

    var iconWidth = 24;
    var iconHeight = 24;

  • It really shouldn't be necessary to use the CSS classes I added, but if you want to adjust the background color or size of those columns or text, you can add the following classes to your stylesheet:

    .cclass {  }  /* character class (icon wrapper) */
    .loClass { } /* class text (includes parenthesis) */
    .clvl { }       /* character level text */
*NOTE* If you have a different game that you would like to do this on, please message me...

Edit (2/26/2010): Fixed the code to work in IE.
TopBottom

Keilana55 (Guild Admin) 2/26/2010 4:58 PM EST : RE: Calendar Event Signups (Vanguard)
Keilana55
Posts: 4537
Zomgawsh Poster

This is wonderful Mottie!  A thousand Thanks!

TopBottom

Keilana55 (Guild Admin) 2/26/2010 5:40 PM EST : RE: Calendar Event Signups (Vanguard)
Keilana55
Posts: 4537
Zomgawsh Poster

Mottie,

Several members are saying that it locks or freezes and has a long loading time with the new roster add ons.  Is there something that I or they can do to remedy that?  Some are seeing red X or a torn paper icon rather than the proper icons that they should see.  I see everything fine.  Loading is a little longer, but not too very much so.  I am using Mozilla if that matters for anything.

TopBottom

Mottie (MVP) 2/26/2010 6:26 PM EST : RE: Calendar Event Signups (Vanguard)
GuildPortal MVP
Mottie
Posts: 3883
Zomgawsh Poster

Hi Keilana55!

I fixed the problem that only seemed to occur in IE. There shouldn't be anymore missing image icons. I've also noticed that IE seems to take a lot longer than any other browser to process the script - the same thing occurs with my GP CSS Styling Bookmarklet I wrote (it's waaayyyy slower in IE). I don't know how to fix this other than say, get a better browser?

Oh to update your code, just replace everything below the "//  Don't change anything below" comment.
TopBottom

Keilana55 (Guild Admin) 2/26/2010 9:52 PM EST : RE: Calendar Event Signups (Vanguard)
Keilana55
Posts: 4537
Zomgawsh Poster

Thanks!

TopBottom

shadowstts (Guild Admin) 4/29/2010 1:07 PM EST : RE: Calendar Event Signups (Vanguard)
shadowstts
Posts: 364
Fingers of Fury!

this isnt workign any more since gp updated today all it is is ? in sted of level and class

Asylum RULES!

TopBottom

Mottie (MVP) 4/29/2010 4:31 PM EST : RE: Calendar Event Signups (Vanguard)
GuildPortal MVP
Mottie
Posts: 3883
Zomgawsh Poster

shadowstts said:
this isnt workign any more since gp updated today all it is is ? in sted of level and class
It'll have to wait until I can upload the roster data to my help site for testing, or if you are willing to make your roster and calendar page viewable by the public.
TopBottom

shadowstts (Guild Admin) 4/30/2010 1:26 PM EST : RE: Calendar Event Signups (Vanguard)
shadowstts
Posts: 364
Fingers of Fury!

wish i could motie but we have enemys ^^ and if they new wat our guild was doing it could be bad for us lol (like hacking our vent wile we raid kind of thing)

Asylum RULES!

TopBottom

Mottie (MVP) 4/30/2010 3:23 PM EST : RE: Calendar Event Signups (Vanguard)
GuildPortal MVP
Mottie
Posts: 3883
Zomgawsh Poster

Hi Shadowstts!

Ok the original post has been updated to work with the WoW Auto Roster, just replace the script below the "Don't change anything below" comment. Sorry it took so long.
TopBottom

Mottie (MVP) 5/5/2010 11:09 AM EST : RE: Calendar Event Signups (Vanguard)
GuildPortal MVP
Mottie
Posts: 3883
Zomgawsh Poster

I've updated the LOTRO signups by adding a table sorter to the event page. This allows you to sort multiple columns at once. I've also included the code to hide the role being filled column.
TopBottom

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