1.6 Compatible: Simple Like System
Final EDIT: Everything below is because I was using an older version of MyAlerts. My bad! I'll keep it here for reference though.

The converter works great. Converted over 19,000 likes pretty much instantly. The only problem I've encountered, so far, is the {$post['button_like']} isn't showing up in the postbit for some reason (so I'm unable to like/remove likes from posts). Permissions for all usergroups are set to be able to like posts.

EDIT: This was because the tables weren't added to _usergroups. How I found out:

I pasted the button directly into the postbit_classic template:

Code:
<a href="xmlhttp.php?action=like_post&amp;post_id={$post['pid']}&amp;my_post_key={$mybb->post_code}" class="btn_like postbit_button" id="likeButton_post_{$post['pid']}"><span class="icon-ok"></span> {$buttonText}</a>

And the FontAwesome icon shows up. I click that, and it gives me this pop up:

Quote:Your usergroup is not currently allowed to like posts.

I looked back at my individual usergroup (Admin) and upon clicking "Save," I get this MyBB error:

Quote:MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1054 - Unknown column 'simplelikes_can_like' in 'field list'
Query:
UPDATE tes_usergroups SET `type`='1', `title`='Administrator', `description`='The group all administrators belong to.', `namestyle`='{username}', `usertitle`='Administrator', `stars`='0', `starimage`='', `image`='', `isbannedgroup`='0', `canview`='1', `canviewthreads`='1', `canviewprofiles`='1', `candlattachments`='1', `canpostthreads`='1', `canpostreplys`='1', `canpostattachments`='1', `canratethreads`='1', `caneditposts`='1', `candeleteposts`='1', `candeletethreads`='1', `caneditattachments`='1', `canpostpolls`='1', `canvotepolls`='1', `canundovotes`='1', `canusepms`='1', `cansendpms`='1', `cantrackpms`='1', `candenypmreceipts`='1', `pmquota`='0', `maxpmrecipients`='0', `cansendemail`='1', `cansendemailoverride`='0', `maxemails`='0', `canviewmemberlist`='1', `canviewcalendar`='1', `canaddevents`='1', `canbypasseventmod`='1', `canmoderateevents`='1', `canviewonline`='1', `canviewwolinvis`='1', `canviewonlineips`='1', `cancp`='1', `issupermod`='1', `cansearch`='1', `canusercp`='1', `canuploadavatars`='1', `canchangename`='1', `showforumteam`='1', `usereputationsystem`='1', `cangivereputations`='1', `reputationpower`='2', `maxreputationsday`='0', `maxreputationsperuser`='0', `maxreputationsperthread`='0', `attachquota`='0', `cancustomtitle`='1', `canwarnusers`='1', `canreceivewarnings`='0', `maxwarningsday`='0', `canmodcp`='1', `showinbirthdaylist`='1', `canoverridepm`='1', `canusesig`='1', `canusesigxposts`='0', `signofollow`='0', `candelayedpost`='1', `canmanagecomments`='1', `cansendcomments`='1', `caneditselfcomments`='1', `candeleteselfcomments`='1', `canreportprofile`='1', `canuseprofilepic`='1', `canuploadprofilepic`='1', `profilepicmaxsize`='400', `profilepicmaxdimensions`='1280x720', `simplelikes_can_like`='1', `simplelikes_can_view_likes`='1' WHERE gid='4'

From there, I add the correct tables using phpMyAdmin (simplelikes_can_like and simplelikes_can_view_likes).

Everything seems to work fine now.
Reply
Strange that they weren't added in the first place. There were no error reports on install or anything?
Reply
Hi, I have a problem.

When I like a thread appears:

[Image: 3uAYT.jpg]

But if I refresh the page appears:

[Image: 3uB05.jpg]

I want the likebar like the 2 image when I press the button U_U.

Can you help me? Thanks in advance for the plugin Happy.
Reply
That's an odd one. ANy chance I could get a link to your site?
Reply
Is this: http://www.aniterasu.com/foro/index.php
Reply
(04-07-2013, 05:57 PM)Sasori Wrote: Is this: http://www.aniterasu.com/foro/index.php

AH, it's because of your postbit template. The script inserts the bar right at the end of the block that begins with:

PHP Code:
<div id="pid_... 

For your site, this block raps both the post content and the signature.

To fix it, open like_system.js. Find this:

PHP Code:
} else {
                    $(
'#pid_' post_id).after(data.templateString);
                } 

Replace it with this:

PHP Code:
} else {
                    $(
'#pid_' post_id ' fieldset').after(data.templateString);
                } 

That should work.
Jona and envira like this post
Reply
Thanks for the help, but don't work :S.

Uhm, look my Postbit_classic:

Code:
        <table width="100%">
            <tr><td>{$post['posturl']}<span class="smalltext"><strong>{$post['mysupport_status']}{$post['icon']}{$post['subject']} {$post['subject_extra']}<div class="float_right">{$post['mysupport_bestanswer']}{$post['mysupport_deny_support_post']}</div></strong></span>
            <br />
            <div id="pid_{$post['pid']}" style="padding: 5px 0 5px 0;">
            
<div>
<div id="1" style="float:left; z-index: 1; position: Absolute;">
<br><img src="images/globito01.png">
</div>
<div id="2" style="z-index: 0; padding: 5px;">
<fieldset style="background: #ffffff;
border:2px solid #bde1fd;
-moz-border-radius:8px;
-webkit-border-radius:8px;
position: relative;">
{$post['message']}
</fieldset>
        </div>
            
{$post['attachments']}
            {$post['signature']}
            <div style="text-align: right; vertical-align: bottom;" id="post_meta_{$post['pid']}">
                <div id="edited_by_{$post['pid']}">{$post['editedmsg']}</div>
                {$post['iplogged']}
            </div>
        </td></tr>
    </table>
</td>
</tr>
<tr>
    <td class="{$altbg}{$post['mysupport_bestanswer_highlight']}{$post['mysupport_staff_highlight']}" style="white-space: nowrap; text-align: center; vertical-align: middle;"><span class="smalltext">{$post['postdate']} {$post['posttime']}</span></td>
    <td class="{$altbg}{$post['mysupport_bestanswer_highlight']}{$post['mysupport_staff_highlight']}" style="vertical-align: middle;">
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
            <tr valign="bottom">
                <td align="left" ><span class="smalltext">{$post['button_email']}{$post['button_pm']}{$post['button_www']}{$post['button_find']}{$post['button_rep']} </span></td>
                <td align="right">{$post['button_like']}{$post['button_edit']}{$post['button_quickdelete']}{$post['button_quote']}{$post['thanks']}{$post['button_multiquote']}{$post['button_report']}{$post['button_warn']}{$post['button_reply_pm']}{$post['button_replyall_pm']}{$post['button_forward_pm']}{$post['button_delete_pm']}</td>
            </tr>
        </table>
    </td>
</tr>
{$post['simplelikes']}
{$post['postrep_inline']}
</table>{$post['postrep_outline']}

Look my {$post['simplelikes']}.

And my simplelikes_likebar:

Code:
<div id="post_likes_{$post['pid']}">
<tr>
<td bgcolor="#A9F5A9"><center><img src="http://www.portalcienciayficcion.com/foro/images/smilies/pacman.gif"></center></td>
<td bgcolor="#A9F5A9"><img src="http://cdn2.iconfinder.com/data/icons/linecons/32/like-16.png"> {$likeString}</td>
</tr>
</div>

I want the likebar appears in the <tr>, can I? :S.

Thanks in advance.
Reply
Yes, it's possible. CHange simplelikes_likebar to this:

PHP Code:
<tr>
<
td bgcolor="#A9F5A9"><center><img src="http://www.portalcienciayficcion.com/foro/images/smilies/pacman.gif"></center></td>
<
td bgcolor="#A9F5A9" id="post_likes_{$post['pid']}"><img src="http://cdn2.iconfinder.com/data/icons/linecons/32/like-16.png"> {$likeString}</td>
</
tr

Then change the JS I posted above to this:

PHP Code:
} else {
                    $(
'#post_' post_id).append(data.templateString);
                } 
Sasori likes this post
Reply
Now, thanks thanks thanks, I love this plugin *_*.

I changed the simplelikes_likebar to this finally:

PHP Code:
<tr id="post_likes_{$post['pid']}">
<
td bgcolor="#A9F5A9"><center><img src="http://www.portalcienciayficcion.com/foro/images/smilies/pacman.gif"></center></td>
<
td bgcolor="#A9F5A9"><img src="http://cdn2.iconfinder.com/data/icons/linecons/32/like-16.png"> {$likeString}</td>
</
tr

And works perfect. Thanks again Happy.
euan likes this post
Reply
(05-07-2013, 05:36 PM)Sasori Wrote: Now, thanks thanks thanks, I love this plugin *_*.

I changed the simplelikes_likebar to this finally:

PHP Code:
<tr id="post_likes_{$post['pid']}">
<
td bgcolor="#A9F5A9"><center><img src="http://www.portalcienciayficcion.com/foro/images/smilies/pacman.gif"></center></td>
<
td bgcolor="#A9F5A9"><img src="http://cdn2.iconfinder.com/data/icons/linecons/32/like-16.png"> {$likeString}</td>
</
tr

And works perfect. Thanks again Happy.

So glad you got it working at last Happy
Sasori likes this post
Reply