#1
  1. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Dec 2004
    Posts
    3,082
    Rep Power
    379

    creating a 'dating' like site - need guidance with functionality


    Ok I am creating a site which behaves a little bit like dating site in terms of functionality. I am a little bit confused
    about some parts of it. (Not sure if i should create a separate topic or list everything here?)

    Your input would be greatly appreciated if you could point me in the right direction

    1. when someone registers, they are considered registered users, they can also fill in more
    info and become profiled user. How do I detect this? in the database or code? what if the info changes?

    2. I will also be giving points to some of the things users do i.e. become profiled user = 100, upload image = 50.. how do I do this? in the code/db? if in the code it would be a nightmare as when I add things, I will
    constantly have to make sure to add this aspect...

    3. a profiled user can do more things than a registered user can. again how do I do this? e.g registered user cant favourite / contact other users but profiled users can. Do i simply have an if/elses all over the code? horrendous?

    4. user searching - How do i search for a user who matches your profile 80%+? the query will look like hell.. but more importantly what if profile criteria changes, the query/code will change?

    5. finally searching user in your chosen area.. how do i store users' location? as google co-ordinates and then use levictenstien (sp?) to calculate distance? or as a location?
  2. #2
  3. No Profile Picture
    Super Moderator
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jun 2009
    Location
    Hartford, WI
    Posts
    1,464
    Rep Power
    70
    1.) Simply check if the user is currently logged in via a SESSION.
    2.) In the DB. Simply add points to the column with an UPDATE as you go.
    3.) Same as 1. If/Then are basic items which create the entire life/design of the site. That's always the question/deciding factor, if this, then that.
    4.) (Unsure on the percentage matching)
    5.) Google usually helps great with this. Here's 3 listings from a quick Google search:
    php - How to efficiently find the closest locations nearby a given location - Stack Overflow
    https://developers.google.com/maps/a...v3#findnearsql
    PHP/MySQL: Select locations close to a given location from DB - Stack Overflow
    Last edited by Triple_Nothing; May 27th, 2015 at 07:04 AM.
    He who knows not that he knows not is a fool, ignore him. He who knows that he knows not is ignorant, teach him. He who knows not that he knows is asleep, awaken him. He who knows that he knows is a leader, follow him.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Dec 2004
    Posts
    3,082
    Rep Power
    379
    Thanks for the initial suggestions

    1.) Simply check if the user is currently logged in via a SESSION.

    > Sorry for not explaining well, i wasnt talking about logged in. i was talking about different types of users. you automatically become a registered user when you register. However when you fill in more info, you then become a profiled user. Now how do i do this? the more info bit is where the confusion lies. How do i determine when they have filled in ALL the info needed.. do a db check saying if a,b,c,d etc are filled user has filled all the info.. but if i was to change/add more info, then the code would need changing? i was looking at a better dynamic way perhaps where the app automatically knows how much data has been filled in?

    2.) In the DB. Simply add points to the column with an UPDATE as you go.

    > Again I understand that bit, what I wanted to know is how to recognise/code which sections to give points to. as an example if i decided registering/uploading photo gives you point, how would I check this in the code? i cannot possibly have if statements every where i decide to give points.. it would be a nightmare.. i was looking more like a config option where i can set if user does x,y,z they will get 1,2,3 points and then have it happen automatically

    3.) Same as 1. If/Then are basic items which create the entire life/design of the site. That's always the question/deciding factor, if this, then that.

    > I cannot simply have if/elses throughout my code, what if it was decided that in 3 months time, some of the profiled features can also be done by a registered user, i would have to go through my code updating everywhere..
  6. #4
  7. Code Monkey V. 0.9
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2005
    Location
    A Land Down Under
    Posts
    2,279
    Rep Power
    2039
    Originally Posted by paulh1983
    However when you fill in more info, you then become a profiled user. Now how do i do this?
    if it was me, I'd set up a 'rules' class that is checked on each update. This would let you add separate rule objects for each condition that you want to check. You can set up what conditions there are for that rule, how many points are awarded and checks to make sure that every rule can be applied for each user once only.

    Originally Posted by paulh1983
    Again I understand that bit, what I wanted to know is how to recognise/code which sections to give points to.
    Just as above.

    Originally Posted by paulh1983
    I cannot simply have if/elses throughout my code, what if it was decided that in 3 months time, some of the profiled features can also be done by a registered user, i would have to go through my code updating everywhere..
    The rules will help, and how many if()'s you have will depend completely on how complex your rules are for the points. If you have simple rules, then you won't have many things to check. If you have complex rules, you'll have complex code and there's really no way around that.

    Comments on this post

    • Will-O-The-Wisp agrees : Thanks for helping here!
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Dec 2004
    Posts
    3,082
    Rep Power
    379
    thanks Catacaustic. I was looking for something like that where I just make changes once and they are reflected everywhere, a class would certainly help with that.
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Location
    Tempe
    Posts
    50
    Rep Power
    5
    Number 4 is a bit complex and it requires you to come up with an algorithm. Mainly, you have to think about the most efficient way of doing this.

    My idea is to create different types of profiles (for one athletic users, ones for very romantic users, etc...) and based on the user's profile you will put them in a category (like very athletic). From there you can query the data and only return people who are in that specific category.

    So example:

    You have 5 categories with different levels to them:
    1) Athletic (Somewhat Athletic, Regular Athlete, Super Athletic)
    2) Romantic (Somewhat Romantic, ... , Super Romantic )
    3) Funny (" ... ")
    etc..

    Based on Joe's Profile your program ranked Joe as a Super Athletic Person.
    If Joe was to search for people who are like him, the results would be any females who are in this category (since it's 80% or above matching).

    If you want to get more complex with it, then you can give each person 3 categories. So Joe could be ranked Super Athletic, Somewhat Funny, and Somewhat a overachiever.

IMN logo majestic logo threadwatch logo seochat tools logo