Hi all,
I have a big problem (i think for you it´s small one ;-) ).

I want to have a "Who´s online block" i know there are alot of snippets and modules out there but I´m looking for a special function. I´m using Drupal 5.1

I try to get it look this way :
(10 last logged in users/or online users)

Username (coloured pink if profile_gender = female and light blue if profile_gender = male)
I would also like to have a small icon in front of the username

if profile_gender = male show website.com/drupal/files/male.jpg 25x25px
if profile_gender = female show website.com/drupal/files/female.jpg 25x25px

I´m very sorry but I have two other stupid questions (but I don´t get it on my own):

How can i print this 10 users into 2 columns (5on the right and 5 on the left) ?
And how can I have a border around this whole thing...

I´m very sorry but I don´t get it to work since days/weeks and now I have to annoy you with this newbie questions.

What I got until now is this:

$number = db_result(db_query('SELECT COUNT(uid) AS number FROM {users} WHERE status=1'));

        if (user_access('access content')) {
          // Count users with activity in the past defined period.
          $time_period = variable_get('user_block_seconds_online', 900);

          // Perform database queries to gather online user lists.
          $users = db_query('SELECT uid, name, access FROM {users} WHERE access >= %d AND uid != 0 ORDER BY access DESC', time() - $time_period);
          $total_users = db_num_rows($users);

   
          // Display a list of currently online users.
          $max_users = variable_get('user_block_max_list_count', 10);
          if ($total_users && $max_users) {
            $items = array();

            while ($max_users-- && $account = db_fetch_object($users)) {
              $items[] = $account;
            }
            $output .= theme('user_list', $items, t('Online users'));
          }

        }
        return $output;

Thanks in advance,
best regards,
Maik

Comments

msolt’s picture

Can´t anybody help me?

vm’s picture

You may want to seek out someone in the paid services forum for this task. It's not that trivial a patch IMHO.