Author Topic: [MOD Req] Who's online more detailed-  (Read 97938 times)

0 Members and 2 Guests are viewing this topic.

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: [MOD Req] Who's online more detailed-
« Reply #60 on: February 13, 2006, 05:40:42 PM »
Assuming you still have my definition I did for you for this one :

Quote

$whos_online_userpic


right above, you should find the equality of it. Then, right above, add :

Code: [Select]

$user_country = $row['user_country'];


Offline trez

  • Hero Member
  • *****
  • Posts: 613
    • View Profile
    • blog / photography
Re: [MOD Req] Who's online more detailed-
« Reply #61 on: February 13, 2006, 05:44:20 PM »
Hm, so i did it, put user_country is still not showing ..

Code: [Select]
        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'];
          $userpic_img = ($config['userpic'] && @file_exists(ROOT_PATH."data/userpic/".$row['userpic']) && $user_info['user_level'] >= USER) ? "<img src=\"".ROOT_PATH."data/userpic/".$row['userpic']."\" width=\"100".$userpic_width."\" height=\"100".$userpic_height."\">" : "";
     
  $user_country = $row[$user_table_fields['user_country']];
    $whos_online_userpic = str_replace("{userpic_img}", "", $userpic_img);
          $user_online_list .= "<a href=\"".$site_sess->url($user_profile_link)."\"><center> ".$user_country. $whos_online_userpic."<br />".$username."</a>".$invisibleuser."</center>".REPLACE_EMPTY. REPLACE_EMPTY;
        }

thats the entry in my db_field_definitions.php
Code: [Select]
$additional_user_fields['user_country'] = array($lang['user_country'], "dropdown", 0, $var, 0, 0, 0, 1);

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: [MOD Req] Who's online more detailed-
« Reply #62 on: February 13, 2006, 05:45:48 PM »
Woops. It's true. It's not a core field but an additional field. I have just modified my post above. Then, make the replacement again. ;)

Offline trez

  • Hero Member
  • *****
  • Posts: 613
    • View Profile
    • blog / photography
Re: [MOD Req] Who's online more detailed-
« Reply #63 on: February 13, 2006, 05:53:38 PM »
great!  :) :)

Its working also with the age and gender. Just two questions:

- The user_gender is shown as a "m" or "w" , what do i have to change to get the icon for male or female ?
- I want to resize the userpic proportonialy, i've seen that code in an other MOD but i cant remember where, do you know it ?

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: [MOD Req] Who's online more detailed-
« Reply #64 on: February 13, 2006, 05:59:13 PM »
Quote

The user_gender is shown as a "m" or "w" , what do i have to change to get the icon for male or female ?


I don't see any posted codes. How could I know ? :?

Quote

I want to resize the userpic proportonialy, i've seen that code in an other MOD but i cant remember where, do you know it ?


The width and height is already added in your userpic code. It should be resized proportionally already.

Offline trez

  • Hero Member
  • *****
  • Posts: 613
    • View Profile
    • blog / photography
Re: [MOD Req] Who's online more detailed-
« Reply #65 on: February 13, 2006, 06:03:54 PM »
sorry, here is the code:

Code: [Select]
       

 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'];
          $userpic_img = ($config['userpic'] && @file_exists(ROOT_PATH."data/userpic/".$row['userpic']) && $user_info['user_level'] >= USER) ? "<img src=\"".ROOT_PATH."data/userpic/".$row['userpic']."\" width=\"100".$userpic_width."\" height=\"100".$userpic_height."\">" : "";
     
        $user_age_birthday = $row['user_age_birthday'];
$user_country = $row['user_country'];
        $user_gender = $row['user_gender'];
    $whos_online_userpic = str_replace("{userpic_img}", "", $userpic_img);
          $user_online_list .= "<a href=\"".$site_sess->url($user_profile_link)."\"><center> ".$user_country. $user_age_birthday. $user_gender. $whos_online_userpic."<br />".$username."</a>".$invisibleuser."</center>".REPLACE_EMPTY. REPLACE_EMPTY;
        }
        (!$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++;


if ($num_guests_online > 1){
$invitado_online_list .= " , ";
}

edit: about the userpic - yes, but they were to large, i have to resize them, but proportionaly

Here is the code from the db_field_definitions if that may help you:

Code: [Select]
$additional_user_fields['user_gender'] = array($lang['user_gender'], "dropdown", 0, array("n" => "---","b" => "NA", "m" => "Man", "w" => "Woman"), 1, 0, 0, 0);
$additional_user_fields['user_age_birthday'] = array($lang['user_age_birthday'], "text", 1);

here is the image location (from member_profile.html)
Code: [Select]
<img src="{template_url}/images/{user_gender}.gif">

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: [MOD Req] Who's online more detailed-
« Reply #66 on: February 13, 2006, 06:37:59 PM »
Quote

edit: about the userpic - yes, but they were to large, i have to resize them, but proportionaly


And what if you reduce them even more than it looks like comparing to the member profile ? ;)

Quote

$additional_user_fields['user_gender'] = array($lang['user_gender'], "dropdown", 0, array("n" => "---","b" => "NA", "m" => "Man", "w" => "Woman"), 1, 0, 0, 0);


Ah ! now, I see what you mean. Ok, then you'd need to post the 'whole ' SELECT Form from your HTML member template file (relatively with the user_gender field) in order to fit in the whos online feature.

Quote

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


As for this one, it's the same way as the user_country field I posted above.

A little tip: When you see an additional user field, such as the bolded text above, then it means you can simply call it like the user_country field.

Quote

<img src="{template_url}/images/{user_gender}.gif">


Above the $user_country = ... string,

add :

Code: [Select]

$user_gender = "<img src=\"".get_gallery_image($row['user_gender'])."gif"\">";


This should do it. ;)

Offline Stoleti

  • Hero Member
  • *****
  • Posts: 574
    • View Profile
Re: [MOD Req] Who's online more detailed-
« Reply #67 on: February 13, 2006, 07:03:55 PM »
well i ill wait for this be complete , and posted step by step   :mrgreen:

Offline trez

  • Hero Member
  • *****
  • Posts: 613
    • View Profile
    • blog / photography
Re: [MOD Req] Who's online more detailed-
« Reply #68 on: February 13, 2006, 10:03:37 PM »
thanks very much, it works, but now my regular whois_online is wrong ... off, one problem after another .. i need a breeak :(

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: [MOD Req] Who's online more detailed-
« Reply #69 on: February 13, 2006, 10:38:09 PM »
Quote

thanks very much, it works, but now my regular whois_online is wrong


And what is the definition of wrong in this case ?

Offline trez

  • Hero Member
  • *****
  • Posts: 613
    • View Profile
    • blog / photography
Re: [MOD Req] Who's online more detailed-
« Reply #70 on: February 13, 2006, 10:43:37 PM »
Oracle its about that one: http://www.4homepages.de/forum/index.php?topic=11596.0
It has nothing to do with this topic, but its a real problem ..  :roll:

Offline trez

  • Hero Member
  • *****
  • Posts: 613
    • View Profile
    • blog / photography
Re: [MOD Req] Who's online more detailed-
« Reply #71 on: February 15, 2006, 10:07:14 AM »
Hey Oracle,

today the forum is working - yeah ;) so, i have some additional questions, if you have time please answer me:

Quote
And what if you reduce them even more than it looks like comparing to the member profile ? ;)

In the members profile the specifed size is about 400 x 350, bacause it looks better in profiles, but for the onlinelist its just to big. I believe there was a line i have seen to reduce them proportionaly ?


Quote
Ah ! now, I see what you mean. Ok, then you'd need to post the 'whole ' SELECT Form from your HTML member template file (relatively with the user_gender field) in order to fit in the whos online feature.

here you are ;)
Code: [Select]
          <td class="cl_left"><b>{lang_user_country}</b></td>
<td class="cl_right">{user_country_dropdown} </td>
</tr>
<tr>
    <td class="cl_left"><b>{lang_user_gender}</b></td>
    <td class="cl_right"><b>{user_gender_dropdown}</b><img src="{template_url}/images/{user_gender}.gif"></td>
</tr>


 <tr>
<td class="cl_left"><b>{lang_user_birthday}</b></td>
<td class="cl_right">
<select name="birthday_day" style="width:50px;">
{dropdown_day}
</select>
<select name="birthday_month" style="width:98px;">
{dropdown_month}
</select>
<select name="birthday_year" style="width:75px;">
{dropdown_year}
</select>
</td>
</tr>

Quote
Above the $user_country = ... string,
add :
Code: [Select]
$user_gender = "<img src=\"".get_gallery_image($row['user_gender'])."gif"\">";

doesnt work for me, it gives me:
Code: [Select]
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /www/ggrec.com/www/root/zapomnime2/includes/sessions_un.php on line 445

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /www/ggrec.com/www/root/zapomnime2/includes/sessions_un.php on line 445

And again, thanks for the wonderfull help :)

Georgi

PS: The MOD works pretty well for me, my users love it, its a very nice feature when you have more users online ;)

Offline IcEcReaM

  • Hero Member
  • *****
  • Posts: 714
    • View Profile
    • My little Testboard
Re: [MOD Req] Who's online more detailed-
« Reply #72 on: February 15, 2006, 10:22:17 AM »
You can define the image size also in templates directly by using width & height

Code: [Select]
<img src="url" width="100" height="100">

About your error
this line
Code: [Select]
$user_gender = "<img src=\"".get_gallery_image($row['user_gender'])."gif"\">";should be like this:
Code: [Select]
$user_gender = "<img src=\"".get_gallery_image($row['user_gender'])."gif\">";a " too much.
don't know if the code is ok, checked only the syntax for errors.
Coding is a everlasting competition between programmers who tries to write larger, better and idiot-safe programs and the universe producing larger and stupider idiots...
...so far the universe won
bump

Offline trez

  • Hero Member
  • *****
  • Posts: 613
    • View Profile
    • blog / photography
Re: [MOD Req] Who's online more detailed-
« Reply #73 on: February 15, 2006, 10:32:39 AM »
Yes you were right about the usergender code, just one thing, i have to add a "." before the "gif" so it looks like this (just for the mod records):

Code: [Select]
$user_gender = "<img src=\"".get_gallery_image($row['user_gender']).".gif\">";
About the userpic, i want it to be resized proportionally ;)

thats the line:

Code: [Select]
$userpic_img = ($config['userpic'] && @file_exists(ROOT_PATH."data/userpic/".$row['userpic']) && $user_info['user_level'] >= USER) ? "<img src=\"".ROOT_PATH."data/userpic/".$row['userpic']."\" width=\"100".$userpic_width."\" height=\"100".$userpic_height."\">" : "";
;)

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: [MOD Req] Who's online more detailed-
« Reply #74 on: February 15, 2006, 03:11:22 PM »
Quote

$user_gender = "<img src=\"".get_gallery_image($row['user_gender']).".gif\">";


Correct. I forgot to add the dot with the GIF extension.

Quote

About the userpic, i want it to be resized proportionally


From your current point, you can resize easily from these two marks :

Quote

width=\"100".$userpic_width."\" height=\"100".$userpic_height."\"