J!Extensions Store™
Forum
Welcome, Guest
Please Login to access forum.
Re:Anonymous Users (1 viewing) 
Go to bottom
TOPIC: Re:Anonymous Users
#6993
Bertrand Couvin
Junior Boarder
Posts: 21
User Offline
Anonymous Users Karma: 0  
Hello John,

We would like to have the Joomla user_id instead of the Fullname or Username in Video and Message Users list.
Could you tell us how we can get this?

Thanks and Regards
 
Logged Logged  
  The administrator has disabled public write access.
#6994
John Dagelmore
Admin
Posts: 3716
User Online Now
Re:Anonymous Users Karma: 79  
Hello,

i'm not sure about this... also it sounds a bit bizzarre to me. However you have to customize the file root/components/com_jchat/models/stream.php

To propagate the user id everywhere you can add this line at 917 in the getBuddyList function :
$chat[$userFieldName] = $chat['id'];

Take care that it will work only if a user is logged in, with Joomla assigning them an ID.

Regards
 
Logged Logged  
  The administrator has disabled public write access.
#6995
Bertrand Couvin
Junior Boarder
Posts: 21
User Offline
Re:Anonymous Users Karma: 0  
Hello,

Thanks for the tips.
We have also to modify message.php too? If yes, could you tell us where?

PS: Agree with you when you said "bizarre"...
However, there is the reason. It is a recruiting platform.

Thanks,
Regards
 
Logged Logged  
  The administrator has disabled public write access.
#6996
John Dagelmore
Admin
Posts: 3716
User Online Now
Re:Anonymous Users Karma: 79  
Hello,
if you mean messaging.php (not message.php) that is the file used for private messaging you have to modify the line 74
from:

Code:

"\n u.{$this->userFieldName} AS " . $this->_db->quoteName('username') .
to
Code:

"\n u.id AS " . $this->_db->quoteName('username') .
Regards
 
Logged Logged  
  The administrator has disabled public write access.
#7008
Bertrand Couvin
Junior Boarder
Posts: 21
User Offline
Re:Anonymous Users Karma: 0  
Hello,

Yes, it is "messaging.php". It is working. Thanks!

However, the search field can not search by user_id number in "Private Messaging" list, nor by name of user (even it is not dispalying anymore).
Where could I modify for this to make it working?

Thanks again.
 
Logged Logged  
  The administrator has disabled public write access.
#7009
John Dagelmore
Admin
Posts: 3716
User Online Now
Re:Anonymous Users Karma: 79  
I'm not sure how that could work.

Try to modify the code in the stream.php at line 814 to use the id, from:

Code:

// Search filter for registered users / override name guests if($searchFilter && $searchFilter != JText::_('COM_JCHAT_SEARCH')) { $logicAND .= "\n AND(" . "\n CASE" . "\n WHEN (u.$userFieldName != '' OR (ccs.override_name != '' AND ccs.override_name IS NOT NULL))" . "\n THEN (u.$userFieldName LIKE '%" . $searchFilter . "%'OR ccs.override_name LIKE '%" . $searchFilter . "%')" . "\n ELSE sess.session_id != ''" . "\n END)"; }
to
Code:

// Search filter for registered users / override name guests if($searchFilter && $searchFilter != JText::_('COM_JCHAT_SEARCH')) { $logicAND .= "\n AND(" . "\n CASE" . "\n WHEN (u.id != '')" . "\n THEN (u.id = " . (int)$searchFilter . ")" . "\n ELSE sess.session_id != ''" . "\n END)"; }
I'm contrary to this kind of customizations, take care they will be overwritten at every update.
 
Logged Logged  
  The administrator has disabled public write access.
Go to top