Recent Topics

[Plugin] ShareThis plugin for b2evolution

Started by on Jul 29, 2008 – Contents updated: Mar 03, 2015

Jul 29, 2008 17:29    

Update July 4 2009: I have released version 1.1 of my ShareThis plugin. Read the [url=]Announcement[/url] (o, en [url=]español[/url]). Many thanks to NelsonGuirado, who provided several suggestions and helped with testing the functionality.

I'm happy to present the Sharethis plugin for b2evolution 2.4.x.

What is sharethis? A nice button to allow your readers to post your content to multiple social bookmarking sites, like facebook, digg, meneame, etc. Furthermore you'll have upon registration on sharethis, nice statistics about click-through rates and other goodies.

This plugin will add a Sharethis button to your posts. Just that.

Read more and download at [url=]Crónicas Linuxeras[/url] (in spanish, but instruction for installation are standard, or so one hopes. Maybe later I'll add an English translation).

This a snapshot of the backoffice configuration screen for the plugin:

Enjoy sharing!

Aug 09, 2008 05:16

Thanks for the plugin - is there any way to have the sharethis button appear somewhere else on the page? On my site, I have my post's title, categories etc, appear to the left of the post text itself (see and I'd like the sharethis button appear in the same place.

Aug 09, 2008 10:34

Hi na3,

Sorry, in this version there's no way to move the button to somewhere else, except perhaps through CSS. The button is inside a div with class "sharethis", so you could set:


.sharethis { position: absolute;
right: 40px;
top: 200px;

OR something like that. However, I know that's not optimal, so perhaps I could transform the plugin into a widget you can put whenever you like. I don't promise I'll do it quickly, because first I have to learn how to do that :)

Aug 09, 2008 11:09

Oh, I'd love that! Take your time, I'm in no hurry.

Thanks so much!

Aug 09, 2008 11:13

Austriaco wrote:

so perhaps I could transform the plugin into a widget you can put whenever you like.

It basically involves copying everything in function RenderItemAsHtml() into function SkinTag() ;)

Don't forget to error check your params in case somebody slaps it in the header container ;)


Aug 20, 2008 10:44

Error log


[error] PHP Notice:  Undefined index:  HTTP_USER_AGENT in /home/***/public_html/plugins/sharethis_plugin/_sharethis.plugin.php on line 149

Aug 29, 2008 17:40

Hi Laibcombs,

you might try changing the function is_ie_crap() on line 148 like this:


function is_ie_crap() {
    if( !empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
      $match preg_match'/MSIE [56]\.\d/'$_SERVER['HTTP_USER_AGENT'] );
      return ( $match );
    return false;

Sep 10, 2008 20:32


I'm using the latest B2 software and I've just loaded and installed the Share This plugin. However - when I go to add the publisher ID and press 'save', I am presented with an error page which states "You don't have permission to access /admin.php on this server.

All the other plugins seem fine that I've loaded, it's just this one. I've tried uninstalling and reloading a few times with no luck.

Any suggestions??

Thanks very much,


Sep 10, 2008 21:47

Austriaco wrote:

Hi Laibcombs,

you might try changing the function is_ie_crap() on line 148 like this:


function is_ie_crap() {
    if( !empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
      $match preg_match'/MSIE [56]\.\d/'$_SERVER['HTTP_USER_AGENT'] );
      return ( $match );
    return false;

You can also try this


function is_ie_crap()
    global $Hit;
    if( $Hit->is_IE )
        return ( @preg_match'/MSIE [56]\.\d/'$Hit->user_agent ) );
    return false;

Nov 26, 2008 21:03

when I share via email or text the link that it sends, as well as the image, are wrong. I think it assumes that everything is in the servers root directory where mine is /blog/plugins/sharethis/......

Any idea how to fix this or which files to edit?

Nov 26, 2008 21:43

Hi fugfuggy, The plugin doesn't assume anything about the location of any files. But a link to the blog were you're having problems would come in handy to see what's happening.

Nov 26, 2008 21:55


I think that the link is correct, it is just the image that is wrong. The image that is sent is what looks like the index.php page in the root directory, rather than an image of the blog page (which is what I assume it is supposed to do). This is the old website that is no longer in use. Here is a link to one of the blogs.

Feb 13, 2009 23:48

Thanks for the really helpful plug-in.

Please let us know if and when you figure out how to move the button to the beginning of a post instead of the end.

Feb 25, 2009 18:35

Never mind this post I found the solution

Feb 26, 2009 10:55

How can I get this to show up on the posts broken up by "more?" Below the fold, I guess you'd say.

Mar 05, 2009 06:32

In other words, share this won't show up on some posts. Is there a way to fix this?

Mar 30, 2009 06:50

I really like this plug in, but if you go to my blog, you'll notice that the share this plug in doesn't show up on each of my posts. I think this is a great plug in, essential even, and would love to get rid of the custom solution I have. Are there any updates planned?

Apr 21, 2009 23:51

Hi Nelson, where is your blog?

I plan on doing some updates when I have time. Maybe next week even. At this point you can show the ST button only on full posts pages, or if you don't use <!--more-->.

What is exactly what you'd like to do? To display the ST button on every post, even if its split by <!--more-->?

Apr 24, 2009 22:08

My blog is I have a custom solution, but would like your plug in to take its place. I like it but it doesn't show up on every post even though I told it to.

Apr 29, 2009 09:06

Hi Nelson.

The solution I have been able to implement will put the ShareThis block before the "read more" link on multiple-post pages and after all the post content on single post pages (as it is now). If you don't mind that little "inconsistency" I can send you a "pre-release" version, so you can test it and tell me if it works as you like.

Apr 29, 2009 22:38

That would be great.


Apr 30, 2009 11:53

Sorry, the forum stops me from creating new post. Can anybody help to post the following? Thank you very much!

Does b2evolution supports modules for
- displaying members who are online
- displaying latest added blog entry
- displaying blogs with latest updates
- displaying blogs with most hits

Apr 30, 2009 12:31

april2915 wrote:

Sorry, the forum stops me from creating new post.

Perhaps explains why? This forum is for plugin authors to share their work, and plugin users to get help with specific plugins. The specific thread is about the "Sharethis" plugin. You can't post new here because you're not a plugin author (yet?), and your question seemingly has nothing to do with the Sharethis plugin.

april2915 wrote:

Does b2evolution supports modules for
- displaying members who are online
- displaying latest added blog entry
- displaying blogs with latest updates
- displaying blogs with most hits

Um... have you checked out this software at all? Because what you're asking is basically "does b2evolution do what b2evolution does?" which makes no sense.

Please, ask any question you like AFTER taking the time to find the appropriate forum for your type of question. It'd be cool if you played with the software a little bit first (there is a demo site available), and maybe even used the search feature, but don't just jump on a thread expecting someone to take care finding where your question belongs cuz that's pretty crappy.

Jul 04, 2009 16:56

Hi everybody interested in the ShareThis plugin. I have released a new version. Read the announcement at the top of [url=]this thread[/url]

New functionality:

  • Ability to to put the button at the beginning or at the end of every post.
  • Ability to use it as a pop-up window or embedded widget
  • Improvements in the admin area.
  • [/list:u]


Jul 10, 2009 09:09

I'm using it. Thanks.

Jul 26, 2009 10:52

Usually, when things go wrong I seem to have caused it. So I have no doubt that there is an easy solution for this: I can display every widget in the container I set up except for ShareThisWidget.

There's a certain irony to not being able to share sharethiswidget, but not enough of one that I wouldn't appreciate any help you could give me. The container is copied and pasted verbatim, and has no trouble loading widgets like "BlogTitle."

Any ideas?

Jul 28, 2009 18:44

I have finally got ShareThis to work on a blog I put together. The link appears ONLY in Firefox. IE does not display anything. In addition, ShareThis links is below the icon, even though I am specifying display:inline in the stylesheet.
Has anyone had this happen?
Is there something that needs to be changed to work in IE?

Mar 18, 2010 08:48

I uploaded the file to the plugins folder and installed it but it doesn't appear in m blog?

Mar 23, 2010 05:04

Anyone have specific instructions on how to get this to work?

Mar 23, 2010 11:32

Installation and Setup

Installation and setup is fairly easy.

1. Donwload the ZIP file which contains the Plugin: Sharethis Plugin for b2evolution 2.4.x
2. Extract the contents of the ZIP file on your server's plugins/ directory
3. Go to your Backoffice and activate the plugin
4. There are two parameters to setup after activation, the first one is your publisher ID, which you get upon registration at ShareThis. The second one is the comma-separated list of services you want to appear when the user clicks the button. If this list is empty, the default 20 services will be used.
5. After this, you will notice a new checkbox when you're in the editor ShareThis, which is activated by default. This will put the ShareThis button in your new posts. If you don't want this behavior, go to the plugin settings and select "opt-in", or "opt-out" for "Apply Rendering" option.

Mar 24, 2010 08:53

Thanks, figured out my mistake. I had just uploaded the folder to the plugins folder whereas you just upload the file itself.

May 25, 2010 19:59


is ther some way to get this ShareThis Plugin working for b2evo version 1.9.2 as well? I tried and I received an error apparently caused by line 90 (require_js( $sharethis_url )).

Best Regards,

Mar 28, 2012 23:02

I installed the sharethis plugin as stated with my sharethis ID.

I opted in and then also tried "always"

I have tried to use it in postings and also on pages but it is not appearing?

Any ideas on how to fix this?

Dec 13, 2013 16:48

Regarding the error at line 149 - neither of the solutions offered above work - any other suggestions?

Feb 07, 2014 10:26

Hello everybody,

I just added two super minor changes (including the code mentioned above about warning in line 149) to this plugin, re-packed and shared to be downloaded directly from here.

Note: tested in version 5.0.7, it works as expected.



Feb 25, 2015 17:11

I am using the plugin too and I like it.
However, when i share a post to Facebook, it always shares the same post, not the one I used the plugin for.

Any fix for this or did I do something wrong?
b2e version 5.2.2 Aveso skin.

Feb 28, 2015 06:27

Hi @vlaanderen,

The plugin actually shares different posts, the problem is that the URLs are shortened and you always see the same one at the Facebook's wall, at least that is what I got when I tested from my side (see image above). I think this could be managed depending on which values are sent to ShareThis as properties, however the plugin would need an update to support more customization.

Please confirm if, even when URLs look the same at the wall, they lead to different pages.


Mar 03, 2015 11:39

Yes, this is the case. It does point to the wrong place, however, it is annoying to see a post appear on facebook which has nothing to do with the topic you are actually referring to.
Thank you.

Form is loading...

powered by b2evolution – This forum is powered by b2evolution CMS, a complete engine for your website.