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

jsx

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.


jsx

To remove the Like stats link from the menu bar, I need to remove this code?

Sources/LikePosts/LikePosts.php

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;
}

vbgamer45

After global $scripturl, $txt, $user_info, $modSettings;


Add

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

jsx

Properly?

global $scripturl, $txt, $user_info, $modSettings; return;


vbgamer45

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

jsx

Do you mean this way?

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

return;


Full code:

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;
}

vbgamer45

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

jsx

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

vbgamer45

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

jsx

It's so a bit strange in this mod, the whole mod can be translated except for one word. ::)


vbgamer45

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

jsx

#1071
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?

vbgamer45

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

jsx

It would be cool if there was such a possibility. :)

DreadPirateRoberts

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!

vbgamer45

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

danster

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

vbgamer45

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

danster

Quote from: vbgamer45 on May 09, 2020, 05:35:52 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

DreadPirateRoberts

Quote from: danster on May 09, 2020, 06:16:53 PM
Quote from: vbgamer45 on May 09, 2020, 05:35:52 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
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!

Advertisement: