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
Comment #1
les limThere's already an interface for this - go to the "Customize services" tab on the administration page.
Comment #2
drclaw commentedMan, I can't believe I missed that! Sorry! Thanks!
Comment #4
girishmuraly commentedI 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
Comment #5
najyk commentedThis 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.
???
Comment #6
WouterL commentedI have the same problem! Is there a solution?
Or is it solved when the website is online?
Thx
Comment #7
les limAppears 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...
Comment #8
girishmuraly commentedThanks @Les Lim.
I was able to fix the gibberish error by what they suggested, in a hook_update_N() function:
Comment #9
najyk commentedThanks Les Lim and girishmuraly -- but could you tell me where you added this code? Many thanks in advance
Comment #10
girishmuraly commented@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.
Comment #11
LostReaper commentedsame here, via @addthis issue.
www.esguide.org
Comment #12
koppie commentedWhat will it take to patch this module and get it into the stable version?
Comment #13
gisleThis 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.