Extension talk:WoWItem

i changed a few lines in the file urlreader.php to be able to use german item names.

function itemstats_read_url($url) {        global $wgLanguageCode; // Try cURL first. If that isn't available, check if we're allowed to        // use fopen on URLs. If that doesn't work, just die. if (function_exists('curl_init')) {                $ch = curl_init($url); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $language = $wgLanguageCode; curl_setopt ($ch, CURLOPT_HTTPHEADER, array("Accept-Language: ".$language.",".$language."-".$language.";"));

probably it would be better to include an additional tag like lang inside of the tag, i.e. . perhaps it makes sense to include a array of the available armory languages and check if the wiki language is one of them, if not "en" should be used. i only hacked in fix to use the wiki language.

Added. Egingell 06:39, 13 April 2008 (UTC)

errors installing on mediawiki 1.12
Extension returned immediate errors. Not sure if this is a problem with my PHP setup, or what. I'm running PHP 5.2.6 on a Linux server (Apache 1.3.41).

First problem was a script error saying $WoWItem_site was not defined. I fixed that by adding "$WoWItem_site = 'wowarmory';" on line 28 of the wowitems.inc file.

Then I got these errors with a simple page that just says " Fang of Venoxis ":

Notice: Trying to get property of non-object in /home/warcraft/public_html/wiki/extensions/WoWItem/wowitem.inc on line 43

Notice: Undefined index:  html in /home/warcraft/public_html/wiki/extensions/WoWItem/wowitem.inc on line 46

Notice: Undefined index:  html in /home/warcraft/public_html/wiki/extensions/WoWItem/wowitem.inc on line 46

Notice: Undefined index:  img in /home/warcraft/public_html/wiki/extensions/WoWItem/wowitem.inc on line 52

Notice: Undefined index:  img in /home/warcraft/public_html/wiki/extensions/WoWItem/wowitem.inc on line 52

Notice: Undefined index:  img in /home/warcraft/public_html/wiki/extensions/WoWItem/wowitem.inc on line 55

Notice: Undefined variable: begin in /home/warcraft/public_html/wiki/extensions/WoWItem/includes/wowarmory.php on line 55

Notice: Undefined variable: begin in /home/warcraft/public_html/wiki/extensions/WoWItem/includes/wowarmory.php on line 73

Those last two lines repeat many times. It's dying on this code segment:

if (!$wlwowitem->init) { $wlwowitem = new wowiteminfo; }

I think because it's trying to run the init method on an object that hasn't been created yet.

Suggestions?

joe