Per Photo 'Like' Almost there?
  • I am new to this whole thing, so please forgive my ignorance. I have a wordpress site that has a gallery. That gallery has prettyPhoto. I am wanting to do a per picture like, which should be easy as each picture has it's own unique URL.

    Here is what I have done.

    1. replaced the 'alt' with 'longdesc' in pp_titles
    - 'longdesc' carries the URL to the page with the image and Facebook meta tags
    2. put this in the changepicturecallback:


    function(){$('.pp_social').html('<div class="pp_social"><div class="twitter"><a href="http://twitter.com/share&quot; class="twitter-share-button" data-count="none">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="facebook"><iframe src="http://www.facebook.com/plugins/like.php?locale=en_US&href='+pp_titles+'&amp;layout=button_count&amp;show_faces=true&amp;width=500&amp;action=like&amp;font&amp;colorscheme=light&amp;height=23&quot; scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:23px;" allowTransparency="true"></iframe></div></div>');}"


    **I did this because the URL was not updating on the facebook button itself unless you manually refreshed the page.

    The Problem:

    When I drop in the 'pp_titles' where 'location.href' used to be I get the entire array instead of a the current URL. In other words, I get all the URL's of all the posts on the page.

    Here is the site http://mmch.bigdigi.net/archives/category/gallery/


  • Everything seems to be working properly now. I replaced 'pp_titles' with pp_titles[set_position].

    If anyone would like more of an explanation let me know.
  • hello cramerhwood. i need to do the same to my website - one LIKE per picture - instead of one per gallery.

    could you please explain me exactly what has to be done step by step? im not too at programming.

    thank you very much!
  • Hello! This is not working for me. When I click the Facebook "Like" button, it shows for a little while (less than a second) the liked state button (grey), but then it gets back to the Like button. And nothing is shared in my facebook. Any help? Link: http://gnomo.fe.up.pt/~teupwww/novo/fotografias.php?ano=2008
  • Go here http://forums.no-margin-for-errors.com/discussion/comment/3460/#Comment_3460 and download Vladimir's version of the program and the CSS.
    Find the language code "ru_RU" and change it to your language. Example: the Portugal is pt_PT or France is fr_FR.

    The facebook and twitter buttons are linked to individual image. Vladimir did a great job.
  • Sorry to hijack a thread. Lee you said facebook links to individual errors, can you check my site to see if my like button is working correctly? (can see it on the other thread you posted on for me)

    I thought the like would link to the prettyphoto viewer and not just the image.
  • Jimmy, revert to the original code which does link the twitter and facebook to the entire gallery and not individual picture. That might solve the problem of the facebook "like" not appearing on facebook pages as well.

    Lee
  • Is Vlad's version not working for anyone else? I try to "like" something and it simply doesn't show on my facebook.
  • Hi! I'm a bit new to this and recently downloaded Vladimir's version to my fine art site:

    Sample gallery http://krandallwilcox.com/galleries/cuba/

    I like the functionality but wondering how to turn off the long path that shows up when you do the facebook "like" so it just links to that gallery.

    What shows up in facebook: "http://krandallwilcox.com/wp-c‚Äčontent/uploads/2009/12/krw_cub‚Äča_bicitaxi.jpg"

    Also, if you wanted to just turn off the Facebook Like feature and just have Twitter how would you do that.

    Thanks for any help.
  • try this code. it works for me

    you have to add these codes to the wp-prettyphoto/js/jquery.prettyPhoto.js

    (document.URL); or (document.location.href);

    and data-url=" '+link+' "

    this is how the code will look

    function _changeTwitter() {
    if (settings.twitter) {
    var link = (document.URL);
    $('.pp_social .twitter').html('');
    }



    just change the via name to you own twitter account name or take it out all together

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Login with Facebook Sign In with Google Sign In with OpenID Sign In with Twitter