News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Question about the "view likes" popup window

Started by vii, August 07, 2018, 09:58:49 PM

Previous topic - Next topic

vii

So I've been porting the smf 2.1 likes code to an older version of SMF, and I noticed that in the popup code, there is nothing for pages. It just lists all the likes in one window. I haven't tested out the behavior, so I'm not sure if there is a scrollbar in the content portion of the popup, but I don't see anything in the db query nor theme code that supports pages. I also tried to find a website using smf 2.1 live but didn't see any with posts with a large number of likes.

Is this is an oversight or was it meant to be like this? Because I know for sure that there will be many posts on a regular basis that will get up to or over 100 likes on the forum I'm porting this for, and I'm not sure how the popup window will work with that many likes and no pages or scrolling. Also, I imagine there are really big forums out there that could get hundreds of likes, so aren't pages for the popup necessary?

Also, just to be clear, I'm making this thread to point out an issue with the design for smf 2.1's likes, not really for my own project.

-

* apologies if this is posted in the wrong forum, or if I missed something in the code

albertlast


vii

Quote from: albertlast on August 07, 2018, 11:14:46 PM
From which popup you talking?
The popup you get when you click the link under a post that says "x people/person liked this" (see attachment)

I'm just worried about what happens in the popup with posts with dozens or hundreds of likes, as Likes::view() and template_like_popup() just dump all of them at once. It seems problematic both in terms of how it will look but also resource-wise, given view() loads the profiles of each user who liked it when the popup is triggered.

Arantor

This is by design. Note that Facebook does it with a popup too, even with many more than 200 likes.

vii


Arantor

That said I'm sure it can be looked at if it genuinely becomes a problem. My experience on forums is that 200 likes is unholy rare on a forum... even one big enough and busy enough.

feline

A good option for this ... make the avatars smaller.
They are too big for this popup ...

Arantor

You have a point... when this was originally made, the avatars *were* smaller.

Antes

That's something I broke while changing things around. That avatar needs to be far smaller

vii

Yes I ended up adding max-width to the avatar image as well when I slightly redesigned the popup.

Arantor

Might also want max-height; not all avatars are square.

feline

This works fine  ;)


#likes li .avatar {
max-height: 22px;
max-width: 22px;
border-radius: 3px;
vertical-align: middle;
}

Advertisement: