Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: unformatted_ on December 29, 2010, 04:54:35 PM

Title: Sharethis.com on my forum please
Post by: unformatted_ on December 29, 2010, 04:54:35 PM
Hi!

I'm trying to integrate sharethis.com buttons on posts.
But When I add the code on display.template.php gives error because the ' on the code
This is the 2 blocks of code
<span class="st_twitter_vcount" displayText="Tweet"></span><span class="st_facebook_vcount" displayText="Share"></span><span class="st_email_vcount" displayText="Email"></span><span class="st_sharethis_vcount" displayText="Share"></span>

<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script><script type="text/javascript">stLight.options({publisher:'513fc4bd-50e9-4a6a-9b2d-ae48ce6eeb71'});</script>

As you can see the ' between the publisher code will give error on smf

You can try here: http://secure.sharethis.com/publishers/get-button-code?style=9

Any ideia how to use sharethis on smf forum?
Title: Re: Sharethis.com on my forum please
Post by: IchBin™ on December 29, 2010, 05:08:11 PM
All you should have to do is escape the extra single quotes with a backslash.

<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script><script type="text/javascript">stLight.options({publisher:\'513fc4bd-50e9-4a6a-9b2d-ae48ce6eeb71\'});</script>
Title: Re: Sharethis.com on my forum please
Post by: unformatted_ on December 29, 2010, 08:11:03 PM
Thanks a lot! Works nice!

But now, when I'm trying to share with tweet have this error:
sharethiscom Invalid Unicode value in one or more parameter
When sharing with facebook button do not finishing share
The forum use portuguese language.

thanks
Title: Re: Sharethis.com on my forum please
Post by: IchBin™ on December 29, 2010, 08:14:19 PM
I'm assuming that is a sharethiscom error, and not an SMF error.
Title: Re: Sharethis.com on my forum please
Post by: unformatted_ on December 30, 2010, 08:43:56 AM
I think I have to convert to utf-8.

I tried changing the language to Portuguese-utf8 and it works well the tweet button facebook. But many characters in the thread subject and posts is like this: �
So then I tried to convert the entire forumto UTF-8 in the administration, but after a few minutes gives the error Internal Server Error.
Do you think I should converte to utf-8 and there is another way to do that without giving the error?
Attached a print screen of my tables. Where is latin1_swedish_ci should be utf-8?
Can I delete backup tables to save space?
Title: Re: Sharethis.com on my forum please
Post by: unformatted_ on December 30, 2010, 05:11:33 PM
After I trying to convert to UTf-8 now the board names and name of the members breaks the word on the special character...how can I solve this? If I convert will be all ok? Please help me!
Title: Re: Sharethis.com on my forum please
Post by: unformatted_ on January 01, 2011, 03:51:18 PM
Please I really need help to convert my forum to UTF-8.
I can pay for this work.
Title: Re: Sharethis.com on my forum please
Post by: unformatted_ on January 02, 2011, 05:43:06 AM
Please someone can help? I can't convert my forum to utf-8...
Title: Re: Sharethis.com on my forum please
Post by: IchBin™ on January 02, 2011, 11:25:03 PM
If you get an internal server error, there is something going wrong on your server. You need to look at the server log, nothing we can do here unless you can tell us what the log says. Even then, it's likely that the host will have to help you with this.
Title: Re: Sharethis.com on my forum please
Post by: unformatted_ on January 03, 2011, 06:47:34 PM
I really cant convert the forum from ISO 8859 - 1 to UTF-8
I don't no want I can do right now...
I tryed to remove search index (400mb) clean all the errors. When I try to convert after few minutes I have a 500 Internal Server Error again and again...
In my reply#4 I have a pic with my DB. Can I delete the tables with backup_ prefix? Maybe without this tables (hundreds of MB) can I convert.
And about pretty urls cache with 1,4GB? Has some influence on the conversion? if I delete help the conversion process? If I create a new index the urls will be the same so as not to leave broken links that are already indexed by google?

Title: Re: Sharethis.com on my forum please
Post by: IchBin™ on January 03, 2011, 06:49:37 PM
I've told you where to begin. But you seem to have ignored that. I have no idea about all your setup. The backup tables can be removed if you have successfully upgraded and have been running for a while.
Title: Re: Sharethis.com on my forum please
Post by: chedie on January 30, 2011, 04:58:44 AM
Hi everyone!

I was able to successfully integrate the ShareThis code into my forum. It works fine except for the Facebook button.  I can't seem to share anything with it. This error always comes out using Facebook button:

An Error Has Occurred!

You may test this button on this thread:
http://winglicans.com/index.php?topic=2158.0 (http://winglicans.com/index.php?topic=2158.0)

I hope somebody can provide answers of this. It sucks if this doesn't work :(