Location: PHPKode > projects > pkZoos Website > _right.php
<?php
	if(!defined('PK_MAGIC'))
		die('hack or what?');





	/* */

    $tpl->add_var('FORM_ACTION_LOGIN', html_escape(make_url('register', array('action' => 'login'))));





	/* */

    $q = "
        SELECT
            user_id,
            user_name,
            user_is_admin,
            user_is_member
        FROM " . USERS_TABLE . "
		WHERE last_online_time > " . (CURRENT_TIME - $config['session_online_time']) . "
        ORDER BY user_name ASC
    ";

    $user_res = $db->query($q);
    $user_count = $db->num_rows($user_res);

	$tpl->add_var('USER_COUNT', $user_count);

    for($user_i = 0; $user_i < $user_count; $user_i++)
    {
        $user_row = $db->fetch_row($user_res);





		/* */

		$q = "
			SELECT mod_id
			FROM " . MODS_TABLE . "
			WHERE user_id = " . $user_row['user_id'] . "
		";

        $mod_res = $db->query($q);

        if($db->fetch_row($mod_res))
        {
        	$user_row['user_is_mod'] = 1;
        }
        else
        {
        	$user_row['user_is_mod'] = 0;
        }





		/* */

        $tpl->add_block_vars
        (
            'users', array
            (
                'NAME' => html_escape($user_row['user_name']),
                'IS_MOD' => $user_row['user_is_mod'],
                'IS_ADMIN' => $user_row['user_is_admin'],
                'IS_MEMBER' => $user_row['user_is_member'],
                'URL' => html_escape(make_url('user', array('user_id' => $user_row['user_id'])))
            )
        );
    }
?>
Return current item: pkZoos Website