Like Posts

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

Previous topic - Next topic

Elizabeth II

I did check that file before and searched but I didn't find anything relating to it

Joker™

Quote from: Britannia360 on October 01, 2014, 09:01:00 AM
How do I remove the Like Stats tab from the menu? I can't seem to find it anywhere?
Umm, its added via hook, so no SMF file is being modified to add the menu item. AFAIR, there is already a permission to disable the like stats based on member group, why don't you give it a try.
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

Joker™

Quote from: Kimmie on October 01, 2014, 12:42:32 PM
Thanks for looking into updating this. Most have post count groups so it will come in handy for those of us who don't want every group having these types of permissions. It gives them something to work for. :)
So lets say I have a post group 'Friend' and a normal/regular group 'Coder'.

Now both of these groups have different permissions provided to them, so which group permission should be used for the user in terms of like mod permission system?
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

Elizabeth II

Quote from: Joker™ on October 02, 2014, 12:10:06 AM
Quote from: Britannia360 on October 01, 2014, 09:01:00 AM
How do I remove the Like Stats tab from the menu? I can't seem to find it anywhere?
Umm, its added via hook, so no SMF file is being modified to add the menu item. AFAIR, there is already a permission to disable the like stats based on member group, why don't you give it a try.

So I can't remove the tab?

Joker™

Quote from: Britannia360 on October 02, 2014, 11:14:48 AM
So I can't remove the tab?
Quote from: Joker™ on October 02, 2014, 12:10:06 AM
AFAIR, there is already a permission to disable the like stats based on member group, why don't you give it a try.
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

Elizabeth II

But that doesnt stop me from seeing it..

Joker™

#446
Quote from: Britannia360 on October 02, 2014, 08:31:53 PM
But that doesnt stop me from seeing it..
Are you using an admin account, as admin have all permissions enabled. Try with some normal account
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

gorbi

Do you have russian localisation for this mod?

Joker™

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

gorbi

Are Like in smf 2.0.x and 2.1 similar?

a10

Hello, now om 2.09, am getting this specific error upon any and all use of the 'like' (also clicking 'Show Likes notification' makes the error). But the like's themselves appears to work fine, only symptom is (seemingly) the entry in the error log.


http://www.*/forum/index.php?action=likeposts;sa=like_posts_notification
Apply Filter: Only show the errors with the same message
2: json_encode(): Invalid UTF-8 sequence in argument
Apply Filter: Only show the errors from this file
File: /customers/*/httpd.www/forum/Sources/LikePosts.php
Line: 458
2.0.19, php 7.4.30, MariaDB 10.5.15. Mods: Contact Page, Like Posts, Responsive Curve, Search Focus Dropdown, Add Join Date to Post.

Joker™

Quote from: gorbi on October 03, 2014, 01:32:04 PM
Are Like in smf 2.0.x and 2.1 similar?
Nope. BTW, this mod is not compatible for 2.1 as of now.


Quote from: a10 on October 04, 2014, 08:29:34 AM
Hello, now om 2.09, am getting this specific error upon any and all use of the 'like' (also clicking 'Show Likes notification' makes the error). But the like's themselves appears to work fine, only symptom is (seemingly) the entry in the error log.


http://www.*/forum/index.php?action=likeposts;sa=like_posts_notification
Apply Filter: Only show the errors with the same message
2: json_encode(): Invalid UTF-8 sequence in argument
Apply Filter: Only show the errors from this file
File: /customers/*/httpd.www/forum/Sources/LikePosts.php
Line: 458




Quote from: Joker™ on September 30, 2014, 11:55:05 PM
Great :). It looks like its time to make a major overhaul in the mod.
And I'm working on the same, as mod has too much of unused and unoptimized code. So, with the next major version release this big will also be fixed :). You can see the activity over here, also this bug is already tracked on github.
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

gorbi

#452
The mod is great. I started to make Russian localization. Front-end is ready )

Please add the All Notifications and My Posts in language file.

P.S. Statistics likes is logical to move down the page to the general statistics, or make a check-box in the settings.

mikenye

This mod is really cool, thank you.

I personally like the look and feel of the below forum's like system:

htt p://talkaboutmarriage. com/sex-marriage/210858-erotic-films-couples-not-pure-porn.html

It has username whose liked the post listed right on the post, instead of in a popup.  Can we have an option to display like that?

Also, I had to add a tweak so that it can work with PortaMX SEF.

In PortaMxSEF.php:

function pmxsef_redir_perm($url)
{
//fix likepost ajax
if(strpos($_SERVER['REQUEST_URL'], 'sa=like_post') !== false || strpos($_SERVER['REQUEST_URL'], 'sa=get_message_like_info') !== false) {
return;
}

define('WIRELESS', false);
header('HTTP/1.1 301 Moved Permanently');
redirectexit($url);
}


and added 'clearfix' in LikePosts.js, line 163:

completeString += '<div class="like_posts_member_info"><img class="avatar" src="' + data[i].avatar.href + '" /><div class="like_posts_member_info_details clearfix"><a href="' + data[i].href + '">' + data[i].name + '</a></div></div>';

Rain Forest

Find:
<a href="', $topic['new_href'], '" id="newicon' . $topic['first_post']['id'] . '"><img src="', $settings['lang_images_url'], '/new.gif" alt="', $txt['new'], '" /></a>';

Add after:


if(!empty($modSettings['like_post_enable']) && !empty($modSettings['lp_show_like_on_boards']) && LP_isBoardIncluded($context['current_board']) && LP_isAllowedTo(array('can_like_posts', 'can_view_likes', 'can_view_likes_in_boards'))) {
$context['like_posts']['single_topic_data'] = LP_isTopicLiked($context['like_posts']['topics_liked_data'], $topic['id']);
echo '
<div class="like_post_box floatright">';

if($context['user']['id'] !== $topic['first_post']['member']['id'] && LP_isAllowedTo('can_like_posts')) {
echo '
<a class="', $context['like_posts']['single_topic_data']['already_liked'] ? 'like_link' : 'unlike_link', '" id="like_',$topic['first_post']['id'],'" href="#', $context['like_posts']['single_topic_data']['already_liked'], '" onclick="lpObj.likeUnlikePosts(event, ', $topic['first_post']['id'],', ',$topic['id'],', ',$context['current_board'],', ',$topic['first_post']['member']['id'],'); return false;">', $context['like_posts']['single_topic_data']['text'],'</a>';
}

if(LP_isAllowedTo(array('can_view_likes', 'can_view_likes_in_boards'))) {
echo '
<a id="like_post_info_'. $topic['first_post']['id'] .'" href="javascript:void(0)" onclick="lpObj.showMessageLikedInfo(', $topic['first_post']['id'], ')">', !empty($context['like_posts']['single_topic_data']['count']) ? '<span id="like_count_'. $topic['first_post']['id'] .'">('. $context['like_posts']['single_topic_data']['count_text'] .')</span>' : '', '</a>';
}

echo '
</div>';
}


I can't find this line in messageindex.template.php on 2.0.8.

<a href="', $topic['new_href'], '" id="newicon' . $topic['first_post']['id'] . '"><img src="', $settings['lang_images_url'], '/new.gif" alt="', $txt['new'], '" /></a>';

Joker™

Quote from: gorbi on October 06, 2014, 03:39:59 AM
The mod is great. I started to make Russian localization. Front-end is ready )
Thats great. If you are familiar with the github you can send me a PR with new lang string over here https://github.com/siddhartha-gupta/SMF-Likes


Quote from: gorbi on October 06, 2014, 03:39:59 AM
Please add the All Notifications and My Posts in language file.
Opps! Thanks for pointing it out, tracked over here - https://github.com/siddhartha-gupta/SMF-Likes/issues/24


Quote from: gorbi on October 06, 2014, 03:39:59 AM
P.S. Statistics likes is logical to move down the page to the general statistics, or make a check-box in the settings.
Umm moving it down requires a SMF file edit, I really hate that. Will try to find some alternative.
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

Joker™

Quote from: mikenye on October 08, 2014, 11:50:23 PM
This mod is really cool, thank you.

I personally like the look and feel of the below forum's like system:

htt p://talkaboutmarriage. com/sex-marriage/210858-erotic-films-couples-not-pure-porn.html

It has username whose liked the post listed right on the post, instead of in a popup.  Can we have an option to display like that?
You mean on the top right? Just before where first post start? If thats the case, I think its showing all users who have liked the post. Please provide me some further details.
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

Joker™

Quote from: Magic Coconut on October 09, 2014, 07:15:14 AM
Find:
<a href="', $topic['new_href'], '" id="newicon' . $topic['first_post']['id'] . '"><img src="', $settings['lang_images_url'], '/new.gif" alt="', $txt['new'], '" /></a>';

Add after:


if(!empty($modSettings['like_post_enable']) && !empty($modSettings['lp_show_like_on_boards']) && LP_isBoardIncluded($context['current_board']) && LP_isAllowedTo(array('can_like_posts', 'can_view_likes', 'can_view_likes_in_boards'))) {
$context['like_posts']['single_topic_data'] = LP_isTopicLiked($context['like_posts']['topics_liked_data'], $topic['id']);
echo '
<div class="like_post_box floatright">';

if($context['user']['id'] !== $topic['first_post']['member']['id'] && LP_isAllowedTo('can_like_posts')) {
echo '
<a class="', $context['like_posts']['single_topic_data']['already_liked'] ? 'like_link' : 'unlike_link', '" id="like_',$topic['first_post']['id'],'" href="#', $context['like_posts']['single_topic_data']['already_liked'], '" onclick="lpObj.likeUnlikePosts(event, ', $topic['first_post']['id'],', ',$topic['id'],', ',$context['current_board'],', ',$topic['first_post']['member']['id'],'); return false;">', $context['like_posts']['single_topic_data']['text'],'</a>';
}

if(LP_isAllowedTo(array('can_view_likes', 'can_view_likes_in_boards'))) {
echo '
<a id="like_post_info_'. $topic['first_post']['id'] .'" href="javascript:void(0)" onclick="lpObj.showMessageLikedInfo(', $topic['first_post']['id'], ')">', !empty($context['like_posts']['single_topic_data']['count']) ? '<span id="like_count_'. $topic['first_post']['id'] .'">('. $context['like_posts']['single_topic_data']['count_text'] .')</span>' : '', '</a>';
}

echo '
</div>';
}


I can't find this line in messageindex.template.php on 2.0.8.

<a href="', $topic['new_href'], '" id="newicon' . $topic['first_post']['id'] . '"><img src="', $settings['lang_images_url'], '/new.gif" alt="', $txt['new'], '" /></a>';
The code is near line number 260

// Is this topic new? (assuming they are logged in!)
if ($topic['new'] && $context['user']['is_logged'])
echo '
<a href="', $topic['new_href'], '" id="newicon' . $topic['first_post']['id'] . '"><img src="', $settings['lang_images_url'], '/new.gif" alt="', $txt['new'], '" /></a>';
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

Rain Forest

Hmm, do you have an alternative for putting that code after?

gorbi

Quote from: Joker™ on October 09, 2014, 12:39:44 PM
Quote from: gorbi on October 06, 2014, 03:39:59 AM
The mod is great. I started to make Russian localization. Front-end is ready )
Thats great. If you are familiar with the github you can send me a PR with new lang string over here https://github.com/siddhartha-gupta/SMF-Likes


Quote from: gorbi on October 06, 2014, 03:39:59 AM
Please add the All Notifications and My Posts in language file.
Opps! Thanks for pointing it out, tracked over here - https://github.com/siddhartha-gupta/SMF-Likes/issues/24


Quote from: gorbi on October 06, 2014, 03:39:59 AM
P.S. Statistics likes is logical to move down the page to the general statistics, or make a check-box in the settings.
Umm moving it down requires a SMF file edit, I really hate that. Will try to find some alternative.
Ок.  I will modify the draft and send. Thank you for your work!

Advertisement: