[ABD] Armory World of Warcraft Tooltip

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
Locked
User avatar
reiserfs
Registered User
Posts: 125
Joined: Wed May 23, 2007 8:47 pm
Location: Maceió - Brazil
Contact:

Re: [RC1] Armory World of Warcraft Items Tooltip

Post by reiserfs »

Axti wrote:Image

Can u tell me what i got not correct?
same problem of hansjorgen

I dont know yet why your server cant get the armory data, i will make more test scripts and send to you guys.
Angerphile wrote:erm, I'm also noticing an error with items like "[Helm of the Fallen Champion]"...

It's listing the info as "Classe: Shaman" instead of showing all the classes/etc.
i will check that.
Tabro
Registered User
Posts: 4
Joined: Sat Sep 08, 2007 4:09 pm

Re: [RC1] Armory World of Warcraft Items Tooltip

Post by Tabro »

I had the same problem with the server not being able to connect to armory, and I found the problem being cURL which this script bases its connection with armory through. So aperently the cURL extension is by default disabled in some apache/php distributions, including my host AND apachefriends which I use as server on my local pc.
So I fixed the script to use the standard stream function in php (fsockopen, fwrite and fgets).
Basicly what I do is to declare the proper request header, and then on the response stream I discard the entire header, and ends up with the XML code from armory.
I can put up some code if anyone wants it later, but if you have access to alter in the php.ini configuration file, you can enable cURL by finding the line:

Code: Select all

;extension=php_curl.dll
and remove the ; (semicolon).

\\Tabro
hazzardous
Registered User
Posts: 7
Joined: Sat Sep 08, 2007 4:57 pm

Re: [RC1] Armory World of Warcraft Items Tooltip

Post by hazzardous »

Could you please provide the files and/or a copy of the guide Tabro as I am currently stuck with the 466 error.
Tabro
Registered User
Posts: 4
Joined: Sat Sep 08, 2007 4:09 pm

Re: [RC1] Armory World of Warcraft Items Tooltip

Post by Tabro »

Sure I will upload the altered file later.
Tabro
Registered User
Posts: 4
Joined: Sat Sep 08, 2007 4:09 pm

Re: [RC1] Armory World of Warcraft Items Tooltip

Post by Tabro »

So here is my edited version of the phpArmory.class.php, which atleast fixed my problems with "unable to connect".
http://www.utc-guild.com/fix.rar
If you have any questions, feel free to ask.
Axti
Registered User
Posts: 8
Joined: Thu Sep 06, 2007 1:52 pm

Re: [RC1] Armory World of Warcraft Items Tooltip

Post by Axti »

Tabro wrote:So here is my edited version of the phpArmory.class.php, which atleast fixed my problems with "unable to connect".
http://www.utc-guild.com/fix.rar
If you have any questions, feel free to ask.
After upload your file i got this:

Image
Tabro
Registered User
Posts: 4
Joined: Sat Sep 08, 2007 4:09 pm

Re: [RC1] Armory World of Warcraft Items Tooltip

Post by Tabro »

Axti wrote:
Tabro wrote:So here is my edited version of the phpArmory.class.php, which atleast fixed my problems with "unable to connect".
http://www.utc-guild.com/fix.rar
If you have any questions, feel free to ask.
After upload your file i got this:

Image
Then it seems like you host does not support external communication. I know several hosts does this. At some hosts it is possible to enable external access.
hazzardous
Registered User
Posts: 7
Joined: Sat Sep 08, 2007 4:57 pm

Re: [RC1] Armory World of Warcraft Items Tooltip

Post by hazzardous »

hazzardous
Registered User
Posts: 7
Joined: Sat Sep 08, 2007 4:57 pm

Re: [RC1] Armory World of Warcraft Items Tooltip

Post by hazzardous »

BTW how do you open an external connection to allow only wowarmory.com. We are using a Windows server if that helps.
Axti
Registered User
Posts: 8
Joined: Thu Sep 06, 2007 1:52 pm

Re: [RC1] Armory World of Warcraft Items Tooltip

Post by Axti »

I use RC3. This can be a problem? BTW i can't use Windows server because in my country that's servers not be developed. Also all fixs does'nt working nothing. Still unable to connect.
hansjorgen
Registered User
Posts: 8
Joined: Tue Aug 29, 2006 9:06 am

Re: [RC1] Armory World of Warcraft Items Tooltip

Post by hansjorgen »

Ok. The quest continues. ;)

So I enabled the curl_url thing, and things changed at least. (See the image I posted earlier as I just replaced the old one with the new one)

See also:
http://www.darksunguild.net/viewtopic.php?f=6&t=2229

Any ideas? :)
User avatar
reiserfs
Registered User
Posts: 125
Joined: Wed May 23, 2007 8:47 pm
Location: Maceió - Brazil
Contact:

Re: [RC1] Armory World of Warcraft Items Tooltip

Post by reiserfs »

I made a test script for everyone with problems

http://killermonkeys.net/wow/phparmory/test.php.txt

Get this script and execute, and send via PM to me the results.
hazzardous
Registered User
Posts: 7
Joined: Sat Sep 08, 2007 4:57 pm

Re: [RC1] Armory World of Warcraft Items Tooltip

Post by hazzardous »

Here is what my test.php says:
http://www.renegadewow.com/phpBB3/test.php

However it still does not work:
http://www.renegadewow.com/phpBB3/viewt ... p?f=21&t=4
User avatar
reiserfs
Registered User
Posts: 125
Joined: Wed May 23, 2007 8:47 pm
Location: Maceió - Brazil
Contact:

Re: [RC1] Armory World of Warcraft Items Tooltip

Post by reiserfs »

hazzardous wrote:Here is what my test.php says:
http://www.renegadewow.com/phpBB3/test.php

However it still does not work:
http://www.renegadewow.com/phpBB3/viewt ... p?f=21&t=4
You have a notice reporting problem i put error_reporting(E_ALL ^ E_NOTICE); on my new release put this on your code and notices will turn off.
hazzardous
Registered User
Posts: 7
Joined: Sat Sep 08, 2007 4:57 pm

Re: [RC1] Armory World of Warcraft Items Tooltip

Post by hazzardous »

PERFECT :D The 466 error has been fixed. Here is the new item.php for anybody who needs it.

Code: Select all

<?php
// Disbale Php Armory error logs
error_reporting(E_ALL ^ E_NOTICE);

// Include the Php Armory Class
include("phpArmory.class.php");

// Get the URL GET And decode
$var = urldecode($_GET['v']);

// Create a new Armory Object
$armory = new phpArmory();

// Get the item data from the item name. NOTE THE ORIGINAL PHPARMORY CLASS DONT HAVE THIS METHOD.
$item = $armory->itemnameFetch($var);

// Url for armory icons
$icons_url = "http://www.wowarmory.com/images/icons/";

// Reduce the array name size, make more easy to work with the array.
$item = $item['itemtooltips']['itemtooltip'];

if (count($item) == 0) die("<br /> <br /> Unable to connect to Armory portal, Or item name not found. Try again <br /> <br /> <br />");

//DEBUGGING
// print_r($item);

// Return the quality color
function value_color($v)
{
	switch($v)
	{
		case 0: return "#c9c9c9"; break;
		case 1: return "#FFFFFF"; break;
		case 2: return "#00FF00"; break;
		case 3: return "#0070DD"; break;
		case 4: return "#A335EE"; break;
		case 5: return "#FF3300"; break;
		case 6: return "#ffd517"; break;
		case 7: return "#d80000"; break;
	}
}

// Bonding
function value_bound($v)
{
	switch($v)
	{
		case 1: return "Binds when picked up"; break;
		case 2: return "Binds when equipped"; break;
		case 3: return "Soulbond"; break;
                case 4: 
                case 5: return "Quest item"; break;
	}
}

// Item Slot
function value_slot($v)
{
	switch($v)
	{
		case 0: return " ";break;
                case 1: return "Head";break;
                case 2: return "Neck";break;
		case 3: return "Shoulders"; break;
                case 4: return "Shirt";break;
                case 5: return "Chest";break;
                case 6: return "Waist";break;
                case 7: return "Legs";break;
                case 8: return "Feet";break;
                case 9: return "Wrist";break;
		case 10: return "Hand";break;
		case 11: return "Finger";break;
		case 12: return "Trinket";break;
		case 13: return "One-Hand";break;
		case 14: return "Off-Hand";break;
		case 15: return "Ranged";break;
		case 16: return "Back";break;
		case 17: return "Two-Hand";break;
		case 18: return "Bag";break;
		case 19: return "Tabard";break;
		case 20: return "Chest";break;		
                case 21: return "Main-Hand";break;
                case 22: return "Off-Hand";break;
                case 23: return "Held In Off Hand";break;
                case 24: return "Projectile";break;
                case 25: return "Thrown";break;
                case 26: return "Ranged";break;
                case 27: return "Quiver";break;
                case 28: return "Relic";break;
	}
}

// Reputation level
function value_rep($v)
{
	switch($v)
	{
		case 0: return "Hated"; break;
		case 1: return "Hostile"; break;
		case 2: return "Unfriendly"; break;
		case 3: return "Neutral";break;
		case 4: return "Friendly";break;
		case 5: return "Honored";break;
		case 6: return "Revered";break;
		case 7: return "Exalted";break;
	}
}

// Item Spell DATA Trigger
function value_trigger($v)
{
	switch($v)
	{
		case 0: return "Use";break;
		case 1: return "Equip";break;
	}
}

// Create Required DATA if exist
if ($item['requiredability']) $require_data .= '<font color="#d80000">Require '.$item['requiredability'].'</font> <br />';
if ($item['requiredlevel']) $require_data .= '<font color="#d80000">Require Level '.$item['requiredlevel'].'</font> <br />';
if ($item['requiredfaction']) $require_data .= '<font color="#d80000">Require '.$item['requiredfaction']['attributes']['name'].' - '.value_rep($item['requiredfaction']['attributes']['rep']).'</font> <br />';
if ($item['requiredskill'])  $require_data .= '<font color="#d80000">Require '.$item['requiredskill']['attributes']['name'].' - '.$item['requiredskill']['attributes']['rank'].'</font> <br />'; 

// Class allowable to use
if ($item['allowableclasses']) $require_data .='<font color="#d80000">Classe: '.$item['allowableclasses']['class'].'</font> <br />';

// Unique?
if ($item['maxcount']==1) $require_data .='<font color="#FFFFFF">Unique</font> <br />';

// Create SPELL DATA if exist
if ($item['spelldata'])
{
	$spell = $item['spelldata']['spell'];
	// If existe more then one trigger
	if (is_array($spell[0]))
	{
		foreach($spell as $s)
		{
			$spell_data .= '<font color="#00FF00">'.value_trigger($s['trigger']).': '.$s['desc'].' </font><br />';
	}	}	
	else $spell_data .= '<font color="#00FF00">'.value_trigger($spell['trigger']).': '.$spell['desc'].' </font><br />';
}
// Make more Spelldata info, i know its very strange, but works =D.
if ($item['bonuscritspellrating']) $spell_data.= '<font color="#00FF00">'.value_trigger(1).': Improves spell critical strike rating by '.$item['bonuscritspellrating'].'</font><br />';
if ($item['bonushitspellrating']) $spell_data.= '<font color="#00FF00">'.value_trigger(1).': Improves spell hit rating by '.$item['bonushitspellrating'].'</font><br />';
if ($item['bonushitrating']) $spell_data.= '<font color="#00FF00">'.value_trigger(1).': Improves hit rating by '.$item['bonushitrating'].'</font><br />';
if ($item['bonusdefenseskillrating']) $spell_data.= '<font color="#00FF00">'.value_trigger(1).': Increases defense rating by '.$item['bonusdefenseskillrating'].'</font><br />';
if ($item['bonusparryrating']) $spell_data.= '<font color="#00FF00">'.value_trigger(1).': Increases your parry rating by '.$item['bonusparryrating'].'</font><br />';
if ($item['bonusdodgerating']) $spell_data.= '<font color="#00FF00">'.value_trigger(1).': Increases your dodge rating by '.$item['bonusdodgerating'].'</font><br />';
if ($item['bonusblockrating']) $spell_data.= '<font color="#00FF00">'.value_trigger(1).': Increases your shield block rating by '.$item['bonusblockrating'].'</font><br />';
if ($item['bonuscritrating']) $spell_data.= '<font color="#00FF00">'.value_trigger(1).': Improves critical strike rating by '.$item['bonuscritrating'].'</font><br />';
if ($item['bonusresiliencerating']) $spell_data.= '<font color="#00FF00">'.value_trigger(1).': Improves your resilience rating by '.$item['bonusresiliencerating'].'</font><br />';
if ($item['bonushitmeleerating']) $spell_data.= '<font color="#00FF00">'.value_trigger(1).': Improves bonushitmeleerating by '.$item['bonushitmeleerating'].'</font><br />';
if ($item['bonushitrangedrating']) $spell_data.= '<font color="#00FF00">'.value_trigger(1).': Improves bonushitrangedrating by '.$item['bonushitrangedrating'].'</font><br />';
if ($item['bonuscritmeleerating']) $spell_data.= '<font color="#00FF00">'.value_trigger(1).': Improves bonuscritmeleerating by '.$item['bonuscritmeleerating'].'</font><br />';
if ($item['bonuscritrangedrating']) $spell_data.= '<font color="#00FF00">'.value_trigger(1).': Improves bonuscritrangedrating by '.$item['bonuscritrangedrating'].'</font><br />';
if ($item['bonushittakenmeleerating']) $spell_data.= '<font color="#00FF00">'.value_trigger(1).': Improves bonushittakenmeleerating by '.$item['bonushittakenmeleerating'].'</font><br />';
if ($item['bonushittakenrangedrating']) $spell_data.= '<font color="#00FF00">'.value_trigger(1).': Improves bonushittakenrangedrating by '.$item['bonushittakenrangedrating'].'</font><br />';
if ($item['bonushittakenspellrating']) $spell_data.= '<font color="#00FF00">'.value_trigger(1).': Improves bonushittakenspellrating by '.$item['bonushittakenspellrating'].'</font><br />';
if ($item['bonuscrittakenmeleerating']) $spell_data.= '<font color="#00FF00">'.value_trigger(1).': Improves bonuscrittakenmeleerating by '.$item['bonuscrittakenmeleerating'].'</font><br />';
if ($item['bonuscrittakenrangedrating']) $spell_data.= '<font color="#00FF00">'.value_trigger(1).': Improves bonuscrittakenrangedrating by '.$item['bonuscrittakenrangedrating'].'</font><br />';
if ($item['bonuscrittakenspellrating']) $spell_data.= '<font color="#00FF00">'.value_trigger(1).': Improves bonuscrittakenspellrating by '.$item['bonuscrittakenspellrating'].'</font><br />';
if ($item['bonushastemeleerating']) $spell_data.= '<font color="#00FF00">'.value_trigger(1).': Improves bonushastemeleerating by '.$item['bonushastemeleerating'].'</font><br />';
if ($item['bonushasterangedrating']) $spell_data.= '<font color="#00FF00">'.value_trigger(1).': Improves bonushasterangedrating by '.$item['bonushasterangedrating'].'</font><br />';
if ($item['bonushastespellrating']) $spell_data.= '<font color="#00FF00">'.value_trigger(1).': Improves bonushastespellrating by '.$item['bonushastespellrating'].'</font><br />';
if ($item['bonushittakenrating']) $spell_data.= '<font color="#00FF00">'.value_trigger(1).': Improves bonushittakenrating by '.$item['bonushittakenrating'].'</font><br />';
if ($item['bonuscrittakenrating']) $spell_data.= '<font color="#00FF00">'.value_trigger(1).': Improves bonuscrittakenrating by '.$item['bonuscrittakenrating'].'</font><br />';
if ($item['bonushasterating']) $spell_data.= '<font color="#00FF00">'.value_trigger(1).': Improves bonushasterating by '.$item['bonushasterating'].'</font><br />';
// if ($item['']) $spell_data.= '<font color="#00FF00">'.value_trigger(1).': Improves  by '.$item[''].'</font><br />';

// Build Armor / Bonus data
if ($item['armor']) $armor_data .= '<font color="#FFFFFF">'.$item['armor'].' Armor</font><br />';
if ($item['bonusstamina'])  $armor_data .= '<font color="#FFFFFF">+'.$item['bonusstamina'].' Stamina</font><br />';
if ($item['bonusintellect'])  $armor_data .= '<font color="#FFFFFF">+'.$item['bonusintellect'].' Intellect</font><br />';
if ($item['bonusspirit'])  $armor_data .= '<font color="#FFFFFF">+'.$item['bonusspirit'].' Spirit</font><br />';
if ($item['bonusagility'])  $armor_data .= '<font color="#FFFFFF">+'.$item['bonusagility'].' Agility</font><br />';
if ($item['bonusstrength'])  $armor_data .= '<font color="#FFFFFF">+'.$item['bonusstrength'].' Strength</font><br />';
if ($item['blockvalue'])  $armor_data .= '<font color="#FFFFFF">'.$item['blockvalue'].' Block</font><br />';
if ($item['fireresist'])  $armor_data .= '<font color="#FFFFFF">+'.$item['fireresist'].' Fire Resistance</font><br />';
if ($item['natureresist'])  $armor_data .= '<font color="#FFFFFF">+'.$item['natureresist'].' Nature Resistance</font><br />';
if ($item['frostresist'])  $armor_data .= '<font color="#FFFFFF">+'.$item['frostresist'].' Frost Resistance </font><br />';
if ($item['shadowresist'])  $armor_data .= '<font color="#FFFFFF">+'.$item['shadowresist'].' Shadow Resistance</font><br />';
if ($item['arcaneresist'])  $armor_data .= '<font color="#FFFFFF">+'.$item['arcaneresist'].' Arcane Resistance</font><br />';

// Durability info
if ($item['durability'])
{
	$durability = '<font color="#FFFFFF">Durability: '.$item['durability']['attributes']['current'].'/'.$item['durability']['attributes']['max'].'</font><br />';
}

//Build GEM Data
//http://www.wowarmory.com/images/images/icons/Socket_Meta.png
if ($item['socketdata'])
{
        // If exist more then one gem slot 
        if (is_array($item['socketdata']['socket'][0]))
        {
                foreach($item['socketdata']['socket'] as $x)
                {
                        $gem_data.= '<font color="#c9c9c9"><img src="'.$icons_url.'Socket_'.$x['attributes']['color'].'.png">'.$x['attributes']['color'].' Socket</font><br />';
        	}       
	}
        else 
	{
		$x = $item['socketdata']['socket'];
		$gem_data.= '<font color="#c9c9c9"><img src="'.$icons_url.'Socket_'.$x['attributes']['color'].'.png">'.$x['attributes']['color'].' Socket</font><br />';
	}

	if ($item['socketdata']['socketmatchenchant'])
	{
		$gem_data.= '<font color="#c9c9c9">Socket Bonus: '.$item['socketdata']['socketmatchenchant'].'</font><br />';
	}	
}

if ($item['gemproperties'])
{
	$gem_data.='<font color="#ffffff">'.$item['gemproperties'].'</font><br />';
}

// Build set DATA if Exist
if ($item['setdata'])
{
	$set_data .= '<br /><font color="#ffd517">'.$item['setdata']['name'].' (0/'.count($item['setdata']['item']).')</font><br />';
        foreach($item['setdata']['item'] as $i)
	{
		$set_data .= '<font color="#c9c9c9">'.$i['attributes']['name'].'</font><br />';
	}
        //Build the set bonus, but first check if the set have mutiple bonus
        if (is_array($item['setdata']['setbonus'][0])) 
	{
		 $set_data .= '<br />';
		foreach($item['setdata']['setbonus'] as $b)
		{
			 $set_data .= '<font color="#c9c9c9">('.$b['attributes']['threshold'].') '.$b['attributes']['desc'].'</font><br />';
		}
	}
	else
	{
		$b = $item['setdata']['setbonus'];
		$set_data .= '<br /><font color="#c9c9c9">('.$b['attributes']['threshold'].') '.$b['attributes']['desc'].'</font><br />';
	}
}	
if ($item['desc'])
{
	$desc = '<font color="#ffd517">"'.$item['desc'].'"</font><br />';
}

if (($item['equipdata']['inventorytype']) || $item['equipdata']['subclassname'])
{
  $type_class = '
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
    <tr>
      <td align="left">
        <font color="#FFFFFF">'.value_slot($item['equipdata']['inventorytype']).'</font>
      </td>
      <td align="right">
        <font color="#FFFFFF">'.$item['equipdata']['subclassname'].'</font>
      </td>
    </tr>
   ';
}

if ($item['bonding'])
{
	$bonding = '<font color="#FFFFFF">'.value_bound($item['bonding']).'</font> <br />';
}

if ($item['equipdata']['inventorytype'])
{
	$inventory = '<font color="#FFFFFF">'.value_slot($item['equipdata']['inventorytype']).'</font><br />';
}
?>
<table cellspacing="0" cellpadding="5" border="0">
 <tr>
  <td width="43" valign="top"><img src="<?=$icons_url;?>43x43/<?=$item['icon'];?>.png" border="0">
  </td>
  <td> <font color="#FFFFFF">  
  <font color="<?=value_color($item['overallqualityid'])?>"><?=$item['name'];?> </font> <br />
  <?=$bonding;?>
  <?=$inventory;?>
  <?=$require_data;?>  
  <?=$type_class;?>
  <?=$armor_data;?>
  <?=$gem_data;?>
  <?=$durability;?>
  <?=$spell_data;?>
  <?=$set_data;?>
  <?=$desc;?>
  </td>
 </tr>
</table>
Locked

Return to “[3.0.x] Abandoned MODs”