[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.
flokohlert
Registered User
Posts: 7
Joined: Sat Sep 01, 2007 11:35 am

Re: [RC1] Armory World of Warcraft Items Tooltip

Post by flokohlert »

After some hard time i found why it doesn´t find any items on german i found teh result, its the armory itself:
if you want to retrieve items in de/fr/es you have to send an header with curl:

Code: Select all

in phpArmory.class.php:
~line 240 (function xmlFetch)
find:curl_setopt ($ch, CURLOPT_USERAGENT, $userAgent);
AFTER ADD:
$language="de";
curl_setopt ($ch, CURLOPT_HTTPHEADER, array("Accept-Language: ".$language.",".$language."-".$language.";"));
This should make it work with german items, now it would be even better to search for all of them if no item is found. at least on our forums we have german and english items.
change $language="de"; to fr/en/es if you need other language, don´t know why the armory doesnt return items on every language you try.

lyf
Registered User
Posts: 13
Joined: Wed Mar 30, 2005 3:55 pm
Location: Denmark

Re: [RC1] Armory World of Warcraft Items Tooltip

Post by lyf »

I'm sorry but I can't find that ACP bbcode options panel. I try like this:

System > (Module Management) Administration Control Panel > Posting > Messages > BBCodes

..but now what? Can't see what I should do know, I'm kinda confused. I really like the new ideas you have, looking forward to them.

Any help would be greatly appreciated.

flokohlert
Registered User
Posts: 7
Joined: Sat Sep 01, 2007 11:35 am

Re: [RC1] Armory World of Warcraft Items Tooltip

Post by flokohlert »

lyf you already made it to the right place ;)
now there should be a button "add bbcode" click it and you are done.

I changed the phpArmory.class.php so that it searches with different languages:

FIND

Code: Select all

	var $timeout = 30;
AFTER ADD

Code: Select all

	
      /**
     * the language items get fetched
     *
     * @var de/en/fr/es
     */
	var $lang = "en";

FIND

Code: Select all

$item_ary = $this->xmlToArray($this->xmlFetch($url));
REPLACE WITH

Code: Select all

                 //searchable languages
                 $languages = array ("en","de","fr","es");
                // Search the itemid on different languages
                foreach ($languages as $plang)
                {
                $item_ary = $this->xmlToArray($this->xmlFetch($url,$plang));
                //if we found the item stop trying other languages
                if ($item_ary['armorysearch']['searchresults']['items']['item']) {break;}
                }
FIND

Code: Select all

	function xmlFetch($url, $userAgent = NULL, $timeout = NULL){
REPLACE WITH

Code: Select all

	function xmlFetch($url, $lang = NULL, $userAgent = NULL, $timeout = NULL){
FIND

Code: Select all

if(($timeout==NULL)&&($this->timeout)) $timeout = $this->timeout;
AFTER ADD

Code: Select all

    if(($lang==NULL)&&($this->lang)) $lang = $this->lang;

FIND

Code: Select all

curl_setopt ($ch, CURLOPT_USERAGENT, $userAgent);
AFTER ADD

Code: Select all

			curl_setopt ($ch, CURLOPT_HTTPHEADER, array("Accept-Language: ".$lang.",".$lang."-".$lang.";"));

The language you set with var $lang = "en"; is the language your items will be displayed, the search will always try EN/DE/FR/ES (in this order) until it finds an item.

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 »

flokohlert wrote:lyf you already made it to the right place ;)
now there should be a button "add bbcode" click it and you are done.

I changed the phpArmory.class.php so that it searches with different languages:

FIND

Code: Select all

	var $timeout = 30;
AFTER ADD

Code: Select all

	
      /**
     * the language items get fetched
     *
     * @var de/en/fr/es
     */
	var $lang = "en";

FIND

Code: Select all

$item_ary = $this->xmlToArray($this->xmlFetch($url));
REPLACE WITH

Code: Select all

                 //searchable languages
                 $languages = array ("en","de","fr","es");
                // Search the itemid on different languages
                foreach ($languages as $plang)
                {
                $item_ary = $this->xmlToArray($this->xmlFetch($url,$plang));
                //if we found the item stop trying other languages
                if ($item_ary['armorysearch']['searchresults']['items']['item']) {break;}
                }
FIND

Code: Select all

	function xmlFetch($url, $userAgent = NULL, $timeout = NULL){
REPLACE WITH

Code: Select all

	function xmlFetch($url, $lang = NULL, $userAgent = NULL, $timeout = NULL){
FIND

Code: Select all

if(($timeout==NULL)&&($this->timeout)) $timeout = $this->timeout;
AFTER ADD

Code: Select all

    if(($lang==NULL)&&($this->lang)) $lang = $this->lang;

FIND

Code: Select all

curl_setopt ($ch, CURLOPT_USERAGENT, $userAgent);
AFTER ADD

Code: Select all

			curl_setopt ($ch, CURLOPT_HTTPHEADER, array("Accept-Language: ".$lang.",".$lang."-".$lang.";"));

The language you set with var $lang = "en"; is the language your items will be displayed, the search will always try EN/DE/FR/ES (in this order) until it finds an item.

Nice changes i will put on official. But need more code to change only the language and the system change the armory url by language option.

User avatar
bigbabol
Registered User
Posts: 17
Joined: Wed Aug 01, 2007 7:23 pm
Location: Greece

Re: [RC1] Armory World of Warcraft Items Tooltip

Post by bigbabol »

Image

I follow step by step the installation instructions.. any idea?

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 »

bigbabol wrote:Image

I follow step by step the installation instructions.. any idea?
This is very strange, first try to turn off the notice notification on you php.ini config, notice are anoying, and i wil see this line on armory class.

hansjorgen
Registered User
Posts: 8
Joined: Tue Aug 29, 2006 9:06 am

Re: [RC1] Armory World of Warcraft Items Tooltip

Post by hansjorgen »

I think I've installed the mod correctly, and I get the links and everything, but inside the tooltip I only get "Unable to connect to Armory portal, or item name not found. Try again"

I've checked with several names. Capital letters and all. (used the ItemStats mod earlier). Any suggestions?

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 »

hansjorgen wrote:I think I've installed the mod correctly, and I get the links and everything, but inside the tooltip I only get "Unable to connect to Armory portal, or item name not found. Try again"

I've checked with several names. Capital letters and all. (used the ItemStats mod earlier). Any suggestions?
Your webserver can make a remote file open? Check the php config and your firewall

hansjorgen
Registered User
Posts: 8
Joined: Tue Aug 29, 2006 9:06 am

Re: [RC1] Armory World of Warcraft Items Tooltip

Post by hansjorgen »

Well. I turned off the firewall just to check if it was the problem, and still got the same error. As for allowing remote files to open, this is new to me. I did some searching, and I guess you are referring to allow_ur_fopen? It's currently enabled in php.ini.

User avatar
cyberken
Registered User
Posts: 185
Joined: Wed Jul 27, 2005 11:51 am
Location: Edinburgh

Re: [RC1] Armory World of Warcraft Items Tooltip

Post by cyberken »

Firstly - great mod - the WoW fans on my site are loving this :)

I have 1 question - a few of the members have flash signatures and the tooltip opens up behind that signature - its the same in both IE7 and Firefox - 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 »

hansjorgen wrote:Well. I turned off the firewall just to check if it was the problem, and still got the same error. As for allowing remote files to open, this is new to me. I did some searching, and I guess you are referring to allow_ur_fopen? It's currently enabled in php.ini.
This is very odd. First you have to test if you server can open a remote site.

Try this code

Code: Select all

<?
ini_set('user_agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1) Gecko/20061010 Firefox/2.0');

$server = urlencode(utf8_encode('Your Realm Name'));
$name   = urlencode(utf8_encode('Your Guild Name'));

 $url = 'http://www.wowarmory.com/guild-info.xml?r='.$server.'&n='.$name;
 $strYourXML = file_get_contents($url);
 die(htmlentities($strYourXML));
?>
Run the code and show here what you get!

Look the code running on my webserver: http://reiserfs.killermonkeys.net/scrip ... /teste.php
cyberken wrote:Firstly - great mod - the WoW fans on my site are loving this :)

I have 1 question - a few of the members have flash signatures and the tooltip opens up behind that signature - its the same in both IE7 and Firefox - any ideas?
This can be a layer problem. i will check some CSS parameter to set the DIV layer in front of every other layer. Flash Object layers always are on the front.

User avatar
bigbabol
Registered User
Posts: 17
Joined: Wed Aug 01, 2007 7:23 pm
Location: Greece

Re: [RC1] Armory World of Warcraft Items Tooltip

Post by bigbabol »

any news reiserfs about line 466? :D

lyf
Registered User
Posts: 13
Joined: Wed Mar 30, 2005 3:55 pm
Location: Denmark

Re: [RC1] Armory World of Warcraft Items Tooltip

Post by lyf »

flokohlert wrote:lyf you already made it to the right place ;)
now there should be a button "add bbcode" click it and you are done.
Sorry, but really can't find it. Here's a screenshot of my status: http://lyf.dk/bbcode_gone.jpg

User avatar
bigbabol
Registered User
Posts: 17
Joined: Wed Aug 01, 2007 7:23 pm
Location: Greece

Re: [RC1] Armory World of Warcraft Items Tooltip

Post by bigbabol »

lyf wrote:
flokohlert wrote:lyf you already made it to the right place ;)
now there should be a button "add bbcode" click it and you are done.
Sorry, but really can't find it.
It's under posting Category m8 :D

hansjorgen
Registered User
Posts: 8
Joined: Tue Aug 29, 2006 9:06 am

Re: [RC1] Armory World of Warcraft Items Tooltip

Post by hansjorgen »

This is very odd. First you have to test if you server can open a remote site.

Try this code

Code: Select all

<?
ini_set('user_agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1) Gecko/20061010 Firefox/2.0');

$server = urlencode(utf8_encode('Your Realm Name'));
$name   = urlencode(utf8_encode('Your Guild Name'));

 $url = 'http://www.wowarmory.com/guild-info.xml?r='.$server.'&n='.$name;
 $strYourXML = file_get_contents($url);
 die(htmlentities($strYourXML));
?>
Run the code and show here what you get!

Look the code running on my webserver: http://reiserfs.killermonkeys.net/scrip ... /teste.php
Looks like it works:
http://www.darksunguild.net/test.php

Locked

Return to “[3.0.x] Abandoned MODs”