?

Log in

No account? Create an account
LiveJournal Likes? - 'Twas brillig, and the slithy toves did gyre and gimble in the wabe [entries|archive|friends|userinfo]
Thomas

[ website | Beware the Jabberwock... ]
[ deviantArt | the-boggyb ]
[ FanFiction | Torkell ]
[ Tumblr | torkellr ]

Links
[Random links| BBC news | Vulture Central | Slashdot | Dangerous Prototypes | LWN | Raspberry Pi]
[Fellow blogs| a Half Empty Glass | the Broken Cube | The Music Jungle | Please remove your feet | A letter from home]
[Other haunts| Un4seen Developments | Jazz 2 Online | EmuTalk.net | Feng's shui]

LiveJournal Likes? [Sunday 4th December 2016 at 9:05 pm]
Thomas

boggyb
[Tags|, ]
[Feeling |annoyedannoyed]
[Playing |2]Whistler's Bride ~ Warder/The Feadanaigh Epic [whistler's bride.it]]

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.
Link | Previous Entry | Share | Next Entry[ 3 pennies | Penny for your thoughts? ]

Comments:
[User Picture]From: flippet
Tuesday 17th January 2017 at 4:57 pm (UTC)
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!
(Reply) (Thread)
[User Picture]From: boggyb
Tuesday 17th January 2017 at 7:04 pm (UTC)
Sorry - I tried patching out the check in get_lj_entry_likus() and adding it to my style, but while the HTML was added it didn't display anything useful in the browser. I definitely needed to switch to the new site scheme to get likes to work anywhere, and even then I don't think I got them working in my style.

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.
(Reply) (Parent) (Thread)
[User Picture]From: flippet
Tuesday 17th January 2017 at 7:41 pm (UTC)
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. :-)
(Reply) (Parent) (Thread)