News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Google+ Button

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

Previous topic - Next topic

yogesh_gamer

Quote from: tinoest on July 23, 2011, 04:22:15 AM
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.


Its working.......
Thanks Bhai...

Khadamon

#41
First of all : Thanks for this mods ^^

I could install and uninstall it with no problem.

However, it seems that if I +1'ed a post in a thread => All post become +1'ed
Is it normal ?
It seems that the +1 is not for the the post but for the whole thread ; which miss the purpose to have a "+1" on any post though ...

I haven't check what is transmit to Google+ : would it be the thread's link, or the post I tried to +1'ed ?
[After reinstall]
It link the thread's URL without anything after the TOPIC_ID

Can you do anything to allow +1 to be for each post instead of the whole thread ?

Thanks anyway :)

[After some research]
I think all is here :


// Show the google+ icon.
if (!empty($modSettings['display_google_plus'])) {
if ($message['id'] == $context['topic_first_message'] || !empty($modSettings['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>';
}
}


Instead of "$context['current_topic']" (or following) there should be a $context['current_msg'] or something like this ?
(Unfortunatly at work, but I'll try this evening)

tinoest

Hi it does indeed apply it to the whole thread, as I would of thought you wanted to +1 the entire thread and not just the message within a thread.

You are correct in your assumption that you need to change $context[current_topic] to message['id'],


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

Khadamon

Hi,

Well, some thread are worth to be +1'ed in a whole, but sometimes you just want to +1 a specific comment/post.

And the right code (tested right now) is actually :


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


I hope it would be integrated in futur update of your great mod :)

Thanks again !

tinoest

Thanks for updating the thread with the correct code, I hadn't managed to test what I had put. It was meant to give you an idea towards what it should be.

I'll look at integrating what you have as an tick-able option in the settings.

Khadamon


Khadamon

Double-post just to add that the "+1" doesn't show on mobile phone (even Android's one).

I also had some complains about the fact that the only 2 first post of thread had the "+1" and not the other posts - I had no problem myself though.

If it helps for futur release ^^

crustybum

using SMF 2.0 but its not showing up in admin so i cant enable/disable (not in misc either) installed without problems..

tinoest

It should show up in the miscellaneous settings on the default theme.

If your running a custom theme then you will have to manually make the changes.

MrBogosity

I'm also having the problem where it only shows on the first 2 or 3 posts on the thread, and even on the other posts it seems to +1 the entire thread and not the post.

Draffi

I have this Mod (v1.0) installed, without errors during the installation.

But looks like i have almost the same issue like other here.

In a topic, the "GooglePlus"-Icon shows only on a some posts, not all the message, like i was thinking.

I attached my Display.template.php, maybe tinoest can help me?

thank you in advance.

Draffi

jacbier

Quote from: Slug1 on July 13, 2011, 12:19:24 AM
Great mod!

Is there an update plan/idea for an option (a checkbox) in the "Modify Boards" to allow only specific boards to show the Google+ button?

+1

There are boards for special members on my forum. I do not want these indexed by bots.

tinoest

Quote from: jacbier on August 27, 2011, 09:54:08 AM
Quote from: Slug1 on July 13, 2011, 12:19:24 AM
Great mod!

Is there an update plan/idea for an option (a checkbox) in the "Modify Boards" to allow only specific boards to show the Google+ button?

+1

There are boards for special members on my forum. I do not want these indexed by bots.

I'll look at getting this implemented shortly.

I should get some free time in the next week to look at making the change.

jacbier

#53
Quote from: tinoest on August 28, 2011, 08:33:08 AM
I'll look at getting this implemented shortly.

I should get some free time in the next week to look at making the change.

If you can would that be great.

Slug1

Quote from: tinoest on August 28, 2011, 08:33:08 AM
Quote from: jacbier on August 27, 2011, 09:54:08 AM
Quote from: Slug1 on July 13, 2011, 12:19:24 AM
Great mod!

Is there an update plan/idea for an option (a checkbox) in the "Modify Boards" to allow only specific boards to show the Google+ button?

+1

There are boards for special members on my forum. I do not want these indexed by bots.

I'll look at getting this implemented shortly.

I should get some free time in the next week to look at making the change.

Cool, thanks allot!
Slug1--out

~My blessings are as many as the miles I marched all these years~

babalola olasehinde

pls i mistakenly install this mod twice and i have uninstalled it but i am still getting this error

$txt['display_google_plus'] = 'Show google plus icon in posts'; $txt['display_google_plus_all'] = 'Show google plus icon in all posts, Note Display Google Plus has to be checked.';

pls what can i do

skb

Is there a way to not display this icon in the Private Boards ?

SMF 2.1.4 / TP 2.2.2

Advertisement: