Advertisement:

Author Topic: Like Posts  (Read 336174 times)

Offline jsx

  • Full Member
  • ***
  • Posts: 448
  • Gender: Male
Re: Like Posts
« Reply #1060 on: March 22, 2020, 03:35:57 PM »
I understand. How to edit the php code? Would you be able to create a guide? Probably many people would like to change the position of this link.

The Great Winged Hussars

https://www.youtube.com/watch?v=eWkrQQly6xU

We remember
In september
When The Winged Hussars arrived!

Offline jsx

  • Full Member
  • ***
  • Posts: 448
  • Gender: Male
Re: Like Posts
« Reply #1061 on: March 23, 2020, 01:50:55 PM »
To remove the Like stats link from the menu bar, I need to remove this code?

Sources/LikePosts/LikePosts.php

Code: [Select]
self::$LikePostsUtils->checkJsonEncodeDecode();
}

public static function addMenuItems(&$menu_buttons) {
global $scripturl, $txt, $user_info, $modSettings;

if (empty($modSettings['lp_mod_enable']) || empty($modSettings['lp_stats_enable']) ||
!self::$LikePostsUtils->isAllowedTo(array('lp_guests_can_view_likes_stats', 'lp_can_view_likes_stats'))) {
return false;
}
The Great Winged Hussars

https://www.youtube.com/watch?v=eWkrQQly6xU

We remember
In september
When The Winged Hussars arrived!

Online vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 22,517
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Like Posts
« Reply #1062 on: March 23, 2020, 02:17:35 PM »
After global $scripturl, $txt, $user_info, $modSettings;


Add
Code: [Select]
return;
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

Offline jsx

  • Full Member
  • ***
  • Posts: 448
  • Gender: Male
Re: Like Posts
« Reply #1063 on: March 23, 2020, 02:33:03 PM »
Properly?

Code: [Select]
global $scripturl, $txt, $user_info, $modSettings; return;
The Great Winged Hussars

https://www.youtube.com/watch?v=eWkrQQly6xU

We remember
In september
When The Winged Hussars arrived!

Online vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 22,517
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Like Posts
« Reply #1064 on: March 23, 2020, 03:01:06 PM »
proper would be on it's own line
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

Offline jsx

  • Full Member
  • ***
  • Posts: 448
  • Gender: Male
Re: Like Posts
« Reply #1065 on: March 23, 2020, 03:47:49 PM »
Do you mean this way?

Code: [Select]
public static function addMenuItems(&$menu_buttons) {
global $scripturl, $txt, $user_info, $modSettings;

return;

Full code:

Code: [Select]
self::$LikePostsUtils->checkJsonEncodeDecode();
}

public static function addMenuItems(&$menu_buttons) {
global $scripturl, $txt, $user_info, $modSettings;

return;

if (empty($modSettings['lp_mod_enable']) || empty($modSettings['lp_stats_enable']) ||
!self::$LikePostsUtils->isAllowedTo(array('lp_guests_can_view_likes_stats', 'lp_can_view_likes_stats'))) {
return false;
}
The Great Winged Hussars

https://www.youtube.com/watch?v=eWkrQQly6xU

We remember
In september
When The Winged Hussars arrived!

Online vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 22,517
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Like Posts
« Reply #1066 on: March 23, 2020, 04:02:41 PM »
yes
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

Offline jsx

  • Full Member
  • ***
  • Posts: 448
  • Gender: Male
Re: Like Posts
« Reply #1067 on: March 24, 2020, 05:38:12 AM »
Okay. And I added a link to the Like stats in the right place on the menu bar using the Ultimate Menu modification. Big thanks to live627 for creating this modification.

I would like to know why the word "liked" that appears in the popup notification window is not in the LikePosts.english.php file? I create a translation into my language and unfortunately the word remained in English.

Username liked Re: Some topic
The Great Winged Hussars

https://www.youtube.com/watch?v=eWkrQQly6xU

We remember
In september
When The Winged Hussars arrived!

Online vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 22,517
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Like Posts
« Reply #1068 on: March 24, 2020, 09:23:58 AM »
Hmm the liked text is hardcoded it looks like scripts\LikePosts\LikePosts.js line 407 and 421

scripts\LikePosts\LikePosts.min.js
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

Offline jsx

  • Full Member
  • ***
  • Posts: 448
  • Gender: Male
Re: Like Posts
« Reply #1069 on: March 24, 2020, 09:58:04 AM »
It's so a bit strange in this mod, the whole mod can be translated except for one word. ::)

The Great Winged Hussars

https://www.youtube.com/watch?v=eWkrQQly6xU

We remember
In september
When The Winged Hussars arrived!

Online vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 22,517
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Like Posts
« Reply #1070 on: March 24, 2020, 10:04:09 AM »
Yes it is but I didn't make it orginally.
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

Offline jsx

  • Full Member
  • ***
  • Posts: 448
  • Gender: Male
Re: Like Posts
« Reply #1071 on: March 24, 2020, 01:48:48 PM »
I understand. I wonder how SMF 2.1 will be released, this version 2.1 has its own like system and will all those likes from Like Posts modification be imported to the like system in SMF 2.1?
« Last Edit: March 24, 2020, 02:01:40 PM by jsx »
The Great Winged Hussars

https://www.youtube.com/watch?v=eWkrQQly6xU

We remember
In september
When The Winged Hussars arrived!

Online vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 22,517
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Like Posts
« Reply #1072 on: March 24, 2020, 02:14:51 PM »
Maybe would have to build it. Or someone might have made a script already to import it.
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

Offline jsx

  • Full Member
  • ***
  • Posts: 448
  • Gender: Male
Re: Like Posts
« Reply #1073 on: March 24, 2020, 02:22:55 PM »
It would be cool if there was such a possibility. :)
The Great Winged Hussars

https://www.youtube.com/watch?v=eWkrQQly6xU

We remember
In september
When The Winged Hussars arrived!

Offline DreadPirateRoberts

  • Semi-Newbie
  • *
  • Posts: 31
Re: Like Posts
« Reply #1074 on: May 01, 2020, 08:44:18 PM »
Would this be copatilable with the smf members award mod? As in if a user gets 100 likes, that user will get an award? This is the link https://github.com/Spuds/SMF-Member-Awards/releases
Welcome to Agora Road's Macintosh Cafe || A retro design vaporwave community forum! Enjoy your stay!
http://www.agoraroad.com/macforum/index.php

Online vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 22,517
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Like Posts
« Reply #1075 on: May 01, 2020, 09:05:49 PM »
Shouldn't break it but support would need to be built to add it to that mod.
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

Offline danster

  • Jr. Member
  • **
  • Posts: 145
  • Gender: Male
Re: Like Posts
« Reply #1076 on: May 09, 2020, 05:11:30 PM »
hello..

I have use smf ver 2.0.15 and I use like post mode and recently I uninstalled that mode and re installed so now in profile showing like stats twise

please some one can help me to correct that issue now it's showing total like amount twise

I attached a screen shot for reference

Online vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 22,517
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Like Posts
« Reply #1077 on: May 09, 2020, 05:35:52 PM »
Check that the edit wasn't made to the display.template.php file 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

Offline danster

  • Jr. Member
  • **
  • Posts: 145
  • Gender: Male
Re: Like Posts
« Reply #1078 on: May 09, 2020, 06:16:53 PM »
Check that the edit wasn't made to the display.template.php file twice.

I try to find but I could't so pls can you tell me the code what I have to find and edit

Offline DreadPirateRoberts

  • Semi-Newbie
  • *
  • Posts: 31
Re: Like Posts
« Reply #1079 on: May 10, 2020, 02:41:23 PM »
Check that the edit wasn't made to the display.template.php file twice.

I try to find but I could't so pls can you tell me the code what I have to find and edit

Check to see if this code is duplicated in the display.template.php
Code: [Select]
if(!empty($modSettings['lp_mod_enable']) &&
LikePosts::$LikePostsUtils->isBoardIncluded($context['current_board'])) {

$context['like_posts']['single_msg_data'] = LikePosts::$LikePostsUtils->isPostLiked($context['like_posts']['msgs_liked_data'], $message['id']);

echo '<div class="like_post_box floatleft">';
if(!$message['is_message_author'] && LikePosts::$LikePostsUtils->isAllowedTo('lp_can_like_posts')) {
echo '
<a class="', $context['like_posts']['single_msg_data']['already_liked'] ? 'like_link' : 'unlike_link', '" id="like_',$message['id'],'" href="#', $context['like_posts']['single_msg_data']['already_liked'], '" onclick="lpObj.likeHandler.likeUnlikePosts(event,', $message['id'],', ',$message['member']['id'],'); return false;">', $context['like_posts']['single_msg_data']['text'],'</a>';
}

if(LikePosts::$LikePostsUtils->isAllowedTo(array('lp_can_view_likes', 'lp_guest_can_view_likes_in_posts'))) {
echo '
<a id="like_post_info_'. $message['id'] .'" href="javascript:void(0)" onclick="lpObj.likeHandler.showMessageLikedInfo(', $message['id'], ')">
', !empty($context['like_posts']['single_msg_data']['count']) ? '<span id="like_count_'. $message['id'] .'">('. $context['like_posts']['single_msg_data']['count_text'] .')</span>' : '', '
</a>';
}
echo '</div>';
}

I had the same problem as you although I'm on mobile but try that
Welcome to Agora Road's Macintosh Cafe || A retro design vaporwave community forum! Enjoy your stay!
http://www.agoraroad.com/macforum/index.php