Main features

A pluggable widget that provides HTML5 widgets for social networks. Each button has language-options so you can set them to the language of your site. By using the networks widgetbuilders and javascript (which the module loads async in HEAD where possible) the full and latest sharing-technology is guaranteed.

The following networks are included:
Twitter => Share, @follow, #hashtag and @mention
Facebook => Like/Recommend and/or Share
Google => +1 or Share
LinkedIn => Share
Pinterest => Share or follow
Tumblr => Share
More to come and extending on existing ones also.

You can choose a lot of options for each button including counters, no counters, set the order in which they must be displayed, choose a horizontal or vertical layout, set language, width, fixed urls or flexible urls (uses path-aliases if set) and more.

In general settings you can enable widgets per node-type, the weight of the widgets, and optionally display them on teasers too (which is not usefull when you set them to a fixed url), or display the buttons in a block.

Extend this module

The module is written in a manner that it should be easy to add extra plugins. Just drop a pluginname.inc in the plugins folder and it will be picked up automatically.

First check your favorite social network for html-widgets you want to add, create a file called mynetwork.inc in the plugins folder. See the plugins/mynetwork.inc.txt for a code example, this one has the basic minimumoptions, so it should be easiest to extend on that one. Take a sneakpeak at linkedin.inc, this one is the easiest with not so much extra code at all. When creating a new plugin make sure to clear the cache when a new file is present in the pluginsfolder to enable it in the /admin/config/services/sharebuttons/settings.

You can see a demo on http://diddism.nl/blog/webdesign/sass-vs-css. This is a horizontal line-up with no counters.

Get the module here: https://drupal.org/sandbox/diddism/2259999

git clone --branch 7.x-1.x-dev http://git.drupal.org/sandbox/diddism/2259999.git sharebuttons
cd sharebuttons
CommentFileSizeAuthor
like-screen.png67.52 KBdiddism
vertical-counters.png15.2 KBdiddism

Comments

PA robot’s picture

Status: Needs review » Needs work

There are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxdiddism2259999git

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

diddism’s picture

Did some work on the errors. Some of them are part of the code for improved readabilty.
This one i use a lot: String concat is not required here; use a single string instead

  // A clear and fast way of concating long strings with lot's o vars.
  $markup = 'test'
    . $var1 . 'longsentence'
    . $var2 . 'longsentence';
  return $markup;

And what is this: Case breaking statements must be followed by a single blank line

  // Returning arrays vanilla in a switch.
  switch($var) {

    case '1':
      return array(
        'a' => 'aaaa',
        'b' => 'bbbb',
      );

    case '2':
       return array(
         'etc etc',
     ); 
  }

Why does it expect to put the array in a $var and return that after the array is build?

diddism’s picture

Status: Needs work » Needs review
a_thakur’s picture

Please change the git details in the project applications it should be
git clone --branch 7.x-1.x-dev http://git.drupal.org/sandbox/diddism/2259999.git sharebuttons

Coming back with more review.

a_thakur’s picture

Please add the .install file too as in sharebuttons.settings.inc you have saved variables in variables table, so these variables have to be deleted when the module is uninstalled.

This is done using hook_uninstall() in .install file of your module.

a_thakur’s picture

Status: Needs review » Needs work
diddism’s picture

Issue summary: View changes
diddism’s picture

Thank you for reviewing
- Added install/uninstall info @ http://drupalcode.org/sandbox/diddism/2259999.git/commit/ac0a89c
- Updated link to git.
- Updated project description to review yesterday's changes (added some things).

diddism’s picture

Status: Needs work » Needs review
a_thakur’s picture

Please change sharebuttons.settings.inc to sharebuttons.admin.inc, as this file contains the admin settings of your module, so it is a good practice to name it .admin.inc, taking example from core node module

/**
 * Implements hook_menu().
 */
function node_menu() {
  $items['admin/content'] = array(
     'title' => 'Content',
     'description' => 'Find and manage content.',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('node_admin_content'),
     'access arguments' => array('access content overview'),
     'weight' => -10,
     'file' => 'node.admin.inc',
   );
 }
a_thakur’s picture

didism: could you elaborate common difference between your module and other social sharing modules available for drupal.

There are many such modules which exist already like: https://drupal.org/project/addtoany, https://drupal.org/project/addthis.

Drupal believes in collaboration rather than competition, may be you could join hands with some of the existing modules or you could include similar modules on your project page.

diddism’s picture

Issue summary: View changes

Sharebuttons has more settings out of the box per button than addtoany or addthis through webgui (though addtoany and addthis have more providers). It uses the HTML5 api's where available and the javascript the buttonprovider uses instead of the javascript of an external provider like addthis or addtoany.

I know there are a lot of similar modules for social media, but none of them was giving an easy setup for displaying the default standard buttons from the bigger networks.

For example: if you want the addtoany facebookbutton with faces, then you need to go through a process where copying/pasting is involved (according to this page: http://www.addtoany.com/buttons/customize/drupal).

I think Sharebuttons is much more friendly for end-users that know nothing about HTML but want to have and maintain a site with social media - share options and a easy setup for that.

diddism’s picture

Issue summary: View changes
BigEd’s picture

Nice little module.

A few points though.

On sharebuttons.module line 73,89,114,122,155,169,172,197,209,212,232 extra spaces are not needed.

Also some functions have a space after and some don't, for consistency I suggest you remove the space as this is quite normal.

On .install you are using function sharebuttons_enable() to print a message to the user you can do this in hook_update_n
https://api.drupal.org/api/drupal/modules%21system%21system.api.php/func... this also has the added advantage of getting your module ready for the next version that will inevitably happen after release.

olivierg’s picture

I install it without problem. I checked code and it's clear.
Just Pinterest for me I saw the error "Sorry, couldn't find any pinable..." but I wasn't put an image in my page.... :-(

So it works fine.

jdvc’s picture

Status: Needs review » Reviewed & tested by the community

One very small functionality or docs change:
It's confusing to enable each share button separately on their respective admin pages. Maybe consolidate onto the global settings page? From the documentation it was not clear for me that 'enable plugin' meant the actual share button pages, but maybe others will figure it out, just a suggestion.

Other than that, this is the most robust and configurable sharing module that i've seen that still uses the native apis for the buttons and not a service.

Probably going to start using it right now, really nice module.

kscheirer’s picture

Status: Reviewed & tested by the community » Fixed

Non-blocking issues:

  • You don't need the ; in the .info file
  • You can use drupal_ucfirst() instead of uc_first, and theme('item_list') to create your ul
  • All of the js files in /js use a similar technique - loading a new script via Dom elements. I think using drupal_add_js() would be much easier/clearer
  • Thanks for addressing the duplication issue, consider posting this on your project page to help users understand the differences

Checked for security, licensing, Drupal API, and individual account.

Thanks for your contribution, diddism!

I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks to the dedicated reviewer(s) as well.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.