Topic: More extern.php help, please

Calsoft temporary address: http://www.secondpagemedia.com/~beeh/

I'm working on making a website that's integrated with PunBB, but that darn exern.php is beyond me.

What I'd like is for the information displayed under the 'Discussion board" header to be displayed as a list (as below).

* Guests online: 0
* Registered users online: 1
* Total number of registered users: 3
* Newest registered user: Ares
* Total number of topics: 8
* Total number of posts: 21

I've tried editing extern.php myseldf, but all I get is errors.

Thanks guys!

Through the awful grace of God

"Dude, CSS and XHTML are like two boys who are deeply in love.  They're perfect for each other, but no one can acccept it."

2

Re: More extern.php help, please

Maybe try adding the entire path... thats what I did and it seems to work fine:

<?php include('http://www.uscivilwaronline.com/forums/extern.php?action=news&fid=15&summary=yes&show=5'); ?>

Re: More extern.php help, please

Maybe you misunderstood.  If you checked the page you'd see I can make it work, I'd just like it to display as a list?

Through the awful grace of God

"Dude, CSS and XHTML are like two boys who are deeply in love.  They're perfect for each other, but no one can acccept it."

Re: More extern.php help, please

Please guys, any help!

Through the awful grace of God

"Dude, CSS and XHTML are like two boys who are deeply in love.  They're perfect for each other, but no one can acccept it."

5

Re: More extern.php help, please

Bradyn wrote:

What I'd like is for the information displayed under the 'Discussion board" header to be displayed as a list (as below).

* Guests online: 0
* Registered users online: 1
* Total number of registered users: 3
* Newest registered user: Ares
* Total number of topics: 8
* Total number of posts: 21

That's how I see it...

6

Re: More extern.php help, please

Did you try this

//
// Show users online
//
else if ($_GET['action'] == 'online' || $_GET['action'] == 'online_full')
{
    // Load the index.php language file
    require PUN_ROOT.'lang/'.$pun_config['o_default_lang'].'/index.php';
    
    // Fetch users online info and generate strings for output
    $num_guests = $num_users = 0;
    $users = array();
    $result = $db->query('SELECT user_id, ident FROM '.$db->prefix.'online WHERE idle=0 ORDER BY ident', true) or error('Unable to fetch online list', __FILE__, __LINE__, $db->error());

    while ($pun_user_online = $db->fetch_assoc($result))
    {
        if ($pun_user_online['user_id'] > 1)
        {
            $users[] = '<a href="'.$pun_config['o_base_url'].'/profile.php?id='.$pun_user_online['user_id'].'">'.pun_htmlspecialchars($pun_user_online['ident']).'</a>';
            ++$num_users;
        }
        else
            ++$num_guests;
    }

    echo '<li>'.$lang_index['Guests online'].': '.$num_guests.'</li>';

    if ($_GET['action'] == 'online_full')
        echo '<li>'.$lang_index['Users online'].': '.implode(', ', $users).'</li>';
    else
        echo '<li>'.$lang_index['Users online'].': '.$num_users.'</li>';

    return;
}


//
// Show board statistics
//
else if ($_GET['action'] == 'stats')
{
    // Load the index.php language file
    require PUN_ROOT.'lang/'.$pun_config['o_default_lang'].'/index.php';

    // Collect some statistics from the database
    $result = $db->query('SELECT COUNT(id)-1 FROM '.$db->prefix.'users') or error('Unable to fetch total user count', __FILE__, __LINE__, $db->error());
    $stats['total_users'] = $db->result($result);

    $result = $db->query('SELECT id, username FROM '.$db->prefix.'users ORDER BY registered DESC LIMIT 1') or error('Unable to fetch newest registered user', __FILE__, __LINE__, $db->error());
    $stats['last_user'] = $db->fetch_assoc($result);

    $result = $db->query('SELECT SUM(num_topics), SUM(num_posts) FROM '.$db->prefix.'forums') or error('Unable to fetch topic/post count', __FILE__, __LINE__, $db->error());
    list($stats['total_topics'], $stats['total_posts']) = $db->fetch_row($result);

    echo '<li>'.$lang_index['No of users'].': '.$stats['total_users'].'</li>';
    echo '<li>'.$lang_index['Newest user'].': <a href="'.$pun_config['o_base_url'].'/profile.php?id='.$stats['last_user']['id'].'">'.pun_htmlspecialchars($stats['last_user']['username']).'</a></li>';
    echo '<li>'.$lang_index['No of topics'].': '.$stats['total_topics'].'</li>';
    echo '<li>'.$lang_index['No of posts'].': '.$stats['total_posts'].'</li>';

    return;
}

You have to put the <ul></ul> in your page as it isn't being generated by extern.

Elzar: he wants a list not a paragraph and a bunch of br's.

Re: More extern.php help, please

Yeah, I tried adding it myself, but all I got was errors.  I'll give that a try after work, thanks.

Through the awful grace of God

"Dude, CSS and XHTML are like two boys who are deeply in love.  They're perfect for each other, but no one can acccept it."

Re: More extern.php help, please

Flawless!  Thanks mate.

Through the awful grace of God

"Dude, CSS and XHTML are like two boys who are deeply in love.  They're perfect for each other, but no one can acccept it."