Hi,

I have set up Twitter, facebook and Google+ counter buttons as shown on the first attachment and on that widgets/sets/edit page they all show up OK. However if I go to a node that is configured to show them then I only see Facebook and Google+ as shown on the second attachment.

It seems that actually the code is not being generated - here's what output in links:

<div class="links">
  <ul class="links inline">
      <li class="socialmedia_share-default first"><span>
        <div id="widgets-element-socialmedia_share-default" class="widgets widgets-set widgets-set-horizontal widgets-style-horizontal">
          <div id="widgets-element-socialmedia_addthis-facebook-like" class="widgets widgets-element widgets-element-horizontal widgets-style-horizontal"><a class="addthis_button_facebook_like at300b" fb:like:layout="button_count" title="Facebook_like" href="#"><iframe style="overflow: hidden; border: 0px none; width: 90px; height: 25px; " src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fidris.test.ac.uk%2Fd7test5%2Fnode%2F100&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;font=arial&amp;layout=button_count"></iframe></a>
          </div>
          <div id="widgets-element-socialmedia_addthis-google-plusone" class="widgets widgets-element widgets-element-horizontal widgets-style-horizontal"><a class="addthis_button_google_plusone at300b" g:plusone:size="standard" title="Google_plusone" href="#"><div style="height: 24px; width: 106px; display: inline-block; text-indent: 0px; margin: 0px; padding: 0px; background-color: transparent; border-style: none; float: none; line-height: normal; font-size: 1px; vertical-align: baseline; background-position: initial initial; background-repeat: initial initial; " id="___plusone_0"><iframe allowtransparency="true" frameborder="0" hspace="0" marginheight="0" marginwidth="0" scrolling="no" style="position: static; top: 0px; width: 106px; margin: 0px; border-style: none; left: 0px; visibility: visible; height: 24px; " tabindex="0" vspace="0" width="100%" id="I0_1348571429930" name="I0_1348571429930" src="https://plusone.google.com/_/+1/fastbutton?size=standard&amp;callback=_at_plusonecallback&amp;hl=en-US&amp;origin=http%3A%2F%2Fidris.test.ac.uk&amp;url=http%3A%2F%2Fidris.test.ac.uk%2Fd7test5%2Fnode%2F100&amp;ic=1&amp;jsh=m%3B%2F_%2Fapps-static%2F_%2Fjs%2Fgapi%2F__features__%2Frt%3Dj%2Fver%3DSjyRYw7b8zM.en_GB.%2Fsv%3D1%2Fam%3D!9Ag6gGPKM9qYppXIMg%2Fd%3D1%2Frs%3DAItRSTNw9TlZfRK2wsjtzAeBbaKvgZ8AJg#_methods=onPlusOne%2C_ready%2C_close%2C_open%2C_resizeMe%2C_renderstart%2Concircled&amp;id=I0_1348571429930&amp;parent=http%3A%2F%2Fidris.test.ac.uk" title="+1"></iframe></div></a></div><div class="widgets-clear">
          </div>
        </div>
        <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#username="></script></span>
      </li>
      <li class="social_media last"><span>
        <div class="fb-like" data-send="false" data-layout="button_count" data-width="450" data-show-faces="false">
        </div></span>
      </li>
  </ul>
</div>

Is there something obvious i'm doing wrong?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jinky32’s picture

Sorry to bump this but does anyone have any ideas?

Brizzle’s picture

Experiencing the same issue with Twitter. Any ideas?

segi’s picture

I have same issue, twitter icon not appears.

tjerkdekuijper’s picture

Exactly the same issue for me.
version: 7.x-1.0-beta13
drupal: 7.15

Arganox’s picture

All,

Is there any news on this issue?
I'm having the same problem as described above.

hvalentim’s picture

Same here. Is it perhaps related with a conflict having the Twitter module installed?

Marcus Aurelius’s picture

Same here!

zcrow’s picture

Using the old, commented out code at line 279 in socialmedia.widgets.inc instead of the code at line 280 fixed it for me.

KarinW’s picture

I am having both the facebook button and the tweet share button not showing. Also the widgets for facebook and twitter with the countbox do not work. Is there any solution yet? (@zcrow which old code do yu mean? I installed for the first time).

renderfreak’s picture

Same issue, but only when i'm logged in as a user (thankfully)...

reptilex’s picture

I downloaded the latest stable yesterday and had this issue too, but on top facebook was not showing up either so I exchanged it with the old stuff and it worked, something is broken in the latest stable.

To show the icons you have to go into the code

at line 128 you have to exchange the platforms[facebook][templates] variable with:

$platforms['facebook']['templates'] = array(
      'profile-url' => "[?profile_url=[socialmedia:sm-facebook_url]?]",
      'profile-text-link' => '<a href="[?profile_url=[socialmedia:sm-facebook_url]?]" title="' . $title . '"[?link-target= target="{[socialmedia:sm-default_link_target_profile]}"?][?link-rel= rel="{[socialmedia:sm-default_link_rel_profile]}"?]>[?profile_username=[socialmedia:sm-facebook_username]?]</a>',
      'profile-button' => '<a href="[?profile_url=[socialmedia:sm-facebook_url]?]" 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-facebook_icon-path]?]" alt="Facebook icon"></a>',
      'share-text-link' => '<a href="http://www.facebook.com/sharer.php?u=[|[node:url]||[current-page:url]|]&t=[|[node:title]||[current-page:title-plain]|]" title="[?link-text=Share on Facebook?]"[?link-target= target="{[socialmedia:sm-default_link_target_sharing]}"?][?link-rel= rel="{[socialmedia:sm-default_link_rel_sharing]}"?]>[?link-text=' . $title . '?]</a>',
      'share-button' => '<a href="http://www.facebook.com/sharer.php?u=[|[node:url]||[current-page:url]|]&t=[|[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-facebook_icon-path]?]" alt="Facebook icon" ></a>',
  );

and at line 211 I uncommented the comment and comented the new line below:

$platforms['pinterest']['templates'] = array(
    'profile-url' => "[?profile_url=[socialmedia:sm-pinterest_url]?]",
    'profile-text-link' => '<a href="[?profile_url=[socialmedia:sm-pinterest_url]?]" title="' . $title . '"[?link-target= target="{[socialmedia:sm-default_link_target_profile]}"?][?link-rel= rel="{[socialmedia:sm-default_link_rel_profile]}"?]>[?profile_username=[socialmedia:sm-pinterest_username]?]</a>',
    'profile-button' => '<a href="[?profile_url=[socialmedia:sm-pinterest_url]?]" 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-pinterest_icon-path]?]" alt="Pinterest icon" ></a>',
    //'share-text-link' => '<a href="http://pinterest.com/pin/create/button/?url=[|[node:url]||[current-page:url]|]&media=[|[node:title]||[current-page:title-plain]|]" title="[?link-text=Pin It?]"[?link-target= target="{[socialmedia:sm-default_link_target_sharing]}"?][?link-rel= rel="{[socialmedia:sm-default_link_rel_sharing]}"?]>[?link-text=Pin It?]</a>',
    'share-button' => '<a href="javascript:void((function()%7Bvar%20e=document.createElement(&apos;script&apos;);e.setAttribute(&apos;type&apos;,&apos;text/javascript&apos;);e.setAttribute(&apos;charset&apos;,&apos;UTF-8&apos;);e.setAttribute(&apos;src&apos;,&apos;http://assets.pinterest.com/js/pinmarklet.js?r=&apos;+Math.random()*99999999);document.body.appendChild(e)%7D)());" title="[?link-text=' . $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-pinterest_icon-path]?]" alt="Pinterest icon" ></a>',
  ); 

Now the icons show, but I haven't yet tested whether all the share links work.

broon’s picture

For a project I experienced a similar error. The project has both a Twitter and a LinkedIn account but no Facebook page. The profile buttons showed up correctly (Twitter & LinkedIn), however the client requested that nodes may also be shared with Facebook. But the facebook button never showed up.

After entering my own facebook profile in the settings it suddenly worked and facebook share button showed up. So I assume there's some unnecessary connection or dependency between existing profiles and the share functionality.

etibmw’s picture

Status: Active » Needs work

Thank you Paul.B, You are right.
Only by adding the profiles for facebook and tweeter they will show up in the share.
Strange but true..

mikel1’s picture

Same problem. Adding profiles for Twitter makes button appear but it now shares on the profile account instead of the user's account, so still broken.

ailgm’s picture

The organization my site is for has a Facebook page, but no Twitter account. Users will not be able to sign in, so I want to:

  • list only the Facebook page of the organization and RSS in the profile widget,
  • list several platforms in the share widget so that visitors can share the content using their accounts.

When I initially had Twitter selected as one of the site platforms, I had the same problem of the Twitter icon not appearing on the share widget (except on the widget admin page). After I removed it as a site platform, the icon still doesn't show up in the share widget AND this error is shown (twice) on admin pages:
Notice: Undefined index: username in socialmedia_twitter_tokens() (line 612 of .../sites/all/modules/socialmedia/socialmedia.platforms.inc).

(I'm using the dev version of the module)

Help would be appreciated.

Clonefall’s picture

I'm having this same issue, missing Twitter button and I get this error:

Notice: Undefined index: username in socialmedia_twitter_tokens() (line 612 of /homepages/11/d502611008/htdocs/drupal7/sites/all/modules/socialmedia/socialmedia.platforms.inc).
Notice: Undefined index: username in socialmedia_twitter_tokens() (line 612 of /homepages/11/d502611008/htdocs/drupal7/sites/all/modules/socialmedia/socialmedia.platforms.inc).

joegl’s picture

I had to get the Twitter share button working without a Twitter profile setup. Apparently the icon does not show for logged in users unless a Twitter profile is set (in the profile settings for the module). Same goes for Facebook/Pinterest (maybe others).

I can confirm that going into the socialmedia.widgets.inc file, finding the $platforms array for your widget, and then swapping to lines of commented code works. For me it was uncommenting line 279 and commenting out 280 instead.

Cheers!

Code included below (couldn't use the PHP tags because of formatting issues with the code):

Before

//'share-button' => '<a href="http://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="http://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>',

After

'share-button' => '<a href="http://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="http://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>',