Topic: Home page of this site?

I'm considering using punbb on a site, and I like how the punbb.org site shows on the home page a list of recent new topics.  Is this a feature of punbb, or a mod, or something Rickard does manually from time to time?

Thanks,

Tracey

2

Re: Home page of this site?

try my simple mod
http://punbb.org/forums/viewtopic.php?id=4876
i use it in my site

If your people come crazy, you will not need to your mind any more.

Re: Home page of this site?

Thanks!

Re: Home page of this site?

I believe zaher's mod will post you favorite posts on your home page. If you just want the most recent posts, then look at extern.php that comes with punBB. Instructions are commented in the code.

Do you love physics? :) http://www.ilovephysics.com
Interested in Internet Marketing? http://www.keyliberty.com

5 (edited by zaher 2004-11-09 04:19)

Re: Home page of this site?

in this mod  there is a sample how to make home page named "home.php", not necessary to use the whole mod.

If your people come crazy, you will not need to your mind any more.

6

Re: Home page of this site?

jchristophm wrote:

I believe zaher's mod will post you favorite posts on your home page. If you just want the most recent posts, then look at extern.php that comes with punBB. Instructions are commented in the code.

So, if I want to print the 15 most recent posts, does extern.php tell me how?

I want to print it in this format:

subject, poster, forum_name

Re: Home page of this site?

So, if I want to print the 15 most recent posts, does extern.php tell me how?

Yes.

Do you love physics? :) http://www.ilovephysics.com
Interested in Internet Marketing? http://www.keyliberty.com

8 (edited by D9r 2004-11-11 00:25)

Re: Home page of this site?

I worked with the extern.php file and got it to print the 15 recent posts with links.  But I'd still like to add the poster and forum_name(linked) to the output like this:

subject(linked) : poster : forum_name(linked)

So while fetching from the database, I need the poster, forum_id, then the forum_name from the other table, and whatever is needed to link to the forum.  Any suggestions would be appreciated.

Here's the code I'm working with:
--------
It's currently set up to display a list of the 15 most recent posts, with links to the posts:
subject(linked)

I want to do:
subject(linked) : poster : forum_name(linked)

//
// active2 (show recently active topics as 'subject(linked) : poster : forum_name(linked)') (HTML)
// 
// 
if ($_GET['action'] == 'active2')
{
    $order_by = ($_GET['action'] == 'active2') ? 't.last_post' : 't.posted';
    $forum_sql = '';

    // Was a forum ID supplied?
    if (isset($_GET['fid']))
    {
        $fid = intval($_GET['fid']);
        if (!empty($fid))
            $forum_sql = 'f.id='.$fid.' AND ';
    }

    // Should we output this as RSS?
    // Code removed


    // Output regular HTML
//    else
//    {
        $show = intval($_GET['show']);
        if ($show < 1 || $show > 50)
            $show = 15;

        // Fetch $show topics
        $result = $db->query('SELECT t.id, t.subject FROM '.$db->prefix.'topics AS t INNER JOIN 
'.$db->prefix.'forums AS f ON t.forum_id=f.id WHERE t.moved_to IS NULL AND 
'.$forum_sql.'f.admmod_only=0 ORDER BY '.$order_by.' DESC LIMIT '.$show) or 
error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());

        while ($cur_topic = $db->fetch_assoc($result))
        {
            if ($pun_config['o_censoring'] == '1')
                $cur_topic['subject'] = censor_words($cur_topic['subject']);

            if (pun_strlen($cur_topic['subject']) > $max_subject_length)
                $subject_truncated = trim(substr($cur_topic['subject'], 0, ($max_subject_length-5))).' ...';
            else
                $subject_truncated = $cur_topic['subject'];

            echo '<b>·</b> <a href="'.$pun_config['o_base_url'].'/viewtopic.php?
id='.$cur_topic['id'].'&action=new" title="'.pun_htmlspecialchars($cur_topic['subject']).'">'.
pun_htmlspecialchars($subject_truncated).'</a><br>'."\n";
        }
//    }

    exit;
}

(I added some linebreaks to minimize the horizontal scrolling.)

9 (edited by D9r 2004-11-11 02:20)

Re: Home page of this site?

I figured it out and got it to work.  Thanks for telling me about the extern.php file - that saved me a lot of time.  I don't know much PHP/MySQL, so it was a lot easier to just figure out what was already written and add in a few values rather than getting all the database stuff, config file, common file, language file, etc to work together from scratch.

Rickard, thanks for setting up that extern.php file.  Very helpful and thoughtful of you.  I was having a heck of a time trying to figure out how to call to the database from a different subdomain.  Your solution is so much easier.

The solution I came up with is at HiveMinds.info for anyone who's interested:
http://hiveminds.info/phpBB/viewtopic.php?t=2602