Simple Links to the Armory

Miscellaneous code snippets and examples that members have posted

Simple Links to the Armory

Postby seleleth » Wed Apr 25, 2007 7:00 am

I realized that as I'm browsing through information on my guild's roster, I'm often doing a second lookup on Blizzard's armory to get a complete picture of a character build, spec, etc. And I thought, "Why not add a simple link for every character in my guild to Blizzard's armory listing?"

So I did.

I did this in two places: 1) Within the character view itself and 2) in the index listings (i.e., the front, "Stats", and "Honor" pages). I just did this quick and dirty--no configurable options, no alternate languages. If you want it, here you go. If you don't, don't do it. There's your configuration. :rabbit2:

NOTE: This was written around Roster 1.7.2, but may work with any Roster 1.7.x version.

To add links to the armory in character profiles

(demo here)

Edit memberdetails.php

Find the following around line 112:

Code: Select all
echo $menu_cell.$url.'&action=character">'.$wordings[$roster_conf['roster_lang']]['character'].' Stats</a></td>'."\n";


After add:

Code: Select all
echo $menu_cell.'<a href="http://armory.worldofwarcraft.com/character-sheet.xml?r='.$server.'&amp;n='.$name.'" target="_blank">Armory</a></td>'."\n";


To add links to the armory in member listings

(demo here)

Edit memberslist.php

Find the following around line 426:

Code: Select all
function name_value ( $row )
{
   global $wordings, $roster_conf, $guildFaction;


After add:

Code: Select all
$armorylink = $roster_conf['interface_url'].'Interface/Icons/INV_Box_01.'.$roster_conf['img_suffix'];
$armorylink = '<img class="membersRowimg" width="'.$roster_conf['index_iconsize'].'" height="'.$roster_conf['index_iconsize'].'" src="'.$armorylink.'" alt="Armory Profile">';
$armorylink = '<a href="http://armory.worldofwarcraft.com/character-sheet.xml?r='.$roster_conf['server_name'].'&amp;n='.$row['name'].'" target="_blank">'.$armorylink.'</a> ';


Find the following around line 453:

Code: Select all
return $tooltip.'<a href="char.php?name='.$row['name'].'&amp;server='.$row['server'].'">'.$row['name'].'</a></div>';


Change to:

Code: Select all
return $tooltip.$armorylink.'<a href="char.php?name='.$row['name'].'&amp;server='.$row['server'].'">'.$row['name'].'</a></div>';


Find the following around line 457:

Code: Select all
return $tooltip.$row['name'].'</div>';


Change to:

Code: Select all
return $tooltip.$armorylink.$row['name'].'</div>';


Find the following around line 464:

Code: Select all
return '<a href="char.php?name='.$row['name'].'&amp;server='.$row['server'].'">'.$row['name'].'</a>';


Change to:

Code: Select all
return $armorylink.'<a href="char.php?name='.$row['name'].'&amp;server='.$row['server'].'">'.$row['name'].'</a>';


Find the following around line 468:

Code: Select all
return $row['name'];


Change to:

Code: Select all
return $armorylink.$row['name'];


That's it!

FAQ

Q: Does my code suck?
A: Yes

Q: Should you laugh at my php skills?
A: Sure
Last edited by seleleth on Tue May 29, 2007 11:56 pm, edited 1 time in total.
User avatar
seleleth
Gimpy Developer
Gimpy Developer
 
Posts: 59
Joined: Thu Jul 06, 2006 10:26 pm
Location: Salt Lake City, UT

Simple Links to the Armory

Postby PleegWat » Wed Apr 25, 2007 3:31 pm

Looks decent to me.
I <3 /bin/bash
User avatar
PleegWat
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 1636
Joined: Tue Jul 04, 2006 1:43 pm

Re: Simple Links to the Armory

Postby daddelkopp » Wed Apr 25, 2007 3:33 pm

Works perfect :thumleft:

Guilds on Europe Servers must change:
Code: Select all
armory.worldofwarcraft.com

to
Code: Select all
armory.wow-europe.com


Thanks
daddelkopp
User avatar
daddelkopp
WR.net Journeyman
WR.net Journeyman
 
Posts: 99
Joined: Wed Jan 03, 2007 10:22 am

Simple Links to the Armory

Postby Rumik » Fri Jul 06, 2007 10:00 pm

GENIUS!!!
Rumik
WR.net Apprentice
WR.net Apprentice
 
Posts: 24
Joined: Fri Jun 15, 2007 2:18 pm

Simple Links to the Armory

Postby Gator81 » Mon Jul 09, 2007 3:50 am

This is great, ty for sharing the info and the ease of making the changes.
Gator81
WR.net Journeyman
WR.net Journeyman
 
Posts: 115
Joined: Fri Jun 01, 2007 4:44 am

Simple Links to the Armory

Postby secretone » Tue Jul 10, 2007 4:05 am

Very nice, works brilliantly.

Thank you

Secretone
Image
User avatar
secretone
WR.net Apprentice
WR.net Apprentice
 
Posts: 62
Joined: Wed Feb 28, 2007 6:33 pm
Location: Kent, UK

Re: Simple Links to the Armory

Postby Wyren » Tue Jul 10, 2007 4:14 pm

Very nice indeed, thanks!
Wyren
WR.net Journeyman
WR.net Journeyman
 
Posts: 81
Joined: Wed Jul 26, 2006 3:07 pm

Simple Links to the Armory

Postby vblars » Fri Jul 20, 2007 7:53 am

Very nice thanks Good work. :P
User avatar
vblars
WR.net Apprentice
WR.net Apprentice
 
Posts: 50
Joined: Tue Jul 04, 2006 1:52 pm

Simple Links to the Armory

Postby littleaton » Fri Jul 20, 2007 8:05 am

is there a way to change the name links to armory and not roster?
User avatar
littleaton
WR.net Apprentice
WR.net Apprentice
 
Posts: 21
Joined: Tue Jul 17, 2007 10:17 pm

Simple Links to the Armory

Postby Blueleaf » Sun Jul 29, 2007 11:47 pm

Very Nice, worked like a charm.

anyone have code or addon that displays a bag report like on RPGO Outfitter? if so could you share?
User avatar
Blueleaf
WR.net Apprentice
WR.net Apprentice
 
Posts: 50
Joined: Thu Apr 26, 2007 12:06 am
Location: Minot, ND


Return to Code Cache

Who is online

Users browsing this forum: No registered users and 0 guests

cron