|
Post by eveready on Sept 4, 2010 19:35:02 GMT -8
If it isn't too much trouble, maybe you could take a look at this code I haphazardly wrote ;D since I need a fresh set of eyes to see what the problem is.
It's a miniprofile remodel that I figured I could accomplish by myself. I wrote it a couple weekends ago over a couple (few?) beer but I'm not making any excuses. Since then I have scrutinized it completely sober (whether that helps or not I don't know) and I have still failed.
Anyways, the problem I'm having is that the info that I'm grabbing and replacing is coming up 'undefined' in the first post. Then the first post's info is being placed in the second post, and so on.
So I figure it's a problem with my loops and it's probably something to do with a bracket that shouldn't be where I put it or something. Or perhaps you'll look at the code and say WTF? and I'll permanently be in the Wormo hall of shame.
The first half of the code, I grab the relevant data. Then I create the new cells, and then I place the data within the cells. It seems to all go according to plan until the last part.
|
|
|
Post by Wormopolis on Sept 4, 2010 22:26:51 GMT -8
Its a bit late right now and I JUST got done submitting the tournament bracket code that has been troubling me all day. I will look at this tomorrow!
|
|
|
Post by eveready on Sept 4, 2010 22:40:02 GMT -8
No rush.
|
|
|
Post by Wormopolis on Sept 5, 2010 14:48:40 GMT -8
the miniprofiles seem normal... the signature for the first post is undefined. is that the only thing?
|
|
|
Post by eveready on Sept 5, 2010 18:37:29 GMT -8
For me everything is undefined in that first post.
The info for the first post shows up in the second post (in Chrome & FF / nothing in IE).
The buttons are hard to see because they are the same as the background (I haven't added text to them) but if you roll over them you can see the title popup in the second and subsequent posts.
The 'link to post' information is undefined in the first post and unlike the others doesn't even show up in subsequent posts.
|
|
|
Post by Wormopolis on Sept 5, 2010 22:44:01 GMT -8
definately conflicts with something else I got running here so I have to take it to a clean board for a bit
|
|
|
Post by Wormopolis on Sept 5, 2010 23:00:01 GMT -8
wow.. test board hates it too... ok.. from what I can tell, the problem lies in the structure of how you are getting the individual things you need. You have your loop, then inside it you are checking for individual cells that meet a certain criteria. some of those cells are being overlooked for whatever reason, and the loop continues getting the next pieces. so do this... rather then scan each cell looking for criteria, what does every post have? a mini profile. JUST scan for those. it has width=20%.. class=windowbg or windowbg2.. and valign=top. once the loop finds one of those, chances are it has found a mini-profile cell. use THAT as your marker for all the other cells you want to get info from by lookng at their relationships to the mini-profile. if TD is a miniprofile, then TD.nextsibling is going to be the post stuff to the right. examining it, it has a table as its first child. look at what the table has, 3 rows. the first row is the top of the post, the area with the icon, the title, the buttons. the 2nd rowhas the actual post contents. the 3rd row has the report to mod-link to post etc.. AND it has the signature below the HR line. use relationships like nextSibling, firstChild, lastChild, etc... to get the placements of these items. pick out all the things you are wanting to retrieve, THEN build your remodel. remember if you change the internal structure of what the loop is currently scanning, then you might have to adjust "a" to compensate or it will either get stuck in an infinite loop or skip the next post completely.
|
|
|
Post by eveready on Sept 7, 2010 3:26:06 GMT -8
Yeah, not sure why I did it the way I did but in looking at other codes they are usually the way you specify. I was hoping it was a small fix, but I guess I'll have to rewrite it.
|
|
|
Post by eveready on Sept 7, 2010 7:18:16 GMT -8
I seem to have it all worked out and the code feels much cleaner. Thanks for the tips. I'll remember those down the road.
|
|
|
Post by Wormopolis on Sept 7, 2010 18:19:22 GMT -8
you were on the right path.. you diligiently were picking out the correct areas for the data, but the order was out of synch. it was finding and acting before it had all what it needed.
it looks like a cool remodel on your site.. I guess you have some more stuff runnig in order to complete the effect because the clean site was all weird about it when I tried it.
|
|
|
Post by eveready on Sept 7, 2010 19:51:41 GMT -8
Yeah, I've got a few other favorites making my life easier.
|
|