• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ General Support (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

Distinct response to recipient via a command

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
5 posts • Page 1 of 1

Postby Francois » Tue Jun 12, 2012 10:47 pm

Is it possible to have a different (distinct) response to each recipient ?

For ex for a simple game, you do not wish user1 to see the same information as user2 . Say user1 invite user2, and create a private channel between the two users.
I will write a new command, say to read the information (from a file or DB), and I wish the "server" to send "ABC" to recipient1, and "DEF" to recipient2 for that command. OF course user1 should NOT see "DEF" (and similarly user2 does not see the "ABC" sent to user1)

I hope it is possible? does anyone know how ?
many thanks
Francois
New member
 
Posts: 3
Joined: Mon May 28, 2012 9:22 pm
Top

Postby Myth024 » Wed Jun 13, 2012 4:27 pm

My knowledge of javascript and PHP is not very strong, however, you might consider separating messages based on chat channel instead of user. The other possible way is to set css options for text color. So ABC and DEF would be sent to both users but ABC would have a text color of black and DEF would be transparent or have the same background color. (color: transparent;) and then you would reverse it for the other user. Or have some kind of css hidden property. Hope this gives you an idea of where to go.
Myth024
Member
 
Posts: 19
Joined: Sun Jun 03, 2012 3:35 am
Top

Postby Francois » Wed Jun 13, 2012 7:34 pm

Thank you for your reply. much appreciated. This is what I feared...a client-side solution, Using color is to hide things is an idea. not sure how robust (a smart user might turn use firebug or other broser debugger to see what req/respnses is coming...)

I hope there is a solution based on "server-side" . without such workarounds on the "client" (JS or CSS) side,.
Francois
New member
 
Posts: 3
Joined: Mon May 28, 2012 9:22 pm
Top

Postby Myth024 » Wed Jun 13, 2012 8:19 pm

I know that there is p#pfc_handle { display: none; } in the style.css.php code that prevents the display of your nick next to the input text box. As far as I can tell, that property prevents the display completely.
You may have to create some kind of "admin" page that has two text input boxes. Then you would have to figure out a method for retrieving some unique identifier for each nick and be able to assign names to input boxes. Then your database would "send" data to one type of users using one of the input boxes and the other type of data to the other user.
You might look into a whisper type command. Where instead of opening up a private chat tab, the text will only show to a specific user. Something like /whisper nick message (where nick is the nickname and message is your message)
I think there is someplace on the forums where someone wrote a command to force someone to change a nickname. I haven't looked at it myself, but it's possible that it may contain code to send a message to a single user.
Myth024
Member
 
Posts: 19
Joined: Sun Jun 03, 2012 3:35 am
Top

Postby Francois » Thu Jun 14, 2012 12:50 pm

Just to say thanks Myth024 for your replies.
Francois
New member
 
Posts: 3
Joined: Mon May 28, 2012 9:22 pm
Top


Post a reply
5 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 8 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
cron
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub