Hi,
I use EE since a while and wanted to integrate some syndication links for every post lately. After looking through the plugin list I wasn’t very satisfied with the solutions. Luckely I just stumbled over a post from Alex King who just coded a plugin for WordPress called “Share This”, which I found very helpful. So I just had a look at that code and wrote a plugin for EE, which you can find working here at my personal blog. It’s almost done, but I still have some difficulties with one feature I would like to implement. That’s why there is no download there yet. I would like to to have an email this link feature, but I don’t have a clue how to best integrate that into EE. It would be easy to write just a little helper script that get’s an ajax request and sends the email, but this would be a dirty hack and I would like to have it integrated into EE nicely. So the question is, is this possible with a plugin or do I need to create a extension? Any ideas and thoughts are welcome..
/lars
I’m intrigued by this but I’ve received an error message when using the entry id
{exp:share_this entry_id="{entry_id}"}
shows me this message when I try to render the page:
MySQL ERROR:
Error Number: 1064
Description: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '}' at line 3
Query: SELECT title FROM `exp_weblog_titles` WHERE entry_id = {entry_id}
When I take out the entry_id from the tag then I do get a link on the page but nothing happens when I click on the link. Here’s a test page that I had:
<html>
<head>
<link href="/css/share_this.css" rel="stylesheet" type="text/css">
</script>
</head>
<body>
{exp:share_this entry_id="{entry_id}"}
</body>
</html>
I double checked that the JS and CSS files were accessible to the page.
EDIT: the forum is filtering out and not displaying the JS file in the above code but I do have that in my actual template.
Dear Rob Q,
the share_this tag must be placed within the weblog:entries tag in the templates. So your code should look like this:
<html>
<head>
<link href="/css/share_this.css" rel="stylesheet" type="text/css">
</script>
</head>
<body>
{exp:weblog:entries weblog="" .... }
your other stuff...
{exp:share_this entry_id="{entry_id}"}
{/exp:weblog:entries}
</body>
</html>
I added this to the documentation and added a warn message to the plugin, if entry_id isn’t set correctly.
/lars
Hmmm. I updated to the most recent version. It’s giving me this message: The Tag must be included within the ‘{weblog}’ tag - even though I have it now included in the weblog tag.
And when I use the entry id tag I get this message still:
MySQL ERROR:
Error Number: 1054
Description: Unknown column 'field_id_2' in 'field list'
Query: SELECT field_id_2 FROM `exp_weblog_data` WHERE entry_id = 24
This is the EE code for what I had in the template:
</head>
<body>
{exp:weblog:entries weblog="blog" }
{exp:share_this entry_id="{entry_id}"}
{/exp:weblog:entries}
</body>
</html>
The entry_id is required. This is why you got the error message even as you put the tag within the weblog:entries tag.
Did you change your input fields? Do you have custom input fields. As I thought the field_id_2 is used for the bodytext of the standard installation. Did you modify this? Other question what is your weblog_data table called? Did you use another prefix for tables?
Is there a global constant for the table prefix that could be used. I had a brief look at the code in the core file , but didn’t found any?
/lars
I cannot get this plugin to work at all. I uploaded the javascript and made sure it is being called properly. I have the stylesheet uploaded and called properly.
This is the code I am using (and it is in a {exp:weblog:entries} tag)
{exp:share_this entry_id="{entry_id}" title="Title"
url="{title_permalink=cdreviews/comments}" orientation="top" bodytext="This is an article about yada yada yada..."}
{/exp:share_this}
I am calling it on a comments page. Is this correct?
When I mouse over the Share This link it disappears. When I finally click it, nothing happens.
Firefox reports this error when clicked on: $ is not defined [Break on this error] var form = $(‘share_this_form’);
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.