Topic: Custom made pages integration

Ok i read about it in wiki

http://punbb.informer.com/wiki/punbb13/ … t_10_posts

<?php
 
define('RECENT_POSTS_SHOW_POST', true); // Set to false to show topic subject only
define('RECENT_POSTS_MAX_POST_LENGTH', 20); // Limit length of the post text displayed
 
if (!defined('FORUM_ROOT'))
    define('FORUM_ROOT', './');
 
require FORUM_ROOT.'include/common.php';
 
// Get 10 lastest posts
$query = array(
    'SELECT'    => 'p.id, p.message, t.subject',
    'FROM'        => 'posts AS p',
    'JOINS'        => array(
        array(
            'LEFT JOIN'        => 'topics AS t',
            'ON'            => 'p.topic_id = t.id'
        )
    ),
    'ORDER BY'    => 'p.posted DESC',
    'LIMIT'        => '0,10'
);
 
$result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
 
$recent_posts = array();
while ($cur_post = $forum_db->fetch_assoc($result))
    $recent_posts[] = $cur_post;
 
// Print out posts
if (!empty($recent_posts))
{
    ?>
    <ul>
    <?php
    foreach($recent_posts as $cur_post)
    {
 
        echo '<li><a href="', forum_link($forum_url['post'], $cur_post['id']), '">', $cur_post['subject'], '</a>';
 
        if (RECENT_POSTS_SHOW_POST)
        {
            if (utf8_strlen($cur_post['message']) > RECENT_POSTS_MAX_POST_LENGTH)
                $cur_post['message'] = utf8_substr($cur_post['message'], 0, RECENT_POSTS_MAX_POST_LENGTH).'…';
 
            echo '<br />', "\n", $cur_post['message'];
        }
 
        echo '</li>';
    }
    ?>
    </ul>
    <?php
}
 
?>

This shows 10 recent post, can someone help me to make it specifically shows a topic from any forum id or topic that i want?

example i only want it to shows topic with its post from here

http://hakimct.freehostia.com/forum/viewforum.php?id=2

thanks again! big_smile big_smile big_smile

if mONey is lOSt nOThINg is lOSt,
if cHArACtER is lOSt sOMeTHiNG is lOSt,
bUT,
if rELiGIon and eDUcATiON aRE lOSt eVErYThINg is lOSt.

Re: Custom made pages integration

Are you trying to use extern.php?