Crafty Social Buttons
[resolved] share buttons not formatted correctly (5 posts)

  1. designwrench
    Posted 1 year ago #

    My link buttons work fine, but the share buttons are losing some HTML formatting somehow, and spitting code out instead of images:

    I love the simplicity of this plugin. Help?


  2. designwrench
    Posted 1 year ago #

    For instance, this is the code that is generated, which is, of course, very odd and broken:

        <a class="crafty-social-button csb-stumbleupon" <br="">
                <span class="crafty-social-share-count"> … </span>
  3. designwrench
    Posted 1 year ago #

    This is the code that shows on my posts instead of icons. I'm pasting it here because I want to remove the error from my live site.

    href=”http://www.facebook.com/sharer.php?u=http://www.davinapallone.com/” target=”_blank”> title=”Facebook”
    src=”http://www.davinapallone.com/wp-content/plugins/crafty-social-buttons/buttons/somacro/facebook.png” />
  4. karizmuh
    Posted 1 year ago #

    Hello, I've encounter the same issue as designwrech, though it didn't show up for myself until after I turned on the filter for wpautop. Anyway, I've tracked it down to all files in the services directory.

    Basically, the shareButton, linkButton, and buttonImage have hard returns in the html, and when parsed, they show up as br tags where the hard returns are.

    Here's an illustration for anyone interested. I'm going to use the offending code from file class-SH_Digg.php, it's the same for all files though with the exception of class-SH_Social_Service.php

    (shareButton for Digg):

    $html = '<a class="' . $this->cssClass() . '"
    			. 'url='. $url. '" '
    			. ($this->newWindow ? 'target="_blank"' : '') . '>';

    Should look like this instead.

    $html = '<a class="' . $this->cssClass() . '" href="http://www.digg.com/submit?' . 'url='. $url. '" ' . ($this->newWindow ? 'target="_blank"' : '') . '>';
    $html .= $this->buttonImage();
    $html .= '</a>';

    (linkButton for Digg):

    $html = '<a class="' . $this->cssClass() . '"
    			href="'. $url. '" ' .
    			($this->newWindow ? 'target="_blank"' : '') . '>';

    Should look like this instead.

    $url = "http://www.digg.com/$username";
    $html = '<a class="' . $this->cssClass() . '" href="'. $url. '" ' . ($this->newWindow ? 'target="_blank"' : '') . '>';
    $html .= $this->buttonImage();
    $html .= '</a>';

    And finally, in file class-SH_Social_Service.php - funny name for the file =)


    $imageUrl = $this->imagePath . trim(strtolower($this->service)) . $this->imageExtension;
    		return '<img
    					alt="'.$this->service. '"
    					src="' . $imageUrl .'" />';

    Should look like this:

    $imageUrl = $this->imagePath . trim(strtolower($this->service)) . $this->imageExtension;
    return '<img title="'.$this->service.'" alt="'.$this->service. '" src="' . $imageUrl .'" />';

    Anyway, that's pretty much it. Hope it helps for those who need a quick fix until one can be made from the author.

    Thanks for the plugin, keep up the good work!

  5. Sarah Henderson
    Plugin Author

    Posted 1 year ago #

    Thanks for debugging this - I have removed all the extra spacing in the files in the next release (1.0.7) so this problem shouldn't happen again. Please let me know if it does.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Crafty Social Buttons
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.