Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: RSS feed for Kodak EasyShare W1020 Wireless Digital Frame  (Read 6229 times)

0 Members and 1 Guest are viewing this topic.

ff

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 108
RSS feed for Kodak EasyShare W1020 Wireless Digital Frame
« on: July 06, 2011, 07:57:05 pm »

The Kodak EasyShare W1020 Wireless Digital Frame had the ability to show images with help from Framechannel.com. They, however, terminated their services.

This frame also has the ability to show a RSS-feed with images.
Problem is that normally RSS-feeds show the most recent images.

I edited Slider in Coppermine to create a simple RSS-feed which updates every 15 minutes.

I have a file (rss.php) with the code beneath in the root of my album.
Code: [Select]
<?php
/****************************************************************************
This script choose random pics (15 by default) from your coppermine album.
It then creates a rss-feed for the Kodak digital image frame which is refreshed every 15 minutes.
*****************************************************************************/
// Initialisation
define('IN_COPPERMINE'true);

//For all tests only,uncomment the line "required..." and run the script by http://your-site/slider.php
require('include/init.inc.php');
// maximum pics to show
$limit=100;
//clear FORBIDDEN_SET for logged in users with nothing forbidden (not needed in 1.5)
//if ($FORBIDDEN_SET != "") $FORBIDDEN_SET = "AND $FORBIDDEN_SET";
// request of your database
$query "SELECT * FROM {$CONFIG['TABLE_PICTURES']} as p WHERE approved = 'YES' AND filename LIKE '%.jpg' $FORBIDDEN_SET ORDER BY RAND() LIMIT $limit";
// result of request
$result cpg_db_query($query);
// For reading result
$rowset = array();
// Index of tab
$i=0;
// For each pic.....building javascript in php
echo "<rss version=\"2.0\" xmlns:media=\"http://search.yahoo.com/mrss/\">
<channel>
    <title>
$CONFIG[gallery_name]$CONFIG[gallery_description] - $album_name</title>
    <link>
$CONFIG[ecards_more_pic_target]</link>
    <description>
$CONFIG[gallery_description] - $album_name</description>
    <generator>
$CONFIG[ecards_more_pic_target]rss.php</generator>
<ttl>15</ttl>
"
;
while(
$row mysql_fetch_array($result)){
      
//reading filename of pic and other info
      
$filename=$row['filename'];
$image_url $CONFIG['ecards_more_pic_target'];
      
$prefix "normal_";
      
$file="albums".$row['filepath']."normal_".$row['filename'];
               if (
file_exists($file)) {
                          
$prefix "normal_";
               } else {
                          
$prefix "";
               }
        
// path of pic
        
$file="albums/".$row['filepath'].$prefix.$row['filename'];
      
// final check that the file exists, if so, show picture
      
if (file_exists($file)) {
                 
$lien=$file;
      }
        
// building javascript code
        
echo "<item><media:content url=\"".$image_url.$lien."\" type=\"image/jpeg\"> </media:content></item>\n";
        
$i=$i+1;
}
echo 
"</channel>
</rss>"
;

To do:
  • Replace hardcoded "albums/" by "$image_url". When I try this, the URL is gone.
  • Have an extra check in 'last updated' for the 10 last images which are shown more often in this feed.
Logged
Pages: [1]   Go Up
 

Page created in 0.014 seconds with 19 queries.