Author Topic: Thumbnails in RSS  (Read 51824 times)

0 Members and 1 Guest are viewing this topic.

Offline yousaf

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
Re: Thumbnails in RSS
« Reply #30 on: May 29, 2009, 09:26:05 PM »
just like i want it,
Thanks alot its working  :D

Offline manager

  • Pre-Newbie
  • Posts: 2
    • View Profile
Re: Thumbnails in RSS
« Reply #31 on: August 01, 2009, 03:27:23 AM »
Not sure if I am posting this is the correct area or not but I sat down this weekend and figured a way to get the thumbnails to show up finally. Through google translator I saw that the one person was wanting donations for his mod. their mod looked great but overkill for what I wanted. I just wanted a thumnail to show up.
The main problem I had was that the readers that I was using wanted the direct path and not a relative one. the "./thumbnails" did not work. it had to be "http://www.example.com/thumbnails" in order for them to see it.
I went in and modified an already mod for external thumbnails, instead of taking a chance on things messing up elsewhere, i just renamed it to another function.
You will be modifying 3 files on your site.
rss.php
includes\functions.php
your template directory\rss_item.xml

In the rss.php file
replace
Code: [Select]
'image' => get_thumbnail_code($row['image_media_file'], $row['image_thumb_file'], $row['image_id'], $row['cat_id'], format_rss_text($row['image_name']), ((isset($mode) && !empty($mode)) ? $mode : ""), 1),
with
Code: [Select]
//rss thumbnail mod
//'image' => get_thumbnail_code($row['image_media_file'], $row['image_thumb_file'], $row['image_id'], $row['cat_id'], format_rss_text($row['image_name']), ((isset($mode) && !empty($mode)) ? $mode : ""), 1),
'image' => get_thumbnail_rss_code($row['image_media_file'], $row['image_thumb_file'], $row['image_id'], $row['cat_id'], format_rss_text($row['image_name']), ((isset($mode) && !empty($mode)) ? $mode : ""), 1),
        //

in the includes/functions.php
go to the end of the file
above
Code: [Select]
?>insert
Code: [Select]
//--External thumbnails(modified for rss feed)--------------------------------
function get_thumbnail_rss_code($media_file_name, $thumb_file_name = "", $image_id, $cat_id, $image_name = "", $mode = "", $show_link = 1, $open_window = 1) {
  global $site_sess, $config;
  $mysite = 'http://www.example.com/gallery/';// change this to the path to your 4images gallery

  if (!check_media_type($media_file_name)) {
    $thumb = "<img src=\"".$mysite.ltrim(ICON_PATH,"./")."/404.gif\" border=\"0\" alt=\"\" />";
  }
  else {
    if (!get_file_path($thumb_file_name, "thumb", $cat_id, 0, 0)) {
      $file_src = $mysite.ltrim(ICON_PATH,"./")."/".get_file_extension($media_file_name).".gif";
      $image_info = @getimagesize($file_src);
      $width_height = (!empty($image_info[3])) ? " ".$image_info[3] : "";
      $thumb = "<img src=\"".$file_src."\" border=\"0\"".$width_height." alt=\"".$image_name."\" />";
    }
    else {
      $file_src = $mysite.ltrim(get_file_path($thumb_file_name, "thumb", $cat_id, 0, 1),"./");
      $image_info = @getimagesize($file_src);
      $width_height = (!empty($image_info[3])) ? " ".$image_info[3] : "";
      $thumb = "<img src=\"".$file_src."\" border=\"".$config['image_border']."\"".$width_height." alt=\"".$image_name."\" />";
    }
  }

  if ($show_link) {
    if ($open_window) {
      $thumb = "<a href=\"".$site_sess->url($mysite."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\">".$thumb."</a>";
    }
    else {
      $thumb = "<a href=\"".$site_sess->url($mysite."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\">".$thumb."</a>";
    }
  }
  return $thumb;
}

//--End external thumbnails(modified for rss feed)----------------------------

note under line 4 in the above change
put in the path to your gallery directory just as you would type it in your browser

I tried using other variables from 4images but they did not seem to carry over to the readers so I just hardcoded it in the function.

in the your template folder/rss_item.xml
replace on the 5th line
Code: [Select]
      <description><![CDATA[{item_description}]]></description>
with
Code: [Select]
      <description><![CDATA[<table><tr><td>{item_image}</td><td>{item_description}</td></tr></table>]]></description>

I also did the mods at the top of this post so I am not sure if you need them or not.

and you are finished.

if you look at that last change you will see that you can make this as fancy as you want.
anything between the ![CDATA[ and the ]]> is passed on to the reader without any parsing.
I made mine so that it is a table with 2 cells next to each other with the thumbnail on the left and your description of the image on the right. but you can take it from there if you want more info.

this works with yahoo, google, ie7, firefox, and a few others and passes the feed validation so I think I am good.
I did find one software reader that could not display the image, just broken links, but I think it was on thier end and not mine.

if you want to see this in action...
http://www.budduke.com/gallery/rss.php?action=images

PS: if you go to my site you will see I am using SMF forums with only one login between 4images and SMF (interested?)
It took my about 2-3 weeks to get it to work but they are using thier own database and I used some functions that someone else created for connected to thier product but when I find time I will compare all the changes I did and how hard it would be to pass the info on to everyone.


Thanks, I did the mod on the top of this thread, combined with this and it works! 

Offline whoopiedoo2

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Thumbnails in RSS
« Reply #32 on: August 15, 2009, 07:15:37 AM »
I tried everything, and i can not get this mod to work.
I think my rss.php file is completly different.

Offline popac

  • Pre-Newbie
  • Posts: 6
    • View Profile
Re: Thumbnails in RSS
« Reply #33 on: September 30, 2009, 03:06:36 PM »
Thank you manager, working !  :wink:

Offline satine88

  • Sr. Member
  • ****
  • Posts: 265
    • View Profile
Re: Thumbnails in RSS
« Reply #34 on: November 18, 2009, 11:14:02 PM »
Not sure if I am posting this is the correct area or not but ......

Thanks ! :)



a full quote is not necessary... @Rembrandt
« Last Edit: November 19, 2009, 04:40:18 AM by Rembrandt »

Offline surferboy

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Re: Thumbnails in RSS
« Reply #35 on: September 13, 2010, 09:22:07 PM »
Hi -

Using v1.7.7
Mysql 5.1.47
Php 5.2.13

I have done all the changes for this MOD twice just to make sure and still no luck in getting the images to appear in the RSS feed.  Also, the RSS feed for the index page only shows the logout index page images when I try to copy the RSS feed to say google or yahoo.

Do you think the problem is that all of category permissions in the ACP are set as 'registered users?'  Should I attempt to change the setting in the category permission to 'ALL' for View Category and View Image? 

If so, can someone help with a quick sql query that I can use in phpmyadmin to change the settings? I have upwards of 200 categories now.

Thanks,

Brian

Offline budduke

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
    • http://www.budduke.com
Re: Thumbnails in RSS
« Reply #36 on: September 14, 2010, 01:33:14 AM »
Do you think the problem is that all of category permissions in the ACP are set as 'registered users?'  Should I attempt to change the setting in the category permission to 'ALL' for View Category and View Image?  

If so, can someone help with a quick sql query that I can use in phpmyadmin to change the settings? I have upwards of 200 categories now.

that is interesting, I just tried that on my test server and yes, if all your cat/images are set for registered users, the rss feed is blank, which seems right because you have to log in to see them and they are not just out there for everyone to see.

the way I would change the fields would be in the database admin panel
for the categories
Code: [Select]
UPDATE `4images_categories` SET auth_viewcat = 0
and for the images
Code: [Select]
UPDATE `4images_categories` SET auth_viewimage = 0
replacing the 4images_ with your tables name if you did not use the default settings

UPDATE: you can just change the viewcat setting and it will still work
people can then look in the category and see the thumbnail images but they can not get to the detail page to download the images unless they register
Buddy Duke
www.budduke.com

Offline surferboy

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Re: Thumbnails in RSS
« Reply #37 on: September 14, 2010, 03:26:06 AM »
Hi Buddy Duke,

Thanks, that solved half of the problem. I executed the sql query you provided and in a blink of an eye, all the auth_viewcats were set to 0.  Thanks so much for the assist.

And now, the RSS feed for the index page did add to Google, for which I am ambivalent. I was more focused on the inclusion of RSS feeds in other pages of our website.  However, now there are two problems, one left over and just a coding housekeeping issue.

1. The image still does not appear in the RSS feed. Just the text listing. That's true in the Google feed as well as the internal website RSS feed on another page.

2. I am using an external widget studio that makes some nice looking widgets. It allows for all kinds of options to include in the RSS feed display.  So I did want to list the 'contributor' and the system lists two things: [example@example.com][userid].  The example@example.com is listed on every feed so that's just a coding issue, I'm sure. The [userid] is working properly.

[edit] - found the example@example.com in the RSS.php file. I deleted it. Just left it as $user_email = "";  Just checked and it didn't fix it but RSS feeds are not instantaneous. Hopefully that will solve item 2.
[edit2] - had a look in rss_item.xml and found the author_email code; deleted that from the CDATA section.
[edit3] - scanned this topic again, and I see to be having the same issue that Kurman had,
http://www.4homepages.de/forum/index.php?topic=19647.msg125000#msg125000

but I checked the RSS.php file for the image title and image name fix that he said fixed his problem and I had that in there. When I completely redid this RSS MOD, I followed all the steps of the first page and then added your steps from page 2.

You did ask elsewhere in this post if there were any other mods done on the RSS.php file. The only thing I could find was this:

// Reset session mode
$site_sess->mode = $old_session_mode;

if ($cache_page_rss) {
  save_cache_file($cache_id, $content, true);
}

} // end if get_cache_file()

I will PM you, hoping that is acceptable, to give you access to our website, since it is protected with aMember login.

Thanks again for your help.

- Brian
« Last Edit: September 14, 2010, 04:02:37 AM by surferboy »

Offline Nosferatu

  • Full Member
  • ***
  • Posts: 230
    • View Profile
    • Project-Firepower
Re: Thumbnails in RSS
« Reply #38 on: June 02, 2011, 02:55:09 PM »
Hallo,

ich würde gerne im RSS neben dem Bild die Kategorie, Bildname und Datum dabei stehen haben, aber mir rss kenn ich mich irgendwie gar nicht aus.... und egal was ich schon rumprobiert habe es war nichts sichtbar ...

so sieht es derzeit aus Link

rss.php

<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: rss.php                                              *
 *        Copyright: (C) 2002-2010 Jan Sorgalla                           *
 *            Email: jan@4homepages.de                                    * 
 *              Web: http://www.4homepages.de                             * 
 *    Scriptversion: 1.7.9                                                *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/

$main_template 'rss';

$nozip 1;
define('GET_CACHES'1);
define('ROOT_PATH''./');
include(
ROOT_PATH.'global.php');
require(
ROOT_PATH.'includes/sessions.php');
$user_access get_permission();
include(
ROOT_PATH.'includes/page_header.php');

$site_template->template_extension 'xml';

@
define('RSS_DEFAULT_ITEMS'10);
@
define('RSS_MAX_ITEMS'30);

if (isset(
$HTTP_GET_VARS['items']) || isset($HTTP_POST_VARS['items'])) {
  
$num_items = (isset($HTTP_POST_VARS['items'])) ? intval($HTTP_POST_VARS['items']) : intval($HTTP_GET_VARS['items']);
  if (!
$num_items) {
    
$num_items RSS_DEFAULT_ITEMS;
  }

  if (
$num_items RSS_MAX_ITEMS) {
    
$num_items RSS_MAX_ITEMS;
  }
}
else {
  
$num_items RSS_DEFAULT_ITEMS;
}

if (
$action == '') {
  
$action 'images';
}

function 
cut_at_word($text$length$suffix '...') {
  if (
strlen($text) <= $length) {
    return 
$text;
  }

  
$delims = array(' ''.'',''!''?''-'':''_''/');
  
$text substr($text0$length 1);

  
$positions = array();

  for (
$i 0; isset($delims[$i]); $i++) {
    
$pos strrpos($text$delims[$i]);
    if (
$pos) {
      
$positions[] = $pos;
    }
  }

  if (
sizeof($positions) > 0) {
    
rsort($positions);
    
$text substr($text0$positions[0]);
  }

  
$text .= $suffix;

  return 
$text;
}

function 
format_rss_text($text) {
  
$text format_text(trim($text), 101);
  
$text strip_tags($text);
  
$text safe_htmlspecialchars($text);

  
$text cut_at_word($text250);

  return 
$text;
}

function 
format_rss_html($text) {
  
$text format_text(trim($text), 101);

  return 
$text;
}

function 
get_file_url($file_name$image_type$cat_id)
{
    
$url get_file_path($file_name$image_type$cat_id01);

    if (!
is_remote($file_name)) {
        global 
$script_url;
        
$url $script_url.'/'.$url;
    }

    return 
str_replace('./'''$url);
}

function 
get_rss_enclosure($file_name$image_type$cat_id) {
  if (!
get_file_path($file_name$image_type$cat_id00)) {
    return array();
  }

  
$file get_file_path($file_name$image_type$cat_id01);
  
$url get_file_url($file_name$image_type$cat_id);

  return array(
    
'url' => $url,
    
'length' => @filesize($file),
    
'type' => get_mime_content_type($file)
  );
}

$cache_id create_cache_id(
  
'page.rss',
  array(
    
$user_info[$user_table_fields['user_id']],
	
$action,
    
$image_id,
    
$cat_id,
    
$num_items
  
)
);

if (!
$cache_page_rss || !$content get_cache_file($cache_id)) {
  
$old_session_mode $site_sess->mode;
  
$site_sess->mode 'cookie';

ob_start();

$rss_title format_rss_text($config['site_name']);
$rss_link  $site_sess->url($script_url);
$rss_desc  format_rss_text($config['site_name']);
$rss_lang  "";
$rss_image = array();
$rss_ttl   $cache_page_rss $cache_lifetime 0;
$rss_cat   = array();
$rss_items = array();

switch (
$action) {
  case 
'comments':
    if (!
$image_id) {
      exit;
    }

    
$sql "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits, c.cat_name".get_user_table_field(", u.""user_name").get_user_table_field(", u.""user_email")."
            FROM ("
.IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
            LEFT JOIN "
.USERS_TABLE." u ON (".get_user_table_field("u.""user_id")." = i.user_id)
            WHERE i.image_id = 
$image_id AND c.cat_id = i.cat_id";
    
$image_row $site_db->query_firstrow($sql);

    if (!isset(
$image_row['image_id'])) {
      exit;
    }

    
$cat_id = (isset($image_row['cat_id'])) ? $image_row['cat_id'] : 0;

    
$rss_title .= " - " format_rss_text($image_row['image_name']);
    
$rss_link  $site_sess->url($script_url."/details.php?".URL_IMAGE_ID."=".$image_id);
    
$rss_desc  format_rss_html($image_row['image_description']);
    if (
get_file_path($image_row['image_thumb_file'], "thumb"$cat_id00)) {
      
$rss_image = array(
        
'url' => get_file_url($image_row['image_thumb_file'], "thumb"$cat_id),
        
'title' => format_rss_text($image_row['image_name']),
        
'link' => $rss_link
      
);
    }

    
$rss_cat = array(
      
'name' => format_rss_text($cat_cache[$cat_id]['cat_name']),
      
'domain' => $site_sess->url($script_url."/categories.php?".URL_CAT_ID."=".$cat_id)
    );

    
$image_allow_comments = (check_permission("auth_readcomment"$cat_id)) ? $image_row['image_allow_comments'] : 0;

    
$sql "SELECT c.comment_id, c.image_id, c.user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, c.comment_ip, c.comment_date".get_user_table_field(", u.""user_level").get_user_table_field(", u.""user_name").get_user_table_field(", u.""user_email").get_user_table_field(", u.""user_showemail").get_user_table_field(", u.""user_invisible").get_user_table_field(", u.""user_joindate").get_user_table_field(", u.""user_lastaction").get_user_table_field(", u.""user_comments").get_user_table_field(", u.""user_homepage").get_user_table_field(", u.""user_icq")."
            FROM "
.COMMENTS_TABLE." c
            LEFT JOIN "
.USERS_TABLE." u ON (".get_user_table_field("u.""user_id")." = c.user_id)
            WHERE c.image_id = 
$image_id
            ORDER BY c.comment_date DESC
            LIMIT 
$num_items";
    
$result $site_db->query($sql);

    while (
$row $site_db->fetch_array($result)) {
      
$user_name format_rss_text($row['comment_user_name']);
      
$user_email "example@example.com";

      if (isset(
$row[$user_table_fields['user_name']]) && $row['user_id'] != GUEST) {
        
$user_name format_rss_text($row[$user_table_fields['user_name']]);
        if (!empty(
$row[$user_table_fields['user_email']]) && (!isset($row[$user_table_fields['user_showemail']]) || (isset($row[$user_table_fields['user_showemail']]) && $row[$user_table_fields['user_showemail']] == 1))) {
          
$user_email $row[$user_table_fields['user_email']];
        }
      }

      
$rss_items[] = array(
        
'title' => format_rss_text($row['comment_headline']),
        
'link' => $site_sess->url($script_url."/details.php?".URL_IMAGE_ID."=".$image_id."#comment".$row['comment_id']),
        
'pubDate' => $row['comment_date'],
        
'desc' => format_rss_text($row['comment_text']),
        
'category' => array(
          
'name' => $rss_title,
          
'domain' => $rss_link
        
),
        
'author' => array(
          
'name' => $user_name,
          
'email' => $user_email
        
),
      );
    }
    break;

  case 
'images':
  default:
    
$cat_sql "";
    if (
$cat_id && isset($cat_cache[$cat_id])) {
      
$rss_title .= " - " format_rss_text($cat_cache[$cat_id]['cat_name']);
      
$rss_link  $site_sess->url($script_url."/categories.php?".URL_CAT_ID."=".$cat_id);
      
$rss_desc  format_rss_html($cat_cache[$cat_id]['cat_description']);

      
$cat_sql "AND i.cat_id = $cat_id";
    }

    
$sql "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits, c.cat_name".get_user_table_field(", u.""user_name")."
            FROM ("
.IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
            LEFT JOIN "
.USERS_TABLE." u ON (".get_user_table_field("u.""user_id")." = i.user_id)
            WHERE i.image_active = 1
              
$cat_sql
              AND c.cat_id = i.cat_id
              AND i.cat_id NOT IN ("
.get_auth_cat_sql("auth_viewcat""NOTIN").")
            ORDER BY i.image_date DESC, i.image_id DESC
            LIMIT 
$num_items";
    
$result $site_db->query($sql);

    while (
$row $site_db->fetch_array($result)) {
      
$user_name format_rss_text($lang['userlevel_guest']);
      
$user_email "example@example.com";

      if (isset(
$row[$user_table_fields['user_name']]) && $row['user_id'] != GUEST) {
        
$user_name format_rss_text($row[$user_table_fields['user_name']]);
        if (!empty(
$row[$user_table_fields['user_email']]) && (!isset($row[$user_table_fields['user_showemail']]) || (isset($row[$user_table_fields['user_showemail']]) && $row[$user_table_fields['user_showemail']] == 1))) {
          
$user_email $row[$user_table_fields['user_email']];
        }
      }

      
$rss_items[] = array(
        
'title' => format_rss_text($row['image_name']),
	
	
'image' => get_thumbnail_code($row['image_media_file'], $row['image_thumb_file'], $row['image_id'], $row['cat_id'], format_rss_text($row['image_name']), ((isset($mode) && !empty($mode)) ? $mode ""), 1),
        
'link' => $site_sess->url($script_url."/details.php?".URL_IMAGE_ID."=".$row['image_id']),
        
'pubDate' => $row['image_date'],
        
'desc' => format_rss_html($row['image_description']),
        
'category' => array(
          
'name' => format_rss_text($cat_cache[$row['cat_id']]['cat_name']),
          
'domain' => $site_sess->url($script_url."/categories.php?".URL_CAT_ID."=".$row['cat_id'])
        ),
        
'enclosure' => get_rss_enclosure($row['image_thumb_file'], "thumb"$row['cat_id']),
        
'author' => array(
          
'name' => $user_name,
          
'email' => $user_email
        
),
        
'comments' => $site_sess->url($script_url."/details.php?".URL_IMAGE_ID."=".$row['image_id']."#comments"),
      );
    }
    break;
}

$items '';

foreach (
$rss_items as $item) {
  
$tpl_vars = array(
    
'item_title' => $item['title'],
'item_image' => $item['image'],
    
'item_link' => $item['link'],
    
'item_pubdate' => gmdate('D, d M Y H:i:s'$item['pubDate']) . " GMT",
    
'item_description' => $item['desc'],
    
'item_category' => true,
    
'item_category_domain' => '',
    
'item_category_name' => '',
    
'item_author' => false,
    
'item_author_email' => '',
    
'item_author_name' => '',
    
'item_enclosure' => false,
    
'item_enclosure_url' => '',
    
'item_enclosure_length' => '',
    
'item_enclosure_type' => '',
  );

  if (@
count($item['category']) > 0) {
    
$tpl_vars['item_category'] = true;
    
$tpl_vars['item_category_domain'] = $item['category']['domain'];
    
$tpl_vars['item_category_name'] = $item['category']['name'];
  }

  if (@
count($item['author']) > 0) {
    
$tpl_vars['item_author'] = true;
    
$tpl_vars['item_author_email'] = $item['author']['email'];
    
$tpl_vars['item_author_name'] = $item['author']['name'];
  }

  if (@
count($item['enclosure']) > 0) {
    
$tpl_vars['item_enclosure'] = true;
    
$tpl_vars['item_enclosure_url'] = $item['enclosure']['url'];
    
$tpl_vars['item_enclosure_length'] = $item['enclosure']['length'];
    
$tpl_vars['item_enclosure_type'] = $item['enclosure']['type'];
  }

  
$site_template->register_vars($tpl_vars);
  
$items .= $site_template->parse_template("rss_item");
}

$tpl_vars = array(
  
'channel_title' => $rss_title,
  
'channel_link' => $rss_link,
  
'channel_pubdate' => gmdate('D, d M Y H:i:s') . " GMT",
  
'channel_description' => $rss_desc,
  
'channel_image' => false,
  
'channel_image_url' => '',
  
'channel_image_title' => '',
  
'channel_image_link' => '',
  
'channel_ttl' => $rss_ttl,
  
'items' => $items
);

if (
count($rss_image) > 0) {
  
$tpl_vars['channel_image'] = true;
  
$tpl_vars['channel_image_url'] = $rss_image['url'];
  
$tpl_vars['channel_image_title'] = $rss_image['title'];
  
$tpl_vars['channel_image_link'] = $rss_image['link'];
}

$site_template->register_vars($tpl_vars);

$site_template->print_template($site_template->parse_template($main_template));

$content ob_get_contents();
ob_end_clean();

// Reset session mode
$site_sess->mode $old_session_mode;

if (
$cache_page_rss) {
  
save_cache_file($cache_id$contenttrue);
}

// end if get_cache_file()

header('Content-Type: text/xml');
header('Expires: ' gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');

echo 
$content;


?>


rss_item.xml
    <item>
      <
title>{item_title}</title>
      <
image>{item_image}</image>
      <
link>{item_link}</link>
      <
pubDate>{item_pubdate}</pubDate>
  <
description><![CDATA[
<
table>
<
tr>
<
td>{item_image}</td>
<
td>{item_description}</td>
</
tr>
</
table>]]>
</
description>

 {if 
item_category}
      <
category domain="{item_category_domain}">{item_category_name}</category>
    {endif 
item_category}
    {if 
item_author}
      <
author><![CDATA[{item_author_email} ({item_author_name})]]></author>
    {endif 
item_author}
   
    {if 
item_enclosure}
      <
enclosure url="{item_enclosure_url}" length="{item_enclosure_length}" type="{item_enclosure_type}" />
    {endif 
item_enclosure}
      <
guid isPermaLink="false">{item_link}</guid>
    </
item>


rss.xml
<?xml version="1.0" encoding="{charset}"?>
<rss version="2.0">
  <channel>

    <title>{channel_title}</title>
    <link>{channel_link}</link>
    <description><![CDATA[{channel_description}]]></description>
    <pubDate>{channel_pubdate}</pubDate>

  {if channel_image}
    <image>
      <url>{channel_image_url}</url>
      <title>{channel_image_title}</title>
      <link>{channel_image_link}</link>
	
  <author>{channel_name}</author>
    </image>
  {endif channel_image}

  {if channel_ttl}
    <ttl>{channel_ttl}</ttl>
  {endif channel_ttl}

{if items}
{items}
{endif items}

  </channel>
</rss>


Danke!

mfg
Nosferatu
« Last Edit: June 02, 2011, 03:06:16 PM by Nosferatu »

Rembrandt

  • Guest
Re: Thumbnails in RSS
« Reply #39 on: June 02, 2011, 03:36:26 PM »
..ich würde gerne im RSS neben dem Bild die Kategorie, Bildname und Datum dabei stehen haben, aber mir rss kenn ich mich irgendwie gar nicht aus.... und egal was ich schon rumprobiert habe es war nichts sichtbar ...
ich denke mal mit dem mod bist du ganz gut bedient:
http://www.4homepages.de/forum/index.php?topic=28187.0

mfg Andi

Offline Hello-world

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Thumbnails in RSS
« Reply #40 on: September 29, 2012, 10:13:27 AM »
it works, but in some browsers thumbnails  are not displayed, 

because of an incorrect path :

http://www.site.com/data/thumbnails/1/1.jpg

Instead of http://www.site.com/gallery/data/thumbnails/1/1.jpg

How to correct it?

Offline bigwave

  • Newbie
  • *
  • Posts: 35
  • stuck on the North Shore of Maui
    • View Profile
    • Maui Tropica
Re: Thumbnails in RSS
« Reply #41 on: March 28, 2013, 07:48:43 AM »
Hi,
I'm getting partial success.  On my site in firefox and ie9 when I click on the rss button I get the feed with thumbnails which is very nice :D but when I try to use a feed reader in wordpress no thumbnails :?

In Chrome I get this error message: This XML file does not appear to have any style information associated with it. The document tree is shown below.

The paths in the xml file are good. 

Any suggestions on how to trouble shoot?

Thanks!


Offline budduke

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
    • http://www.budduke.com
Re: Thumbnails in RSS
« Reply #42 on: April 04, 2013, 02:04:00 AM »
Hi,
I'm getting partial success.  On my site in firefox and ie9 when I click on the rss button I get the feed with thumbnails which is very nice :D but when I try to use a feed reader in wordpress no thumbnails :?

In Chrome I get this error message: This XML file does not appear to have any style information associated with it. The document tree is shown below.

The paths in the xml file are good. 

Any suggestions on how to trouble shoot?

Thanks!



The Chrome error is because Chrome does not read rss feeds without adding an extention...
This is what another site said you need to add to get the rss feeds to work.
https://chrome.google.com/extensions/detail/nlbjncdgjeocebhnmkbbbdekmmmcbfjd

Sorry, I do not work with wordpress but I wonder if it might also need a plugin or extention to read rss feeds?
Buddy Duke
www.budduke.com

Offline bigwave

  • Newbie
  • *
  • Posts: 35
  • stuck on the North Shore of Maui
    • View Profile
    • Maui Tropica
Re: Thumbnails in RSS
« Reply #43 on: April 04, 2013, 02:26:36 AM »
Thanks very much!  That helps.  I'll try other rss reader widgets in wordpress.