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.24 | Gaxme | Ahh, good to be back. =) |
16:21.08 | Gaxme | Well, not the most elegant solution, but I found one to that object property problem. |
16:56.31 | Zanix | coolness |
16:56.55 | PleegWat | nice |
17:00.39 | Gaxme | So 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.08 | Gaxme | Ugh, 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.31 | Zanix | Im not sure, I think I remember it working in the RosterDF port |
17:04.09 | PleegWat | http://nl2.php.net/manual/en/simplexml.examples-basic.php |
17:04.39 | PleegWat | Access an attribute as an array element, and a tag that isn't a valid name as {'tag-name'} |
17:07.06 | Gaxme | Much better. Thank you. |
17:07.18 | Gaxme | Not that creating a new variable and destroying it doesn't work, but still. |
17:07.21 | Gaxme | Why waste the memory. |
17:08.57 | PleegWat | This is probably faster too |
17:18.27 | Zanix | cool |
17:18.49 | Gaxme | Hrm. Well... That's not letting me extract it either. |
17:19.10 | Gaxme | fullitem->itemInfo->item->{'@attributes'}['icon'] etc doesn't pull. |
17:19.17 | Gaxme | And assigning it to a temporary variable and dumping it shows: |
17:19.25 | Gaxme | String SimpleXMLElement::__set_state(array( |
17:19.47 | PleegWat | $item = $fullitem->itemInfo->item['icon']; |
17:20.16 | Zanix | "SimpleXML includes built-in XPath support" |
17:20.19 | Zanix | that is just cool |
17:20.23 | Zanix | I didnt know that |
17:20.23 | PleegWat | It's a php5 thing - it uses an interface to apply language semantics to objects |
17:20.56 | PleegWat | $ php --rc SimpleXMLElement |
17:20.56 | PleegWat | Class [ <internal:SimpleXML> <iterateable> class SimpleXMLElement implements Traversable ] |
17:21.30 | PleegWat | There's no reference on interfaces, but Traversable includes ArrayAccess and Iterable |
17:21.49 | Gaxme | Hrm. That doesn't pull it though, Pleeg. Gives no data without decending into @attributes |
17:22.06 | PleegWat | Which basically means $item['icon'] turns into $item->getArrayElement('icon'); somewhere behind the scenes |
17:23.56 | PleegWat | hm |
17:24.15 | Zanix | are you using simplexml Gaxme? |
17:25.13 | Gaxme | Well... I thought so. |
17:25.26 | Zanix | or the xml parser in roster? |
17:25.33 | Zanix | I dont think it uses simple xml |
17:25.47 | Zanix | since its still trying to be compatible with php4 |
17:25.49 | PleegWat | roster's XML parser is minixml |
17:25.51 | Zanix | and simplexml is php5 only |
17:26.02 | Zanix | there is also another one, its lighter |
17:26.09 | Gaxme | I guess Roster's, because I'm calling out to the armory class |
17:26.20 | Zanix | yeah, and that uses the simpleparser |
17:26.41 | PleegWat | What dump function are you using to get at the contents? Roster's? |
17:26.55 | Gaxme | aprint(var_export($variable,true)); |
17:27.15 | Gaxme | So a combination. =) |
17:27.24 | PleegWat | forget the var_export. You can run aprint() directly. |
17:27.30 | Gaxme | Ahh, ok. |
17:27.54 | PleegWat | aprint() does objects as well as arrays - that's one of the main reasons we wrote it |
17:29.25 | Gaxme | Check. |
17:29.40 | PleegWat | Or did zanix write it for the formatting and I added objects later? |
17:29.58 | PleegWat | I know I added resources at some point - print the name of the resource type. var_export just prints NULL. |
17:31.34 | Zanix | I did the formatting, you aded object output |
17:33.12 | Gaxme | Ok, now that's just wierd. |
17:33.44 | Gaxme | So if I assign $temp = fullitem->itemInfo->item; |
17:33.52 | Gaxme | And then pull $temp['icon']; it works. |
17:34.05 | Gaxme | If I try to pull fullitem->itemInfo->item['icon'] it fails. |
17:34.41 | Gaxme | I must have a bug in here somewhere. |
17:34.44 | Gaxme | That makes no sense. |
17:36.05 | PleegWat | Does sound weird |
17:36.21 | PleegWat | Can you have multiple 'item' tags in an 'itemInfo' tag? |
17:37.06 | Gaxme | None that I've seen yet |
17:37.11 | PleegWat | Might be worth trying $fullitem->itemInfo->item[0]['icon'] |
17:38.33 | Gaxme | Shit, yes you can |
17:38.37 | Gaxme | Sorry, language. |
17:39.16 | Gaxme | The base object has attributes, and they have a "disenchantLoot" element that also has item->@attributes |
17:39.24 | Gaxme | Ok, trying the first array element. |
17:40.33 | PleegWat | Actually 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.43 | Gaxme | Ok, got that working. Now I just need to figure out why my locale array isn't working. |
17:45.49 | Gaxme | Not sure where the bug was there, but it's fixed. |
17:46.01 | Gaxme | I change too many things too fast. Hard to track myself. *chuckle* |
17:46.17 | Gaxme | Is locale still read by $roster->locale->act['variable']? |
17:46.20 | Gaxme | Or has that changed? |
17:46.25 | PleegWat | still there |
17:46.29 | Gaxme | *nod |
17:46.30 | Zanix | yep |
17:47.04 | Zanix | or if you need a specific locale variable $roster->locale->wordings['enUS']['variable'] |
17:47.11 | Zanix | iirc |
17:57.03 | Gaxme | Ahh, that was the problem. So the variable that it was pulling (in this case 'color') from the item struct wasn't clean. |
17:57.11 | Gaxme | I typecast it to int, and it works again. |
17:57.48 | Gaxme | Knocking things down one at a time! |
17:57.51 | PleegWat | Yeah, it's weird behavior, though it's on the site. It returns everything as objects. |
17:58.04 | Gaxme | Figure I'll get the caching fixed first, then work on the rest of the frontend. |
17:58.05 | PleegWat | If you want to compare attribute or tag contents to something, cast to string first |
17:58.12 | Gaxme | I'll do that. |
17:58.38 | Gaxme | I have a simple routine that pulls the color string from an indexed locale array. |
17:58.44 | Gaxme | Makes it easier to localize than the DB. |
17:58.52 | Gaxme | There's enough DB localization that will need to happen for zones and such. |
17:59.09 | Gaxme | Though, once that's done, it's really easy to set up. |
18:00.35 | Gaxme | Thanks for the help, guys. =) |
18:00.47 | Gaxme | Maybe I can acutally get this bugger finished this time. |
18:01.34 | Zanix | heh |
18:03.57 | Zanix | Im going to go pick up my GF from class, then lunch, then work...see ya in a few hours |
18:03.59 | Zanix | lol |
18:04.05 | PleegWat | cya |
18:05.07 | Gaxme | Enjoy 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.25 | Gaxme | Well 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.44 | Gaxme | Nevermind, answered my own question. |
20:07.06 | Gaxme | So something is tagging the bottom of the HTML tooltips. Not sure whether it's the armory or the roster. |
20:07.25 | Gaxme | <div id="XssName28800" style="display: none;">Hammer of the Naaru</div> |
20:07.40 | Gaxme | <div id="XssIcon28800" style="display: none;">inv_hammer_28</div> |
20:10.58 | *** join/#wowroster Movix1 (n=mattes@82.242.144.196) |
20:14.42 | Gaxme | Ugh, 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.43 | Gaxme | There we go. Working tooltips. |
21:41.35 | Gaxme | Ok, 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 |