This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Friend request, accept, decline.

 
Ibragim Gapuraev
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to make friend requests in a web site. Anyone has a code?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please remember coderanch is NotACodeMill.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think we'd need to know at least 10 times more than you have told us so far before we could speculate about how to help you: TellTheDetails
 
Ibragim Gapuraev
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:I think we'd need to know at least 10 times more than you have told us so far before we could speculate about how to help you: TellTheDetails

OK! I have done database,registration of user, login/logout/ search servlets/jsp. In this site there are a few users who supposed to exchenge messages, make friends (requests/accept/ignore),
if someone can explain how it works, how to write code!
Thank you!
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you familiar with FaceBook? Assuming you are, why not make this aspect work just like it?
 
Ibragim Gapuraev
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:Are you familiar with FaceBook? Assuming you are, why not make this aspect work just like it?

This is the problem, I don't know!
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't know Facebook, or you don't know how to begin?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not rocket science:
- put a "Friend" button on each person's page (or "Unfriend" if the person is a friend already)
- if the button is clicked, record that in the DB somehow and (optionally) send an email to the person
- if the person next visits the site, show her a list of all people who have requested to be friended (the info is in the DB record you created)
- now clicking "Confirm" leads to full "Friend" status being granted (however that works on your site); clicking "Decline" simply removes the DB record
- once somebody is a person's friend, show them more of that person's profile than they would otherwise see

That's more or less all there is to it.
 
Ibragim Gapuraev
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer thank you! i Think I got it!
 
Ibragim Gapuraev
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi again! I got it add friend to database and User can see added friend in his friends page!
Now, if someone know how to let another user know that he was added and ignore it or accept i.e. delete from database!
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I outlined that, too, in my previous post. Do you have problems implementing any specific part of that?
 
Ibragim Gapuraev
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:I outlined that, too, in my previous post. Do you have problems implementing any specific part of that?

I find a person and add him to list of my friends and then I can see him in my friends, but he can not see me in his friends. I just don't know how another user knows that i VE added him! i.e.
if the person next visits the site, show her a list of all people who have requested to be friended (the info is in the DB record you created):
I dont know how to do this!
Should I just show his as already friend in user's friend list and put button config or ignore beside?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not quite sure how to break it down even further; I'll try:
-The other person visits the site.
-When generating any page for him, check the DB if there is a "new friend request" record.
-If there is, show him appropriate content on the page (like buttons "Accept" and "Reject")

Keep in mind that this person is *not* yet a friend until he confirms that; so you shouldn't be able to see any of their private content.

Should I just show his as already friend in user's friend list and put button config or ignore beside?

Again, why not do exactly what Facebook does? Just to guide you *what* to implement; I understand that you have problems *how* to implement.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic