Extension, Plugin

Archived
Forum
(read-only)

EE ShareThis

ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From Protean Web

     

php errors

General

DesigningIT
DesigningIT

Hi,

I installed the extension and put the following code inside my channel entry’s tag on a multiple entry page.

{exp:sharethis:button services=“sharethis|facebook|twitter” title=“My page” url=“www.google.com”}

I didnt do anything in the settings and only included the line above. Is there anything else that I need to do? does this work on an entry listings page?

I am on EE2.3.1

Severity: Warning

Message: Invalid argument supplied for foreach()

Filename: sharethis/ext.sharethis.php

Line Number: 115
A PHP Error was encountered

Severity: Notice

Message: Undefined index: display

Filename: sharethis/pi.sharethis.php

Line Number: 162
A PHP Error was encountered

Severity: Notice

Message: Undefined index: services

Filename: sharethis/pi.sharethis.php

Line Number: 164
A PHP Error was encountered

Severity: Notice

Message: Undefined index: content

Filename: sharethis/pi.sharethis.php

Line Number: 217
A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home2/..../public_html/ee/codeigniter/system/core/Exceptions.php:170)

Filename: core/Common.php

Line Number: 405

jayalfredprufrock
# 1
Developer
jayalfredprufrock

Hello, I’m sorry you’re having problems with the plugin. That tag snippet should work just fine within channel listing tags. There must be something else going on. Have you gone to the extensions settings page for ShareThis and saved the global settings yet?

DesigningIT
# 2
DesigningIT

hi, I went into the settings and hit save .. now I am down to 1 php error .. Is there anything in the settings that is required for me to set prior to using this? maybe the ‘share this license key’ or something?


A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home2//public_html/ee/expressionengine/third_party/sharethis/pi.sharethis.php:213)

Filename: core/Common.php

Line Number: 405

jayalfredprufrock
# 3
Developer
jayalfredprufrock

This is in fact a bug that occurs when you don’t include the separate sharethis:js tag in your header. Thanks for bringing it to my attention, I have fixed the issue in the next build, which you can download now. Please let me know if you find any other problems. Thanks!

DesigningIT
# 4
DesigningIT

now i get this .
Fatal error: Cannot redeclare class Sharethis_ext in /home2/dfadf/public_html/ee/expressionengine/third_party/sharethis/language/english/sharethis_lang.php on line 11

jayalfredprufrock
# 5
Developer
jayalfredprufrock

Ahhh this is embarrassing!  That’s what I get for rolling out a fix without proper testing. Please re download the file in a couple of minutes. I’m not going to change the version number this time.

jayalfredprufrock
# 6
Developer
jayalfredprufrock

New download is ready. Again, I’m sorry for all the confusion.

DesigningIT
# 7
DesigningIT

thank you for fixing this.

quick implementation question.

I am using this code snipped: {exp:sharethis:button services=“facebook|twitter” title=“My page” url=“http://google.com” after=”
”}

it only creates the green share this icon, but i dont want that, I want facebook/twitter. ? Do i have to do stuff in the settings or would that work out of the box?

jayalfredprufrock
# 8
Developer
jayalfredprufrock

That is exactly what that snippet should do…so I’m guessing this issue is also related to the automatic loading of the javascript. If you would, include the {exp:sharethis:js} tag within your <head> section, and let me know if that solves your problem. Tomorrow, I’ll have to do some more testing to see if I can’t get the auto-load javascript functionality working correctly. That was kind of a last-minute feature that was added for users that really only wanted a single button in one place. Since you are outputting more than one button, you should probably be including the javascript within your <head> section anyways. If you have already included that js tag within your <head>, then I’ll have to dig deeper to figure out what’s going on, because the tag you posted works as expected on my testing server. Also, have you created an account with ShareThis and received an API key? This shouldn’t prevent the buttons from outputting, but I’m just trying to think of anything that might be different for you from my testing environment. Again, thank you for working with me on this, I want to get you up and running just as soon as I can.

DesigningIT
# 9
DesigningIT

I put the tag in the header, but still the same result. anything else i can do ?

jayalfredprufrock
# 10
Developer
jayalfredprufrock

I’ll be happy to take a look at your site if that’s possible. For now,  just do a “View Source” on the rendered page so I can see what javascript/html is being produced. You can email it to me at jayalfredprufrock at gmail . With that, I should be able to identify what is going on much more quickly. Take care,

Andrew

jayalfredprufrock
# 11
Developer
jayalfredprufrock

For anybody having the above problem, the plugin wasn’t picking up the tag parameters because those special “curly” quotes were being used instead of traditional quotes, thus it was as if no parameters were being passed to the tag at all. This is a good thing to keep in mind if any EE Add-On doesn’t seem to be responding to parameters!