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 vbdh » Tue Mar 20, 2007 3:32 pm

nope still gos to the wow site :(
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 mdeshane » Wed Mar 21, 2007 4:35 am

Ok I found the error.

Code: Select all
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_link.$row['name'].'</a></div>';
}
 


should be

Code: Select all
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.$name_link.$row['name'].'</a></div>'//Change this between $icon_link and $name_link as well
}
 


That should fix your problem.

**Edit: Changed the main code previously posted with changes for you to better see what needs to change. **
Last edited by mdeshane on Wed Mar 21, 2007 4:44 am, edited 1 time in total.
Image
Accounts Addon - Roster v2 User Account Addon

PKC Dev Site - http://dev.pkcomp.net
My Roster Dev Site - http://myroster.dontexist.net
User avatar
mdeshane
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 203
Joined: Sun Dec 10, 2006 4:54 am
Location: Grand Rapids, MI USA
Realm: Khadgar (PvE) - US

Adding link to armory page in member list?

Postby vbdh » Wed Mar 21, 2007 5:14 am

Thanks so much for time you have put in to getting this to work.

it's now working great thanks again :)
Long Live The Fighters
User avatar
vbdh
WR.net Apprentice
WR.net Apprentice
 
Posts: 45
Joined: Wed Jan 03, 2007 12:48 pm

Adding link to armory page in member list?

Postby Equisetum » Thu Mar 22, 2007 1:05 am

I love this addition to the roster! Thanks so much for setting it up, and for everyone's work on it so far.

I use WowRosterDF, and wanted to get it working there, so I had to change things ever so slightly. I'm not a programmer, so please bear with me!!

I took the code from the first page of this thread, (so my realm is still hardcoded, and all members have the blizz icon next to them not just a select number), and then modified a few lines to work with the DF module. I only commented the lines I modifed. I put the whole section of code in the post to make it easy for others to just cut and paste the section in. If you do this, just remember to either modify the code to be dynamic with your guild info as shown in this thread, or changing your realm in the code.

Here's the end product: http://wow.rage-and-mana.com/WoWRosterDF.html

Here's the code:

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

   $icon_name = 'Interface/Icons/Mail_GMIcon';
   $icon_value = '<a href="http://armory.worldofwarcraft.com/#character-sheet.xml?r=Alexstrasza&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'] )
      {

//         Original WowRosterDF Code
//         return $tooltip.'<a href="'.getlink($module_name.'&amp;file=char&amp;cname='.$row['name'].'&amp;server='.$row['server']).'">'.$row['name'].'</a></div>';

//         Original Code for the Armory Update from thread http://wowroster.net/Forums/viewtopic/t=3047/finish=15/start=0.html
//         return $tooltip.$icon_value.'<a href="char.php?name='.$row['name'].'&amp;server='.$row['server'].'">'.$row['name'].'</a></div>';

//         Modified code for use with Armory and WowRosterDF
         return $tooltip.$icon_value.'<a href="'.getlink($module_name.'&amp;file=char&amp;cname='.$row['name'].'&amp;server='.$row['server']).'">'.$row['name'].'</a></div>';


      }
      else
      {

//         Original WowRosterDF Code
//         return $tooltip.$row['name'].'</div>';
         return $tooltip.$icon_value.$row['name'].'</div>';

      }
   }
   else
   {
      if ( $row['server'] )
      {

//         Original WowRosterDF Code
//         return '<a href="'.getlink($module_name.'&amp;file=char&amp;cname='.$row['name'].'&amp;server='.$row['server']).'">'.$row['name'].'</a>';

//         Original Code for the Armory Update from thread http://wowroster.net/Forums/viewtopic/t=3047/finish=15/start=0.html
//         return $icon_value.'<a href="char.php?name='.$row['name'].'&amp;server='.$row['server'].'">'.$row['name'].'</a>';

//         Modified code for use with Armory and WowRosterDF
         return $icon_value.'<a href="'.getlink($module_name.'&amp;file=char&amp;cname='.$row['name'].'&amp;server='.$row['server']).'">'.$row['name'].'</a>';

      }
      else
      {

//         return $row['name'];
         return $icon_value.$row['name'];
      }
   }
}


Again, thanks so much for this! You guys rock!!!

~Eq

PS - When I previewed the post, it was all stretched out... don't know what I did to make it do that, so I'm sorry if you have to scroll!! :scratch:
Image
User avatar
Equisetum
WR.net Apprentice
WR.net Apprentice
 
Posts: 65
Joined: Mon Jul 24, 2006 6:44 am

Re: Adding link to armory page in member list?

Postby pinion120 » Wed Apr 11, 2007 11:15 pm

I've read the replies and am ready to implement the code change. However, which .php file does the code get inserted in?
Last edited by pinion120 on Mon May 05, 2008 6:20 am, edited 1 time in total.
pinion120
WR.net Apprentice
WR.net Apprentice
 
Posts: 1
Joined: Tue Jul 25, 2006 12:08 am

Re: Adding link to armory page in member list?

Postby IllusoryThrall » Fri May 18, 2007 9:38 am

FYI to all who are doing this. a lot of the posts above, the code includes a # before the character sheet in the armory link.. which has aparently been taken out!!

the correct code ((from the original poster's fixes.. with the # taken out)) would be:

change the function in memberslist.php to:

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

   $icon_name = 'Interface/Icons/Mail_GMIcon';
   
   if( $roster_conf['realmstatus_url'] == "http://www.worldofwarcraft.com/realmstatus/status.xml") {
      $armory_url = "armory.worldofwarcraft.com";
   } else {
      $armory_url = "armory.wow-europe.com";
   }
   
   $icon_value = '<a href="http://'.$armory_url.'/character-sheet.xml?r='.urlencode($roster_conf['server_name']).'&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'];
      }
   }
}


I have this on my memberslist.. and it's working, with all links functional.

ADDITIONAL!

for those that have / use alt monitor..

change the same function in altlist.php to:

Code: Select all
function name_value ( $row )
{
   global $wordings, $roster_conf, $guildFaction;
   
   $icon_name = 'Interface/Icons/Mail_GMIcon';

   if( $roster_conf['realmstatus_url'] == "http://www.worldofwarcraft.com/realmstatus/status.xml") {
      $armory_url = "armory.worldofwarcraft.com";
   } else {
      $armory_url = "armory.wow-europe.com";
   }
   
   $icon_value = '<a href="http://'.$armory_url.'/character-sheet.xml?r='.urlencode($roster_conf['server_name']).'&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";

      switch ( $row['alt_type'] & 3 )
      {
         case 0:
            $tooltip .= 'Main with alts'."\n";
            break;
         case 1:
            $tooltip .= 'Main without alts'."\n";
            break;
         case 2:
            $tooltip .= 'Alt of '.$row['main_name']."\n";
            break;
         case 3:
            $tooltip .= 'Mainless Alt'."\n";
            break;
      }

      $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'];
      }
   }
}
User avatar
IllusoryThrall
WR.net Apprentice
WR.net Apprentice
 
Posts: 22
Joined: Mon May 14, 2007 6:11 pm

Re: Adding link to armory page in member list?

Postby Malkom » Tue May 29, 2007 7:53 pm

To stay on the first idea, I prefer to have another column for the icon and the link...

So I have made this change :

On index.php, between name and class, add this :

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',
   ),
);



On memberlist.php, on the bottom, add this :

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

   $icon_name = 'Interface/Icons/Mail_GMIcon';
   
   if( $roster_conf['realmstatus_url'] == "http://www.worldofwarcraft.com/realmstatus/status.xml") {
      $armory_url = "armory.worldofwarcraft.com";
   } else {
      $armory_url = "armory.wow-europe.com";
   }
   
   $icon_value = '<a href="http://'.$armory_url.'/character-sheet.xml?r='.urlencode($roster_conf['server_name']).'&n='.$row['name'].'" target="_blank"><img class="membersRowimg" width="16" height="16" src="'.$roster_conf['interface_url'].$icon_name.'.'.$roster_conf['img_suffix'].'" title="Lien vers le profil de l\'Armurerie de wow" alt="" /></a> ';
   
   return $icon_value;
}


If you use ALtMonitor, do the same things with altlist_wrap.php and altlist.php


Work fine for me :thumright:

You can see the result here : http://gondolyn.free.fr/roster/index.php
Last edited by Malkom on Tue May 29, 2007 7:54 pm, edited 1 time in total.
Image
User avatar
Malkom
WR.net Journeyman
WR.net Journeyman
 
Posts: 144
Joined: Tue Jan 09, 2007 11:02 am
Location: France - 91 - Longjumeau

Adding link to armory page in member list?

Postby PleegWat » Tue May 29, 2007 10:49 pm

You can also add the FIELD entry in the same place in indexalt.php, indexstat.php and indexhonor.php to add the icon to those pages.
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 seleleth » Tue May 29, 2007 11:53 pm

Hey! I never even noticed this topic. I independently thought of this thing, came up with a way to do it, and posted it here:

http://www.wowroster.net/Forums/viewtopic/t=3387.html

And here you guys were discussing it a month before I even posted!

Anyway, if any of you are having trouble following this thread you may find the one I linked a bit easier to follow.
User avatar
seleleth
Gimpy Developer
Gimpy Developer
 
Posts: 59
Joined: Thu Jul 06, 2006 10:26 pm
Location: Salt Lake City, UT

Adding link to armory page in member list?

Postby Rumik » Fri Jul 06, 2007 9:28 pm

Hi there,

I've followed the instructions - modified my memberlist.php and uploaded the icon into the right place, but my roster isn't changing...

Can anyone help?

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

Previous

Return to General Code Help

Who is online

Users browsing this forum: No registered users and 0 guests

cron