Page 3 of 44

Re: [RC1] Armory World of Warcraft Items Tooltip

Posted: Sat Sep 01, 2007 11:49 am
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.

Re: [RC1] Armory World of Warcraft Items Tooltip

Posted: Sat Sep 01, 2007 11:50 am
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.

Re: [RC1] Armory World of Warcraft Items Tooltip

Posted: Sat Sep 01, 2007 12:52 pm
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.

Re: [RC1] Armory World of Warcraft Items Tooltip

Posted: Mon Sep 03, 2007 6:29 pm
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.

Re: [RC1] Armory World of Warcraft Items Tooltip

Posted: Tue Sep 04, 2007 12:20 am
by bigbabol
Image

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

Re: [RC1] Armory World of Warcraft Items Tooltip

Posted: Tue Sep 04, 2007 6:54 pm
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.

Re: [RC1] Armory World of Warcraft Items Tooltip

Posted: Wed Sep 05, 2007 9:13 am
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?

Re: [RC1] Armory World of Warcraft Items Tooltip

Posted: Wed Sep 05, 2007 12:55 pm
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

Re: [RC1] Armory World of Warcraft Items Tooltip

Posted: Wed Sep 05, 2007 2:01 pm
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.

Re: [RC1] Armory World of Warcraft Items Tooltip

Posted: Wed Sep 05, 2007 4:21 pm
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?

Re: [RC1] Armory World of Warcraft Items Tooltip

Posted: Wed Sep 05, 2007 6:16 pm
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.

Re: [RC1] Armory World of Warcraft Items Tooltip

Posted: Thu Sep 06, 2007 6:41 am
by bigbabol
any news reiserfs about line 466? :D

Re: [RC1] Armory World of Warcraft Items Tooltip

Posted: Thu Sep 06, 2007 6:59 am
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

Re: [RC1] Armory World of Warcraft Items Tooltip

Posted: Thu Sep 06, 2007 8:26 am
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

Re: [RC1] Armory World of Warcraft Items Tooltip

Posted: Thu Sep 06, 2007 9:48 am
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