Log in

View Full Version : A little help with brainstorming please?



Sartavius
10-03-2011, 02:55 AM
Okay, so I'll give you the short version of where I'm at:

I have a chatsite, that I wrote in PHP with a MySQL backend, and one feature I've been wanting to add to it for awhile is the ability for one chatter to ignore another chatter.

The problem is that for some reason I just can't seem to wrap my brain around HOW I will go about doing that. I also can't decide if I should do it with PHP itself or maybe make it simpler on myself and use a show/hide DIV javascript with cookies remembering the setting.

Is anyone willing to give me some basic principles/ideas as to how I would go about this if I chose to use PHP instead?

Many thanks in advance!

djr33
10-03-2011, 11:55 PM
Store a list of users who are blocked, for each user. Using MySQL, the simplest way would be a table with two columns: the first is the user who is blocking, and the second is the user who is blocked. Then when you are using PHP to get the chat information from the databases you will skip any messages that match a blocked user. It would probably be best to compile a list of users who are blocked by the current user (WHERE `user`=currentuser), and then remove any chat messages (or just don't display them) that match any of those blocked users.
None of this is particularly complicated in MySQL, so if you just keep learning you'll be able to do this sort of thing soon enough. It's important to keep the data organization and the data interaction components separate in your plans though. That can make everything simpler. What are you storing? And how do you want to use it?