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! > Roster Links
Mottie (MVP) 4/8/2009 6:10 AM EST : Roster Links
GuildPortal MVP
Mottie
Posts: 3884
Zomgawsh Poster

Roster Links

This script is specifically for "Special Interest (None)" type guilds. They usually have members from many different games and the roster page is a little different. When you add a character to the roster, you can "Add a Character" which allows you to enter the character name and a "Home Page URL"



This results in a "link" that will take you to that site.



This script enables you to enter several links into the box above (when you add a character) which is then coverted into clickable icons.



Sadly, the input box is limited to 125 characters but you could possibly (I haven't tested this) add more using the "Characters & Settings" from the top bar, clicking the "Edit" button next to the name, then clicking on "Game Stats". You'll see the "Home Page URL" box again. Add or modify your links here.

The Code - Add this to a Free Form Text/HTML box on your Roster page
<script type="text/javascript">
$(document).ready(function(){
/********************************
This script replaces Home Page URL "link" in the Special Interest (none) type of guild roster
formats accepted:
- http://www.myspace.com/kiddkraddick,http://www.facebook.com/profile.php?id=48129544153,http://twitter.com/KiddKraddick
- ms:kiddkraddick,fb:48129544153,tw:KiddKraddick
*********************************/
 var newTitle = "Contact Links";

 // Don't Change Anything Below
 // **********************
 $("table[id*='grdRoster']").find("a:contains('Home Page URL')").html(newTitle);
 $("table[id*='grdRoster']").find("a:contains('link')").each(function(){
  var lnk = $(this).attr('href').split(',');
  for (j=0;j<lnk.length;j++){
   var img = " <img width='16' src='http://i201.photobucket.com/albums/aa236/Mottie1/testsite/icons/";
   var tmp = unAbbrev(lnk[j]);
   var icon = "link.gif'>";
   if (tmp.match('myspace')){ icon = "myspace.gif'>" }
   if (tmp.match('facebook')){ icon = "facebook.gif'>" }
   if (tmp.match('twitter')){ icon = "twitter.gif'>" }
   if (j==0) {
    $(this).attr('href',tmp).html(img+icon)
   } else {
    $(this).parent().append("<a href='" + tmp + "'>" + img + icon + "</a>");
   }
  }
 })
 function unAbbrev(t){
  var t2 = t.split(':');
  if (t2[0]=="ms") return "http://www.myspace.com/" + t2[1];
  if (t2[0]=="fb") return "http://www.facebook.com/profile.php?id=" + t2[1];
  if (t2[0]=="tw") return "http://twitter.com/" + t2[1];
  return t;
 }
})
</script>
Using the Code

  • You can replace the column header "Home Page URL" with whatever you want by modifying the text in red.

  • To make the links work, just add the URLs separated by a comma. I used "Kidd Kraddick" who is a radio celebrity as an example.

    http://www.myspace.com/kiddkraddick,http://www.facebook.com/profile.php?id=48129544153,http://twitter.com/KiddKraddick

    Notice there are no spaces and I used the full URL for each site. You may have to extract out this shorter versions of the links as they can get quite long.

  • If you start to run out of space, I've included a way to abbreviate the above links. So far it only works with myspace, facebook and twitter. I'll add more if you guys just tell me which others ones to add.

     Full Link Abbreviated Link 
     http://www.myspace.com/kiddkraddick ms:kiddkraddick
     http://www.facebook.com/profile.php?id=48129544153 fb:48129544153
     http://twitter.com/KiddKraddick tw:KiddKraddick

    So an abbreviated version of the line above (with full URLs) would be:

    ms:kiddkraddick,fb:48129544153,tw:KiddKraddick

    and of course you can mix and match the URLs...

    http://www.myspace.com/kiddkraddick,fb:48129544153,http://guildportal.com/Guild.aspx?GuildID=258012&TabID=2168223

TopBottom

Guppy Queen (New Admin) 4/8/2009 12:05 PM EST : RE: Roster Links
Guppy Queen
Posts: 41034
Zomgawsh Poster

Neat 


TopBottom

FrostmaneWar (New Admin) 4/8/2009 12:45 PM EST : RE: Roster Links
FrostmaneWar
Posts: 22
Becoming Adept!

This is very Nice.

Mottie is a Coding God.Thanks for Sharing 
TopBottom

Pythean (New Admin) 5/2/2011 5:48 PM EST : RE: Roster Links
Pythean
Posts: 209
Fingers of Fury!

Tried this today, works great apart from it still saying Home Page URL not Contacts List. Any ideas why?

Secondly, is it possible to assign this roster for a FFXI specific guild? ....because quite frankly the current one for FFXI is appallingly outdated and changing the guild association to the none specific one loses me some options in the event schedule.
TopBottom

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