Dismiss
Announcing Stack Overflow Documentation

We started with Q&A. Technical documentation is next, and we need your help.

Whether you're a beginner or an experienced developer, you can contribute.

Sign up and start helping → Learn more about Documentation →

I've completely redone this database a few times now and I can't figure out the puzzle of it all.

The basic idea at the moment is a user makes a post and people can submit replies to it. On View 1, "initiated posts" are viewed, on View 2 you see all of the posts you've replied, on view 3 you can click into a specific post and see all the responses, and on view 4 you can see a detail page for any specific reply.

I have this all working, but I've got two major issues after implementing a friend system and delete system.

I'll make an example post to help explain:

View 1:

A bunch of topics from your friends list

Talk about cats Talk about cars Talk about Swift

View 2:

Post you've joined in about dogs in the past post you've joined in about cars in the past the post about cats you just responded to

View 3 after clicking on the cats post:

User 1 : Cats suck User 2 : Cats are cool

View 4 after clicking on user a user:

Detailed view of that post and that user

Bob Bobs picture "Cats suck"

I'm needing users to be able to have customized views of view 3 and 4 because I want them to be able to delete certain posts and individual posts.

So instead of there being a User 1 and User 2 under cats, if someone really didn't like what someone said or it was just a troll submission from User 1 they could delete it.

The issue is that I'm currently just pulling all of the replies from underneath the post's "replies" child..I could temporarily delete a post from the view via scratching it from the array, but when the page is reloaded it'd load up all of the posts again, so obviously the user needs their own place they're keeping track of the individual replies made to a main post.

For example I need some way for each user to have a reference to "Cats are cool" and "cats suck"

On View 2 those can easily just be deleted by deleting the reference to that post in their user info which is only created when they respond to it in the first place, but beyond that I don't know how to get the individual replies to the users.

Very roughly because at this point I've reworked it all so many times:

Users
   09283490823
      RepliedToPosts
          ABCDEFG : true
      FriendsPosts
           friendUID : postID
           friendUID: postID
           // reworked all of this, dunno how I want this structured anymore but this part will be ok

  posts:
      ABCDEFG
         *replies*

so I'm observing the friendsPosts on View1, observing the repliedToPosts on View 2 which I can delete, and then on view3 I just going into posts and viewing all the replies, and then further on view 4 viewing one at an individual level.

I had everything working and fine and dandy until I forgot right up at the end that I'm wanting to be able to delete individual posts on View3 and I haven't found a way to implement that.

Any ideas? I can't just have individual replies sent to all "participants" because people can join in late...no idea really.

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.