Advertisement:

Author Topic: Like Posts  (Read 309597 times)

Offline JoeWaters

  • Newbie
  • *
  • Posts: 6
  • Gender: Male
    • PSR Tutorial
Re: Like Posts
« Reply #940 on: February 03, 2018, 03:23:51 PM »
I've passed that link on to the server admins. Hopefully, they (Lunarpages) will be able to apply that fix. Thank you!

Offline Black Tiger

  • Full Member
  • ***
  • Posts: 577
  • Gender: Male
    • Satellite Fun
Re: Like Posts
« Reply #941 on: April 25, 2018, 04:06:01 PM »
We're having the same issue CDLehner had, and we did not make any changes to the modfiles.
Yes we made changes to index.template.php but that shouldn't be any issue since other mods do that too.

Uninstalling 2.02 gave errors. Reinstalling 2.02 did not help. Placing index.template.php back did not help either.

The thing is we moved from a server without https and mod_ruid2 and php 5.3.36 to a server with https and mod_ruid2 and php 5.6.35. After that the Like button did not work anymore.
You could click on it, but it would not respond anymore.

So we tried uninstalling 2.02 which gave errors and a blank screen. We had to put all files back and it worked again, however it displayed "uninstalled. So we installed it again, uninstalled it (which went fine that time) and again a blank screen.
So again all files back. Getting tired of this crap, installed 2.0.5. Which is working.

But not as should be. There are 2 like buttons now. If I use the right side like button, a like will be added, but I can like as often as I want (and my name get's mentioned +1 every time in the list of people who liked).

The left side like button turns to a unlike button (when liking with the right side button) with which I can remove all my likes again.

Does not look like it works as should be.

I would like to remove the complete thing to get a clean version again but don't know how.
But if the above could be fixed I would be happy to.

Maybe it's in here. This is from the /Themes/default/index.template.php which contains multiple lines, should this be like this? Or is one of these lines from the old mod version an can be removed?

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

                if(LikePosts::$LikePostsUtils->showLikeNotification()) {
                        echo '
                                        <li><a href="#" class="showLikeNotification" onclick="lpObj.likePostsNotification.showLikeNo
tification()">', $txt['like_show_notifications'], '</a></li>';
« Last Edit: April 25, 2018, 04:16:24 PM by Black Tiger »
Greetings, Black Tiger

Offline Black Tiger

  • Full Member
  • ***
  • Posts: 577
  • Gender: Male
    • Satellite Fun
Re: Like Posts
« Reply #942 on: April 25, 2018, 04:57:19 PM »
This one was not a duplicate, but in other base php files (source and default templates and custom templates) there were duplicate entry's.
Removed all duplicate entry's from those files. When removing the correct ones, the uninstaller turned the files in black with test succesfull. This way I removed all duplicates and seems to work fine now again.

So fixed it. :)
Greetings, Black Tiger

Offline sera

  • Newbie
  • *
  • Posts: 5
Re: Like Posts
« Reply #943 on: April 30, 2018, 05:24:24 PM »
When installed on 2.0.15, users can no longer access anything, instead receiving the error:

Unable to load the 'main_above' template.

This occurs regardless of what theme they are using.  Now, for the details.

We have three custom themes available: DarkDream, Dash, and Everest.  Install failed on each of their index.template.php files.  i manually edited DarkDream for the installation failure.  Test user immediately received the above error on next refresh, regardless of theme used.

Admin can manually change a user's theme to either Dash or Everest and users can navigate the site again.  Putting the user on DarkDream, however, causes the error again.  A user force changed to a theme can then change to another theme. 

Manual edit is as follows:

Ctrl+F
Code: [Select]
<li><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a></li>';
AddAfter
Code: [Select]
if(LikePosts::$LikePostsUtils->showLikeNotification()) {
            echo '
                    <li><span class="showLikeNotification" onclick="lpObj.likePostsNotification.showLikeNotification()">', $txt['like_show_notifications'], '</span></li>';
        }

i'm guessing it's where the If(LikePosts) function is set; messing with the If/Else coding?  This now appears within the file as:

Code: [Select]
// User login
if (!empty($context['user']['is_logged']))
echo '
<li><a href="', $scripturl, '?action=profile;area=forumprofile">', $txt['forumprofile'], '</a></li>
<li><a href="', $scripturl, '?action=profile;area=account">', $txt['account'], '</a></li>
<li><a href="', $scripturl, '?action=unread">', $txt['unread_topics_visit'], '</a></li>
<li><a href="', $scripturl, '?action=unreadreplies">', $txt['unread_replies'], '</a></li>

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

<li class="divider"></li>
<li><a href="', $scripturl, '?action=logout;', $context['session_var'], '=', $context['session_id'], '">', $txt['logout'], '</a></li>';
else
echo '
<li><a href="#" data-toggle="modal" data-target="#loginModal">', $txt['login'], '</a></li>
<li><a href="', $scripturl, '?action=register">', $txt['register'], '</a></li>';

Thank you for any assistance!  This has always been a forum favourite mod.

Offline GL700Wing

  • Full Member
  • ***
  • Posts: 428
  • Gender: Female
Re: Like Posts
« Reply #944 on: April 30, 2018, 07:31:55 PM »
The 'echo' command in the following block of code is not terminated - there should be a '; at the end after the </li>.

Code: [Select]
// User login
if (!empty($context['user']['is_logged']))
echo '
<li><a href="', $scripturl, '?action=profile;area=forumprofile">', $txt['forumprofile'], '</a></li>
<li><a href="', $scripturl, '?action=profile;area=account">', $txt['account'], '</a></li>
<li><a href="', $scripturl, '?action=unread">', $txt['unread_topics_visit'], '</a></li>
<li><a href="', $scripturl, '?action=unreadreplies">', $txt['unread_replies'], '</a></li>

Also, there is no 'echo' command at the beginning of the following block of code (which shouldn't be between the '}' and the 'else'):
Code: [Select]
<li class="divider"></li>
<li><a href="', $scripturl, '?action=logout;', $context['session_var'], '=', $context['session_id'], '">', $txt['logout'], '</a></li>';

I think the following block of code should work:
Code: [Select]
// User login
if (!empty($context['user']['is_logged']))
{
echo '
<li><a href="', $scripturl, '?action=profile;area=forumprofile">', $txt['forumprofile'], '</a></li>
<li><a href="', $scripturl, '?action=profile;area=account">', $txt['account'], '</a></li>
<li><a href="', $scripturl, '?action=unread">', $txt['unread_topics_visit'], '</a></li>
<li><a href="', $scripturl, '?action=unreadreplies">', $txt['unread_replies'], '</a></li>';

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

echo '
<li class="divider"></li>
<li><a href="', $scripturl, '?action=logout;', $context['session_var'], '=', $context['session_id'], '">', $txt['logout'], '</a></li>';
}
else
echo '
<li><a href="#" data-toggle="modal" data-target="#loginModal">', $txt['login'], '</a></li>
<li><a href="', $scripturl, '?action=register">', $txt['register'], '</a></li>';
« Last Edit: April 30, 2018, 07:45:26 PM by GL700Wing »

Offline sera

  • Newbie
  • *
  • Posts: 5
Re: Like Posts
« Reply #945 on: May 01, 2018, 01:08:47 PM »
Perfect fix!  Thank you so much, GL700Wing!!!!

Edit: Okay, well the theme is up and working again!  lol  i may need another edit later as i'm having some difficultly locating the Like option on the theme. xD Thank you, thank you!

Didn't have the user permissions set up correctly!  Again, thank you so much! =3
« Last Edit: May 01, 2018, 01:26:41 PM by sera »

Offline vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 20,272
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Like Posts
« Reply #946 on: June 10, 2018, 04:29:57 PM »
Version 2.0.6 released
- Remote Avatars now also support https
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 efk

  • Jr. Member
  • **
  • Posts: 126
  • Gender: Male
Re: Like Posts
« Reply #947 on: June 16, 2018, 06:52:38 PM »
Hey guys I really want to have dislike button. Someone have lines which should be added to have dislike with same functions which like have? And of course if someone click on some of those button it should disable another one till clicking on Unlike. Any help so I can summon one brilliant coder to install that plugin finally?  O:)

Offline SirLouen

  • Semi-Newbie
  • *
  • Posts: 71
Re: Like Posts
« Reply #948 on: June 24, 2018, 09:55:31 AM »
I used to have both combined Thank-o-matic and Like Posts
I recently deleted Thank-o-matic and now Like Posts it's crashing

I've tried to remove Like Posts and "reinstalling it" without deleting the DB registers but it's not working

Some errors:

On "sa=savegeneralsettings": Function name must be a string

forum.com/index.php?pretty;action=admin&amp;area=likeposts;sa=savegeneralsettings
8: Undefined property: LikePostsAdmin::$Array /Sources/LikePosts/LikePostsRouter.php
Line: 128

forum.com/index.php?pretty;action=admin&amp;area=likeposts;sa=savegeneralsettings
8: Array to string conversion /Sources/LikePosts/LikePostsRouter.php
Line: 91

forum.com/index.php?pretty;action=admin&amp;area=likeposts;sa=savegeneralsettings
8: Undefined property: LikePostsAdmin::$Array /Sources/LikePosts/LikePostsRouter.php
Line: 91

On "sa=seeotherslikes": Function name must be a string

forum.com/index.php?pretty;action=profile&amp;area=likeposts;sa=seeotherslikes;u=1
8: Undefined property: LikePostsProfile::$ArrayAplicar Sources/LikePosts/LikePostsRouter.php
Line 128


The most interesting thing is that ?area=likeposts;u=1 workswell (with a result equivalent to sa=seeownlikes)

But when clicking on sa=seeownlikes: Function name must be a string
forum.com/index.php?pretty;action=profile&amp;area=likeposts;sa=seeownlikes;u=1
8: Undefined property: LikePostsProfile::$Array /Sources/LikePosts/LikePostsRouter.php
Line: 128


Offline vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 20,272
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Like Posts
« Reply #949 on: June 24, 2018, 10:46:10 AM »
Try to uninstall like posts then reinstall hooks might have gotten cleared.
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 SirLouen

  • Semi-Newbie
  • *
  • Posts: 71
Re: Like Posts
« Reply #950 on: June 24, 2018, 11:34:53 AM »
Try to uninstall like posts then reinstall hooks might have gotten cleared.

Quote from: SirLouen
I've tried to remove Like Posts and "reinstalling it" without deleting the DB registers but it's not working

Did so, same errors.

This happens with the "sa=" of Like Posts exclusively. Not with other sa= of the forum
No errors or anything during the installation

Maybe I have to recreate this part manually in the DB?

Offline SirLouen

  • Semi-Newbie
  • *
  • Posts: 71
Re: Like Posts
« Reply #951 on: June 24, 2018, 11:51:47 AM »
It seems that this issue is not new:
https://github.com/siddhartha-gupta/SMF-Likes/issues/53

It has been happening from last year.

Offline SirLouen

  • Semi-Newbie
  • *
  • Posts: 71
Re: Like Posts
« Reply #952 on: June 24, 2018, 12:29:07 PM »
I see that this guy solved this
https://github.com/siddhartha-gupta/SMF-Likes/pull/51/commits/5ddc158ff148a3eb9c8b2145e3bbced9d602b14d

It seems the huge problem is with installations based on PHP 7+
I've now solved the previous issue, but now new issues arise :P

Call to undefined function getOwnLikes()

Offline SirLouen

  • Semi-Newbie
  • *
  • Posts: 71
Re: Like Posts
« Reply #953 on: June 24, 2018, 05:46:46 PM »
Call to undefined function getOwnLikes()

Ok, I've solved this also
I put:
return LikePosts::$LikePostsProfile->{$subActions[$_REQUEST['sa']]($memID)};
Instead of:
return LikePosts::$LikePostsProfile->{$subActions[$_REQUEST['sa']]}($memID);

Now the mod is running smoothly in PHP 7+

@vbgamer45 push changes for future Like Posts 2.0.7 :)
PD: Don't forget to update version in all the files, you still have all versioned under 2.0.5 on 2.0.6

Offline pocttopus

  • Jr. Member
  • **
  • Posts: 260
    • @pocttopus on Twitter
Re: Like Posts
« Reply #954 on: June 26, 2018, 07:23:59 AM »
Is there any way to use some kind of Like icon instead of hyperlink!?

Offline SirLouen

  • Semi-Newbie
  • *
  • Posts: 71
Re: Like Posts
« Reply #955 on: June 26, 2018, 07:25:45 AM »
Is there any way to use some kind of Like icon instead of hyperlink!?

Not by default. There is no hyperlink, there is a button

Offline pocttopus

  • Jr. Member
  • **
  • Posts: 260
    • @pocttopus on Twitter
Re: Like Posts
« Reply #956 on: June 26, 2018, 07:34:28 AM »
Yes, I was referring to button which is very similar to hyperlink with background color.
So no way to use icon instead of button?

Offline SirLouen

  • Semi-Newbie
  • *
  • Posts: 71
Re: Like Posts
« Reply #957 on: June 26, 2018, 07:36:35 AM »
Yes, there is, but manually through code

Offline pocttopus

  • Jr. Member
  • **
  • Posts: 260
    • @pocttopus on Twitter
Re: Like Posts
« Reply #958 on: June 27, 2018, 03:04:51 AM »
Thanks... I had added an like icon into LikePosts.css  :D

Code: [Select]
.like_link {
background: #3159A8 url(../../default/images/like/thumb-up.png) no-repeat;
padding: 1px 20px;
color: #fff !important;
position: relative;
border-radius: 2px;
}

Offline shawnb61

  • Support Specialist
  • Sr. Member
  • *
  • Posts: 867
    • sbulen on GitHub
Re: Like Posts
« Reply #959 on: June 30, 2018, 09:21:34 PM »
I believe the errors above are due to the lack of php7 support. 

It'd be nice to get that tweak in there when you have time!   :)
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp