User talk:Ppiotr

From Warcraft Wiki
Jump to navigation Jump to search

LoadArmoryData.php

Continued from User talk:Pcj#LoadArmoryData.php:

Adys's project is to have a database of items, quests, NPCs, and whatever else is in the WoW WDB/DBC files in a machine-readable format. This will in part make generating tooltips and links to them easier. My script's purpose is to connect to the WoW Armory and retrieve the names of items a particular character has equipped. Right now this will be used to help generate item comparison, but there are other possible uses.

So basically, Adys's project is to store all the details of every item, my script's purpose is to retrieve the names of items someone has equipped. --Pcj (TDrop me a line!C207,729 contributions and counting) 12:49, 27 May 2008 (UTC)

Thx for the explanation. Well... let's do it? Before we do proper cache etc. - how to restrict it to just a few characters / classes of characters? How do you call LAD.php from your js code? -- Nef <staff /> (talk) 17:11, 27 May 2008 (UTC)
I'm not sure what you mean by restricting it to a few characters...it should only be one at a time anyway... But LAD.php is called from JS code in Help:Tooltips/preferences.js:loadArmoryData() (I have it pointing to another server for testing, this code is not yet active for all users). The effect of this is an extra field in the Special:Preferences tooltips section which will allow people to save character item data to cookies. As you should be able to see, the PHP code defines the item names in JS-compatible variables, rendering it as content-type:JavaScript. --Pcj (TDrop me a line!C207,729 contributions and counting) 17:44, 27 May 2008 (UTC)
"Only NPC tooltips from realm foo" or something like this. Some kind of restriction which would make you happy with enough test data and me with limited downside. -- Nef <staff /> (talk) 05:21, 28 May 2008 (UTC)
The purpose of my item name gathering script is for comparison of any item with the items a set person (set by the user in Preferences) has collected (and which is stored in Armory). These item names will vary from user to user (see [1] vs [2]) and so any restriction like that would basically make the entire script pointless (the idea is to enable a larger amount of people to be able to use the comparison feature without becoming enmeshed in JavaScript coding). Maybe client-side caching (i.e., only allow updates when cookie is expired) would be better? Unless you can store the item names in the user's profile somehow with a last-updated timestamp... --Pcj (TDrop me a line!C207,729 contributions and counting) 05:41, 28 May 2008 (UTC)
Perhaps I should make clear that the design intent of this code is to store the retrieved character's item data into a cookie (optimally it would save configuration to a subpage of the User's profile page but I haven't gotten that working yet), the PHP script won't run with every page load but is intended only to be run when the user attempts to update from Armory in Special:Preferences. Hopefully we can figure out a suitable caching process. --Pcj (TDrop me a line!C207,729 contributions and counting) 05:52, 28 May 2008 (UTC)
Ok, I can't wrap my head around your wowish world. (-8 I'll ping Kirk to get me in touch with you on skype/irc. Missa wanna more background info. (-; -- Nef <staff /> (talk) 08:18, 28 May 2008 (UTC)
Sorry I got disconnected there, hopefully we cleared some things up. If you still need to talk to me, I should be available on IRC most of the time. --Pcj (TDrop me a line!C207,729 contributions and counting) 23:42, 29 May 2008 (UTC)