forum.coppermine-gallery.net

Support => cpg1.4 plugins => cpg1.4.x Support => Older/other versions => cpg1.4 plugin contributions => Topic started by: gtgillis on July 31, 2009, 02:15:18 am

Title: Facebook Plugin
Post by: gtgillis on July 31, 2009, 02:15:18 am
I have made a down and dirty plugin to add a Facebook link at the bottom of each photo.

You can see it in action at my personal and test sites
http://www.sillig.com/coppermine (http://www.sillig.com/coppermine)
http://www.rudebastard.com/coppermine (http://www.rudebastard.com/coppermine)

Both of my sites use a version of CMG that is bridged to Geeklog so your mileage may vary.


[Edit GauGau 2010-03-03]
This plugin has been added to the subversion repository: http://coppermine.svn.sourceforge.net/viewvc/coppermine/branches/cpg1.4.x/plugins/facebook

It has been updated as well to reflect the version checking routines in the plugin manager that are meant to make sure that galleries don't break because of plugins installed that aren't meant for that particular version of the gallery.

Download: https://sourceforge.net/projects/coppermine/files/Plugins/1.4.x/cpg1.4.x_plugin_facebook_v1.4.zip/download
[/Edit]
Title: Re: Facebook Plugin
Post by: Pascal YAP on July 31, 2009, 02:40:56 am
Thanx ! Usefull and small add for all Facebook addict  ;)
Work as expected, a link is visible bottom the picture.

But there is a 404 error after click on it.

Maybe you forgot this JavaScript =>
Code: [Select]
<script>function fbs_click() {u=location.href;t=document.title;window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');return false;}</script>
You must to add it in your plugin.
Title: Re: Facebook Plugin
Post by: jeepguy_1980 on July 31, 2009, 03:07:30 am
Works great for me. No error here.

I tweaked the padding and used a facebook button, instead of text.


I see the error now. When clicking on the link from facebook it comes back to your gallery with a 404 error.
Title: Re: Facebook Plugin
Post by: jeepguy_1980 on July 31, 2009, 03:15:49 am
the problem is that the mod assumes the gallery is installed in the "coppermine" subdirectory.
Title: Re: Facebook Plugin
Post by: Joachim Müller on July 31, 2009, 07:39:29 am
the problem is that the mod assumes the gallery is installed in the "coppermine" subdirectory.
Use
Code: [Select]
$CONFIG['site_url']to determine the actual gallery URL (including the path) instead of hardcoding it.

I have made a down and dirty plugin to add a Facebook link at the bottom of each photo.
Doesn't work with JS turned off, so why is the HTML-link populated in the first place - it will cause a lot of broken links for all spiders and confuse visitors with JS turned off. Nice plugin, but needs improvement.
Title: Re: Facebook Plugin
Post by: gtgillis on July 31, 2009, 12:46:36 pm
Use
Code: [Select]
$CONFIG['site_url']to determine the actual gallery URL (including the path) instead of hardcoding it.
Doesn't work with JS turned off, so why is the HTML-link populated in the first place - it will cause a lot of broken links for all spiders and confuse visitors with JS turned off. Nice plugin, but needs improvement.

I said it was dirty but I'll work on it.
Title: Re: Facebook Plugin
Post by: jeepguy_1980 on July 31, 2009, 04:11:59 pm
This is a version of the plugin I have tweaked for use on my site.  It doesn't require javascript and it autodetects the coppermine folder.

Title: Re: Facebook Plugin
Post by: Pascal YAP on July 31, 2009, 09:21:19 pm
Well done, it work nice  ;)
Title: Re: Facebook Plugin
Post by: Fabricio Ferrero on August 06, 2009, 08:05:00 am
This is a version of the plugin I have tweaked for use on my site.  It doesn't require javascript and it autodetects the coppermine folder.
The image button was not loading for me.

Open codebase.php and search line 48, then search for:
Code: [Select]
<img src="plugins/facebook/facebook_share_button" width=75 height=33 /> and add the ".jpg" to the file name.
Title: Re: Facebook Plugin
Post by: jeepguy_1980 on August 06, 2009, 01:05:47 pm
The image button was not loading for me.

Open codebase.php and search line 48, then search for:
Code: [Select]
<img src="plugins/facebook/facebook_share_button" width=75 height=33 /> and add the ".jpg" to the file name.

That's strange that it worked for me without the .jpg extension. But it's fixed now.
Title: Re: Facebook Plugin
Post by: demultiplexor on August 21, 2009, 09:02:02 pm
Hello, thanks for this plugin.
It is possible to locate the facebook button under the photos border? Maybe near comment box or File information?
Title: Re: Facebook Plugin
Post by: tinorebel on October 23, 2009, 06:10:37 pm
Working fine for me... just out of the box: upload, install and enjoy!

Thanks for the plug in! :)
Title: Re: Facebook Plugin
Post by: tinorebel on October 23, 2009, 06:41:35 pm
mmm.... just found out that this plug-in sets the link in facebook dyrectly to the photo.
Would it be possible to link to the coppermine page containing the photo instead???
Title: Re: Facebook Plugin
Post by: x3 on October 24, 2009, 02:25:48 am
Is it possible to integrate this to EnlargeIt?
I want to add a facebook button in EnlargeIt.
I have noticed that he facebook plugin doesn't show up in images when EnlargeIt is used.
Thanks!
Title: Re: Facebook Plugin
Post by: friendjain1 on November 14, 2009, 08:10:11 pm
Is it possible to make such plugin for orkut??
Title: Re: Facebook Plugin
Post by: Joachim Müller on November 15, 2009, 07:01:02 pm
Your question does not belong into this thread!
Title: Re: Facebook Plugin
Post by: fhj on November 18, 2009, 12:51:33 pm
Thank you for a great plugin, but I have a small problem. When I share a link from my gallery, all I get is the tiny thumbnail when clicking on the link from Facebook.

Any idea why?

This is the page I share.
http://download.atvforumet.com/CP/displayimage.php?album=topn&cat=0&pos=2

This is what it links to.
http://download.atvforumet.com/CP/albums/userpics/10044/thumb_div.jpg
Title: Re: Facebook Plugin
Post by: fhj on November 18, 2009, 01:14:53 pm
No worries. It was the BBcode plugin that made the little problem. Once removed, all is good :-)
Title: Re: Facebook Plugin
Post by: torkio on December 18, 2009, 01:48:47 pm
Is it possible the link to url absoluty ?
now the link is to normal_fileimage


thank ... great work congrats
Title: Re: Facebook Plugin
Post by: gtgillis on December 18, 2009, 04:06:30 pm
Is it possible the link to url absoluty ?
now the link is to normal_fileimage

thank ... great work congrats

The reason I did it that way was because the picture preview does not show up if I link to the page URL but it does linking to the fileimage.
Title: Re: Facebook Plugin
Post by: Toddsc on January 20, 2010, 11:09:54 am
Quote
The reason I did it that way was because the picture preview does not show up if I link to the page URL but it does linking to the fileimage.

Is there a quick and dirty way to change this to link to the page?  I want people to be able to browse the gallery easily after clicking the link.  I'll look through the code, but this would be great.  Thanks!
Title: Re: Facebook Plugin
Post by: Toddsc on January 20, 2010, 09:06:05 pm
I think I came up with a solution that works for me.  As gtgillis noted, he wanted a direct link to the actual photo.  WIth this hack, it will give you the link to the photo, but the user will need to actually pick the right image from the facebook sharer app.

Replace the href portion of the code (this is only part of the line) in line 48 of codebase.php.  I hope I used the bbcode corectly, the preview looks ok, but it took a while to fit it on my screen:

Code: [Select]
<a href="http://www.facebook.com/sharer.php?u={$CONFIG['site_url']}{$CURRENT_PIC_DATA['url']}&{$CURRENT_PIC_DATA['title']}"
 TARGET="_blank" onclick="window.open(this.href,'window','width=626,height=436,resizable') ;return false;">

With this:

Code: [Select]
<a href="http://www.facebook.com/sharer.php?u={$CONFIG['site_url']}displayimage.php?pos=-{$CURRENT_PIC_DATA['pid']}&{$CURRENT_PIC_DATA['title']}"
 TARGET="_blank" onclick="window.open(this.href,'window','width=626,height=436,resizable') ;return false;">
Title: Re: Facebook Plugin
Post by: Joachim Müller on January 22, 2010, 08:47:42 am
TARGET="_blank" is bad btw. Bossing the user around if he wants a new browser window/tab or not is bad - everybody can decide that on his own.
Additionally the attribute itself is deprecated as per standards compliance. Finally, HTML tags and attributes mustn't be written in upper case. Not related to this plugin, but my 2 ct. Seeing the target attribute makes me shiver...
Title: Re: Facebook Plugin
Post by: emjay_smitten on January 25, 2010, 01:19:06 am
Is there perhaps like the facebook plugin a twitter plugin to??
Title: Re: Facebook Plugin
Post by: gtgillis on January 25, 2010, 05:15:13 am
Is there perhaps like the facebook plugin a twitter plugin to??

If you are using Coppermine integrated with Geeklog then yes, twitter and many more shares. The CM stand alone plugin has not caught up yet though.
Title: Re: Facebook Plugin
Post by: styling on February 27, 2010, 03:58:05 pm
Hi,
I installed the plugin and it worked fine for me...but only in firefox browser!
If I try to view the gallery with internet explorer, netscape or opera it doesn't work
I can see the fbshare image button but it's not clickable and also before the button image I see this: html.fb_share_link { padding:2px 0 0 20px; height:216px; }
How can I solve this problem?

have a nice day!
Title: Re: Facebook Plugin
Post by: papukaija on February 27, 2010, 10:07:12 pm
@styling: Please post a link to your gallery.
Title: Re: Facebook Plugin
Post by: fullysynthetic on April 12, 2010, 11:37:54 am
Hi all,

I'd just like to let you know that I have this plugin working in 1.5.3(RC)  :)

I did have to make a change, but that was to just let coppermine know that this plugin will work with this version.

Install the plugin as normal, then you need to edit plugins/facebook/configuration.php so that line 6 has a max version number suitable for 1.5.3. I changed this line so that its as below:

Code: [Select]
$plugin_cpg_version = array('min' => '1.4', 'max' => '1.5.99');
After that, just go to (or refresh) the plugins page (in coppermine) and you should be able to enable the plugin
Title: Re: Facebook Plugin
Post by: Joachim Müller on April 12, 2010, 05:36:10 pm
This plugin is designed for cpg1.4.x, and this board is dedicated to cpg1.4.x plugins. Your posting shouldn't have gone into this thread nor into this sub-board. Please stay out of this thread with issues related to cpg1.5.x.
Title: Re: Facebook Plugin
Post by: michelon on May 29, 2010, 05:04:18 pm
nice plugin,
but what do i have do change, if i want the button to be displayed above the picture. It should be in the row where the other buttons like slideshow, ecard, previous and next picture are displayed.

thanks for a hint
Title: Re: Facebook Plugin
Post by: olaechea on July 06, 2010, 05:35:36 pm
can i change background color?
Title: Re: Facebook Plugin
Post by: olaechea on July 06, 2010, 05:40:58 pm
working ok using LightBox NotesFor.net 3.0
Mousewheel support for filmstrip 0.4

but using Add Pic Downlink Link 1.0 don't work
Title: Re: Facebook Plugin
Post by: ne4x4 on August 06, 2010, 11:36:05 am
Minor issue, hope someone can help with this.

Coppermine version 1.4.27
PHP 5

installed the facebook Plugin works fine except for the following:

from a particular image ie  http://www.mysite.com/coppermine/displayimage.php?album=448&pos=54

the actual link posted on facebook is http://www.4x4uk.org/cpg132/albums/pea+farm/normal_DSCF3620.JPG
which returns a 404 error on the server
anyone know what I need to do to correct this
Many thanks
Title: Re: Facebook Plugin
Post by: ne4x4 on August 06, 2010, 11:39:49 am
also it would be nice if it was possible to post the actual picture as a link rather than just the link
Title: Re: Facebook Plugin
Post by: hlabout on October 06, 2010, 07:05:25 pm
Nice plugin, using it on my coppermine gallery at www.haraldlabout.nl (currently disabled)(running cpg 1.4.29

One question.
Installed the displayimage mod:

Code: [Select]
<a href="http://www.facebook.com/sharer.php?u={$CONFIG['site_url']}displayimage.php?pos=-{$CURRENT_PIC_DATA['pid']}&{$CURRENT_PIC_DATA['title']}"
 TARGET="_blank" onclick="window.open(this.href,'window','width=626,height=436,resizable') ;return false;">

Should it show the image and link together in Facebook.
Currently only a links shows up with text "select miniature image" below it.
No image showing up!!

Any ideas?

Harald
Title: Re: Facebook Plugin
Post by: hlabout on October 09, 2010, 08:51:48 am
When the plugin is installed the facebook button shows up in the center just under the intermediate picture between two picture borders.
Would like to see the button showing up in the right hand lower corner on the intermediate page.
Tried adding several codes into the plugin.
Unfortunately I am not an experienced programmer so all my solutions failed.
Any ideas for this code.

Harald

www.haraldlabout.nl
cpg 1.4.27

Title: Re: Facebook Plugin
Post by: Oenne on January 22, 2011, 02:29:36 pm
Where can i find it for CPG 1.5x ?
Title: Re: Facebook Plugin
Post by: idotal on January 23, 2011, 11:05:11 am
how did u tag some people in the photos?
like on facebook
Title: Re: Facebook Plugin
Post by: PatCPG on July 28, 2011, 04:24:20 am
In order to get Facebook to recognize the image first, you need to add the following to the <head> section.
Look for:
Code: [Select]
if ($CURRENT_PIC_DATA['keywords']) { $meta_keywords = "<meta name=\"keywords\" content=\"".$CURRENT_PIC_DATA['keywords']."\"/>"; }Insert after:
Code: [Select]
    // Add link-rel tag for facebook share button
if (!is_numeric($album)) $meta_fblink .= " - " . $album_name;
$thumb_url = str_replace('normal', 'thumb', $CURRENT_PIC_DATA['url']);
$meta_fblink = "\n<link rel=\"image_src\" href=\"{$CONFIG['site_url']}{$thumb_url}\" />\n";
$meta_keywords .= $meta_fblink;
Works like a dream!
I'm not sure how this is added to to the plugin...  I hope someone else can!
Title: Re: Facebook Plugin
Post by: PatCPG on July 28, 2011, 04:26:55 am
Previous edits were done on displayimage.php
Title: Re: Facebook Plugin
Post by: allvip on June 22, 2012, 07:46:08 pm
it does not work for me.he is in config-plugins,but it has no install icon.it has the error icon. please help.my copermine files and folders is uploaded on my host in a folder named gallery.
my gallery:
http://allvip.us/gallery/index.php
Title: Re: Facebook Plugin
Post by: gtgillis on June 22, 2012, 08:16:10 pm
What version of CM are you running? What version of the plugin are you trying to install?



it does not work for me.he is in config-plugins,but it has no install icon.it has the error icon. please help.my copermine files and folders is uploaded on my host in a folder named gallery.
my gallery:
http://allvip.us/gallery/index.php
Title: Re: Facebook Plugin
Post by: allvip on June 22, 2012, 09:14:28 pm
Coppermine Photo Gallery 1.5.18 (stable) and I download the plugin from page 1 of this threat-cpg1.4.x_plugin_facebook_v1.4.
Where can I find a facebook plugin that works with my gallery?I find nothing on Google.
Thanks.
Title: Re: Facebook Plugin
Post by: gtgillis on June 22, 2012, 09:36:12 pm
The correct plugin for CM 1.5 can be found here -> http://forum.coppermine-gallery.net/index.php/topic,71844.msg348115.html#msg348115 (http://forum.coppermine-gallery.net/index.php/topic,71844.msg348115.html#msg348115)

Coppermine Photo Gallery 1.5.18 (stable) and I download the plugin from page 1 of this threat-cpg1.4.x_plugin_facebook_v1.4.
Where can I find a facebook plugin that works with my gallery?I find nothing on Google.
Thanks.
Title: Re: Facebook Plugin
Post by: allvip on June 22, 2012, 09:55:30 pm
thanks.I will try it
Title: Re: Facebook Plugin
Post by: allvip on June 22, 2012, 10:08:10 pm
it worked.thanks a lot.