Some Facebook modules I've made

CptGamma

Joined: 2011-04-17
Posts: 1
Posted: Sun, 2011-04-17 21:28

Hi.
First time poster.
I've discovered Gallery about a month ago, along with the Kohana framework (I've been working with CakePHP before, and got disappointed).
Anyway, I wanted to offer my (very) humble donation - 2 tiny modules about Facebook integration:
facebook_admins allows you to add "fb:" tags to mark some Facebook users/pages/applications as the admins of your gallery, mainly used to access Facebook Insights and Comments.
facebook_comment adds the Facebook comment box to the bottom of the image. Very few customizable options.

Installation - Just copy and activate.
I don't know if my modules are worthy of being added to the repository, but I hope someone will enjoy them!

Note from moderator: See http://gallery.menalto.com/forum_module_facebook_comment#comment-386343 for a updated facebook comment module.

AttachmentSize
facebook_comment.zip3.82 KB
 
Kevin Logan
Kevin Logan's picture

Joined: 2006-07-06
Posts: 51
Posted: Sat, 2011-04-23 10:12

Well done. Works perfectly. I find for the FB social plugin (not your work) to work in IE, one needs to add xmlns:fb="http://www.facebook.com/2008/fbml" in the header so that the HTML XMLNS tag reads as: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" xml:lang="en" lang="en">

Well done again & thanks,
Kevin

 
westd05

Joined: 2011-05-10
Posts: 1
Posted: Tue, 2011-05-10 12:37

Hi, thanks for creating and sharing the module! It works great!

 
technotim
technotim's picture

Joined: 2011-06-01
Posts: 2
Posted: Wed, 2011-06-01 22:59

this is awesome, thank you so much. Any way to easily add code to align center, rather than left? I would like the comment box to be centered at the bottom of the page. I already figured out how to make it black (which matches my theme better)

To make it black (or any other color) change this:
modules/facebook_comment/views/facebook_comment.html.php

change the color in this line: <fb:comments style="background:black" href="<?=url::abs_current()?>" num_posts="<?=

as you can see i made mine black to go better with my theme, now if I could only get it centered...

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Thu, 2011-06-02 00:13
technotim wrote:
Any way to easily add code to align center, rather than left? I would like the comment box to be centered at the bottom of the page.

This is an issue with all the various facebook models. I haven't tried so much with this one but I have tried with Dave's module. The problem seems to be that it's in its own iframe, so you can't just use CSS to change its appearance. In theory Javascript is an option, but as it's an iframe from another domain I have a suspicion that the security model in most browsers won't let you tamper with an iframe from another domain. If I find a solution I'll let you know.

U-G

 
splunck

Joined: 2011-06-03
Posts: 8
Posted: Fri, 2011-06-03 11:44

How do I remove the post to facebook option?

 
Amalaswinta

Joined: 2011-06-06
Posts: 67
Posted: Tue, 2011-06-07 03:14

Hi,

absolute love this, however, I'm bumping into two things:

1: under each image I get a warning message "<url to image> is unreachable".
it doesn't make any difference whether I set permissions to fullsize view=true

2: when the check 'post to facebook' is on, the comments only appear on my wall, not in my newsfeed

would you have any idea on how to fix this?

kind regards,
Mélisande

*edit* - this appears to be something with the Facebook plug-in, nothing wrong with your code :)

 
technotim
technotim's picture

Joined: 2011-06-01
Posts: 2
Posted: Wed, 2011-06-08 03:01

Thanks for the reply. One more question. Is there a way to block everything but the name? Right now when people post comments, it says John Doe CEO of Some Company. I just want "John Doe" Thanks!
www.techtronic.us

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Wed, 2011-06-08 06:47

I think the answer is the same - you can format the DIV etc that Gallery3 houses the FB code in, but I don't think that you can format or change the content inside it, for the above reasons.

There seem to be a number of these FB like/recommend snippets that you can grab, and I was wondering if they have a variant that is centred differently, or if there's a centring parameter that you can send when you call the snippet. I have it a long way down my to-do list to go looking for such a thing for Dave's FB like module. You could try looking for such a thing for John Doe - but I don't like your chances.

 
tlq123

Joined: 2011-05-30
Posts: 1
Posted: Wed, 2011-06-08 08:15

thanks for sharing.

 
Amalaswinta

Joined: 2011-06-06
Posts: 67
Posted: Wed, 2011-06-08 14:22
 
bryan145

Joined: 2010-10-24
Posts: 83
Posted: Tue, 2011-07-05 02:40

I love this plugin however I've run into something also, and this only happens in Win7 and IE9. When I view the resized image (the view where the comment box is supposed to appear) within an IFRAME, the comment box disappears. When I view the same resized image directly (bypassing the IFRAME) it's there. You can view the differences here:

IFRAME - http://www.allianceqt.com/htm/gallery.htm
Direct - http://www.allianceqt.com/gallery3/

I suspect this could be a security issue within Win7 and IE9 which is preventing it from being displayed.

 
kevinogrady
kevinogrady's picture

Joined: 2008-12-05
Posts: 2
Posted: Mon, 2011-07-25 20:03

The plugin posts a Twitter thumbnail image to Facebook instead of the image that is being commented on. Has anyone had the same experience? Is there a fix out there for this?

AHONU

 
drAstronomus

Joined: 2011-04-02
Posts: 9
Posted: Wed, 2011-07-27 19:54

Well done. Please add the Comments notify and akismet support for this plugin

 
Amalaswinta

Joined: 2011-06-06
Posts: 67
Posted: Wed, 2011-07-27 20:03
drAstronomus wrote:
Please add the Comments notify

add the facebook code <meta property="fb:admins" content="{YOUR_FACEBOOK_USER_ID}"/> to your theme's page view.
you can then use the moderation tool and you get a notification when someone leaves a comment

 
drAstronomus

Joined: 2011-04-02
Posts: 9
Posted: Thu, 2011-07-28 18:11

I add this code to the 'themes/wind/views/page.html' file, but i dont see any changes

 
Amalaswinta

Joined: 2011-06-06
Posts: 67
Posted: Thu, 2011-07-28 18:29

okay, here's what the first few lines of my page looks like:

<?php defined("SYSPATH") or die("No direct script access.") ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?= $theme->html_attributes() ?> xml:lang="en" lang="en">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta property="fb:admins" content="699406016"/>
<meta property="fb:app_id" content="229817163696672"/>
    <? $theme->start_combining("script,css") ?>
    <title>

line 7 = my user ID. You have to use the numeric id, not a name
line 8 = the app ID. You get this when you get the code for a comment box (http://developers.facebook.com/docs/reference/plugins/comments/)

when you have added those two meta properties you'll have access to the moderation tool (http://developers.facebook.com/tools/comments)
and eventually on your site those moderation tools will show up too.

I hope I explained it clearly enough, I know I had quite a search figuring it all out myself

edit: almost forgot:
I also edited the modules facebook_comment.html.php
it now looks like this:

<?php defined("SYSPATH") or die("No direct script access.");
?>
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js#appId=229817163696672&amp;xfbml=1"></script>
<fb:comments style="background:white" href="<?=url::abs_current()?>" num_posts="<?=
module::get_var("facebook_comment", "num_posts",2);
?>" width="<?=
module::get_var("facebook_comment", "width",650);
?>"></fb:comments>

where in
appId=229817163696672
you of course also have to enter your own app id

 
kevinogrady
kevinogrady's picture

Joined: 2008-12-05
Posts: 2
Posted: Thu, 2011-07-28 18:27

When a user makes a comment with the "Post to FaceBook" option checked, the plugin posts a Twitter thumbnail image to Facebook instead of the image that is being commented on. Has anyone else had the same experience or is it just me? I could not make the above suggestions work either. Help?

AHONU

 
drAstronomus

Joined: 2011-04-02
Posts: 9
Posted: Thu, 2011-07-28 19:25

Thank you very much

 
Amalaswinta

Joined: 2011-06-06
Posts: 67
Posted: Thu, 2011-07-28 19:26

you're welcome, I hope it works :)

 
grishkin

Joined: 2006-10-27
Posts: 23
Posted: Fri, 2011-07-29 03:52
splunck wrote:
How do I remove the post to facebook option?

Any update on how to uninstall this plug in? Unckecking the checkbox does not do it.

 
grishkin

Joined: 2006-10-27
Posts: 23
Posted: Sat, 2011-07-30 05:00
grishkin wrote:
splunck wrote:
How do I remove the post to facebook option?

Any update on how to uninstall this plug in? Unckecking the checkbox does not do it.

Setting `active` to 0 in `g3_modules` where `name` = 'facebook_comment' did the trick. I'd also recommend adding a record to `g3_logs` with `message` = 'Deactivated module facebook_comment' similar to the one you have for `message` = 'Activated module facebook_comment'.

 
Amalaswinta

Joined: 2011-06-06
Posts: 67
Posted: Sat, 2011-07-30 09:09

weird that unchecking didn't work...
although I'm usually a bit more thorough: I uncheck, safe and then delete the module folder from my server :P

 
Jopho

Joined: 2010-11-27
Posts: 15
Posted: Mon, 2011-08-01 04:14
grishkin wrote:
Setting `active` to 0 in `g3_modules` where `name` = 'facebook_comment' did the trick. I'd also recommend adding a record to `g3_logs` with `message` = 'Deactivated module facebook_comment' similar to the one you have for `message` = 'Activated module facebook_comment'.

Hope this isn't a dumb question, but where do I find 'g3_modules' and 'facebook_comment'. Is this under Advanced settings in Admin, or in the database ? I'm having the same problem - module won't deactivate by unchecking box in module section of Admin.
Thanks

 
kristfin

Joined: 2010-12-02
Posts: 11
Posted: Sat, 2011-08-27 17:39

i was just installing this on my site.
one problem though. when i post a comment to facebook, facebook uses the picture from the random picture box on the page. therefore the result is pretty random.

do you know if i can force facebook to use the main picture and ignore the random picture box. i really like the random picture box so I don't want to discard it.
cheers,kf

 
kristfin

Joined: 2010-12-02
Posts: 11
Posted: Wed, 2011-08-31 15:58

after googling around, i found some mentions around setting the
img_src
and
og:image
properties. then the facebook plugin would know what picture to select.

since i'm not much of a php person i'm not really sure how to set it. any ideas?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2011-09-02 00:18

The attachment should fix that.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
kristfin

Joined: 2010-12-02
Posts: 11
Posted: Fri, 2011-09-02 14:11

just when i return triumphantly to say that i had it solved, you had of course done it.
my solution was to add to facebook_admins.html.php

Quote:
echo '<meta property="og:image" content="'.$item->thumb_url(true).'"/>'."\n\r";

your solution is of course much better. setting the og:image, og:title, og:type and og:url

anyway. i re-installed the facebook_admin and your facebook_comment and it works like a charm.

thanks

 
jaesflo

Joined: 2006-05-09
Posts: 45
Posted: Sun, 2011-09-04 05:33

Very Good, I want to change it to Spanish, How

http://www.todoarequipa.com /fotitos

 
abhijitkn

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

Hi,

In 3nids theme I can not see the Facebook comments button in the resized window. Any suggestions?
Here is the link to my Gallery

 
petri
petri's picture

Joined: 2005-12-15
Posts: 253
Posted: Tue, 2011-12-27 11:11

This is a GREAT module ! Thank you so much !

It works great as well !

I think one thing is missing : it's the title of the module (Facebook Comments) that should be displayed in the g-block h2 title..

Does anyone know how I can set this ?

 
floridave
floridave's picture

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

Two ways that I can think of to do this:
1. Edit helpers/facebook_commentr_theme.php change:

		$view = new View("facebook_comment.html");
		$block->content = $view;
		return $block;

to

		$view = new View("facebook_comment.html");
		$block->title = t("Facebook comments");
		$block->content = $view;
		return $block;

or you can edit the view with standard HTML adding the H tags and the title and if you want it translatable use the t() function as used in other modules.

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
petri
petri's picture

Joined: 2005-12-15
Posts: 253
Posted: Wed, 2011-12-28 02:33

Thank you Dave

the first solution works fine.

Will you add it yourself in any update you might have with this module ?

oups...sorry, did not see that you did note develop these...

 
giovanisp

Joined: 2011-12-28
Posts: 3
Posted: Thu, 2011-12-29 21:42

Hi, I was wondering if there's any module for Gallery 3 that allows facebook/googleplus/twitter authentication and then shows albums only to those in the gallery's owner friends list... any guesses?

 
Chasden

Joined: 2012-01-02
Posts: 51
Posted: Mon, 2012-01-09 06:42

Hi,

This has been working perfectly for me until yesterday for some reason. On many of my pages, i get an error message in the comment box "Warning: http://rashadface.com/index.php/MMA-Shoops/Hendo-Bisping-Mortal-Kombat-Finish-Him is unreachable." On other pages, i get no such error, but there is no link to moderate comments anymore. Still on other pages (usually older pages), there are no errors and the moderation tools are there.

When i send ANY of my URLs to the debugger, whether they have an error message or not, i get this (different URLs every time, obviously):

Response Code 500
Fetched URL http://rashadface.com/index.php/MMA-Shoops/chael-silva-rehearsal
Canonical URL http://rashadface.com/index.php/MMA-Shoops/chael-silva-rehearsal

Critical Errors That Must Be Fixed
Error Scraping Page Bad response code

Open Graph Warnings That Should Be Fixed
Inferred Property The og:url property should be explicitly provided, even if a value can be inferred from other tags.
Inferred Property The og:title property should be explicitly provided, even if a value can be inferred from other tags.

Object Properties
og:url http://rashadface.com/index.php/MMA-Shoops/chael-silva-rehearsal
og:type article
og:title chael-silva-rehearsal
og:image
og:updated_time 1325964950

What do i have to do to get this working again?

 
CC Roi

Joined: 2008-08-05
Posts: 24
Posted: Tue, 2012-01-10 21:48

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

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

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

Right now everybody can bring pictures out to Facebook, even if they are protected or hidden.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2012-01-11 04:38
Quote:
even if they are protected

I don't thing that images can be see if the permissions are properly set. The hide module is just that 'hide' not permissions.
I don't think the author has added code to restrict the view if the user is not a guest.
Since I seem to be the one that last updated the module I will have to see what you really want before I code it in.

IMO the any facebook content should not be shown to anybody unless the content can be seen by a guest.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
CC Roi

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

As I wrote in the Facebook like thread: I did not test with actual protected pictures, but commenting on hidden pictures showed them on Facebook. Even if Facebook is not able to drag protected pictures from the gallery, the Facebook elements should not be there as using them on protected content does not make much sense.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2012-01-12 02:55
CC Roi wrote:
even if they are protected or hidden.

CC Roi wrote:
I did not test with actual protected pictures

Please in the future be clear so we don't get confused or jump to conclusions.
Showing content to a user that does not have permissions for, is important and needs attention.

I agree that any facebook content should not be shown to anybody unless the content can be seen by a guest.

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2012-01-12 04:11

Updated the module to give the block a title.
The block and associated <meta og:image, og:title, og:type and og:url /> data is not shown if the guest can't see the item.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2012-01-12 05:20

The other option is to do some CSS tricks.
http://www.langleycom.com/gallery3/index.php/Test1/IMG_1433
try to mouse over the facebook comment block.
Does that sound like a solution? I think just not show the block in the guest can't see it as I have done in the above post.
comments?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
SkipR
SkipR's picture

Joined: 2012-01-23
Posts: 3
Posted: Wed, 2012-01-25 02:07
CptGamma wrote:
... 2 tiny modules about Facebook integration:
facebook_admins allows you to add "fb:" tags to mark some Facebook users/pages/applications as the admins of your gallery, mainly used to access Facebook Insights and Comments.

Where is the link to Facebook_admins code download is it in Facebook_comments download?

Exactly what can you do with the comments? Could you give a simple example of what benefit you get when you use facebook_admins. A screen shot maybe ?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2012-01-25 02:29

CptGamma posted one post 2011-04-17 14:28 and nothing since.
I don't know about this Facebook_admins module.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
SkipR
SkipR's picture

Joined: 2012-01-23
Posts: 3
Posted: Wed, 2012-01-25 06:47

Hi Dave,

The info for http://codex.gallery2.org/Gallery3:Modules:facebook_admins lead me here. There is a link to http://gallery.menalto.com/files/facebook_admins.zip on the page but it fails. Just an observation your name is in page history. Maybe CptGamma will attach it I'll send him a PM.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2012-01-25 14:31

Your name is in the page history as well. At least you know what it is supposed to be. :-) So you know more about it than I.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
CC Roi

Joined: 2008-08-05
Posts: 24
Posted: Wed, 2012-01-25 15:35
floridave wrote:
Updated the module to give the block a title.
The block and associated <meta og:image, og:title, og:type and og:url /> data is not shown if the guest can't see the item.

I just installed and tried the new version. Works for me if the album is not visible by guests. Thank you! :-)

Cheers,
Roi

/EDIT: It still shows 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.

 
Dogen

Joined: 2012-01-09
Posts: 10
Posted: Fri, 2012-01-27 02:44

Hello friends,
First of all thanks for great plugin.
I have a permissions problem, that I don't know how to solove.
When I'm putting mouse cursor over Facebook Comments, there is block that covers the Comments block, that says
"The guest can't view this item.
You will not be able to post a comment for Facebook users."

How can it be solved?
I'v checked permissions and it looks like evrebody have a permissions to view thumbs and ig images.

Thank You!

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2012-01-28 20:01

Dogen,
Sorry, I zipped up the wrong version. I have fixed it now:
http://gallery.menalto.com/files/facebook_comment_FR.zip
Please test and report back.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
fryfrog

Joined: 2002-10-30
Posts: 3236
Posted: Sun, 2012-01-29 00:13

I've improved the facebook_comment module in a few ways. I added the ability to pick between the light and dark color schemes and added fields for both your own appId and your Facebook numeric user id so that you can moderate your comments.

Edit: Oops, didn't realize floridave was working on this module at the same time. I've re-incorporated his changes into my changes.

_________________________________
Support & Documentation || Donate to Gallery || My Website

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2012-01-29 01:17

Thanks fryfrog,
Glad you are coming out of the woodwork. :-)

Dave
____________________________________________
Blog & G2 || floridave - Gallery Team

 
fryfrog

Joined: 2002-10-30
Posts: 3236
Posted: Sun, 2012-01-29 15:23

And this is probably it from me for this module:

I fixed the uninstall / deactivate issue. It didn't seem that there was any need for the uninstall routine, so I just made the file blank. Deleting it works too, but of course anyone with the module existing already would have to remember to do it... so the one in this zip files is just a single line.

I also added a check box toggle to show the comments on albums and/or photos, in case you wanted in multiple locations (kind of like floridave's like button module)
_________________________________
Support & Documentation || Donate to Gallery || My Website