vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=236)
-   -   Add-On Releases - Add "LIKE" button and other Facebook plugins to threads. (https://vborg.vbsupport.ru/showthread.php?t=243319)

Agathadaimon 08-02-2010 05:22 PM

Original postbit_legacy


PHP Code:

$template_hook[postbit_start]
<
table id="post$post[postid]class="tborder" cellpadding="$stylevar[cellpadding]cellspacing="0" border="0" width="100%" align="center">
<
tr>
<if 
condition="$show['announcement']">
<
td class="thead" style="font-weight:normal; border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]colspan="2">
<
img class="inlineimg" src="$stylevar[imgdir_statusicon]/post_$post[statusicon].gif" alt="$post[statustitle]border="0" />
<
phrase 1="$post[startdate]2="$post[enddate]">$vbphrase[x_until_y]</phrase>
</
td>
<else />
<
td class="thead" style="font-weight:normal; border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]; border-right: 0px" $post[scrolltothis]> 
<!-- 
status icon and date -->
<
a name="postimage$post[postid]"><img class="inlineimg" src="$stylevar[imgdir_statusicon]/post_$post[statusicon].gif" alt="$post[statustitle]border="0" /></a>
$post[postdate]<if condition="!$show['detailedtime']">, $post[posttime]</if>
$post[firstnewinsert]
<!-- / 
status icon and date --> 
</
td>
<
td class="thead" style="font-weight:normal; border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]; border-left: 0px" align="$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></if>
<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>
</
td>
</if>
</
tr>
<
tr valign="top">
<
td class="alt2" width="175" style="border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]; border-top: 0px; border-bottom: 0px">

<
fieldset><legend><b><font color="#000000" size="1">Kullan&#305;cı Profili</font></b></legend><div id="postmenu_$post[postid]">
<if condition="$show['profile']">
<
center><class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]">$post[musername]</a></center>
<
script type="text/javascript"vbmenu_register("postmenu_$post[postid]"true); </script>
<else />
<
center>$post[musername]</center>
</if>
</
div>

<if 
condition="$post['usertitle']"><div class="smallfont"><div class="postbit_buki"><center>$post[usertitle]</center></div></div></if>
<if 
condition="$post['rank']"><div class="smallfont"><div class="postbit_buki"><center>$post[rank]</center></div></div></if>
$template_hook[postbit_userinfo_left]

<if 
condition="$show['avatar']">
<
div class="smallfont"><div class="postbit_buki"><center><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></center></div>
<else />
<if 
condition="$bbuserinfo[showavatars]">
<
div class="smallfont"><div class="postbit_buki">
<
center><img src="http://img120.imageshack.us/img120/542/99104463oq1.png" alt="Avatar Yok" border="0" /></center>
</
div>
</if>
</
div>

</if></
fieldset>

<
fieldset><legend><b><font color="#000000" size="1">Kullan&#305;cı Bilgileri</font></b></legend><div class="smallfont">
<if condition="$post['joindate']"><div class="postbit_buki"><b>$vbphrase[join_date]:</b$post[joindate]</div></if>
<if 
condition="$post['field2']"><div class="postbit_buki"><b>$vbphrase[location_perm]: </b>$post[field2]</div></if>
<
div class="postbit_buki"><b>?ye No : </b>$post[userid]</div>
<if 
condition="$post['age']"><div class="postbit_buki"><b>$vbphrase[age]:</b$post[age]</div></if>
<
div class="postbit_buki">
<
b>$vbphrase[posts]:</b$post[posts]
</
div>
<if 
condition="$show['infraction']"><div class="postbit_buki">$vbphrase[infractions]: $post[warnings]/$post[infractions] ($post[ipoints])</div></if>

<if 
condition="$show['reputation']"><if condition="$show['reppower']"><div class="postbit_buki">$vbphrase[reppower]: $post[reppower]</div></if> 
<
div class="postbit_buki"><b>Rep Puan&#305; :</b> $post[reputation]</div> 
<div class="postbit_buki"><b>Rep Derecesi :</b$post[reputationdisplay]</div></if> </fieldset>


$template_hook[postbit_userinfo_right]
$post[icqicon$post[aimicon$post[msnicon$post[yahooicon$post[skypeicon]
</
div

</
td>
<if 
condition="$show['moderated']">
<
td class="alt2" id="td_post_$post[postid]style="border-right: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]">
<else />
<
td class="alt1" id="td_post_$post[postid]style="border-right: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]">
</if>
$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]/>
<!-- / 
icon and title -->
</if>

<!-- 
message -->
<
div id="post_message_$post[postid]">$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]

<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]/>
<
em>
<
phrase 1="$post[edit_username]2="$post[edit_date]3="$post[edit_time]">$vbphrase[last_edited_by_x_on_y_at_z]</phrase>.
<if 
condition="$post['edit_reason']">$vbphrase[reason]: $post[edit_reason]</if>
</
em>
</
div>
<!-- / 
edit note -->
</if>

</
td>
</
tr>
<
tr>
<
td class="alt2" style="border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]; border-top: 0px">
$post[onlinestatus]
<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>
</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></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></if>
$post[iplogged]
&
nbsp;
</
td>
<if 
condition="$show['moderated']">
<
td class="alt2" align="$stylevar[right]style="border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]; border-left: 0px; border-top: 0px">
<else />
<
td class="alt1" align="$stylevar[right]style="border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]; border-left: 0px; border-top: 0px">
</if>
<!-- 
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['deletedpost']">
<
img src="$stylevar[imgdir_misc]/trashcan.gif" alt="$vbphrase[deleted_post]border="0" />
</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 -->
</
td>
</
tr>
</
table>
<
div class="dcc"><div class="dcg"></div><div class="dcd"></div></div>
<
div style="padding:0px 0px 5px 0px;"></div>
$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_more_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_buddy_list]</phrase></a></td></tr>
</if>
$template_hook[postbit_user_popup]
</
table>
</
div>
<!-- / 
post $post[postidpopup menu --> 


Support 08-03-2010 01:31 PM

Agathadaimon ,
i reset the template so i have the original one already, i need the original template with modification

and btw, that is not the original template

Support 08-04-2010 03:57 PM

so no one can do it..

soundbarrierpro 08-04-2010 08:32 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2063890)
I agree this is much more difficult then it should be- something isn't playing nicely in vB... but I did end up getting this to work using all the instructions in this mod but instead if pasting the last step here into the template I used the IFRAME code provided by facebook...

Code:

<iframe src="http://www.facebook.com/plugins/like.php?href=http://www.YOURDOMAIN/forums/showthread.php$session[sessionurl]?t=$threadid" &amp;show_faces=false&amp;width=350&amp;action=like&amp;colorscheme=dark&amp;height=30" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:350px; height:30px;" allowTransparency="true"></iframe>
edit YOURDOMAIN to be your web domain...

Additionally I put it in an if tag:
Code:

<if condition="!in_array($GLOBALS[forumid], array(2, 3, 6, 15, 24, 45))">
 -iframe code-
</if>

Where the numbers are the forum id's of private forums that aren't viewable by guests and therefore useless to add a 'like' button too.

Finally I moved this to under where the page navigation menu would show if it was a multiple page thread on the showthread template... I moved the <td></td> tags out of the built in <if> statement so the table will be there regardless of whether the page nav menu is displayed... the code for everything now looks like:

Code:

        <td align="$stylevar[right]"><if condition="$show['pagenav']">$pagenav</if>
<if condition="!in_array($GLOBALS[forumid], array(2, 3, 6, 15, 24, 45))">
<iframe src="http://www.facebook.com/plugins/like.php?href=http://www.YOURDOMAIN/forums/showthread.php$session[sessionurl]?t=$threadid" &amp;show_faces=false&amp;width=350&amp;action=like&amp;colorscheme=dark&amp;height=30" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:350px; height:30px;" allowTransparency="true"></iframe>
</if>
</td>

Anyway this all works fine (for me), you can see a demo at:
http://www.juot.net/forums/showthread.php?t=41185
No login required.

What if you're using vbSEO? http://www.mysite.com/forum/showthread.php?.....doesn't post the correct link on your facebook page.

BirdOPrey5 08-04-2010 11:26 PM

I don't know, I've never had nor used vbSEO- is there an alternate variable you can use maybe?

soundbarrierpro 08-04-2010 11:33 PM

Hmmm. It still posts the "Like" thread to the members FB profile. But it just posts exactly what the url is which is defined in the mod instructions. I don't know anything about writing variables. I just have vbSEO relative .html URLS defined in the rewrite instructions. They rewrite as http://www.mysite.com/forum/topic-name.html

ShawneyJ 08-31-2010 01:17 AM

3. Click the Connect tab
-----------------
Connect tab seems to be gone on facebook, was there when i added this to my other forum a week ago.

EDIT: im guessing step 3 is now 3. Click the Website tab

Xtrigit 09-01-2010 02:57 AM

Quote:

Originally Posted by jaycob (Post 2091828)
EDIT: im guessing step 3 is now 3. Click the Website tab

That's correct. Thanks

MikesSite 09-14-2010 03:24 PM

Confirmed, does NOT work properly with Zoints SEO. The button is there and you can push it, but on facebook it leaves out the thread URL and does not create the actual page on facebook.

carsafety 10-14-2010 03:30 PM

Anyone have a live demo of this running on vb 3.8 right now? Thanks!


All times are GMT. The time now is 09:25 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.02610 seconds
  • Memory Usage 1,997KB
  • 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
  • (3)bbcode_code_printable
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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