WordPress.org

Ready to get started?Download WordPress

Forums

Facebook Photo Fetcher
[resolved] yntax error, unrecognized expression (7 posts)

  1. benbowler
    Member
    Posted 1 year ago #

    I get the following error with Fancybox on this plugin. Live page: http://new.getdarker.com/getdarker-boat-party-outlook-festival-2012/

    Uncaught Error: Syntax error, unrecognized expression: a[rel=http://www.facebook.com/album.php?fbid=10151222247755185&id=235509725184&aid=504751], area[rel=http://www.facebook.com/album.php?fbid=10151222247755185&id=235509725184&aid=504751]

    http://wordpress.org/extend/plugins/facebook-photo-fetcher/

  2. justin_k
    Member
    Plugin Author

    Posted 1 year ago #

    You have numerous other javascript errors on your page; these other errors need to be fixed before the plugin can be expected to work reliably. See FAQ12.

  3. aherta
    Member
    Posted 1 year ago #

    I have the same issue. For some reason the plugin adds a full url after the rel= instead of just adding the number for the album. This is how it worked in the first version of the facebook photo fetcher plugin, so I changed all the occurrences url to the number for the album like this: rel="10151222247755185"

    You will also have to remove the <!--FBGallery2 10151222247755185 --><!--/FBGallery2--> magic tags as well to prevent it from updating and replacing all your changes with the original code it generated.

    Once I realized this worked properly, I went in to the plugin code and found the line causing the issue. It is in the _output_gallery.php file on line 258.

    Change this:

    $link = '<a rel="' . htmlspecialchars($album->link) . '" class="fbPhoto" href="'.$photo->source . '" title="'.$caption_with_br.' " ><img src="' . $photo->picture . '" alt="" /></a>';

    To this:

    $link = '<a rel="' . $aid . '" class="fbPhoto" href="'.$photo->source . '" title="'.$caption_with_br.' " ><img src="' . $photo->picture . '" alt="" /></a>';

  4. justin_k
    Member
    Plugin Author

    Posted 1 year ago #

    >>For some reason the plugin adds a full url after the rel= instead of just adding the number for the album

    Because just putting a number isn't HTML5 valid, and most users prefer a plugin that generates code which properly validates. You can hack the code as above, but this will break html5 validation. I'd also mention that having a full URL *absolutely* does not cause the plugin to break in and of itself, so if it isn't working for you as-shipped, your error is elsewhere. If it were me I'd be looking for the true cause, rather than hacking the plugin...

  5. aherta
    Member
    Posted 1 year ago #

    Thanks for the suggestion. I will search for the root cause, but for now I needed something that just works right away.

    If I'm not mistaken, this is how the older version of the plugin worked. I checked for any conflicts and I am not getting any errors except for the one benbowler listed above.

  6. justin_k
    Member
    Plugin Author

    Posted 1 year ago #

    Yes, this is how the older one worked (the older one was implemented before HTML5 was widespread). It should work that way, but again it will break html5 validation.

  7. justin_k
    Member
    Plugin Author

    Posted 1 year ago #

    It's probably a conflicting version of Fancybox that's doing it. Older versions had a bug that caused this not to work, and the newest versions are no longer GPL-compatible, so I shipped a version with FPF in which I made a few minor fixes. If you have another plugin that's including an older version of Fancybox, that's probably what's causing it.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic