Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Google +1 Button Addon request

Asked Modified Viewed 5,230 times
A
aitmelloul
A
  • Junior Member, joined since
  • Contributed 36 posts on the community forums.
  • Started 10 threads in the forums
  • Started this discussions
asked
Junior Member

Hello Guys !

I wonder if anyone can make an infusion or a panel that allows users to take benefits from the +1 Service lately launched by Google !

It says in Google Website that this service " helps the site stand out "

Thanks in advance.
0 replies

14 posts

C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
answered
Fusioneer

I will do that soon please be patient.
0 replies
A
aitmelloul
A
  • Junior Member, joined since
  • Contributed 36 posts on the community forums.
  • Started 10 threads in the forums
  • Started this discussions
answered
Junior Member

Thanks Craig :)
0 replies
M
miskith
M
My projects:
PHP-Fusion Czech | miskith portfolio | theConnex (In preparation) | Online game (Future project)
  • Member, joined since
  • Contributed 117 posts on the community forums.
  • Started 2 threads in the forums
answered
Member

How do you want it to look? Here you have a simple HTML valid panel.
add_to_head("<script type='text/javascript' src='https://apis.google.com/js/plusone.js'></script>");

openside("Google +1");
  echo "<div class='g-plusone'></div>";
closeside();
0 replies
H
HobbyMan
H
Just some Guy
  • Veteran Member, joined since
  • Contributed 1,486 posts on the community forums.
  • Started 91 threads in the forums
answered
Veteran Member

Or...

openside("Google +1");
  echo "<center>\n<g:plusone size='medium'></g:plusone>\n</center>\n";
closeside();
add_to_footer("<script type='text/javascript' src='https://apis.google.com/js/plusone.js'></script>");


Sizes: "small", "medium" or "standard"

If you just want the button on its own don't use openside/closeside
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
answered
Fusioneer

M
miskith
M
My projects:
PHP-Fusion Czech | miskith portfolio | theConnex (In preparation) | Online game (Future project)
  • Member, joined since
  • Contributed 117 posts on the community forums.
  • Started 2 threads in the forums
answered
Member

Quote

Philip wrote:

Or...

openside("Google +1");
  echo "<center>\n<g:plusone size='medium'></g:plusone>\n</center>\n";
closeside();
add_to_footer("<script type='text/javascript' src='https://apis.google.com/js/plusone.js'></script>");


Sizes: "small", "medium" or "standard"

If you just want the button on its own don't use openside/closeside

Yes, but your script isn't valid and contains no-sematic tag <center>.
0 replies
W
Wanabo
W
Wanabo 10
www.probemyip.com/probe-my-ip-80x15.png
pHp-Fusion.Asia & pHp-Fusion.Fr & pHp-Fusion.Cn are available for a localized support community. Send PB for info.
  • Senior Member, joined since
  • Contributed 598 posts on the community forums.
  • Started 94 threads in the forums
answered
Senior Member

In themes\templates\footer.php add this line (or use philips suggestion to use add_to_footer in your panel)

[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]echo "<script type='text/javascript' src='https://apis.google.com/js/plusone.js'>{lang: 'nl'}</script>\n";
echo "</body>\n</html>\n";
[/syntaxhighlighter]
Change {lang: 'nl'} to your language or leave empty for default English.

Add a google +1 button in every post:
Open up forum\viewthread.php
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false] echo "<div style='float:right' class='small'>";
echo "<a href='#top'><img src='".get_image("up"wink."' alt='".$locale['541']."' title='".$locale['542']."' style='border:0;vertical-align:middle' /></a>\n";
echo "&nbsp;<a href='#post_".$data['post_id']."' name='post_".$data['post_id']."' id='post_".$data['post_id']."'>#".($current_row+$_GET['rowstart'])."</a>";
echo "&nbsp;<a href='".BASEDIR."print.php?type=F&amp;thread=".$_GET['thread_id']."&amp;post=".$data['post_id']."&amp;nr=".($current_row+$_GET['rowstart'])."'><img src='".get_image("printer"wink."' alt='".$locale['519a']."' title='".$locale['519a']."' style='border:0;vertical-align:middle' /></a></div>\n";
echo "<div style='float:right' class='small'><g:plusone size='small'></g:plusone></div>\n";
echo "<div class='small'>".$locale['505'].showdate("forumdate", $data['post_datestamp'])."</div>\n";
echo "</td>\n";
echo "</tr>\n<tr>\n<td valign='top' class='tbl2 forum_thread_user_info' style='width:140px'>\n";
if ($data['user_avatar'] && file_exists(IMAGES."avatars/".$data['user_avatar']) && $data['user_status']!=6 && $data['user_status']!=5) {
echo "<center><a href='".BASEDIR."profile.php?lookup=".$data['user_id']."' title='".$data['user_name']."'><img src='".IMAGES."avatars/".$data['user_avatar']."' alt='".$locale['567']." ".$data['user_name']."' style='border:0;' /></a></center><br /><br />\n";
} else {
[/syntaxhighlighter]
Add the g:plusone buttuon as in the example above.

Live demo: Ziggo Gebruikers Groep.
All posts have this button, and on the front page I have put a +1 button in the latest active forum threads panel.
Don't forget to +1
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
answered
Fusioneer

This will also be included in Share This v4 when I get around to finishing it off. :)
0 replies
M
MarcusG
M
Ex Senior Dev.
  • Member, joined since
  • Contributed 182 posts on the community forums.
  • Started 5 threads in the forums
answered
Member

@Wanabo: This only works for the whole thread, right?

If you click +1 on one post and reload the page, all posts are set to +1.
0 replies
A
Ankur
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
answered
Veteran Member

Or if you don't want your Content to go XHTML INVALID, then you can use this :
<head>
<script type="text/javascript" src="https://apis.google.com/js/plusone.js">
{"parsetags": "explicit"}
</script>
<script type="text/javascript">
gapi.plusone.render("plusone-div", {"size": "tall", "count": "true"});
</script>
</head>
<body>
<div id="plusone-div"></div>
</body>
0 replies
M
miskith
M
My projects:
PHP-Fusion Czech | miskith portfolio | theConnex (In preparation) | Online game (Future project)
  • Member, joined since
  • Contributed 117 posts on the community forums.
  • Started 2 threads in the forums
answered
Member

Quote

MarcusG wrote:

@Wanabo: This only works for the whole thread, right?

If you click +1 on one post and reload the page, all posts are set to +1.

When you click on the "+1" button, the URL at which you are gets +1 point.
0 replies
M
MarcusG
M
Ex Senior Dev.
  • Member, joined since
  • Contributed 182 posts on the community forums.
  • Started 5 threads in the forums
answered
Member

Thanks.
0 replies
W
Wanabo
W
Wanabo 10
www.probemyip.com/probe-my-ip-80x15.png
pHp-Fusion.Asia & pHp-Fusion.Fr & pHp-Fusion.Cn are available for a localized support community. Send PB for info.
  • Senior Member, joined since
  • Contributed 598 posts on the community forums.
  • Started 94 threads in the forums
answered
Senior Member

Quote

MarcusG wrote:

@Wanabo: This only works for the whole thread, right?

If you click +1 on one post and reload the page, all posts are set to +1.


Yes, I think so and I didn't realize that.

It is possible to use a href function within the +1. I'll experiment with the post number url. That way it will +1 a specific post.
0 replies
A
Ankur
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
answered
Veteran Member

Quote

wanabo wrote:
It is possible to use a href function within the +1. I'll experiment with the post number url. That way it will +1 a specific post.


Yeah ! There is one parameter for that ! Please see : http://code.google.com/apis/+1button/...parameters B) But I am not sure if it works with the Links on the same Page with Hashes#...
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 14 posts
  • Votes 0 votes
  • Topic users 7 members

7 participants

C
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
W
W
Wanabo 10
www.probemyip.com/probe-my-ip-80x15.png
pHp-Fusion.Asia & pHp-Fusion.Fr & pHp-Fusion.Cn are available for a localized support community. Send PB for info.
  • Senior Member, joined since
  • Contributed 598 posts on the community forums.
  • Started 94 threads in the forums
H
H
Just some Guy
  • Veteran Member, joined since
  • Contributed 1,486 posts on the community forums.
  • Started 91 threads in the forums
A
A
  • Junior Member, joined since
  • Contributed 36 posts on the community forums.
  • Started 10 threads in the forums
  • Started this discussions
M
M
My projects:
PHP-Fusion Czech | miskith portfolio | theConnex (In preparation) | Online game (Future project)
  • Member, joined since
  • Contributed 117 posts on the community forums.
  • Started 2 threads in the forums
M
M
Ex Senior Dev.
  • Member, joined since
  • Contributed 182 posts on the community forums.
  • Started 5 threads in the forums
A
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet