C7F.net

What's New
Webcam
Porn Search
Site Map

Gallery latest:

Error

Blog RSS
Gallery RSS


Friends

Rohit's Realm
Linkstew.org
JAZLink.com
ChalkyB
Michy's LJ
Jelly's LJ
Angie's LJ
Eddo's LJ
Brad?

Gallery RSS Generator
 
"c7f.net updating yearly since 2001" --cody (put your comment here)
 

 
Introduction
 
Notice: as of Gallery version 1.4.4, my RSS generator has been integrated into Gallery officially, so you do not need to download my RSS feed if you use version 1.4.4 or newer.
 
The Gallery RSS Generator is a script to generate an RSS (version 2.0) feed for an installation of Gallery. For more information on what RSS is, and why it's nice, see Dave Winer's RSS 2.0 specification. Even though you may not use an aggregator to keep up with your favorite websites, someone who visits your gallery might. Hence, it's helpful for everyone.
 
You may still be thinking, why would someone want to aggregate galleries? See Why.
 
Download Version 0.4
 
Click the title above to download, then just follow these very simple instructions, and you'll be all ready to go. If you want a patch, please scroll down to Older Versions and Patches.
 
  1. Download the file wherever you currently have Gallery installed.

    This might be /usr/share/gallery, /var/www/html/gallery, or ~/public_html/gallery. If you don't know where, try running `locate albums.php`.

  2. (Optional) Add RSS auto-discovery information tags to albums.php, to assist Aggregators:

    <link rel="alternate" type="application/rss+xml" title="RSS" href="rss.php">

    The above belongs inside the <head> section, (line 70 in my version of Gallery, line 79 in version 1.4.1)

  3. (Optional) Add a button pointing to your feed.

    cd html_wrap
    cp -i gallery.footer.default gallery.footer # answer no
    vi gallery.footer

    After the following lines:

    <td nowrap class="head" align="left">
    &nbsp;<?php echo $gallery->app->galleryTitle ?>&nbsp;
    </td>

    Add this tag:

    <td><a href="rss.php" style="background-color:#f60; border:2px outset #ffc8a4; color:white; text-decoration:none; font:bold 10px sans-serif; padding:0px 3px 0px 5px; letter-spacing:1;">RSS</a></td>

  4. (Optional) Change the default configuration: see below.
 
Configuration
 
There are a few adjustments you can make to the feed if you're not totally happy with it. Most notably, is the mode setting, discussed below. Other settings are more just tweaking the output than anything else. The types for these configs are either:

BOOLEAN - either 'TRUE' or 'FALSE', with no quotes.

STRING - a single or double-quoted string, with accepted options described below.

 

  • $mode - (added v0.4) STRING, inset HTML photo modes. If you turn this on, <img> tags will be placed in each item's description. Options for this are:
    • basic - no images at all
    • highlight - all thumbnails
    • thumbs - all thumbnails
    • thumbs-with-captions - all thumbnails AND captions for each
    • mdm - the mystery option

  • $highlightAlbum - (added v0.4) STRING, which album's highlight picture should be the highlight for the whole RSS feed. If set to '*' it will select the highlight image of the most-recently-created album. If set to "", it will turn off the channel highlight feature. (See noBigPhoto below for more info).

  • $onlyFindable - (added v0.3) BOOLEAN, print only findable albums. Suppose you have an album which contains several other albums. To make all those sub-albums inaccessible, you just remove the read permission from their parent album. However, technically those sub-albums are still readable, and will appear in your feed if you set onlyFindable to FALSE. Defaults to TRUE, this behavoir was changed in version 0.3.
  • $noPhotoTag - (added v0.4) BOOLEAN, there are two RSS extensions that allow for images representing items to be linked from feeds. They are: photo:imgsrc and photo:thumbnail (see pheed spec) and pb:thumb (see PhotoBlog spec). These elements shouldn't be damaging at all, even to clients unaware of their meaning, but if you want to turn them off, you can.

  • $noDCDate - (added v0.2.1) BOOLEAN, turn off printing of the <dc:date> tag, which technically makes the feed not a valid RSS 2.0 document, but helps many older RSS clients read the date correctly. Defaults to FALSE.
  • $noBigPhotos - (added v0.4) BOOLEAN, the whole channel can have one highlight image, but it can be no more than 144 pixels wide and 400 pixels tall. Since most galleries have thumbnails 150 pixels wide (for landscape photos), a small amount of clipping may occur on some clients. So most people won't really even notice, we lie about the sizes if the thumbnail is too big. If some clients complain that the channel thumbnail is garbled in their news reader because of the bogus size, you can set this to FALSE to turn that feature off, but it will cause your RSS feed to not validate.
 
Why Syndicate
 
I update my gallery often. Occasionally four or five times per month, if not more. And my friends and family who read the site typically like to know about new photos as much as new blog entries or whatever else. Therefore, syndicating makes sense.
 
Even if you don't update this often, syndication can be useful. I have ten or twelve friends with galleries updated at different frequencies. Rather than checking each frequently, I just read my aggregator every day, and it will inform me if there have been updates.
 
Change Log
 
Version 0.4 (2004.04.25)
  • Much better international support
  • Better guessing about creation times of albums
  • Highlight thumbnail for each album, via pheed or PhotoBlog extension, or inset HTML
  • Highlight thumbnail for whole gallery, either latest album, or one specified in config
  • Photos inside description tag, either single highlight, all photos, or all photos and captions
Version 0.3 (2004.01.17)
  • onlyFindable option to make RSS feed of only albums users could find (that is, not albums they can technically access, but are within albums they cannot access)
  • Removed non-printable characters (thanks to Pierre Gailly (PG))
  • Added support for international dates (thanks to PG and Jason Guinn (JG))
Version 0.2.1 (2004.01.08)
  • noDCDate option to make feeds fully compliant
Version 0.2 (2004.01.02)
  • Suppress empty tags
  • Implement permissions support
  • Properly encoded HTML special characters
Version 0.1 (2003.12.27)
  • Initial coding and framework
 
Older Versions and Patches
 
Because they're almost totally useless, versions prior to 0.2.1 are not available (actually, I will admit, I didn't even save them). The currently available versions are:
 

 
Also, if you've made changes to the script that you don't want to lose, you may be more comfortable with a patch:
 

 
To patch your copy, simply download the patch file and run on the command line:
cd [location of rss.php]
cp rss.php rss.php-backup
patch < [patchfile]
 
Feedback
 
If you have any suggestions, questions or comments, please email cody@rescomp.berkeley.edu.
 

Syndicate This Page Back to the Top

 
This page best viewed while dangerously intoxicated.
 

codythefreak.net, or c7f.net is not copyrighted, reserved, limited, restricted, or private. Information is always inherently free.

If I don't want you to read, view, or plagarize something, I won't post it up. Courtesy appreciated 2001-2006.
Up 82 days, 4:37.