News:

SMF 2.0.19 has been released! Please update. Read more.

Main Menu

Like Posts

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

Previous topic - Next topic

MaryLouW

Thanks again.  Will just have to be patient.  Since we are all graphic artists on my forum, we like our graphics!  The more the merrier!

MaryLouW

I thought I was finished with asking questions but I have one more.  See the attachement.

jriani

What script is responsible for putting the "Like posts" link on the menu? I would like to edit the button text if possible.

valpo04

Hello,

I am trying to uninstall version 1.3.1 of this mod to update to the latest version, but I am getting "Test Failed" on the modification of Load.php:

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

if(!empty($modSettings['like_post_enable']) && !empty($modSettings['lp_show_like_on_boards']) && LP_isAllowedTo(array('can_like_posts', 'can_view_likes'))) {
$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="like_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('can_view_likes'))
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>';
}


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


I have checked my Load.php file and find no code that matches anything in the (Find) or even the (Replace) code box. Any ideas?

The mod is currently installed and is working.

Joker™

Lol too many requests all of a sudden :P.

Quote from: MaryLouW on July 30, 2014, 04:20:06 PM
I thought I was finished with asking questions but I have one more.  See the attachement.
I've created separate classes for like/unlike button in upcoming version. With that you'll be able to style like/unlike easily as per your preferences. For capital you can add the css property in the 'like_unlike_link' class

Themes/default/css/LikePosts.css]text-transform: uppercase;
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: jriani on July 30, 2014, 05:55:57 PM
What script is responsible for putting the "Like posts" link on the menu? I would like to edit the button text if possible.
Which menu are you referring 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

Joker™

Quote from: valpo04 on August 01, 2014, 10:40:23 AM
Hello,

I am trying to uninstall version 1.3.1 of this mod to update to the latest version, but I am getting "Test Failed" on the modification of Load.php:

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

if(!empty($modSettings['like_post_enable']) && !empty($modSettings['lp_show_like_on_boards']) && LP_isAllowedTo(array('can_like_posts', 'can_view_likes'))) {
$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="like_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('can_view_likes'))
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>';
}


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


I have checked my Load.php file and find no code that matches anything in the (Find) or even the (Replace) code box. Any ideas?

The mod is currently installed and is working.
Correct me if I'm wrong, this edit is made for 'MessageIndex.template.php' only.
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

MechSpecs

Quote from: Joker™ on August 02, 2014, 12:53:47 PM
Quote from: jriani on July 30, 2014, 05:55:57 PM
What script is responsible for putting the "Like posts" link on the menu? I would like to edit the button text if possible.
Which menu are you referring over here?

I think he is talking about Subs.php or wherever Likes dumps in the "LIKE STATS" nav option.

valpo04

Quote from: Joker™ on August 02, 2014, 12:56:05 PM
Quote from: valpo04 on August 01, 2014, 10:40:23 AM
Hello,

I am trying to uninstall version 1.3.1 of this mod to update to the latest version, but I am getting "Test Failed" on the modification of Load.php:

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

if(!empty($modSettings['like_post_enable']) && !empty($modSettings['lp_show_like_on_boards']) && LP_isAllowedTo(array('can_like_posts', 'can_view_likes'))) {
$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="like_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('can_view_likes'))
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>';
}


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


I have checked my Load.php file and find no code that matches anything in the (Find) or even the (Replace) code box. Any ideas?

The mod is currently installed and is working.
Correct me if I'm wrong, this edit is made for 'MessageIndex.template.php' only.

The uninstall test shows it making the modification on Load.php.

It is the only test that fails so maybe it makes sense that this edit is for MessageIndex.template.php.

Not sure why it is attempting to make the edit on Load.php.

Joker™

Quote from: MechSpecs on August 02, 2014, 01:28:09 PM
Quote from: Joker™ on August 02, 2014, 12:53:47 PM
Quote from: jriani on July 30, 2014, 05:55:57 PM
What script is responsible for putting the "Like posts" link on the menu? I would like to edit the button text if possible.
Which menu are you referring over here?

I think he is talking about Subs.php or wherever Likes dumps in the "LIKE STATS" nav option.
But that option says 'Like stats', not 'Like Posts' :)
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: valpo04 on August 02, 2014, 02:19:52 PM
Quote from: Joker™ on August 02, 2014, 12:56:05 PM
Quote from: valpo04 on August 01, 2014, 10:40:23 AM
Hello,

I am trying to uninstall version 1.3.1 of this mod to update to the latest version, but I am getting "Test Failed" on the modification of Load.php:

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

if(!empty($modSettings['like_post_enable']) && !empty($modSettings['lp_show_like_on_boards']) && LP_isAllowedTo(array('can_like_posts', 'can_view_likes'))) {
$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="like_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('can_view_likes'))
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>';
}


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


I have checked my Load.php file and find no code that matches anything in the (Find) or even the (Replace) code box. Any ideas?

The mod is currently installed and is working.
Correct me if I'm wrong, this edit is made for 'MessageIndex.template.php' only.

The uninstall test shows it making the modification on Load.php.

It is the only test that fails so maybe it makes sense that this edit is for MessageIndex.template.php.

Not sure why it is attempting to make the edit on Load.php.
Will try to see the issue in more detail and get back to you.
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

MaryLouW

Quote from: Joker™ on August 02, 2014, 12:53:15 PM
Lol too many requests all of a sudden :P.

Quote from: MaryLouW on July 30, 2014, 04:20:06 PM
I thought I was finished with asking questions but I have one more.  See the attachement.
I've created separate classes for like/unlike button in upcoming version. With that you'll be able to style like/unlike easily as per your preferences. For capital you can add the css property in the 'like_unlike_link' class

Themes/default/css/LikePosts.css]text-transform: uppercase;

Thank you again!!  It looks perfect now!  Looking forward to the next version too. :)

Joker™

Quote from: valpo04 on August 02, 2014, 02:19:52 PM
The uninstall test shows it making the modification on Load.php.

It is the only test that fails so maybe it makes sense that this edit is for MessageIndex.template.php.

Not sure why it is attempting to make the edit on Load.php.
Ok, I wasn't able to reproduce the error. You can try the following things
Make backup of your files before trying this
Also make backup of your package zip file

Upload and replace the attached zip file to the 'Packages' folder using FTP and see if you are able to uninstall the mod easily.
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

valpo04

Quote from: Joker™ on August 03, 2014, 09:39:59 AM
Quote from: valpo04 on August 02, 2014, 02:19:52 PM
The uninstall test shows it making the modification on Load.php.

It is the only test that fails so maybe it makes sense that this edit is for MessageIndex.template.php.

Not sure why it is attempting to make the edit on Load.php.
Ok, I wasn't able to reproduce the error. You can try the following things
Make backup of your files before trying this
Also make backup of your package zip file

Upload and replace the attached zip file to the 'Packages' folder using FTP and see if you are able to uninstall the mod easily.

Thanks for this, Joker.

Unfortunately, I uploaded this file and then tried to uninstall and received the same error.

I also just checked the modification for 'MessageIndex.template.php' and it differs from the modification for 'Load.php.'

Here is the mod for Message.template.php:

Find:
if(!empty($modSettings['like_post_enable']) && LP_isAllowedTo('can_view_likes')) {
$total_likes = isset($context['like_posts']['posters_data'][$message['member']['id']]) ? $context['like_posts']['posters_data'][$message['member']['id']] : 0;

echo '
<li class="postcount"><a href="', $scripturl ,'?action=profile;area=likeposts;sa=seeotherslikes;u=', $message['member']['id'], '">', $txt['like_post_total_likes'] . ': ' . $total_likes, '</a></li>';
}

// Is karma display enabled?  Total or +/-?


Replace:
// Is karma display enabled?  Total or +/-?



Compared to the mod for Load.php:

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

if(!empty($modSettings['like_post_enable']) && !empty($modSettings['lp_show_like_on_boards']) && LP_isAllowedTo(array('can_like_posts', 'can_view_likes'))) {
$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="like_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('can_view_likes'))
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>';
}


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

Beelzeboss

#394
Dear Joker, there is an issue in versions 1.5 & 1.5.2 when you want to show the 'likes notification" from a smartphone browser (stock android browser and chrome). Actually, you can't see the latest likes from a smartphone. This issue was not in version 1.3.1. (I didn't test 1.4.)

Quote from: Joker™ on August 02, 2014, 12:53:15 PM
I've created separate classes for like/unlike button in upcoming version. With that you'll be able to style like/unlike easily as per your preferences.

Could you do that optional for someone who wants as it is now?

Thank you.

Joker™

Quote from: valpo04 on August 04, 2014, 07:51:24 AM
Thanks for this, Joker.

Unfortunately, I uploaded this file and then tried to uninstall and received the same error.

I also just checked the modification for 'MessageIndex.template.php' and it differs from the modification for 'Load.php.'

Here is the mod for Message.template.php:

Find:
if(!empty($modSettings['like_post_enable']) && LP_isAllowedTo('can_view_likes')) {
$total_likes = isset($context['like_posts']['posters_data'][$message['member']['id']]) ? $context['like_posts']['posters_data'][$message['member']['id']] : 0;

echo '
<li class="postcount"><a href="', $scripturl ,'?action=profile;area=likeposts;sa=seeotherslikes;u=', $message['member']['id'], '">', $txt['like_post_total_likes'] . ': ' . $total_likes, '</a></li>';
}

// Is karma display enabled?  Total or +/-?


Replace:
// Is karma display enabled?  Total or +/-?



Compared to the mod for Load.php:

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

if(!empty($modSettings['like_post_enable']) && !empty($modSettings['lp_show_like_on_boards']) && LP_isAllowedTo(array('can_like_posts', 'can_view_likes'))) {
$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="like_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('can_view_likes'))
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>';
}


Replace:
<a href="', $topic['new_href'], '" id="newicon' . $topic['first_post']['id'] . '"><img src="', $settings['lang_images_url'], '/new.gif" alt="', $txt['new'], '" /></a>';
Well you can take a hard step. It's your call,

Uninstall the mod(even with errors), and see if all the edits are removed across all files. If any edit related to the mod is left, you can remove it manually.
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: Beelzeboss on August 09, 2014, 06:53:36 PM
Dear Joker, there is an issue in versions 1.5 & 1.5.2 when you want to show the 'likes notification" from a smartphone browser (stock android browser and chrome). Actually, you can't see the latest likes from a smartphone. This issue was not in version 1.3.1. (I didn't test 1.4.)
Will see to it, thanks for the info.


Quote from: Beelzeboss on August 09, 2014, 06:53:36 PM
Quote from: Joker™ on August 02, 2014, 12:53:15 PM
I've created separate classes for like/unlike button in upcoming version. With that you'll be able to style like/unlike easily as per your preferences.
Could you do that optional for someone who wants as it is now?

Thank you.
Well the mod code is on github, anyone can take it from there, but it's untested and I'd highly unrecommend against it. Once I feel its stable there will be a new mod version released.
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

elf_fu

I've been wanting to use a Likes mod on my forum for about a year. Due to my limited knowledge in coding, issues and so on--I've never been able to find a mod that worked with our theme, forum, etc.

I just want to say THANK YOU for this mod! I backed up everything an hour ago, downloaded, ran a test check--which came out clean as a whistle, no errors, despite having a lot of extra mods--installed it and voila. Worked right out of the mod box, so to speak. (My forum is version 2.0.8.)

Thanks to members in this post as well as the mod creators answered, it was super easy to find the  .css too, to tweak colors.

Thank you! This mod is perfect for us!

GR

johndays

Quote from: johndays on July 27, 2014, 07:14:17 AM
Thank you for your continuous feedback.

@Joker™

Some samples :

João (ã)
Informação (ç and ã)

At least this 2.

Best regards,
Quote from: Joker™Thanks for the info, will be trying it out soon.

There is some update? Thank you so much in advance.

Joker™

Quote from: elf_fu on August 11, 2014, 11:12:28 AM
I've been wanting to use a Likes mod on my forum for about a year. Due to my limited knowledge in coding, issues and so on--I've never been able to find a mod that worked with our theme, forum, etc.

I just want to say THANK YOU for this mod! I backed up everything an hour ago, downloaded, ran a test check--which came out clean as a whistle, no errors, despite having a lot of extra mods--installed it and voila. Worked right out of the mod box, so to speak. (My forum is version 2.0.8.)

Thanks to members in this post as well as the mod creators answered, it was super easy to find the  .css too, to tweak colors.

Thank you! This mod is perfect for us!
Thanks for such kind words :)


Quote from: johndays on August 14, 2014, 04:15:04 PM
Quote from: johndays on July 27, 2014, 07:14:17 AM
Thank you for your continuous feedback.

@Joker™

Some samples :

João (ã)
Informação (ç and ã)

At least this 2.

Best regards,
Quote from: Joker™Thanks for the info, will be trying it out soon.

There is some update? Thank you so much in advance.
Nope, I was having some break, and went on holidays. Lol, real world isn't that bad :P
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

Advertisement: