Google+ Button

Started by tinoest, July 12, 2011, 10:03:13 AM

Previous topic - Next topic

tinoest

Thanks for the pictures to explain what you mean, I just don't quite understand why that would happen.

Do you have any other mod's installed?

Could you post your Display.template.php file?, its located in the following directory. Themes/default/

Thanks.

yogesh_gamer

there are many mods but no one is for google +1 button...

tinoest

I know, I just wondered if any were conflicting with this modification.

Do you have access to your Display Template?

I have tested it here with various user groups and its not exhibiting the same behavior as yours.


yogesh_gamer

but mod was successfully installed...
if you need any file, i can attached here.

tinoest

If you could the displaytemplate file would be useful.

Kaos2K

First of all, thanks for your work and dedication with this mod.

Second, a couple of questions :D

Is this mod only for Default Theme? I say that because is working on default theme but not on custom modified theme i have (LiveMC to be exact). Any clues?

Thanks ;)

P.D: I have just noticed that in default theme i can click the +1 button in posts (Logged in Google+ with my account), the icon changes from 0 to +1 but i cant see anything about it in my Google+ profile, there is no mention to that +1 i just clicked, aswell if i reload the topic in forum, the +1 gone and the 0 is still there.

Any help would be very appreciated.

tinoest

It is for the default theme only.

Are you using SMF 1.11.x or SMF 2.0 ?

Also it should, or atleast it does for me in the +1 links on my google account.


Kaos2K

#27
Thanks for you reply.

I use SMF 1.1.14

Is there any solution for using it on a modified theme? manual file modification maybe?

In the other hand, i think that the +1 problem in Google+ account is my website fault (or server), because if i search in Google for a thread, i see the +1 button on the right side of google result but if i click on it i get a red icon and an explanation of possible error causes.

Take a look.

Before clicking +1 button:


After clicking +1 button:


Possible causes of error:


In Google+ web interface it's impossible for me to share a link to a post of my forum (Only webpage index worked) because i get permanent "Error" as you can see in the pic below.



I dont have a clue why this is happening. (BTW i oftenly have problems sharing links on Facebook, it only works when the post i want to share was visited by Google's spiders and appear on search results, in other words, when Google has indexed it).


tinoest

The code you want to add is the following to your Display.template.php file just above the following line.

// Maybe they want to report this post to the moderator(s)?

// Show the google+ icon.
if (!empty($settings['display_google_plus'])) {
if ($message['id'] == $context['topic_first_message'] || !empty($settings['display_google_plus_all'])) {
echo '<g:plusone href="' . $scripturl . '?topic=' . $context['current_topic'] . '" size="small"></g:plusone>
<script type="text/javascript" src="http://apis.google.com/js/plusone.js"></script>';
}
}


If its not working , I would first look at your cookies to ensure that they are correct.

Kaos2K

Quote from: tinoest on July 20, 2011, 02:36:20 PM
The code you want to add is the following to your Display.template.php file just above the following line.

// Maybe they want to report this post to the moderator(s)?

// Show the google+ icon.
if (!empty($settings['display_google_plus'])) {
if ($message['id'] == $context['topic_first_message'] || !empty($settings['display_google_plus_all'])) {
echo '<g:plusone href="' . $scripturl . '?topic=' . $context['current_topic'] . '" size="small"></g:plusone>
<script type="text/javascript" src="http://apis.google.com/js/plusone.js"></script>';
}
}


If its not working , I would first look at your cookies to ensure that they are correct.

Thank you very much, working perfectly (at least i can see the button in my LiveMC modified theme). Now i have to resolve the other important problem... why Google+ doesn't like my website? :/

Any clues?

tinoest

I see you have some facebook and twitter mods in your template aswell.

You might want to move the code I pasted above so that its near them.

With regards to your issue with the google+ not working, I would look at either the server settings or cookies.

I get the same error as you, but if I try it on a different site it works correctly. So something on your webserver is blocking it from connecting.

Kaos2K

Yes, i have some mods to share topics in different social networks. It´s a good point to move the Google+ button code near them if i find the correct place in that big file called Display.template.php hehe :).

I'll take a look at server configuration or contact with my hosting support to see if they can do something with it.

By the way it's strange that the only links that doesn't work are the SMF forum related ones. I have MkPortal integrated with SMF and all exclusive MkPortal links works perfect on Facebook or Google+ or at least that is my impression, i have to investigate it to assure.

Thanks for your help again, i'll let you know if i will be able to solve the problem ;)

tinoest

If you look for the following code in your template:

<div id="share_this">

You should put the google+ one near there to move it near the twitter icon.

yogesh_gamer

Quote from: tinoest on July 20, 2011, 02:36:20 PM
The code you want to add is the following to your Display.template.php file just above the following line.

// Maybe they want to report this post to the moderator(s)?

// Show the google+ icon.
if (!empty($settings['display_google_plus'])) {
if ($message['id'] == $context['topic_first_message'] || !empty($settings['display_google_plus_all'])) {
echo '<g:plusone href="' . $scripturl . '?topic=' . $context['current_topic'] . '" size="small"></g:plusone>
<script type="text/javascript" src="http://apis.google.com/js/plusone.js"></script>';
}
}


If its not working , I would first look at your cookies to ensure that they are correct.

This code is present in my display.template.php
what is cookies?
Is there any need to attach any file?
if yes, i can attach here. just tell me the name and location of that file..

Kindred

Quote from: Kindred on July 21, 2011, 01:02:06 AM
3- We have noted the type of site that you run. We typically will not provide support for such sites. We do not support those sites. We do not like those sites. We do not encourage those sites. We do not want those sites.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

tinoest

#35
Quote from: Kindred on July 22, 2011, 07:59:46 AM
Quote from: Kindred on July 21, 2011, 01:02:06 AM
3- We have noted the type of site that you run. We typically will not provide support for such sites. We do not support those sites. We do not like those sites. We do not encourage those sites. We do not want those sites.

Hi Kindred.

Is that directed at me? Or other people whom have posted in this support thread.

EDIT: Ignore me, clicked on the link and realised it was aimed at yogesh_gamer

tinoest

Quote from: yogesh_gamer on July 22, 2011, 05:34:09 AM
Quote from: tinoest on July 20, 2011, 02:36:20 PM
The code you want to add is the following to your Display.template.php file just above the following line.

// Maybe they want to report this post to the moderator(s)?

// Show the google+ icon.
if (!empty($settings['display_google_plus'])) {
if ($message['id'] == $context['topic_first_message'] || !empty($settings['display_google_plus_all'])) {
echo '<g:plusone href="' . $scripturl . '?topic=' . $context['current_topic'] . '" size="small"></g:plusone>
<script type="text/javascript" src="http://apis.google.com/js/plusone.js"></script>';
}
}


If its not working , I would first look at your cookies to ensure that they are correct.

This code is present in my display.template.php
what is cookies?
Is there any need to attach any file?
if yes, i can attach here. just tell me the name and location of that file..

I would appreciate it if you could attach the Display.Template.php file as requested.

Cookies are not related to your problem, that was in response to another member.

yogesh_gamer

Quote from: tinoest on July 22, 2011, 09:41:05 AM
Quote from: yogesh_gamer on July 22, 2011, 05:34:09 AM
Quote from: tinoest on July 20, 2011, 02:36:20 PM
The code you want to add is the following to your Display.template.php file just above the following line.

// Maybe they want to report this post to the moderator(s)?

// Show the google+ icon.
if (!empty($settings['display_google_plus'])) {
if ($message['id'] == $context['topic_first_message'] || !empty($settings['display_google_plus_all'])) {
echo '<g:plusone href="' . $scripturl . '?topic=' . $context['current_topic'] . '" size="small"></g:plusone>
<script type="text/javascript" src="http://apis.google.com/js/plusone.js"></script>';
}
}


If its not working , I would first look at your cookies to ensure that they are correct.

This code is present in my display.template.php
what is cookies?
Is there any need to attach any file?
if yes, i can attach here. just tell me the name and location of that file..

I would appreciate it if you could attach the Display.Template.php file as requested.

Cookies are not related to your problem, that was in response to another member.


Ok.. here it is attachment...

tinoest

Its due to another Mod that your using.

Move it this // Show the google+ icon.
if (!empty($settings['display_google_plus'])) {
if ($message['id'] == $context['topic_first_message'] || !empty($settings['display_google_plus_all'])) {
echo '<g:plusone href="' . $scripturl . '?topic=' . $context['current_topic'] . '" size="small"></g:plusone>
<script type="text/javascript" src="http://apis.google.com/js/plusone.js"></script>';
}
}

to be before this.

// Delete spam post link. But let's hide it if the poster is a mod or  admin.


.Vapor


Advertisement: