1

(2 replies, posted in PunBB 1.3 troubleshooting)

Query Str :

SELECT ident FROM prefix_online WHERE user_id=1

Then Simply count this with mysql_num_rows

This will give you the total number of guest online

For other user you should use user_id!=1. Guest group id is 1

Take a look yourPrefix_online table.

2

(7 replies, posted in PunBB 1.3 troubleshooting)

This would add a title

if (!defined('FORUM_ROOT'))
    define('FORUM_ROOT', './');
require FORUM_ROOT.'include/common.php';

($hook = get_hook('ul_start')) ? eval($hook) : null;

/*if ($forum_user['g_read_board'] == '0')
    message($lang_common['No view']);
else if ($forum_user['g_view_users'] == '0')
    message($lang_common['No permission']);*/ /* For permission i copied this code from another page of punbb */
    
$link = 'useronline.php';

$forum_page['crumbs'] = array(
    array($forum_config['o_board_title'], forum_link($forum_url['index'])),
    array($lang_common['User online'], $link)
);


require FORUM_ROOT.'header.php';
?>

    <div class="main-head">
        <h2 class="hn"><span>User Online</span></h2>
    </div>
    
    <div class="main-content main-frm">
        
        <?php
        echo $forum_user['id'];
        
        ?>
    </div>
    
    
    <div class="main-foot">
<?php

    if (!empty($forum_page['main_foot_options']))
        echo "\n\t\t\t".'<p class="options">'.implode(' ', $forum_page['main_foot_options']).'</p>';

?>
        <h2 class="hn"><span>User Online</span></h2>
    </div>
<?php

($hook = get_hook('ul_end')) ? eval($hook) : null;

$tpl_temp = forum_trim(ob_get_contents());
$tpl_main = str_replace('<!-- forum_main -->', $tpl_temp, $tpl_main);
ob_end_clean();
// END SUBST - <!-- forum_main -->

require FORUM_ROOT.'footer.php';

This might help you!

I also newbie with this punBB....asked them for a simple tutorial let see whats happen

I looked over punBB it quite easy and awesome. I like it. Well then i looked over extensions, then i saw if i need some more extension in future what i will do? Then i decided to make extension so that i can use punBB with more than its feature [like a family  big_smile ].

I went on punBB wiki. I saw there are coding standard, Some Constants, Global variables etc names. But i need a small tutorial which will make a simple extension with permission feature.

Like a PHP FILE :

test.php

It will contain

<?php echo 'Hello!'; ?>

This test.php will be visible for a particular group of member [like moderator].

So when normal user request http://www.example.com/forum/test.php , he/she will get "You don't have permission to access this page" and when a moderator will request this page then , he/she will show "Hello! his username"


I just need to develop extension for punBB. Thats it!. Thanks in advance. Hope i can learn it. smile