xml.php creation of Media RSS feed from Gallery2 albums
natec
Joined: 2007-06-21
Posts: 13 |
![]() |
Hi All! I've spent the last two days trying to get my gallery2 to output Media RSS feeds that work with PicLens (http://www.piclens.com/enable), and I think only one thing stands between me and a working implementation. I've been modifying the xml.php file that is part of the XML mini slideshow located at http://www.flashyourweb.com/dokuwiki/doku.php?id=xmlmini, and with my limited knowledge I've been able to get it to output the XML file needed, except the <link> parameter in each <item> is formed with the form /gallery2/main.php?g2_itemId=###, while the links assigned to the thumbnails on my album pages have the rewritten format of /gallery2/v/albumpath/filename.jpg.html I'm including my modified xml.php file at the bottom of this message with the hopes that someone can suggest a clean way to get the photo page links into the <link> parameter. I think the part that I need to figure out how to change lies in the function getLink() or something with the urlGenerator. If anyone else wants to try this, in your local theme.tpl file, beneath this line {if $theme.pageType == 'album' || $theme.pageType == 'photo'} <meta name="keywords" content="{$theme.item.keywords}" /> <meta name="description" content="{$theme.item.description|markup:strip}" /> {/if} add this line {if $theme.pageType == 'album'} <link rel="alternate" type="application/rss+xml" title="MediaRSS:{$theme.item.title}" href="/gallery2/xml.php?g2_itemId={$theme.item.id}" /> {/if} which will declare the RSS feed on each album page. Thanks!! |
|
natec
Joined: 2007-06-21
Posts: 13 |
![]() |
Got it working, thanks to help from suprsidr! the modified xml.php file code is attached. It works great in Safari with the PicLens plugin, and I haven't tested it yet in FireFox on windows with the plugin, but I have no reason to believe it wouldn't work. -Nate |
|
natec
Joined: 2007-06-21
Posts: 13 |
![]() |
Ok, the above works for PicLens in Safari, but not in the FireFox plugin on WinXP. The developers of PicLens are looking into it and suggested that they may have a bug that they need to fix in PicLens Firefox. I'll post back when i hear what they find out. -Nate |
|
Thumper369
Joined: 2006-07-20
Posts: 4 |
![]() |
natec wrote:
Got it working, thanks to help from suprsidr! the modified xml.php file code is attached. It works great in Safari with the PicLens plugin, and I haven't tested it yet in FireFox on windows with the plugin, but I have no reason to believe it wouldn't work. So here is my insanely lame question. I can not find where to put this file. Can someone tell me the path? Thanks! |
|
conorboyd
Joined: 2005-03-29
Posts: 166 |
![]() |
Thumper369 wrote:
So here is my insanely lame question. I can not find where to put this file. Can someone tell me the path? If you look at natec's original post, you'll see the following: So if you use that href as-is, it would appear that you should be placing xml.php in the root of your gallery2 installation. If you put it elsewhere, you'd need to change that href accordingly. HTH, Conor |
|
natec
Joined: 2007-06-21
Posts: 13 |
![]() |
Thanks for answering, Conor... I typed up a reply yesterday and hit preview without the final submit. You are correct- I think you can put the file elsewhere, but I've put it at my gallery2 root, and it has worked for me. Still no update on a working version of PicLens for Firefox Windows working with this RSS feed. At first the developers seemed very willing to investigate, but I haven't heard anything back from them narrowing the problem to their code, firefox's RSS parsing, or a problem with the RSS feeds that our xml.php file is generating. They suggested I try out their new "PicLens Publisher" software for windows (doesn't work on my Mac) that will take a bunch of images and automatically create all of the html and rss files needed for a gallery. I pointed out that it sounds like a great solution for the iLife crowd, but doesn't meet the needs of those using Gallery2, since most people use it for the ease of administration of hundreds and thousands of photos, security features of users and groups, and other powerful features like custom themes, shopping/selling/etc. If you'd like to get in touch with the PicLens developers yourself, to inquire about getting PicLens Firefox on Windows to work with our solution (or at least find out where the problem is), you can shoot them an email at [url]mailto:feedback@piclens.com[/url]. -Nate |
|
conorboyd
Joined: 2005-03-29
Posts: 166 |
![]() |
Nate, One thing I notice in the XML from your xml.php (although it may not be significant), is that when I run it on my gallery, the URLs for the media:content and media:thumbnail tags are fully qualified. e.g. on my gallery, one example is http://gallery.ildica.com/d/8289-2/IMG_1255.jpg?g2_GALLERY... whereas the img src generated on my gallery album page is simply /d/8289-2/IMG_1255.jpg I'm not sure how PicLens does it's matching, but it could be the differences are significant? I haven't looked into the Gallery code enough (or understand enough PHP anyway) to know if there's an easier way to get the shortened URL so that it matches. Thoughts? Conor |
|
natec
Joined: 2007-06-21
Posts: 13 |
![]() |
Hi Conor, I might not be understanding what you are asking... did the xml.php file not work with PicLens in Safari on your website? On my site, PicLens uses the MediaRSS media:content and media:thumbnail tags to get the full size images, and does the matching with the thumbnail links on the album pages, which link to the gallery page showing the full-size image. -Nate |
|
conorboyd
Joined: 2005-03-29
Posts: 166 |
![]() |
Hi Nate, Sorry, haven't tried Safari against my site. If I get time, I might install it on a virtual machine and see if it flies. I was just looking at the example feeds on the PicLens site and comparing them to the feed from my site and the thumbnail links on the album pages. The examples on the PicLens site match exactly (e.g. the media:content tag matches exactly the thumbnail url on the album page), whereas the ones generated by the xml.php on my site don't. For a start they have the GALLERYSID appended. I was simply wondering if this might be significant in how PicLens does it's matching. Cheers, Conor |
|
natec
Joined: 2007-06-21
Posts: 13 |
![]() |
Hi Conor, Ahh... I understand now. Do you, by chance have URL rewrite turned on in Gallery? I do, so the XML is generating objects that look like this: <item> <title>DSC_0304</title> <id>3606</id> <link>http://www.natecarroll.com/gallery2/v/travel/tahiti/Tahiti_Posters/DSC_0304.jpg.html</link> <media:content url="http://www.natecarroll.com/gallery2/d/3606-2/DSC_0304.jpg" /> <media:thumbnail url="http://www.natecarroll.com/gallery2/d/3607-2/DSC_0304.jpg" /> <width>800</width> <height>532</height> <mime>image/jpeg</mime> <description><![CDATA[<a href="http://www.natecarroll.com/gallery2/v/travel/tahiti/Tahiti_Posters/DSC_0304.jpg.html"><img border="0" src="http://www.natecarroll.com/gallery2/d/3607-2/DSC_0304.jpg" width="150" height="100"/></a><br/>DSC_0304]]></description> <guid isPermaLink="false">http://www.natecarroll.com/gallery2/v/travel/tahiti/Tahiti_Posters/DSC_0304.jpg.html</guid> <pubDate>Sun, 24 Jun 2007 03:16:14 -0500</pubDate> </item> The link URL matches exactly what the thumbnail link URL is for a photo on my Album pages. The original xml.php file I modified was giving me links with the GALLERYSID stuff, which didn't work because I was using the URLrewrite feature (and it may depend on how your theme is configured to create links? I'm using Carbon). -Nate |
|
conorboyd
Joined: 2005-03-29
Posts: 166 |
![]() |
Hey there, Yeah, got URLRewrite on. Here's one of the items from my xml.php (which I've tried tweaking a bit already): <item> <title>The Ragged Range across the Rakaia</title> <id>8287</id> <link>/v/DoubleHill/IMG_1255.jpg.html</link> <media:content url="/d/8287-1/IMG_1255.jpg?g2_GALLERYSID=f911f9105e6e4e6a78a713e6d40005f0" /> <media:thumbnail url="/d/8289-2/IMG_1255.jpg?g2_GALLERYSID=f911f9105e6e4e6a78a713e6d40005f0" /> <width>1279</width> <height>853</height> <mime>image/jpeg</mime> <description><![CDATA[<a href="/v/DoubleHill/IMG_1255.jpg.html"><img border="0" src="/d/8289-2/IMG_1255.jpg?g2_GALLERYSID=f911f9105e6e4e6a78a713e6d40005f0" width="150" height="100"/></a><br/>The Ragged Range across the Rakaia]]></description> <guid isPermaLink="false">/v/DoubleHill/IMG_1255.jpg.html</guid> <pubDate>Sun, 12 Aug 2007 20:42:56 -0400</pubDate> </item> And here's the corresponding bit from my album page: <a onmouseover="pic8287.className='ImageFrame_image giThumbnail opacity6'" onmouseout="pic8287.className='ImageFrame_image giThumbnail opacity10'" href="/v/DoubleHill/IMG_1255.jpg.html?g2_enterAlbum=0"> <img src="/d/8289-2/IMG_1255.jpg" width="150" height="100" id="IFid1" class="ImageFrame_image giThumbnail opacity10" name="pic8287" alt="The Ragged Range across the Rakaia" longdesc=""/></a> What I was comparing it with was the sample XML from the Firefox section on the PicLens site (http://www.piclens.com/firefox/photos.xml): <item> <title>Reine-Among-Mountains.jpg</title> <link>http://www.piclens.com/firefox/images/Reine-Among-Mountains.jpg</link> <media:thumbnail url="thumbs/Reine-Among-Mountains_thumb.jpg" /> <media:content url="images/Reine-Among-Mountains.jpg" type="image/jpeg" /> </item> which has relative urls. Soooo, I've still got problems with the GALLERYSID, etc. I haven't tried contacting PicLens directly, but I will do so. Thanks for the conversation, it would be really nice to get this working. ;-) Conor |
|
natec
Joined: 2007-06-21
Posts: 13 |
![]() |
I'm attaching my version of my xml.php that I'm currently using to this message. I see that all of the links in my MediaRSS feed are absolute. Can you check my xml.php against your version to make sure we are using the same code to get the links? I really don't understand why PicLens for Safari works fine on my site and the MediaRSS feeds that I'm generating, while the PicLens for Firefox Windows doesn't. It makes me suspect a bug in the PicLens code, or (since the difference is the browser) a problem with the validity of the MediaRSS feed, where Firefox is pickier. -Nate |
|
malandro95
Joined: 2007-10-16
Posts: 7 |
![]() |
Is there any update on this? I just discovered PicLens and would love to implement it on my Gallery2 site, but unfortunately 95% of the users are on Windows. |
|
malandro95
Joined: 2007-10-16
Posts: 7 |
![]() |
Also, are the instructions above current? I don't find a line in the theme.tpl file that matches the line above. |
|
conorboyd
Joined: 2005-03-29
Posts: 166 |
![]() |
Since I had the above conversation with Nate, I've also been in touch with the PicLens support guys. Sadly, while they were interested in beta feedback on the PicLens Publisher tool they're currently developing, they don't seem at all interested in helping me understand why I can't get PicLens going against my Gallery using Firefox. In terms of where to put the entry in your theme.tpl, just find the <head> tag in your theme.tpl and put it somewhere appropriate close under that. I assume you've made a copy of your theme.tpl file in a "local" subfolder. If you get it going, I'd love to hear about it, but I've put it on the back burner myself for now. Cheers, Conor |
|
natec
Joined: 2007-06-21
Posts: 13 |
![]() |
Yeah, I think there's still no luck with the windows Firefox users. I never really got the PicLens guys to understand that their PicLens publisher software might be great for people to put up a simple web gallery, but that Gallery2 offered a lot more functionality for those that have lots of images or users, or need shopping-cart type features... two different markets that would both benefit from having a working PicLens! -Nate |
|
malandro95
Joined: 2007-10-16
Posts: 7 |
![]() |
I may have some good news for you guys, it is working on my site. I included the following line: <link rel="alternate" type="application/rss+xml" title="MediaRSS:{$theme.item.title}" href="/photos/xml.php?g2_itemId={$theme.item.id}" /> After the following lines in the theme.tpl file: {if $theme.pageType == 'album'} {g->theme include="album.tpl"} I also had to edit the xml.php file as my folder is called photos and not gallery2. That's all I did though and it works great. I wonder if PicLens has corrected the problem? |
|
conorboyd
Joined: 2005-03-29
Posts: 166 |
![]() |
Interesting! With Firefox? Is your Gallery publicly available? Would you be able to share the URL with us so that we can have a peek? Cheers, Conor |
|
malandro95
Joined: 2007-10-16
Posts: 7 |
![]() |
Okay, so check this out. It functions on my work computer, but NOT on my home computer!! Gah! Both are windows, both are on the same version of Firefox. I'm going to play around with it to see what is different. I will probably start by installing all the plug-ins on my home computer that I have at work. Then I will try removing them until I find the magic plug-in. My photo site is not publicly available, but since I am all about sharing, I'll make one album publicly available for a day or two: http://www.theharwoodfamily.net/photos/main.php?g2_itemId=379 I'll let you know when I get it working on my home PC. |
|
malandro95
Joined: 2007-10-16
Posts: 7 |
![]() |
Okay, I don't understand this, but here's the deal. It just so happens that I was trying out a few new plug-ins today. One of them was PicLens. The other was Yoono. So, I installed Yoono on my home PC and now PicLens is working. Go figure. |
|
malandro95
Joined: 2007-10-16
Posts: 7 |
![]() |
Disregard the last. I uninstalled Yoono and it is still working fine. I don't know why it wasn't working at first. |
|
conorboyd
Joined: 2005-03-29
Posts: 166 |
![]() |
Tried your URL thanks. I get the little PicLens overlay on each thumbnail, but clicking on it doesn't do anything (apart from make the little circular throbber rotate at the bottom right of the thumbnail). Installing Yoono didn't make any difference either. PicLens still works fine if I view any Flickr album. Oh well. Cheers, Conor |
|
conorboyd
Joined: 2005-03-29
Posts: 166 |
![]() |
Which version of Firefox are you using? I'm on 2.0.0.7, with Piclens 1.5.11. Cheers, Conor |
|
malandro95
Joined: 2007-10-16
Posts: 7 |
![]() |
That's really odd. I will say that my site is slower than Flickr since the images are typically much larger, but if I get the Piclens icon on the image, it ALWAYS works. The times when it was flaking out, I wasn't getting the Piclens icon on the image. You might try waiting a bit to see if the image eventually comes up. I'm running my webserver out of my basement on a standard DSL line, so it's not real zippy. I'm using FireFox version 2.0.0.7 and PicLens 1.5.11. |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
It worked for me (mostly) on the harwoodfamily site. Loaded very slow. about 20 seconds for initial view. |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
Here is the new feed generator. |
|
natec
Joined: 2007-06-21
Posts: 13 |
![]() |
thanks suprsidr! I just swapped in your new xml.php file for my old modified one, and PicLens worked in Safari just as it had before without any changes needed! I don't have any dynamic albums in my website, so I haven't tested that feature, nor have I tested Windows Firefox PicLens yet. -natec |
|
conorboyd
Joined: 2005-03-29
Posts: 166 |
![]() |
Yeah, thanks Suprsidr. I have downloaded it and will try it out later; I don't have time today. PicLens on FF was working for me (slowly) on the Harwood Family site, so hopefully I'm getting close to getting things going on mine. ;-) More as I have it... Cheers, Conor |
|
conorboyd
Joined: 2005-03-29
Posts: 166 |
![]() |
Hi, I finally got round to trying your latest mediaRSS posted above, Suprsidr. The script seems to be outputting nothing. I changed the embedding URIs on line 30 as appropriate, and it seems to produce no output (e.g. http://gallery.ildica.com/mediaRss.php?g2_itemID=9206) Any further thoughts before I sadly give up trying to get PicLens working in FF? Many thanks, Conor |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
The version included with this player is more refined if you care to give it a try. I'm going to finish adding mediaRSS to the G2 RSS module this week, will let you know when its been reviewed and it available. -s |
|
conorboyd
Joined: 2005-03-29
Posts: 166 |
![]() |
I've tried this new version with the same lack of success on my gallery. It seems to be failing somewhere in the getAlbumList method. It just silently bails out, so the output from the php script is I put a few echos in to see how far it got, and it gets as far as line 304 or thereabouts, and then nothing further: It might be significant, but I'm still runing G2.1, not G2.2: Gallery version = 2.1.2 core 1.1.0.2 PHP version = 5.2.2 cgi-fcgi Webserver = Apache/1.3.37 (Unix) mod_psoft_traffic/0.1 Vortech_PHP/0.1.0-p0 FrontPage/5.0.2.2623 mod_throttle/3.1.2 mod_ssl/2.8.28 OpenSSL/0.9.7e-p1 Database = mysql 4.0.26, lock.system=flock Toolkits = Exif, Gd, NetPBM, ImageMagick Acceleration = partial/21600, partial/900 Operating system = FreeBSD unix11.hsphere.cc 6.1-RELEASE-p12 FreeBSD 6.1-RELEASE-p12 #0: Thu Feb 1 16:50:12 EST 2007 root@unixYY.hsphere.cc :/usr/obj/usr/src/sys/WEB6 i386 Conor Christchurch, NZ |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
you can safely comment out the get call to the albumlist -s |
|
conorboyd
Joined: 2005-03-29
Posts: 166 |
![]() |
Thanks for looking into it further. Better, in that I at least get something now. However, it's not what we were hoping for. ;-) Error loading Entity:Error (ERROR_BAD_PARAMETER) * in modules/core/classes/helpers/GalleryEntityHelper_simple.class at line 50 (GalleryCoreApi::error) * in modules/core/classes/GalleryCoreApi.class at line 2382 (GalleryEntityHelper_simple::loadEntitiesById) * in mediaRss.php at line 328 (GalleryCoreApi::loadEntitiesById) * in mediaRss.php at line 654 * in mediaRss.php at line 661
Conor |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
I believe this change is post 2.1, gallery now requires the itemtype to be passed -s |
|
climber_
Joined: 2007-11-25
Posts: 1 |
![]() |
I got it working on Win XP and FireFox 2.0.0.9 with PicLens 1.5.15, using the first media rss posted by natec on Gallery version 2.2.1 core 1.2.0.1. Even the URL-rewriting works well! Using the media rss posted by supersidr, I got problems with the GALLERYSID. |
|
Banta
Joined: 2006-04-18
Posts: 35 |
![]() |
Not sure what I am doing wrong here. I have tried just about everything I have read. I just want to be able to spit out a media content rss feed for any paticular album in my gallery. I keep getting errors about invalid top level document. Any idea of how this can be done or what I might be doing wrong? Thanks Banta |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
Banta
Joined: 2006-04-18
Posts: 35 |
![]() |
Sent you a PM. And might I say that E2 is far from the bouncing Logo player I had before. Extremely well done! Thank You!!! |
|
Banta
Joined: 2006-04-18
Posts: 35 |
![]() |
This was user error. The feed is working fine. Just to note, it didn't seem to work in IE6. But returns the results fine in IE7 Thanks Banta |
|
eversonl
Joined: 2006-04-13
Posts: 9 |
![]() |
any developments on this? |
|
natec
Joined: 2007-06-21
Posts: 13 |
![]() |
Perhaps someone can help if they know what version of Gallery/PicLens/Safari/FF you're using. It seems like getting this working is rather hit/miss between different versions, and an update in any of the components can cause another to break. I'm still using the xml.php posted in this thread on 10/17, and it still works for me in non-3.0 Safari. Haven't tried in Firefox recently. |
|
eversonl
Joined: 2006-04-13
Posts: 9 |
![]() |
I think I have the standard slide show working does this enable the immersive slides? (the new 3d wall effect) Thanks Lee |
|
ingimundurn
Joined: 2008-02-11
Posts: 1 |
![]() |
First of all I want to thank everybody on this thread After trying almost every combo in these threads the thing that finally worked for me was Natec's first xml.php file and Malandro95's edit of the theme.tpl. theme.tpl (malandro95's way) Quote:
{if $theme.pageType == 'album'} then add the following: Quote:
<link rel="alternate" type="application/rss+xml" title="MediaRSS:{$theme.item.title}" (in my case I removed /gallery2/) xml.php (from natec's first post) Quote:
$ret = GalleryEmbed::init(array('fullInit' => true, 'embedUri' => '/gallery2/main.php', 'g2Uri' => '/gallery2/')); became => Quote:
$ret = GalleryEmbed::init(array('fullInit' => true, 'embedUri' => '/main.php', 'g2Uri' => '/')); multi-site install: Quote:
<?php |
|
eversonl
Joined: 2006-04-13
Posts: 9 |
![]() |
I have tried both the original xml and the mediaRss file, The xml.php file seems closer to it but I dont think either will any one know what I am on about or can help? |
|
eversonl
Joined: 2006-04-13
Posts: 9 |
![]() |
Ok I am getting closer, I have the 3d wall working when I click the firefox plugin icon in the toolbar but I can not get the little play icon to appear on the actual images. I think this is because the output from the rss converts & signes to & which does not relate back to the actual gallery image href. Does anyone know how in xml.php I can stop this extra & appearing? ==================== and click teh lpay icon that appears on the thumbnail when you mouseover. these are old pics and are not set to the right size for best impact |
|
midbar
Joined: 2008-02-12
Posts: 1 |
![]() |
I think I found a possible problem with the xml.php file provided by natec. |
|
natec
Joined: 2007-06-21
Posts: 13 |
![]() |
Hi Midbar- Can you attach a text file with your changes? I have seen weird symbols in my automatically generated RSS feed, and haven't investigated to find out if it's because there was a mismatch between the listed text-encoding type, and the way my webserver was actually serving the file. Does that have something to do with it? -natec |
|
Totoro
Joined: 2002-08-19
Posts: 11 |
![]() |
eversonl wrote:
Ok I am getting closer, I have the 3d wall working when I click the firefox plugin icon in the toolbar but I can not get the little play icon to appear on the actual images. Hi everson I checked out your gallery and the 3D Piclens slideshow seems to work perfectly ! |
|
eversonl
Joined: 2006-04-13
Posts: 9 |
![]() |
Hi Totoro, Yes it does work but only because I have altered the xml.php file to get rid of my issue. Natec my xml output is Quote:
<item> note the & in the link and guid should be I ended up hard coding the link and guid to avoid this extra & but is I can figure out what is putting it there the xml.php file provided by natec would work 'out the box' Any help would be appreciated! |
|
eversonl
Joined: 2006-04-13
Posts: 9 |
![]() |
Here is my file, there are notes in the file, but like I say, its a hack/bodge My issues may be purely related to my joomla embedded gallery using sef urls Cheers Lee |
|
nutsnbolts
Joined: 2004-12-15
Posts: 71 |
![]() |
Ok, I have used the orignal natec xml.php file and the changes that was made into the theme.tpl Not working here for me. |
|