4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: Chris on June 04, 2005, 01:06:09 AM

Title: [MOD] RSS Feed 0.1
Post by: Chris on June 04, 2005, 01:06:09 AM
Originally posted by falti.  This is being restored from saved search engine cache pages

Installation:
1. Open rss.php and modify CONFIG values.
2. Upload rss.php to 4images root directory. Upload rss.html and rssitem.html to your template directory (i.e. templates/yourtemplate/).
3. Modify your template that user have a link to rss.php. Or simply upload the modified footer.html to your templates folder.

Notes:
Currently there is no check if a user is allowed to view an image presented via rss. This is due to the fact, that a user reading the rss feed is not logged in to the 4images system. If you find a solution for this problem feel free to modify the script and let me know how you made it.
If most of your categories are open for unregistered users then you can use a sql statement similar to index.php.
Title: Re: [MOD] RSS Feed 0.1
Post by: Chris on June 04, 2005, 01:11:47 AM
Originally posted by ptitpierre
That's fine, but when I am not logged in and when I select a picture which is in a private category (I mean you must be logged in to see the pic) I have the Index page.

Is there a possibility to have différent RSS feeds according to the user logged in (or not logged in for visitors) ?

Thanks in advance !

Pierre

Originally posted by nette
Parse error: parse error, unexpected T_STRING in /home/electrii/public_html/gallery/includes/template.php(101) : eval()'d code on line 1


http://ataraxy.net/~electrii/gallery/rss.php

if someone could help me out I would be grateful

---

Hmm I think it's funny how I posted under the correct forum to get help for this mod the first time and I never got a response so I posted somewhere else thinking maybe no one read this one and I get this

http://www.4homepages.de/forum/viewtopic.php?t=3914
#5 from one of the moderators.

Now I am posting back under the same original thread for the mod and still no reply. Doesn't make any sense to me.

Originally posted by falti
It was a quick and dirty hack. I thought someone could use it, modify it whatever. I am currently busy and cannot give support. I also have the problem that the hack works fine at my 4images version (4images 1.7) so why don't you look at /home/electrii/public_html/gallery/includes/template.php(101) : eval()'d code on line 1
and try to fix it by yourself?

Originally posted by graficalicus
just a little help needed for this - which is working well, BTW - but one issue:

If a user uploads an image, and in their comments about the image they include a URL or a " ' " character (like "it's" or "your's" or 'look out below!' ) it craps out the RSS feed -

I need a stripslashes kind of command - but I'm not sure where to place it - so these characters don't interrupt the feed -

this is the complete rss.php file:
Code: [Select]
<?
/*************************************************
 * RSS Feed for 4images                          *
 * beta 0.1                                      *
 * Email:
 */

//------------ CONFIG ----------------------------

$num_new_images = 10;
/*
 u can uncomment this, if you want to use config variables from 4images config
 $num_new_images = $config['image_cells'];
*/

//because we have no session here, we have to hardcode this values
define('SCRIPT_URL', 'http://digiart.graficalicus.com'); //no trailing slash
define('LANGUAGE', 'en-us');

define('ROOT_PATH', './');

//----- END CONFIG--------------------------------------------

include(ROOT_PATH.'global.php');
$main_template = 'rss';



$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, c.cat_name
        FROM ".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c
        WHERE i.image_active = 1 AND c.cat_id = i.cat_id
        ORDER BY i.image_date DESC
        LIMIT $num_new_images";
$result = $site_db->query($sql);
$num_rows = $site_db->get_numrows($result);
$format="Y-m-d\TH:i:s+00:00"; //the time format for rss date
while($image_row = $site_db->fetch_array($result)){
  $site_template->register_vars(array(
                  "title" => $image_row["image_name"],             
                  "description" => $image_row["image_description"],
                  "category_domain" => SCRIPT_URL."/categories.php?cat_id=".$image_row["cat_id"],
                  "category" => $image_row["cat_name"],
                  "link" => SCRIPT_URL."/details.php?image_id=".$image_row["image_id"],
                  "date" => format_date($format,$image_row["image_date"]),
                  ));
  $new_images.=$site_template->parse_template("rssitem");
 }

//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(
               array(
                "ctitle" => $config['site_name'],
                "clink" => SCRIPT_URL,
                "cdescription" => $config['site_name']." Last 5 images",
                "language" =>LANGUAGE,
                "ititle" =>"digiart galleries at the graficalicus workshop",               
                "iurl" => SCRIPT_URL."/digiart-graf_banner.gif",
                "ilink" => SCRIPT_URL,
                "items" => $new_images,             
                )
               );
header("Content-type: text/xml");
$site_template->print_template($site_template->parse_template($main_template));
?>


thanks in advance -

Originally posted by falti
"description" => stripslashes($image_row["image_description"])

this should work (not tested).

Originally posted by V@no
I dont know exactly how all this RSS works, but would it be a problem if someone use < and > signs in the description (url html link)?
if so, u'll probably need to replace them with &lt; and &gt;
As of the appostrophe, why would it give any problems if RSS uses tags simular to HTML? just curious.
I dont know exactly how all this RSS works, but would it be a problem if someone use < and > signs in the description (url html link)?
if so, u'll probably need to replace them with &lt; and &gt;
As of the appostrophe, why would it give any problems if RSS uses tags simular to HTML? just curious.

Originally posted by AntiNSA2
his mod works great for me in opera.... I wanted to add one thing

open up header.html and add this
Code: [Select]
<link rel="alternate" type="application/rss+xml" title="TheCenterOfTheNet All Lives Stills Newest Images Feed" href="http://www.thecenterofthenet.com/4images/rss.php" />to get an RSS button to appear in opera/fav browser......

But my request would be if you could modify this mod ...

Some people use different templates for different categories.... it would nice to beable to place this within category specific template that way the user could only select feeds from the categories they are interested in in addition to the newest images for the whole database.

Thanks!
Title: Re: [MOD] RSS Feed 0.1
Post by: graficalicus on June 04, 2005, 07:40:05 PM
(posted in the Member Template Select (http://www.4homepages.de/forum/index.php?topic=6220.0) thread also, but I guess I should have poted here...  :oops: )


Can anyone help with "hard-coding" this RSS  to a special category template?   When I install the Member Select Template MOD, it moves code from global.php to sessions.php, making the two MODs incompatible with each other  :(

Does anyone have a solution?  Thanks-
 
 
Title: Re: [MOD] RSS Feed 0.1
Post by: Maweryk on June 09, 2005, 12:26:58 AM
It is possible to add thumbs?

Cheers,

Markus
Title: Re: [MOD] RSS Feed 0.1
Post by: firefall on June 09, 2005, 08:00:30 PM
4Images Version: 1.7.1
Mods already added: Memberlist, Cat Image, Mass Image Edit, Star Rating
Site: http://www.lunaescence.com/fanart/

Error:
Code: [Select]
Parse error: parse error, unexpected T_STRING in /home/*******/public_html/fanart/includes/template.php(101) : eval()'d code on line 1
Has anyone figured out why this error happens?

I tried fixing it myself, but nothing has worked.  I even tried commenting that whole section ("Don't show error notces") out as an experiemnt.

Line 101 in template.php looks like this:

Code: [Select]
eval("?>".$template."<?php return 1;");
I'm about to give up, since I can't figure out what the problem is.  But I'd really like to use this mod, since the rest of my site has RSS.  Any thoughts?

Thanks
Title: Re: [MOD] RSS Feed 0.1
Post by: graficalicus on June 09, 2005, 10:04:34 PM
try this -
in rss.php, find
Code: [Select]
include(ROOT_PATH.'global.php');and just below it add
Code: [Select]
include(ROOT_PATH.'includes/sessions.php');
(this from V@no on the Member Template Select thread)  :wink:
Title: Re: [MOD] RSS Feed 0.1
Post by: firefall on June 10, 2005, 12:02:24 AM
Yeah, I saw that in the other thread, that was my last attempt before I gave up for a bit.

 http://www.lunaescence.com/fanart/rss.php

Thanks though  :?
Title: Re: [MOD] RSS Feed 0.1
Post by: graficalicus on June 10, 2005, 12:28:20 AM
have you edited RSS.html template?

you're calling two top layer elements - you can only call one, and the others must be sub-elements -

also the xml version must be stated - paste this into line 1 of the template:
Code: [Select]
<?xml version="1.0" encoding="ISO-8859-1"?>
my entire rss.html is:
Code: [Select]
<?xml version="1.0" encoding="ISO-8859-1"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>{ctitle}</title>
    <link>{clink}</link>
    <description>{cdescription}</description>
    <language>{language}</language>
    <image>
      <title>{ititle}</title>
      <url>{iurl}</url>
      <link>{ilink}</link>
    </image>
    {items}
  </channel>
</rss>
Title: Re: [MOD] RSS Feed 0.1
Post by: V@no on June 10, 2005, 12:38:41 AM
Error:
Code: [Select]
Parse error: parse error, unexpected T_STRING in /home/*******/public_html/fanart/includes/template.php(101) : eval()'d code on line 1
Has anyone figured out why this error happens?

This error acure because rss.html template has:
Quote
<?xml version="1.0" encoding="ISO-8859-1"?>
And 4images new template engine chokes on such code.
For now, I dont have a very good fix for u, but try this work around.
Remove that line from rss.html template.
Then in rss.php replace:
Code: [Select]
$site_template->print_template($site_template->parse_template($main_template));with:
Code: [Select]
$site_template->print_template('<?xml version="1.0" encoding="ISO-8859-1"?>'.$site_template->parse_template($main_template));
(not tested)
Title: Re: [MOD] RSS Feed 0.1
Post by: firefall on June 10, 2005, 01:01:40 AM
That worked!   :D Thanks, graficalicus and V@no!
Title: Re: [MOD] RSS Feed 0.1
Post by: b.o.fan on June 12, 2005, 01:05:05 PM
in rss.php i got this error.

Quote
Fatal error: Call to a member function on a non-object in /home/www/htdocs/wartenaufden15.de/includes/sessions.php on line 311

can somebody help me?
Title: Re: [MOD] RSS Feed 0.1
Post by: Maweryk on June 12, 2005, 07:27:27 PM
I tried to add thumbs to the RSS feed.

rss.php:

After
Code: [Select]
$site_template->register_vars(array( add:

Code: [Select]
"thumbnail" => get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_row['image_id'], $image_row['cat_id'], $mode, $show_link),
Replace the sql statemant to:

Code: [Select]
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_thumb_file, i.image_media_file, i.image_keywords, i.image_date, i.image_active, c.cat_name
        FROM ".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c
        WHERE i.image_active = 1 AND c.cat_id = i.cat_id
        ORDER BY i.image_date DESC
        LIMIT $num_new_images";

rssitem.html:

After <description> add:

Code: [Select]
<![CDATA[{thumbnail}]]>
Now I need your help. I see a border for a thumb in my RSS-Reader, but without the picture.
The reason:
Code: [Select]
<description>
- <![CDATA[ <a href="./details.php?image_id=9268"><img src="./data/thumbnails/218/XXX.JPG" border="1" width="90" height="61" alt="" /></a>
  ]]>

How can I add the rest of my website address?: href="domain.de/4images/???

Thanks a lot.

Markus


Title: Re: [MOD] RSS Feed 0.1
Post by: V@no on June 12, 2005, 08:51:25 PM
Code: [Select]
"thumbnail" => SCRIPT_URL."/".get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_row['image_id'], $image_row['cat_id'], $mode, $show_link),
Also, I'd suggest u replace $mode, $show_link with: "", 0 because these two variables are not set and might produce warning messages ;)
Title: Re: [MOD] RSS Feed 0.1
Post by: Maweryk on June 12, 2005, 08:57:51 PM
Thanks, now I get:

Code: [Select]
<![CDATA[ http://www.domain.de/4images/<a href="./details.php?image_id=9268"><img src="./data/thumbnails/218/xxx.JPG" border="1" width="90" height="61" alt="" /></a>
  ]]>


Any other idea?

Cheers,

Markus
Title: Re: [MOD] RSS Feed 0.1
Post by: V@no on June 12, 2005, 09:40:27 PM
ops...
try this then:
below:
Code: [Select]
while($image_row = $site_db->fetch_array($result)){Insert this:
Code: [Select]
  if (!check_media_type($image_row['image_media_file']))
  {
    $file_src = ICON_PATH."/404.gif";
  }
  else
  {
    if (!get_file_path($image_row['image_thumb_file'], "thumb", $image_row['cat_id'], 0, 0))
    {
      $file_src = ICON_PATH."/".get_file_extension($image_row['image_media_file']).".gif";
    }
    else
    {
      $file_src = get_file_path($image_row['image_thumb_file'], "thumb", $image_row['cat_id'], 0, 1);
    }
  }
  $image_info = @getimagesize($file_src);
  $width_height = (!empty($image_info[3])) ? " ".$image_info[3] : "";
  $file_src = SCRIPT_URL."/".str_replace(ROOT_PATH, "", $file_src);
  $thumb = "<a href=\"".SCRIPT_URL."/details.php?".URL_IMAGE_ID."=".$image_row['image_id']."\"><img src=\"".$file_src."\" border=\"1\"".$width_height." alt=\"".$image_row['image_name']."\" /></a>";


Then replace line from your original code:
Code: [Select]
"thumbnail" => get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_row['image_id'], $image_row['cat_id'], $mode, $show_link), with this:
Code: [Select]
    "thumbnail" => $thumb,
P.S. which RSS reader do u use that can show thumbnails? :?:
Title: Re: [MOD] RSS Feed 0.1
Post by: Maweryk on June 12, 2005, 10:07:13 PM
GREAT!!!!!! It works!
Thanks again for your help!!!

Another idea: At the moment you can only see the 10 newest images. It is possible to show the 10 newest images sort by category, user and so on???

Overview:
User1, User2,...
or
Category1, Category2, ...
After a click on User1 you will see the 10 newest images from user1 or after a click on Category1 you will see the 10 newest images from category1.

My rss-reader is only in german: http://www.newsbee.de/download/newsbeesetup.exe

Cheers,

Markus

PS.: Take a look to the attachment! :wink:
Title: Re: [MOD] RSS Feed 0.1
Post by: V@no on June 12, 2005, 10:35:04 PM
hmmm....
acording to RSS validator, the "thumbnails" format is not valid
http://www.feedvalidator.org
Title: Re: [MOD] RSS Feed 0.1
Post by: Maweryk on June 12, 2005, 10:47:09 PM
 :?:
Congratulations!
This is a valid RSS feed.

Cheers,

Markus
Title: Re: [MOD] RSS Feed 0.1
Post by: V@no on June 12, 2005, 10:53:21 PM
well, yes, I had to remove <![CDATA[{thumbnail}]]> from the template, otherwise it wouldnt pass the validation...:(
Title: Re: [MOD] RSS Feed 0.1
Post by: V@no on June 12, 2005, 10:56:16 PM
oh, wait, the <![CDATA[{thumbnail}]]> must be between <description> and </description> ?? ops...
Title: Re: [MOD] RSS Feed 0.1
Post by: Maweryk on June 12, 2005, 11:00:57 PM
oh, wait, the <![CDATA[{thumbnail}]]> must be between <description> and </description> ?? ops...

Yes, between the description section.

Cheers,

Markus
Title: Re: [MOD] RSS Feed 0.1
Post by: V@no on June 12, 2005, 11:12:51 PM
another thing, I've noticed in some readers, that they are not properly display the date. and I found that its because of <dc:date>
tag being used instead of <pubDate>
But after changing it, the validation failed because of time format is for old RSS v1.0 and new date format should be different, so I had to change Y-m-d\TH:i:s+00:00 to: D, j M Y H:i:s +0000
Title: Re: [MOD] RSS Feed 0.1
Post by: Maweryk on June 13, 2005, 02:11:08 AM
So that everybody knows the category of the new image, open the file rssitem.html and change the title to

Code: [Select]
<title>{category}/{title}</title>
N8

Markus
Title: Re: [MOD] RSS Feed 0.1
Post by: mawenzi on June 13, 2005, 09:08:30 PM
hi Chris, hi Maweryk, hi V@no, hi all ...  :D

4images-RSS-Feed incl. thumbnails works like a charme ...  :!:
and V@nos RSS-test works already with tables, random image, smiles, bbcode and html ...   8O
( ... but now I also redesigned my rss feed layout ...  :mrgreen: ... )

mawenzi

Title: Re: [MOD] RSS Feed 0.1
Post by: V@no on June 15, 2005, 04:01:34 AM
and a little tip for u guys.
If your feed is getting
Quote
Your feed appears to be encoded as "ISO-8859-1", but your server is reporting "US-ASCII"
at the validation, then simply replace
Code: [Select]
header("Content-type: text/xml");with:
Code: [Select]
header("Content-type: text/xml; charset=\"ISO-8859-1\"");Replace ISO-8859-1 with whatever charset you are using in rss.html template
Title: Re: [MOD] RSS Feed 0.1
Post by: mawenzi on June 15, 2005, 01:13:37 PM
I use for my rss-feed ... encoding="ISO-8859-1" ... and it works very well in RSS-Readers
only the validator says rss-feed is validate ... but there is a language error ...  :?:
and now the header replacement don't has an effekt ...  :(

Feedvalidator (http://www.feedvalidator.org) say : but your server is reporting "US-ASCII" ...  :?:
RSS-Validator (http://rss.scripting.com) say : language must be an ISO-639 language code ...  :?:

but by changing into code "US-ASCII" or "ISO-639" or "utf-8" or ... my rss-feed doesn't work ...  :!:
knows someone a solution ?

mawenzi
Title: Re: [MOD] RSS Feed 0.1
Post by: mawenzi on June 15, 2005, 03:55:06 PM
i found the error ...  :D ...  :!:

... for a RRS-Feed in german language with encoding="ISO-8859-1" ... you need to change in rss.php
Code: [Select]
define('LANGUAGE', 'DE');into
Code: [Select]
define('LANGUAGE', 'de-de');
well ... now RSS Validator says : Congratulations -- the RSS feed validates!
and I get a (http://cyber.law.harvard.edu/blogs/gems/tech/loveRss.gif)

thanks guys
mawenzi
Title: Re: [MOD] RSS Feed 0.1
Post by: olibird on July 27, 2005, 08:49:17 AM
Ok, so I donw know if I'm the only one but the original posted code does not work. I read through each post  and tested. So this is how your three files should look like:

rss.php
- you must change www.yourwebsite.com to whatever URL your site is

define('LANGUAGE', 'en-us'); change to whatever language your website is

"ititle" =>"The title of your feed", whatever you want the name of your feed to be
Code: [Select]
<?
/*************************************************
 * RSS Feed for 4images                          *
 * beta 0.1                                      *
 * Email:
 */

//------------ CONFIG ----------------------------

$num_new_images = 10;
/*
 u can uncomment this, if you want to use config variables from 4images config
 $num_new_images = $config['image_cells'];
*/

//because we have no session here, we have to hardcode this values
define('SCRIPT_URL', 'http://www.yourwebsite.com'); //no trailing slash
define('LANGUAGE', 'en-us');

define('ROOT_PATH', './');

//----- END CONFIG--------------------------------------------

include(ROOT_PATH.'global.php');
$main_template = 'rss';



$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_thumb_file, i.image_media_file, i.image_keywords, i.image_date, i.image_active, c.cat_name
        FROM ".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c
        WHERE i.image_active = 1 AND c.cat_id = i.cat_id
        ORDER BY i.image_date DESC
        LIMIT $num_new_images";
$result = $site_db->query($sql);
$num_rows = $site_db->get_numrows($result);
$format="Y-m-d\TH:i:s+00:00"; //the time format for rss date
while($image_row = $site_db->fetch_array($result)){
  if (!check_media_type($image_row['image_media_file']))
  {
    $file_src = ICON_PATH."/404.gif";
  }
  else
  {
    if (!get_file_path($image_row['image_thumb_file'], "thumb", $image_row['cat_id'], 0, 0))
    {
      $file_src = ICON_PATH."/".get_file_extension($image_row['image_media_file']).".gif";
    }
    else
    {
      $file_src = get_file_path($image_row['image_thumb_file'], "thumb", $image_row['cat_id'], 0, 1);
    }
  }
  $image_info = @getimagesize($file_src);
  $width_height = (!empty($image_info[3])) ? " ".$image_info[3] : "";
  $file_src = SCRIPT_URL."/".str_replace(ROOT_PATH, "", $file_src);
  $thumb = "<a href=\"".SCRIPT_URL."/details.php?".URL_IMAGE_ID."=".$image_row['image_id']."\"><img src=\"".$file_src."\" border=\"1\"".$width_height." alt=\"".$image_row['image_name']."\" /></a>";
  $site_template->register_vars(array(


"thumbnail" => $thumb,
      "title" => $image_row["image_name"],  
      "description" => $image_row["image_description"],
      "category_domain" => SCRIPT_URL."/categories.php?cat_id=".$image_row["cat_id"],
      "category" => $image_row["cat_name"],
      "link" => SCRIPT_URL."/details.php?image_id=".$image_row["image_id"],
      "date" => format_date($format,$image_row["image_date"]),
      ));
  $new_images.=$site_template->parse_template("rssitem");
 }

//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(
      array(
    "ctitle" => $config['site_name'],
    "clink" => SCRIPT_URL,
    "cdescription" => $config['site_name']." RSS Feed",
    "language" =>LANGUAGE,
    "ititle" =>"The title of your feed",    
    "iurl" => SCRIPT_URL."/".TEMPLATE_PATH."/images/header_logo.gif",
    "ilink" => SCRIPT_URL,
    "items" => $new_images,  
    )
      );
header("Content-type: text/xml; charset=\"ISO-8859-1\"");
$site_template->print_template('<?xml version="1.0" encoding="ISO-8859-1"?>'.$site_template->parse_template($main_template));

?>

OK?   :|

rss.html
Code: [Select]
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>{ctitle}</title>
    <link>{clink}</link>
    <description>{cdescription}</description>
    <language>{language}</language>
    <image>
      <title>{ititle}</title>
      <url>{iurl}</url>
      <link>{ilink}</link>
    </image>
    {items}
  </channel>
</rss>

rssitem.html - This is edited to allow images

Code: [Select]
<item>
  <title>{title}</title>
  <dc:date>{date}</dc:date>
  <category domain="{category_domain}">{category}</category>
  <description>
    {description}
    <![CDATA[{thumbnail}]]>
  </description>
  <link>
  {link}
</link>
</item>

Note: I did not change pubdate/ dc date as mentioned or include category name. Didnt need it.

My 2 cents
Title: Re: [MOD] RSS Feed 0.1
Post by: JensF on July 30, 2005, 02:28:36 AM
Hello,

can anyone help me? I have make the changes but i can´t see the thumbs.
and i see the latest 5 images but i want to see the latest 10. i have change it but no effect.
What is wrong??
Title: Re: [MOD] RSS Feed 0.1
Post by: V@no on July 30, 2005, 04:17:07 AM
not all rss readers can display thumbnails.
and number of images are controlled by the settings on top of the code.
Title: Re: [MOD] RSS Feed 0.1
Post by: JensF on July 30, 2005, 09:32:56 AM
Hi,

i have change it to 10. But i can see 5 :(

And Thumbs i see for 3 Pics and for 2 i don´t see thumbs...

Can you test it?

http://www.terraristik-galerie.de/rss.php
Title: Re: [MOD] RSS Feed 0.1
Post by: V@no on July 30, 2005, 12:04:59 PM
I see 25 images and all with thumbnails
Title: Re: [MOD] RSS Feed 0.1
Post by: JensF on July 30, 2005, 05:24:32 PM
I see 25 images and all with thumbnails

Yes, i have change it to 25 but with my Reader i don´t see all Images. But you see it and i think its OK :)
Title: Re: [MOD] RSS Feed 0.1
Post by: V@no on August 06, 2005, 12:21:52 AM
remove all headers from the file and see what it will output. I bet there some warning or error message.

[EDIT]
here is the error that messing it up:
Quote
DB Error: Bad SQL Query: 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, c.cat_name FROM 4images_images i, 4images_categories c WHERE i.image_active = 1 AND c.cat_id = i.cat_id ORDER BY i.image_date DESC LIMIT
You have an error in your SQL syntax near '' at line 5

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /var/www/web98/html/crazyfunpics.de/includes/db_mysql.php on line 96
Title: Re: [MOD] RSS Feed 0.1
Post by: artpics on August 09, 2005, 06:26:27 AM
i get this error tried installing the mod 3 times no difference

This page contains the following errors:

error on line 2 at column 1: Extra content at the end of the document
Below is a rendering of the page up to the first error. :(

any ideas

post edited see v@no code below if useing V1.71
:idea:
Title: Re: [MOD] RSS Feed 0.1
Post by: V@no on August 09, 2005, 02:07:42 PM
did u change the templates?
Title: Re: [MOD] RSS Feed 0.1
Post by: V@no on August 10, 2005, 12:05:07 AM
ah, right, 4images v1.7.1 chokes on any combinations of <? and in this mod mistakely treat code between <?xml and ?> as php

In includes/templates.php find:
Code: [Select]
    error_reporting($old);Insert below:
Code: [Select]
    $str = preg_replace(
            "/<!--\\\\ open tag (.+) \\\\-->(.*)<!--\\\\ close tag \\\\-->/siU",
            "<?\\1\\2?>",
            $str
    );

Then find:
Code: [Select]
    // Compile variables in PHP codeInsert above:
Code: [Select]
    $template = preg_replace(
            "/<\?+((?!php )(?!=)(?! ).+ )(.*)\?+>/siU",
            "<!--\\\\ open tag \\1 \\\\-->\\2<!--\\\\ close tag \\\\-->",
            $template
    );
Title: Re: [MOD] RSS Feed 0.1
Post by: artpics on August 10, 2005, 12:39:44 AM
 :D thankyou for your answer, your code you wrote done the trick.

thanks for your time 
rt
Title: Re: [MOD] RSS Feed 0.1
Post by: V@no on August 10, 2005, 01:55:42 AM
by the way, I just remmembered that this already was discused on first page! :roll:
Title: Re: [MOD] RSS Feed 0.1
Post by: bibabobu on August 10, 2005, 07:00:43 PM
Sorry!
Could someone tell me if the problem with not showing private category pics in the feed is solved until now?
Thanks.
Title: Re: [MOD] RSS Feed 0.1
Post by: V@no on August 10, 2005, 10:57:31 PM
what exactly is the problem? please be specific ;)
Title: Re: [MOD] RSS Feed 0.1
Post by: bibabobu on August 11, 2005, 10:20:42 AM
ok i will explain again like on the first page:

Some pics in some categories are only available to see for registered users.

Is the rss feed showing pics of all categories or only of categories which are not private :?:

 :roll:hope everybody can understand what i mean.
Title: Re: [MOD] RSS Feed 0.1
Post by: V@no on August 11, 2005, 01:54:17 PM
it doesnt filter any images, so it will show even private ones :?

if u want to show only the ones which guests can see, replace the sql query with this one:
Code: [Select]
$user_info['user_level'] = GUEST;
$user_info['user_id'] = GUEST;
$user_access = get_permission();
$cat_id_sql = get_auth_cat_sql("auth_viewcat", "NOTIN").", ".get_auth_cat_sql("auth_viewimage", "NOTIN");
$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_thumb_file, i.image_media_file, c.cat_name, u.user_name
        FROM ".IMAGES_TABLE." i
        LEFT JOIN ".CATEGORIES_TABLE." c ON (c.cat_id = i.cat_id)
        LEFT JOIN ".USERS_TABLE." u ON (u.user_id = i.user_id)
        WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql)
        ORDER BY i.image_date DESC
        LIMIT $num_new_images";

And above
Code: [Select]
include(ROOT_PATH.'global.php');Insert:
Code: [Select]
define("GET_CACHES", 1);
Title: Re: [MOD] RSS Feed 0.1
Post by: artpics on August 13, 2005, 09:43:50 AM
hello since installing this mod this code i am useing below to show the date/time no longer works, anyone help me to get me to show the time again

Code: [Select]
<?php
                    
echo date("d.m.Y, H:i"); 
        ?>
thanks
RT
Title: Re: [MOD] RSS Feed 0.1
Post by: V@no on August 13, 2005, 02:47:26 PM
how do u determin "it doesnt work"?
Title: Re: [MOD] RSS Feed 0.1
Post by: artpics on August 18, 2005, 02:42:03 AM
before when i used this code in any html template
Code: [Select]
<?php
                    
echo date("d.m.Y, H:i");
        
?>

it showed the date time on each page, now since i have added this mod  the time is not shown anymore,when it used to work any ideas

thanks
RT
Title: Re: [MOD] RSS Feed 0.1
Post by: mawenzi on August 18, 2005, 10:37:42 PM
@ V@no ...

the query, you posted here (http://www.4homepages.de/forum/index.php?topic=8240.msg43565#msg43565), don't show only the images in RSS-Feed which only guests can see on the website ... it shows further all images ... is there another solution ... ?

mawenzi
Title: Re: [MOD] RSS Feed 0.1
Post by: Vincent on August 27, 2005, 12:17:03 PM
i need help i can't get the thumb to show up - the description on the beginn of the site was to confusing me!
could somebody nice and clear writing down - what to do to have the thumbs added?

is it also possible to have the keywords added?

thanks for support
vincent
Title: Re: [MOD] RSS Feed 0.1
Post by: Vincent on August 29, 2005, 08:28:19 AM
http://www.foto-kocher.com/rss.php

--------------------------
Ok es geht jetzt so wie ich es will mit dem Thumb!
aber ist es noch möglich das Verzeichniss einzufügen und die Keywords des Bildes?
--------------------------
OK it works with a thumb picture
but it is also possible to add the categorie next to the picture and also the Keywords?
--------------------------
Sincerly
gruss
Vincent
Title: Re: [MOD] RSS Feed 0.1
Post by: Vincent on August 30, 2005, 12:47:49 AM
is it possible to do a RSS Feed from just a couple of categories,
or is it possible that the user register and could  define which categorie he would get a feed!

sincerly
vincent
Title: Re: [MOD] RSS Feed 0.1
Post by: mawenzi on August 30, 2005, 03:59:09 PM
... du kannst ja pro Kategorie ein RSS-Feed anlegen (natürlich auch einen für die gesamte Galerie) ... und der geneigte User kann sich dann den ihn entsprechenden Feed aussuchen bzw. von der jeweiligen Kategorieseite laden ... möglich wäre auch den RSS-Feed-Kategorie-Download (Mini-Button) immer jeweils mit der category_bit.html anzuzeigen ...
Title: Re: [MOD] RSS Feed 0.1
Post by: Vincent on August 31, 2005, 07:44:53 AM
i was trying to add a table structure but i could not find out which html file i had to do something!
i mean when i added a table nothing happen and i could not see any change!

any idee where to add this?

sincerly
vincent
Title: Re: [MOD] RSS Feed 0.1
Post by: mawenzi on August 31, 2005, 10:14:15 AM
in rss.php ...
Code: [Select]
...
$content .= " <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td>";
...
$content .= " </td><td></table>";
...

mawenzi
Title: Re: [MOD] RSS Feed 0.1
Post by: Vincent on September 10, 2005, 10:25:26 AM
still hoping getting support for doing a Rss feed from a selected categorie and his Subcategorie!

sincerly
vincent
Title: Re: [MOD] RSS Feed 0.1
Post by: mawenzi on September 22, 2005, 12:00:45 PM
Hallo Vincent,

habe gerade dieses (http://www.4homepages.de/forum/index.php?topic=9774.msg47336#msg47336) gelesen und ich denke, es ist auch der Lösungsansatz für deine Anfrage.

RSS-Feed für bestimmte / einzelne Kategorien :

1. mach eine Kopie von deiner aktuellen rss.php und benenne sie nach den betreffenden Kategorien um z.B. rss_1-2-3.php
2. Verwende folgende Datenbankabfrage (d.h. ersetzen) in der rss_1-2-3.php:
Code: [Select]
$cat_in = array(1,2,3); // Hier id-Liste der anzuzeigenden Kategorien!

$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_thumb_file, i.image_media_file, c.cat_name, u.user_name
        FROM ".IMAGES_TABLE." i
        LEFT JOIN ".CATEGORIES_TABLE." c ON (c.cat_id = i.cat_id)
        LEFT JOIN ".USERS_TABLE." u ON (u.user_id = i.user_id)
        WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND c.cat_id = i.cat_id AND i.cat_id IN (".implode(", ", $cat_in).")
        ORDER BY i.image_date DESC
        LIMIT $num_new_images";
$result = $site_db->query($sql);
$num_rows = $site_db->get_numrows($result);

3. Nun kannst du in der betreffenden Kategorie den Link ( z.B. auch mit RSS-Feed-Button ) als Kategorie-RSS-Feed anbieten.
4. Du kannst natürlich auch auf deiner RSS-Seite eine Liste / Tabelle mit den jeweiligen RSS-Feeds anbieten, so dass der User hier auswählen kann.

Hinweis :
Subkategorien werden nicht automatisch mitangezeigt, wenn die übergeordnete Kategorie in der Liste steht. D.h. alle gewünschten Kategorien müssen in der id-Liste aufgeführt werden.

Hab es getestet und ich denke es wäre der erste Schritt bezogen auf deine Wunschliste ...  :wink:

mawenzi

Title: Re: [MOD] RSS Feed 0.1
Post by: lovetamil on October 21, 2005, 10:06:15 PM
hello...i am gettin this error..please help


Quote
End tag 'head' does not match the start tag 'link'. Error processing resource 'http://www.tamilsoulja.com/gallery/rss.php'. Line 8, Position 3
 

</head>
--^

and this is my rss.php

Quote
/*************************************************
 * RSS Feed for 4images                          *
 * beta 0.1                                      *
 * Email:
 */

//------------ CONFIG ----------------------------

$num_new_images = 10;
/*
 u can uncomment this, if you want to use config variables from 4images config
 $num_new_images = $config['image_cells'];
*/

//because we have no session here, we have to hardcode this values
define('SCRIPT_URL', 'http://www.tamilsoulja.com/gallery'); //no trailing slash
define('LANGUAGE', 'DE');

define('ROOT_PATH', './');

//----- END CONFIG--------------------------------------------

include(ROOT_PATH.'global.php');
$main_template = 'rss';



$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, c.cat_name
        FROM ".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c
        WHERE i.image_active = 1 AND c.cat_id = i.cat_id
        ORDER BY i.image_date DESC
        LIMIT $num_new_images";
$result = $site_db->query($sql);
$num_rows = $site_db->get_numrows($result);
$format="Y-m-d\TH:i:s+00:00"; //the time format for rss date
while($image_row = $site_db->fetch_array($result)){
  $site_template->register_vars(array(
                  "title" => $image_row["image_name"],             
                  "description" => $image_row["image_description"],
                  "category_domain" => SCRIPT_URL."/categories.php?cat_id=".$image_row["cat_id"],
                  "category" => $image_row["cat_name"],
                  "link" => SCRIPT_URL."/details.php?image_id=".$image_row["image_id"],
                  "date" => format_date($format,$image_row["image_date"]),
                  ));
  $new_images.=$site_template->parse_template("rssitem");
 }

//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(
               array(
                "ctitle" => $config['site_name'],
                "clink" => SCRIPT_URL,
                "cdescription" => $config['site_name']." RSS Feed",
                "language" =>LANGUAGE,
                "ititle" =>"",               
                "iurl" => SCRIPT_URL."/".TEMPLATE_PATH."/images/header_logo.gif",
                "ilink" => SCRIPT_URL,
                "items" => $new_images,             
                )
               );
header("Content-type: text/xml");
$site_template->print_template('<?xml version="1.0" encoding="ISO-8859-1"?>'.$site_template->parse_template($main_template));;
?>
Title: Re: [MOD] RSS Feed 0.1
Post by: V@no on October 21, 2005, 11:59:58 PM
probably something wrong with your template or some text that being included in the feed contains < or > characters.
Title: Re: [MOD] RSS Feed 0.1
Post by: sigma on November 07, 2005, 05:44:58 AM
Couldnt find this in teh previous posts. Maybe I didnt search well enough.

Im trying to include my news mod and also updates to certain categories. These category updates would have new images but the dates would be from months ago. Any way of adding either of these to the Feed?
Title: Re: [MOD] RSS Feed 0.1
Post by: a4land on November 10, 2005, 07:50:48 PM
Could you show me the final edition of this MOD ?

I've just downloaded it from the 1st page , and installed it . It works but without showing thumbnails , I tried to use the Feedreader v2.9 to view rss.php but the thumbnails still didn't appear . What should I do now ?
Title: Re: [MOD] RSS Feed 0.1
Post by: takgallery on November 12, 2005, 03:55:53 PM
please help on this error

XML Parsing Error: junk after document element
Location: http://takgallery.com/rss.php
Line Number 1, Column 7:<br /><font color='#FF0000'><b>DB Error</b></font>: <b>Bad SQL Query</b>: 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, c.cat_name
------^


i tried everything but no way
please help and take a look at this error :
http://takgallery.com/rss.php
Title: Re: [MOD] RSS Feed 0.1
Post by: V@no on November 12, 2005, 05:40:08 PM
did u upload rss.php in text mode?
besides the database error you also getting
Quote
Couldn't open Template ./templates/gallery-en/rss.html
Title: Re: [MOD] RSS Feed 0.1
Post by: marius26 on November 13, 2005, 02:11:47 AM
Error:
Code: [Select]
Parse error: parse error, unexpected T_STRING in /home/*******/public_html/fanart/includes/template.php(101) : eval()'d code on line 1
Has anyone figured out why this error happens?

This error acure because rss.html template has:
Quote
<?xml version="1.0" encoding="ISO-8859-1"?>
And 4images new template engine chokes on such code.
For now, I dont have a very good fix for u, but try this work around.
Remove that line from rss.html template.
Then in rss.php replace:
Code: [Select]
$site_template->print_template($site_template->parse_template($main_template));with:
Code: [Select]
$site_template->print_template('<?xml version="1.0" encoding="ISO-8859-1"?>'.$site_template->parse_template($main_template));
(not tested)

thank you very much it works, its tested now i tested myself  :lol:
Title: Re: [MOD] RSS Feed 0.1
Post by: takgallery on November 13, 2005, 10:50:57 PM
did u upload rss.php in text mode?
besides the database error you also getting
Quote
Couldn't open Template ./templates/gallery-en/rss.html

what do you mean ? 
shall i upload the rss.html page too ? 

internet explorer shows the error so :


The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.


--------------------------------------------------------------------------------

Only one top level element is allowed in an XML document. Error processing resource 'http://www.takgallery.com/rss.php'. L...

<br /><font color='#FF0000'><b>DB Error</b></font>: <b>Bad SQL Query</b>: SELECT i...
 
Title: Re: [MOD] RSS Feed 0.1
Post by: Vincent on November 13, 2005, 11:34:06 PM
yes of course - you mostly have a php file to run the script and the html file to show the result of the script!
i belive you did not do what is writen in the readme.txt file  :x

vincent
Title: Re: [MOD] RSS Feed 0.1
Post by: takgallery on November 14, 2005, 09:33:36 AM
yes of course - you mostly have a php file to run the script and the html file to show the result of the script!
i belive you did not do what is writen in the readme.txt file  :x

vincent

thanks for replies

i tried to follow to the readme.txt ! and i done all of the configuration works
but i still not managed to get this mod work
i have another error

http://www.takgallery.com/rss.php

The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.


--------------------------------------------------------------------------------

Only one top level element is allowed in an XML document. Error processing resource 'http://takgallery.com/rss.php'. Line ...

<b>Parse error</b>:  parse error, unexpected T_STRING in <b>/home/gallery/public_html/includes/template.ph...


thanks for attentions
Title: Re: [MOD] RSS Feed 0.1
Post by: takgallery on November 14, 2005, 09:57:38 AM
thanks i resolved my problem
 :oops:
Title: Re: [MOD] RSS Feed 0.1
Post by: sigma on December 09, 2005, 06:16:14 AM
Anyone know how to get a news comment ( Latest News & Archive MOD (http://www.4homepages.de/forum/index.php?topic=5142.45) ) to show up in the Feed?
Title: Re: [MOD] RSS Feed 0.1
Post by: mawenzi on December 09, 2005, 06:56:10 PM
Anyone know how to get a news comment ( Latest News & Archive MOD (http://www.4homepages.de/forum/index.php?topic=5142.45) ) to show up in the Feed?

hi sigma,
new ... but not only for you [MOD] News-RSS-Feed V.1.0 ...  :wink:

http://www.4homepages.de/forum/index.php?topic=10715.0

mawenzi
Title: Re: [MOD] RSS Feed 0.1
Post by: sigma on December 09, 2005, 09:10:23 PM
Very nice mawenzi, I'll have to check it out.
Also wonder how I would go about adding a direct link to the page that the thumbnail reprasents. RIght now it just points to my main index page. Anyone know how i can get the thumbnails to link to their proper page?
Title: Re: [MOD] RSS Feed 0.1
Post by: mawenzi on December 09, 2005, 09:20:40 PM
@ sigma,

please post in the right thread ... !
I have updated the rrs_news.php ...

mawenzi
Title: Re: [MOD] RSS Feed 0.1
Post by: JensF on December 17, 2005, 01:21:10 AM
in rss.php ...
Code: [Select]
...
$content .= " <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td>";
...
$content .= " </td><td></table>";
...

mawenzi

Ich möchte das gerne so haben wie beim RSS-News Mod. Schön mit Tabelle und in welcher Kategorie etc.

Habe das jetzt mal mit den content Sachen probiert aber jetzt geht irgendwie gar nichts mehr. Habe dann alles wieder rückgängig gemacht und habe jetzt immer die Meldung "Aktuell sind in diesem Kanal keine Nachrichten verfügbar."

Hatte vorher immer das Problem das ein Thumb immer nur angezeigt wurde wenn zu dem Bild keine Beschreibung vorhanden war. Komische Sache.
Title: Re: [MOD] RSS Feed 0.1
Post by: mawenzi on December 17, 2005, 01:49:10 AM
Ich möchte das gerne so haben wie beim RSS-News Mod. Schön mit Tabelle und in welcher Kategorie etc.

... na klar geht das auch mit dem News-Feed für die Bilder ... siehe hier (http://klick.kl.funpic.de/index.php) (My Feed - Bilder)
... sieht mit den Thumbnails, Beschreibungen, Links, ... usw. sogar noch interessanter aus

mawenzi
Title: Re: [MOD] RSS Feed 0.1
Post by: JensF on December 17, 2005, 02:51:06 AM
Hi,

habe gerade mal geschaut und das sieht wirklich top aus. Nur die Frage wie ich das hinbekomme. Habe mal ein wenig getestet aber geklappt hat es nicht.
Wenn ich jetzt Änderungen mache dann bekomme ich in meinem Reader immer die Meldung das "Aktuell sind in diesem Kanal keine Nachrichten verfügbar." sind :(

Selbst nachdem ich wieder alles rückgängig gemacht hatte konnte ich nichts mehr sehen. Hab den Kanal schon gelöscht und neu hinzugefügt aber irgendwie haut jetzt was nicht hin.

Naja, werde ich die Tage nochmal probieren.

Title: Re: [MOD] RSS Feed 0.1
Post by: Vincent on December 24, 2005, 01:23:03 AM
ich möchte noch gerne die Stichwörter zum Foto haben und das Verzeichniss!
gruss
vincent
Title: Re: [MOD] RSS Feed 0.1
Post by: sigma on January 12, 2006, 05:55:16 AM
Just noticed in a RSS Reader my thumbnail image doesnt have a </ br> after it and before the description for the image. anyone know where I would add this?

Is it in the rss.php or one of the template files (rss.html or rssitem.html) ever time i tried in the templat file the live bookmark would give me a parse error.
Title: Re: [MOD] RSS Feed 0.1
Post by: mawenzi on January 12, 2006, 03:28:09 PM
@sigma,

I think ... in rss.php ... but I don't know your rss-files ... !
I designed my rss-feeds, by using html-tags, completely in rss.php with ...
Code: [Select]

$content .= " ... here html-content ... ";

mawenzi
Title: Re: [MOD] RSS Feed 0.1
Post by: sigma on January 12, 2006, 05:14:00 PM
ah I see. Where would i put this 'content' code?

Heres what my rss.php looks like.

Code: [Select]
<?
/*************************************************
 * RSS Feed for 4images                          *
 * beta 0.1                                      *
 * Email:
 */

//------------ CONFIG ----------------------------

$num_new_images = 10;
/*
 u can uncomment this, if you want to use config variables from 4images config
 $num_new_images = $config['image_cells'];
*/

//because we have no session here, we have to hardcode this values
define('SCRIPT_URL', 'http://www.cydonian.com/photos'); //no trailing slash
define('LANGUAGE', 'EN');

define('ROOT_PATH', './');

//----- END CONFIG--------------------------------------------

include(ROOT_PATH.'global.php');
$main_template = 'rss';



$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_thumb_file, i.image_media_file, i.image_keywords, i.image_date, i.image_active, c.cat_name
        FROM ".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c
        WHERE i.image_active = 1 AND c.cat_id = i.cat_id
        ORDER BY i.image_date DESC
        LIMIT $num_new_images";
$result = $site_db->query($sql);
$num_rows = $site_db->get_numrows($result);
$format="Y-m-d\TH:i:s+00:00"; //the time format for rss date
while($image_row = $site_db->fetch_array($result)){
  if (!check_media_type($image_row['image_media_file']))
  {
    $file_src = ICON_PATH."/404.gif";
  }
  else
  {
    if (!get_file_path($image_row['image_thumb_file'], "thumb", $image_row['cat_id'], 0, 0))
    {
      $file_src = ICON_PATH."/".get_file_extension($image_row['image_media_file']).".gif";
    }
    else
    {
      $file_src = get_file_path($image_row['image_thumb_file'], "thumb", $image_row['cat_id'], 0, 1);
    }
  }
  $image_info = @getimagesize($file_src);
  $width_height = (!empty($image_info[3])) ? " ".$image_info[3] : "";
  $file_src = SCRIPT_URL."/".str_replace(ROOT_PATH, "", $file_src);
  $thumb = "<a href=\"".SCRIPT_URL."/details.php?".URL_IMAGE_ID."=".$image_row['image_id']."\"><img src=\"".$file_src."\" border=\"1\"".$width_height." alt=\"".$image_row['image_name']."\" /></a>";
  $site_template->register_vars(array(
  "thumbnail" => $thumb,
      "title" => $image_row["image_name"],  
      "description" => $image_row["image_description"],
      "category_domain" => SCRIPT_URL."/categories.php?cat_id=".$image_row["cat_id"],
      "category" => $image_row["cat_name"],
      "link" => SCRIPT_URL."/details.php?image_id=".$image_row["image_id"],
      "date" => format_date($format,$image_row["image_date"]),
      ));
  $new_images.=$site_template->parse_template("rssitem");
 }

//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(
      array(
    "ctitle" => $config['site_name'],
    "clink" => SCRIPT_URL,
    "cdescription" => $config['site_name']." RSS Feed",
    "language" =>LANGUAGE,
    "ititle" =>"",    
    "iurl" => SCRIPT_URL."/".TEMPLATE_PATH."/images/header_logo.gif",
    "ilink" => SCRIPT_URL,
    "items" => $new_images,  
    )
      );
header("Content-type: text/xml");
$site_template->print_template($site_template->parse_template($main_template));
?>
Title: Re: [MOD] RSS Feed 0.1
Post by: V@no on February 05, 2006, 06:26:24 AM
below
Code: [Select]
include(ROOT_PATH."global.php");insert this:
Code: [Select]
$user_access = get_permission();
Title: Re: [MOD] RSS Feed 0.1
Post by: V@no on February 05, 2006, 08:51:44 PM
oh...found the misstake
I've update this topic:
http://www.4homepages.de/forum/index.php?topic=8240.msg43565#msg43565
redo all the steps again ;) you dont need sessions.php.
Title: Re: [MOD] RSS Feed 0.1
Post by: V@no on February 06, 2006, 02:24:58 PM
It says "ABOVE" and not "BELOW" ;)
Title: Re: [MOD] RSS Feed 0.1
Post by: Flo2005 on February 07, 2006, 09:09:08 PM
I must do the following changes to get my rss.php to run

Quote
In includes/templates.php find:
Code:
    error_reporting($old);
Insert below:
Code:
    $str = preg_replace(
            "/<!--\\\\ open tag (.+) \\\\-->(.*)<!--\\\\ close tag \\\\-->/siU",
            "<?\\1\\2?>",
            $str
    );

Then find:
Code:
    // Compile variables in PHP code
Insert above:
Code:
    $template = preg_replace(
            "/<\?+((?!php )(?!=)(?! ).+ )(.*)\?+>/siU",
            "<!--\\\\ open tag \\1 \\\\-->\\2<!--\\\\ close tag \\\\-->",
            $template
    );

But when I do this changes, my Random Banner MOD won´t work any longer  :?

Here is my banner_random.php

Code: [Select]
<?php

/* Banner Simple, Version 1.0
 * by Dan Kaplan <dan@abledesign.com>
 * Last Modified: January 10, 2003
 * --------------------------------------------------------------------
 *
 * USE THIS LIBRARY AT YOUR OWN RISK; no warranties are expressed or
 * implied. You may modify the file however you see fit, so long as
 * you retain this header information and any credits to other sources
 * throughout the file.  If you make any modifications or improvements,
 * please send them via email to Dan Kaplan <dan@abledesign.com>.
 * --------------------------------------------------------------------
*/

$base_dir '/www/htdocs/my_account/lite/';
$img_url 'http://www.snuup.de/lite/templates/lite/images/banner';

// add any banner sizes (width x height) that you will use:
// IAB Standards & Guidelines:  http://www.iab.net/standards/adunits.asp
$banner_sizes = array ("468x60""100x60""100x38""300x250""250x250""240x400""336x280""180x150""500x74""234x60""88x31""120x90""120x60""120x240""125x125""160x600""120x600");

$srand_called FALSE;
$last_file '';
$array '';

function 
get_banner($size='') {
global $base_dir$img_url$banner_sizes$srand_called$last_file$array;

if (empty($size) || !in_array($size$banner_sizes)) {
$size "468x60";
}

$size_split explode("x"$size);
$width $size_split[0];
$height $size_split[1];

if (empty($last_file) || ($size != $last_file) || !is_array($array)) {
// if calling muliple banners on one page, no need to read in the same file repeatedly.  so,
// if the last banner file read in is the next one called, pull the $array array from memory.

$file $base_dir."/templates/lite/images/banner/mybanner_".$size.".txt";
if (!file_exists($file)) {
// could not load the banner file, so create a default blank image and exit
$banner "<img src=\"\" width=\"$width\" height=\"$height\" border=\"0\" alt=\"Bild kaputt\">";
return $banner;
}
$array file($file); // read $file into an array
$last_file $size; // save the last read-in file into memory
}

if (!$srand_called) {
// slightly less random without this; srand() should only be called once for multiple banners
mt_srand ((double) microtime() * 1000000);
$srand_called TRUE;
}

$rand mt_rand(1count($array)-1); // start at 1 to ignore comment line
$line chop($array[$rand]);

# URL | target="_blank" (1/0) | off-site image (1/0) | image | Alt text
$banner_split explode("|"$line);
$URL $banner_split[0];
$blank $banner_split[1];
$off_site $banner_split[2];
$image $banner_split[3];
$alt $banner_split[4];

if ($blank == 1) {
$target "target=\"_blank\"";
} else {
$target "";
}

if ($off_site == 1) {
$image $image;
} else {
$image "$img_url/$image";
}

$banner "<a href=\"$URL\" $target><img src=\"$image\" width=\"$width\" height=\"$height\" border=\"0\" alt=\"$alt\"></a>";
return $banner;
}

?>

Somebody got the plan  :| ?
Title: Re: [MOD] RSS Feed 0.1
Post by: Flo2005 on February 11, 2006, 10:18:23 AM
Okay, now it works!

But where can I set to show only files which are younger e.g. 7 days :?:

Now my rss.php shows me files which are older than 7 days...

THX by Flo
Title: Re: [MOD] RSS Feed 0.1
Post by: graficalicus on March 03, 2006, 02:13:15 AM
way back on page 1 of this thread, I asked about removing " ' ", " & ", " ; " , etc., characters and got this reply:

Quote
"description" => stripslashes($image_row["image_description"])

this should work (not tested).

it didn't work  :?

Can anyone suggest a fix for this - some kind of character substitution like
Code: [Select]
In includes/templates.php find:
Code:
    error_reporting($old);
Insert below:
Code:
    $str = preg_replace(
            "/<!--\\\\ open tag (.+) \\\\-->(.*)<!--\\\\ close tag \\\\-->/siU",
            "<?\\1\\2?>",
            $str
    );

Then find:
Code:
    // Compile variables in PHP code
Insert above:
Code:
    $template = preg_replace(
            "/<\?+((?!php )(?!=)(?! ).+ )(.*)\?+>/siU",
            "<!--\\\\ open tag \\1 \\\\-->\\2<!--\\\\ close tag \\\\-->",
            $template
    );

?  Any time a user uses one of those characters in their image description while uploading, it craps out the feed....

Thanks -
Title: Re: [MOD] RSS Feed 0.1
Post by: graficalicus on March 09, 2006, 10:47:36 PM
HA HA! HO HO! :D  i fixed it -

simply move the {description} tag inside the CDATA tag, as mentioned earlier in this thread - -

Magpie (http://digiart.graficalicus.com/rss.php) likes it, Feedburner (http://feeds.feedburner.com/DigiartGraficalicusImageGalleries)[/url] likes it -

the only change is in rssitem.html (mine looks like this - yours may be different):
Code: [Select]
<item>
  <title>{category}/{title}</title>
 <link>
  {link}
</link>
<description>
<![CDATA[{thumbnail}
{description}]]>   
  </description>
</item>

 :mrgreen:
Title: Re: [MOD] RSS Feed 0.1
Post by: Stoleti on March 27, 2006, 04:11:48 AM
this give me this error Fatal error: Call to a member function on a non-object in /home/blacktra/public_html/rss.php on line 57

and here is my rss.php

Code: [Select]
<?
/*************************************************
* RSS Feed for 4images                          *
* beta 0.1                                      *
* Email:
*/

//------------ CONFIG ----------------------------

$num_new_images = 10;
/*
u can uncomment this, if you want to use config variables from 4images config
$num_new_images = $config['image_cells'];
*/

//because we have no session here, we have to hardcode this values
define('SCRIPT_URL', 'http://www.*******.com'); //no trailing slash
define('LANGUAGE', 'en-us');

define('ROOT_PATH', './');

//----- END CONFIG--------------------------------------------

include(ROOT_PATH.'global.php');
$main_template = 'rss';



$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_thumb_file, i.image_media_file, i.image_keywords, i.image_date, i.image_active, c.cat_name
        FROM ".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c
        WHERE i.image_active = 1 AND c.cat_id = i.cat_id
        ORDER BY i.image_date DESC
        LIMIT $num_new_images";
$result = $site_db->query($sql);
$num_rows = $site_db->get_numrows($result);
$format="Y-m-d\TH:i:s+00:00"; //the time format for rss date
while($image_row = $site_db->fetch_array($result)){
  if (!check_media_type($image_row['image_media_file']))
  {
    $file_src = ICON_PATH."/404.gif";
  }
  else
  {
    if (!get_file_path($image_row['image_thumb_file'], "thumb", $image_row['cat_id'], 0, 0))
    {
      $file_src = ICON_PATH."/".get_file_extension($image_row['image_media_file']).".gif";
    }
    else
    {
      $file_src = get_file_path($image_row['image_thumb_file'], "thumb", $image_row['cat_id'], 0, 1);
    }
  }
  $image_info = @getimagesize($file_src);
  $width_height = (!empty($image_info[3])) ? " ".$image_info[3] : "";
  $file_src = SCRIPT_URL."/".str_replace(ROOT_PATH, "", $file_src);
  $thumb = "<a href=\"".SCRIPT_URL."/details.php?".URL_IMAGE_ID."=".$image_row['image_id']."\"><img src=\"".$file_src."\" border=\"1\"".$width_height." alt=\"".$image_row['image_name']."\" /></a>";
  $site_template->register_vars(array(
                      "thumbnail" => $thumb,
      "title" => $image_row["image_name"],  
      "description" => $image_row["image_description"],
      "category_domain" => SCRIPT_URL."/categories.php?cat_id=".$image_row["cat_id"],
      "category" => $image_row["cat_name"],
      "link" => SCRIPT_URL."/details.php?image_id=".$image_row["image_id"],
      "date" => format_date($format,$image_row["image_date"]),
      ));
  $new_images.=$site_template->parse_template("rssitem");
}

//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(
      array(
    "ctitle" => $config['site_name'],
    "clink" => SCRIPT_URL,
    "cdescription" => $config['site_name']." RSS Feed",
    "language" =>LANGUAGE,
    "ititle" =>"The title of your feed",    
    "iurl" => SCRIPT_URL."/".TEMPLATE_PATH."/images/header_logo.gif",
    "ilink" => SCRIPT_URL,
    "items" => $new_images,  
    )
      );
header("Content-type: text/xml; charset=\"ISO-8859-1\"");
$site_template->print_template('<?xml version="1.0" encoding="ISO-8859-1"?>'.$site_template->parse_template($main_template));

?>
Title: Re: [MOD] RSS Feed 0.1
Post by: BartAfterDark on April 16, 2006, 05:25:36 PM
I have a problem when I try to view the RSS with Internet Explorer. Some of the categorys has a ' in then. But IE doesn't like that. Anyway workaround for this?
Title: Re: [MOD] RSS Feed 0.1
Post by: sigma. on April 11, 2007, 06:11:26 PM
Is there a way to use the larger image insted of the thumbnail image to be displayed in the feed?
Title: Re: [MOD] RSS Feed 0.1
Post by: sigma. on May 27, 2007, 03:47:27 AM
Anyone know how to exclude certain categories from the RSS Feed? I have had success with tweaking the index.php to exclude certain categories from New Images but have not had success copying that code into the rss.php

Heres the exclude from index.php tweak
http://www.4homepages.de/forum/index.php?topic=16348.0
Title: Re: [MOD] RSS Feed 0.1
Post by: cronk005 on June 09, 2007, 06:06:17 AM
Hi There--

So how would one go about getting this to work with the multilang() function so that it does not say the entire [language]wording wording wording[/] [language2]wording wording wording[/].

Regards,
Title: Re: [MOD] RSS Feed 0.1
Post by: sigma. on June 17, 2007, 09:35:06 PM
With the new Google Reader site http://www.google.com/reader/view/

I think this RSS feed really needs a non thumbnail view.

How can we show the full image insted of the thumbnail?
Title: Re: [MOD] RSS Feed 0.1
Post by: mawenzi on June 18, 2007, 11:24:58 PM
How can we show the full image insted of the thumbnail?

... you want to show only the full image instead of the thumbnail ... ?
... but I think your feed need a little bit of structure ... maybe by a table ... ;)
Title: Re: [MOD] RSS Feed 0.1
Post by: sigma. on June 19, 2007, 05:35:07 AM
Hi mawenzi, thanks for the response.  Your probably right, I do need a table, the text isn't breaking properly next to the thumbnail. And yes I would like the full image insted of the Thumbnail, I just dont know how to go about it.
Title: Re: [MOD] RSS Feed 0.1
Post by: sigma. on June 22, 2007, 05:54:49 PM
anyone know how to put html inside the RSS feed? the full image isnt as important as getting a nice clean look in the format.

the question is where do you put it? I cant even put a <br/> anywhere without it busting.
Title: Re: [MOD] RSS Feed 0.1
Post by: mawenzi on June 22, 2007, 07:17:26 PM
... hi sigma ... sorry for no answering ...  :oops:
... I think both is possible ...
... for a nice clean look in the format test my rss-feeds on my website ...
... it is my solution with tables, but it is alterable ...
... and I think there are no big images necessary ...
... but we can try it with big images ...
... what do you think ... ?
Title: Re: [MOD] RSS Feed 0.1
Post by: sigma. on June 23, 2007, 08:57:34 AM
I really like your setup mawenzi. Its a very clean format with the thumbnail on the left of the text. Thumbnails are ok, it does require the user to click on the thumb to see the entire image, which is good, but I think a full image version does come in handy when using Google Reader and other RSS viewers. but at this stage I would just be happy with a clean line break after my thumbnail so my description gets listed below. Tables would be even better! :)
Title: Re: [MOD] RSS Feed 0.1
Post by: sigma. on July 07, 2007, 07:20:54 PM
hey Mawenzi,

are you using css in your rss feed or is it just straight out tables?
Title: Re: [MOD] RSS Feed 0.1
Post by: GaYan on November 22, 2009, 10:54:24 AM
Has Any1 posted a complete tutorial on this ? if so please be kind to post the link  :D

i followed many tuts and finally what i archived... http://nuwaragedara.com/Gallery/rss.php?action=images
its doesn't seems tobe a validated rss :S :S even its not a feed :D :D
 :mrgreen: :mrgreen: :mrgreen: