Module: Facebook like module

Rogier2712

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

Great! It worked and the album cover for the root is a lot more representative for the website than the old one. Thanks!

 
undagiga

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

One issue you may have is that Facebook caches pages, so that any existing likes will use the old thumb. You can use this tool to force a refresh:

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

As I understand it, it's designed principally as a debug tool, but it has the additional effect of forcing a refresh, so that on the FB walls of those who have liked your page the new thumb will magically appear.

U-G

 
CC Roi

Joined: 2008-08-05
Posts: 24
Posted: Tue, 2012-01-10 22:19

I'm using this module and I really like it.

But for some reasons there should not be a like button if the album is not accessible to everybody but also registered users (of certain groups).

Also there should not be a like button if a certain element is hidden by the "hide" plugin.

Right now everybody might bring pictures out to Facebook, at least somehow, even if they are protected or hidden.

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Tue, 2012-01-10 23:02

I don't have a detailed understanding of permissions, and my own use of permissions is fairly simple so I can't easily test this. Is there anyone out there who does understand permissions who could advise me on how to make these changes, assuming that they're desirable?

Also, could the owner of the "hide" plugin (rWatcher?) suggest code that would prevent the Like button from displaying for hidden photos?

It seems to be that it's probably not worth too much effort to deal with these issues in 3.0.x. We are supposed to be getting more sophisticated permissions in 3.1. There are all sorts of permission issues at the moment. For example, the hidden module (if I'm thinking of the correct one) hides albums, but you can still see the images through searches and in Tag Albums. So I wonder if the problems with Like are sufficiently unique to warrant attention.

F_P

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2012-01-11 04:45
Quote:
Right now everybody might bring pictures out to Facebook, at least somehow, even if they are protected or hidden.

Can you give me an example of a protected image (using G3s permissions), not hide, allows for the item to be shown on Facebook?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
CC Roi

Joined: 2008-08-05
Posts: 24
Posted: Wed, 2012-01-11 21:17

@floridave: I only had the "problem" that people commented on hidden pictures which showed up on Facebook.

But I noticed that both Facebook comment and like elements are shown on protected albums and images. So it should be possible to send something to Facebook. Maybe the pictures cannot be dragged to Facebook then, but you can still comment and like, which does not make much sense.

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Wed, 2012-01-11 23:37

I understand your problem, as least as far as the FB Like module is concerned. If the Hide module author can give me some code that would enable me to test whether a page is "hidden" or not, I could implement it. I don't have the time right now to deconstruct his/her module.

However I have a couple of concerns. As I understand it there are several such modules around that make albums and images hidden. Am I supposed to incorporate tests for all of them, and any new ones?

I also wonder if your problems are limited to the FB Like module. If you're concerned about the privacy of hidden images being breached, have you tried using the G3 search function to find a hidden image? My understanding is that it is possible. It's also the case that hidden images appear in the pages created by the Tag Albums module.

So while I could include code that prevents FB Like appearing on pages hidden by the Hide module, my understanding is that the problems are more systemic and a comprehensive solution will have to wait for G3.1.

U-G

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2012-01-12 00:37

I think that this module has a design flaw and should not show the like button if the item is not view-able by the guest. We can test for that in a bunch of different ways to hide the button.
We can hide it with CSS or not even deliver the HTML in the view or the theme helper file.
We can fix that and the other FB module as well if this is what the community wants.

But like undagiga said, the permissions will be redesigned in the future and the 'hide' module is just that, hide, it is not a permissions system. Like undagiga I have not looked at how that module was developed to see how the items are hidden from view.

We need to differentiate between permissions and hiding. I don't think the hide module author intended to have this issue.

This is some code that might work to test to see if the guest can view the item:

if (access::user_can(identity::guest(), "view", $item)) {
...
...
}

undagiga if you want to implement that in the view I would apreaciate it.

Cheers!
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Thu, 2012-01-12 07:50

I'll try to get to it in the next day or so. Not a big job.

U-G

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Wed, 2012-01-18 05:05

Sorry about the delay. Dave - I went to insert the code, then I noticed that this code is already in there, in a more elaborate form. Towards the end of each of the two view files there is the following block:

<?php
/**
 * Only show the like button, css and JS if the item is vewable by the guest user 
 * as facebook is a guest user to get the thumb of the item.  If this is a dynamic 
 * album then use the root album to check to see if the guest has permissions.
 */
$guest = user::lookup("1");
$item = "";
if ($theme->item()) {
  $item = $theme->item();
} else {
  $item = ORM::factory("item", 1);
}
if (access::user_can($guest, "view", $item)) {
  $show_like_code = true;
}
?>

This isn't my code. IIRC you did the first version of this module? Anyway, what this means is that either this approach doesn't work, or there is a bug in this code.

I am puzzled by the first line which says <?php. I thought that this only went in the first line of a PHP file (clearly I'm no expert). Isn't this supposed to be just <??

Second, I can't see how the variable $show_like_code is used to control display, as it doesn't appear anywhere else in the module. I'm more inclined to wrap the whole view file in the if statement as you suggested, but wanted to check with you first in case I have not understood correctly.

U-G

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2012-01-19 05:33
Quote:
I am puzzled by the first line which says <?php. I thought that this only went in the first line of a PHP file (clearly I'm no expert). Isn't this supposed to be just <??

either way works see:
FAQ: Why do you use PHP's short open tags?

Code looks good to me so I guess it it is in CC roi court to prove that the issue is not permissions but hidden that I don't think we should address.
I will look if he posts back.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Fri, 2012-01-20 01:06

OK thanks, but I'm still puzzled about the variable $show_like_code - what is the mechanism whereby this variable prevents the like module from being shown?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2012-01-22 19:58

Does this work?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Mon, 2012-01-23 23:21

I can't easily test it as I don't use the hidden module. We'll have to wait for CC Roi to return. Did you use V5 as the starting point?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2012-01-24 02:59

It will not work for hidden items. I'm not going to go down that road. Just fixed the issue of it showing the block if the guest user can't see the item.
Not sure what version I used :-(

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
CC Roi

Joined: 2008-08-05
Posts: 24
Posted: Wed, 2012-01-25 15:35

The Facebook like module now does not show a button when the picture is not public viewable, which means if guests do not have access. Thanks! :-)

It still shows the button if the picture is hidden by the hide module - but I did understand that it is not easy to change and there will be changes to the permissions in Gallery 3.1 anyway.

 
peshko

Joined: 2010-11-22
Posts: 81
Posted: Mon, 2012-02-20 03:16

Hi Dave. I installed the module and I can see the "Like" on my site, but:

1. The only thing that says after the "F" is likes this, no name, no "You...". Nothing
2. Nothing gets published on my FB page if I "Like" with a comment

Here are my settings:

Enter the appId: I put my ID that I got from the URL. It is 15 digit number
Enter *your* Facebook *numeric* ID: Same as above
Use the XFBML version rather than the iFrame version (allows the Send button and better dialogs). - Checked
Layout style: Standard
Show on top of resize photo: Checked

Thats pretty much it...

My FB registration is as Personal Website and not as individual, yet as a part of the set up it shows the way to set up "Like"...

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Tue, 2012-02-21 13:30

Please post or PM a URL where this can be seen. Hard to guess the problem without seeing it.

U-G

 
peshko

Joined: 2010-11-22
Posts: 81
Posted: Fri, 2012-03-02 00:01
undagiga wrote:
Please post or PM a URL where this can be seen. Hard to guess the problem without seeing it.

U-G

Sorry for the delay. Just PM the information.

Thanks again!

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Fri, 2012-03-02 04:05

I went to one of your album pages. I clicked on the like button. Initially it appeared to work. But after a second it reverted back to an "un-liked" state. There was an error message displayed immediately after "Be the first of your friends to like this", and when I click on the error it says "The app ID "370506916311574" specified within the "fb:app_id" meta tag was invalid." So this would appear to be the problem.

Note that there are two IDs that you need and they are different. The first one is the AppID, which is something you have to create. The second one is your own Facebook ID, which should be easy enough to find out. For both IDs, follow the instructions on the module admin page. I can see that you're not using the default dummy AppID, so I assume that you've got one but something has gone wrong.

Update: I find that if you press the like button a second time, it works. Based on my limited testing this does seem to be a symptom of a faulty AppId. After the second successful click the "like" is posted to my facebook wall, so it is working, but after two clicks.

[I've made a few likes on your site from my dummy FB account that I use for testing. If you want to track real likes, then I can remove them.]

U-G

 
xeta

Joined: 2011-11-24
Posts: 42
Posted: Thu, 2012-05-24 12:07

A german computer journal developed a plugin that the user can de-/activate the access to Facebook and Google+ for privacy reasons.

Here is the description of the module: http://translate.google.de/translate?sl=de&tl=en&js=n&prev=_t&hl=de&ie=UTF-8&layout=2&eotf=1&u=http%3A%2F%2Fheise.de%2F-1333879&act=url
and some code examples http://translate.google.de/translate?hl=de&sl=de&tl=en&u=http%3A%2F%2Fwww.heise.de%2Fextras%2Fsocialshareprivacy%2F

Do you think it would be possible to integrate this privacy plugin in Gallery3?

Would be a really great option.

www.xeta.at

 
cboyse

Joined: 2011-09-09
Posts: 33
Posted: Fri, 2012-05-25 21:02

Hi, Novice user here.

I have installed the module and it looks fine.

When I click the 'like' button on a picture, it only posts the link on facebook with no thumbnail

error says: There was an error retrieving data for "the link"

any suggestions would be great!

Thanks

 
dmcantrell

Joined: 2007-10-04
Posts: 44
Posted: Wed, 2012-07-18 23:00

Hello,

I have read this entire thread, and I cannot for the life of me figure out why the Like button isn't posting a thumbnail to my Facebook timeline. I've installed G3 with and without the mod_rewrite setting in the .htaccess file with the same results either way.

Now, I think I've isolated the problem to only occur when the album (or the specific photo) is uploaded via the server_add module.
* If I try to Like a photo from an album that was created with server_add, I do not get the thumbnail only the link in my Facebook timeline. (NOTE: The timeline entry is the full URL to the photo as both the title and the link.)
* If I try to Like a photo from an album that was created with the native G3 uploader, I get the thumbnail and the link in my Facebook timeline.(NOTE: This timeline entry is the thumbnail and just the photo title, with the actual URL to the photo as a link)

That's as far as I've gotten. Any suggestions for the next step of debug?

Here's my Gallery : http://dmcantrell.com/gallery3

and the details :
-----------------
Host name: p3nlhg406.shr.prod.phx3.secureserver.net
Operating system: Linux 2.6.18-238.19.1.el5PAE
Apache: Unknown
PHP: 5.2.17
MySQL: 5.0.92-log
Server load: 1.95 1.97 2.08
Graphics toolkit: imagemagick

Thanks in advance for any help!

UPDATE: I went into a couple of the photos that were added via Serveradd and edited them (edit photo in G3) to change their title. In doing this, I changed something that allowed the thumbnail to be posted... Huh.

 
allys

Joined: 2012-07-20
Posts: 1
Posted: Fri, 2012-07-20 06:35

hello,
i am new here, i was reading your posts and i would like to ask where i can download the share and bookmarks and if i can customize which one i need there..

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Sat, 2012-07-21 15:24

@dmcantrell: Not sure why, but you should start by cleaning up the urls to your thumbs. Can't really offer more than that without seeing the actual code.

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

@allys: What is "the share and bookmarks"? http://codex.gallery2.org/Gallery3:Modules:share_bookmark maybe?
If not, try looking at the modules page. http://codex.gallery2.org/Category:Gallery_3:Modules

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

@ubenxd: Add &amp;locale=es_ES to the end of the Facebook url code.

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

EDIT: @ubenxd: http://developers.facebook.com/docs/reference/plugins/like/

 
dmcantrell

Joined: 2007-10-04
Posts: 44
Posted: Sat, 2012-07-21 18:57

Tempg - what does it mean to "clean up the urls to your thumbs". What specific action does this suggestion entail?

 
gozertje

Joined: 2010-10-25
Posts: 57
Posted: Sun, 2012-07-22 09:20

where is the manual? i can't get a code on Fb. just don't understand the step 1 and step 2 code in the settings.

i got a code on facebook and it looked allright but then i got an error below every picture.

it's just a big mistery how to get this to work.

 
jtcafe

Joined: 2012-07-24
Posts: 1
Posted: Tue, 2012-07-24 08:25

Hi,

this module have a italian language?I don't know where i can download this language.Thx in advance,

 
gozertje

Joined: 2010-10-25
Posts: 57
Posted: Fri, 2012-07-27 20:54

i've been trying to get this thing working now for about 3 days.
i keep getting a error next to the like button under the picture. the like button is there but when i click on it to enter a comment i get an error.

please somebody help me !!

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2012-07-27 23:11
Quote:
i keep getting a error next to the like button

What is the error? More info is more helpful than less.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Sat, 2012-07-28 05:50
gozertje wrote:
i've been trying to get this thing working now for about 3 days.
i keep getting a error next to the like button under the picture. the like button is there but when i click on it to enter a comment i get an error.

Have you been to the module's admin page and entered an appID (which you will have to create) and also your own numeric Facebook ID? These are the first two fields in the admin page. In my experience most of the errors like the one you describe are caused by not filling these two fields in. Note: I think the module ships with a couple of dummy entries so that you know what the numbers are supposed to look like, but you need to create your own.

If that's not it then give us a URL to look at.

U-G

 
teodorsavic

Joined: 2012-07-19
Posts: 10
Posted: Sat, 2012-08-04 09:25

I'm having some problems with like button. I was trying to place facebook like button under photos on my site but it was never showing the right page name or thumbinail. Now, it will not even work.

When I click the like button an error appears : "URL could not be liked because it's been blocked. "

Does anyone know how to repair this?

here's some random link:
http://justimagine-ddoc.com/Start-Imagining/Architecture/Unique-Staircase-Designs/unique-creative-staircase-design-4

Thanks everyone!

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Sat, 2012-08-04 13:15

Got the same error on your site. I've not seen this before. I know someone who has a similar problem. Whenever they put links to their blog on their wall, people who try and click on it are told that you can't go there from facebook because the site had been reported as abusive. His blog was on blogspot.com, and it's hard to imagine his site as being offensive. It may have applied to all of blogspot.com, but who knows? You can try and complain, but you may find that it falls on deaf ears.

I don't think it's a problem with the module.

U-G

 
teodorsavic

Joined: 2012-07-19
Posts: 10
Posted: Sat, 2012-08-04 13:55

But some people can like it, and some can't.. I don't know why. Also, although the module inserted all meta tags right, pages don't show up on facebook right when i try to share it. Also, some people can share link to my page on their wall and some can't.. Just can't understand that..
Did you try to see page source? Are meta tags inserted properly?

I believe I know what the problem is...

When I try to share something from my website I get this error e.g.:

The content you're trying to share includes a link that's been blocked for being spammy or unsafe:

http://justimagine-ddoc.com/some random url
error404.000webhost.com

For more information, visit the Help Center. If you think you're seeing this by mistake, please let us know.

I host my site on a dedicated server now, but I did create account on ooowebhost just until I sorted out some things regarding dedicated server. Facebook maybe sees my site as if it is still hosted there, and maybe it is blocking all the websites that are hosted on 000webhost. Don't know.. just guessing..

 
teodorsavic

Joined: 2012-07-19
Posts: 10
Posted: Sat, 2012-08-04 14:05

now I see it!! When I share a link to my website, although I'm on a dedicated server now, and I redirected domain to my nameservers (actually redirected to cloudflare, but I redirected properly), when I try to share something on facebook it shares the site from my old host(my old site). I realized that because some text that I deleted from my "new
" site appears in the link description n facebook. That text was on homepage at the time I hosted my account at 000webhost...(hope I wrote it clearly)

 
scrp

Joined: 2012-08-05
Posts: 1
Posted: Wed, 2012-08-08 14:08

Thank you Dave. A wonderful module. But it does not work the Russian language. Maybe I'm doing something wrong.
files

 
uncletupac

Joined: 2012-08-05
Posts: 1
Posted: Sun, 2012-08-05 15:58
scrp wrote:
Thank you Dave. A wonderful module. But it does not work the Russian language. Maybe I'm doing something wrong.

Me too

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2012-08-05 17:06

The docs from FB say you just need to change the url to the JS call
//connect.facebook.net/en_US/all.js
Let us know if that works.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
netrunner

Joined: 2012-11-11
Posts: 3
Posted: Sat, 2012-11-17 11:48

The problem of not showing or showing only with the facebook_comment module occurred to me also, so I started to dive into the code. I also noticed that facebook meanwhile offers a html5-method of integration, which seemed to work even more perfectly. So I updated the module to provide html and url methods as well, and to show a comment box on demand.

Changes from v5 (roughly):
- grouped config settings and converted checkbox for xfbml to dropdown (with import code for upgrade)
- added option to show the fb comment box below album/resize (does not make sense to use a second module as it would again import the fb scripts. this made some structural changes for the main view necessary, it is now a template that can contain the like and the comment sections.
- added html5 and url embedding methods
- the main and sidebar views are exactly the same files, this makes it easier to update them. you can copy the main to the _sidebar and set the $side on top of the sidebar to "_side".

Open points:
- I needed to fixate the height for the div below the resize/album page so that the popup for the comment/note can show up.
- for the same reason in the sidebar, I needed to override the overflow-style of the sidebar with an ugly !important tag.

Feel free to have a look.
Best regards
Netrunner

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2012-11-17 23:00

Great! I'm glad others can continue on dev work.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
roy2363
roy2363's picture

Joined: 2012-11-18
Posts: 3
Posted: Sun, 2012-11-18 00:40

Can we use this module for ELGG I need this plugin for my social networl with elgg software

Thanks in Advance.

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Thu, 2013-08-08 02:31

Comments are now permitted for this topic.

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Thu, 2013-08-08 03:17

Thanks. There were some breaking changes made by FB - in Nov 2012 and July 2013:

https://developers.facebook.com/docs/reference/plugins/like/

In my initial testing V6 of the module still seems to work. There were some comments in another thread that the module was broken. I'd appreciate any feedback re issues that people are having to guide my updates.

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Thu, 2013-08-08 14:26

I have made some progress. I found some things in version 6 that I could only describe as bugs - things that surely weren't properly tested. Netrunner only made one post so I take it that he's not around to verify some of these suspicions with. Is anyone using version 6 of this script?

Then there is the fact that the FB plugin doesn't behave as expected - faces of friends are not shown when they should; friends who have liked a page don't get listed, they are only there as part of "27 people like this. Be the first of your friends." I have double-checked the code snippets and I don't get this.

Is any one out there who wants to test a beta version 7?

 
Meelistoom

Joined: 2013-03-18
Posts: 6
Posted: Mon, 2013-08-12 16:51
undagiga wrote:
I have made some progress. I found some things in version 6 that I could only describe as bugs - things that surely weren't properly tested. Netrunner only made one post so I take it that he's not around to verify some of these suspicions with. Is anyone using version 6 of this script?

Then there is the fact that the FB plugin doesn't behave as expected - faces of friends are not shown when they should; friends who have liked a page don't get listed, they are only there as part of "27 people like this. Be the first of your friends." I have double-checked the code snippets and I don't get this.

Is any one out there who wants to test a beta version 7?

i tried to install v6 but it sais there is problem with installing v6 like.
i am using: Ubuntu Linux 12.04
Gallery 3.0.9 release

Quote:
 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Thu, 2013-08-15 11:20

Believe it or not, I'm still on 3.0.4. I need to upgrade to 3.0.9 to test this. I'd have to release something that's broken in the latest release. I'm currently drowning in image processing, but hopefully next week.

There are still some oddities in the way that the FB like button works, at least on my site. I'd like to get these resolved too, but I'm not optimistic.

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Fri, 2013-08-16 14:30

@Meelistoom - I've now upgraded to 3.0.9 and I haven't seen any problems of the sort that you describe. I will release V7 shortly, but I don't think that it will solve your problems.

I've stumbled across the fact that enabling maximum output compression (9) in the config.php significantly slows down the loading of this module. I'm not sure why, and perhaps it's my server, but setting this to FALSE speeds up the loading of this module, which is important for the Shadowbox module.

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Sat, 2013-08-17 12:54

Attached is V7. I haven't done all that much other than fix some coding errors in V6. It's working for me in G3.0.9.

One thing I have done is allow for different CSS to be applied to the like button in the sidebar and to the like button in the centre column and to the comments box, so if you have applied some custom CSS you may need to make some adjustments.

That said, these social plugins can be a bit erratic, and I'm no expert. That is, sometimes things show up in your wall and sometimes they don't, and sometimes you can see which of your friends have clicked on the like button and sometimes you can't. But I think it's a FB thing - I have double and tripled checked the code that this module produces against what FB provides and I can't see any errors.

 
Meelistoom

Joined: 2013-03-18
Posts: 6
Posted: Mon, 2013-08-19 15:22

Hi, tried this version (v7) of like module and everything works on my site :) many thanks ;)

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Mon, 2013-08-19 23:16

That's great! I have some questions perhaps you can answer about how this module works on your site.

1. If a FB friend of yours likes a page (album or resize image) on your site, do you see their name listed when you visit that page? I.e. Do you see "John Doe and 1 other person likes this" or do you just see "2 people like this. Be the first of your friends."

2. If the answer is yes, and if have show faces enabled, do you see John Doe's face?

3. Does the answer to 1 and 2 differ between the root album and other pages on your site?

I ask because on my site the answer to 1 only seems to be yes on the root album, and the answer to 2 used to be yes on the root album (but not elsewhere I think) but has been no for some time. And I can't see why this is, despite much searching.