Advertisement:

Author Topic: Like Posts  (Read 305597 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: 568
  • 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: 568
  • 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: 411
  • 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,128
    • 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: 114
  • 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:)