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.

Date: 2017-01-17 04:57 pm (UTC)
From: [identity profile] flippet.livejournal.com
Hi,

This post is practically the only information I've found about this new 'likes' feature - like you, I was only getting notification emails that told me....not a whole lot.

I'm also running an older design and style, and have no intentions of changing.

May I ask - if/when you do add this code, or change your style to add it, whatever...does it then tell you WHO liked your post? Or does it just give you numbers?

I don't care about numbers, I care about users...so if it doesn't give me that, a) what's the point, and b) I'm definitely not changing.

Thanks for any insight!

Date: 2017-01-17 07:41 pm (UTC)
From: [identity profile] flippet.livejournal.com
Oh, thanks for the reply!

So, in theory, it ought to show you a list of *who* liked the post.

Hmm. That *might* be worth tinkering with it a bit myself.

Thanks for the code info, too - I can mess with the code with some hand-holding, but wouldn't have known where to start on my own. :-)

Date: 2019-07-26 05:42 pm (UTC)
From: [identity profile] reecord2.livejournal.com
hello from 2019! I also just received and email letting me know someone 'liked' an entry of mine and I have no idea how to see it. So take comfort in knowing 3 years later this is still an issue.

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 02:43 pm
Powered by Dreamwidth Studios