IRC log for #wowroster on 20090316

14:44.28*** join/#wowroster Movix (n=mattes@82.242.144.196)
15:58.50*** join/#wowroster Gaxme (n=Gaxme@76.76.51.25)
15:59.24GaxmeAhh, good to be back. =)
16:21.08GaxmeWell, not the most elegant solution, but I found one to that object property problem.
16:56.31Zanixcoolness
16:56.55PleegWatnice
17:00.39GaxmeSo I see that Ulminia took the ajax stuff out of the updater. I'm not super familiar with Ajax or innerHTML, but I had been considering using a simple Ajax call for loading data to the screen for the raidtracker, rather than having to reload the page. Are there overall problems with doing that in the roster? Or with then porting it to other platforms?
17:03.08GaxmeUgh, apparently I need to fix the way tooltips are parsed too. It's throwing the object name and the icon name at the bottom of the tooltip. *ponder*
17:03.31ZanixIm not sure, I think I remember it working in the RosterDF port
17:04.09PleegWathttp://nl2.php.net/manual/en/simplexml.examples-basic.php
17:04.39PleegWatAccess an attribute as an array element, and a tag that isn't a valid name as {'tag-name'}
17:07.06GaxmeMuch better. Thank you.
17:07.18GaxmeNot that creating a new variable and destroying it doesn't work, but still.
17:07.21GaxmeWhy waste the memory.
17:08.57PleegWatThis is probably faster too
17:18.27Zanixcool
17:18.49GaxmeHrm. Well... That's not letting me extract it either.
17:19.10Gaxmefullitem->itemInfo->item->{'@attributes'}['icon'] etc doesn't pull.
17:19.17GaxmeAnd assigning it to a temporary variable and dumping it shows:
17:19.25GaxmeString SimpleXMLElement::__set_state(array(
17:19.47PleegWat$item = $fullitem->itemInfo->item['icon'];
17:20.16Zanix"SimpleXML includes built-in XPath support"
17:20.19Zanixthat is just cool
17:20.23ZanixI didnt know that
17:20.23PleegWatIt's a php5 thing - it uses an interface to apply language semantics to objects
17:20.56PleegWat$ php --rc SimpleXMLElement
17:20.56PleegWatClass [ <internal:SimpleXML> <iterateable> class SimpleXMLElement implements Traversable ]
17:21.30PleegWatThere's no reference on interfaces, but Traversable includes ArrayAccess and Iterable
17:21.49GaxmeHrm. That doesn't pull it though, Pleeg. Gives no data without decending into @attributes
17:22.06PleegWatWhich basically means $item['icon'] turns into $item->getArrayElement('icon'); somewhere behind the scenes
17:23.56PleegWathm
17:24.15Zanixare you using simplexml Gaxme?
17:25.13GaxmeWell... I thought so.
17:25.26Zanixor the xml parser in roster?
17:25.33ZanixI dont think it uses simple xml
17:25.47Zanixsince its still trying to be compatible with php4
17:25.49PleegWatroster's XML parser is minixml
17:25.51Zanixand simplexml is php5 only
17:26.02Zanixthere is also another one, its lighter
17:26.09GaxmeI guess Roster's, because I'm calling out to the armory class
17:26.20Zanixyeah, and that uses the simpleparser
17:26.41PleegWatWhat dump function are you using to get at the contents? Roster's?
17:26.55Gaxmeaprint(var_export($variable,true));
17:27.15GaxmeSo a combination. =)
17:27.24PleegWatforget the var_export. You can run aprint() directly.
17:27.30GaxmeAhh, ok.
17:27.54PleegWataprint() does objects as well as arrays - that's one of the main reasons we wrote it
17:29.25GaxmeCheck.
17:29.40PleegWatOr did zanix write it for the formatting and I added objects later?
17:29.58PleegWatI know I added resources at some point - print the name of the resource type. var_export just prints NULL.
17:31.34ZanixI did the formatting, you aded object output
17:33.12GaxmeOk, now that's just wierd.
17:33.44GaxmeSo if I assign $temp = fullitem->itemInfo->item;
17:33.52GaxmeAnd then pull $temp['icon']; it works.
17:34.05GaxmeIf I try to pull fullitem->itemInfo->item['icon'] it fails.
17:34.41GaxmeI must have a bug in here somewhere.
17:34.44GaxmeThat makes no sense.
17:36.05PleegWatDoes sound weird
17:36.21PleegWatCan you have multiple 'item' tags in an 'itemInfo' tag?
17:37.06GaxmeNone that I've seen yet
17:37.11PleegWatMight be worth trying $fullitem->itemInfo->item[0]['icon']
17:38.33GaxmeShit, yes you can
17:38.37GaxmeSorry, language.
17:39.16GaxmeThe base object has attributes, and they have a "disenchantLoot" element that also has item->@attributes
17:39.24GaxmeOk, trying the first array element.
17:40.33PleegWatActually shouldn't matter. The parser can't know the structure, so it should transparently take the attributes/subelements of the first object if there's only one
17:45.43GaxmeOk, got that working. Now I just need to figure out why my locale array isn't working.
17:45.49GaxmeNot sure where the bug was there, but it's fixed.
17:46.01GaxmeI change too many things too fast. Hard to track myself. *chuckle*
17:46.17GaxmeIs locale still read by $roster->locale->act['variable']?
17:46.20GaxmeOr has that changed?
17:46.25PleegWatstill there
17:46.29Gaxme*nod
17:46.30Zanixyep
17:47.04Zanixor if you need a specific locale variable $roster->locale->wordings['enUS']['variable']
17:47.11Zanixiirc
17:57.03GaxmeAhh, that was the problem. So the variable that it was pulling (in this case 'color') from the item struct wasn't clean.
17:57.11GaxmeI typecast it to int, and it works again.
17:57.48GaxmeKnocking things down one at a time!
17:57.51PleegWatYeah, it's weird behavior, though it's on the site. It returns everything as objects.
17:58.04GaxmeFigure I'll get the caching fixed first, then work on the rest of the frontend.
17:58.05PleegWatIf you want to compare attribute or tag contents to something, cast to string first
17:58.12GaxmeI'll do that.
17:58.38GaxmeI have a simple routine that pulls the color string from an indexed locale array.
17:58.44GaxmeMakes it easier to localize than the DB.
17:58.52GaxmeThere's enough DB localization that will need to happen for zones and such.
17:59.09GaxmeThough, once that's done, it's really easy to set up.
18:00.35GaxmeThanks for the help, guys. =)
18:00.47GaxmeMaybe I can acutally get this bugger finished this time.
18:01.34Zanixheh
18:03.57ZanixIm going to go pick up my GF from class, then lunch, then work...see ya in a few hours
18:03.59Zanixlol
18:04.05PleegWatcya
18:05.07GaxmeEnjoy that. =)
18:49.51*** join/#wowroster Anaxent (n=Anaxent@216.207.124.226)
19:52.51*** join/#wowroster poetter_ (n=poetter@g224085229.adsl.alicedsl.de)
20:04.25GaxmeWell that's interesting. So, any idea why strip_tags on an armory tooltip would add the item and icon name to the end?
20:06.44GaxmeNevermind, answered my own question.
20:07.06GaxmeSo something is tagging the bottom of the HTML tooltips. Not sure whether it's the armory or the roster.
20:07.25Gaxme<div id="XssName28800" style="display: none;">Hammer of the Naaru</div>
20:07.40Gaxme<div id="XssIcon28800" style="display: none;">inv_hammer_28</div>
20:10.58*** join/#wowroster Movix1 (n=mattes@82.242.144.196)
20:14.42GaxmeUgh, I suck with regular expressions. Any idea how I'd remove those with a preg_replace?
20:26.40*** join/#wowroster Movix2 (n=mattes@82.242.144.196)
20:31.55*** join/#wowroster Movix (n=mattes@82.242.144.196)
20:39.32*** join/#wowroster Movix3 (n=mattes@82.242.144.196)
21:28.43GaxmeThere we go. Working tooltips.
21:41.35GaxmeOk, I have now beat up my brain enough today. Time to run! See you guys later. Thanks again for the help, Z and Pleeg.
21:46.00*** join/#wowroster Movix (n=mattes@82.242.144.196)
22:21.19*** join/#wowroster PleegWat (n=PleegWat@212-123-189-114.ip.telfort.nl)
22:21.19*** mode/#wowroster [+o PleegWat] by ChanServ
23:46.42*** join/#wowroster Zanix (n=Zanix@67-61-239-171.cpe.cableone.net)
23:46.42*** mode/#wowroster [+o Zanix] by ChanServ

Generated by irclog2html.pl Modified by Tim Riker to work with infobot.