Drupal and Itemstats Input Filter
This is a Drupal module for World of Warcraft and Itemstats 1.55. It creates a filter that translates the tags [item], [itemico], and [itememb] into representations of in-game loot.
http://losmuertos.houseofbob.net/drupal_itemstats.zip
I still have:
- Integrated Itemstats' view_cache.php
- Added support for 3 tags ([item], [itemico], and [itememb])
- Created a flexible site settings form.
I have decided not to integrate:
- Fake items from the Itemstats xml_cache (You'll have to manually add view_cache files).
- Write extensive help
Where I expect Itemstats-Warcraft-Drupal Modules to go:
- Extending Itemstats' site filters to query and cache Blizzards item DB guaranteeing more accurate item information.
View the easy to parse XML from the source:
http://armory.worldofwarcraft.com/item-tooltip.xml?i=30374
- Tying Blizzard's Armory into the Drupal profile (by downloading and parsing the character XMLs every week or so):
It has everything.. Rep to figure out who has Heroic keys, tradeskills, Equipment, and even enchants and gems!
View the source on the following for an example:
http://armory.worldofwarcraft.com/character-sheet.xml?r=Alexstrasza&n=Bo...
TO install:
1) Install Itemstats ( http://itemstats.free.fr/news.php?lang=en-US )
2) Copy 'drupal_itemstats.php' into the root of your 'itemstats/' install directory.
3) Unzip the folder 'modules' into the drupal base directory.
4) Go to 'Home » Administer » Site building » Modules' to activate 'Warcraft Itemstats' under the 'Optional' sub-section.
5) Go to 'Home » Administer » Site configuration » Warcraft Itemstats settings' and enter path information.
6) Go to 'Home » Administer » Site configuration » Input formats' and 'configure' each input format to include the Itemstat filter.
7) Make a new test post to ensure everything is functioning as intended.
I've made it GPL, and have no interest in maintaining it... so feel free to make improvements and even CVS it if you want to spend the time.

Other Important Links
Other important links:
http://www.rpgoutfitter.com/addons/wowinterface.cfm (icon packs)
http://itemstats.free.fr/news.php?lang=en-US (Itemstat)
I can't remember where I obtained the socket icons.
Display site:
http://losmuertos.houseofbob.net
thoughtlover... I was
thoughtlover...
I was already working on a module when I located your solution 2 days ago. I'm willing to maintain this module if you aren't willing to do so.
thanks
-t
Tony Guntharp
Co-Founder SourceForge.net
fusion94@damagestudios.net
issues...
So this appears to be working for the most part except for a small issue.
I configure the location to itemstats via the Warcraft Itemstats settings page as such:
URI of Itemstats:
itemstats/
Location of the Warcraft Itemstats directory from docroot.
Name of Itemstats Hook Script:
drupal_itemstats.php
Name of the Warcraft Itemstats hook php script (inside Itemstats URI).
URI and Name of the Overlib JS:
itemstats/overlib/overlib.js
Location of the overlib tooltip script from docroot.
URI and Name of the Itemstats CSS:
modules/warcraft_itemstats/drupal_itemstats.css
Location of the Warcraft Itemstats CSS template from docroot.
(There is a custom one for Drupal named drupal_itemstats.css in the module directory)
Now when I create a forum post using [item]Shadowcast Tunic[/item] the url to click on the item goes to:
http://extinctionservices.com/forums/officer-country/admin/itemstats/upd...
and not
http://extinctionservices.com/itemstats/updateitem.php?item=Shadowcast%2...
Apparently this might have something to do with pathauto.
Any thoughts? Ideas?
thanks
-t
Tony Guntharp
Co-Founder SourceForge.net
fusion94@damagestudios.net
If you want to maintain it,
If you want to maintain it, go ahead. It was a project I just wanted to complete, but I quit WoW about a week ago. This is why I'm not starting a CVS version of it somewhere, because realistically I won't be willing to maintain it. I may, however, take a stab at creating a filter that retrieves item information directly from Blizzard's armory (which wouldn't be hard to do at all considering they essentially provide XML data and the XSL files to transform it into a tooltip).
I ran some tests, and there does appear to be some lingering path issues with updateitem.php. I'll toy with it, but I am unfamiliar with Pathauto (should that be an issue). If you discover a fix, I'll update my zip file.
Also.. I just updated the zip file to add "=> Clear unfound objects" on the Home » Administer » Content management » Warcraft Itemstat Database Page.
Update: I think I see what the problem is.. I might have a fix soonish.
New version, same zip
Ok. I have changed a bunch of things.
- I pulled view_cache.php into the module so that I could change the code a bit,
- I gave item numbers priority over item names (because of items like Atiesh, Greatstaff of the Guardian, for instance).
- I added an "absolute path" for the itemstats directory
- I fixed two small update.php path bugs...
HOWEVER, I am not sure if this will fix your problem. If not, I shall have to make an attempt to understand Pathauto better (a URL redirect module I'm assuming).
A couple small changes
This whole thread should probably be under Module Development, if the thread can be moved.
I added a couple hacks to the drupal_itemstats.php to make life easier.
1) I tweaked the output a bit so that multiple [itememb]s can be placed next to each other. For instance:
a) [itememb]x[/itememb][itememb]y[/itememb][itememb]z[/itememb] will produce 3 embedded items on the same row in a table.
b) [itememb]x[/itememb][itememb]y[/itememb] [itememb]z[/itememb], however, will produce 2 embedded items on one row, and one embedded item on the next row.
2) I also added a new tag [itembi]. While the tag does not make items bisexual, it does create an item icon and item name link at the same time.
Hopefully I didn't break anything. If You want to see what all these tags to in Drupal, visit my test site at http://losmuertos.houseofbob.net ... If it is broken, I'm probably testing something so try again later
If anyone can feed me reproducible information about situations that break this module, I'll see what I can do to fix it.
Itemstats Problem
Hmm... I installed your module and it creates a link, but not one linking to the actual WoW item:
http://hokage.org/node/129
Any tips would be greatly appreciated, thanks.
-K
First, it looks like your
First, it looks like your HTML filter has a higher weight than the Item Filter, and is devouring the item's html as a result.
Change it in Home » Administer » Site configuration » Input formats -> Configure (Filtered HTML input format) -> tab Rearrange
Second, it appears the link isn't scanning Allakhazam immediately. This is likely because "itemstats/config_itemstats.php" needs tweaking. Find the line "define('automatic_search', false);" and change it to "define('automatic_search', true);"
Third, similar to fusion94, you seem to be using the "http://hokage.org/node/129" URI notation over the "http://hokage.org/?q=node/129" notation. I am NOT familiar with this Drupal option (I've only been using Drupal for about 2 weeks), and It is obviously screwing up the call to "update.php" call. Please tell me how to turn this on so I can troubleshoot it.
Got it working, thanks for
Got it working, thanks for the help thoughtlover.
How did you get it working?
How did you get it working? I'm having the same problem - the /node/ bit is being added to the updateitem.php url every time I try to click a new link anywhere but in a story. I think it has something to do with using clean URL's, but I'm not sure how to get it to reference updateitem.php correctly in all cases.
I have made some changes
I have made some changes that should fix the redirect issue, but I haven't had the opportunity to test it with clean URLs. It now calls a Drupal path to do the update instead of calling updateitem.php directly. Tell me if that fixes the issue.
Aslo, updating FAKE ITEMS doesn't work from inside Drupal, but if you call view_cache.php directly and update it there, that FAKE ITEM will thereafter be in the database and will be visible in Drupal.
Neat!
This is really cool! Nice work. I'm installing it now for a guild site I'm working on for some friends. :)
I also think you are spot-on about using armory data. When armory was released I became excited about the possibility of integrating it with guild sites... just have never spent any serious time to try parsing the data. The potential is huge, though--guilds could automatically synch their roster information, item priorities, etc. in real time.
Warcraft Armory
I am, in fact, working on just such an Armory integration. You can see the Armory Item node type on my test site near the bottom sometimes; they look just like the armory tool tips. Making them node types makes them just like any other Drupal content type: you can add comments to them, manage them through Content Management, and create Taxonomy relationships. I'm currently working on the Armory import.
No promises about when I'll be done, but when I am it should be a simple matter of replacing the Itemstats filter with the Armory Item Filter, as I plan to implement the same tags ([item][itemico][itememb][itembi]).
Is there any way to get this
Is there any way to get this to work in the 4.x version of drupal? I've installed the module and all the items are coming up and listing but when I use the tags eg [item]Despair[/item] it comes out as plain text and looks like there's no input filter parsing it? What am I supposed to do?
Nothing formatted
When i'm tryin to post any [item] tags -- at output i'm receiving "as is".
What i did?
1) Downloaded and unpacked Itemstats at /itemstats.
2) Edited /itemstats/config.php for correct MySQL info.
3) Downloaded module, put it at /modules.
4) Enabled module at site configuration.
5) Enabled filter at default filter setting (now it's: Itemstat, BBCode).
6) Gave -10 priority to Itemstats at filter settings.
7) Trying to post message with any of Itemstats tags (e.g. [item]Stiletto[/iteam) -- receiving same at output ([item]Stiletto[/item]), just plain text at any pages.
What i did wrong?
Error While module is activated
Hello There,
I installed this great module, but when the module is activated, I get the following error:
string(40) "Unable to connect to SQL host: localhost" string(40) "Unable to connect to SQL host: localhost"
I think it has something to do with my config.php from itemstats.
I wonder to what database this module hase to be linked? All new Database, or just the normal drupal database?
Same Issue
"When i'm tryin to post any [item] tags -- at output i'm receiving "as is"."
I'm getting the same issue. What am I doing wrong?
And...
When I click the "Save configuration" button on the module's config page, I get all sorts of MySQL errors. What am I not doing here? It seems like Itemstats hasn't been set up properly. Are there database tables that I should have created? I looked over the installation page on the Itemstats Web site, and it's horrible, to say the least, so I'm not sure I have set it up properly so that your module can use it.
Are there tables that I need to create or something?
Please let me know.
No popup
Cant figure this one out....everything works 100%, except that there is no popup.
I did a test php page in the root of my site (i.e. outside drupal) and the popup works fine.
So, something to do with drupal then. The items are collected from Allakhazam just fine,the links to Alla are correct, the mysql table is updated...but no popup.
Ofcourse I checked in Input Formats in Drupal admin, clicked Rearrange and in each case the Itemstat filter is 10 (with all other items much lower (0, 1, 2).
Would love some help please, from anyone.
Thanks.
Got it working, but no popup either
Same exact issue you are having, JonoB. Going to the view_cache.php page inside the Itemstats folder gives me a popup for all the items in the cache. Inside Drupal, I WAS getting a popup, once. Then I refreshed the page, and it no longer works at all inside Drupal. What's going on here?
While I am no longer really
While I am no longer really working on this project... things I've seen in the past:
- Dated templates that do not include the javascript include call (or Css call)
- Attempting to use on a version of Drupal it was not written for
As I've stated... if anyone wants to take this project over have at it... That is why it is under the Gnu Public license after all.
Can't install module
I need some help. I am trying to install the module for the guild website. We are running Drupal 5.2. When I upload the module and activate it I get the following message.
Parse error: parse error, unexpected T_OBJECT_OPERATOR in /home/content/j/r/o/(username)/html/drupal/modules/warcraft_armory/warcraft_armory.module on line 1351
Every page I go to gives the same error until I delete warcraft_armory.module from my server.
I took my username out for security reasons and replaced it with "username."
I looked at line 1351 in the warcraft_armory.module and it is ); I am a total noob at php, don't know the first thing about it. Any ideas?
I reiterate.. I am done
I reiterate.. I am done maintaining this module. However.. at a guess I'd say you are running php4.
When I wrote Drupal_Armory (which is different than Drupal_itemstats), I had to make a choice between PHP5's DOM vs PHP4's DOMXML because they are not compatible. In hindsight it was the wrong choice as I could have used http://alexandre.alapetite.net/doc-alex/domxml-php4-php5/index.en.html (which I didnt know about then) to make them compatible on php4, php5, and php6. IF I were still maintaining this module, I would probably rewrite to use the old DOM standard and use http://alexandre.alapetite.net/doc-alex/domxml-php4-php5/index.en.html or the PECL Repository to make it compatible with PHP5 and 6.
The code you are refering to comtains DOM (php5) instead of DOMXML(php4)... objects instead of arrays:
1352 $title = $dom->getElementsByTagName("name")->item(0)->nodeValue;
1353 return array("html" => $html,
1354 "title" => $dom->getElementsByTagName("name")->item(0)->nodeValue,
1355 "iid" => $dom->getElementsByTagName("id")->item(0)->nodeValue,
1356 "locale" => $dom->getElementsByTagName("page")->item(0)->getAttribute("lang"),
1367 "rarity" => $dom->getElementsByTagName("overallQualityId")->item(0)->nodeValue,
1368 "icon" => $dom->getElementsByTagName("icon")->item(0)->nodeValue,
1369 );
However you could just try updating to a more current version of PHP4 as: (I have not tested this)
"The DOM XML extension has been overhauled in PHP 4.3.0 to better comply with the DOM standard. The extension still contains many old functions, but they should no longer be used. In particular, functions that are not object-oriented should be avoided."
PHP4 ref: http://us.php.net/manual/en/ref.domxml.php ( http://us.php.net/manual/en/function.domelement-get-elements-by-tagname.php )
PHP5 ref: http://us.php.net/dom ( http://us.php.net/manual/en/function.dom-domelement-getelementsbytagname... )
As of 13-Jul-2007, PHP 4 is at the end of its lifetime( see http://us.php.net/), so you should probably consider upgrading. It is possible to have both on one server, and have different sites on the same server run different php versions by configuring Apache so the PHP version is different for each site (though this can be tricky to setup).
If you upgrade to php5, be careful.. I had to reinstall Drupal when I did it (make a backup of your data so you can import it somehow later).
Quick question
Thoughtlover,
I have the module installed and working, I just have one leetle bitty problem I'd like you to *please* take a quick glance at: the background of my mouseovers are clear instead of black.
If you, or anyone else here has an idea of what I need to change, I would love to hear some feedback. Thanks!
http://www.warcraftier.org/?q=node/5
It looks like the CSS
It looks like the CSS template: drupal_itemstats.css isnt getting included.
This could be because the theme omits include near the top:
<?php print $styles ?>( psd-resources templates leave this out for some reason.)<span class=quality4>Destruction Holo-gogs</span>should equate to
{color: #A335EE; font-weight: bold;}but it is clearly not purple.
Also, it looks like the itememb/itembi stuff is failing. Itemstats never conceived of embeding/having both an icon and text, only tooltips. Undoubtedly some identifying keyword/format I relied upon to to parse the tootip output into an embedded/bi form form was changed... so the regular expressions in that reguard need to be tweaked... that or just pretend itembi/itememb don't exist (because I'm not gonna fix it, I am Done with this project:P)
Not sure if you are still checking this...
But I fixed this on my site.
I moved the dupal_itemstats.css to my theme folder and changed the appropriate setting on the admin/settings page. I multisite my drupal install and I think it was having problems grabbing the css from the path to the subsite modules folder.
Hope that helps!
See example here:
http://www.bofif.com/forum/announcements/website-suggestions/itemstats-t...