TinyPortal

Development => Block Codes => Topic started by: greenman on January 04, 2007, 11:03:36 AM

Title: Recent New Topics (topic title only)
Post by: greenman on January 04, 2007, 11:03:36 AM
I'm not very good at this, can someone help me out.

What I would want would be the exact same code as talked about in this topic: http://www.tinyportal.net/index.php?topic=11574.0

But instead of having for a specific board, just overall for the forum. Sounds like a stupid question with an easy answer but do read on.
The problem is, in the SSI the code is coded to show in what board, posted by who, and the date. What I want is just the name of the topic as a link to the topic, that's it. Just like the code in topic posted above works as.


I hope I'm not asking for something that has already been asked for, I searched but didn't find.

Thank you. :)
Title: Re: Recent New Topics (topic title only)
Post by: IchBin on January 04, 2007, 02:31:04 PM
You could just take the code from this post and modify it to suit your needs?
http://www.tinyportal.net/index.php?topic=596.0
Title: Re: Recent New Topics (topic title only)
Post by: jacortina on January 04, 2007, 10:45:21 PM
If you call ssi_RecentTopics so that it returns an array (rather than echoing out its results), you can take that array and choose what to show.

Aside from that, as IchBin suggested, that topic has a few different ways of presenting recent topic displays. I'm sure one could be adapted.
Title: Re: Recent New Topics (topic title only)
Post by: greenman on January 06, 2007, 05:36:58 AM
Thanks a lot.
Not sure if this is proper, but works like a charm for me. :)

<?php
$what
=ssi_recentTopics('5', NULL, 'array');Ã, 
foreach ($what as $topic)
{
echo
'
<a href="'
, $topic['href'], '">', $topic['link'], '</a><br />';
}
?>


One little problem though, it shows the top threads with newest posts in them, how can I make it show latest posted threads? (not effected by posts)
Title: Re: Recent New Topics (topic title only)
Post by: jacortina on January 06, 2007, 05:48:22 AM
If you want the most recently STARTED threads, you'll have to write a function for it. It's actually a matter of duplicating the ssi_RecentTopics functions and changing the "ORDER BY" clause in the query from:

      ORDER BY t.ID_LAST_MSG DESC

to:

      ORDER BY t.ID_FIRST_MSG DESC
Title: Re: Recent New Topics (topic title only)
Post by: greenman on January 06, 2007, 07:14:43 AM
Thanks :)

Works perfectly. ;D