torkell: (Default)
[personal profile] torkell
Okay, how do likes work on LiveJournal? All I get is an email saying:

"1 user(s) likes this - http://boggyb.livejournal.com/488309.html"

As best as I can tell that's it. I can't see how many likes I have on an entry (for that matter I don't even have a like button), and the like statistics page is empty.

The FAQ does say that this needs the new design and one of the new styles - but I still don't see like buttons even after switching to the new site design (which I'd prefer not to use as it's fallen into the trap of assuming that everything has to be designed for mobile - Vertigo is a far more useful scheme with the left-hand link bar and the smaller journal banner) and previewing my journal in the Air style.

Oh, wait, but if I try the Expressive style then it does appear (so much for that FAQ claiming that Air supports this). Interesting. It seems like there's an entirely new function to generate the likes button:

var int likus_journal_id = $.journal.userid;
var int likus_post_id = $.itemid;
var string likus_url = $.permalink_url;

print get_lj_entry_likus("li", "asset-meta-likus item", $likus_journal_id, $likus_post_id, $likus_url);


And that looks is implemented in the base layer as:

function get_lj_entry_likus(string tag, string class, int journal_id, int post_id, string post_uri) : string {

    # LJSUP-24066
    if( not is_likes_display() ) {
        return "";
    }

    # for js LJSUP-18559
    return """<""" + $tag + """ class="$class" lj-likus lj-likus-journal="$journal_id" lj-likus-item="$post_id" lj-likus-uri="$post_uri"></""" + $tag + """>""";

}


Hmm... I wonder if I can hack it into my S2 style? All this does is add a placeholder HTML element so it would seem the actual like button is generated with Javascript - which is a bit annoying as that makes it hard to customise. I might be able to do something with suitably crazy CSS hackery.

Not that such a feature should need a new journal style anyway. S2 is designed to cope with new features without needing all styles to be redesigned - for example, the way the per-entry links work ("Edit Entry", "Add to Memories", "Share" and so on) is that the S2 engine provides a list of actions and a function to generate each link. So adding a new one is straightforward, and unless the style writer has gone for an entirely custom layout ignoring this list then it will Just Work.

Sigh. It does annoy me that the current trend in, well, everything computing-related is to remove open-ended customisability because maintaining it requires effort, and that sounds too much like actual work compared to rewriting everything in the latest shiny framework.
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

May 2025

S M T W T F S
    123
45678910
111213141516 17
18192021222324
25262728293031

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 11th, 2025 05:31 am
Powered by Dreamwidth Studios