This site makes extensive use of JavaScript.
Please enable JavaScript in your browser.
Live
PTR
10.2.5
PTR
10.2.6
Add Wowhead tooltips to your forums or CMS.
Return to board index
Post by
Lockslap
The newest version has been released, you may download it
here
. Please see CHANGELOG.txt located in the zip file for changes made. This version
REQUIRES
PHP 5.x in order to function, so if you're not using it then the script will not work.
I am still working hard on the complete rewrite and hope to have a working version soon. I am rewriting functions.php into a class so that practically anyone could use this class as the base of a similar script. It will contain all of the functions that my script uses to get any sort of info from Wowhead. It will take me a little while to get it written and test, because I had to brush up on my class writing in PHP (haven't done it in a couple of years). This upcoming version will be 2.0, and hopefully much improved with most of the bugs worked out. I have come to the conclusion that I will be using SimpleXML for XML parsing, so those of you that use PHP 4.x the script will not work for you, my apologies but I don't know of any other XML parsers that will handle CDATA and be as simple to use as SimpleXML is.
Stay tuned!!!
By the way, if you have any issues with the version that I had just released, please post here with any errors that it gives and then we'll get ya squared away.
EDIT
After playing around for a bit, I have come to the conclusion that using the user's language settings is not possible to determine which tooltip will be used due to the different variations to similar languages. For example, there are at least 3 different German translations, and all use different abbreviations. Therefore, to have different languages in the script, the admin will have to set the language that they wish to use.
EDIT #2
Purely by accident I discovered a bug in the newest release version of the script that arises from my code to strip headers. This bug has been fixed and the code should function properly when finding quests/spells.
Post by
Lockslap
Okay, now the Wowhead class is complete. It handles all of the queries to Wowhead, now I am just writing the script that will actually do things with the info the class will give it. My goal is to combine all of the 'preg_match()' calls into one to keep things smooth and possibly speed up execution. All of the features previously found in the script will be there when version 2 is release, with the exception of the user-defined language.
Hopefully, some time later on tonight (Saturday night) I will have a release version up and running. We'll see.
Post by
90697
This post was from a user who has deleted their account.
Post by
Lockslap
I don't have the time this weekend to work through your new scripts and find out where the mistake is or look for the things you are still working at but haven't released yet, but right now the multi-language support doesn't work at all anymore.
Colorcoding in different languages different from English also doesn't work (inside the cache the names are still used like 'Epic')
The language of the item link and the tooltip seems to be dependant on the cache entry.
And for the forum languages: The ones you used in one of your previous versions worked fine for me - maybe you could give the user the choice how to handle which forum language setting.
I would suggest to add "name_en", "name_de", name_fr", "name_es" to the chache and create the wowhead item link on the fly as intended, leaving the four names, the quality, the id and the type left to be stored.
Thanks a lot for the support you give.
All of what you suggest would require quite an overhaul of the old code, which I'm not gonna do due to me currently rewriting everything to be more efficient, and have better features. I am changing the way the script gets the quality information (it will get the # rather than the word, thereby making language irrelevant). This will also require some changing around of
wowhead.cache
to account for this, but all in all it will be better suited.
In terms of different languages and the cache, in the newest version the link (and in turn the tooltip) will be generated on the fly with a function that is written into the wowhead class.
I am hoping to have a working version posted sometime tonight or tomorrow.
Post by
Lockslap
A quick update before I goto sleep. I have been working hard on the new class and script to handle everything. The primary reason for turning this into a class is I would like to port (or have people port) the class for use on other PHP forum software, for example, Invision or vBulletin.
Now the class will handle all of the workings with Wowhead on it owns, all you give it is what to search for, the type (item, spell, quest), and the rank (if its a spell) and then it will figure out what method to use to get the info and store it for you. I kept the MySQL portion out of the class to allow other PHP scripters to be able to write their own versions of the script to actually handle the information the class will get (ie port it to other forum software, etc.).
I have also been working on the new
parse.php
and have been able to work the script into only 1 while-loop, using only 2 preg_match() calls. This should speed up script execution, even if its undetectable, but its nice to know the script is as efficient as possible.
One feature I did have to remove was the ability to specify the link color of the item using {item name}
This is due to the script supporting multiple languages now. With the script formerly using the worded quality (epic, rare, etc.) it was possible to specify the proper span class (from
wowhead.css
) to set the color, but now that the script is multi-language supporting the quality names are dependant on the language you use. I have considering using the quality ID (0 to 6), but I don't expect people to remember what quality is equivalent to what number. Besides that, its not really an important feature. The class will also not rely on the worded quality to set the color of the link, it will now depend on the quality's ID. One feature that will remain is the ability to have a specific quality to always use
wowhead.css
to determine it's style.
I will be able to release version 2 of the script/class tonight (Monday night), I just have to write the function 'whp_parse()' to be able to handle the information, and add it to MySQL. Thank you for your patience and I apologize if this post doesn't make all that much sense; I am tired.
EDIT
I couldn't sleep, so I decided to finish up
parse.php
and then release it as a
BETA
release. For those that don't know what that is: BETA software is released so that testing may be done on it to work out any kinks or suggest changes. I wrote
parse.php
over the past couple of hours, so there may be bugs, although I have tested it thoroughly on my guild's website. Anyone that would like to take it through its paces, please do. The installation instructions are the same as the old version,
except that you MUST run create_table.php.
The MySQL table scheme has been changed, so you must run the script to make sure the table is compatible. You can download it by clicking
here
, see below.
Also, I have created a page for this script on
Google Code
. This was done with the intent that the class would get implemented into scripts for other forum software. This way, as people (or myself) release them, they will remain in a centralized place. I will maintain a changelog for the script/class on this page, as well as installation instructions. The page also has places where users can report bugs, and suggested features.
So on that note, enjoy! Let me know if problems arise.
Post by
xodium
This used to work great when the PHP5 was not a requirement, unfortunately my host uses PHP4
PHP Version 4.4.8
System Linux vanowen 2.4.32-grsec+f6b+gr217+nfs+a32+fuse23+++opt+c6+gr2b-v6.192 #1 SMP Wed Dec 14 17:06:16 PST 2005 i686
Build Date Jan 25 2008 10:00:44
Is there a repository where you keep the old versions, I do not want anything fancy like quests, spells, or German or Spanish, just being able to do
ITEMNAME
will suffice, and I believe an older version would allow me to do this.
Thanks!
Post by
Lockslap
I am currently looking into other XML parsers that will support PHP4/5 and allow me to read the data properly.
Post by
Lockslap
The newest version 2.0.1 now supports PHP4 using an external XML class. It is slower than the PHP5 SimpleXML, but it gets the job done! This release will remain BETA quality until people have had a chance to run it through its paces and report any issues they have found. Once this has been done I will release it, until then anyone is encouraged to try it out and report their findings.
Download:
http://wowheadtooltips.googlecode.com/files/wowhead-2.0.1beta.zip
One quick note, if your host uses PHP4 then the script will use
xml.php
to handle its XML parsing. There seems to be a bug that causes a 'headers already sent' warning (does not stop script execution). This is the reason for the error_reporting(0);Line at the beginning of
xml.php
. Perhaps its due to my lack of sleep, but I have searched the XML class top to bottom to try and find a reason for it causing this warning message, but have come up empty. If you can figure out why it does this, then please do let me know, I'd like to fix it. If your host uses PHP5, then you do not have to worry about it, the script will use SimpleXML (build into PHP5).
Later on today I will be added Installation instructions and a changelog to the googlecode page for the script to keep everything centralized.
Enjoy guys!!!!
Post by
159979
This post was from a user who has deleted their account.
Post by
160966
This post was from a user who has deleted their account.
Post by
161026
This post was from a user who has deleted their account.
Post by
161287
This post was from a user who has deleted their account.
Post by
Lockslap
Unfortunately the guild who's website I was testing this addon on has been disbanded. And I am now in a guild that raids 7 days a week, so I am going to have to halt development of this script.
The last version I released above will be the last release. If anyone would like to continue development then feel free, as long as the script remains under the GPL license (version 3).
Thanks for all of the positive feedback and support since I started writing this thing back in Feb.
Lockslap aka craCkpot
Post by
marcimi
Thanks for the great work and have fun raiding 7 days a week. What instances do you raid that you need 7 day's for it?
Post by
160966
This post was from a user who has deleted their account.
Post by
Unbarc
Unfortunately the guild who's website I was testing this addon on has been disbanded. And I am now in a guild that raids 7 days a week, so I am going to have to halt development of this script.
The last version I released above will be the last release. If anyone would like to continue development then feel free, as long as the script remains under the GPL license (version 3).
Thanks for all of the positive feedback and support since I started writing this thing back in Feb.
Lockslap aka craCkpot
Seems that the guild also took down their domain, so the file isn't available anymore; is there someplace else to get it?
**EDIT** Nevermind, it wasn't working for me this morning; now it does.
Post by
169528
This post was from a user who has deleted their account.
Post by
Sarag
I am also having problems with the tag but and work fine. When I preview or post an tag I get the following error:
Fatal error: Call to undefined function: simplexml_load_string() in /f1/content/freecompany/public/forums/wowhead/parse.php on line 59
Here are lines 57-60 of parse.php:
// item wasn't found in the cache, so we have to query wowhead
$data = whp_read_url(whp_generate_domain() . "/?item=" . urlencode($name) . "&xml");
$xml = simplexml_load_string($data, 'SimpleXMLElement', LIBXML_NOCDATA);
if ($xml->error == "")
If anyone has any ideas I'd be very appreciative.
Post by
Talonos
ok i got this working fine except for when i use the {Item Name} or {ID} it just totaly locks me out of the post with a white screen i've tried everything i can think of and hav still come to no prevail could u help me plz
Post by
171689
This post was from a user who has deleted their account.
Post Reply
This topic is locked. You cannot post a reply.