More out of curiosity than anything else (too much time and enthusiasm), I was wondering how easy it would be to build a style that implemented flat commenting, rather than threaded.. Ideally, it would be set by an argument in the page URL, so that people could turn it on temporarily with a link..
So I figured that it shouldn't be too difficult to hijack the print comment function, and iterate through all comments (and children of comments), adding all the comments on the entry into an array of comment objects. Forget for a second that some of them might only be partial comments, that's something I haven't figured out a way around yet..
To make the display a bit more user friendly, I was thinking of building a hash or two at the same time that links the poster and talkid of each comment to all the children, so that I can use a comment's talkid to look up the talkid of its parent, and who it was by. The idea then being that a comment can say "Reply to user5 (link to relevant comment)".
But this is where it starts to fall down..
What I'd then be looking to do is sort the array based on the talkid of each comment (ascending). i.e., break the threaded model, and access the comment array in the order in which the comments were written to the database.
Now I think I can probably do that by iterating through the comment array, picking out the lowest talkid, printing it, adding it to another array of "done" comments, and then repeat, excluding those "done" comments every time.. But that seems like a really long-winded way of going about it.
I was just wondering if anybody had any insight into the best way to do this, or any obvious reasons why the whole thing would just break on attempting it. Like I said, it's more out of curiosity than anything else, I just want to see if I can do it (and do it in a well-performing manner).
I recently started playing around in S2 (after about a year of having my brain melt every time I tried to look at it...), and I have a programming question. If I knew a bit about Perl or Java, this might be self evident, but previously, I've only worked in PHP. My question concerns whether you should always include a print command and what exactly the "safe" modifier does.
A while back there was a push to update all S2 styles to provide a standardised set of features, and use consistent names (e.g. in the wizards) to refer to them, rather than vary between styles (free text/blurb for example).
Is any listing available of these? I.e. 'Must-have-at-least-*these*-features-for-all-styles' list and 'styleguide - list of terms' list.
So far as I can tell changes were applied to both livejournal and ljcom styles, during that initiative. Is that correct?