Module: Facebook like module

floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2010-10-24 19:59

Facebook like/recommend module.
Adds a like button to the sidebar.
test please as I did not do much of that.
http://codex.gallery2.org/Gallery3:Modules:facebook_like

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
petri
petri's picture

Joined: 2005-12-15
Posts: 253
Posted: Mon, 2010-10-25 03:31

Hi Dave,

Nice modules you made there. it works pretty well and I have been trying all the settings :-)

I have only a few suggestions :

1) Would it be possible to add the button in the list of icons (view full size, slideshow, etc) ?
2) The button appears about ten seconds after the photo has been uploaded so I guess the users won't wait until then to use it. Is there a way to make it appear quicker ? I put the Facebook like module on the top of the list of the "Module Order" module but it does not change anything.
3) Again and again, no thumbnail appear in the posts on Facebook, I know it's a FB problem, but it is still annoying.

-----------------

Gallery stats

* Version: 3.0 (Santa Fe)
* Albums: 12
* Photos: 168

remove Platform information

* Host name:
* Operating system: Linux 2.6.18-194.11.3.el5
* Apache: Apache/2.2.3 (Red Hat)
* PHP: 5.2.6
* MySQL: 5.0.77
* Server load: Unavailable
* Graphics toolkit: gd

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2010-10-25 04:12
Quote:
1) Would it be possible to add the button in the list of icons (view full size, slideshow, etc) ?

I tried but most of the buttons are square and as far as I know the button that facebook uses is not customizable. It is a <iframe> and quite wide.

Quote:
2) The button appears about ten seconds after the photo has been uploaded so I guess the users won't wait until then to use it. Is there a way to make it appear quicker

I could investigate but if you have an idea why let me know.

Quote:
3) Again and again, no thumbnail appear in the posts on Facebook, I know it's a FB problem, but it is still annoying.

Is it related to this module? I don't understand.

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
petri
petri's picture

Joined: 2005-12-15
Posts: 253
Posted: Mon, 2010-10-25 05:06
Quote:
Is it related to this module? I don't understand.

I mean that the thumbnail of the picture does not appear in the posts, I don't know if you can do smth about it, same problem with the "share module" or even Facebook applications such as RSS graffiti and Gallery Status Updater
.

-----------------

Gallery URL = http://www.coquille.org/gallery/main.php
Gallery version = 2.3 core 1.3.0
API = Core 7.54, Module 3.9, Theme 2.6, Embed 1.5
PHP version = 5.2.6 apache2handler
Webserver = Apache/2.0.52 (CentOS)
Database = mysql

 
ajorgereis

Joined: 2008-09-06
Posts: 132
Posted: Tue, 2010-11-02 20:24

Nice module, Dave

Why not another button "Share:fb"

Regards

www.ajorge.net

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2010-11-02 22:24

Thanks!
There is a share this and share bookmark module(s)

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
iwc
iwc's picture

Joined: 2010-10-30
Posts: 11
Posted: Wed, 2010-11-03 15:34

I Dave,

Nice module.

But I have a concern with language. My home is French by default
Firefox, on any language, it remains in French
With IE8, it is in German!
And impossible to translate natively Gallery3!
Bug or not ??

Thanks

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2010-11-03 23:01

http://developers.facebook.com/docs/reference/plugins/like says it is a simple switch. So I guess U can fix that.
I will have to add some code and detect the version. This opens a big can of worms as you can detectt the browser locale, the G3 default locale, the user default locale and the user selected locale.
What one to use?

I am not willing to make a admin option for this but you are welcome to code some if you wish.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
iwc
iwc's picture

Joined: 2010-10-30
Posts: 11
Posted: Thu, 2010-11-04 20:15

Thanks ... I have make test. Is IE8 + windows!!
If i set the regional setting at French (france) OK. But I'm French (swiss)

On FireFox it use fr oder fr_FR but not IE !!! it want fr_CH and I hop not exist at Facebook, so comming de_CH !!!

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2010-11-06 04:04

Updated to read the users cookie locale value.
Use attached file above.
Bumped to version 2

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
iwc
iwc's picture

Joined: 2010-10-30
Posts: 11
Posted: Mon, 2010-11-08 12:18

Thanks Dave!!
With the 2.0 is OK now!

 
spamsuxx

Joined: 2007-09-22
Posts: 33
Posted: Sun, 2010-11-14 22:50

Button works, but does not integrate nicely:
http://gallery.olausson.de (Missing border around the module)

And when I enable the normal style the text is half way out of the box (to the right)

I am not sure if it is the buttons fault or the fault of the template, but I would guess the button does not take the template styling into account.

Thanks for the nice work you have done.

Cheers
Bjoern

--
http://olausson.de
http://gallery.olausson.de

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2010-11-15 04:27

If you can sort out the css of the theme you are using to make this module more to your likeing I am willing to include those changes.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2010-11-15 04:36
Quote:
Missing border around the module

This is not a block and thus does not have the g-block wrapper.
You are more than welcome to make changes to the modules code to your liking to fit your theme.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
spamsuxx

Joined: 2007-09-22
Posts: 33
Posted: Mon, 2010-11-15 10:09

Mhh, okay, but why is the text cut?
I searched all the css styles but could not find a option to enlarge the textbox :-(

See here:
--> http://gallery.olausson.de

Any hints?

[EDIT]
Found it!
[/EDIT]

Cheers
Bjoern

--
http://olausson.de
http://gallery.olausson.de

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2010-11-15 13:31
Quote:
[EDIT]
Found it!
[/EDIT]

It would be nice if you posted a solution for the benefit of the community.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
spamsuxx

Joined: 2007-09-22
Posts: 33
Posted: Mon, 2010-11-15 13:58

Sure. I was so obvious that I just forgot to post it.
Here's how I did it:

in views/facebook_like.html.php increase the value for height:

By the way, why not add control options to the admin site for all changeable options facebook provides?
http://developers.facebook.com/docs/reference/plugins/like

This would also help to control the height and width for individual themes.

Cheers
Bjoern

--
http://olausson.de
http://gallery.olausson.de

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2010-11-15 17:50

Just height and width?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
spamsuxx

Joined: 2007-09-22
Posts: 33
Posted: Mon, 2010-11-15 17:57

Well, you could make it feature complete by adding all the attributes listed on http://developers.facebook.com/docs/reference/plugins/like to the admin page.

If you do so, keep the restrictions in mind like

Quote:
Minimum width: 225 pixels. Default width: 450 pixels. Height: 35 pixels (without photos) or 80 pixels (with photos).

You might consider to use the XFBML version.

Cheers
Bjoern

--
http://olausson.de
http://gallery.olausson.de

 
rross

Joined: 2010-08-22
Posts: 41
Posted: Tue, 2010-11-16 14:35

AddThis has a new option that combines FB Like, a Tweet button and the usual Share button for all other services. I copied that code and pasted it in place of the code in share_bookmark_block.html.php, but the FB Like count/balloon didn't show. Also, I need to widen the sidebar a bit to get it all on one line and couldn't figure it out in the css.

 
rross

Joined: 2010-08-22
Posts: 41
Posted: Tue, 2010-11-23 04:37

I ended up doing the following to your share_bookmark_block.html.php file to get the long Share button and their FB Like and Tweet buttons:

<script type="text/javascript">
var addthis_config = {
username: "YOUR ADDTHIS USERNAME"
}
</script>
<div class="addthis_toolbox addthis_default_style">
<a class="addthis_button" href="http://www.addthis.com/bookmark.php?v=250&amp;username=xa-4ceb41967d22f68c"><img src="http://s7.addthis.com/static/btn/v2/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a>
<br /><br />
<a class="addthis_button_facebook_like"></a>
<a class="addthis_button_tweet"></a>
</div>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js"></script>

The <br /><br /> is to place the FB and Tweet buttons on their own line, otherwise it looks unprofessional with Tweet alone below FB and Share. (I could've used one of their smaller Share buttons to get everything on one line, but I like their longer Share button.)

http://www.blackboxnynj.com/gallery/

R

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Tue, 2010-11-23 15:10
petri wrote:
Quote:
Is it related to this module? I don't understand.

I mean that the thumbnail of the picture does not appear in the posts, I don't know if you can do smth about it, same problem with the "share module" or even Facebook applications such as RSS graffiti and Gallery Status Updater

@petri: What's the url of the site you're adding this to? I went to the site in your signature, but it's not Gallery3.

 
petri
petri's picture

Joined: 2005-12-15
Posts: 253
Posted: Wed, 2010-11-24 02:00

Yeah sorry, I have not made the big step yet, still testing Gallery 3

http://www.coquille.org/gallery3/

:-)

-----------------

Gallery URL = http://www.coquille.org/gallery/main.php
Gallery version = 2.3 core 1.3.0
API = Core 7.54, Module 3.9, Theme 2.6, Embed 1.5
PHP version = 5.2.6 apache2handler
Webserver = Apache/2.0.52 (CentOS)
Database = mysql

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Wed, 2010-11-24 18:47

I get images when I share your pages to Facebook; I actually get way more images to choose from than are on the page. (I think they're coming from the sidebar.) Doesn't work for you?

 
petri
petri's picture

Joined: 2005-12-15
Posts: 253
Posted: Thu, 2010-11-25 04:22

Yes, indeed, to my surprise, the "share" module works fine in terms of images publishing on Gallery3 (not Gallery2 though) and that is a great news !!! :-)

But I was talking about the "Facebook Like" module, the topics of this post. This one does not publish the image, just a text, such as :

Quote:
Petri likes Photo :: bougie on coquille.org.

for this page :

http://www.coquille.org/gallery3/index.php/Portfolio/Design/Color/bougie

But maybe it is normal, Facebook like does not publish photos...

By the way... about text... could it be possible to take away the double :: on the title of the page ?

:-)

-----------------

Gallery 2 URL = http://www.coquille.org/gallery/main.php
Gallery version = 2.3 core 1.3.0
API = Core 7.54, Module 3.9, Theme 2.6, Embed 1.5
PHP version = 5.2.6 apache2handler
Webserver = Apache/2.0.52 (CentOS)
Database = mysql

Gallery 3 URL = http://www.coquille.org/gallery3
Version: 3.0 (Santa Fe)
Système d'exploitation : Linux 2.6.18-194.11.3.el5
Apache: Apache/2.2.3 (Red Hat)
PHP: 5.2.6
MySQL: 5.0.77

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2010-11-25 07:03
Quote:
By the way... about text... could it be possible to take away the double :: on the title of the page ?

Best to start a new thread as to not confuse the topic at hand.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Jeeves_

Joined: 2010-10-27
Posts: 6
Posted: Fri, 2010-11-26 12:03

Is there a link to the newest version of this module? Or isn't it really ready yet?

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Fri, 2010-11-26 16:48

@petri: It's normal; that's the way like works. As for the ::, it's controlled in your theme and I agree with floridave that you should start a new topic thread if you need help with that.

@Jeeves_: Yes, the module works; the link is at the top of the page http://codex.gallery2.org/Gallery3:Modules:facebook_like

@floridave: Thanks for the module!!

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2010-11-26 18:03

tempg,
Thanks and thanks for your help in the forums as well. Feel free to takeover this module if you see and or want improvements.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
dwdallam

Joined: 2006-11-19
Posts: 394
Posted: Mon, 2011-01-10 07:39

Dave, is there a "Share" button like this one?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2011-01-10 14:18

http://gallery.menalto.com/node/99043
care to contribute to the community by creating a codex page for it after you get it installed?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
dwdallam

Joined: 2006-11-19
Posts: 394
Posted: Tue, 2011-01-11 07:08

Of course I will. Any instructions? I have never done it.

I had a look at that thread, but that doesn't look like a module. It's a script that hasn't been "modulized."

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2011-01-11 10:28

The second post is the module.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2011-01-12 00:14

As for directions: login go to a page you want to create with the url copy/paste/edit to your hart content.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
lateatnight
lateatnight's picture

Joined: 2011-03-06
Posts: 15
Posted: Sun, 2011-03-06 19:33

Hi Dave,
I have a problem with your module, when I click on like button on my facebook page I can see the right title and the right link of my liked picture, but the thumbnail showed is from another picture in my gallery.
Do you know which could be the problem?

Thank you
Greetings
Riccardo

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2011-03-06 20:58

Works for me. Perhaps you are liking an album?
post a url or the source of the page in question after <div class="g-facebook_like"> to the end of the </div>

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
lateatnight
lateatnight's picture

Joined: 2011-03-06
Posts: 15
Posted: Sun, 2011-03-06 23:15

I tried with this photo for example
http://www.lateatgallery.org/index.php/Fuerteventura/Black_windmill
and in facebook I find the thumbnail of this photo
http://www.lateatgallery.org/index.php/Fuerteventura/T_shirt_of_the_day
But same problem with all picture in any album

 
Pintac
Pintac's picture

Joined: 2009-02-03
Posts: 11
Posted: Mon, 2011-03-07 03:36

I tried this on multiple different photos. At one point, it posted a photo from a completely different album but had the text for the photo that I had liked.
Gallery 3.0.1

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Mon, 2011-03-07 14:21

The share button works; it's pulling an image from the navigator module because Facebook can't distinguish which image you want highlighted.

@floridave: It may help Facebook know what thumb to use if the module can add <meta property="og:image" content="LINK-TO-ITEM/ALBUM-THUMBNAIL"/> to the header of each page. I don't really understand how modules do their business, so I don't know how to test that out.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2011-03-07 14:30

I see the issue that lateatnight has but don't know how FB gets the image from the code. The code in the <i frame> that is generated looks fine to me and has the proper url.

tempg;
If you add that to the page.html.php of the theme... to test it out then if it works, then I can add this to the module.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2011-03-07 14:46

Pintac,
URL or are you using some additional modules like lateatnight?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
lateatnight
lateatnight's picture

Joined: 2011-03-06
Posts: 15
Posted: Mon, 2011-03-07 15:36

If it can help you, I'm using these modules:

* Facebook like
* Fancy boxes
* Google analytics
* Kbd Navigation
* Thumb navigator
* Stop owner counts

I installed Share & Bookmark after discover the thumbnail problem of facebook like

 
Pintac
Pintac's picture

Joined: 2009-02-03
Posts: 11
Posted: Mon, 2011-03-07 17:11

Modules that I added are

Adsense
ContactOwner
FaceBook Like (deactivated)
reCaptcha

It likes to pickup the advertisement banner in my footer as the image on FB.

Site can be found here.
http://www.philippinegallery.com

I'll reactivate the FB Like button.

Is it possible in a future release to have the option to place Like button below the pictures?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2011-03-09 04:19

see if the attached works better. I added a
<meta property="og:image" content="LINK-TO-ITEM/ALBUM-THUMBNAIL"/> as suggested by tempg. If you are in an album it will use the hightlight thumb.

Let me know so I can remove the other attachment.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Pintac
Pintac's picture

Joined: 2009-02-03
Posts: 11
Posted: Wed, 2011-03-09 08:14

Seems to be working so far. Tried it on a few different photos.

But when you click like, shouldn't you receive a popup box asking you for the share permission level on facebook?

 
lateatnight
lateatnight's picture

Joined: 2011-03-06
Posts: 15
Posted: Wed, 2011-03-09 08:31

I tried it in a lot of pictures and it seems to work well. Thank you Dave

 
Atrus

Joined: 2006-10-08
Posts: 2
Posted: Wed, 2011-03-09 10:44

Unrelated question: is there a way of hiding the Like button for pictures in private albums? I havn't tried what happens when I click on such a button but I guess Facebook will create a link to a login box.

Best,

Roland.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2011-03-09 13:40
Pintac wrote:
But when you click like, shouldn't you receive a popup box asking you for the share permission level on facebook?

I don't know. If a user is logged it already it should just add it. If you are not logged in I think there is a popup or some redirect for the user to login. Not sure if the user has some popup blocker what hapends.

Atrus,
I guess I should fix that. FB needs to have access to the image to get it. What do you think of still having the 'like' button but only give facebook a generic thumb? Or is it better just to not show the like button at all?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Wed, 2011-03-09 14:51

@floridave: Apologies for not getting back; overlooked it.

@pintac: The new line works for you, but it's just coincidental because of the way your page is laid out. You're supposed to replace your facebook like module with the one posted by @floridave above: http://gallery.menalto.com/node/98752#comment-370082

 
Pintac
Pintac's picture

Joined: 2009-02-03
Posts: 11
Posted: Wed, 2011-03-09 15:02

I did replace it with those files and yes it works. The part about permissions was a separate thing. It posts to the profile but not to the news feed like everything else unless you click on share.

 
Atrus

Joined: 2006-10-08
Posts: 2
Posted: Wed, 2011-03-09 15:27
Floridave wrote:
What do you think of still having the 'like' button but only give facebook a generic thumb? Or is it better just to not show the like button at all?

@ Floridave, I would prefer not showing the button at all, so that facebook never knows about private albums.

Roland.