Resource icon

Display AddThis Share Bar in Posts 1.0

No permission to download

Chris D

XenForo developer
Staff member
Yorick submitted a new resource:

Display AddThis Share Bar in Posts (version 1.0) - Displays the "AddThis" Share Bar (normally appears in the post "Permalink" overlay) within the post.

Description
This add on displays the AddThis share bar, usually seen in the Permalink overlay:

View attachment 28806

Within the ad_message_below template:
View attachment 28807

You can see a live demo of it here:

http://www.valvetime.net/threads/google-drive-launched-with-5gb-free-dropbox-killer.190387/

Installation
Simply upload the contents of the upload folder to your Library folder.
Then, from the AdminCP, install...

Read more about this resource...
 
It's a good idea and works, but I don't like how it will not allow an image to be used if the post you are posting to FB has pictures inside of the thread. I tried this and each and everytime, it only gave me the option to just post the link but no 'image' choices (for threads which actually had threads in them) :(
 
I will look into this, but this is likely to be a limitation of AddThis, rather than anything else.

So basically, I'm assuming you're wanting to share to Facebook and then enable you to choose one of the images within the thread as your thumbnail?
 
Yes, I've looked into this and it's not straight forward. This is also a bit of a limitation of Facebook. Facebook needs to be told what image to use as its thumbnail. This is usually provided by the og:image meta tag or link tags. Whereas we could probably get it to pick up a generic image such as your logo, it's not quite as simple to get it to randomly pick an image from the post and use that as its thumbnail. Certainly the Facebook API isn't designed like this, the existing Facebook share button on XenForo isn't designed like this, and the AddThis share feature isn't designed like this.

If I find a solution I will implement it, but we have to bear in mind this add on is provided to share links to valuable posts on hundreds of sharing services. It isn't designed to share the content of the posts, just a link to the posts.
 
Understood but you can't expect anyone to want to follow a link that someone has shared without 'seeing' some of what the content is going to be about, correct? I mean, if I see someone telling me to 'click on this link' and it only shows a URL then to ME it's not telling or 'showing' me enough info for me to want to look further by clicking on that link. I understand what the intent was for this addon, I'm just stating the obvious as many of us who have shared links are given the option of choosing a range of images which are usually already available on the page we are asking people to click the link to. Content is available at the link so since you have the ability to provide a 'peep' o that link then I'm just saying 'why not provide any of the images on that page'? It's a great addon, I just wish you could have it mimic as much as possible the way most FB sharing options operate ;-)
 
Yorick updated Display AddThis Share Bar in Posts with a new update entry:

IMPORTANT: Follow these instructions for this add-on to work correctly

PROBLEM:

Unfortunately, it appears that certain parameters aren't passed to the ad_message_below template hook.

You might notice when using this add-on that the link which is shared does not contain the post number. In fact, the link that is shared doesn't even work properly.

This is because the details of the post ID aren't passed to the URL.

TEMPORARY SOLUTION:

As odd as this sounds, please disable the add-on. This will of course disable the Listener containing the...

Read the rest of this update entry...
 
Understood but you can't expect anyone to want to follow a link that someone has shared without 'seeing' some of what the content is going to be about, correct? I mean, if I see someone telling me to 'click on this link' and it only shows a URL then to ME it's not telling or 'showing' me enough info for me to want to look further by clicking on that link. I understand what the intent was for this addon, I'm just stating the obvious as many of us who have shared links are given the option of choosing a range of images which are usually already available on the page we are asking people to click the link to. Content is available at the link so since you have the ability to provide a 'peep' o that link then I'm just saying 'why not provide any of the images on that page'? It's a great addon, I just wish you could have it mimic as much as possible the way most FB sharing options operate ;-)
CritiKiL, part of the problem may be that there was previously a fault with this add on. Please follow the instructions here: http://xenforo.com/community/resources/display-addthis-share-bar-in-posts.641/update?update=1048

This does now seem to pass relevant content through to the share provider. It also seems to pull some thumbnails from the thread. I will continue to look at making this better.
 
CritiKiL, part of the problem may be that there was previously a fault with this add on. Please follow the instructions here: http://xenforo.com/community/resources/display-addthis-share-bar-in-posts.641/update?update=1048

This does now seem to pass relevant content through to the share provider. It also seems to pull some thumbnails from the thread. I will continue to look at making this better.
I just tried that and it does nothing different. What am I missing, and can you show me snapshots of how it looks 'working'? I have the addon 'disabled' then added that code to the bottom just like it says...
 
HEY! I cannot use this addon because it allows the CONVERSATIONS to be shared. I may not want some conversations to be shared but only be between the people I've invited in to the conversation. This addon 'allows' anyone in that conversation to post it to social networks (Look at the Image attachment). Now 'that's a NO-NO! :eek:
 

Attachments

  • file_addpostinconversations.webp
    file_addpostinconversations.webp
    161.4 KB · Views: 22
I just tried that and it does nothing different. What am I missing, and can you show me snapshots of how it looks 'working'? I have the addon 'disabled' then added that code to the bottom just like it says...
It doesn't look any different when it isn't working. But the functionality is broken.

Before my changes, the proper links aren't shared. The links that are shared do not work. This is because the thread and post parameters aren't picked up properly.

You'll also find that after the changes are made that Facebook will correctly pick up a thumbnail from the post or the default Facebook sharing logo as per default XenForo/Facebook behaviour.
 
HEY! I cannot use this addon because it allows the CONVERSATIONS to be shared. I may not want some conversations to be shared but only be between the people I've invited in to the conversation. This addon 'allows' anyone in that conversation to post it to social networks (Look at the Image attachment). Now 'that's a NO-NO! :eek:
Incorrect.

It allows LINKS to the conversations to be shared. What use is that to anyone? If someone shares a link to your conversation on Facebook no one other than the people within the conversation can actually see it. They are private messages after all. They will remain private, even if you publish the link.

That being said, it isn't needed there so it will be removed in the next version. It's only there because conversation view and thread view share the same templates. But it doesn't stop you using the add-on.
 
That's true. I think you should 'then' leave it there because it doesn't look bad actually even though it doesn't serve any purpose. Sorry I got spooked when I saw it in the Conversation area! lol

OK! I REALLY need some help on this. I just looked at the demo and my site does NOT look like the facebook share does when I try to share one of those threads. Please help me to get this to work? I can even get you temp-access for you to troubleshoot, but there's definitely something wrong with what I'm doing...
 
This is what I see when I try to share to FB:
 

Attachments

  • file_addpostinconversations2.webp
    file_addpostinconversations2.webp
    201.5 KB · Views: 20
That's true. I think you should 'then' leave it there because it doesn't look bad actually even though it doesn't serve any purpose. Sorry I got spooked when I saw it in the Conversation area! lol
That's ok, I was initially spooked myself until I realised it wouldn't do anything! :)

I will remove it, because it's just one template conditional but want to get the other issue fixed first. In fact, you could add it yourself if you want?

All you need to do is find template: addthis_ajax_post

1) At the top of the template add:

Code:
<xen:if is="{$controllerName} == 'XenForo_ControllerPublic_Conversation'">
<xen:else />

2) At the bottom of the template add:
Code:
</xen:if>
 
That's ok, I was initially spooked myself until I realised it wouldn't do anything! :)

I will remove it, because it's just one template conditional but want to get the other issue fixed first. In fact, you could add it yourself if you want?

All you need to do is find template: addthis_ajax_post

1) At the top of the template add:

Code:
<xen:if is="{$controllerName} == 'XenForo_ControllerPublic_Conversation'">
<xen:else />

2) At the bottom of the template add:
Code:
</xen:if>

Cool, but any idea why I'm getting 'this (see my image below)' instead of what the DEMO shows for trying to share to FB?:
 

Attachments

  • file_addpostinconversations2.webp
    file_addpostinconversations2.webp
    201.5 KB · Views: 20
Cool, but any idea why I'm getting 'this (see my image below)' instead of what the DEMO shows for trying to share to FB?:
Ok, I've now realised why this is happening for you.

Your forums are private, meaning all of your threads are private. This basically means that Facebook cannot read your thread to get the data which is fed to each page. If your forum is private then Google can't see your content, Facebook can't, guests can't etc.

So this really isn't going to work for you if your forums are going to stay private like that.


Facebook has a tool you can use to debug its ability to retrieve content from your page. Here's how your index page looks:

https://developers.facebook.com/tools/debug/og/object?q=http://sck-mobile.com/community/index.php

Your index page isn't private so it can read your board title, description, image etc.



Here's the same example again, but with a thread that can only be accessed by signing in:

https://developers.facebook.com/too.../sck-mobile.com/community/index.php?threads/2

Notice how Facebook can't pull anything through? You might be able to see the thread properly if you go to it, because you're registered, but Facebook can't.

Your only option would be to include some meta properties in your login template, but this will only supply a static image, your board description etc. It will not be able to supply thread or post detail because this is private.
 
@Chris D This is great addon, it looks really good.

Is there any reason why this was discontinued? Is there an alternative and does it work with 1.4?
 
Is there any reason why this was discontinued? Is there an alternative and does it work with 1.4?
I actually have no idea.

I know it wasn't very popular, it certainly wasn't built with even 1.2 or 1.3 in mind let alone anything else. Loading AddThis on every post probably isn't ideal in terms of page load performance. Ultimately I used it myself, and I stopped using it because I thought it was over the top and it was never used.
 

Similar threads

Replies
7
Views
1K
Top Bottom