Hi. Great module.
There's a glitch on my site. When I share via twitter, it shares the link twice (eating up a lot of characters).
It also says via@@ instead of via @

Comments

maerys’s picture

Same here, except the @@ – the URL is posted twice Doesn't look that good...

Flash dash’s picture

Issue summary: View changes

Has anybody found a fix for this? I'm having the same issue on a clients site. The main issue is the link showing twice

mdawe’s picture

I have corrected the duplicate link bug by simply removing the token from the twitter entry, within the socialmedia_base_platforms function in social media.widgets.inc. For example the following code:

  $platforms['twitter'] = array(
    'label' => t('Twitter'),
    'group' => t('Social media: Twitter'),
  );
  $title = t("Visit !varusername on Twitter", array('!varusername' => '[?profile_username=[socialmedia:sm-twitter_username]?]'));
  $stitle = t("Tweet this");
  $platforms['twitter']['templates'] = array(
    'profile-url' => "[?profile_url=[socialmedia:sm-twitter_url]?]",
    'profile-text-link' => '<a href="//twitter.com/[?profile_username=[socialmedia:sm-twitter_username]?]" title="' . $title . '"[?link-target= target="{[socialmedia:sm-default_link_target_profile]}"?][?link-rel= rel="{[socialmedia:sm-default_link_rel_profile]}"?]>@[?profile_username=[socialmedia:sm-twitter_username]?]</a>',
    'profile-button' => '<a href="//twitter.com/[?profile_username=[socialmedia:sm-twitter_username]?]" title="' . $title . '"[?link-target= target="{[socialmedia:sm-default_link_target_profile]}"?][?link-rel= rel="{[socialmedia:sm-default_link_rel_profile]}"?]><img src="[?icon-path=[socialmedia:sm-twitter_icon-path]?]" alt="Twitter icon" ></a>',
    'share-text-link' => '<a href="//twitter.com/share?url=[|[node:url]||[current-page:url]|]&text=[|[node:title]||[current-page:title-plain]|]" title="' . $stitle . '"[?link-target= target="{[socialmedia:sm-default_link_target_sharing]}"?][?link-rel= rel="{[socialmedia:sm-default_link_rel_sharing]}"?]>[?link-text=' . $stitle . '?]</a>',
    //'share-button' => '<a href="//twitter.com/share?url=[|[node:url]||[current-page:url]|]&text=[|[node:title]||[current-page:title-plain]|]" title="' . $stitle . '"[?link-target= target="{[socialmedia:sm-default_link_target_sharing]}"?][?link-rel= rel="{[socialmedia:sm-default_link_rel_sharing]}"?]><img src="[?icon-path=[socialmedia:sm-twitter_icon-path]?]" alt="Twitter icon" ></a>',
    'share-button' => '<a href="//twitter.com/share?url=[|[node:url]||[current-page:url]|]&text=[?message=[|[node:title]||[current-page:title-plain]|] [|[node:url]||[current-page:url]|] via @[socialmedia:sm-twitter_username]?]" title="' . $stitle . '"[?link-target= target="{[socialmedia:sm-default_link_target_sharing]}"?][?link-rel= rel="{[socialmedia:sm-default_link_rel_sharing]}"?]><img src="[?icon-path=[socialmedia:sm-twitter_icon-path]?]" alt="Twitter icon" ></a>',

  );

becomes this:

  $platforms['twitter'] = array(
    'label' => t('Twitter'),
    'group' => t('Social media: Twitter'),
  );
  $title = t("Visit !varusername on Twitter", array('!varusername' => '[?profile_username=[socialmedia:sm-twitter_username]?]'));
  $stitle = t("Tweet this");
  $platforms['twitter']['templates'] = array(
    'profile-url' => "[?profile_url=[socialmedia:sm-twitter_url]?]",
    'profile-text-link' => '<a href="//twitter.com/[?profile_username=[socialmedia:sm-twitter_username]?]" title="' . $title . '"[?link-target= target="{[socialmedia:sm-default_link_target_profile]}"?][?link-rel= rel="{[socialmedia:sm-default_link_rel_profile]}"?]>@[?profile_username=[socialmedia:sm-twitter_username]?]</a>',
    'profile-button' => '<a href="//twitter.com/[?profile_username=[socialmedia:sm-twitter_username]?]" title="' . $title . '"[?link-target= target="{[socialmedia:sm-default_link_target_profile]}"?][?link-rel= rel="{[socialmedia:sm-default_link_rel_profile]}"?]><img src="[?icon-path=[socialmedia:sm-twitter_icon-path]?]" alt="Twitter icon" ></a>',
    'share-text-link' => '<a href="//twitter.com/share?url=&text=[|[node:title]||[current-page:title-plain]|]" title="' . $stitle . '"[?link-target= target="{[socialmedia:sm-default_link_target_sharing]}"?][?link-rel= rel="{[socialmedia:sm-default_link_rel_sharing]}"?]>[?link-text=' . $stitle . '?]</a>',
    //'share-button' => '<a href="//twitter.com/share?url=[|[node:url]||[current-page:url]|]&text=[|[node:title]||[current-page:title-plain]|]" title="' . $stitle . '"[?link-target= target="{[socialmedia:sm-default_link_target_sharing]}"?][?link-rel= rel="{[socialmedia:sm-default_link_rel_sharing]}"?]><img src="[?icon-path=[socialmedia:sm-twitter_icon-path]?]" alt="Twitter icon" ></a>',
    'share-button' => '<a href="//twitter.com/share?url=&text=[?message=[|[node:title]||[current-page:title-plain]|] [|[node:url]||[current-page:url]|] via @[socialmedia:sm-twitter_username]?]" title="' . $stitle . '"[?link-target= target="{[socialmedia:sm-default_link_target_sharing]}"?][?link-rel= rel="{[socialmedia:sm-default_link_rel_sharing]}"?]><img src="[?icon-path=[socialmedia:sm-twitter_icon-path]?]" alt="Twitter icon" ></a>',

  );

Just removing the tokens [|[node:url]||[current-page:url]|].
I have not created a patch, as this is surely not the correct method to fix this issue, but this was done on a clients bequest. Thought i would update with my findings.

durata’s picture

Regarding the @@ in the twitter links, if you set up your profile for twitter to just pull the twitter username from the url, or don't include the @ in your username field, it will show up as a single @.

Doesn't fix the duplicate URLs however.