Advertisement:

Author Topic: Like Posts  (Read 343341 times)

Offline gorbi

  • Jr. Member
  • **
  • Posts: 169
    • https://www.facebook.com/s.gorbachevsky on Facebook
    • @gorbachevsky on Twitter
Re: Like Posts
« Reply #1080 on: June 07, 2020, 09:00:50 AM »
I am using mod like posts ver. 2.0.5 by Joker. How to upgrade to this mod while maintaining the number of likes?

Offline vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 22,986
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Like Posts
« Reply #1081 on: June 07, 2020, 10:33:39 AM »
Uninstalling shouldn't remove the links. Unless you check the option to remove associated data
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 kilk

  • Semi-Newbie
  • *
  • Posts: 25
    • Elddem The MMORPG
Re: Like Posts
« Reply #1082 on: June 09, 2020, 04:04:25 PM »
Epic mod vbgamer! Love it! Still using it!
Elddem The MMORPG - https://www.elddem.com | Denarius (D) Cryptocurrrency - https://www.denarius.io | BlockForums - Cryptocurrency Community Forums - https://www.blockforums.org

Offline GL700Wing

  • Full Member
  • ***
  • Posts: 548
  • Gender: Female
Re: Like Posts
« Reply #1083 on: July 04, 2020, 07:17:11 AM »
Hmm looks like this mod uses hooks should add it after the logout button

sources/likeposts/LikePosts.php

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

// insert before logout
$initPos = 0;
reset($menu_buttons);
while (($key = key($menu_buttons) && $val = current($menu_buttons)) && $key != 'logout')
$initPos++;

$menu_buttons = array_merge(
array_slice($menu_buttons, 0, $initPos),
array(
'like_post_stats' => array(
'title' => $txt['lp_stats'],
'href' => $scripturl . '?action=likepostsstats',
'show' => true,
'sub_buttons'=> ''
),
),
array_slice($menu_buttons, $initPos, count($menu_buttons) - $initPos)
);
}

The  'Like stats'  menu button is being inserted as the first menu button because of a minor bug in the placement code - in order to insert the  'Like stats'  button before the  'Logout'  button the value of  $initPos  needs to be reduced by 1 after the position of the 'logout' menu button is found.

In the file ./Sources/LikePosts/LikePosts.php
Find:
Quote
      while (($key = key($menu_buttons) && $val = current($menu_buttons)) && $key != 'logout')
      $initPos++;

Add After:
Quote

      // reduce $initPos by 1 to insert button before 'logout'
      $initPos = $initPos - 1;
Life doesn't have to be perfect to be wonderful ...

Offline Sectomy

  • Semi-Newbie
  • *
  • Posts: 89
Re: Like Posts
« Reply #1084 on: July 10, 2020, 07:31:45 AM »
Hi,

i have the Sunrise Theme and theres a little Problem with the Notification List in die "Menue"... is there any way to remove those Notification Entries in that menue ?
"show Like information"

Offline Welicak94

  • Newbie
  • *
  • Posts: 8
Re: Like Posts
« Reply #1085 on: July 21, 2020, 03:29:30 PM »
Hi, vbgamer45.

I have upgraded my SMF site and I had "Like Posts" mod installed. I do know that after upgrading, modifications are "removed". But, when I do install this mod again, I have two "Like" buttons sitting one to another. I believe I have doubled codes right now, but can you tell me which file I should edit and what part of code exactly?
Before installing it again, I do already have one "Like" button, but it does not work. When I click on it, nothing happens.

Thank you in advance.

Offline vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 22,986
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Like Posts
« Reply #1086 on: July 21, 2020, 03:45:37 PM »
This mod for the menu buttons does not edit files...Uses hooks which means it calls code at runtime without file edits.
Try to uninstall the mod again and see if it disappears.

If not you will have to manually remove the hooks with this mod https://custom.simplemachines.org/mods/index.php?mod=3285
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 Welicak94

  • Newbie
  • *
  • Posts: 8
Re: Like Posts
« Reply #1087 on: July 21, 2020, 05:20:37 PM »
Thank you for you reply, sir.

I had done both advices, but unfortunately, I'm still facing problems.
After failed uninstalling and re-installing, I tried a mod you linked.

I did deleted all the hooks naming "LikePosts", after that - this text appeared after the post:
"Class 'LikePosts' not found" .
Installing after all of the deleted hooks, got back old problem - two buttons sitting to one another.

Maybe I'm missing some hook which need to be deleted?

Offline vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 22,986
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Like Posts
« Reply #1088 on: July 21, 2020, 05:28:36 PM »
Unfortunately with hooks not easy to fix will require going into the smf_settings table and removing entries.
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 Welicak94

  • Newbie
  • *
  • Posts: 8
Re: Like Posts
« Reply #1089 on: July 21, 2020, 05:47:48 PM »
Sorry for troubling you.
I believe you thought about MySQL table.
These are all rows containing "like" word in the "smf_settings" table.
Should I delete all of them?

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,147
Re: Like Posts
« Reply #1090 on: July 21, 2020, 06:01:03 PM »
No, if you have duplicate installations, you need to find the settings marked integrate_ and change those.
No good deed goes unpunished
All helpful urges should be circumvented

Offline Welicak94

  • Newbie
  • *
  • Posts: 8
Re: Like Posts
« Reply #1091 on: July 23, 2020, 12:37:30 PM »
Thanks.

Offline dan3

  • Newbie
  • *
  • Posts: 6
Re: Like Posts
« Reply #1092 on: July 28, 2020, 12:38:59 AM »
Currently running Like Posts 2.0.5 and SMF 2.0.14

When I click on remove duplicate likes it used to run the task and do that. But recently it started just freezing up and requiring the whole forum to be rebooted from AWS.

Any ideas? Will upgrading to Like Posts 2.2 fix anything?

Offline vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 22,986
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Like Posts
« Reply #1093 on: July 29, 2020, 07:39:09 PM »
How many likes on your forum.  Freezing do you mean like long run time on the sql statements? Or page just goes white?
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 LWillisjr

  • Newbie
  • *
  • Posts: 6
Re: Like Posts
« Reply #1094 on: August 12, 2020, 09:29:32 PM »
I just found this mod and very interested in it. I just installed on my site which is running SMF version 2.0.17
I installed the mod, and it shows up in the admin panel. I enabled it for a couple of boards as a test but I don't see the "Like" button appearing anywhere. What am I missing? Anyone else have this working on 2.0.17?

Offline DreadPirateRoberts

  • Semi-Newbie
  • *
  • Posts: 39
    • Agora Road's Macintosh Caf
Re: Like Posts
« Reply #1095 on: August 13, 2020, 01:31:23 AM »
I just found this mod and very interested in it. I just installed on my site which is running SMF version 2.0.17
I installed the mod, and it shows up in the admin panel. I enabled it for a couple of boards as a test but I don't see the "Like" button appearing anywhere. What am I missing? Anyone else have this working on 2.0.17?
yes its working on my site currently.  Try going on your board setting and enable like posts button
Welcome to Agora Road's Macintosh Cafe || A retro design vaporwave community forum! Enjoy your stay!

Online shawnb61

  • Developer
  • SMF Hero
  • *
  • Posts: 2,433
    • sbulen on GitHub
Re: Like Posts
« Reply #1096 on: September 08, 2020, 11:24:25 PM »
I have the same minor issue GL700Wing reported above.  The stats button is to the left of the Home button.

Took a minor tweak to fix. 
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp