Advanced search  

News:

cpg1.5.46 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter recently discovered vulnerabilities. It is important that all users who run version cpg1.5.44 or older update to this latest version as soon as possible.
[more]

Pages: [1] 2 3 4 5   Go Down

Author Topic: Social Sharing Plugin (Facebook Like/FB Share/FB Comments/Twitter/VZ zeigen)  (Read 72963 times)

0 Members and 1 Guest are viewing this topic.

1aB

  • Contributor
  • Coppermine novice
  • ***
  • Country: de
  • Offline Offline
  • Posts: 29
    • Home Page

Due to some popular demand here's a Coppermine plugin to put a selection of buttons for a few social networks on the picture page.
Now that I am finished as far as this, I notice there is already an existing plugin which seems to do similar things, Facebook Sharer.

Now if you also want to try this one, it has quite a bunch of config options, as I wanted to hardcode only as little as possible.

Specifically in Facebook it seems to be actually quite a puzzle to predict when or when not a thumbnail will be shown. Although all elements are always provided with a thumbnail image by this plugin, I have managed to only get Facebook to display it right away when either using the old sharer.php, or the Like button but then needing to enter something into the balloon that turns up when liking something. As all of this seems to be functionality inside Facebook, I would not be surprised if it may change every once in a while. If anyone knows a way to provision Facebook into always displayng the thumbnail -- please let me know and/or contribute.

This plugin works together with fb_oauth but can also be used independently of it.

Install via the plugin manager. Check the configuration options; I hope the inline explanations with them are clear.

Important: On a picture page double-check the HTML code that arrives in the browser to make sure that it contains OpenGraph metatags:
Code: [Select]
<!-- BEGIN OpenGraph metatags -->
<meta property="og:site_name" content="..." />
[...]
<meta property="og:url" content="..." />
<!-- END OpenGraph metatags -->
These tags missing is a known issue with the XFeed plugin and possibly others that also use the page_meta hook. Please fiddle with the plugins order in the plugin manager until these tags really appear in the picture page header. For Facebook you might also find the Facebook Linter useful to check what those information mean for Facebook.

Many thanks for lots of useful ideas and testing go to Thomas Behlke of the Fotofreunde Rathenow who, just as myself, is amazed with all the opportunities that Coppermine and its plugins can offer.

If you like this and can implement even more additions or social networks or improve the (default) layout, please feel free to contribute and extend the code and share it back in this thread.

Now I hope that this may be really some use for some people out there :-)

Best Regards,
Roland
« Last Edit: January 29, 2011, 10:18:22 PM by 1aB »
Logged

1aB

  • Contributor
  • Coppermine novice
  • ***
  • Country: de
  • Offline Offline
  • Posts: 29
    • Home Page

Actual plugin is now in the initial post (edited).
« Last Edit: January 27, 2011, 12:42:17 PM by 1aB »
Logged

TeknoSounds

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 83
    • TeknoSounds

Checking this out now :D Thanks!

TeknoSounds

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 83
    • TeknoSounds

looks good so far :)
I'm liking all the options

However, having one issue with my comments box...  I'm getting an error stating the feature is not enabled for my domain, yet I can't find an option anywhere (like in your settings or in the application developer settings on FB) that "turns on" this feature. 

Any help?

cmfa

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 226

Hi,

Facebook shows you the page title. Here you have to limit the length of your domain.

Example:

not so http://teknosounds.com/tspics/index.php?cat=10

better so http://teknosounds.com/tspics/

then it should work

VG CMFA
Logged

TeknoSounds

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 83
    • TeknoSounds

Hmm, the application I'm using is set up for my vbulletin forum, but everything points to just http://teknosounds.com/
So, if I understand you correctly, I'm going to either need to change the URL referenced to http://teknosounds.com/tspics/ or make a new application just for the coppermine gallery?

1aB

  • Contributor
  • Coppermine novice
  • ***
  • Country: de
  • Offline Offline
  • Posts: 29
    • Home Page

Hi TeknoSounds,

the problem is likely that the OpenGraph metatags are missing in your gallery, check the HTML source of your picture page ...those metatags are probably eaten up by some other plugin.

Try to change the oder of the plugins in the plugin manager.
Or fix the other plugin :-), so that on the page_meta hook it does not create new content but appends to the input parameter that it received from Coppermine. (Initially I had made the same mistake in social_sharing's page_meta hook -- in social_sharing this is now fixed so if social_sharing's page_meta is called last, it does not eat up the other plugin's page_meta result.)

Hope this helps.
Roland
Logged

TeknoSounds

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 83
    • TeknoSounds

Well that was the case, the meta tags weren't showing. Now I've corrected the order and they're showing, but its still telling me:
Quote
This feature is not yet enabled for your domain, teknosounds.com

i.e. http://teknosounds.com/tspics/displayimage.php?album=242&pid=27365#top_display_media
(can view source and see the og meta tags as well)


now then, i've used the application I initially set up for my site for vbulletin, however, that setup didn't require anything special being done to the app, just setting the URL to the base site and domain to the domain.  Nothing else has been set as far as I can see.  But I don't see any options for "enabling comments for my domain" nor is there any help on the plugins section for fb for the comments.

cmfa

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 226

Hi,

yes you have to create new App ID, then enter back into the plugin and then it should go.

VG CMfA
Logged

cmfa

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 226

hi@all


Many thanks for lots of useful ideas and testing go to Thomas Behlke of the Fotofreunde Rathenow who, just as myself, is amazed with all the opportunities that Coppermine and its plugins can offer.


Please note the link to this gallery is here http://fotofreunde-rathenow.adtg.de/Teil5

VG CMfA
Logged

1aB

  • Contributor
  • Coppermine novice
  • ***
  • Country: de
  • Offline Offline
  • Posts: 29
    • Home Page

Right, now the metatags are there. As far as I can judge, the approach with using the same AppId for the forum and for the gallery when both are under http://teknosounds.com/ and that is registered with Facebook, should be fine.

But wait... today I am getting that message in my gallery, too; when I try the comments box :-(
Seems Facebook is making some changes currently....?? A little bit clueless about this at the moment ???
Logged

1aB

  • Contributor
  • Coppermine novice
  • ***
  • Country: de
  • Offline Offline
  • Posts: 29
    • Home Page

Try this. This one works for me ...at least today ;)
Background and reason why I think it would work tomorrow, too:
v1.0 had specified <fb:comments href="..."> but href is actually not a documented attribute, in fact it seems to me now it has triggered some Facebook-internal functionality, which I *suspect* is why Facebook is blocking it now.
v1.1 is now specifying only <fb:comments url="..."> and that is per the Facebook JSDK doc the correct way to refer the containing page.
Logged

TeknoSounds

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 83
    • TeknoSounds

Works!

But now I have a double Like button?

Does the new comment box have a like button attached to it now?  kinda looks like it...

TeknoSounds

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 83
    • TeknoSounds

Yupyup looks so.
Removed the individual Like button and looks much better now :)

TeknoSounds

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 83
    • TeknoSounds

Request:
I want to post a link of my album on FB, but it doesn't pull a thumbnail for the album... is that a meta tag thing? Easily fixable or gonna require some effort?

newx

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 50

I get this error:

Fatal error: Call to undefined function: http_build_query() in /homepages/29/d320159611/htdocs/friseurfragen/frisurengalerie/plugins/social_sharing/codebase.php on line 209

Logged

newx

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 50

Sorry: I get the above shown error also when i try to config the plugin.
there are no other plugins activated except this one.
Logged

newx

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 50

@TeknoSounds
How do you get the facebook comments work in your gallerys? or is it part of the plugin?
(As posted above, i cant see the config options of this plugin cause of erroro i posted)

Greetz X
Logged

TeknoSounds

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 83
    • TeknoSounds

Make sure to grab version 1.1 in a couple posts above mine

1) You need to create a facebook application
2) Input the facebook appid into the appropriate field in config
3) Turn on comments in config

hopefully that gets it for you

1aB

  • Contributor
  • Coppermine novice
  • ***
  • Country: de
  • Offline Offline
  • Posts: 29
    • Home Page

@newx: oops, the message about http_build_query() probably means that I am using PHP5 and have not taken care of compatibility with PHP4.

@TeknoSounds: make Facebook show thumbnails seems to be quite unpredictable :-) But idea for using this for album level, too, is good ...will require some effort, though.
Logged
Pages: [1] 2 3 4 5   Go Up
 

Page created in 0.081 seconds with 22 queries.