• This forum is for release discussion only. Discussions that do not relate specifically to the resource release should be discussed in another, more appropriate forum.
  • This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Fb Send Button threads "Share This Page"

B

bogus

Guest
I am using this since a Member was asking for.
Very simple modification to add Facebooks Send Button. Remember to add this always after a xenforo upgrade. Maybe this will be added by default ;)

In ACP Template search for share_page

and replace

<fb:like href="{$url}" show_faces="true" width="500" action="{$xenOptions.facebookLikeAction}" font="trebuchet ms" colorscheme="@fbColorScheme"></fb:like>
with
<fb:like href="{$url}" show_faces="true" send="true" width="500" action="{$xenOptions.facebookLikeAction}" font="trebuchet ms" colorscheme="@fbColorScheme"></fb:like>
Attachment is a preview Screen.

p.s.: If any knows how to get rid of the BBCode dont hesitate to tell
 

Attachments

B

bogus

Guest
Nothing that i have done. It´s just a simple config part FB is offering and which is easy to implement.
But as I thought it is quite interesting for those who do not know
 

Victor

Active member
Anyway to have this for each post instead of each page? That would be awesome!

Well this is awesome too ;)
 
B

bogus

Guest
You could do the same as decribed here , with the fb button
http://xenforo.com/community/threads/tweet-per-post.14581/

Just copy the FB Code out of the share_page Template and replace the Tweet from tweet-per-post.14581 with the FB Code. I will do this later if you dont know. Maybe anywhere around is an example already. Have to do some work now
 
B

bogus

Guest
Well done something.. VERY dirty coded.... Check if a forum is secret is missing. Like posts wont be shown in FB or twitter but the buttons shouldnt be shown in a private Forum....

I have taken over the Idea of the Twitter button from the Link i posted one Post over this one

Create a new Template and call it share_user_post. Fill it with the following code
Code:
<xen:if is="{$controllerName} == 'XenForo_ControllerPublic_Thread'">

        <xen:if is="{$xenOptions.tweet.enabled}">

            <div class="tweet shareControl">
                <a href="http://twitter.com/share" class="twitter-share-button"
                    data-count="vertical"
                    data-lang="{xen:helper twitterLang, $visitorLanguage.language_code}"
                    data-url="{xen:link canonical:posts, {$post}}"
                    {xen:if {$thread.title}, 'data-text="{$thread.title}"'}
                    {xen:if {$xenOptions.tweet.via}, 'data-via="{$xenOptions.tweet.via}"'}
                    {xen:if {$xenOptions.tweet.related}, 'data-related="{$xenOptions.tweet.related}"'}>{xen:phrase tweet}</a>
            </div>
        </xen:if>

            <xen:if is="{$xenOptions.facebookLike}">
                <div class="facebookLike shareControl">
                    <xen:container var="$facebookSdk">1</xen:container>
                    <fb:like href="{$url}" show_faces="false" send="true" layout="box_count" font="trebuchet ms" colorscheme="@fbColorScheme"></fb:like>
                </div>
            </xen:if>

</xen:if>
Open EXTRA.css and add this Code to it
Code:
.messageUserInfo .tweet { margin-top: 10px; float: left; }
.messageUserInfo .facebookLike { padding-left: 10px; margin-top: 10px; float: left; }
To get the whole Code looking like the Userinfo part its another Class needed i have not added here.

Open message_user_info Template and add between the last

</div>
</div>
Code:
<xen:include template="share_user_post" />
Thats it. Dont forget to save all the changes ;)
Credits must go to this Thread
Every better Idea is Welcome..
 

ArucarD

Member
Very very nice.. I like the way it has changed to having the bubbles above. Thank you, added this to both of my themes. :D
 
Top