I have all but finished a private members' site and they have asked for a new feature to be 'thrown in.'

When a member is logged in, they can go to a directory of members and search through it. The display shows the relevant results.

What I need to be able to do now is in the area where the members update their profile, I need to give them an option of whether or not to allow other members to see their phone number, email address, etc.

Each bit of info has to be controlled separately. ie yes show my email but not my phone. etc.

I'd like to have a check box beside each option that essentially says select here if you would like to make this information available. And of course now the information when it is initially inputted to the database has to not show up until the user says 'yeh.'

I'm not really sure how to go about this. I have a couple ideas but both seem ridiculous at the end of the day. Before I even start coding I need a better concept to start with.

Anyone? Thanks so much!!!

mlseim

09-15-2011, 07:13 PM

Create some more columns in your MySQL table.
Populate those columns with either a 0 (hide) or a 1 (show).

Acute Chaos

09-15-2011, 09:04 PM

One of my ideas I thought was a bit out there was adding a sort of salt to each field if they select to hide the content and check for that.

So forest for the trees here I guess.

Just create another column and have it initially set to hide (because it should hide unless they reveal it) Then set the check box to change that to show if they select it.

Then when doing the search query do an if statement that basically says if the new column says show then show else don't.