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

RSS / XML Output for Ten Most Recent Postings

(Page 2 of 2)
> >
Quote Reply
A RSS Feed that is Filtered In reply to
I want RSS feeds, but I don't want just the most recent threads -

I want the feed to show the 20 most recent discussion threads that also match a search phrase.

Do you know how to do this?
Quote Reply
Re: [designgroup] A RSS Feed that is Filtered In reply to
Just add &search_string=yourquery to the URL.
John
Quote Reply
Re: [gotze] A RSS Feed that is Filtered In reply to
Hi, Gotze;

Thank you very much for your reply.

I believe, howevor, (correct me if I am wrong) that what you posted will work perfectly in giving the most recent posts matching a search query, but I need the most recent threads (returning the first post in a thread) matching a search query.

Have you modified your code from the inital posting you made? Perhaps I missed the update.

I was using the hot threads method, and had tried adding a search query, with no luck, until I realized that the hot threads method did not use the info.

Any ideas on recent threads by search query? I'm even willing to make multiple hot threads actions and hard code the search query it in, if I knew how.

Thanks!
Quote Reply
Re: [designgroup] A RSS Feed that is Filtered In reply to
Oh, I missed that it was the threads, sorry. I think you could just add &search_fields=s although that's not bullet-proof if people keep changing the subject under a thread.
Quote Reply
Re: [gotze] A RSS Feed that is Filtered In reply to
Hmmm... I guess &search_fields=s would bring too many results (one for each post in a thread). I don't know what else to do ...
Quote Reply
Re: [gotze] A RSS Feed that is Filtered In reply to
Hi, Gotze;

Wow, fast reply, thanks!

Yes, and it looks so repetitive, as the titles are the same pretty much.

In the hot threads method, where would and how would I embed the query? I do not mind making 10 or so copies, one for each search term.
Quote Reply
Re: [gotze] A RSS Feed that is Filtered In reply to
Any Ideas? I'm willing to pay for a solution...

I need a RSS feed of THREADS based on keyword search..

The RSS part is easy, but returning THREADS based on a keyword search...??

Someone want to make $100?
Quote Reply
Re: [discusswireless] RSS / XML Output for Ten Most Recent Postings In reply to
Yeah, but how about making it search able by keyword??

(last x posts in a rSS format, or at least last x posts matching keyword./phrase query)

The RSS conversion is just a tremplate, so not difficult.

I'm offering $150 for a solution!
Quote Reply
Re: [designgroup] RSS / XML Output for Ten Most Recent Postings In reply to
Hi,

I have created a plugin called RSSThreads to enable GForum to product rss 2.0 of last x post or last x post matched keyword or phrase.

I you are still interested, please just PM me or send an email to dat@cgito.net.

Cheers,

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [discusswireless] RSS / XML Output for Ten Most Recent Postings In reply to
Hi,

For anyone who wants to make this mod work with SEO templats (mod_rewrite), you can use this global:

hot_threads
Code:
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) {
$post->{forum_name} = $DB->table('Forum')->select( ['forum_name'], { forum_id => $post->{forum_id_fk} } )->fetchrow;
$post->{cat_id} = $DB->table('Forum')->select( ['cat_id_fk'], { forum_id => $post->{forum_id_fk} } )->fetchrow;
push @output, $post;
}

return { post_loop => \@output };
}

..and then instead of:

Code:
<link>http://www.yourdomain.com/gforum.cgi?post=<%post_id%></link>

Code:
<link>http://www.yourdomain.com/<%cat_path($cat_id)%><%escape_name($forum_name)%>_F<%forum_id_fk%>/<%escape_name($post_subject)%>_P<%post_id%>/</link>

(change the bit in red to the URL of your mod_rewrite forum URL)

Also, you need to make sure you have the following globals in your /rssmod template set:

cat_path
Code:
sub {
my $id = shift;
my $category = q|%s_C%d/|;

if (!$GForum::CAT_CACHE{$id}) {
my $Cat = $DB->table('Category');
my $cat = $Cat->get({ cat_id => $id }, 'HASH', ['cat_id', 'cat_name', 'cat_id_fk']);
push @{$GForum::CAT_CACHE{$id}}, $cat;
while ($cat = $Cat->get({ cat_id => $cat->{cat_id_fk} }, 'HASH', ['cat_id', 'cat_name', 'cat_id_fk'])) {
push @{$GForum::CAT_CACHE{$id}}, $cat;
}
}
my @cats = @{$GForum::CAT_CACHE{$id}};

my $cat = shift @cats;
(my $cat_name_e = $cat->{cat_name}) =~ y/ \t\r\n?"'#/__/d;
my $cat_name = sprintf($category, $cat_name_e, $id);
for (@cats) {
($cat_name_e = $_->{cat_name}) =~ y/ \t\r\n?"'#/__/d;
$cat_name = sprintf($category, $cat_name_e, $_->{cat_id}) . $cat_name;
}

return \"/$cat_name";
}

escape_name
Code:
sub {
my $name = shift;
$name =~ y/ \t\r\n?"'#/__/d;
$name = $IN->escape($name);
$name =~ s|%2F|/|gi; # For some reason, Apache doesn't like %2F in the pathinfo, but a real / is fine
\$name;
}


Just thought I'd post this, in case anyone else is trying to do the same thing :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
> >