The custom twitter templates works great for the http://twitter.com/home links, but for the tweet button (the one with the counter) link, it uses the http://twitter.com/share method and always has the via @addThis. It seems the addthis button will force the via @addthis for that particular button unless you override it using the html attribute tw:via="{YOUR TWITTER USERNAME}" in the link. I fixed temporarily by adding this to the addthis.module file:

/**
 * Implements hook_addthis_toolbox_services().
 */
function addthis_addthis_toolbox_services() {
  .......
    'tweet' => array(
      'class' => 'addthis_button_tweet',
      'attributes' => 'tw:via="{TWITTER USER NAME}"', // Added this
    ),
  );
  return $services;
}

It might be nice to have a setting somewhere in the module where you can specify a twitter username to override the 'via' for the '/share' method.

Just a though.

Thanks!

Comments

les lim’s picture

Status: Active » Fixed

There's already an interface for this - go to the "Customize services" tab on the administration page.

drclaw’s picture

Man, I can't believe I missed that! Sorry! Thanks!

Status: Fixed » Closed (fixed)

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

girishmuraly’s picture

Status: Closed (fixed) » Active

I can't get this to work.

* I am using tweet
* At 'Customize services' page (settings/addthis/custom), I set:
Service code: tweet
HTML classes: addthis_button_tweet
HTML attributes: tw:via="{myname}"
Title:

However, when I click on the 'tweet' link, it still has "..... via @addthis".

The url of the link however has:
http://twitter.com/intent/tweet?status=This is my tweet text!%3A+http%3A%2F%2Flocalhost%2Fhome%23.TfXutHX9ASA%3Btwitter+via+%40addthis
&url=http%3A%2F%2Flocalhost%2Fhome%23.TfXutHX9ASA%3Btwitter
&via={myname}
&text=This is my tweet text!&count=horizontal

However, the content of my tweet seems to take what is in the 'status' var, and what I end up tweeting is:

This is my tweet text!: http://localhost/home#.TfXutHX9ASA;twitter via @addthis

najyk’s picture

This started happening a couple days ago. It was working fine before, and now it's forcing the @addthis and that weird text to the URL.

???

WouterL’s picture

I have the same problem! Is there a solution?

Or is it solved when the website is online?

Thx

les lim’s picture

Appears to be an issue with the AddThis service, not the module:

problem with "via" settings:
http://www.addthis.com/forum/viewtopic.php?f=5&t=32111&sid=d13a03b361f27...

problem with gibberish in tweet text:
http://www.addthis.com/forum/viewtopic.php?f=5&t=31612&sid=d13a03b361f27...

girishmuraly’s picture

Thanks @Les Lim.

I was able to fix the gibberish error by what they suggested, in a hook_update_N() function:

function mymodule_update_6001() {
  $ret = array();

  if (module_exists('addthis')) {
    $addthis_config = variable_get('addthis_config', array());
    $addthis_config['ui_cobrand'] = 'My Site';
    $addthis_config['data_track_clickback'] = false;
    variable_set('addthis_config', $addthis_config);
    $ret[] = array('success' => TRUE, 'query' => "Set ui_cobrand and value of data_track_callback to false, in Addthis module");
  }

  return $ret;
}
najyk’s picture

Thanks Les Lim and girishmuraly -- but could you tell me where you added this code? Many thanks in advance

girishmuraly’s picture

@najyk, what I did was I created an update hook in my custom module's .install file.

See http://api.drupal.org/api/drupal/developer--hooks--install.php/function/... for hook_update_N

If you have a custom module (otherwise create one), in its .insall file, add the code pasted above (replace 'mymodule' with the name of your custom module and 'My Site' with whatever you want really) and run update.php as an admin on your site.

Then, flush all caches and test the tweet button. Hopefuly gibberish that appeared after the url should now be gone.

LostReaper’s picture

Category: feature » bug

same here, via @addthis issue.

www.esguide.org

koppie’s picture

What will it take to patch this module and get it into the stable version?

gisle’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

This bug report is nearly 5 years old and is about an outdated version of the module. I have not seen this problem when using the latest version (7.x-4.x).

I assume it has been resolved by now.

Feel free to reopen if you can tell us how to reproduce this with a clean install of AddThis 7.x-4.x.