vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Add-On Releases - Add Facebook "Like" button to your threads [vB 3.8.x] (https://vborg.vbsupport.ru/showthread.php?t=241053)

hubie 04-22-2010 10:00 PM

Add Facebook "Like" button to your threads [vB 3.8.x]
 
1 Attachment(s)
This mod is based on this, but working on vB 3.8.x.

As was said there: Facebook has just launched their latest "Like" button to developers to use on any site. What this does is utilizes the Advertising module to add the "Like" button to the first post of each thread. Please see screenshots to get an idea.

DEMO

IFrame Method

There is two kind of "Like" button (IFrame Method):

- With a smallest counter at his side *
Code:

<iframe src="http://www.facebook.com/plugins/like.php?href=http://www.YOURSITE.com/showthread.php$session[sessionurl]?p=$post[postid]&amp;layout=button_count&amp;show_faces=true&amp;width=&amp;action=like&amp;colorscheme=light"
scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:100px; height:20px"></iframe>


- With a largest counter (and names of people who have clicked) *
Code:

<iframe src="http://www.facebook.com/widgets/like.php?href=http://www.YOURSITE.com/showthread.php$session[sessionurl]?p=$post[postid]&amp;show_faces=false&amp
        scrolling="no" frameborder="0"
        style="border:none; width:450px; height:25px"></iframe>

*Change show_faces=false for true if you want to see faces :)

Installation:

Go to your Postbit/Postbit Legacy template and search for:
Code:

<!-- controls -->
And add below the code that you previously selected according your favorite button style.

If you want that the button only appears in first post of a thread, add this variables at the beginning and end of the code that you previously selected:
Code:

<if condition="$post[postcount] == 1">YOUR CODE</if>
*You should add these variables, otherwise the button will be displayed in every post, which makes no sense.

https://vborg.vbsupport.ru/external/2011/10/45.png

XFBML Method (recommended)
This is a richer way to send the contents of your board to Facebook, because it gives to users the possibility to add more information and also an image of your site is displayed on their FB wall (see the screenshots below).

Installation: (provided by cdoyle, thanks mate :up:)

You'll need to register your app here: http://developers.facebook.com/setup/, and get an ID to place into the code below.

Code:

<if condition="$post[postcount] == 1 AND !in_array($GLOBALS[forumid], array(40, 39))">


<p><fb:like></fb:like></p>

<div id="fb-root"></div>
    <script>
      window.fbAsyncInit = function() {
        FB.init({appId: 'yourappID', status: true, cookie: true,
                xfbml: true});
      };
      (function() {
        var e = document.createElement('script');
        e.type = 'text/javascript';
        e.src = document.location.protocol +
          '//connect.facebook.net/en_US/all.js';
        e.async = true;
        document.getElementById('fb-root').appendChild(e);
      }());
    </script>


</if>

-----------------------------------------------------------------------------------------------------

Internet Explorer browser fix: https://vborg.vbsupport.ru/showpost....5&postcount=70

-----------------------------------------------------------------------------------------------------

For additional information on this button and different parameters please visit http://developers.facebook.com/docs/...e/plugins/like

Remember to click Mark as Installed if you use this modification :up:

kimof911 04-23-2010 11:36 AM

very cool

thank u

installed

wacnstac 04-23-2010 02:54 PM

Two comments. After I install and customize to my URL it clicks my like through momentarily and indicates that my User Name likes the post, but then it quickly transistions to showing "Be the first of your friends to like this. · Admin Page · Error" Also my likes never get posted on my facebook wall. How do I get it to show on my wall?

hubie 04-23-2010 03:22 PM

Quote:

Originally Posted by wacnstac (Post 2026006)
Two comments. After I install and customize to my URL it clicks my like through momentarily and indicates that my User Name likes the post, but then it quickly transistions to showing "Be the first of your friends to like this. ? Admin Page ? Error" Also my likes never get posted on my facebook wall. How do I get it to show on my wall?

Have you tried the two versions of button? Please send me a link to check.

wacnstac 04-23-2010 03:27 PM

Looking at my source for the page in question gives me some answers. The source generated shows:

<iframe src="http://www.facebook.com/widgets/like.php?href=http://www.michigan-sportsman.com/showthread.php?p=3110497&amp;show_faces=true&amp
scrolling="no" frameborder="0"


but the real URL for the page is: http://www.michigan-sportsman.com/fo...d.php?t=327362

You can see a demo of the problem I am seeing if you go here:
http://www.facebook.com/widgets/like....php?p=3110497

wacnstac 04-23-2010 03:32 PM

Actually once I added "forum" in my path so that I have the correct URL, it does work in isolation:

http://www.facebook.com/widgets/like...ling=%22yes%22

But still throws an error when on my forum. Any ideas?

wacnstac 04-23-2010 03:33 PM

Here's a link to where it is deployed:

http://www.michigan-sportsman.com/fo...d.php?t=327362

hubie 04-23-2010 03:39 PM

Quote:

Originally Posted by wacnstac (Post 2026026)
Looking at my source for the page in question gives me some answers. The source generated shows:

<iframe src="http://www.facebook.com/widgets/like.php?href=http://www.michigan-sportsman.com/showthread.php?p=3110497&amp;show_faces=true&amp
scrolling="no" frameborder="0"


but the real URL for the page is: http://www.michigan-sportsman.com/fo...d.php?t=327362

You can see a demo of the problem I am seeing if you go here:
http://www.facebook.com/widgets/like....php?p=3110497

You have to change "showthread.php?p=3110497" for "showthread.php$session[sessionurl]?p=$post[postid]".

You only have to put your sitename, then you code would be: "http://www.michigan-sportsman.com/forum/showthread.php$session[sessionurl]?p=$post[postid]..."

If it helps you mark as installed, if not, comment please ;)

Yellow Slider 04-23-2010 03:40 PM

why aren't you using the the meta data in the showthread page?

* <meta property="og:title" content="The Rock"/>
* <meta property="og:site_name" content="IMDb"/>
* <meta property="og:image" content="http://ia.media-imdb.com/rock.jpg"/>

wacnstac 04-23-2010 03:47 PM

This is exactly how it is coded in the example thread I included above:

PHP Code:

<iframe src="http://www.facebook.com/widgets/like.php?href=http://www.michigan-sportsman.com/forum/showthread.php$session[sessionurl]?p=$post[postid]&amp;show_faces=true&amp
        scrolling="
no" frameborder="0
        style="
border:nonewidth:450pxheight:80px"></iframe> 


hubie 04-23-2010 04:04 PM

Quote:

Originally Posted by wacnstac (Post 2026040)
This is exactly how it is coded in the example thread I included above:

PHP Code:

<iframe src="http://www.facebook.com/widgets/like.php?href=http://www.michigan-sportsman.com/forum/showthread.php$session[sessionurl]?p=$post[postid]&amp;show_faces=true&amp
        scrolling="
no" frameborder="0
        style="
border:nonewidth:450pxheight:80px"></iframe> 


The code seems to be ok, please add the same code next to "<!-- controls -->" for testing purposes and check if your problem is related with your postbit template.

Yellow Slider 04-23-2010 04:06 PM

you should have a version with thread id only, for those who want it just for thr first post

showthread.php?t=xxxxxx

AcidX 04-23-2010 04:11 PM

The first post option doesn't work. "Like" buttons show on every first page, not first post.

Edit: it shows on private messages too.

wacnstac 04-23-2010 04:12 PM

When I put this code in, replacing what I had:

PHP Code:

        <div style="margin-top: 10px" align="$stylevar[right]">
            <!-- 
controls -->

<
iframe src="http://www.facebook.com/widgets/like.php?href=http://www.michigan-sportsman.com/forum/showthread.php$session[sessionurl]?p=$post[postid]&amp;show_faces=true&amp
        scrolling="
no" frameborder="0
        style="
border:nonewidth:450pxheight:80px"></iframe> 

Nothing at all shows up.

Yellow Slider 04-23-2010 04:41 PM

Quote:

Originally Posted by AcidX (Post 2026052)
The first post option doesn't work. "Like" buttons show on every first page, not first post.

Edit: it shows on private messages too.

you're right, can some one fix it?

wacnstac 04-23-2010 05:20 PM

There is something wrong with the code itself. If I simply put this code:

PHP Code:

http://www.facebook.com/widgets/like.php?href=http://www.michigan-sportsman.com/showthread.php?t=333410&amp;show_faces=true&ampscrolling=%22no%22 

in a browser line, it takes my click on the like and then gives me an error.

wacnstac 04-23-2010 05:52 PM

Here is my whole template. I have tried a couple different versions of this. The code in isolation in a browser window works, but in my template below (which I've tried a couple of different versions), it does not:

PHP Code:

$template_hook[postbit_start]
<if 
condition="!$_POST['ajax']">
   <!--  
Google Hack -->
     <if 
condition="(in_array($bbuserinfo[usergroupid], array(5, 87, 84)) OR is_member_of($bbuserinfo, 94) OR is_member_of($bbuserinfo, 99))">

     <else />

     <if 
condition="((($post[postcount] % 15) == 3))">
        <if 
condition="$show['spacer']">$spacer_open<if condition="!$post['islastshown']"><div style="padding:0px 0px $stylevar[cellpadding]px 0px"></if></if>
          <
table class="tborder" cellpadding="$stylevar[cellpadding]cellspacing="$stylevar[cellspacing]border="0" width="100%" align="center">
             <
tr>
                <
td class="thead" $scrolltothis><img src="$stylevar[imgdir_statusicon]/forum_link.gif" alt="" border="0" /> 
                </
td>
             </
tr>
             <
tr>
                <
td class="alt2" style="padding:0px">
                   <
table cellpadding="0" cellspacing="$stylevar[cellpadding]border="0" width="100%">
                      <
tr>
                </
td>
                <
td nowrap="nowrap"
                       <
a href="http://www.michigan-sportsman.com/sponsoring_member.htm">
                        <
strong>Remove this ad...</strong></a>
                </
td>
                <
td width="100%">&nbsp;</td>
                <
td valign="top" nowrap="nowrap">             
                </
td>
             </
tr>
          </
table>
    </
td>
</
tr>
<
tr>
   <
td class="alt1">

     <
table width="100%" border="0" cellspacing="0" cellpadding="0">
        <
tr>
           <
td><div align="left">
        
              {
michigan_content_left_300}

           </
div></td>
        </
tr>
      </
table>



    </
td>
</
tr>
</
table>
<if 
condition="$show['spacer']"><if condition="!$post['islastshown']"></div></if>$spacer_close</if>
</if>

<!--  
End Google Hack -->

</if> 
<!-- 
Usergroup Hack -->
</if>
<!--- if 
AJAX hack  -->




<
table class="tborder" id="post$post[postid]cellpadding="$stylevar[cellpadding]cellspacing="$stylevar[cellspacing]border="0" width="100%" align="center">
<
tr>
    <
td class="thead" $post[scrolltothis]>
        <
div class="normal" style="float:$stylevar[right]">
            &
nbsp;
            <if 
condition="$show['postcount']">#<a href="showpost.php?$session[sessionurl]p=$post[postid]&amp;postcount=$post[postcount]" target="new" rel="nofollow" id="postcount$post[postid]" name="$post[postcount]"><strong>$post[postcount]</strong></a> &nbsp;</if>
            
<if condition="$show['reputationlink']">
                <
span id="reputationmenu_$post[postid]"><a href="reputation.php?$session[sessionurl]p=$post[postid]rel="nofollow" id="reputation_$post[postid]"><img class="inlineimg" src="$stylevar[imgdir_button]/reputation.gif" alt="<phrase 1="$post[username]">$vbphrase[add_to_xs_reputation]</phrase>" border="0" /></a></span>
                <if 
condition="$show['popups']"><script type="text/javascript"vbrep_register("$post[postid]")</script></if>&nbsp;
            </if>
            <if 
condition="$show['infractionlink']"><a href="infraction.php?$session[sessionurl]do=report&amp;p=$post[postid]rel="nofollow"><img class="inlineimg" src="$stylevar[imgdir_button]/infraction.gif" alt="<phrase 1="$post[username]">$vbphrase[add_infraction_for_x]</phrase>" border="0" /></a> &nbsp;</if>
            <if 
condition="$show['reportlink']"><a href="report.php?$session[sessionurl]p=$post[postid]rel="nofollow"><img class="inlineimg" src="$stylevar[imgdir_button]/report.gif" alt="$vbphrase[report_bad_post]border="0" /></a> &nbsp;</if>
            
$post[iplogged]
            <if 
condition="$show['inlinemod']">
            <
input type="checkbox" name="plist[$postid]" id="plist_$postidstyle="vertical-align:middle; padding:0px; margin:0px 0px 0px 5px" value="$post[checkbox_value]/>
            </if>
        </
div>

        <
div class="normal">
            <!-- 
status icon and date -->
            <
a name="post$post[postid]"><img class="inlineimg" src="$stylevar[imgdir_statusicon]/post_$post[statusicon].gif" alt="$post[statustitle]border="0" /></a>
            <if 
condition="!$show['announcement']">
                
$post[postdate]<if condition="!$show['detailedtime']">, $post[posttime]</if>
            <else />
                <
phrase 1="$post[startdate]2="$post[enddate]">$vbphrase[x_until_y]</phrase>
            </if>
            
$post[firstnewinsert]
            <!-- / 
status icon and date -->
        </
div>
    </
td>
</
tr>
<
tr>
    <
td class="alt2" style="padding:0px">
        <!-- 
user info -->
        <
table cellpadding="0" cellspacing="$stylevar[cellpadding]border="0" width="100%">
        <
tr>
            <if 
condition="$show['avatar']"><td class="alt2"><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[avatarurl]$post[avwidth$post[avheightalt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a></td></if>
            <
td nowrap="nowrap">

                <
div id="postmenu_$post[postid]">
                    <if 
condition="$show['profile']">
                    <
class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]">$post[musername]</a>
                    
$post[onlinestatus]
                    <
script type="text/javascript"vbmenu_register("postmenu_$post[postid]"true); </script>
                    <else />
                    
$post[musername]
                    </if>
                </
div>

                <if 
condition="$post['usertitle']"><div class="smallfont">$post[usertitle]</div></if>
    <!--            <if 
condition="$post['rank']"><div class="smallfont">$post[rank]</div></if>  -->

<!-- 
rank hack -->
    <if 
condition="is_member_of($post,94)">
     <
div class="smallfont"><a href="payments.php"><img src="images/ranks/sponsor.gif" border="0" alt="Rank Type" /></a></div><br />
    <else />
        <if 
condition="is_member_of($post,99)">
            <
div class="smallfont"><a href="payments.php"><img src="images/ranks/sponsor.gif" border="0" alt="Rank Type" /></a></div><br />
        <else />
            <if 
condition="$post['rank']"><div class="smallfont">$post[rank]</div></if></if></if>
<!-- 
end rank hack -->
                
$template_hook[postbit_userinfo_left]

            </
td>
            <
td width="100%">

<
iframe src="http://www.facebook.com/plugins/like.php?href=http://www.michigan-sportsman.com/forum/showthread.php?t=$post[threadid]&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;font=verdana&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:px"></iframe>


<
iframe src="http://www.facebook.com/widgets/like.php?href=http://www.michigan-sportsman.com/forum/showthread.php$session[sessionurl]?t=$post[threadid]&amp;show_faces=false&amp
        scrolling="
no" frameborder="0
        style="
border:nonewidth:450pxheight:80px"></iframe>

</td>
            <td valign="
top" nowrap="nowrap">

                <div class="
smallfont">
<if condition="
!$post['forwardlink'] AND !in_array($GLOBALS[forumid], array(66))">


<!-- AddThis Button BEGIN -->
<script type="
text/javascript">var addthis_pub="shelinski";</script>
<a href="
http://www.addthis.com/bookmark.php?v=20" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()"><img src="http://s7.addthis.com/static/btn/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a><script type="text/javascript" src="http://s7.addthis.com/js/200/addthis_widget.js"></script>
<!-- AddThis Button END -->


</if>
                    <if 
condition="$post['joindate']"><div>$vbphrase[join_date]: $post[joindate]</div></if>
                    <if 
condition="$post['field2']"><div>$vbphrase[location_perm]: $post[field2]</div></if>
                    <if 
condition="$post['age']"><div>$vbphrase[age]: $post[age]</div></if>
                    <
div>
                        
$vbphrase[posts]: $post[posts]
<!-- 
photopost hack -->
<if 
condition="$post['photos']"><div>Photos$post[photos]<a href="http://www.michigan-sportsman.com/photopost/showgallery.php?cat=500&ppuser=$post[userid]"><img class="inlineimg" src="$stylevar[imgdir_button]/camera.gif" alt="Users Photo Gallery" border="0" /></a></div></if>

<!-- 
photopost end hack -->
                    </
div>
                    
$template_hook[postbit_userinfo_right_after_posts]
                    <if 
condition="$show['infraction']"><div>$vbphrase[infractions]: $post[warnings]/$post[infractions] ($post[ipoints])</div></if>
                    <if 
condition="$show['reputation']"><if condition="$show['reppower']">$vbphrase[reppower]: <span id="reppower_$post[postid]_$post[userid]">$post[reppower]</span> </if><div><span id="repdisplay_$post[postid]_$post[userid]">$post[reputationdisplay]</span></div></if>
                    
$template_hook[postbit_userinfo_right]
                    <
div>$post[icqicon$post[aimicon$post[msnicon$post[yahooicon$post[skypeicon]</div>
                </
div>

            </
td>
        </
tr>
        </
table>
        <!-- / 
user info -->
    </
td>
</
tr>
<
tr>
    <if 
condition="$show['moderated']">
    <
td class="alt2" id="td_post_$post[postid]">
    <else />
    <
td class="alt1" id="td_post_$post[postid]">
    </if>    
    <!-- 
messageattachmentssig -->

        
$template_hook[postbit_messagearea_start]

        <if 
condition="$show['messageicon'] OR $post['title']">
            <!-- 
icon and title -->
            <
div class="smallfont">
                <if 
condition="$show['messageicon']"><img class="inlineimg" src="$post[iconpath]alt="$post[icontitle]border="0" /></if>
                <if 
condition="$post['title']"><strong>$post[title]</strong></if>
            </
div>
            <
hr size="1" style="color:$stylevar[tborder_bgcolor]; background-color:$stylevar[tborder_bgcolor]/>
            <!-- / 
icon and title -->
        </if>

        <!-- 
message -->




<if 
condition="!$_POST['ajax']">
<if 
condition="(($post[postcount] % $vboptions[maxposts] == 1))">
<if 
condition="(in_array($bbuserinfo[usergroupid], array(5, 6, 87, 84)) OR is_member_of($bbuserinfo, 94) OR is_member_of($bbuserinfo, 99))">
<else />
       <
div class="postbit_adcode">
<
span style="float: right; width: 300px; height: 270px; margin: 10px;">
  <
a href="http://www.michigan-sportsman.com/sponsoring_member.htm">
                <
strong>Remove this ad.....<br /> become a Supporting Member today.</strong></a>
    {
michigan_content_300}
</
span>
</
div>
</if>
</if>

</if>





        <
div id="post_message_$post[postid]">
            
$ad_location[ad_showthread_firstpost_start]
            
$post[message]
        </
div>
        <!-- / 
message -->

        <if 
condition="$show['attachments']">
        <!-- 
attachments -->
            <
div style="padding:$stylevar[cellpadding]px">

            <if 
condition="$show['thumbnailattachment']">
                <
fieldset class="fieldset">
                    <
legend>$vbphrase[attached_thumbnails]</legend>
                    <
div style="padding:$stylevar[formspacer]px">
                    
$post[thumbnailattachments]
                    </
div>
                </
fieldset>
            </if>

            <if 
condition="$show['imageattachment']">
                <
fieldset class="fieldset">
                    <
legend>$vbphrase[attached_images]</legend>
                    <
div style="padding:$stylevar[formspacer]px">
                    
$post[imageattachments]
                    </
div>
                </
fieldset>
            </if>

            <if 
condition="$show['imageattachmentlink']">
                <
fieldset class="fieldset">
                    <
legend>$vbphrase[attached_images]</legend>
                    <
table cellpadding="0" cellspacing="$stylevar[formspacer]border="0">
                    
$post[imageattachmentlinks]
                    </
table>
                    </
fieldset>
            </if>

            <if 
condition="$show['otherattachment']">
                <
fieldset class="fieldset">
                    <
legend>$vbphrase[attached_files]</legend>
                    <
table cellpadding="0" cellspacing="$stylevar[formspacer]border="0">
                    
$post[otherattachments]
                    </
table>
                </
fieldset>
            </if>

            <if 
condition="$show['moderatedattachment']">
                <
fieldset class="fieldset">
                    <
legend>$vbphrase[attachments_pending_approval]</legend>
                    <
table cellpadding="0" cellspacing="$stylevar[formspacer]border="0">
                    
$post[moderatedattachments]
                    </
table>
                </
fieldset>
            </if>

            </
div>
        <!-- / 
attachments -->
        </if>

        
$template_hook[postbit_signature_start]
        
$ad_location[ad_showthread_firstpost_sig]

        <if 
condition="$post['signature']">
        <!-- 
sig -->
            <
div>
                
__________________<br />
                
$post[signature]
            </
div>
        <!-- / 
sig -->
        </if>

        
$template_hook[postbit_signature_end]

        <if 
condition="$show['postedited']">
        <!-- 
edit note -->
            <
div class="smallfont">
                <
hr size="1" style="color:$stylevar[tborder_bgcolor]; background-color:$stylevar[tborder_bgcolor]/>
                <
em>
                    <if 
condition="$show['postedithistory']">
                        <
phrase 1="$post[edit_username]2="$post[edit_date]3="$post[edit_time]4="posthistory.php?$session[sessionurl]p=$post[postid]">$vbphrase[last_edited_link_by_x_on_y_at_z_postid]</phrase>
                    <else />
                        <
phrase 1="$post[edit_username]2="$post[edit_date]3="$post[edit_time]">$vbphrase[last_edited_by_x_on_y_at_z]</phrase>
                    </if>
                    <if 
condition="$post['edit_reason']">
                        
$vbphrase[reason]: $post[edit_reason]
                    </if>
                </
em>
            </
div>
        <!-- / 
edit note -->
        </if>

        <
div style="margin-top: 10px" align="$stylevar[right]">
            <!-- 
controls -->
            <if 
condition="$post['editlink']">
                <
img style="display: none" id="progress_$postidsrc="$stylevar[imgdir_misc]/progress.gif" alt="$vbphrase[loading_editor_please_wait]/>
                <
a href="$post[editlink]name="vB::QuickEdit::$post[postid]"><img src="$stylevar[imgdir_button]/edit.gif" alt="$vbphrase[edit_delete_message]border="0" /></a>
            </if>
            <if 
condition="$post['forwardlink']">
                <
a href="$post[forwardlink]"><img src="$stylevar[imgdir_button]/forward.gif" alt="$vbphrase[forward_message]border="0" /></a>
            </if>
            <if 
condition="$post['replylink']">
                <
a href="$post[replylink]rel="nofollow"><img src="$stylevar[imgdir_button]/<if condition="$post['forwardlink']">reply_small<else />quote</if>.gif" alt="$vbphrase[reply_with_quote]border="0" /></a>
            </if>
            <if 
condition="$show['multiquote_post']">
                <
a href="$post[replylink]rel="nofollow" onclick="return false"><img src="$stylevar[imgdir_button]/multiquote_<if condition="$show['multiquote_selected']">on<else />off</if>.gif" alt="$vbphrase[multi_quote_this_message]border="0" id="mq_$post[postid]/></a>
            </if>
            <if 
condition="$show['quickreply'] AND !$show['threadedmode']">
                <
a href="$post[replylink]rel="nofollow" id="qr_$post[postid]onclick="return false"><img src="$stylevar[imgdir_button]/quickreply.gif" alt="$vbphrase[quick_reply_to_this_message]border="0" /></a>
            </if>
            <if 
condition="$show['moderated']">
                <
img src="$stylevar[imgdir_misc]/moderated.gif" alt="$vbphrase[moderated_post]border="0" />
            </if>
            <if 
condition="$show['spam']">
                <
img src="$stylevar[imgdir_misc]/spam_detected.png" alt="$vbphrase[spam_post]border="0" />
            </if>
            <if 
condition="$show['deletedpost']">
                <if 
condition="$show['managepost']">
                    <
a href="postings.php?$session[sessionurl]do=managepost&amp;p=$post[postid]"><img src="$stylevar[imgdir_misc]/trashcan.gif" alt="$vbphrase[manage]border="0" /></a>
                <else />
                    <
img src="$stylevar[imgdir_misc]/trashcan.gif" alt="$vbphrase[deleted_post]border="0" />
                </if>
            </if>
            <if 
condition="$show['redcard']">
                <
a href="infraction.php?$session[sessionurl]do=view&amp;p=$post[postid]"><img src="$stylevar[imgdir_button]/redcard.gif" alt="$vbphrase[received_infraction]border="0" /></a>
            <else />
                <if 
condition="$show['yellowcard']">
                    <
a href="infraction.php?$session[sessionurl]do=view&amp;p=$post[postid]"><img src="$stylevar[imgdir_button]/yellowcard.gif" alt="$vbphrase[received_warning]border="0" /></a>
                </if>
            </if>
            
$template_hook[postbit_controls]
            <!-- / 
controls -->
        </
div>

    <!-- 
messageattachmentssig -->

    </
td>
</
tr>
</
table>
$template_hook[postbit_end]

<!-- 
post $post[postidpopup menu -->
<
div class="vbmenu_popup" id="postmenu_$post[postid]_menu" style="display:none;">
    <
table cellpadding="4" cellspacing="1" border="0">
    <
tr>
        <
td class="thead">$post[username]</td>
    </
tr>
    <if 
condition="$show['profile']">
        <
tr><td class="vbmenu_option"><a href="member.php?$session[sessionurl]u=$post[userid]">$vbphrase[view_public_profile]</a></td></tr>
    </if>
    <if 
condition="$show['pmlink']">
        <
tr><td class="vbmenu_option"><a href="private.php?$session[sessionurl]do=newpm&amp;u=$post[userid]rel="nofollow"><phrase 1="$post[username]">$vbphrase[send_private_message_to_x]</phrase></a></td></tr>
    </if>
    <if 
condition="$show['emaillink']">
        <
tr><td class="vbmenu_option"><a href="sendmessage.php?$session[sessionurl]do=mailmember&amp;u=$post[userid]rel="nofollow"><phrase 1="$post[username]">$vbphrase[send_email_to_x]</phrase></a></td></tr>
    </if>
    <if 
condition="$show['homepage']">
        <
tr><td class="vbmenu_option"><a href="$post[homepage]"><phrase 1="$post[username]">$vbphrase[visit_xs_homepage]</phrase></a></td></tr>
    </if>
    <if 
condition="$show['search']">
        <
tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=finduser&amp;u=$post[userid]rel="nofollow"><phrase 1="$post[username]">$vbphrase[find_all_posts_by_x]</phrase></a></td></tr>
    </if>
    <if 
condition="$post['userid'] AND $show['member']">
    <
tr><td class="vbmenu_option"><a href="profile.php?$session[sessionurl]do=addlist&amp;userlist=buddy&amp;u=$post[userid]"><phrase 1="$post[username]">$vbphrase[add_x_to_contacts]</phrase></a></td></tr>
    </if>
    
$template_hook[postbit_user_popup]
    </
table>
</
div>
<!-- / 
post $post[postidpopup menu --> 


wacnstac 04-23-2010 06:20 PM

Ok, I've gotten it to work with the following code:

PHP Code:

<iframe src="http://www.facebook.com/plugins/like.php?href=http://(your url)/forum/showthread.php?t=$post[threadid]&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;font=verdana&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:70px"></iframe

Now what I haven't been able to figure out is where these likes actually get displayed on FB. Does anybody know?

Yellow Slider 04-23-2010 06:34 PM

in your profile.

hubie 04-23-2010 06:37 PM

Quote:

Originally Posted by wacnstac (Post 2026098)
Now what I haven't been able to figure out is where these likes actually get displayed on FB. Does anybody know?

Your code is now working well, when you clic on Like the post appears correctly in your FB wall. I've checked it in your site.

wacnstac 04-23-2010 06:41 PM

I've marked as installed. But with as many things as I've checked as liked, I don't see anything on my wall. Any idea what gives?

hubie 04-23-2010 06:44 PM

Quote:

Originally Posted by Yellow Slider (Post 2026037)
why aren't you using the the meta data in the showthread page?

* <meta property="og:title" content="The Rock"/>
* <meta property="og:site_name" content="IMDb"/>
* <meta property="og:image" content="http://ia.media-imdb.com/rock.jpg"/>

Quote:

Originally Posted by Yellow Slider (Post 2026047)
you should have a version with thread id only, for those who want it just for thr first post

showthread.php?t=xxxxxx

I'll see this. Where do you add meta data? Can you help me? Excuse me for my lack of knowledge :)

Quote:

Originally Posted by AcidX (Post 2026052)
The first post option doesn't work. "Like" buttons show on every first page, not first post.

Edit: it shows on private messages too.

Edit: Fix for private messages and first post on every first page issues:

Replace:
Code:

<if condition="!$GLOBALS['FIRSTPOSTID']">
by:
Code:

<if condition="$post[postcount] == 1">

wacnstac 04-23-2010 06:46 PM

Close but no cigar. I found all my recent likes on my FB profile page. But if I click on any of them in FB I get a blank page. It trys to take me to a garbage URL:

PHP Code:

http://www.facebook.com/l.php?u=http%3A%2F%2Fwww.michigan-sportsman.com%2Fforum%2Fshowthread.php%3Ft%3D333593&h=3f000 

So obviously for this to be of any use at all these links on the user's FB profile page must be live and they must work!

hubie 04-23-2010 07:03 PM

wacnstac, i've checked your site and it's working correctly.

The only thing you have to add now is the conditional:
Code:

<if condition="$post[postcount] % $vboptions[maxposts] == 1">Your Code</if>
Otherwise, the Like button will be shown on every post of a thread.

wacnstac 04-23-2010 07:11 PM

So why don't the URLS on my fb profile page click through to a valid page. That's the most important part!

wacnstac 04-23-2010 07:25 PM

Also need the ability to exclude private forums.

hubie 04-23-2010 09:21 PM

Quote:

Originally Posted by wacnstac (Post 2026126)
Also need the ability to exclude private forums.

Put this code:
Code:

<if condition="$post[postcount] == 1 AND in_array($GLOBALS[forumid], array(X,Y,Z))">Your Code</if>
Where in X,Y,Z you have to put the forum IDs you want the button appear, and in the forum ID not especified the button won?t appear.

wacnstac 04-23-2010 10:59 PM

Thanks, and PM's should be excluded.

Gamelobby 04-24-2010 01:10 AM

This is very cool, but it doesn't seem to work with "Chief 1st post"..?
Any ideas.?

Also how does it work..!?
Any way that i can "like" things from my FB group or company page, instead of my personal profile.?

Floris 04-24-2010 01:20 AM

THe demo page returns: error.

wacnstac 04-24-2010 02:22 AM

Quote:

Also how does it work..!?
Any way that i can "like" things from my FB group or company page, instead of my personal profile.?
That would be very cool, but I don't think it's possible right now.

Brandon Sheley 04-24-2010 04:27 AM

Very cool mod, thanks so much
it works exactly how it should :)
I'm going to play with the placement a little, but here is a "Like" demo if you want to check it out.

Geek Specialtie 04-24-2010 05:58 PM

Looks like a missing closing quote for src tag.

original
Code:

<iframe src="http://www.facebook.com/widgets/like.php?href=http://www.YOURSITE.com/showthread.php$session[sessionurl]?p=$post[postid]&amp;show_faces=false&amp
        scrolling="no" frameborder="0"
        style="border:none; width:450px; height:25px"></iframe>


closing quote added
Code:

<iframe src="http://www.facebook.com/widgets/like.php?href=http://www.YOURSITE.com/showthread.php$session[sessionurl]?p=$post[postid]&amp;show_faces=false&amp"
        scrolling="no" frameborder="0"
        style="border:none; width:450px; height:25px"></iframe>

I haven't tried this yet but seems some browsers may have an issue with this.

Uberguilds 04-24-2010 06:20 PM

The button on every single post lags out my website in certain browsers/platforms. Had to take it down =/

hubie 04-24-2010 06:44 PM

Quote:

Originally Posted by Gamelobby (Post 2026266)
This is very cool, but it doesn't seem to work with "Chief 1st post"..?
Any ideas.?

You have to add the code manually in Chief 1st post templates to get it work.

Also how does it work..!?
Any way that i can "like" things from my FB group or company page, instead of my personal profile.?
I would like to know the same.

Quote:

Originally Posted by Loco.M (Post 2026316)
Very cool mod, thanks so much
it works exactly how it should :)
I'm going to play with the placement a little, but here is a "Like" demo if you want to check it out.

Great! but testing whit your demo i've noted that when i like the post and then go to my fb page the wall title shows the root of your forums and no the single post in particular. Maybe a miss of code there.

Quote:

Originally Posted by Geek Specialtie (Post 2026626)
Looks like a missing closing quote for src tag.

Thanks, i'll check and fix.

Quote:

Originally Posted by Uberguilds (Post 2026636)
The button on every single post lags out my website in certain browsers/platforms. Had to take it down =/

You must add the conditional "<if...>" (at first post of this thread) if don't want the button on every single post.

cdoyle 04-24-2010 11:52 PM

I'm going to add this to my site, just had a question on the demo.
I'm looking at it right now, and it only says 1 for the count (was 0 before I clicked it), is that right?

After so many from here trying it out, I would think it would be higher than that

hubie 04-25-2010 01:36 AM

Quote:

Originally Posted by cdoyle (Post 2026785)
I'm going to add this to my site, just had a question on the demo.
I'm looking at it right now, and it only says 1 for the count (was 0 before I clicked it), is that right?

After so many from here trying it out, I would think it would be higher than that

Yes you're right. i've replaced the button and the count is still at 0. Not sure if the problem is related with facebook, please give me feedback about it.

cdoyle 04-25-2010 01:46 AM

Quote:

Originally Posted by hubie (Post 2026202)
Put this code:
Code:

<if condition="$post[postcount] == 1 AND in_array($GLOBALS[forumid], array(X,Y,Z))">Your Code</if>
Where in X,Y,Z you have to put the forum IDs you want the button appear, and in the forum ID not especified the button won?t appear.

Just wanted to add, that I modified this IF a little, to make it so you only need to enter the forums you want to exclude
PHP Code:

<if condition="$post[postcount] == 1 AND !in_array($GLOBALS[forumid], array(c, j))"

Just enter the forums you want excluded, and these forums won't show the button and the rest will.

cdoyle 04-25-2010 12:23 PM

Quote:

Originally Posted by hubie (Post 2026812)
Yes you're right. i've replaced the button and the count is still at 0. Not sure if the problem is related with facebook, please give me feedback about it.

I just took another look at the demo, and right now it's only showing that I clicked the button.
I'm assuming that you clicked it too right?

I think I'm seeing the same thing on my forum, but I'm waiting for members to reply back if they clicked it in the test post.

I think it's a problem on Facebooks side, I've tried adding the like button to my RPG game. So far I only have 1 click there too, even though some have said they clicked it.

It also doesn't help that the facebook developer forums have been down all weekend too.

cdoyle 04-27-2010 02:18 AM

Has anyone else had any luck with the like button?
It seems for me, at least when I look at it. It only shows when I click on it, and doesn't give a total count of how many have clicked it.

Just like the demo, it only shows that I clicked on it and nobody else.

That can't be right can it?


All times are GMT. The time now is 01:55 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02011 seconds
  • Memory Usage 2,224KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (12)bbcode_code_printable
  • (8)bbcode_php_printable
  • (17)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete