News:

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

Main Menu

Like Posts

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

Previous topic - Next topic

chrisjudd

For some reason when I install (doing on 2.0.7) it will display 2 like buttons and 2 like stats in the user message profile

margarett

That usually means you installed the MOD twice...
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Joker™

Quote from: Beelzeboss on February 18, 2014, 04:26:59 PM
Quote from: Joker™ on February 01, 2014, 07:11:15 AM
Nice catch, tracked

Dear Joker I see you fixed it. Thank you.

I noticed something else. When you move/split/merge topics or posts, then the likes disappeared from the posts.The meter continues to count them and you can find the latest likes from notification button. The problem is because the columns "id_board" or/and "id_topic" from database table "like_post", don't change when you move/split/merge posts. I made the following changes:

In the file /sources/MoveTopic.php 

after this

$smcFunc['db_query']('', '
UPDATE {db_prefix}messages
SET id_board = {int:id_board}' . ($isRecycleDest ? ',approved = {int:is_approved}' : '') . '
WHERE id_topic IN ({array_int:topics})',
array(
'id_board' => $toBoard,
'topics' => $topics,
'is_approved' => 1,
)
);



I added this

$smcFunc['db_query']('', '
UPDATE {db_prefix}like_post
SET id_board = {int:id_board}
WHERE id_topic IN ({array_int:topics})',
array(
'id_board' => $toBoard,
'topics' => $topics,
)
);



and in the file /sources/SplitTopics.php

before this "// Mess with the old topic's first, last, and number of messages."

I added this

$smcFunc['db_query']('', '
UPDATE {db_prefix}like_post
SET id_topic = {int:id_topic}
WHERE id_msg IN ({array_int:split_msgs})',
array(
'split_msgs' => $splitMessages,
'id_topic' => $split2_ID_TOPIC,
)
);



and before  "// Change the subject of the first message..."

I added this

$smcFunc['db_query']('', '
UPDATE {db_prefix}like_post
SET
id_topic = {int:id_topic},
id_board = {int:target_board}
WHERE id_topic IN ({array_int:topics_list})',
array(
'topics_list' => $topics,
'id_topic' => $id_topic,
'target_board' => $target_board,
)
);



It seems it works now. I'll wait to check if it 's ok. Thank you

Glad the fixed worked for you.

Also thanks for pointing out another issue(thanks for debugging) about split topics. We can fix it via 2 ways
1. If you allow I can use the code provided by you for the fix, but that requires the mod playing with SMF core files
2. We can drop the topic and board column from likes table as mod is also not utilising those columns very well.

Hmmmm, lets think :).
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

chrisjudd

Quote from: margarett on February 21, 2014, 07:13:15 AM
That usually means you installed the MOD twice...
I don't see it listed twice..

Joker™

Quote from: chrisjudd on February 23, 2014, 02:36:04 PM
Quote from: margarett on February 21, 2014, 07:13:15 AM
That usually means you installed the MOD twice...
I don't see it listed twice..
Check if the mod edits are made twice in the mentioned files over here
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Beelzeboss

#245
Quote from: Joker™ on February 23, 2014, 12:26:49 AM
Glad the fixed worked for you.

Also thanks for pointing out another issue(thanks for debugging) about split topics. We can fix it via 2 ways
1. If you allow I can use the code provided by you for the fix, but that requires the mod playing with SMF core files
2. We can drop the topic and board column from likes table as mod is also not utilising those columns very well.

Hmmmm, lets think :).

I'm glad to hear that. Of course you can use anything you want. Does it creates any problem the requirement of use smf core file like MoveTopic/SplitTopics.php?

2. I thought the deletion of these columns because I believe the important would be the id_msg, but I didn't try it. Maybe it's the best solution.

Thank you.

Joker™

Quote from: Beelzeboss on February 26, 2014, 08:06:54 AM
I'm glad to hear that. Of course you can use anything you want. Does it creates any problem the requirement of use smf core file like MoveTopic/SplitTopics.php?

2. I thought the deletion of these columns because I believe the important would be the id_msg, but I don't tried it. Maybe it's the best solution.

Thank you.
Well I personally try to tweak SMF files as minimal as possible, as if some other mod has made a change in the same file and at a same place then my mods are going to create the conflicts, and I'd have to provide a lot of mod related support.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Beelzeboss

Quote from: Joker™ on February 26, 2014, 08:42:43 AM
Well I personally try to tweak SMF files as minimal as possible, as if some other mod has made a change in the same file and at a same place then my mods are going to create the conflicts, and I'd have to provide a lot of mod related support.

Hmmm yes you 're right.  :)

STRRAYNGE

#248
This may have been covered, but I didnt see it. By chance does this mod work with IE? I use firefox and chrome and its working wonderfully, but I just had a user message me saying he cant like any posts, its not working. I asked him what browser he was using and he said IE8. Any help is much appreciated.

EDIT: Disregard, im just going to suggest for him to use a different browser.

someDev

i think it would be great some stat page for this likes

Joker™

Quote from: STRRAYNGE on March 05, 2014, 11:54:21 AM
This may have been covered, but I didnt see it. By chance does this mod work with IE? I use firefox and chrome and its working wonderfully, but I just had a user message me saying he cant like any posts, its not working. I asked him what browser he was using and he said IE8. Any help is much appreciated.

EDIT: Disregard, im just going to suggest for him to use a different browser.

Quote from: Joker™ on September 10, 2013, 01:17:27 PM
Ahhh IE. ScrumpyJack, please don't feel offended, but I never try my code on IE, as why should I put double effort just to support a browser which is still doing everything it can to make dev's life hell :P.

Also is anyone aware about how to install IE on mac :-X?
:D


Quote from: someDev on March 05, 2014, 03:11:18 PM
i think it would be great some stat page for this likes
I started working on it a while back, but currently I'm more inclined to another forum software hence theres a lesser probability that this mod is going to receive any great feature in near future.

Also SMF team has built like systems in SMF 2.1 so why should I put more time into this mod?
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Dblog

It would be great if Guests are also able to see 'Likes' recieved by a member. (Only members should be able to like/dislike though)
This will motivate members to make more Likeable posts and also add to their credibility.
Right now, guests doesnt even know/see that there is a post/topic like option

jawad96

Hi there,

Installing this mod on MysticJade theme.

Receive this test fail upon installation:

<li><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a></li>';

Code: (Replace)

<li><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a></li>
<li><a href="#" class="showLikeNotification" onclick="lpObj.showLikeNotification()">', $txt['like_show_notifications'], '</a></li>';


File location:

Themes/mysticjade_20a/index.template.php

Installed regardless, and have had no issues. Just posting to see what exactly failed, by the looks of it, notification won't be working?

Regards,
Jawad

PS:

Agree with cBlog. Would be great if guests could see like feature exists on forum. This is as simple as adding another checkbox under permission settings > can view likes > 'Guests'?

Would be great if you can add this.

Kaerie


Hello!

I wanted, first of all, to say thanks.  I'm running a forum for a very small, close-knit community, and they have really appreciated the addition of a "Like" button.  However, the ladies on this forum don't like the "popularity contest" they perceive the "total likes of a user" in each post.  I've attached a screenshot to show exactly what I'm talking about:




I have a *little* bit of coding understanding.  Just enough to kind of follow what's going on, but not really enough to confidently make any changes.  I'd like to remove this display from each post, however I have been unable to find the correct spot thus far to experiment and comment out.

If someone could point me in the right direction and show me where I need to be in order to do this, I'd really appreciate it!

Thank you!

FemR

+1 for implementing some top stats page for this great mod - it is one thing we miss so much!

Thanks for all your work on this mod, Joker! ;)

MechSpecs

Quote from: Kaerie on March 12, 2014, 01:12:07 PM
If someone could point me in the right direction and show me where I need to be in order to do this, I'd really appreciate it!

If you figure it out post it here. This is something that has also prevented me from installing this mod on a new site. I really like how stats are tracked although I think it could be fleshed out even more to be more graphically pleasing but I understand the authors reluctance with SMF 2.1 coming out with a built in likes system.

MechSpecs

Quote from: Kaerie on March 12, 2014, 01:12:07 PM


Did anyone give you the specific code you are looking to pull out for this to work? I've been thinking about this mod as well if I can right align the button and remove that bit from the post author portion, in your face popularity contests are an issue, then I think I might plug this into the latest 2.0.7 I've done.

someDev

Quote from: Joker™ on March 06, 2014, 10:14:27 AM
I started working on it a while back, but currently[...] why should I put more time into this mod?

becouse not all using smf 2,1

so i made some simple addon which shows simple stats
http://www.borowicz.info/pub/smf/abStats4LikePosts.zip [nofollow]

ryan_dwight

Quote from: someDev on April 01, 2014, 09:41:42 AM
Quote from: Joker™ on March 06, 2014, 10:14:27 AM
I started working on it a while back, but currently[...] why should I put more time into this mod?

becouse not all using smf 2,1

so i made some simple addon which shows simple stats
http://www.borowicz.info/pub/smf/abStats4LikePosts.zip
where is the stat located?

redding99

#259
Hi, hope you can support me with getting this mod working on my forum.

It all seems OK but nothing happens when you click on the Like button on a post. Nothing updates and the button remains.

I installed the mod without any problem except for one file on a couple of my themes (index.template.php):

The installer was looking for this:

<li><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a></li>';

To change to this

<li><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a></li>
               <li><a href="#" class="showLikeNotification" onclick="lpObj.showLikeNotification()">', $txt['like_show_notifications'], '</a></li>';


But other mods had added to this line of code so I manually entered the change for this file. It all seems to work OK so I don't think the issue is related.

Any suggestion would be appreciated. I have disabled the mod at the moment but can enable for you to view it

Steve

Advertisement: