Topic: Pulling subjects and authors from ONLY one forum to display on page

Hi all,

Is there any way to pull just the titles of the threads, and their authors (from one forum), and display them on a page?

I can do this right now through vbulletin, but I can't seem to find a way to do it with punbb. I do this currently in vbulletin like so:

<script type="text/javascript" src="http://www.test.com/forums/external.php?type=js&forumids=9"></script> 
                        <script language="" type="text/javascript">
                        <!--
                        for (x = 0; x < 6; x++)
                        {
                        document.writeln("<a href=\"http://www.test.com/forums/showthread.php?t="+threads[x].threadid+"\">"+threads[x].title+"</a> "+threads[x].threaddate+"<br />");
                        }
                        //-->
                        </script>

Re: Pulling subjects and authors from ONLY one forum to display on page

Something like this:
http://punbb.org/forums/search.php?search_id=1635462458
?

Re: Pulling subjects and authors from ONLY one forum to display on page

The link does not work.

4 (edited by elbekko 2006-07-12 20:05)

Re: Pulling subjects and authors from ONLY one forum to display on page

Not any more, I suppose the search cache has been deleted. Anyways, do you want it is an existing feature or wouldn't you mind creating a new page with a separate query?
I'll write a bit of code that will do it for you tongue

Re: Pulling subjects and authors from ONLY one forum to display on page

Here's the code:

<?php
define('PUN_ROOT', './');
include "include/common.php";

$result = $db->query("SELECT poster, subject FROM ".$db->prefix."topics WHERE forum_id=".intval($_GET['fid']));

while($row = $db->fetch_assoc($result))
    echo $row['subject']." by ".$row['poster']."<br />\n";
    
?>

It outputs something like this:

code wrote:

Test post by elbekko
Testing... by elbekko

You use it with listthreads.php?fid=1