stewart715 Posted October 31, 2006 Share Posted October 31, 2006 I've posted something like this beofre but no one seems to know how to do it...I have a table called 'Privacymode' with the columns 'uid' and 'privacyid.' The column 'uid' is the users User ID number, and the 'privacyid' is the users slected privacy mode setting, either a value of 1 (private mode) or 2 (public mode).Now, I created a friend scripts that when a friend is added to your buddylist, their User ID number is inserted into a column 'buddy' next to a column 'uid' in the table buddylist.When a user selects private mode, their profile is only viewable to their friends.When a user selects public mode, their profile is viewable to everyone.I need a script that will do the following:When a user views someones profile, do a database query that pulls data from the table privacymode and looks to see what privacyid the profiles users uid has next to it. if it is null, show the following html <html>profile data</html>, if it is 2, show the following html <html>profile data</html>, if it is 1, pull data from the table buddylist to see if the profiles user uid lines up with the person who is viewing the profiles uid in the column buddy..exampleuser 4 = billuser 2 = joejoe is viewing bills profile so the script checks privacymodeuid privacyid4 1since bills privacyid is 1 (private)it checks to see in buddylistuid buddy4 2since bill is joes buddy, it shows show the following <html>MY PROFILE</html>..please help please!!if joe wasn't bills buddy i want it to show the following <html>YOU CANT SEE THIS PROFILE</html> thanks so much you guys have been great Quote Link to comment Share on other sites More sharing options...
btherl Posted October 31, 2006 Share Posted October 31, 2006 I don't think a join is a good idea for this, unless you have a very good reason. Two queries is much simpler.The first query gets the privacy mode of the user being viewed, and if that results in 1, then the second query checks the buddy list. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.