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
Valdaglerion (Guild Admin) 5/8/2010 5:56 PM EST : RE: Calendar Event Signups (LOTRO)
Valdaglerion
Posts: 2473
Zomgawsh Poster

The recent changes to allow multiple column sorting are great.  Thanks Mottie!
TopBottom

Mottie (MVP) 6/1/2010 11:54 PM EST : RE: Calendar Event Signups
GuildPortal MVP
Mottie
Posts: 3884
Zomgawsh Poster

Added a second version to work with the WoW XML/XSL roster.
TopBottom

Valdaglerion (Guild Admin) 7/12/2010 2:36 AM EST : RE: Calendar Event Signups
Valdaglerion
Posts: 2473
Zomgawsh Poster

The LotRO version of this seems to be broken again.  Sent you an email Mottie. 
TopBottom

Mottie (MVP) 7/12/2010 9:00 AM EST : RE: Calendar Event Signups
GuildPortal MVP
Mottie
Posts: 3884
Zomgawsh Poster

Fixed
TopBottom

Mottie (MVP) 5/28/2011 12:45 PM EST : Calendar Event Signups - Rift
GuildPortal MVP
Mottie
Posts: 3884
Zomgawsh Poster

Calendar Event Signups - Rift

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).

Before
After



The Code
<!--
************************************
Calendar Event Signups - Rift
-= Add character Level & Class =-
************************************ -->

<style type="text/css">
th.header {
 color: #fff;
 background: #354250 url(http://i201.photobucket.com/albums/aa236/Mottie1/testsite/icons/sort-white.gif) left center no-repeat;
 cursor: pointer;
 font-weight: bold;
 text-align: center;
 padding-left: 10px;
 border-right: 1px solid #000;
}
th.headerSortUp { background: #400000 url(http://i201.photobucket.com/albums/aa236/Mottie1/testsite/icons/asc-white.gif) left center no-repeat; }
th.headerSortDown { background: #804000 url(http://i201.photobucket.com/albums/aa236/Mottie1/testsite/icons/desc-white.gif) left center no-repeat; }
.hide {display:none;}
</style>
<div id="tmproster" style="display:none"></div>
<script type="text/javascript" src="http://www.guildportal.com/Cms/jquery.tablesorter.min.js"></script>
<script type="text/javascript">
var rosterPage = 'http://guildportal.com/... myGuildRosterPage';
var addIcons = true;
var hideRole = false;
var hideSignedUp = false;
var iconWidth = 24;
var iconHeight = 24;
var isUnknown = '?'; // if unknown, this is added to the spot

// ***************************
// Don't change anything below
// ***************************

// add containsExact selector
$.extend($.expr[':'],{
 containsExact: function(a,i,m){
  return $.trim(a.innerHTML.toLowerCase()) === m[3].toLowerCase();
 }
});
$(document).ready(function(){
 rosterPage = rosterPage.substring(rosterPage.lastIndexOf('/Guild.aspx'),rosterPage.length);
 $('#tmproster').load(rosterPage + ' #tblDumpRosterRift',updateClass);
 if (hideRole) {
  // hide Role selector during signup
  $('select[id*="ddlCharacterRole"]').hide()
  .closest('table').find('td:contains("Role Being Filled")').empty();
 }
});
function updateClass(){
 var gp,cn,cls,loc,lvl, t = '',
  tmproster = $('#tmproster'),
  signups = $('div[id*="_signupsHolder"] table'),
  bxtitle = signups.find('tr:first'),
  trow = '<div class="ContentBoxTitle"><td>' + bxtitle.html() + '</div>';
  bxtitle.remove();
 // adjust table to make tablesorter work
 signups
  .before(trow)  // move title row
  .find('tbody').before('<thead></thead>')
  .find('tr:eq(0)').find('td').each(function(){
   cn = $(this).text();
   t += ( cn == '' ) ? '<td></td>' : '<th>' + cn + '</th>';
  }).end().remove();
 signups
  .find('thead').append('<tr>' + t + '</tr>').end()
  // add new columns
  .find('tr').each(function(){
   $(this).find('td:eq(1)')
   .before('<td class="cclass" valign="middle" align="center"></td>')
   .after('<td class="clvl" align="center"></td>');
  }).end()
  // Add header info
  .find('thead th:eq(1)')
   .before('<th class="cclass">Class</th>')
   .after('<th class="clvl">Level</th>');
  if (hideRole) { signups.find('thead').find('th:eq(4)').hide(); }
  if (hideSignedUp) { signups.find('thead').find('th:eq(5)').hide(); }
  // disable hover over rows, because it changes depending on sort
//  signups.find('.NormGridRow, .AltGridRow').unbind('mouseover mouseout');

 tmproster.find('td:nth-child(2)').each(function(){
  $(this).prepend('<span class="riftnames">' + $.trim($(this).text()) + '</span>');
 });

  // Add info to signups
 signups.find('.NormGridRow,.AltGridRow').each(function(){
  gp = $(this).find('td:eq(0) a').text();
  cn = $(this).find('td:eq(0) span > span').text().replace(/(\s\(as\s|\))/g,''); // remove (as ...)
  cn = (cn === '') ? gp : cn; // if cn = gp then it's not added "(as ...)"
  loc = tmproster.find('.riftnames:containsExact("' + cn + '")').parent().parent();
  lvl = (loc.length) ? loc.find('td:eq(2)').text() : isUnknown;
  cn = loc.find('td:eq(3)').text();
  if (addIcons) {
   cls = (loc.length) ? loc.find('td:eq(0)').html() + '<span style="display:none">' + cn + '</span>' : '';
   $(this).find('.cclass').html(cls).find('img').attr({'width':iconWidth,'height':iconHeight});
  } else {
   cls = (loc.length) ? cn : isUnknown;
   $(this).find('td:eq(1)').append(' <span class="loClass">' + cls + '</span>');
  }
  $(this).find('.clvl').html(lvl);
  if (hideRole) { $(this).find('td:eq(4)').hide(); }
  if (hideSignedUp) { $(this).find('td:eq(5)').hide(); }
 });
 signups.tablesorter({
  textExtraction: function(node) {
   return $(node).text();
  },
  sortList: [[2,0],[4,0]],
  widgets: ['zebra'],
  widgetZebra: {css: ["NormGridRow","AltGridRow"]}
 });
};
</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...
TopBottom

Fogy (New Admin) 6/5/2011 12:29 AM EST : RE: Calendar Event Signups

Fogy
Posts: 45
Becoming Adept!

What would prevent the icons and Level from showing up?  I'm getting ? for all attendees.

To verify, should my rosterPage look like this?
TopBottom

Mottie (MVP) 6/7/2011 10:10 AM EST : RE: Calendar Event Signups
GuildPortal MVP
Mottie
Posts: 3884
Zomgawsh Poster

Hi Fogy!

I didn't update the wow calendar event code for the new roster until just now, so update your code from this post
TopBottom

Nykeawyn (New Admin) 6/23/2011 6:59 PM EST : RE: Calendar Event Signups
Nykeawyn
Posts: 246
Fingers of Fury!

I'm having the hardest time with this.  I am a complete noob so please be patient.  I copy the whole script into an HTML widget and change the roster part to my guild roster url like it says, but when I save, nothing happens and when I look at the script, the most that is posted is is down to:

script type="text/javascript" src="http://www.guildportal.com/Cms/jquery.tablesorter.min.js"></script

and nothing more. 

Any help at all would be appreciated!!!
TopBottom

Nykeawyn (New Admin) 6/26/2011 10:20 AM EST : RE: Calendar Event Signups
Nykeawyn
Posts: 246
Fingers of Fury!

Hey Mottie, the new script works great.  The only issue I am having is that the level is being Duplicated.  Can't quite figure out why.  I have highlighted the issue in Red.  Any help would be appreciated!!

vonotterskull (as Hardiborn) Confirmed ? 6/22/2011 10:31 PM Attended: DKP: update
Nykeawyn (as Nykearoxx) Confirmed 6565 6/22/2011 10:31 PM Attended: DKP: update
Atthos85 (as Atthos) Confirmed ? 6/22/2011 10:49 PM Attended: DKP: update
Biagrin (as Tjolinr) Confirmed 6565 6/23/2011 5:48 PM Attended: DKP: update
Arwn Confirmed 4848 6/24/2011 9:44 AM Attended: DKP: update

No drops were entered for this event.
TopBottom

Mottie (MVP) 6/26/2011 5:18 PM EST : RE: Calendar Event Signups
GuildPortal MVP
Mottie
Posts: 3884
Zomgawsh Poster

Hi Nykeawyn!

Try removing the line that doesn't point to a real roster:
rosterPage.push('http://guildportal.com/... myAllyGuildRosterPage');
If that doesn't work, then please make your roster page visible to public so I can get a better look at the problem.
TopBottom

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