I've created a little module that adds support for the Gigya ShareBar plugin. I'd like to provide it as a patch to the existing module. It currently adds the sharebar to the bottom of a node (see http://drupal.org/files/sharebar.png) and allows minimal customization via it's own settings page (see http://drupal.org/files/sharebar_settings.png).

There are some TODOs in comments in the module file, but I think this is a pretty decent start.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

gambaweb’s picture

if you could post the patch I'll try and included it and take care the "TODOs"
thanks

gambaweb’s picture

@jenlampton if you could post the module as is I'll integrated it as a submodule to the current module
thanks

jenlampton’s picture

Sure, I'll make you a patch this weekend.

jenlampton’s picture

Status: Active » Needs review
FileSize
8.49 KB

I'm assuming the 3.x branch is master? Here's an attempt at a patch. let me know if it doesn't work for you.

drupalninja99’s picture

is this in dev yet?

gambaweb’s picture

just pushed it with some additions
- shaerbar per content type
- facebook like button
- show counts configuration

jenlampton’s picture

Awesome :) I'm going to add an .install file to clean up after all these new variables.

jenlampton’s picture

Here's the install and some general cleanup.

ChrisBryant’s picture

@jenlampton and gambaweb, nice work on this. :-)

Jen, I didn't see the .install included with the latest patch, was that missed by accident?

jenlampton’s picture

bah, #gitfail. Trying again.

drupalninja99’s picture

is the .install in dev now?

drupalninja99’s picture

Does this support rendering the bar more than once on a page. I've been poking around and it seems to only support the node view page. I am trying to figure out the best way to make it render multiple times on a page (for views).

gambaweb’s picture

ok pushed the patch

moonray’s picture

This could use a major tweak: Give us more control through a hook_alter().

Find patch attached.

marcp’s picture

I like the idea of the alter hook. Ideally, a module that implements hook_gigya_sharebar_alter() would be able to keep gigya from putting any Javascript out.

So, if in the alter hook, I clear out $settings, then it wouldn't add the gigya_sharebar javascript.

marcp’s picture

This is a great feature. Thank you for providing it! I just added #1198308: Provide option to not show sharebar on teaser which would build upon this foundation, in case anyone has time or interest in coding it up.

dshumaker’s picture

Has anyone been able to get gigya sharebar activities to show up in the gigya activity feed block? We've got the activity feed block working and the gigya sharebar working and now we want to tie them together. I.e. If someone "likes" something via the sharbar it would be great it if those likes would show up as activity in the gigya activity stream. However I don't see how or where to add the trigger/action equivalent for facebook likes.
thanks for any hints.

gambaweb’s picture

I added moonray hook_alter() patch so now it is easy to change the sharebar settings.
you can see docs here http://developers.gigya.com/010_Developer_Guide/18_Plugins/015_Share_Bar
and here http://developers.gigya.com/030_API_reference/010_Client_API/020_Methods...
@dshumaker you should set scope parameter in the showsharebarUI to 'both'

dshumaker’s picture

Thanks @gambaweb, I was able to set the scope parameter successfully a while ago (sorry I didn't update this thread). I'm hoping to make a new module that will include the ability in the admin section to set the scope, privacy and feedID parameters. However, while setting scope and privacy is relatively easy, setting the feedID has some implications of multiple feeds which would possibly involve multiple block creation and I'm not sure if I'll have time for that.

sokrplare’s picture

Anyone know why "Facebook like is special"? I deleted this chunk (lines 52-56, gigya_sharebar.module):

// Facebook like is special.
        if (in_array('facebook_like', $buttons)) {
          drupal_add_js(array('gigya_sharebar' => array('facebookLikeButton' => array('action' => 'Like', 'position' => 'first'))), 'setting');
          unset($buttons['facebook_like']);
        }

Then swapped in a hyphen for the underscore in this bit (lines 189-192, gigya_sharebar.module):

$networks = gigya_sharebar_selected_networks();
  if (in_array('facebook', $networks)) {
    $networks['facebook_like'] = 'Facebook like button';
  }

And saw no change, FB button loaded just fine (albeit, not first in line, but that should be handled with #1469616: Add ordering to ShareBar sub-module, not code hacks). Was this necessary for an older Gigya bug/version that is no longer needed?

Just want to make sure I'm not missing something and irrevocably destroying it - little things like that ;)

moonray’s picture

From what I can tell, it looks like it's to position the button first in the series.

sokrplare’s picture

I agree, but I think it might be for more than that too, otherwise the 'action' => 'Like' part wouldn't be necessary and in the JS there is some special handling to pass these vars on to Gigya (which maybe used to need these for FB?).

sokrplare’s picture

Ah-ha! Was looking for something else entirely when this part of the documentation caught my eye. We've got the 'position' => 'first' part sorted out in comment #21 and #22 above, but the 'action' part was still confusing.

From Gigya's documentation at http://developers.gigya.com/020_Client_API/020_Methods/socialize.showSha...

These following fields are relevant only if provider='facebook-like':
action - string - Defines the verb to display on the button, maps to the Facebook 'action' parameter. Accepts two values: "like" (default) or "recommend".

If you're curious about the difference, this thread helps: http://www.quora.com/What-is-the-difference-between-the-Facebook-Like-bu...

Mystery solved!

gambaweb’s picture

there is a hook_gigya_sharebar_alter i.e. {your-module-name}_gigya_sharebar_alter function.
to do these modifications to the sharebar options

Gigya’s picture

Issue summary: View changes
Status: Needs review » Closed (won't fix)

Gigya's 6.x module is deprecated. We no longer support this version and we encourage upgrading to our latest module.