Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Recent post from GForum on GLinks Homepage

Quote Reply
Recent post from GForum on GLinks Homepage
Hi,

I'm running GLinks in dynamic mode using Rewrite rules.

I would like to include recent post from my GForum on main page of GLinks. I've setup recent.cgi (as described in GForum discussion forum) which is working great, but can't run SSI call on my GLinks page.

I guess this is because using dynamic mode. Any solution?

UnReal Network
Quote Reply
Re: [deadroot] Recent post from GForum on GLinks Homepage In reply to
I actually just posted a solution to this somewhere.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [deadroot] Recent post from GForum on GLinks Homepage In reply to
This global works for me. Call it: "recent_forum_posts"

Code:
sub {
lib->import("/home/path/to/cgi-bin/forum/admin");
my $db = GT::SQL->new('/home/path/to/cgi-bin/forum/admin/defs');
my $Post = $db->table('Post');
$Post->select_options("ORDER BY post_time DESC", "LIMIT 5");
my $loop = $Post->select( { forum_id_fk => 44, post_root_id => 0 })->fetchall_hashref;
return { post_loop => $loop };
}

Set "LIMIT" to the number of posts you want to show.
Set the "forum_id_fk" to the ID of the forum you want to pull the posts from.

In your template add something like:

<h3>New Posts:</h3>
<%recent_forum_posts%>
<%loop post_loop%>
<a href="/cgi-bin/forum/gforum.cgi?post=<%post_id%>;"><%post_subject%></a><br />
<%endloop%>

Hope this helps. Smile

Safe swoops
Sangiro
Quote Reply
Re: [pugdog] Recent post from GForum on GLinks Homepage In reply to
Mines a bit longer, with some comments/notations on what is going on. If interested:

http://www.gossamer-threads.com/...orum.cgi?post=290268


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [sangiro] Recent post from GForum on GLinks Homepage In reply to
I think I'll check pugdog solution.

What I want are recent posts from all database not just from one particular forum and as I could see your global just check for one forum.

Right or wrong?

UnReal Network