Module: Facebook like module

floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2011-05-29 16:55

I thought I tried that when you pointed it out to me but I guess not. Glad you found a solution.
I updated the zip file in the first post.

Thanks

Dave_____________________________________________
Blog & G2 || floridave - Gallery Team

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Mon, 2011-06-13 07:09
floridave wrote:
This is not the xfbml version, I could not get it to work right so kept with the <iframe> version.
If you can make a xfbml version go for it. I really don't have much interest in this module anyway.

I might be prepared to attempt this, if I had an understanding of what problems you encountered. It's been a couple of months - do you remember?

U-G

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2011-06-13 13:28

Not a clue....go for it.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
djjoker

Joined: 2011-08-21
Posts: 3
Posted: Sun, 2011-08-21 20:48

Hello,

Total Novice here. I've installed the facebook like but in order for it to work I have to click it 3 times.

The first 2 times it comes up with an error message:

The app ID specified within the "fb:app_id" meta tag is not allowed on this domain. You must setup the Connect Base Domains for your app to be a prefix of http://solarimage.co.uk/gallery/index.php/Urban/IMG_2635_3_4_tonemapped-copy.

The third time it holds.

My site is www.solarimage.co.uk/gallery

Could someone please point me in the right direction?

I'm using Chrome as my browser.

Thank you

Jeremy

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2011-08-21 21:09

Did you enter your app ID on the admin page?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
djjoker

Joined: 2011-08-21
Posts: 3
Posted: Sun, 2011-08-21 21:13

I seem to be falling short of setting the ID bit up.

Can you explain what I should enter? When I have tried this I am unable to get past the first input screen.

 
djjoker

Joined: 2011-08-21
Posts: 3
Posted: Sun, 2011-08-21 21:24

Think I've got it.

Thanks for coming back to me.

Cheers

Jer

 
timned88

Joined: 2011-08-31
Posts: 90
Posted: Thu, 2011-09-01 03:35

I keep getting this message "The app ID specified within the "fb:app_id" meta tag is not allowed on this domain. You must setup the Connect Base Domains for your app to be a prefix of ..."
I have an appID setup but can someone give specific examples of how things need to be in order to work? thanks.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2011-09-01 23:33

Admin -> settings -> facebook like.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Thu, 2011-09-01 23:56

I've had this too with the appID already filled in, but it's inconsistent. I think it might be a FB server problem.

U-G

 
timned88

Joined: 2011-08-31
Posts: 90
Posted: Sat, 2011-09-03 00:50
floridave wrote:
Admin -> settings -> facebook like.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

i have that filled in but it doesn't want to work.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2011-09-03 00:59

Try this then http://gallery.menalto.com/forum_module_facebook_comment

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
timned88

Joined: 2011-08-31
Posts: 90
Posted: Sat, 2011-09-03 01:16

that one worked right out of the box.

 
timned88

Joined: 2011-08-31
Posts: 90
Posted: Sat, 2011-09-03 01:21

now the original module appears to be working also, even though i didn't change anything. weird.

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Sat, 2011-09-03 23:53
timned88 wrote:
now the original module appears to be working also, even though i didn't change anything. weird.

Which was precisely my experience, hence my comment.

U-G

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Sun, 2011-09-04 23:50

There is something strange going on here and I don't quite understand it. I was having a problem with FB caching an outdated version of one page. This tool:

http://developers.facebook.com/tools/debug

will force a refresh of the cache. The tool provides a range of information about the chosen URL, and told me that the appID was wrong. It's been a while since I set this up, and I'm sure it was working initially with the appID that I used. I guess I will try to set the whole thing up again.

U-G

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Mon, 2011-09-05 14:01

OK, I've got it working. It was the appID after all. I don't know whether an incorrect one crept in to my admin settings (likely, but how?) or FB changed it (unlikely). Odd.

In so doing I've managed to implement some enhancements of the module, including implementing the XFBML version!! I want to do some more testing, but hopefully I'll post it tomorrow. There is a small catch to the XFBML version: depending on where you place it, you may need some custom CSS.

U-G

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2011-09-06 02:09

Looking forward to your changes. Would be nice if you can maintain the module as well, since my time is getting scarcer and harder to find.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Tue, 2011-09-06 05:21

Dave - I knew that you were going to say that. My time is scarce as well at the moment. I put in a burst of effort on G3 earlier this year when I switched to it, but I find it all to easy to keep fiddling with it. Photography and other responsibilities suffer when I do. I try to play with things only when I need to. I'd consider a shared role.

U-G

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Wed, 2011-09-07 14:52

I've attached V4 of this plugin. This has the following new features:

1. In the metatags that are included in page headers I've included "fb:admins" as this enables you to use insights: http://developers.facebook.com/docs/insights/ . You have to enter your numeric Facebook ID in the module's admin settings.

2. I've implemented the XFBML version of the like button. You activate this in the module's admin settings. You can choose either the old iframe or the new XFBML version.

XFBML has a number of advantages: you can add a send button, there are better dialogues when you press like or send, and the like button sizes itself automatically, particularly if you enable the display of profile thumbs. But there's a catch in some situations. If you place the like button at the bottom of the album thumbs, then there is a display clipping problem when you click like or send because overflow is hidden for one of the parent divs. There isn't a perfect solution for this, yet, although you can include some custom CSS to set the overflow to auto, but it doesn't look elegant (scroll bar appears). If you want to place the like button with the album thumbs, above the thumbs is definitely better at the moment if you use the XFBML version. The iframe version is ok under the thumbs, although note the comments below about displaying profile thumbs.

3. I've added the option in admin settings for a send button next to the like button, but you only see this in your gallery if you also select XFBML.

4. I've added the option in admin settings to display the profile picture thumbs for people who have used the like button. Of course you only see these for your "friends".

The XFBML version is definitely better if you enable the display of profile thumbnails, as it resizes itself depending on whether or not there are profile thumbnails to display. The iframe version can't do this, and so I've included code that increases the height of the like button if you select this option, but if there aren't any profile thumbs then there is some blank space under the like button.

5. I've corrected the metatag "og:site_name" so that it now uses the site name entered in the module's admin settings.

So that's it. I need some feedback as to how this works in a range of contexts, and whether there are sizing problems. I'll need examples to look at (by PM if necessary) if there are any problems.

I'm going to be on the road and/or tied up for then next two weeks, so while I hope to be able to read the forums, I can't promise to be able to diagnose or fix any issues quickly.

U-G

p.s. Dave - I suggest we wait for feedback before updating the attachment to the first post and the codex. I want to find a fix for that display clipping problem.

 
OC2PS
OC2PS's picture

Joined: 2010-09-08
Posts: 428
Posted: Mon, 2011-09-26 22:56

Great initiative. This would be good, but it seemed to slow down the pageload for my photo pages a lot. So, can you make the Facebook Like module load after the rest of the page has loaded?

Also:
1. Can you add more services? Or maybe simply use a service like http://www.addtoany.com/ to create a Wordpress AddToAny-like module http://wordpress.org/extend/plugins/add-to-any/
2. Combine Facebook Comments and Facebook like into one single plugin
3. Add Facebook's other social plugins like "Like Box" http://developers.facebook.com/docs/reference/plugins/like-box/ and "Activity Feed" http://developers.facebook.com/docs/reference/plugins/activity/

SoosKriszta
Csillamvilag.com

Bodypainting, Facepainting, Glitter, Henna
HennaLap.com

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2011-09-27 01:24
Quote:
Can you add more services?

http://codex.gallery2.org/Gallery3:Modules:share_bookmark http://codex.gallery2.org/Gallery3:Modules:addthis
For other requests I have no interest so will leave it up to the rest of the community.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
OC2PS
OC2PS's picture

Joined: 2010-09-08
Posts: 428
Posted: Tue, 2011-09-27 09:28

I went to http://www.gallerymodules.com/ and used the codex download link to download (codex has v2 while GIT has v1). Uploaded. Installed. G3 said a modules was out of date. On update page it said installed version is 1, available is 2. I clicked Update All. Then I get an error message that the update failed and I should get the new version or deactivate module.

SoosKriszta
Csillamvilag.com

Bodypainting, Facepainting, Glitter, Henna
HennaLap.com

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2011-09-27 13:37

Version 3 is available in the first post of this thread.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
OC2PS
OC2PS's picture

Joined: 2010-09-08
Posts: 428
Posted: Tue, 2011-09-27 13:54

My bad! I was referring to AddThis, not Facebook Like
SoosKriszta
Csillamvilag.com

Bodypainting, Facepainting, Glitter, Henna
HennaLap.com

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Wed, 2011-09-28 00:08

I developed V4 of the module. If you think it's too slow to load then you can experiment with using the XFBML version of the like button, which some suggest is faster. You select which version of the like button you use in the module's admin settings. XFBML has a number of advantages (see my post above).

I don't know how the get the like button to load last. You have to put the code that calls the like button at the point in the page where it is going to display, and then FB does the rest, so I can't see how to control when it loads, at least not without going to a lot of effort.

Like Dave, I am not inclined to add in the other FB social modules, although I am open to persuasion in relation to comments. In my experience, getting these plugins to display properly on your page is not easy. I can foresee all sorts of issues trying to combine like and comments, especially in the sidebar. Having them as separate modules means that you can place like and comments in different places, such as like in the sidebar and comments below the thumbs or resize image. I guess the admin section could specify different locations for the two plugins, and a relative order if they are in the same location, but it would mean a complicated admin page. Having them as separate modules and if necessary controlling their order using the module that controls the order of execution of modules seems simpler.

If you mean really combine them - this would have to be done by FB by creating a combined like and comments plugin.

If you want to create new modules for the like box or activity feed then it would not be too hard to take V4 of this module and drop in the FB code for them, but you would need to have some understanding of G3 modules.

U-G

 
OC2PS
OC2PS's picture

Joined: 2010-09-08
Posts: 428
Posted: Wed, 2011-09-28 08:24

Thanks udanigaga.

When I said combine, I didn't mean in the frontend. I meant, them having the same admin page...they require common things such as appid, etc. On the frontend, they could have several different boxes which could be placed in different places...
(I'm *a bit* influenced by Wordpress widgets)

SoosKriszta
Csillamvilag.com

Bodypainting, Facepainting, Glitter, Henna
HennaLap.com

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Wed, 2011-09-28 11:17

I don't pretend to be an expert in module admin pages, but from what I've seen this isn't as easy as it seems. Each module has its own settings, so to get like and comments into the same admin page you'd have to get them into the same module, and then the issues I mentioned in my post above arise. There aren't that many settings to enter and I'm not sure that it's worth the effort to combine them just to avoid that.

U-G

 
OC2PS
OC2PS's picture

Joined: 2010-09-08
Posts: 428
Posted: Wed, 2011-09-28 11:56

I am not worried about admin ease-of-use - as you said, there's only a couple of settings.

But as someone on shared hosting (not a very good one at that), I am thinking of performance...a single module probably means a single table is created, and needs to be accessed only once for all activated modules etc...

Maybe there's a better solution....

SoosKriszta
Csillamvilag.com

Bodypainting, Facepainting, Glitter, Henna
HennaLap.com

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Thu, 2011-09-29 01:48

I understand your concern only too well. I was on budget hosting and performance was an issue (I eventually chose to move and pay more). Based on my testing I wouldn't expect that combining these two particular modules would give you any noticeable improvements. You'd still have two separate calls to FB for the FB code and that is what will slow you down. If performance is an issue, then multiple calls to social plugins (not necessarily the same thing as multiple modules) is not a great idea IMHO. Even one is bad enough.

U-G

 
OC2PS
OC2PS's picture

Joined: 2010-09-08
Posts: 428
Posted: Thu, 2011-09-29 10:59

I see what you are saying. Guess I need to choose wisely.

SoosKriszta
Csillamvilag.com

Bodypainting, Facepainting, Glitter, Henna
HennaLap.com

 
OC2PS
OC2PS's picture

Joined: 2010-09-08
Posts: 428
Posted: Thu, 2011-09-29 20:51

@UG: I couldn't find v4. Where should I be looking?

SoosKriszta
Csillamvilag.com

Bodypainting, Facepainting, Glitter, Henna
HennaLap.com

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Fri, 2011-09-30 00:00

Attached to http://gallery.menalto.com/node/98752?page=2#comment-380592 which is further up this page.

You've reminded me that I promised Dave that I'd update the codex, but I was waiting to get some feedback from people on the new version before we made V4 the new official version. So let us know what you think.

U-G

 
OC2PS
OC2PS's picture

Joined: 2010-09-08
Posts: 428
Posted: Fri, 2011-09-30 10:04

Installed it. Seems way faster than v3 (although, in all honesty, I checked the XFBML box).

A couple of requests (really simple, somewhat superficial ones):
1) Option to align this left, center or right.
2) At the moment, if I put the button below the photo then there is no space between the photo and the button. This needs fixing. (if I put the button above the photo, it appears fine, and just as it should)

SoosKriszta
Csillamvilag.com

Bodypainting, Facepainting, Glitter, Henna
HennaLap.com

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Fri, 2011-09-30 14:02

Your requests might seem really simple, but you wouldn't believe how much time I've spent trying to solve both of them, without much success.

1) I've tried all my CSS tricks to try to centre the like button, but I can't. It's largely to do with the fact that the like button is actually contained in an iframe from facebook and browser security models won't let you interfere with an iframe from another domain. What I do on my site is to have some padding on the left in a custom.css style sheet. This approximately centres it.
2) This is caused by an overflow hidden CSS property for one of the parent DIVs. It is possible to set overflow to auto in custom.css, but then you get this ugly vertical scroll bar in the middle of the page when you click either like or send. I've had to move the like button above the photo for the time being.

Both of these things bug me too, especially #2, so when I have more time to waste on this I will try again. Perhaps Serge can help me on #2.

U-G

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Fri, 2011-09-30 23:53
sooskriszta wrote:
2) At the moment, if I put the button below the photo then there is no space between the photo and the button. This needs fixing. (if I put the button above the photo, it appears fine, and just as it should)

Is this happening with all themes?
You have a link to an example of the button on the bottom with no spacing?

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Sat, 2011-10-01 01:15

I am guilty of ready sooskriszta's concern too quickly. Her concern is different to what I was expecting. You can add more vertical spacing in custom.css :
.g-facebook_like iframe {padding-top: 10px; }
I also add a margin-left setting here to roughly centre it. I wonder if I should add this to the module as default.

The thing about the XFBML version is that it dynamically resizes itself. And when you click like and send, it pops up quite a large dialog. In at least the Greydragon theme, if the like button is under the image or thumbs, then when the dialog expands, most of it is hidden. This is because the like button is at the bottom of the g-column-centerleft DIV, which has overflow hidden. This is a harder problem to solve. You can set it to auto in custom.css, but it's not an elegant solution.

sooskriszta - what happens on your site when you click like or send? Is there any clipping of the dialogs that pop-up? I'd also be interested in seeing an example in another theme.

U-G

Edit: It doesn't seem to be a problem in the default Wind theme, as there is sufficient space for the dialog to expand.

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Sat, 2011-10-15 12:51

Despite saying before that I may not have time to play with this module, somehow I've created another version - version 5.

I haven't included any CSS changes to deal with sooskriszta's concerns as they are Greydragon specific. It's not an issue in the default Wind theme. If you want to use this mod in Greydragon then you'll probably need some custom CSS. If you want to use the XFBML version in Greydragon then you'll almost certainly need some additional custom CSS. I am happy to advise Greydragon users on how to do this, as it's a bit site-specific.

Changes in V5:

  • FB Like now appears on dynamic album pages, as well as regular album pages. Good for users of the Tag Albums module!
  • Additional layout added: "Box Count Layout" - See https://developers.facebook.com/docs/reference/plugins/like/ for the various layout options, and all other options as well
  • Button Count and Box Count layouts now available in XFBML version (this was an oversight)
  • It's possible to specify different options for layout, send button and display faces in the main column and the sidebar. This means, for example, you can include a larger version of FB Like in the main column where there's more room, *AND* a compact version in the sidebar, where there's less.

This means that there are a lot of options. I've tried to label them carefully, but you'll need to read them carefully, esp what is for the main column and what is for the sidebar. It's not easy to tweak the layout of these admin pages.

Still no feedback so I'm not going to make this the official version just yet.

U-G

 
jjanule

Joined: 2011-07-10
Posts: 2
Posted: Tue, 2011-11-01 21:53

I really like this module. I have only one question - when I add it to my gallery, how can I find out, who likes it? I cannot see anywhere :-(

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Tue, 2011-11-01 22:45

You will only ever see the names of your facebook friends who like something, plus the total number of likes. Under FB privacy settings you won't be able to see the names of people who are not your FB friends, AFAIK. To see the names of friends you need to use the standard layout, not the Button Count and Box Count layouts. Using the standard layout you can also select the admin option to display the profile pictures of FB friends who like something.

Another question which you can answer is how many likes are there on my site? You can get some information on this using Facebook Insights: http://developers.facebook.com/docs/insights/
If you want to use Insights, then you need to enter your numeric FB ID in the module's admin settings.

U-G

@Dave: I'm about to hit the road for several weeks. I'll update the codex with info about the new version and FAQ when I return.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2011-11-01 23:22
Quote:
I'm about to hit the road for several weeks. I'll update the codex with info about the new version and FAQ when I return.

Cool! and thanks for taking this module to the next level!

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
thefuzz4

Joined: 2011-11-09
Posts: 1
Posted: Wed, 2011-11-09 17:35

Hey Everyone,

Just trying to get this module to work. I'm currently running version Gallery Version 3.0.2. I installed the module just like I've done for all of the others. However when I go into modules it does not show up in there. Is it not compatible with this version of Gallery? The facebook_comments module works just fine. Thank you in advance for your help with this.

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Thu, 2011-11-10 07:16

Which version of the module are you using? It's possible that there incompatibilities with one of the earlier versions - latest is V5. I'm not aware of any incompatibilities with V5 of this module & 3.0.2. It sounds like you've placed the files in the wrong place.

U-G

 
abhijitkn

Joined: 2011-11-10
Posts: 13
Posted: Thu, 2011-11-10 19:39

Hi,

In 3nids theme I can not see the Facebook like button in the resized window. Any suggestions? I'm using V4 of this module.
Here is the link to my Gallery

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Fri, 2011-11-11 16:02

I'm not familiar with this theme, and being on the road I don't have the time to understand it right now. But at a quick glance it looks to me like you're not using a conventional resize page. It looks like you're using one of those photobox overlays instead of a resize page. I don't know how to put the Facebook like button in one of them. I'd like to work out how to do it, but that isn't a priority right now.

U-G

 
abhijitkn

Joined: 2011-11-10
Posts: 13
Posted: Sat, 2011-11-12 17:20
undagiga wrote:
I'm not familiar with this theme, and being on the road I don't have the time to understand it right now. But at a quick glance it looks to me like you're not using a conventional resize page. It looks like you're using one of those photobox overlays instead of a resize page. I don't know how to put the Facebook like button in one of them. I'd like to work out how to do it, but that isn't a priority right now.
U-G

Hi,

Thanks a lot. Please let me know once you make the changes so that I'll have the like button on re-sized page. Same is with the Facebook comments module.

 
Rogier2712

Joined: 2011-12-28
Posts: 11
Posted: Thu, 2011-12-29 12:58

Hi,

I'm trying to figure out why I always get the same picture when using the Like or Send button.... can anyone help me with this?

Thanks!!

-edit- a little more info...

the website address is: http://vansteennis.nl/g3/index.php/

When using the like or send button, I would like to select one of the thumbnails located on the left.

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Thu, 2011-12-29 22:33

You don't say which version of the module you are using, and I can't tell from looking at your page whether it's 4 or 5.

I think the behaviour you are seeing is FB using the thumb that "represents" the album. Each album has a thumb to represent it when it is displayed in its parent album. Even the root has such a thumb AFAIK, despite there being no parent.

The module has some code in the header that tells facebook to use this thumb. For example, in your home page you will find the following line of code in the header:

<meta content="http://vansteennis.nl/g3/var/thumbs//.album.jpg?m=1324409292" property="og:image">

and I think that it's this line that is telling FB which image to use. If you don't like this behaviour you could delete this line of code from the module. Or you could be sure that you have chosen the representative thumbs carefully. If you want to delete the line of code, look for "og:image" in helpers\facebook_like_theme.php and carefully delete the code. But don't delete that entire line, as you will need to keep the return "\t bit.

U-G

 
Rogier2712

Joined: 2011-12-28
Posts: 11
Posted: Sat, 2011-12-31 10:55

Thanks! I'm using version 5, but the same problem exists with version 4. I also noticed that the album thumb is used by Facebook, but I cannot select the thumb for the root album... Do you have a suggestion what code to use? Can it be a url, so I can display a logo if someone likes the root album?

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Sat, 2011-12-31 12:36

You're right - it's harder than I thought and I'm not sure why that is, but I think that this module will enable you to do it:

http://codex.gallery2.org/Gallery3:Modules:album_cover_browser

Just be aware that the message you get when the module successfully assigns a thumb is incompehensible.

U-G