Closed (fixed)
Project:
ShareThis
Version:
7.x-2.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
21 Jul 2011 at 12:46 UTC
Updated:
7 Feb 2015 at 18:43 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
jvalencia commentedThis was added after the last update to the Drupal project. The span tag has class:
class="st_plusone_" + type
Where type is one of the standard ShareThis button types. You can modify the source directly to add it after the buttons, or I think you might also be able to add it directly to the database entry: Inside your Drupal DB you modify the st_table, there is a services field which containes a string of key value pairs.
Or you can wait for/write the next update :-)
Comment #2
juampynr commentedThanks jvalencia, adding "Plusone:plusone" to the services field at table st_table worked. I wonder why Sharethis is not listing Google Plus one at the "Possible services" listing at http://sharethis.com/publishers/get-sharing-button. I have emailed them and will let you know the reason as I guess it will be demanded by more people.
Comment #3
juampynr commentedHere is the reply from ShareThis. They have not added it to the services list, although it can be added manually through the link they suggest.
=================
Hi Juan,
You can add Google+1 horizontal/vertical counter buttons to your page(by just checking the checkbox "Add Google+1" ) from here(We haven't provided google+1 in the list of large buttons only ):
http://sharethis.com/publishers/get-sharing-button
In order to add google+1 chicklet or google+1 button , you will have to add the code manually from the page:
http://help.sharethis.com/customization/using-facebook-like
Thanks
Comment #4
City-busz commentedAdding "Plusone:plusone" to database works me too, but I would like to configure this from module's configuration page. On the official button generation page you can see "Add Facebook Like" and "Add Google +1" checkboxes, if you select horizontal or vertical button style. I would propose something similar for this.
Comment #5
robloachShareThis might add support for this directly in their system. In the mean time, I'm going to set this to postponed.
Comment #6
cwithout commentedI know it would be best if ShareThis simply added the support for 1+ and like, it doesn't look like ShareThis in any hurry to add Google+ to the regular list of services to add widget. The same for Facebook like.
With ShareThis being so commonly used, and (in my experience) +1 and like being a most-wanted feature, I don't this should be postponed. It's hard for non-technical people (who most site builders have to answer to) to understand why they can't have +1 and like on their Drupal site when they can go to ShareThis.com and add it. I think it's better to incorporate the change in the module rather than tell people to make direct database changes, because you reduce the chances of people having unexpected errors due to those changes.
I considered creating a small module to hook into the ShareThis module's functionality to +1 and like. That is probably the best way, but there are currently no hooks in place to do so. I'm not familiar enough with the Drupal hooks system to modify the module to incorporate the necessary hooks.
I've created this patch that adds the checkboxes to the admin like ShareThis does on their site when you use the 'get button' functionality. I also built in the ability to easily remove the checkboxes in the event that they add those into the regular widget for selecting services. And in the event those are named differently once they're added to the widget, I've also included a means to remove for the old names from the services settings after saving the configuration settings. This is accomplished through editing defined constants. I added this via constants so that it is simple to add/remove these when needed.
So if there are additional services that need to be added in the same manner, they can also be added easily. Of course, this assumes the number of services to be added this way remains low. It could handle many, but it would become difficult to manage the source code if the list became numerous. I don't foresee that happening though.
This is a decent solution to allow for quickly adding services that ShareThis has added yet not fully incorporated yet.
Comment #7
mgladding commentedI am getting the following error after implementing the patch for 7.x-2.2:
And I am unable to add a service in the "Choose your services" section (see attached screenshot).
Thanks for any help!
Comment #8
robloachThanks a lot! I made some small adjustments... Mainly to get rid of the preg calls for performance and so that the options don't get cleared, but it's in there! http://drupalcode.org/project/sharethis.git/commit/2808870
Comment #9
robloachComment #10
orenbus commentedwaiting with baited breath for this to get integrated into sharethis module through official release.
Comment #11
robloachHaha, anything else you can think of that should be part of 2.3?
Comment #12
desiman commentedThe patch that is in git give the following error message.
Warning: Invalid argument supplied for foreach() in get_button_HTML() (line 380 of /etc/drupal7/all/modules/sharethis/sharethis.module).
I just looked at the code and on line 376 I was not able to find sharethis_get_options_array()
@@ -376,6 +388,7 @@ function sharethis_get_options_array() {
'nodeType' => variable_get('sharethis_node_option', 'page,article'),
'publisherID' => variable_get('sharethis_publisherID', ''),
'services' => variable_get('sharethis_service_option', '"Tweet:twitter","Facebook:facebook","ShareThis:sharethis"'),
+ 'option_extras' => variable_get('sharethis_option_extras', array()),
'viewMode' => variable_get('sharethis_teaser_option', 0),
'widget' => variable_get('sharethis_widget_option', 'st_multi'),
);
Instead the code is getting data from DB for options array.
function get_options_array() {
$data_options = array();
$sql = "SELECT st.st_options, st.st_value from {st_table} st";
$result = db.query($sql);
foreach ($result as $record) {
$data_options[$record->st_option] = $record->st_value;
}
return $data_options;
}
How can we add the additional argument of option_extra in the db select statement?
thanks for the help.
Comment #13
Xumorist commentedAdd Google Plus and Facebook Like pls! =)
Comment #15
DAKSH commentedI have applied the patch. I can see google+ and facebook like in admin panel but no sign of google+ or facebook like in the main page or on article page.
Comment #16
DAKSH commented