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

0 Members and 1 Guest are viewing this topic.

Offline trez

  • Hero Member
  • *****
  • Posts: 613
    • View Profile
    • blog / photography
Re: [MOD Req] Who's online more detailed-
« Reply #105 on: February 16, 2006, 05:29:46 PM »
Why are you responding so "strong" ??

Ok, if we talk this way, how have i to understand this:

Code: [Select]
Then, [b]the block I posted above[/b], move it into the whos_online.php (you must create on your ROOT_PATH). Then, paste the following in [b]your new file[/b] :
So , which box actually? The firs or the second one above? And what new file? Whos_online.php or something other?

Just this line can be understanded in different ways, even more, if you are talking to a newbie like me. So instead of wasting our time with "who is right, who is wrong about this", we can finish this MOD or we can cancel it.

I've installed over 50 MODs, many of them yours, and had no problem untill yet to understand what line/code to put where. So thats the first time, and dont expect people to understand you if you are not clear enough. When someone tells you, i don't understand, it doesnt mean hes not following your instructions!


Offline IcEcReaM

  • Hero Member
  • *****
  • Posts: 714
    • View Profile
    • My little Testboard
Re: [MOD Req] Who's online more detailed-
« Reply #106 on: February 16, 2006, 05:33:28 PM »
Quote

as i said, i didn't checked the code,
only which error messages are shown.


@icecream:

It is includes/sessions.php file we're talking about. It must be checked (highly important). ;)



But not by me,
i checked only for any syntax errors. ( not more and not less)   :mrgreen:
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 TheOracle

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

I've installed over 50 MODs, many of them yours, and had no problem untill yet to understand what line/code to put where. So thats the first time, and dont expect people to understand you if you are not clear enough.


Sorry, I cannot imagine right now the level of difficulty you're encountering on this subject. After many replies, since my instructions, it is clairly you cannot understand the way 4images codings works (as I have absolutely nothing against that). However, you asked for step-by-step instructions and if you believe my instructions are not clarified enough (as you also expressively believe that it's your first time you're encountering issues due to my instructions), then I'm sorry to say that I'm stepping out of your request.

I have tried many possibilities but I seem to fail to make you understand the purpose of my instructions. I also understand we're not speaking the same language, which makes it far more difficult, but this is about codings and understanding of these steps you have to follow.

Good luck to you !

Offline TheOracle

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

But not by me,


@icecream:

Perhaps you meant : But not for me ? ;)

If not, why would you post corrections about sessions.php file ? :mrgreen:

Offline IcEcReaM

  • Hero Member
  • *****
  • Posts: 714
    • View Profile
    • My little Testboard
Re: [MOD Req] Who's online more detailed-
« Reply #109 on: February 16, 2006, 05:44:50 PM »
no, i meant: not by me.
Means:
If the code posted above from trez,
i am not the one who has to check it, if it's good or has any security issues or somethingelse.
I just wanted to correct any syntax error, not the whole code by itself.
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 TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: [MOD Req] Who's online more detailed-
« Reply #110 on: February 16, 2006, 05:45:41 PM »
no, i meant: not by me.
Means:
If the code posted above from trez,
i am not the one who has to check it, if it's good or has any security issues or somethingelse.
I just wanted to correct any syntax error, not the whole code by itself.

Point taken. ;)

Offline trez

  • Hero Member
  • *****
  • Posts: 613
    • View Profile
    • blog / photography
Re: [MOD Req] Who's online more detailed-
« Reply #111 on: February 16, 2006, 05:56:16 PM »
-

You didn't get the point of my last post, but it makes no sense to discuss this either. Thanks for you help so far, topic closed (for me)
Good luck either.

Offline TheOracle

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

Good luck either.


Thanks, but I won't need it on this one since I already made these replacements a long time ago. ;)

Offline Stoleti

  • Hero Member
  • *****
  • Posts: 574
    • View Profile
Re: [MOD Req] Who's online more detailed-
« Reply #113 on: July 11, 2006, 06:04:35 AM »
i need a hand... solve a lil problem...

i've apply it and i want make username below userpic but this isn't working (pic below)



and heres my code :

[qcode]if (defined("GET_USER_ONLINE") && ($config['display_whosonline'] == 1 || $user_info['user_level'] == ADMIN)) {
  $time_out = time() - 300;
 $additional_sql = "";
    if (!empty($additional_user_fields)) {
      $table_fields = $site_db->get_table_fields(USERS_TABLE);
      foreach ($additional_user_fields as $key => $val) {
        if (isset($table_fields[$key])) {
          $additional_sql .= ", u.$key";
        }
      }
    }
  $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"). $additional_sql."
     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)) {
    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['user_name']]) : $row[$user_table_fields['user_name']];
        if (!$is_invisible || $user_info['user_level'] == ADMIN) {
         $user_online_list .= ($user_online_list != "") ? "<br/>&nbsp&nbsp;&nbsp;&nbsp;&nbsp;" : "";
          $user_profile_link = (!empty($url_show_profile)) ? preg_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).".gif"."\" alt=\"".(($cid != "lan") ? $gi->GEOIP_COUNTRY_NAMES[$gi->GEOIP_COUNTRY_CODE_TO_NUMBER[$cid]] : "lan")."\" border=0> ".$username;
/*
  MOD VISITORS COUNTRY FLAGS
  END INSERT
*/   
           $user_online_list .= "<a href=\"".$site_sess->url($user_profile_link)."\">".$username."</a>".$invisibleuser;
$user_online_list_ondetails .= ($user_online_list_ondetails != "") ? " " : "";
$userpic_img = ($config['userpic'] && @file_exists(ROOT_PATH."data/userpic/".$row['userpic']) && $user_info['user_level'] >= USER) ? "<br /><br/><img src=\"".ROOT_PATH."data/userpic/".$row['userpic']."\" width=100 height=100 \">" : "";
$user_city = $row['user_city'];
$user_country = $row['user_country'];
$user_gender = $row['user_gender'];
$whos_online_userpic = str_replace("{userpic_img}", "", $userpic_img);
$user_online_list_ondetails .= "<a href=\"".$site_sess->url($user_profile_link)."\">".$userpic_img."<br><br>".$username."<br></a><br>".$user_gender."   &nbsp;&nbsp;<b>".$user_country."</b>&nbsp;&nbsp;".$user_city."&nbsp;".$invisibleuser."".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++;
        /*
  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."guestflags/".strtolower($cid).".gif"."\" 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,
     "invitado_online_list" => $invitado_online_list,
    "user_online_list" => $user_online_list,
    "user_online_list_ondetails" => $user_online_list_ondetails,
    "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']),
  ));[/qcode]

what can i do ? to fix it ?  :?

Offline ccsakuweb

  • Sr. Member
  • ****
  • Posts: 498
  • Patri
    • View Profile
    • My Art
Re: [MOD Req] Who's online more detailed-
« Reply #114 on: August 30, 2006, 12:21:55 AM »
em... there is a lot of post with codes and i don't know where is the code that i need to install this mod..  8O
Stoleti where are the steeps from this mod ?
:arrow: 4images Paid Mods: Links, Blog, Albums, Subdomains for users, Diferent templates for user profile, Related picture in details, Last pictures in details.
And the mod that you request me.   Demo: http://www.myart.es

A website dedicated to artist people who loves drawing, design, writing and more

Offline Stoleti

  • Hero Member
  • *****
  • Posts: 574
    • View Profile
Re: [MOD Req] Who's online more detailed-
« Reply #115 on: August 30, 2006, 03:01:50 AM »
em... there is a lot of post with codes and i don't know where is the code that i need to install this mod..  8O
Stoleti where are the steeps from this mod ?

Ill post soon, when i got few time :)

Offline Stoleti

  • Hero Member
  • *****
  • Posts: 574
    • View Profile
Re: [MOD Req] Who's online more detailed-
« Reply #116 on: August 30, 2006, 05:14:52 AM »
em... there is a lot of post with codes and i don't know where is the code that i need to install this mod..  8O
Stoleti where are the steeps from this mod ?

Well here my final code and working fine :) , but i'm using :

PMS MOD
GUESTBOOK MOD by bofan
MEMBER PERSONAL PHOTO
GENDER AND COUNTRY AT REG.
BIRTHDAY MOD


And some extra user additional fields, so you can use or replace by yours!!!

at sessions.php find

Code: [Select]
$user_online_list .= "<a href=\"".$site_sess->url($user_profile_link)."\">".$username."</a>".$invisibleuser;
added after

Quote
$user_online_list_ondetails .= ($user_online_list_ondetails != "") ? "<br/> " : "";
$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 height=100 border=0 \">" : "";
$age = calc_age($row[$user_table_fields['birthday']]);
$user_sexuality = $row['user_sexuality'];
$user_quote = $row['user_quote'];
$user_city = $row['user_city'];
$user_country = $row['user_country'];
$user_gender = $row['user_gender'];
$row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
$user_online_list_ondetails .= "<table width=\"100%\" class=\"onlinerow$row_bg_number\"><td valign=\"top\" width=\"105px\"><a href=\"".$site_sess->url($user_profile_link)."\">".$userpic_img."<br><br> ".$username."&nbsp;</a><br/></td><td valign=\"top\" class=\"online\">&nbsp;".$user_gender." ".$user_sexuality."<br>".$user_country."&nbsp;&nbsp;<br>".$user_city."<br/>".$age."&nbsp;&nbsp;".$lang['years_old']."<br>".$user_quote." <br/><br/><a href='gb.php?action=showgb&id=".$row['session_user_id']."'><img src=\"".TEMPLATE_PATH."/images/gb_english.gif\"  border=\"0\"></a>&nbsp;&nbsp;<a href='pms.php?action=reply&user_id=".$row['session_user_id']."'><img src=\"".TEMPLATE_PATH."/images/pm.gif\"  border=\"0\"></a></td></table>".$invisibleuser."".REPLACE_EMPTY. REPLACE_EMPTY;

Create a new file online.php (or w/e you want ...)

Code: [Select]
<?php 
$main_template 
'online'

define('GET_CACHES'1); 
define('ROOT_PATH''./'); 
define('GET_USER_ONLINE'1); 
include(
ROOT_PATH.'global.php'); 
require(
ROOT_PATH.'includes/sessions.php');
$user_access get_permission(); 

if (isset(
$HTTP_GET_VARS['template']) || isset($HTTP_POST_VARS['template'])) { 
  $template = (isset($HTTP_GET_VARS['template'])) ? stripslashes(trim($HTTP_GET_VARS['template'])) : stripslashes(trim($HTTP_POST_VARS['template'])); 
  if (!file_exists(TEMPLATE_PATH."/".$template.".".$site_template->template_extension)) { 
    $template ""
  
  else { 
    $main_template $template
  

else { 
  $template ""

include(
ROOT_PATH.'includes/page_header.php'); 

if (!empty(
$template)) { 
  $clickstream "<a href=\"".$site_sess->url(ROOT_PATH."index.php")."\">".$lang['home']."</a>".$config['category_separator'].str_replace("_"" "ucfirst($template)); 
  $site_template->register_vars("clickstream"$clickstream); 
  $site_template->print_template($site_template->parse_template($main_template)); 
  include(ROOT_PATH.'includes/page_footer.php'); 


$clickstream "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator']; 
$clickstream .= $main_template

//----------------------------------------------------- 
//--- Print Out --------------------------------------- 
//----------------------------------------------------- 
$site_template->register_vars(array( 
  "msg" => $msg
  "clickstream" => $clickstream 
)); 
  
  $site_template
->print_template($site_template->parse_template($main_template)); 
  include(ROOT_PATH.'includes/page_footer.php'); 
?>

create a new html file "online.html"

Quote
{header}
<table width="640" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td>
      <table width="640" border="0" cellspacing="0" cellpadding="0" class="tablehead">
        <tr>
          <td colspan="4"><img src="{template_url}/images/header_top.gif" width="640" height="6" alt="" /></td>
        </tr>
        <tr>
          <td width="6"><img src="{template_url}/images/header_left.gif" width="6" height="60" alt="" /></td>
          <td width="405"><img src="{template_url}/images/header_logo.gif" width="405" height="60" alt="" /></td>
          <td width="225" align="right">
            <form method="post" action="{url_search}">
              <table border="0" cellspacing="0" cellpadding="1">
                <tr>
                  <td>
                    <input type="text" name="search_keywords" size="15" class="searchinput" />
                  </td>
                  <td>
                    <input type="submit" value="{lang_search}" class="button" name="submit" />
                  </td>
                </tr>
                <tr valign="top">
                  <td colspan="2"><a href="{url_search}" class="smalltext">{lang_advanced_search}</a></td>
                </tr>
              </table>
            </form>
          </td>
          <td align="right" width="6"><img src="{template_url}/images/header_right.gif" width="6" height="60" alt="" /></td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td class="bordercolor">
      <table width="640" border="0" cellspacing="1" cellpadding="0">
        <tr>
          <td class="tablebgcolor">
            <table width="638" border="0" cellspacing="1" cellpadding="0">
              <tr>
                <td class="navbar" height="23">
                  <table width="636" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td><img src="{template_url}/images/spacer.gif" width="4" height="4" alt="" />{clickstream}</td>
                      <td align="right">
                   <a href="{url_top_images}"><b>{lang_top_images}</b></a>&nbsp;
                  <a href="{url_new_images}"><b>{lang_new_images}</b></a>&nbsp;
                 </td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
            <table width="638" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="150" class="row2" valign="top">
                  <table width="150" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td class="head2" height="20"><img src="{template_url}/images/spacer.gif" alt="" width="4" height="4" />{lang_registered_user}</td>
                    </tr>
                    <tr>
                      <td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
                    </tr>
                    <tr>
                      <td align="center" class="row1">{user_box}</td>
                    </tr>
                    <tr>
                      <td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
                    </tr>
                  </table>
              {if random_image}
                  <table width="150" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td class="head2" height="20"> <img src="{template_url}/images/spacer.gif" alt="" width="4" height="4" />{lang_random_image}</td>
                    </tr>
                    <tr>
                      <td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
                    </tr>
                    <tr>
                      <td align="center" class="row1">
                   <br />
                        {random_image}
                  <br />
                        <br />
                      </td>
                    </tr>
                    <tr>
                      <td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
                    </tr>
                  </table>
              {endif random_image}
                </td>
                <td width="1" class="bordercolor" valign="top"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
                <td width="18" valign="top"><img src="{template_url}/images/spacer.gif" alt="" width="18" height="18" /></td>
                <td width="450" valign="top">
              <br />
                  <span class="title">{lang_user_online}</span>
                  <hr size="1" />
                  {user_online_list_ondetails}<p>&nbsp;</p>
            </td>
                <td width="19" valign="top"><img src="{template_url}/images/spacer.gif" alt="" width="19" height="19" /></td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td>
      <table width="640" border="0" cellspacing="0" cellpadding="0" class="tablebottom">
        <tr>
          <td width="6"><img src="{template_url}/images/footer_left.gif" width="6" height="19" alt="" /></td>
          <td width="405">&nbsp;</td>
          <td width="225">&nbsp;</td>
          <td width="6"><img src="{template_url}/images/footer_right.gif" width="6" height="19" alt="" /></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
{footer}

at style.css

Quote
/*--online list----------------------------------------------------*/
.onlinerow1 {
  background-color: #E5E5E5;
  color: #004C75;
}

.onlinerow2 {
  background-color: #EFEFEF;
  color: #004C75;
}
.online {
  font-family: Arial;
  font-size: 12px;
  font-weight: none;
  color : #ffffff;
}

Main.php , before ?>

Quote
$lang['years_old'] = "Years Old";

Note: This has been taken from my sessions.php, this mean some fields i've there maybe you dont, so you can modify or delete, and above all BACKUP ALL YOUR FILES BEFORE!!!!

Screenshot below (note this have a lil differences, since i've modified the code from some mod's above posted) ;)


« Last Edit: August 30, 2006, 06:24:32 AM by Stoleti »

Offline Stoleti

  • Hero Member
  • *****
  • Posts: 574
    • View Profile
Re: [MOD Req] Who's online more detailed-
« Reply #117 on: August 30, 2006, 05:48:27 PM »
But now i'm wondering about how added paging at this, but i've no ideia how ..

Any ideia ?

Offline ccsakuweb

  • Sr. Member
  • ****
  • Posts: 498
  • Patri
    • View Profile
    • My Art
Re: [MOD Req] Who's online more detailed-
« Reply #118 on: August 30, 2006, 07:31:48 PM »
hum... sorry i don't know  :? But i think it is very important if there is a lot of users online..

are you spanish (i say it because in the pic show a flag from Spain) me too ^^
:arrow: 4images Paid Mods: Links, Blog, Albums, Subdomains for users, Diferent templates for user profile, Related picture in details, Last pictures in details.
And the mod that you request me.   Demo: http://www.myart.es

A website dedicated to artist people who loves drawing, design, writing and more

Offline Stoleti

  • Hero Member
  • *****
  • Posts: 574
    • View Profile
Re: [MOD Req] Who's online more detailed-
« Reply #119 on: August 30, 2006, 09:35:20 PM »
hum... sorry i don't know  :? But i think it is very important if there is a lot of users online..

are you spanish (i say it because in the pic show a flag from Spain) me too ^^

well its the only version avaliable for now :) better than nothing  :mrgreen:

spain, well maybe :) , for personal questions use PM  :wink: