Is there a Google +1 Button Plugin?

Creating and modifying plugins.
Isotopp
Regular
Posts: 8
Joined: Wed Dec 05, 2007 11:58 am
Location: Berlin

Is there a Google +1 Button Plugin?

Post by Isotopp » Fri Jun 10, 2011 12:45 pm

Has anyone written a plugin for S9Y that adds a +1 button somewhere? Maybe as part of a generall Button-Pest plugin (serendipity_event_findmore)?
Last edited by Isotopp on Fri Jun 10, 2011 1:30 pm, edited 1 time in total.

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Is there a Google +1 Button Plugin?

Post by Timbalu » Fri Jun 10, 2011 1:23 pm

Hi

I dont think so ... but maybe its easy to include it into the serendipity_event_findmore plugin
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Is there a Google +1 Button Plugin?

Post by garvinhicking » Fri Jun 10, 2011 2:23 pm

Hi!

I just added spread.ly to findmore, and I'm quite sure that google +1 is as easy, if it follows similar embedding stile like facebook and spread.ly.

HOWEVER I'm too stupid to find the documentation on googles pages for how to embed the +1 thing. I only find information about how to use it with the google toolbar.

Any pointers? :)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

User avatar
onli
Regular
Posts: 2362
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Is there a Google +1 Button Plugin?

Post by onli » Fri Jun 10, 2011 2:45 pm

It's not nice because of the additional script-tags, but adding

Code: Select all

<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
<g:plusone href="{$entrydata.url|escape:url}"></g:plusone>
to the plugin-findmore.tpl could work. It should be easy enough to add the sript-tag via the plugin to the head and adding a google+1-option.
garvin: http://code.google.com/apis/+1button/

rocksteady72
Regular
Posts: 20
Joined: Mon Apr 18, 2011 8:53 am

Re: Is there a Google +1 Button Plugin?

Post by rocksteady72 » Fri Jun 10, 2011 10:42 pm

Hi all,

I just add following lines at the end to serendipity_event_findmore/plugin_findmore.tpl

Code: Select all

<iframe src="http://www.facebook.com/plugins/like.php?href={$entrydata.url|@escape:url}&layout=standard&show-faces=true&width=300&action=like&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:100%; height:60px"></iframe>
{/if}
<!-- Place this tag in your head or just before your close body tag -->
<script type="text/javascript" 
src="https://apis.google.com/js/plusone.js"></script>
<!-- Place this tag where you want the +1 button to render -->
<g:plusone></g:plusone>
</div>    
{/if}
Works well for me.
Benjamin

User avatar
seraphyn
Regular
Posts: 211
Joined: Fri Dec 01, 2006 8:42 am
Contact:

Re: Is there a Google +1 Button Plugin?

Post by seraphyn » Tue Jun 14, 2011 10:44 am

Okay,

today I would like to go to make the same thing.
Less work for me *g*
But there should a "no follow-me-option" like facebook-like.
This would be better for the german laws...

chris

User avatar
seraphyn
Regular
Posts: 211
Joined: Fri Dec 01, 2006 8:42 am
Contact:

Re: Is there a Google +1 Button Plugin?

Post by seraphyn » Wed Jun 15, 2011 10:12 am

Ich denke da wäre der kleine Plusone-Button eher angebracht.
http://www.google.com/webmasters/+1/button/
Jener würde sich besser in das findmore_plugin einpassen...
Ist denn im Moment Jemand daran, oder kann man sich darauf stürzen?
Chris

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Is there a Google +1 Button Plugin?

Post by Timbalu » Wed Jun 15, 2011 10:39 am

Hi

Look into berlios SVN and see what Garvin added for spread.ly to findmore just by diff. This should be very easy to adapt to 1+. Make your private changes - see if it works a while, then return back and send a diff to Garvin to update findmore.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

User avatar
seraphyn
Regular
Posts: 211
Joined: Fri Dec 01, 2006 8:42 am
Contact:

Re: Is there a Google +1 Button Plugin?

Post by seraphyn » Wed Jun 15, 2011 10:44 am

Sorry for the last posting.
Sometimes...
Tested it, but I got one thing to stop, how could I tell the findmore_plugin to put the script in the head-section of the theme?
Chris

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Is there a Google +1 Button Plugin?

Post by Timbalu » Wed Jun 15, 2011 11:16 am

You can't!
As far as I see this is impossible, since some of these "like scripts" generate images/iframes/trackbacks, which can't be used in the html head section.
In case of just generating a button image, you can use the plugins image folder to store a previously generated one and just do some normal <a href=""><img src="" /></a> in the findmore.tpl, right?!
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

User avatar
seraphyn
Regular
Posts: 211
Joined: Fri Dec 01, 2006 8:42 am
Contact:

Re: Is there a Google +1 Button Plugin?

Post by seraphyn » Wed Jun 15, 2011 11:41 am

I've look at serendipity_event_head_nugget this should normally work too.
So I try to understand the code there and use it in the findmore_plugin.
Chris

User avatar
seraphyn
Regular
Posts: 211
Joined: Fri Dec 01, 2006 8:42 am
Contact:

Re: Is there a Google +1 Button Plugin?

Post by seraphyn » Wed Jul 06, 2011 9:56 am

Have had a look, but do not find really the Code for the nugget, does someone?
Chris

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Is there a Google +1 Button Plugin?

Post by garvinhicking » Wed Jul 06, 2011 10:45 am

seraphyn wrote:Have had a look, but do not find really the Code for the nugget, does someone?
Chris
For that to work, the plugin would need to listen to one more event hook (frontend_header) to output things there...
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

User avatar
seraphyn
Regular
Posts: 211
Joined: Fri Dec 01, 2006 8:42 am
Contact:

Re: Is there a Google +1 Button Plugin?

Post by seraphyn » Wed Jul 06, 2011 11:19 am

Narf,

seems I'm too lame for this :)
Or today is not really my day, choose the right one ;)
Tried to hack something, withtou having the script inside the module, means put it by myself in the header.
Of course, it won't use the URL of the entry, but I used the right variables for that.
Could it be, that google+ only use the FQDN of the blog instead of the entry URL?
Chris

User avatar
seraphyn
Regular
Posts: 211
Joined: Fri Dec 01, 2006 8:42 am
Contact:

Re: Is there a Google +1 Button Plugin?

Post by seraphyn » Thu Jul 14, 2011 3:52 pm

onli wrote:<g:plusone href="{$entrydata.url|escape:url}"></g:plusone>[/code]
This seems only to work in extended entries not in small entries.
Looks like the whole Domain is just taken.
Is there a way to have it for not extended enrtries too?
Chris

Post Reply