Adding link to armory page in member list?

Here you can find plenty of help with your general coding needs and projects
If it is about a specific program, use the corresponding forum
DO NOT ask basic questions such as "How do I print a variable", use Google for that

Adding link to armory page in member list?

Postby Ymryl » Mon Mar 12, 2007 4:51 pm

I'm wondering just how difficult it would be to add an image link to the member list. Perhaps appearing next to the character name. I got the idea while looking at a modification an individual made to his EQDKP page here.

He has a small image followed by the string link "Armory Profile", linking to that characters armory page. I think the link would be better on the roster page just using the image to link (no string needed). This would allow everyone easy access to that characters profile, especially if the lazy member hasn't bothered to update their Roster profile on the website (an issue I'm sure we all have).

Anyone have any insight before I start hacking at it?
Last edited by Ymryl on Mon Mar 12, 2007 4:52 pm, edited 1 time in total.
User avatar
Ymryl
WR.net Apprentice
WR.net Apprentice
 
Posts: 38
Joined: Mon Jul 17, 2006 11:45 pm
Location: RI, USA

Adding link to armory page in member list?

Postby PleegWat » Mon Mar 12, 2007 5:57 pm

The easiest way might well be adding an extra column after name, setting a value function for that, and creating the linking icon in that function.

You need to add something like this on index.php, on the place where you want the column added (so probably between name and class)

Code: Select all

$FIELD
[] = array (
    
'armory' => array(
        
'lang_field' => 'Arm'// Text to appear in the title. It'll use this string if you don't add a line to the enUS.php
        
'value' => 'armory_link',
    ),
);
 


Then at the bottom of memberslist.php, add a value function like this:
Code: Select all
function armory_link($row)
{
    return 
'The html for the armory link';
}
 
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

Adding link to armory page in member list?

Postby Ymryl » Mon Mar 12, 2007 6:38 pm

I ended up modifying the name_value($row) function in memberslist.php instead so that I didn't need an extra column. It took two additional lines and a modification of the "return" lines to include the new link-icon (I stuck the image in img/Interface/Icons/):

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

   $icon_name = 'Interface/Icons/Armory';
   $icon_value = '<a href="http://armory.worldofwarcraft.com/#character-sheet.xml?r=Medivh&n='.$row['name'].'" target="_blank"><img class="membersRowimg" width="16" height="16" src="'.$roster_conf['interface_url'].$icon_name.'.'.$roster_conf['img_suffix'].'" title="Link to WoW Armory Profile" alt="" /></a> ';

   if( $roster_conf['index_member_tooltip'] )
   {
      $tooltip_h = $row['name'].' : '.$row['guild_title'];

      $tooltip = 'Level '.$row['level'].' '.$row['class']."\n";

      $tooltip .= $wordings[$roster_conf['roster_lang']]['lastonline'].': '.$row['last_online'].' in '.$row['zone'];
      $tooltip .= ($row['nisnull'] ? '' : "\n".$wordings[$roster_conf['roster_lang']]['note'].': '.$row['note']);

      $tooltip = '<div style="cursor:help;" '.makeOverlib($tooltip,$tooltip_h,'',1,'',',WRAP').'>';

      if ( $row['server'] )
      {
         return $tooltip.$icon_value.'<a href="char.php?name='.$row['name'].'&amp;server='.$row['server'].'">'.$row['name'].'</a></div>';
      }
      else
      {
         return $tooltip.$icon_value.$row['name'].'</div>';
      }
   }
   else
   {
      if ( $row['server'] )
      {
         return $icon_value.'<a href="char.php?name='.$row['name'].'&amp;server='.$row['server'].'">'.$row['name'].'</a>';
      }
      else
      {
         return $icon_value.$row['name'];
      }
   }
}


That was a lot easier than I thought it was going to be :) :thumleft:

I suppose it would be best to pull the realm name from the database but hardcoding the realm in is fine for me.

Here's the end result: http://www.black-blades.org/roster/index.php

Thanks for the input, I'll keep that approach in mind in case I decide to add anything else :)
Last edited by Ymryl on Mon Mar 12, 2007 6:47 pm, edited 3 times in total.
User avatar
Ymryl
WR.net Apprentice
WR.net Apprentice
 
Posts: 38
Joined: Mon Jul 17, 2006 11:45 pm
Location: RI, USA

Re: Adding link to armory page in member list?

Postby niagairt » Mon Mar 12, 2007 6:55 pm

Ymryl wrote:I suppose it would be best to pull the realm name from the database but hardcoding the realm in is fine for me.


Added your code to my site, worked great!!!!!! But I do agree that pulling the realm name from the database will make for ease of use......
Rogues may do it from behind, but mages do it hard and fast.
Image
User avatar
niagairt
WR.net Apprentice
WR.net Apprentice
 
Posts: 36
Joined: Wed Jan 10, 2007 7:16 am
Location: Forks, WA

Adding link to armory page in member list?

Postby PleegWat » Mon Mar 12, 2007 10:44 pm

Global $guild_info then use $guild_info['realm']
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

Adding link to armory page in member list?

Postby Sunstrider » Tue Mar 13, 2007 4:08 am

What would it take to add this change to altmonitor also?

I love it.
Sunstrider
WR.net Apprentice
WR.net Apprentice
 
Posts: 8
Joined: Sun Dec 10, 2006 2:23 am

Adding link to armory page in member list?

Postby PleegWat » Tue Mar 13, 2007 10:30 am

Exactly the same change to the same named function in the bottom of altlist.php
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: Adding link to armory page in member list?

Postby Therius » Tue Mar 13, 2007 3:29 pm

You guys are on top of everything. Works great, thank you
User avatar
Therius
WR.net Apprentice
WR.net Apprentice
 
Posts: 7
Joined: Sat Dec 16, 2006 4:01 pm

Re: Adding link to armory page in member list?

Postby tuigii » Wed Mar 14, 2007 11:34 am

PleegWat wrote:Global $guild_info then use $guild_info['realm']

Of course :scratch:

But ... my European realm is being called "Khaz Modan" - so inserting .$guild_info['realm']. will the URL - IE shows a broken URL at the space character.

Is there a parse-function that puts in '+' sign, or a '%20' instead of the white spaces ?
If not, I'll build one ....
[edit] :scratch: ... slap in the face ... => urlencode($guild_info['realm']) exists already many years.... and does the job.

By the way, not feeling happy about including the 'WoW roster' – but have to say that the procedure on this thread is working.

Ok, we still have to cope with the fact the WoW thing is damned slow – buggy – and down all the time.
It even says that my principal character hasn’t been used for a while (I use it a 1 or 2 hours nearly every day – WoW thinks this isn’t just enough yet …they wana turn me in a real no-live ??)

On the other hand – they have to cope with a 3 à 4 million player database – so just imagine the size of the their “item–database”.
Don’t think will see a Guild Bank-facility neither – and if they do – I wouldn’t trust it anyway.
Last edited by tuigii on Wed Mar 14, 2007 2:46 pm, edited 2 times in total.
User avatar
tuigii
WR.net Master
WR.net Master
 
Posts: 891
Joined: Wed Dec 27, 2006 12:57 pm
Location: Somewhere in the South Ouest of France

Re: Adding link to armory page in member list?

Postby Arakor » Wed Mar 14, 2007 3:08 pm

For French or European
replace

$icon_value = '<a href="http://armory.worldofwarcraft.com/#character-sheet.xml?r=Medivh&n='.$row['name'].'" target="_blank"><img class="membersRowimg" width="16" height="16" src="'.$roster_conf['interface_url'].$icon_name.'.'.$roster_conf['img_suffix'].'" title="Link to WoW Armory Profile" alt="" /></a> ';


by

$icon_value = '<a href="http://armory.wow-europe.com/#character-sheet.xml?r=nom de votre serveur&n='.$row['name'].'" target="_blank"><img class="membersRowimg" width="16" height="16" src="'.$roster_conf['interface_url'].$icon_name.'.'.$roster_conf['img_suffix'].'" title="Link to WoW Armory Profile" alt="" /></a> ';


Edit : Correct version
Last edited by Arakor on Wed Mar 14, 2007 4:16 pm, edited 1 time in total.
Arakor
WR.net Apprentice
WR.net Apprentice
 
Posts: 12
Joined: Fri Jan 12, 2007 3:30 am

Adding link to armory page in member list?

Postby PleegWat » Wed Mar 14, 2007 3:19 pm

It works both with and without the #. I've never seen it with a ? before the #.
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: Adding link to armory page in member list?

Postby Arakor » Wed Mar 14, 2007 4:13 pm

My profile :

http://armory.wow-europe.com/?#characte ... h&n=Arakor

Excuse me for my english .
It work's with and without .When you do a research on the site ,you have a '?' before the '#'. Sorry .

http://armory.wow-europe.com/#character ... h&n=Arakor

Good job ,thank you
Arakor
WR.net Apprentice
WR.net Apprentice
 
Posts: 12
Joined: Fri Jan 12, 2007 3:30 am

Adding link to armory page in member list?

Postby Niryk » Wed Mar 14, 2007 4:56 pm

I'm liking using 'Mail_GMIcon' for the link to roster, seemed the most appropriate to me... I also went through and added links to the opposing guilds in the guild pvplog pages (eg: http://roster.pa-guilds.com/kotw/indexpvp.php), though I'm not quite happy with it yet, I don't like how 'Unguilded' isn't indented like the rest because it doesn't have the link image, 'course the easy fix is to move the image to the right side, but I don't want that, another option is to redo the table, but I don't wanna do that either, it's no big deal, I'm just musing...
Also, I'm not quite done with adding the armory links to stuff just yet though, I'm just working on the pvplog pages for individuals so as to link to the guild/character info for the appropriate realm based on that field... should be able to finish that up today..
User avatar
Niryk
WR.net Apprentice
WR.net Apprentice
 
Posts: 33
Joined: Fri Nov 17, 2006 5:31 am

Adding link to armory page in member list?

Postby vbdh » Wed Mar 14, 2007 5:10 pm

Ok i have added the code and it works great sort of when anyone clicks on the icon it just go's to main page of the armory anyone help me out :)

Thrillseekers
Long Live The Fighters
User avatar
vbdh
WR.net Apprentice
WR.net Apprentice
 
Posts: 45
Joined: Wed Jan 03, 2007 12:48 pm

Re: Adding link to armory page in member list?

Postby PleegWat » Wed Mar 14, 2007 5:22 pm

Niryk wrote:I also went through and added links to the opposing guilds in the guild pvplog pages (eg: http://roster.pa-guilds.com/kotw/indexpvp.php), though I'm not quite happy with it yet, I don't like how 'Unguilded' isn't indented like the rest because it doesn't have the link image.


Maybe INV_Misc_QuestionMark solves that problem?
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

Next

Return to General Code Help

Who is online

Users browsing this forum: No registered users and 0 guests

cron