Advanced search  

News:

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

Pages: [1]   Go Down

Author Topic: Facebook "Like" button  (Read 12275 times)

0 Members and 1 Guest are viewing this topic.

uk_martin

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 186
Facebook "Like" button
« on: January 18, 2011, 03:35:22 pm »

Is it possible to use this plug-in here - http://forum.coppermine-gallery.net/index.php/topic,60893.0.html  as something that can be modified to show a Facebook "Like" button, instead of the "share" button?

I have tried this myself, by editing the codebase.php file like this:

find:
Code: [Select]
<a name="fb_share" type="button" href="http://www.facebook.com/sharer.php?u={$CONFIG['site_url']}displayimage.php?pid={$CURRENT_PIC_DATA['pid']}&t={$picture_title}">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>replace with:
Code: [Select]
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like show_faces="true" width="450"></fb:like>
In other words, using the script that Facebook provide.

It almost worked. The button installed, but when pressed, although it identified me, and said I "liked" the page, it also gave an error, saying that Facebook "couldn't get back to the page's URL" (or words to that effect)

If someone who knows more about the PHP that is in the codebase file could have a look, it may be a simple fix...I hope. It would be good to have a simple "Like" facility in these galleries.

Thanks in advance,

Martin
http://www.brummiesfans.com/photos/index.html

Logged

TeknoSounds

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 83
    • TeknoSounds
Re: Facebook "Like" button
« Reply #1 on: January 20, 2011, 08:59:22 am »

Theres a post in the share thread near the end that shows the code needed for a like button, though it can be gotten off the Facebook site too.  However the one in the thread will show you what you need to put for the URL and such.  Would suggest checking that out again.

uk_martin

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 186
Re: Facebook "Like" button
« Reply #2 on: January 20, 2011, 11:15:06 am »

This one? - http://forum.coppermine-gallery.net/index.php/topic,65740.40.html

I get another of those "nearly but not quite moments" from this. You can see here - http://www.brummiesfans.com/coppermine/displayimage.php?album=5&pid=42#top_display_media  - that this causes havoc with my theme (or any "Curve" based theme I'd guess).

Any way of getting the button on the side of the image (the one with the "thumbs up") to be the "active" one, and reposition it BELOW the image, and getting rid of the Plain Jane button that currently sits below the image? No need for two buttons, after all.
Logged

profili

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 113
Re: Facebook "Like" button
« Reply #3 on: January 21, 2011, 01:41:26 am »

You don't really need a plugin for this. Just open theme.php of your theme, then under the section
Code: [Select]
// HTML template for intermediate image display of that file find this: {IMAGE}. (you can use ctrl-f to find it). And just under {IMAGE} add the Facebook like code from the Facebook social plugins page. That's all.
Logged

profili

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 113
Re: Facebook "Like" button
« Reply #4 on: January 21, 2011, 01:42:49 am »

Logged

TeknoSounds

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 83
    • TeknoSounds
Re: Facebook "Like" button
« Reply #5 on: January 21, 2011, 08:48:51 am »

right his code broke my template too...had to modify it a bit, play around with the <td> tags some

Can see it in action here:
http://teknosounds.com/tspics/displayimage.php?album=242&pid=27429#top_display_media

ended up using the facebook share plugin to add mine in there, changed in the codebase.php:
Code: [Select]
    $html .= <<< EOT
        <!-- Facebook share -->
<a name="fb_share" type="button" href="http://www.facebook.com/sharer.php?u={$CONFIG['site_url']}displayimage.php?pid={$CURRENT_PIC_DATA['pid']}&t={$picture_title}" target="_new">Share on Facebook</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script><br />
<iframe src="http://www.facebook.com/plugins/like.php?href={$CONFIG['site_url']}displayimage.php?pid={$CURRENT_PIC_DATA['pid']}&t={$picture_title};layout=standard&amp;show_faces=true&amp;width=350&amp;action=like&amp;colorscheme=dark&amp;height=35" scrolling="no" frameborder="0" align="middle"; style="border:none; overflow:hidden; width:350px; height:25px;" allowTransparency="true"></iframe></td>
EOT;

uk_martin

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 186
Re: Facebook "Like" button
« Reply #6 on: January 21, 2011, 01:21:58 pm »

Thanks TechnoSounds, that's cured my problem too.  :)

Martin
Logged

TeknoSounds

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 83
    • TeknoSounds
Re: Facebook "Like" button
« Reply #7 on: January 21, 2011, 02:03:54 pm »

Fantastic to hear! :D

Couple things about that code...  I changed "Share" to "Share on Facebook"....can be changed to whatever you wish
I also shrunk the like button iframe by 100 pixels.  Seemed to fit better.  If you play around with some table work, I'm sure you could get it to look nicer.

newx

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 50
Re: Facebook "Like" button
« Reply #8 on: January 25, 2011, 12:38:46 am »

Hey there,

please tell me, how to configure codebase.php.
I am new to 1.5 and i am not a php freak.
Can you tell us a step by step tutorial to get the buttons work?

Thx

NewX
Logged

papukaija

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 333
Re: Facebook "Like" button
« Reply #9 on: January 25, 2011, 01:12:37 am »

Can you tell us a step by step tutorial to get the buttons work?
1. Dowload the plugin referenced in reply 2.
2. Edit the plugin as described in reply 5.
3. Post a link to your gallery as requested by board rules if you need more specific instructions.
Logged

TeknoSounds

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 83
    • TeknoSounds
Re: Facebook "Like" button
« Reply #10 on: January 25, 2011, 04:30:41 am »

1. Dowload the plugin referenced in reply 2.
2. Edit the plugin as described in reply 5.
3. Post a link to your gallery as requested by board rules if you need more specific instructions.

yup exactly this.  Thanks again for everything papukaija!

newx

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 50
Re: Facebook "Like" button
« Reply #11 on: January 25, 2011, 07:20:46 pm »

Hi there,

thx for the Info - works nearly perfect.

I have one additional question (not sure if i have to open a new thread)
The "Share" Button works, but it doesnt show the picture @facebook
as i saw, the guys above got it working.
Maybe you have clue to fix that problem.
Link to my galerie with share button: http://www.friseur-fragen.de/frisurengalerie/displayimage.php?album=110&pid=3324#top_display_media
Logged

TeknoSounds

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 83
    • TeknoSounds
Re: Facebook "Like" button
« Reply #12 on: January 25, 2011, 08:57:45 pm »

Hi there,

thx for the Info - works nearly perfect.

I have one additional question (not sure if i have to open a new thread)
The "Share" Button works, but it doesnt show the picture @facebook
as i saw, the guys above got it working.
Maybe you have clue to fix that problem.
Link to my galerie with share button: http://www.friseur-fragen.de/frisurengalerie/displayimage.php?album=110&pid=3324#top_display_media

Probably need to move this request to the share thread...but if no one has it fixed up by tonight when I go into work I'll start working on it.  I think it'll be a simple fix.

newx

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 50
Re: Facebook "Like" button
« Reply #13 on: January 25, 2011, 09:08:12 pm »

Hey Tekno,

thx - i also hope for a simple fix and wait for your advise before i post in "share"  Topic . .

Logged

Oenne

  • Coppermine newbie
  • Offline Offline
  • Posts: 17
Re: Facebook "Like" button
« Reply #14 on: January 26, 2011, 07:21:31 pm »

I have the same problem. The "Share" Button works, but it doesnt show the picture in den popup after clicking the share button and no photo on facebook.

Logged

TeknoSounds

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 83
    • TeknoSounds
Re: Facebook "Like" button
« Reply #15 on: January 27, 2011, 04:17:04 am »

Guys this isn't the topic for the share plugin, and after looking at it, I wasn't quite sure how to implement things, however there is a new FB plugin available that might contain everything we're looking for.  Checking it out now. 
Pages: [1]   Go Up
 

Page created in 0.218 seconds with 19 queries.