LiveJournal Likes?
Dec. 4th, 2016 09:05 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
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:
And that looks is implemented in the base layer as:
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.
"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.
no subject
Date: 2017-01-17 04:57 pm (UTC)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!
no subject
Date: 2017-01-17 07:04 pm (UTC)What should appear is a heart with a number, and hovering over it displays a list of who's liked the post (similar to how Facebook likes work). There's presumably some client-side Javascript to do all this but it's minified and I haven't yet puzzled through it. I may have another crack at it at some point.
no subject
Date: 2017-01-17 07:41 pm (UTC)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. :-)
no subject
Date: 2019-07-26 05:42 pm (UTC)