Author Topic: member_online_medium.gif not showing up in message_read  (Read 3583 times)

Marble

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 1006
  • Karma: +56/-7
member_online_medium.gif not showing up in message_read
« on: March 18, 2013, 01:19:17 AM »
I noticed that when a member is online and when I read a message sent from them, their online indicator in message_read isn't showing the member_online_medium.gif image.

I first looked at this code located in message_read.html and it matches the original default Etano skin directory.
Code: [Select]
<!--opt name="output.other_id"--><a class="content-link member_link {output.is_online}" href="{tplvars.relative_url}profile.php?uid={output.other_id}" title="{output._user_other}"><!--/opt name="output.other_id"-->{output._user_other}<!--opt name="output.other_id"--></a>
Next, I looked in content.css and found this information was correct. Note: when I click on a member ID, their profile indicates that they're online and the member_online_medium.gif appears properly. And to verify this, I downloaded the current gif file from the server and reviewed the image in Firefox.

Code: [Select]
.is_online .member_link, .member_online {
background: url('../images/member_online_medium.gif') no-repeat top left;
}

It turns out that this has never worked for me in the past and I just didn't look into it until now. Since the member_online_medium.gif file is working fine on the other pages that indicate the user is online, could it be that the code listed in message_read.html is either missing something or written incorrectly? If so, what solutions are out there to correct this?
If you see that I'm logged in forever... it just means I turned the page on my browser and forgot to logout.

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 3139
  • Karma: +211/-7
    • Maverick Webworks
Re: member_online_medium.gif not showing up in message_read
« Reply #1 on: March 18, 2013, 12:15:16 PM »
As far back as I can remember the online status in the read messages has never worked. I looked into it before and couldn't come up with a fix.

Fusion Responsive Template & Free Mods
http://www.maverickwebworks.com
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

Marble

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 1006
  • Karma: +56/-7
Re: member_online_medium.gif not showing up in message_read
« Reply #2 on: March 26, 2013, 03:00:45 AM »
Maverick.
I did some digging around and stumbled upon this code inside plugins\widget\blogs\blogs.class.php at line 76
Code: [Select]
for ($i=0;isset($loop[$i]);++$i) {
$loop[$i]['date_posted']=strftime($_SESSION[_LICENSE_KEY_]['user']['prefs']['datetime_format'],$loop[$i]['date_posted']+$_SESSION[_LICENSE_KEY_]['user']['prefs']['time_offset']);
if (isset($GLOBALS['_list_of_online_members'][$loop[$i]['fk_user_id']])) {
$loop[$i]['is_online']='is_online';
$loop[$i]['user_online_status']=$GLOBALS['_lang'][102];
} else {
$loop[$i]['user_online_status']=$GLOBALS['_lang'][103];
}

I believe that it's used with widgets\blogs\display.html where there's a code at line 6 that reads
Code: [Select]
<a class="content-link member_link" href="{tplvars.relative_url}profile.php?uid={loop.fk_user_id}" title="{loop.user} {loop.user_online_status}"><!--/opt name="loop.fk_user_id"-->{loop.user}<!--opt name="loop.fk_user_id"--></a><!--/opt name="loop.fk_user_id"--></strong>
When the member who wrote a blog or comment is online, the member_online_medium.gif is displayed, plus there's a message saying that the member is online when you hover the mouse over their name.

If this could be a solution to what is missing, do you think that it's possible to add something like this into the message_read.php and message_read.html files?
If you see that I'm logged in forever... it just means I turned the page on my browser and forgot to logout.

sharkthis

  • Active Member
  • ***
  • Posts: 65
  • Karma: +4/-2
Re: member_online_medium.gif not showing up in message_read
« Reply #3 on: April 03, 2013, 08:40:10 AM »
Hi Maverick, yes do you think you have the answer can you sort this problem out! not working in message_read and flirt_send and more i think  :'(

sharkthis

  • Active Member
  • ***
  • Posts: 65
  • Karma: +4/-2
Re: member_online_medium.gif not showing up in message_read
« Reply #4 on: December 20, 2013, 07:00:09 AM »
Yes I have fixed this issue will post code on here later for every one...

this is to make the online status work in the mesaage_read.php



Code: [Select]
<?php
/******************************************************************************
Etano
===============================================================================
File:                       message_read.php
$Revision: 679 $
Software by:                DateMill (http://www.datemill.com)
Copyright by:               DateMill (http://www.datemill.com)
Support at:                 http://www.datemill.com/forum
*******************************************************************************
* See the "docs/licenses/etano.txt" file for license.                         *
******************************************************************************/

require 'includes/common.inc.php';
require 
_BASEPATH_.'/includes/user_functions.inc.php';
require 
_BASEPATH_.'/includes/tables/user_inbox.inc.php';
require 
_BASEPATH_.'/skins_site/'.get_my_skin().'/lang/mailbox.inc.php';
check_login_member('auth'); // allow every member for now. Finer checking is made below

$tpl=new phemplate(_BASEPATH_.'/skins_site/'.get_my_skin().'/','remove_nonjs');

$content='';
if (!empty(
$_GET['mail_id']) && isset($_GET['fid'])) {
$output=$user_inbox_default['defaults'];
$output['mail_id']=(int)$_GET['mail_id'];
$output['return2']=sanitize_and_format_gpc($_GET,'return',TYPE_STRING,$__field2format[FIELD_TEXTFIELD],'');
$output['return']=rawurlencode($output['return2']);

$my_folders=array(FOLDER_INBOX=>$GLOBALS['_lang'][110],FOLDER_OUTBOX=>$GLOBALS['_lang'][111],FOLDER_TRASH=>$GLOBALS['_lang'][112],FOLDER_SPAMBOX=>$GLOBALS['_lang'][113]);
$query="SELECT `folder_id`,`folder` FROM `{$dbtable_prefix}user_folders` WHERE `fk_user_id`='".$_SESSION[_LICENSE_KEY_]['user']['user_id']."'";
if (!($res=@mysql_query($query))) {trigger_error(mysql_error(),E_USER_ERROR);}
while ($rsrow=mysql_fetch_row($res)) {
$my_folders[$rsrow[0]]=$rsrow[1];
}

$output['fid']=FOLDER_INBOX;
if (!empty($_GET['fid']) && isset($my_folders[$_GET['fid']])) {
$output['fid']=(int)$_GET['fid'];
}
$moveto_folders=$my_folders;
unset($moveto_folders[FOLDER_SPAMBOX]);
unset($moveto_folders[FOLDER_OUTBOX]);
unset($moveto_folders[$output['fid']]);
$output['moveto_folders']=vector2options($moveto_folders);
$my_folders=sanitize_and_format($my_folders,TYPE_STRING,$__field2format[TEXT_DB2DISPLAY]);

$mailbox_table='inbox';
$where="a.`fk_user_id`='".$_SESSION[_LICENSE_KEY_]['user']['user_id']."' AND a.`mail_id`=".$output['mail_id'];

switch ($output['fid']) {
case FOLDER_INBOX:
$tpl->set_var('spam_controls',true);
break;

case FOLDER_TRASH:
break;

case FOLDER_OUTBOX:
$mailbox_table='outbox';
$tpl->set_var('is_outbox',true);
break;

case FOLDER_SPAMBOX:
$mailbox_table='spambox';
break;

default:
$tpl->set_var('spam_controls',true);
break;

}

$query="SELECT a.*,UNIX_TIMESTAMP(a.`date_sent`) as `date_sent`,b.`fk_user_id` as `other_id`,b.`_photo` as `photo` FROM `{$dbtable_prefix}user_{$mailbox_table}` a LEFT JOIN `{$dbtable_prefix}user_profiles` b ON a.`fk_user_id_other`=b.`fk_user_id` WHERE $where LIMIT 1";
if (!($res=@mysql_query($query))) {trigger_error(mysql_error(),E_USER_ERROR);}
if (mysql_num_rows($res)) {
$output=array_merge($output,mysql_fetch_assoc($res));
$output['date_sent']=strftime($_SESSION[_LICENSE_KEY_]['user']['prefs']['datetime_format'],$output['date_sent']+$_SESSION[_LICENSE_KEY_]['user']['prefs']['time_offset']);
//print_r($output);die;
// it was saved sanitized so no need to resanitize here
// $output['subject']=sanitize_and_format($output['subject'],TYPE_STRING,$__field2format[TEXT_DB2DISPLAY]);

/**
                 * code for member online appended by Brij Raj Singh <brij@edificesoftech.com>
                 **/
                    
$_list_of_online_members=$GLOBALS['_list_of_online_members'];

                    if (!empty(
$_list_of_online_members[$output['fk_user_id_other']])) {
                            
$output['is_online']= 'member_online';//TRUE;//'member_online'; // .is_online
                    
}else{
                    
$output['is_online']= FALSE;//'is_online';
                    
}
                    
switch ($output['message_type']) {

case MESS_MESS:
// it was saved sanitized so no need to resanitize here
// $output['message_body']=sanitize_and_format($output['message_body'],TYPE_STRING,$__field2format[TEXT_DB2DISPLAY]);
check_login_member('message_read');
$output['message_body']=nl2br($output['message_body']);
break;

case MESS_FLIRT:
check_login_member('flirt_read');
break;

case MESS_SYSTEM:
// check_login_member('auth'); this check was made at the begining
if (empty($output['_user_other'])) {
$output['_user_other']=$GLOBALS['_lang'][135];
}
$tpl->set_var('spam_controls',false);
break;

}
$output['message_body']=text2smilies(bbcode2html($output['message_body']));
if (empty($output['photo'])) {
$output['photo']='no_photo.gif';
}
if (empty($output['other_id'])) {
unset($output['other_id']);
} else {
require _BASEPATH_.'/includes/network_functions.inc.php';
if (is_network_member($_SESSION[_LICENSE_KEY_]['user']['user_id'],$output['other_id'],NET_BLOCK)) {
$output['is_blocked']=true;
}
$output['net_block']=NET_BLOCK;
}
$output['mailbox_name']=$my_folders[$output['fid']];

$output['return2me']='message_read.php';
if (!empty($_SERVER['QUERY_STRING'])) {
$output['return2me'].='?'.$_SERVER['QUERY_STRING'];
}
$output['return2me']=rawurlencode($output['return2me']);
$tpl->set_file('content','message_read.html');
//$tpl->set_var('list_of_online_members',$_list_of_online_members);
$tpl->set_var('output',$output);
$tpl->process('content','content',TPL_OPTIONAL);
if ($output['is_read']==0) {
$query="UPDATE `{$dbtable_prefix}user_{$mailbox_table}` SET `is_read`=1 WHERE `mail_id`=".$output['mail_id']." AND `fk_user_id`='".$_SESSION[_LICENSE_KEY_]['user']['user_id']."'";
if (!($res=@mysql_query($query))) {trigger_error(mysql_error(),E_USER_ERROR);}
}
} else {
$topass['message']['type']=MESSAGE_ERROR;
$topass['message']['text']=$GLOBALS['_lang'][5];
redirect2page('mailbox.php');
}
} else {
$topass['message']['type']=MESSAGE_ERROR;
$topass['message']['text']=$GLOBALS['_lang'][5];
redirect2page('mailbox.php');
}




$tplvars['title']=$GLOBALS['_lang'][136];
$tplvars['page_title']=$GLOBALS['_lang'][136];
$tplvars['page']='message_read';
$tplvars['css']='message_read.css';
if (
is_file('message_read_left.php')) {
include 'message_read_left.php';
}
include 
'frame.php';

sharkthis

  • Active Member
  • ***
  • Posts: 65
  • Karma: +4/-2
Re: member_online_medium.gif not showing up in message_read
« Reply #5 on: December 21, 2013, 11:03:48 AM »
friendship request online status  fix...  ;)



friendship_requests.php

Code: [Select]
<?php
/******************************************************************************
Etano
===============================================================================
File:                       friendship_requests.php
$Revision: 679 $
Software by:                DateMill (http://www.datemill.com)
Copyright by:               DateMill (http://www.datemill.com)
Support at:                 http://www.datemill.com/forum
*******************************************************************************
* See the "docs/licenses/etano.txt" file for license.                         *
******************************************************************************/

require 'includes/common.inc.php';
require 
_BASEPATH_.'/includes/user_functions.inc.php';
require 
_BASEPATH_.'/skins_site/'.get_my_skin().'/lang/net.inc.php';
check_login_member('manage_networks');

$tpl=new phemplate(_BASEPATH_.'/skins_site/'.get_my_skin().'/','remove_nonjs');

$output=array();
$query="SELECT a.`nconn_id`,a.`fk_user_id`,b.`_user` as `user`,c.`network` FROM `{$dbtable_prefix}user_networks` a,`{$dbtable_prefix}user_profiles` b,`{$dbtable_prefix}networks` c WHERE a.`fk_user_id`=b.`fk_user_id` AND a.`fk_net_id`=c.`net_id` AND a.`fk_user_id_other`='".$_SESSION[_LICENSE_KEY_]['user']['user_id']."' AND a.`nconn_status`=0";
if (!(
$res=@mysql_query($query))) {trigger_error(mysql_error(),E_USER_ERROR);}
$loop=array();
$_list_of_online_members=$GLOBALS['_list_of_online_members'];
$i=0;
while (
$rsrow=mysql_fetch_assoc($res)) {
$rsrow['network']=sanitize_and_format($rsrow['network'],TYPE_STRING,$__field2format[TEXT_DB2DISPLAY]);
$loop[]=$rsrow;
        
/**
        
        */

       
if (!empty($_list_of_online_members[$rsrow['fk_user_id']])) {
               
$loop[$i]['is_online']= 'member_online';
       }
       
$i++;
}

$output['return2me']='friendship_requests.php';
if (!empty(
$_SERVER['QUERY_STRING'])) {
$output['return2me'].='?'.$_SERVER['QUERY_STRING'];
}
$output['return2me']=rawurlencode($output['return2me']);
$tpl->set_file('content','friendship_requests.html');
$tpl->set_var('output',$output);
$tpl->set_loop('loop',$loop);
$tpl->process('content','content',TPL_LOOP TPL_NOLOOP);
$tpl->drop_loop('loop');
unset(
$loop);

$tplvars['title']=$GLOBALS['_lang'][226];
$tplvars['page_title']=$GLOBALS['_lang'][226];
$tplvars['page']='friendship_requests';
$tplvars['css']='friendship_requests.css';
if (
is_file('friendship_requests_left.php')) {
include 'friendship_requests_left.php';
}
include 
'frame.php';


/skins_site/def/friendship_requests.html

Code: [Select]
<form action="{tplvars.relative_url}processors/friendship_requests.php" method="post" id="requests_form">
<div class="row header">
<div class="control"><input type="checkbox" name="check_all" id="check_all" /><span>All</span></div>
<div class="who">Who?</div>
<div class="network">Network</div>
</div>

<!--loop name="loop"-->
<div class="row">
<div class="control"><input type="checkbox" class="check" id="nconn_id_{loop.nconn_id}" name="nconn_id[]" value="{loop.nconn_id}" /></div>
<div class="who"><a class="content-link member_link {loop.is_online}" href="{tplvars.relative_url}profile.php?uid={loop.fk_user_id}&amp;return={output.return2me}">{loop.user}</a></div>
<div class="network">{loop.network}</div>
<!--noloop name="loop"-->
<p class="no_results">You have no requests yet.</p>
<!--/noloop name="loop"-->
</div>
<!--/loop name="loop"-->

<div id="controls">
<input type="submit" id="btn_accept" name="btn_accept" class="button large" value="Accept selected" />
<span>|</span>
<input type="submit" id="btn_deny" name="btn_deny" class="button large" value="Decline selected" />
</div>
</form>

<script type="text/javascript" src="{tplvars.relative_url}js/friendship_requests.js?v={tplvars.js_lib_v}"></script>

Marble

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 1006
  • Karma: +56/-7
Re: member_online_medium.gif not showing up in message_read
« Reply #6 on: December 22, 2013, 11:57:57 PM »
Thank you for sharing and helping the datemill community.
If you see that I'm logged in forever... it just means I turned the page on my browser and forgot to logout.

sharkthis

  • Active Member
  • ***
  • Posts: 65
  • Karma: +4/-2
Re: member_online_medium.gif not showing up in message_read
« Reply #7 on: December 26, 2013, 01:57:09 PM »
More examples of my work can be find at: http://freedater.us if your interested in any of the features i have made then email me for code:  :grin: