Results 1 to 2 of 2

Thread: A little help with brainstorming please?

  1. #1
    Join Date
    Sep 2011
    Posts
    14
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default A little help with brainstorming please?

    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!

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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?
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •