WordPress.org

Ready to get started?Download WordPress

Forums

Share Buttons by AddThis
[resolved] Feature request to add counter options to addthis_custom_toolbox (9 posts)

  1. jbx
    Member
    Posted 1 year ago #

    The current plugin does not allow specifying the counter when specifying explicitly which buttons you want using the following approach:

    do_action( 'addthis_widget', $url, $title, $style);

    With a simple modification the counter can also be added as one of the options (just like 'size', 'services', 'preferred', and 'more'.

    In the file add_social_widget.php, in the function addthis_custom_toolbox(), at line 398 the following can be added (before $button .= '</div>';)

    if (isset($options['counter']) && ($options['counter'] != "") && ($options['counter'] !== false))
        {
            if ($options['counter'] === true)
            {  //no style was specified
               $button .= '<a class="addthis_counter"></a>';
            }
            else
            {  //a specific style was specified such as pill_style or bubble_style
                $button .= '<a class="addthis_counter addthis_'.$options['counter'].'"></a>';
            }
        }

    With this modification the user can just add 'counter' => 'bubble_style' (or whichever style he likes) to the style array, or even just set it to true for the default style.

    I already have this working on my installation but I don't have permissions to commit it into SVN. I am sure it will be useful for other people because I saw some questions about it around, and I would also be able to update to future versions easily without losing this enhancement.

    http://wordpress.org/extend/plugins/addthis/

  2. jbx
    Member
    Posted 1 year ago #

    Sorry to bump this. Any chance of including this simple functionality to allow the counter and additional options to be added?

    I am sure everyone using the current plugin will find it useful to have the same flexibility of including the plain HTML addthis instead of the plugin.

    The code is already included above, and I've been using on a wordpress blog for over 2 months now.

    Thanks.

  3. Srijith V
    AddThis Samurai
    Plugin Author

    Posted 1 year ago #

    @jbx: Thank you for sharing this! We will definitely try to add this to the plugin. Can I have a look at your site to see it in action?

  4. jbx
    Member
    Posted 1 year ago #

    Sure, have a look here. Its at the bottom left of the page under the article content.

    cheers.

  5. paracleteweb
    Member
    Posted 1 year ago #

    I would also love to see this feature and have also implemented it:

    to call the code I have:

    <?php
    			$customAddThis = array(
    				'size' => '16', // size of the icons.  Either 16 or 32
    				'services' => 'email,facebook', // the services you want to always appear
    				'preferred' => '0', // the number of auto personalized services
    				'more' => true, // if you want to have a more button at the end
    				'counter' => bubble_style // if you want to have a more counter at the end
    			);
    						 do_action('addthis_widget',get_permalink($post->ID), get_the_title($post->ID), $customAddThis);
    			 ?>

    and I've modified the plugin with:

    if (isset($options['counter']) && ($options['counter'] != "") && ($options['counter'] !== false))
    				{
    					if ($options['counter'] === true)
    					{  //no style was specified
    					   $button .= '<a class="addthis_counter"></a>';
    					}
    					else
    					{  //a specific style was specified such as pill_style or bubble_style
    						$button .= '<a class="addthis_counter addthis_'.$options['counter'].'"></a>';
    					}
    				}

    on line 398 before

    $button .= '</div>';
  6. jbx
    Member
    Posted 1 year ago #

    Any chance of having this small update released?
    I have been holding up on updating to the latest version of this plugin just because of this, so that I don't lose my changes.

    cheers.

  7. Srijith V
    AddThis Samurai
    Plugin Author

    Posted 1 year ago #

    @jbx: The next version in queue will have it. It's under our QA and will be released shortly.

  8. jbx
    Member
    Posted 1 year ago #

    @srijith.v I see the code was included in the latest 3.0.3 release :). I can finally upgrade, thanks... will try it out tonight.

  9. Srijith V
    AddThis Samurai
    Plugin Author

    Posted 1 year ago #

    All credits to you for pointing this out!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic