Home : Products : Gossamer Forum : Development, Plugins and Globals :

Products: Gossamer Forum: Development, Plugins and Globals: Re: [gotze] RSS / XML Output for Ten Most Recent Postings: Edit Log

Here is the list of edits for this post
Re: [gotze] RSS / XML Output for Ten Most Recent Postings
1/8/03 UPDATE:
This gizmo is still in-process, since invalid characters are allowed to creep into your xml. See later posting. Back to the orginal posting:

Nice John, I'm testing something similar. This was pieced from other postsings here - which I'm too lazy to credit. It should xml-ize the last ten posts (controlled by hot_threads variable).

This should allow for a short quote of the post to be displayed too.


Step 1
Create two new global variables:


sub {
my $tags = shift;
my $post_db = $DB->table ('Post');
$post_db->select_options ('WHERE post_root_id=0',
'ORDER BY post_time DESC', 'LIMIT 10');
my $sth = $post_db->select;
my @output;
while (my $post = $sth->fetchrow_hashref)
push @output, $post;

return { post_loop => \@output };

hot_chop update: see later post below for improved hot_chop

sub {
my $post_message = shift;
return substr($post_message,0,125);

Step 2
Create a new directory / template set - called rssmod with two new templates:


inheritance => '../default'


<?xml version="1.0" encoding="ISO-8859-1" ?>
<rss version="0.91">
<title>Your Title</title>
<description>Your Description</description>

<%loop post_loop%>

Last edited by:

DoubleJJ: Jan 13, 2003, 5:56 PM

Edit Log: