Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Display last X updates on a different page.

Quote Reply
Display last X updates on a different page.
Hi all,

I have a site where I use Links2.0 as my main page and have forums off this page as a menu option.

What I'd really like to do is to be able to display the last X updates (post topic / time-date/ etc and poster.) on my index page that is built by links.

I'd also like them to be able to click the topic and go to that post.

Is this possible?

Thanks!

Rob
Quote Reply
Re: [rmurdo] Display last X updates on a different page. In reply to
Hi,

Mm.. not really easy with Links2 ;) If you were using GLinks - then it would be a piece of cake Whistle

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!
Quote Reply
Re: [Andy] Display last X updates on a different page. In reply to
 
Hi,

Which one is which? I am using the pay sql version. Not the free one.

Thanks,

Rob
Quote Reply
Re: [rmurdo] Display last X updates on a different page. In reply to
Ah ok - you said Links2, which isn't the SQL version ;)

So what exactly do you want to show? There are quite a few posts that would probably help, if you just want to show the "latest posts" in GLinks Smile

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!
Quote Reply
Re: [Andy] Display last X updates on a different page. In reply to
 
Just looking to list like the last 5-10 posts.

Time / Date / Topic / maybe views/posts
Quote Reply
Re: [rmurdo] Display last X updates on a different page. In reply to
Hi,

Untested, but give this a go:

get_latest_forum
Code:
sub {

my $path = '/path/to/gforum/admin/defs';

my $NEWDB = new GT::SQL (
def_path => $path,
cache => 0,
debug => 0,
subclass => 1
);

my $tbl = $NEWDB->table('Post');
$tbl->select_options("ORDER BY post_time DESC LIMIT 10");

my @loop;
my $sth = $tbl->select() || die $GT::SQL::error;
while (my $hit = $sth->fetchrow_hashref) {
push @loop, $hit;
}

return { latest_forum_posts => \@loop }

}


Code:
<%get_latest_forum%>
<ul>
<%loop latest_forum_posts%>
<li><a href="/cgi-bin/gforum/gforum.cgi?post=<%post_id%>"><%post_subject%></a></li>
<%endloop%>
</ul>

Thats all the time I can spare with that. Hopefully it works ;)

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!
Quote Reply
Re: [Andy] Display last X updates on a different page. In reply to
 
Thanks for trying, I am not able to get it to work...

Rob
Quote Reply
Re: [rmurdo] Display last X updates on a different page. In reply to
I need more information than that ;)

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!
Quote Reply
Re: [Andy] Display last X updates on a different page. In reply to
Something about get_latest_forum not being defined.
Quote Reply
Re: [rmurdo] Display last X updates on a different page. In reply to
Exact error:

Unknown Tag: 'get_latest_forum'

I went in to links admin, added template global get_latest_forum and all that info you posted.

Then I went in to my links template and added that other bit of code:

<%get_latest_forum%>
<ul>
<%loop latest_forum_posts%>
<li><a href="/cgi-bin/gforum/gforum.cgi?post=<%post_id%>"><%post_subject%></a></li>
<%endloop%>
</ul>
----

Did a build all, and that is where I get the Unknown tab message.

Rob
Quote Reply
Re: [rmurdo] Display last X updates on a different page. In reply to
 
Sorry, that was misleading.

I did a build all and then went to the page where I placed the code. I saw that error where the last bit of code was place.
Quote Reply
Re: [rmurdo] Display last X updates on a different page. In reply to
Hi,

Did you add the global? Tongue (Build > Template Globals)

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!
Quote Reply
Re: [Andy] Display last X updates on a different page. In reply to
 
I did, and verified it took.
Quote Reply
Re: [rmurdo] Display last X updates on a different page. In reply to
Hi,

Send over login details (for admin), and I'll see what I can find (no guarantee when I'll be able to look though - as I'm still pretty busy)

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!