Author Topic: Req: More detailed who online list  (Read 72304 times)

0 Members and 1 Guest are viewing this topic.

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: Req: More detailed who online list
« Reply #45 on: January 17, 2006, 11:28:00 PM »
Quote

being on USER_TABLE must work , i think


The users table is : USERS_TABLE. ;)

As for the rest, if you did added the ending braket at the end, everything should work out as you planned (for the first release).

Offline Stoleti

  • Hero Member
  • *****
  • Posts: 574
    • View Profile
Re: Req: More detailed who online list
« Reply #46 on: January 17, 2006, 11:31:08 PM »
error has gone  :D

but still showing only the default stuff (country flag + username) , other stuff no  :roll:

yes USERS_TABLE ..lil grammar mistake  :mrgreen:

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: Req: More detailed who online list
« Reply #47 on: January 17, 2006, 11:34:28 PM »
Quote

But still showing only the default stuff (country flag + username) , other stuff no


If you're saying that the userpic row is not showing up, then it is clairly an implementation issue.

However, just to see if I'm right ;

[ edit ]

let's remain with this line :

Quote

FROM ".USERS_TABLE;


Offline Stoleti

  • Hero Member
  • *****
  • Posts: 574
    • View Profile
Re: Req: More detailed who online list
« Reply #48 on: January 17, 2006, 11:50:54 PM »
still showing the default users list (who's online)

my code with updates :

Code: [Select]
if (defined("GET_USER_ONLINE") && ($config['display_whosonline'] == 1 || $user_info['user_level'] == ADMIN)) {
  $time_out = time() - 300;
  $sql = "SELECT s.session_user_id, s.session_lastaction, s.session_ip".get_user_table_field(", u.", "user_id").get_user_table_field(", u.", "user_level").get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_invisible")."
  FROM ".SESSIONS_TABLE." s
  LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = s.session_user_id)
  WHERE s.session_lastaction >= $time_out
  ORDER BY ".get_user_table_field("u.", "user_id")." ASC, s.session_ip ASC";
  $result = $site_db->query($sql);
  while ($row = $site_db->fetch_array($result)) {
  $sql = "SELECT user_country, user_age, user_sexuality, userpic FROM ".USERS_TABLE." WHERE ".get_user_table_field("", "user_id")." = ".$user_info['user_id'];
  $additional_results = $site_db->query($sql);
  while ($additional_user_rows = $site_db->fetch_array($additional_results)) {
    if ($row['session_user_id'] != GUEST && (isset($row['user_id']) && $row['user_id'] != GUEST)) {
      if (!isset($prev_user_ids[$row['session_user_id']])) {
        $is_invisible = (isset($row[$user_table_fields['user_invisible']]) && $row[$user_table_fields['user_invisible']] == 1) ? 1 : 0;
        $invisibleuser = ($is_invisible) ? "*" : "";
        $username = (isset($row[$user_table_fields['user_level']]) && $row[$user_table_fields['user_level']] == ADMIN && $config['highlight_admin'] == 1) ? sprintf("<b>%s</b>", $row[$user_table_fields['userpic']]. $row[$user_table_fields['user_name']]) : $row[$user_table_fields['user_name']];
        if (!$is_invisible || $user_info['user_level'] == ADMIN) {
          $user_online_list .= ($user_online_list != "") ? "<br />" : "";
          $user_profile_link = (!empty($url_show_profile)) ? str_replace("{user_id}", $row['session_user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$row['session_user_id'];
          /*
  MOD VISITORS COUNTRY FLAGS
  START INSERT
*/
        $cid = geoip_country_code_by_addr($gi, $row['session_ip']);
        if (empty($cid)) $cid = "lan";
        $countries[$cid] = isset($countries[$cid]) ? $countries[$cid]+1 : 1;
        $username = "<img src=\"".ROOT_PATH."flags/".strtolower($cid).".png"."\" alt=\"".(($cid != "lan") ? $gi->GEOIP_COUNTRY_NAMES[$gi->GEOIP_COUNTRY_CODE_TO_NUMBER[$cid]] : "Unknown or LAN")."\" border=0> ".$username;
/*
  MOD VISITORS COUNTRY FLAGS
  END INSERT
*/   
          $userpic_source = (isset($additional_user_rows['userpic']) && $additional_user_rows['userpic'] && $config['userpic']) ? $additional_user_rows['userpic'] : "";
          $userpic_img = $site_sess->url(ROOT_PATH."data/userpic/".$userpic_source);
          $user_sexuality = (isset($additional_user_rows['user_sexuality']) && $additional_user_rows['user_sexuality']) ? $additional_user_rows['user_sexuality'] : $lang['no_comments'];
          $user_age = (isset($additional_user_rows['user_age']) && $additional_user_rows['user_age']) ? $additional_user_rows['user_age']. REPLACE_EMPTY. $lang['years_old'] : "";
          $user_country = (isset($additional_user_rows['user_country']) && $additional_user_rows['user_country']) ? $additional_user_rows['user_country'] : "";
          $user_gender = (isset($additional_user_rows['user_gender']) && $additional_user_rows['user_gender']) ? $additional_user_rows['user_gender'] : "";
          $user_online_list .= "<a href=\"".$site_sess->url($user_profile_link)."\">".$username."</a>".$invisibleuser;
        }
        (!$is_invisible) ? $num_visible_online++ : $num_invisible_online++;
        $num_registered_online++;
      }
      $prev_user_ids[$row['session_user_id']] = 1;
    }
    else {
      if (!isset($prev_session_ips[$row['session_ip']])) {
        $num_guests_online++;
        /*
  MOD VISITORS COUNTRY FLAGS
  START INSERT
*/
        $cid = geoip_country_code_by_addr($gi, $row['session_ip']);
        if (empty($cid)) $cid = "lan";
        $countries[$cid] = isset($countries[$cid]) ? $countries[$cid]+1 : 1;
        $invitado_online_list  = "<font color=\"#00FFFF\">".$num_guests_online."</font><img src=\"".ROOT_PATH."flags/".strtolower($cid).".png"."\" alt=\"".(($cid != "lan") ? $gi->GEOIP_COUNTRY_NAMES[$gi->GEOIP_COUNTRY_CODE_TO_NUMBER[$cid]] : "Unknown or LAN")."\" border=0> ".$invitado_online_list ;
/*
  MOD VISITORS COUNTRY FLAGS
  END INSERT
*/
if ($num_guests_online > 1){
$invitado_online_list .= " , ";
}
      }
    }
    }
    $prev_session_ips[$row['session_ip']] = 1;
  }
  $num_total_online = $num_registered_online + $num_guests_online;
  //$num_invisible_online = $num_registered_online - $num_visible_online;

  $site_template->register_vars(array(
    "num_total_online" => $num_total_online,
    "num_invisible_online" => $num_invisible_online,
    "num_registered_online" => $num_registered_online,
    "num_guests_online" => $num_guests_online,
    "userpic_img" => $userpic_img,
    "user_sexuality" => $user_sexuality,
    "user_age" => $user_age,
    "user_country" => $user_country,
    "user_gender" => $user_gender,
    "user_online_list" => $user_online_list,
    "lang_user_online" => str_replace('{num_total_online}', $num_total_online, $lang['user_online']),
    "lang_user_online_detail" => str_replace(array('{num_registered_online}','{num_invisible_online}','{num_guests_online}'), array($num_registered_online,$num_invisible_online,$num_guests_online), $lang['user_online_detail']),
  ));
  $whos_online = $site_template->parse_template("whos_online");
  $site_template->register_vars("whos_online", $whos_online);
  unset($whos_online);
  unset($prev_user_ids);
unset($prev_session_ips);
}

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: Req: More detailed who online list
« Reply #49 on: January 17, 2006, 11:53:53 PM »
And what about your whos_online.html file ? Could you post it as well ? In the mean time, you did not added the "user_gender" row in your SQL's SELECT statement.

Offline Stoleti

  • Hero Member
  • *****
  • Posts: 574
    • View Profile
Re: Req: More detailed who online list
« Reply #50 on: January 18, 2006, 12:00:12 AM »
all stuff i've in my USERS_TABLES , and i've put all tags you'e before posted on whos_online.html :), i've make all you've said  8)

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: Req: More detailed who online list
« Reply #51 on: January 18, 2006, 12:05:04 AM »
all stuff i've in my USERS_TABLES , and i've put all tags you'e before posted on whos_online.html :), i've make all you've said  8)

If so ... then why do I see :

Quote

$user_gender = (isset($additional_user_rows['user_gender']) && $additional_user_rows['user_gender']) ? $additional_user_rows['user_gender'] : "";         


and is NOT in :

Quote

$sql = "SELECT user_country, user_age, user_sexuality, userpic, where's user_gender ??? FROM ".USERS_TABLE." WHERE ".get_user_table_field("", "user_id")." = ".$user_info['user_id'];


:?:

Offline Stoleti

  • Hero Member
  • *****
  • Posts: 574
    • View Profile
Re: Req: More detailed who online list
« Reply #52 on: January 18, 2006, 12:17:22 AM »
added  :D wooooow its working !!!!!!!! :mrgreen:

and about paging, any news ?

a lil question how make i show each user by row with diferent background ??

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: Req: More detailed who online list
« Reply #53 on: January 18, 2006, 12:21:51 AM »
Quote

and about paging, any news ?


Since it would seems, by your report, that all is working properly. I should start considering plans to build an additional routines for the whos_online with paging. I will keep this topic updated once I succeed.

Quote

a lil question how make i show each user by row with diferent background ??


One feature at the time - shall we ? !

Offline Stoleti

  • Hero Member
  • *****
  • Posts: 574
    • View Profile
Re: Req: More detailed who online list
« Reply #54 on: January 18, 2006, 12:25:30 AM »
sure  :D !!! for now thats a very good work, succefull  :mrgreen:

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: Req: More detailed who online list
« Reply #55 on: January 18, 2006, 12:28:53 AM »
May I ask you to post your URL so that others might see a preview of these successful codings ? ;)

Offline Stoleti

  • Hero Member
  • *****
  • Posts: 574
    • View Profile
Re: Req: More detailed who online list
« Reply #56 on: January 18, 2006, 12:43:13 AM »
actually i'm having a problem about user age....

this show birthday  date and not a user age  ( show "------------" )

-----

But in member profile the tag {user_age} works and here only {user_age_birthday}  8O

the info about Age MOD in attach  8)


-------

well i ill show when all works  fine :mrgreen: , and probably if thats not against rulez move to publish mod's ????? :roll:

Offline Stoleti

  • Hero Member
  • *****
  • Posts: 574
    • View Profile
Re: Req: More detailed who online list
« Reply #57 on: January 18, 2006, 12:45:50 AM »
this means

{user_age } => XX

{user_age_birthday} => XXXX - XX - XX

but why in profile both work and here only birthday work  8O

from DB_Field_Definitions.php

Quote
$additional_user_fields['user_age_birthday'] = array($lang['user_age_birthday'], "text", 1);


but why {user_age} not work like in member_profile ?? 8O

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: Req: More detailed who online list
« Reply #58 on: January 18, 2006, 12:47:51 AM »
Quote

but why {user_age} not work like in member_profile ??


Please read the footer of Step 1 for the answer of that question.

Offline Stoleti

  • Hero Member
  • *****
  • Posts: 574
    • View Profile
Re: Req: More detailed who online list
« Reply #59 on: January 18, 2006, 12:52:38 AM »
another problem this only show my info, another users, not show at this way  8O , show default way....

 8O 8O