Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter designwrench

    (@designwrench)

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

    <li>
        <a class="crafty-social-button csb-stumbleupon" <br="">
            href=”http://www.stumbleupon.com/submit?url=h…
            <img<br>
                title=”StumbleUpon”
                <br></br>
                alt=”StumbleUpon”
                <br></br>
    	    src=”http://www.davinapallone.com/wp-content…
                <span class="crafty-social-share-count"> … </span>
            </img<br>
        </a>
    </li>
    Thread Starter designwrench

    (@designwrench)

    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”
    alt=”Facebook”
    src=”http://www.davinapallone.com/wp-content/plugins/crafty-social-buttons/buttons/somacro/facebook.png” />

    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() . '"
    			href="http://www.digg.com/submit?'
    			. '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 =)

    buttonImage:

    $imageUrl = $this->imagePath . trim(strtolower($this->service)) . $this->imageExtension;
    		return '<img
    				   title="'.$this->service.'"
    					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!

    Plugin Author Sarah

    (@shen045)

    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.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘share buttons not formatted correctly’ is closed to new replies.