?

Log in

S2 Developer Community

Recent Entries

3/7/08 01:26 pm - unknownj

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).

So.. any ideas? :o)

6/10/07 10:41 am - mighty_gratira - Basic Print Commands

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.

Read more...Collapse )

3/22/07 11:23 pm - smigs - Overriding property descriptions and notes

How do I override property descriptions and notes in s2? The documentation says that i18nc, layout and i18n layers can do this, but I can’t find any examples.

This is for internationalisation purposes; for example, in the core layer there is:
property bool view_entry_disabled {
    des = “Disable customized comment pages for your journal”;
}

and I’d just liked to change this so that ‘customized’ is spelt with an ‘s’ in the British English i18nc layer - the text is displayed in the customisation wizard ui.

Edit: Another question: can I assign the value of one property to another using the '=' operator? e.g something like this (that will actually work, in a layout layer; I can't test this properly, but it doesn't appear to work):
set date_format = lang_fmt_date_long;

I intend to use this as a workaround for providing localisation to layouts that use their own date/time properties, without breaking user customisations.

1/25/07 03:58 am - my_death_life - Override

In Page::print_entry(Entry e) i can change subject, body of entry, but i can't change date and time of entry. :(

Page::print_entry(Entry e) invoke for each entry, but i can't find function who invoke print_entry(Entry e);

How can i change design date format of entry?

10/4/06 06:03 pm - name_is_gray - Getting current date and time

Is there any way to get current date and time values is S2?
I want to make dates look something like 'today, at 12:21' or '5 minutes ago'.

Thanks everyone

8/19/06 04:58 am - decadence1 - Standard features, and nomenclature?

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?

8/9/06 03:41 am - smigs - creating a custom i18nc layer

I'm aware this community appears never to have been used, but since there are a handful of people watching it anyway, I thought I'd give it a go, since I don't think this question would get answered in the 'make your journal look pretty' s2 communities.

I'm trying to create an en_GB i18nc layer (you can see it here, hopefully - i just overrode the date formats, nothing else). Basically I just want correct (British, that is, so 25/12/00 instead of 12/25/00) date formats (and 24 hour time) on all styles, not just ones which choose to allow me the option of customising date formats (my preferred style doesn't).

The problem is it just doesn't work. I have British English selected on http://www.livejournal.com/manage/siteopts.bml, and I have "Default" selected from the Language dropdown on http://www.livejournal.com/customize/style.bml ("English" doesn't work either). But the layer just doesn't seem to be functioning. Any clues, or is this sort of thing simply not possible? If it isn't, how would I go about contributing an en_GB i18nc layer to the 'official' i18nc layers already present so that it would function?
Powered by LiveJournal.com