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

Re: Adding link to armory page in member list?

Postby Ymryl » Wed Mar 14, 2007 6:15 pm

vbdh wrote: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


You need to change the realm in the link from Medivh to Khadgar

i.e.
Change:
Code: Select all
$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> ';

to:
Code: Select all
$icon_value = '<a href="http://armory.worldofwarcraft.com/#character-sheet.xml?r=Khadgar&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> ';


or add the global variable declaration and use it:

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

   $icon_name = 'Interface/Icons/Armory';
   $icon_value = '<a href="http://armory.worldofwarcraft.com/#character-sheet.xml?r='.urlencode($guild_info['realm']).'&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'];
      }
   }
}


Edit... Added urlencode() above
Last edited by Ymryl on Wed Mar 14, 2007 7:31 pm, edited 2 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

Adding link to armory page in member list?

Postby vbdh » Wed Mar 14, 2007 7:07 pm

N1 thx alot
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 tuigii » Wed Mar 14, 2007 7:19 pm

Instead of writing:
Code: Select all
...  .$guild_info['realm'].  ....

make it look like:
Code: Select all
.... .urlencode($guild_info['realm']). ....


If your realm (server) name has a space in it, the URL won't be build correctly.

And don't forget to upload a Armory.xxx image file to the locating indicated.
The extension ? Depends on what your 'img_suffix' is set to :!:
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

Adding link to armory page in member list?

Postby Ymryl » Wed Mar 14, 2007 7:32 pm

Ok, try this. It will check for the realmstatus_url to determine which url to use (armory.worldofwarcraft.com or armory.wow-europe.com) and uses urlencode($roster_conf['server_name']) for the server name (I couldn't get $guild_info['realm'] to work). It also uses the Mail_GMIcon image so you don't need to upload anything.

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'];
      }
   }
}
Last edited by Ymryl on Wed Mar 14, 2007 8:09 pm, edited 2 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 tuigii » Thu Mar 15, 2007 12:00 am

Ymryl wrote:....(I couldn't get $guild_info['realm'] to work)....

Because you didn't globalize $guild_info - as Pleegwat already stated above.
You have
Code: Select all
global $wordings, $roster_conf, $guildFaction;

and it should be
Code: Select all
global $wordings, $roster_conf, $guildFaction, $guild_info;

but your solution will do just fine.
Last edited by tuigii on Thu Mar 15, 2007 12:00 am, edited 1 time 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 mdeshane » Thu Mar 15, 2007 12:25 am

Ok, I looked at all of this and decided that it should go in the final version of WRX 1.73. However, I made a few changes so that the icon is only shown if the member already has a profile uploaded. If a member does not have a profile uploaded the link is their name. (As opposed to just a name with no link) Here is the code I used:

Code: Select all
function name_value $row )
{
    global 
$wordings$roster_conf$guildFaction;
            
        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_name 'Interface/Icons/Mail_GMIcon';
        
$icon_link '<a href="http://'.$armory_url.'/character-sheet.xml?r='.urlencode($roster_conf['server_name']).'&n='.$row['name'].'" target="_blank">';
        
$icon_value $icon_link.'<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_link.$row['name'].'</a></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_link.$row['name'].'</a>';
        }
    }
}
 


Also, I could not get $guild_info['realm'] to work even with it declared as a global, so I just used $roster_conf['server_name'] which works just as well.

Thanks to all of you working on this!
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 Ymryl » Thu Mar 15, 2007 1:08 am

tuigii, please give it a shot with $guild_info. I already had the code set up correctly, it just didn't work. But, the value is available in $roster_conf so I used it from there.
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 tuigii » Thu Mar 15, 2007 9:20 am

Ymryl wrote:tuigii, please give it a shot with $guild_info....

Did that, before writing here :mrgreen:

Here are my lines :
Code: Select all
function name_value $row )
{
    global 
$wordings$roster_conf$guildFaction$guild_info;

    
$icon_name 'Interface/Armory';
    
$icon_value '<a href="http://armory.wow-europe.com/#character-sheet.xml?r='.urlencode($guild_info['server']).'&n='.urlencode($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 WoW Armory Profile" alt="" /></a> ';
.... 

Please note that $guild_info is a var array that MUST exist (and used) in memberslist.php, otherwise, look what happens on line 25 and futher on :it will bail out from generating the page.

My rosters :
http://www.les-potes-ages.fr/roster
http://www.les-grands-croises.fr/roster
http://www.papy-team.fr/roster
Last edited by tuigii on Thu Mar 15, 2007 9:26 am, edited 1 time 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

Adding link to armory page in member list?

Postby vbdh » Thu Mar 15, 2007 10:42 am

ok heres one for ya i used mdeshane code and it works fine.

but i would like the members that have not signed up to the roster to goto the roster page on my site and not the armory witch code would i have to change to do this

thanks
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 tuigii » Thu Mar 15, 2007 11:19 am

vbdh wrote:....the members that have not signed up to the roster to goto the roster page on my site ....

Can you make this one more clear ?

Do I have to understand that members that didn't update their character in your roster shouldn't have the icon linking it to the Armory neither ?

Anyway, how can could you stop going members to go anywhere they want to go ?

On the other hand : this must be a "just another way to motivate your members to upgrade ?" :thumright:
Last edited by tuigii on Thu Mar 15, 2007 11:19 am, edited 1 time 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 vbdh » Thu Mar 15, 2007 7:44 pm

tuigii wrote:
vbdh wrote:....the members that have not signed up to the roster to goto the roster page on my site ....

Can you make this one more clear ?

Do I have to understand that members that didn't update their character in your roster shouldn't have the icon linking it to the Armory neither ?

Anyway, how can could you stop going members to go anywhere they want to go ?

On the other hand : this must be a "just another way to motivate your members to upgrade ?" :thumright:


yeah sorry just as u said peeps can go ware thay like but i need members to sign up so if thay sign up thay get the wow link as i said at the mo thay click on there name and thay get the wow link i need to stop this

thanks
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 » Thu Mar 15, 2007 9:26 pm

Code: Select all
function name_value $row )
{
    global 
$wordings$roster_conf$guildFaction;
            
        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_name 'Interface/Icons/Mail_GMIcon';
        
$icon_link '<a href="http://'.$armory_url.'/character-sheet.xml?r='.urlencode($roster_conf['server_name']).'&n='.$row['name'].'" target="_blank">';
        
$icon_value $icon_link.'<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> ';
        
        
//This can be modified to any URL, possibly your guild registration page
        
$name_link '<a href="http://www.yoursite.com/registrationlink.php" target="_blank">';


    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.$name_link.$row['name'].'</a></div>'//$name_link for custom link, and $icon_link for armory
        
}
    }
    else
    {
        if ( 
$row['server'] )
        {
            return 
$icon_value.'<a href="char.php?name='.$row['name'].'&amp;server='.$row['server'].'">'.$row['name'].'</a>';
        }
        else
        {
            return 
$name_link.$row['name'].'</a>'//$name_link for custom link, and $icon_link for armory
        
}
    }
}
 


Notice the addition of $name_link, you can change the url to whatever page you want to link to, ie. Roster Update, Guild Registration, Guild Home, etc. Also, I've commented where you can change $icon_link and $name_link.

**Edit: Made a correction where a $icon_link should also be changed to $name_link for it to work properly as well as added the comment for it. **
Last edited by mdeshane on Wed Mar 21, 2007 4:41 am, edited 2 times 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 » Fri Mar 16, 2007 12:02 am

thx for the code


ok same thing when i click on a members name without a profile it go's to the wow armory i need it to goto the upload page of roster this is what i have

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

        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_name 'Interface/Icons/Mail_GMIcon';
        
$icon_link '<a href="http://'.$armory_url.'/character-sheet.xml?r='.urlencode($roster_conf['server_name']).'&n='.$row['name'].'" target="_blank">';
        
$icon_value $icon_link.'<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> ';

        
//This can be modified to any URL, possibly your guild registration page
        
$name_link '<a href="http://thrillseekers.live-host.org/roster/update.php" target="_blank">';


    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_link.$row['name'].'</a></div>';
        }
    }
    else
    {
        if ( 
$row['server'] )
        {
            return 
$icon_value.'<a href="char.php?name='.$row['name'].'&amp;server='.$row['server'].'">'.$row['name'].'</a>';
        }
        else
        {
            return 
$name_link.$row['name'].'</a>'//$name_link for custom link, and $icon_link for armory
        
}
    }
}
 


thanks for help
Last edited by vbdh on Sat Mar 17, 2007 7:01 pm, edited 1 time in total.
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 vbdh » Mon Mar 19, 2007 3:47 pm

this did not apire on the main page must have been due to server move can anyone help me out with this plz :)
Last edited by vbdh on Mon Mar 19, 2007 3:48 pm, edited 1 time in total.
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 » Tue Mar 20, 2007 2:11 pm

Yes that looks right, it should send them to the profile upload page if they don't have a profile uploaded.
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

PreviousNext

Return to General Code Help

Who is online

Users browsing this forum: No registered users and 0 guests

cron