When I try to insert flickr images, it tells me the url is invalid; isn't http://www.flickr.com/photos/enboig/sets/72157612777810771/ a valid url?

Comments

enboig’s picture

I have also tried one file inside the picasa.inc but it don't work also:
http://picasaweb.google.com/kaos777/YearlyKos#5119063656501095090

error: You have specified an invalid media URL or embed code.

I am using the dev version right now.

alex ua’s picture

Version: 5.x-1.3 » 5.x-1.x-dev
Component: User interface » Embedded Image Field
Status: Active » Patch (to be ported)

Flickr works in 6.x, marking as needs to be ported.

jonathan_hunt’s picture

Doesn't look like any backport has happened. The following code is working for me on Emfield 5.x-1.8 provided I use the URL in the browser address bar when viewing a photo.

+++ contrib/image_ncck/providers/picasa.inc	(working copy)
@@ -46,7 +46,7 @@
 
 function image_ncck_picasa_data($field, $item) {
   $data = array();
-  if (preg_match('!picasaweb\.google\.com/([^/]*)/([^/]*)/photo\#(.*)!i', $item['embed'], $matches)) {
+  if (preg_match('@picasaweb\.google\.com/([^/]+)/([^/\?]+).*?#([^\&]+)@i', $item['embed'], $matches)) {
     $data = array(
       'userid' => $matches[1],
       'album' => $matches[2],
@@ -68,10 +68,19 @@
 }
 
 function image_ncck_picasa_extract($embed = '') {
-  // http://picasaweb.google.com/kaos777/YearlyKos/photo#5119063656501095090
-  if (preg_match('!picasaweb\.google\.com/([^/]*)/([^/]*)/photo\#(.*)!i', $embed, $matches)) {
-    return $matches[3];
+  
+  if (preg_match('@picasaweb\.google\.com/([^/]+)/([^/\?]+).*?#([^\&]+)@i', $embed, $matches)) {
+    $data = array(
+      'userid' => $matches[1],
+      'album' => $matches[2],
+      'photoid' => $matches[3],
+    );
   }
+  
+  if (!empty($data['photoid'])) {
+    return $data['photoid'];
+  }
+
   return array();
 }
aaron’s picture

Status: Patch (to be ported) » Fixed

fixed picasa. flickr had already been.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.