News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Like Posts

Started by vbgamer45, June 29, 2013, 09:29:03 AM

Previous topic - Next topic

vbgamer45

Anything in the browser error console for javascript?
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

GF2022

Quote from: vbgamer45 on January 28, 2022, 07:52:23 AMAnything in the browser error console for javascript?
No. Javascript object has right user inside of it but they are not displayed when ....
Is is a CSS issue. Which is the class of the box that displays the users that liked a post?

landyvlad

I am currently using this mod.

Presumably the likes are held in the database.

When upgrading from 2.0.19 to 2.1.0 (full upgrade package) is it possible to carry over the likes to the new forum? (Given that it's a core feature of the 2.1.x series, not a mod)

If so, how would I go about doing so please?

"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

landyvlad

Quote from: shawnb61 on March 11, 2019, 12:06:57 PMI've been using the following, seems to work (updated from one I shared earlier in this thread).

Note that if you compare counts, they don't line up perfectly, but that ties back to the fact that deleted users/posts linger in the source tables.

--
-- Simple utility to migrate Like Posts mod history
-- to the SMF 2.1 vanilla table.
--
-- Note that in Like Posts, 'topic' likes referenced the first post
-- in the topic.  I.e., all likes were 'msg' likes.   
--
-- Uses IGNORE in case of dupes or reloads. 
-- Found that Like Posts somehow let folks like some things 2x,
-- so dupes may be found in the like_post table.
--

INSERT IGNORE INTO smf_user_likes
    (id_member, content_type, content_id, like_time)
SELECT id_member_gave, 'msg', id_msg, liked_timestamp
    FROM smf_like_post;

--
-- Now for the counts in the messages table.
--

UPDATE smf_messages msg
INNER JOIN
(
   SELECT content_id, COUNT(*) AS like_count
   FROM smf_user_likes
   WHERE content_type = 'msg'
   GROUP BY content_id
) lc ON msg.id_msg = lc.content_id
SET msg.likes = lc.like_count;



Mate where/how do I run that code please?
I'm not very familiar with playing with sql, tables etc.
"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

shawnb61

Quote from: landyvlad on February 09, 2022, 09:41:41 PMMate where/how do I run that code please?
I'm not very familiar with playing with sql, tables etc.

The first thing to do is to edit it & change the prefix accordingly.  I.e., if your tables don't start with smf_, then change those.

Do you use phpMyAdmin?  If so, pull up your database in phpMyAdmin, open up the SQL tab, then copy & paste this in there, & execute it.

(You may get a bunch of 'Duplicate Entry' warnings.  It's safe to ignore those.)
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

landyvlad

Thanks for that. :D
I'll try it when I do my test upgrade.
"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

danielrichter

@vbgamer45 is there an option to make "unlik" impossible? Currently planning to implement your mod to an existing project but I would like to prevent possible spam / not required to have unlike functionality.

Dblog

In 2.1.x is there anyway to display total likes recieved by a user in their profile (along with avatar in each post like it used to appear till 2.0.19)

vbgamer45

Quote from: Dblog on March 07, 2022, 11:31:54 AMIn 2.1.x is there anyway to display total likes recieved by a user in their profile (along with avatar in each post like it used to appear till 2.0.19)
No but wish that was a feature in 2.1
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Kindred

likes are not per user. They are based on POST...    the entire point of likes versus Karma is to *REMOVE* the count attached to the user/person - because it was so abused.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arantor

The main reason it's not a feature is that SMF 2.1 likes aren't just for posts. The system was set up for all kinds of content to get likes. At which point the number of likes isn't particularly relevant.

The fact that it was also designed to reduce gamification by individuals was mostly a side effect. It's also better for performance this way short of keeping counts per user per type of like.

vbgamer45

I would like to see a top liked users page though/list
https://www.simplemachines.org/community/index.php?action=stats
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

FrizzleFried

I am confused.  I am trying to follow the conversation but somewhere got lost.  Doesn't SMF keep track of likes per user?   If not,  how is that stats page generated with the top liked user?


Arantor

It's worked out on demand. The only actual record is 'user x liked content type y, item z', e.g. 'Arantor liked msg 12345'

Which means you have to do lookups from likes to content to content owner. This is all, I should add, by design since it's managed by content type, not just posts. Though nothing is using it yet as far as I know.

JessyKa

What would be great is to have shown the most liked posts in every thread.

Anyway: noce to have this function. Thanks

SGTC

I have a very bad head-splitting problem trying to install this mod. The installation actions list didn't show any failed test errors, but it gave out this "Database Error"

Unknown column 'id_member' in 'pinchbacksforum_like_post'
File: /home/youchewv3/pinchbacks.net/Packages/temp/installer/install.php
Line: 171

I tried upgrading from 2.0.19 to 2.1.2, but now it has multiple failed test errors, and it still doesn't work. It'd be amazing to get a solution to this situation. I'm an admin of this forum, but not the host or webmaster of it..

vbgamer45

In 2.1.2 SMF they have likes built in. There is conversion script  a few posts back.
Or is there a reason you want to use this mod on SMF 2.1?
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

SGTC

Quote from: vbgamer45 on May 27, 2022, 10:07:09 PMIn 2.1.2 SMF they have likes built in. There is conversion script  a few posts back.
Or is there a reason you want to use this mod on SMF 2.1?

I prefer to use version 2.0.19 because last time I tried 2.1, there were multiple test failures when installing the mods I wanted to add.

Doug Heffernan

Quote from: SGTC on May 28, 2022, 08:41:19 AMI prefer to use version 2.0.19 because last time I tried 2.1, there were multiple test failures when installing the mods I wanted to add.

What mods were those if I may ask? Almost all mods compatible with the 2.1.x versions are hooks only, and therefore they have 0 file edits.

SGTC

Quote from: Doug Heffernan on May 28, 2022, 09:20:04 AM
Quote from: SGTC on May 28, 2022, 08:41:19 AMI prefer to use version 2.0.19 because last time I tried 2.1, there were multiple test failures when installing the mods I wanted to add.

What mods were those if I may ask? Almost all mods compatible with the 2.1.x versions are hooks only, and therefore they have 0 file edits.

One example I tried in SMF 2.1.2 is Ultimate Profile. It had a bunch of test fails since I ran it on the aforementioned SMF 2.1.2, but it installed anyways. However, I don't see the Ultimate Profile settings in my profile, so I uninstalled it. The mod Ultimate Profile is not a hooks only mod.

Advertisement: