1.6 Compatible: Simple Like System
#71
(28-05-2013, 10:48 PM)euan Wrote:
(28-05-2013, 09:35 PM)Tecca Wrote: Awesome update, Euan, and thanks for the PM heads-up. I'll add it to my site now ( using this on my guild site over at http://www.kynaran.com ).

EDIT: Put the code into my postbit_classic template, but it doesn't display anything. I deactived and reactivated the plugin after replacing the files with the new ones. Is there anything else I have to do?

Stupid question, but did you enable it in the settings?

(28-05-2013, 10:53 PM)euan Wrote: Odd. Just upgraded here and it's not displaying either, though it works on my test forum.

Yep, I had it enabled. Tried it disabled as well.
euan likes this post
Reply
#72
Well, it seems to only work if it goes directly in the postbit or postbit_classic template. But I've got the query wrong anyway. Going to play with it a little.
Reply
#73
Ok, finally sorted it. Tagging and uploading to GitHub. Sorry guys. This new query is quite big though (it does run extremely quickly here saying that - 9.7990036010742E-5):

PHP Code:
SELECT p.uid, (SELECT COUNT(*) FROM mybb_post_likes l LEFT JOIN mybb_posts mp ON (l.post_id mp.pidWHERE mp.uid p.uid) AS count FROM mybb_posts p WHERE pid IN('664','665'GROUP BY p.uid
Tecca likes this post
Reply
#74
Ok, all tagged and pushed. You can grab the fixed version here: https://github.com/euantorano/SimpleLike...ve/1.2.zip

Should just be able to upload the new files and it should work. Hopefully.
Tecca likes this post
Reply
#75
Works like a charm!
Reply
#76
Happy Glad I found the fix. Been wanting to look at adding that for a while.
Reply
#77
any help about my proposal
Reply
#78
I'll fix it as soon as I get a chance Happy
Reply
#79
(29-05-2013, 03:46 PM)euan Wrote: I'll fix it as soon as I get a chance Happy

i can fix it myself just need code to add it in template

this is global css

PHP Code:
body {
    
background#c4ccdf;
    
color#333333;
    
font8pt tahomaarialhelveticasans-serif;
    
margin0px;
    
padding0px;
    
text-aligncenter;
    
line-height1.4;
}

a:link {
    
color#333333;
    
text-decorationnone;
        
background-colortransparent;
}

a:visited {
    
color#333333;
    
text-decorationnone;
        
background-colortransparent;
}

a:hovera:active {
    
color#4874a3;
    
text-decorationunderline;
        
background-colortransparent;
}

#container {
    
background#fff;
    
width90%;
    
color#000000;
    
border-left1px solid #b7b7b7;
    
border-right1px solid #b7b7b7;
    
marginauto auto;
    
padding17px;
    
text-alignleft;
}

#content {
    /* FIX: Make internet explorer wrap correctly */
    
widthauto !important;
}

.
menu {
    
background#ECEFF5;
    
border-top1px solid #254B82;
    
border-bottom1px solid #254B82;
    
border-left4px solid #254B82;
    
border-right4px solid #254B82;
        
border-radius8px;
        -
moz-border-radius8px;
        -
webkit-border-radius8px;
}

.
menu ul {
    
color#000000;
    
fontbold 8pt tahomahelveticasans-serif;
    
text-alignleft;
    
padding4px;
    list-
stylenone;
    
margin0;
}

.
menu ul a:link {
    
color#000000;
    
text-decorationnone;
}

.
menu ul a:visited {
    
color#000000;
    
text-decorationnone;
}

.
menu ul a:hover, .menu ul a:active {
    
color#4874a3;
    
text-decorationnone;
}

.
menu li {
    
displayinline;
    
padding-left5px;
}

.
menu img {
    
padding-right5px;
    
vertical-alignmiddle;
}

#panel {
    
background#ECEFF5;
    
color#000000;
    
border-top1px solid #254B82;
    
border-bottom1px solid #254B82;
    
border-left4px solid #254B82;
    
border-right4px solid #254B82;
    
padding8px;
    
font8pt tahomaarialhelveticasans-serif;
        
border-radius8px;
        -
moz-border-radius8px;
        -
webkit-border-radius8px;
}

#panel .links {
    
margin0;
    
floatright;
}

table {
    
color#333333;
    
font8pt tahomaarialhelveticasans-serif;
}

.
tborder {
    
width100%;
    
marginauto auto;
    
border0px solid #CCCCCC;
    
border-top1px solid #254B82;
    
border-bottom1px solid #254B82;
    
border-left4px solid #254B82;
    
border-right4px solid #254B82;
        
padding2px;
        
border-radius8px;
        -
moz-border-radius8px;
        -
webkit-border-radius8px;
}

.
thead {
    
background#254B82 none repeat scroll 0 0;
    
color#fff;
    
fontbold 8pt tahomahelveticasans-serif;
    
border-bottom1px solid #D8DFEA;
        
padding7px 15px;
    -
moz-border-radius-topright6px;
    -
moz-border-radius-topleft6px;
    -
webkit-border-top-right-radius6px;
    -
webkit-border-top-left-radius6px;
}

.
thead a:link {
    
color#fff;
    
text-decorationnone;
}

.
thead a:visited {
    
color#fff;
    
text-decorationnone;
}

.
thead a:hover, .thead a:active {
    
color#fff;
    
text-decorationunderline;
}

.
tcat {
    
background#D8DFEA;
    
color#3B5998;
    
fontbold 8pt tahomahelveticasans-serif;
    
border-bottom1px solid #D8DFEA;
}

.
tcat a:link {
    
color#3B5998;
}

.
tcat a:visited {
    
color#3B5998;
}

.
tcat a:hover, .tcat a:active {
    
color#3B5998;
}

.
trow1 {
    
background#f5f5f5;
    
font8pt tahomaarialhelveticasans-serif;
}

.
trow2 {
    
background#EFEFEF;
    
font8pt tahomaarialhelveticasans-serif;
}

.
trow_shaded {
    
background#f5f5f5;
}

.
trow_selected td {
    
background#EFEFEF;
}

.
trow_sep {
    
background#f5f5f5;
    
color#000;
    
font-size12px;
    
font-weightbold;
}

.
tfoot {
    
background#EFEFEF;
    
color#3B5998;
    
font8pt tahomaarialhelveticasans-serif;
}

.
tfoot a:link {
    
color#3B5998;
    
text-decorationnone;
}

.
tfoot a:visited {
    
color#3B5998;
    
text-decorationnone;
}

.
tfoot a:hover, .tfoot a:active {
    
color#3B5998;
    
text-decorationunderline;
}

.
bottommenu {
    
background:#ECEFF5;
    
border-top1px solid #254B82;
    
border-bottom1px solid #254B82;
    
border-left4px solid #254B82;
    
border-right4px solid #254B82;
    
padding6px;
    
color#000000;
    
font8pt tahomaarialhelveticasans-serif;
    
font-weightbold;
        
border-radius8px;
        -
moz-border-radius8px;
        -
webkit-border-radius8px;
}

.
navigation {
    
background:#ECEFF5;
    
border-top1px solid #254B82;
    
border-bottom1px solid #254B82;
    
border-left4px solid #254B82;
    
border-right4px solid #254B82;
    
padding4px;
    
color#000000;
    
font9pt tahomaarialhelveticasans-serif;
    
font-weightbold;
        
border-radius8px;
        -
moz-border-radius8px;
        -
webkit-border-radius8px;
}

.
navigation a:link {
    
text-decorationnone;
}

.
navigation a:visited {
    
text-decorationnone;
}

.
navigation a:hover, .navigation a:active {
    
text-decorationnone;
}

.
navigation .active {
    
color#333333;
    
fontbold 8pt tahomaarialhelveticasans-serif;
}

.
smalltext {
    
font8pt tahomaarialhelveticasans-serif;
}

.
largetext {
    
font8pt tahomaarialhelveticasans-serif;
    
font-weightbold;
}

input.textbox {
    
background#ffffff;
    
color#000000;
    
border1px solid #0f5c8e;
    
padding1px;
            
font8pt tahomaarialhelveticasans-serif;
}

textarea {
    
background#ffffff;
    
color#000000;
    
border1px solid #0f5c8e;
    
padding2px;
    
line-height1.4;
    
font9pt tahomaarialhelveticasans-serif;
}

select {
    
background#ffffff;
    
border1px solid #0f5c8e;
    
font8pt tahomaarialhelveticasans-serif;
}

.
editor {
    
background#f1f1f1;
    
border1px solid #ccc;
}

.
editor_control_bar {
    
background#fff;
    
border1px solid #0f5c8e;
}

.
autocomplete {
    
background#fff;
    
border1px solid #000;
    
colorblack;
}

.
autocomplete_selected {
    
background#adcee7;
    
color#000;
}

.
popup_menu {
    
background#ccc;
    
border1px solid #000;
}

.
popup_menu .popup_item {
    
background#fff;
    
color#000;
}

.
popup_menu .popup_item:hover {
    
background#C7DBEE;
    
color#000;
}

.
trow_reputation_positive {
    
background#ccffcc;
}

.
trow_reputation_negative {
    
background#ffcccc;
}

.
reputation_positive {
    
colorgreen;
}

.
reputation_neutral {
    
color#444;
}

.
reputation_negative {
    
colorred;
}

.
invalid_field {
    
border1px solid #f30;
    
color#f30;
}

.
valid_field {
    
border1px solid #0c0;
}

.
validation_error {
    
backgroundurl(images/FaceBook-v1/invalid.gifno-repeat center left;
    
color#f30;
    
margin5px 0;
    
padding5px;
    
font-weightbold;
    
font8pt tahomaarialhelveticasans-serif;
    
padding-left22px;
}

.
validation_success {
    
backgroundurl(images/valid.gifno-repeat center left;
    
color#00b200;
    
margin5px 0;
    
padding5px;
    
font-weightbold;
    
font8pt tahomaarialhelveticasans-serif;
    
padding-left22px;
}

.
validation_loading {
    
backgroundurl(images/spinner.gifno-repeat center left;
    
color#555;
    
margin5px 0;
    
padding5px;
    
font-weightbold;
    
font8pt tahomaarialhelveticasans-serif;
    
padding-left22px;
}

/* Additional CSS (Master) */
img {
    
bordernone;
}

.
clear {
    
clearboth;
}

.
hidden {
    
displaynone;
    
floatnone;
    
width1%;
}

.
float_left {
    
floatleft;
}

.
float_right {
    
floatright;
}

.
expcolimage {
    
floatright;
    
widthauto;
    
vertical-alignmiddle;
    
margin-top3px;
}

img.attachment {
    
border1px solid #E9E5D7;
    
padding2px;
}

hr {
    
background-color#000000;
    
color#000000;
    
height1px;
    
border0px;
}

#copyright {
    
font8pt tahomaarialhelveticasans-serif;
    
margin0;
    
padding10px 0 0 0;
    
text-aligncenter;
}

#debug {
    
    
text-aligncenter;
    
margin-top0;
    
font8pt tahomaarialhelveticasans-serif;
}

blockquote {
    
border1px solid #ccc;
    
margin0;
    
background#fff;
    
padding4px;
}

blockquote cite {
    
font-weightbold;
    
border-bottom1px solid #ccc;
    
font-stylenormal;
    
displayblock;
    
margin4px 0;
}

blockquote cite span {
    
floatright;
    
font-weightnormal;
}

blockquote cite span.highlight {
    
floatnone;
    
font-weightbold;
    
padding-bottom0;
}

.
codeblock {
    
background#fff;
    
border1px solid #ccc;
    
padding4px;
}

.
codeblock .title {
    
border-bottom1px solid #ccc;
    
font-weightbold;
    
margin4px 0;
}

.
codeblock code {
    
overflowauto;
    
heightauto;
    
max-height200px;
    
displayblock;
    
font-familyMonacoConsolasCouriermonospace;
    
font-size10px;
}

.
subforumicon {
    
border0;
    
vertical-alignmiddle;
}

.
separator {
    
margin5px;
    
padding0;
    
height0px;
    
font-size1px;
    list-
style-typenone;
}

form {
    
margin0;
    
padding0;
}

.
popup_menu .popup_item_container {
    
margin1px;
    
text-alignleft;
}

.
popup_menu .popup_item {
    
displayblock;
    
padding3px;
    
text-decorationnone;
    
white-spacenowrap;
}

.
popup_menu a.popup_item:hover {
    
text-decorationnone;
}

.
autocomplete {
    
text-alignleft;
}

.
subject_new {
    
font-weightbold;
}

.
highlight {
    
background#FFFFCC;
    
padding3px;
}

.
pm_alert {
    
background#FFF6BF;
    
border1px solid #FFD324;
    
text-aligncenter;
    
padding5px 20px;
    
font-size10px;
}

.
red_alert {
    
background#FBE3E4;
    
border1px solid #A5161A;
    
color#A5161A;
    
text-aligncenter;
    
padding5px 20px;
    
font-size10px;
}

.
high_warning {
    
color#CC0000;
}

.
moderate_warning {
    
color#F3611B;
}

.
low_warning {
    
color#AE5700;
}

div.error {
    
padding5px 10px;
    
border-top2px solid #FFD324;
    
border-bottom2px solid #FFD324;
    
background#FFF6BF;
    
font-size10px;
}

div.error p {
    
margin0;
    
color#000;
    
font-weightnormal;
}

div.error p em {
    
font-stylenormal;
    
font-weightbold;
    
padding-left24px;
    
displayblock;
    
color#C00;
    
backgroundurl(images/error.gifno-repeat 0;
}

div.error.ul {
    
margin-left24px;
}

.
online {
    
color#15A018;
}

.
offline {
    
color#C7C7C7;
}

.
pagination {
    
font-size11px;
    
padding-top10px;
    
margin-bottom5px;
}

.
tfoot .pagination, .tcat .pagination {
    
padding-top0;
}

.
pagination .pages {
    
font-weightbold;
}

.
pagination .pagination_current, .pagination a {
    
padding2px 6px;
    
margin-bottom3px;
}

.
pagination a {
    
border1px solid #81A2C4;
}

.
pagination .pagination_current {
    
background#F5F5F5;
    
border1px solid #81A2C4;
    
font-weightbold;
}

.
pagination a:hover {
    
background#F5F5F5;
    
text-decorationnone;
}

.
thread_legend, .thread_legend dd {
    
margin0;
    
padding0;
}

.
thread_legend dd {
    
padding-bottom4px;
    
margin-right15px;
}

.
thread_legend img {
    
margin-right4px;
    
vertical-alignbottom;
}

.
forum_legend, .forum_legend dt, .forum_legend dd {
    
margin0;
    
padding0;
}

.
forum_legend dd {
    
floatleft;
    
margin-right10px;
}

.
forum_legend dt {
    
margin-right10px;
    
floatleft;
}

.
success_message {
    
color#00b200;
    
font-weightbold;
    
font-size10px;
    
margin-bottom10px;
}

.
error_message {
    
color#C00;
    
font-weightbold;
    
font-size10px;
    
margin-bottom10px;
}

.
post_body {
&
nbsp;   padding5px;

font-size16px;
}

.
post_content {
&
nbsp;   padding5px 13px;
}

.
quick_jump {
    
backgroundurl(images/jump.gifno-repeat 0;
    
width13px;
    
height13px;
    
padding-left13px/* amount of padding needed for image to fully show */
    
vertical-alignmiddle;
    
bordernone;
}

.
alt_forumlar {
list-
stylenonemargin0padding0;
}

.
alt_forumlar li {
width50%; floatleft;
}

span.attentionspan.noticespan.alertspan.download
span.approvedspan.mediaspan.notespan.cartspan.cameraspan.doc {
displayblock;padding8px 10px 8px 36px;margin15px 0;
}

span.attention {
color#B79000;border: 1px solid #E7BD72;background: 
#FFF3A3 url(images/notices/attention.png) 10px 50% no-repeat;
}

span.notice {
color#648434;border: 1px solid #9BCC54;background: #CDEFA6 url(images/notices/notice.png) 10px 50% no-repeat;
}

span.alert {
color#CF3738;border: 1px solid #FFACAD;background: #FFD5D5 url(images/notices/alert.png) 10px 50% no-repeat;
}

span.download {
color#1C6B8B;border: 1px solid #6ABCE2;background: 
#A8CDE3 url(images/notices/download.png) 10px 50% no-repeat;
}

span.approved {
color#666;border: 1px solid #a8a8a8;background: #ccc url(images/notices/approved.png) 10px 50% no-repeat;
}

span.media {
color#C76E34;border: 1px solid #FFBB65;background: #FFE0B6 url(images/notices/media.png) 10px 50% no-repeat;
}

span.note {
color#B79000;border: 1px solid #E7BD72;background: #FFF3A3 url(images/notices/note.png) 10px 50% no-repeat;
}

span.cart {
color#666;border: 1px solid #C5C5C5;background: #E6E6E6 url(images/notices/cart.png) 10px 50% no-repeat;
}

span.camera {
color#666;border: 1px solid #C5C5C5;background: #E6E6E6 url(images/notices/camera.png) 10px 50% no-repeat;
}

span.doc {
color#C76E34;border: 1px solid #FFBB65;background: #FFE0B6 url(images/notices/doc.png) 10px 50% no-repeat;
}

.
spoiler {
background-color#EEE;

border1px solid #DDD;

positionrelative;

padding10px;

border-radius3px;
}

.
spoiler div {
background-color#DDD;

positionabsolute;

top0;

bottom0;

right0;

left0;

padding10px;

-
ms-filter"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";

filteralpha(opacity=100);

opacity1;



-
webkit-transitionall 0.7s;

-
moz-transitionall 0.7s;

-
o-transitionall 0.7s;

-
ms-transitionall 0.7s;

transitionall 0.7s;

border-radius3px;
}

.
spoiler:hover div {
left100%;

-
ms-filter"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";

filteralpha(opacity=0);

opacity0;
}

.
forumdisplay_sticky {
background-color#C0F7FE !important;
}

tbody tr.working_on_item td {
background#FEFFAB !important;
}

tbody tr.completed_item td {
background#ABFFE8 !important;
}

tbody tr.non_completed_item td {
background#FFABAF !important;
}

.
btn_like {

background#3b5998;

border1px solid #a1b0cd;

color#fff;

padding2px 10px;

displayinline-block;


And this is postbit_clasic

PHP Code:
{$ignore_bit}
<
table border="0" cellspacing="{$theme['borderwidth']}cellpadding="{$theme['tablespace']}class="tborder" style="{$post_extra_style} {$post_visibility}id="post_{$post['pid']}">
    <
tr>
        <
td class="{$altbg}width="22%" valign="top" style="white-space: nowrap; text-align: center;"><a name="pid{$post['pid']}id="pid{$post['pid']}"></a>
        <
strong><span class="largetext">{$post['profilelink']}</span></strong> {$post['onlinestatus']}<br />
        <
span class="smalltext">
            {
$post['usertitle']}<br />
            {
$post['userstars']}
            {
$post['groupimage']}
            {
$post['useravatar']}<br />
            {
$post['user_details']}
        </
span>
    </
td>
    <
td class="{$altbg}valign="top">
        <
table width="100%">
            <
tr><td>{$post['posturl']}<span class="smalltext"><strong>{$post['icon']}{$post['subject']} {$post['subject_extra']}</strong></span>
            <
br />
            <
div id="pid_{$post['pid']}{$post['pstyle']}>
                {
$post['order_items_showthread']}{$post['message']}
            </
div>
            

{
$post['simplelikes']}
{
$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>    <strong>Likes&nbsp;Received:</strong>&nbsp;<a&nbsp;href="http://www.mybbstuff.com/misc.php?action=post_likes_received_by_user&user_id={$post['uid']}">{$post['likes_received']}</a>

    <
td class="{$altbg}style="white-space: nowrap; text-align: center; vertical-align: middle;"><span class="smalltext">{$post['postdate']} {$post['posttime']}</span></td>
    <
td class="{$altbg}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']}</span></td>
                <
td align="right">{$post['button_like']}{$post['button_edit']}{$post['button_quickdelete']}{$post['button_quote_fast']}{$post['button_quote']}{$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>
</
table>
<
table border="0" cellpadding="0" cellspacing="0" class="thead">
    <
tr>
        <
td align="left" valign="top" height="4px" width="27px"></td>
        <
td height="4px" width="100%"></td>
        <
td align="left" valign="top" height="4px" width="27px"></td>
    </
tr>
</
table
Reply
#80
It should be working then? What exactly's wrong with it?
Reply