Advertisement:

Author Topic: Like Posts  (Read 345003 times)

Offline Rob Lightbody

  • Charter Member
  • Jr. Member
  • *
  • Posts: 172
  • Gender: Male
  • Rob Lightbody, QE2 Story Forum administrator
    • The QE2 Story
Re: Like Posts
« Reply #1040 on: January 14, 2020, 03:09:10 PM »
...
Installed OK - but now I have the "Like Posts" button on my menu bar as the first thing - before Home - affects all users - and is very confusing!  (I instinctively click the first button on the menu bar when i want to go home!).
...

Is anyone able to help with this please?  Screenshot attached to explain.

Thank you very much!

Online vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 23,201
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Like Posts
« Reply #1041 on: January 14, 2020, 03:44:25 PM »
Do you want to remove from menu completely? Or change position?
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 Rob Lightbody

  • Charter Member
  • Jr. Member
  • *
  • Posts: 172
  • Gender: Male
  • Rob Lightbody, QE2 Story Forum administrator
    • The QE2 Story
Re: Like Posts
« Reply #1042 on: January 14, 2020, 05:47:36 PM »
Do you want to remove from menu completely? Or change position?

Move it's position, anywhere but first place!!

Online vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 23,201
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Like Posts
« Reply #1043 on: January 14, 2020, 06:17:42 PM »
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)
);
}
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: 495
  • Gender: Male
Re: Like Posts
« Reply #1044 on: March 17, 2020, 08:17:55 AM »
vbgamer45,

I use a different theme than the default one and when I want to install this modification I get the following error:

Execute Modification:

index.template.php

Code: (Find)

Code: [Select]
<li><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a></li>';
Code: (Add After)

Code: [Select]
if(LikePosts::$LikePostsUtils->showLikeNotification()) {
echo '
<li><span class="showLikeNotification" onclick="lpObj.likePostsNotification.showLikeNotification()">', $txt['like_show_notifications'], '</span></li>';
}

So I have to do this change manually, right?
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: 23,201
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Like Posts
« Reply #1045 on: March 17, 2020, 09:03:31 AM »
Yes, that change would need to be done manually.
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: 495
  • Gender: Male
Re: Like Posts
« Reply #1046 on: March 19, 2020, 05:58:22 AM »
vbgamer45,

I use the Express theme, which I bought a long time ago at DzinerStudio. This code does not exist in the index.template.php file:

Code: [Select]
<li><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a></li>';
This file has the following code:

Code: [Select]
<li><a class="dot" href="', $scripturl, '?action=unread">', $txt['view_unread'], '</a></li>
<li><a class="dot" href="', $scripturl, '?action=unreadreplies">', $txt['view_replies'], '</a></li>';

So I have to add this code:

Code: [Select]
if(LikePosts::$LikePostsUtils->showLikeNotification()) {
echo '
<li><span class="showLikeNotification" onclick="lpObj.likePostsNotification.showLikeNotification()">', $txt['like_show_notifications'], '</span></li>';
}

Under this code?

Code: [Select]
<li><a class="dot" href="', $scripturl, '?action=unread">', $txt['view_unread'], '</a></li>
<li><a class="dot" href="', $scripturl, '?action=unreadreplies">', $txt['view_replies'], '</a></li>';
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: 23,201
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Like Posts
« Reply #1047 on: March 19, 2020, 08:14:06 AM »
Yes you can add it after.
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: 495
  • Gender: Male
Re: Like Posts
« Reply #1048 on: March 19, 2020, 09:54:02 AM »
After adding this code:

Code: [Select]
if(LikePosts::$LikePostsUtils->showLikeNotification()) {
echo '
<li><span class="showLikeNotification" onclick="lpObj.likePostsNotification.showLikeNotification()">', $txt['like_show_notifications'], '</span></li>';
}

The theme does not display correctly.



Why is this happening?
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: 23,201
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Like Posts
« Reply #1049 on: March 19, 2020, 10:04:42 AM »
Post your whole file you modified.
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: 495
  • Gender: Male
Re: Like Posts
« Reply #1050 on: March 19, 2020, 02:21:40 PM »
I attached the file.

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: 23,201
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Like Posts
« Reply #1051 on: March 19, 2020, 02:23:51 PM »
Not seeing anything wrong with the code you added. It looks like a theme issue.
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: 495
  • Gender: Male
Re: Like Posts
« Reply #1052 on: March 19, 2020, 02:42:19 PM »
Do you surmise what could be wrong with this theme? I installed this modification without any changes to the express theme and this modification works, but the "Like" button is not displayed.
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: 23,201
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Like Posts
« Reply #1053 on: March 19, 2020, 02:42:58 PM »
Not really sure not familiar with theme issues.
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: 495
  • Gender: Male
Re: Like Posts
« Reply #1054 on: March 19, 2020, 03:08:12 PM »
The issue with installing this modification is on many themes. Even on the premium theme from smftricks there are errors from this modification during installation.
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: 23,201
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Like Posts
« Reply #1055 on: March 19, 2020, 03:44:43 PM »
Yes, that will happen with custom themes.
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: 495
  • Gender: Male
Re: Like Posts
« Reply #1056 on: March 20, 2020, 06:10:06 AM »
vbgamer45,

The modification works, I made a mistake not installing for the theme. ::) 8)
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: 23,201
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Like Posts
« Reply #1057 on: March 20, 2020, 08:06:59 AM »
Good to know.
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: 495
  • Gender: Male
Re: Like Posts
« Reply #1058 on: March 22, 2020, 03:27:51 PM »
vbgamer45,

I want to change the position of the Like stats link. How can I do that? Ideally, this link should be placed before Logout. Why is the link from this modification there is in the first position in the menu bar?
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: 23,201
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Like Posts
« Reply #1059 on: March 22, 2020, 03:32:10 PM »
Not easy to change since it is hook based you have to edit the php hook code.
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