News:

Join the Facebook Fan Page.

Main Menu

Like Posts

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

Previous topic - Next topic

skb

Quote from: vbgamer45 on March 09, 2019, 08:21:56 AM
Possibly depends on the structure.
I probably won't update this mod to 2.1 now that it exists there.

If you could guide me how to do it, I could make an attempt. Otherwise, it is beyond the scope of my knowledge and skills. But no forum would like to lose the old Likes and start all over again.
Not updating the Mod is your call and does make sense.
Thanks in advance. 

SMF 2.1.2 (default theme) / TP 2.1.0

vbgamer45

I haven't looked at how likes are stored in SMF 2.1.x yet would probably a few sql calls.
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

shawnb61

I'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;


Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

vbgamer45

Nice  shawnb61 thanks!
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

skb

I tried what was suggested and got the following error
Quote#1146 - Table 'xxx.smf_user_likes' doesn't exist

SMF 2.1.2 (default theme) / TP 2.1.0

shawnb61

Run it after upgrading to 2.1, not before.  The upgrade creates that table.

If you use a different table prefix, tweak accordingly.

Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

skb

Yes, I have 2.1 installed on a different server. I had installed this mod emulating 2.0 and that seems to have deleted the table. Uninstalling created lots of errors, so I think I'll do a clean install and then try it all over again.

SMF 2.1.2 (default theme) / TP 2.1.0

skb

Thanks Shawn,

I was able to reinstall and import the Likes.

SMF 2.1.2 (default theme) / TP 2.1.0

razzy

Hey there.
I don't have the mod active at the moment, because of the issue I ran into. Hopefully someone can nudge me in the right direction to fixing the issue I ran into.

I have Like Posts 2.1.2. Love the feature, with the exception of one small issue. The 'like' button itself and who likes it shows up twice in each persons post. I have a theme called Army from SMF Tricks, that I have had to do several work around's for mod's and am thinking somewhere in the Theme it's glitched out.


vbgamer45

I would check your themes display.template.php to seee if the likes code was displayed twice.
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

razzy

Thank you for the Advice. I have combed through the display.template.php file, and found 3 sections of 'like post' code within the php.

I apologize for not experimenting by taking things out that appeared to be doubled, but my understanding of php is limited compared to other code. I have attached a small doc to show what I did find. Unsure if there is duplicates, or if I really don't understand even the basics...which would really blow.

Ty for even the help you have given so far.


diegolyanky

I have installed on my forum under 2.0.15.

Is working fine, but I have a question:

Is it absolutely necessary to perform the recount like stats every 30 days?

My forum is very large (more than 600,000 posts) and when I try to do the maintenance it stays at 30% and does not progress.

Any suggestions?

My server has 32 Gb of RAM and 12 cores ... can you make the steps run in greater quantity?

And what is the "recount member total likes" button supposed to do?

Is it supposed to delete all the likes or update the counter of all the members?

Thanks for this excellent MOD !!  :D
SMF ... SimpleMachines ... Simple, but complete if you want it ;)

4everBlue

If I update mod on new version, does like stats resets or stayed the same?

Kindred

Depends what you mean by new version.

This mod will not run on SMF 2.1 -- because SMF 2.1 has its own LIKE system. The conversion script to change this mod to 2.1 format is above, in this thread.

IF you are updating 2.0.x to a new 2.0.x, then - properly, you should use the package manager patches.... but, if you did the full upgrade form 2.0.x to 2.0.x, then reinstalling this mod WILL keep all likes from before.
Слова
Украина

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."

4everBlue

Quote from: Kindred on March 21, 2019, 10:09:05 AM
Depends what you mean by new version.

This mod will not run on SMF 2.1 -- because SMF 2.1 has its own LIKE system. The conversion script to change this mod to 2.1 format is above, in this thread.

IF you are updating 2.0.x to a new 2.0.x, then - properly, you should use the package manager patches.... but, if you did the full upgrade form 2.0.x to 2.0.x, then reinstalling this mod WILL keep all likes from before.

Thanks a lot.

Steve

Okay, I give up. I either have a mental block or it's more complicated than I expected.

How would I go about changing the orange like icon? I just want to round the corners and make it slightly smaller.
Please do not PM me for support. 

Steve

Please do not PM me for support. 

vbgamer45

Sorry really busy right some things going on.
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

Steve

Please do not PM me for support. 

skb


SMF 2.1.2 (default theme) / TP 2.1.0

Advertisement: