I have heard of the following method...Create a table relationships:

user1_id      user2_id


But whenever you try to get a user's friends list you will have to do
a query like find all user2_id where user1_id = thisuser, and then
vice versa.

Requests would be done on table requests in a very similar fashion,
just with different queries etc. Plus fields for date, accepted, etc.

Additionally, if you want friending to be a situation that is not
NECESSARILY mutual, you can just do the relationship table and send
messages when a user is added by another user.

On the other hand, PHPizabi does it all with a longtext field for
requests and for the relationships in every user's mySQL table. A
parser function would be required. Like when a request is accepted,
new friend is appended to the user's 'relationships' field as "8888;",
etc. Hope this makes sense.

Which is more efficient, I don't know. I am actually in the same
situation as you; luckily I have some time to decide ;). On one hand,
you have a lot of mysql records and a lot of query returns, etc. On
the other hand you have huge text fields in each user record.

(Anyone else?)

On Jul 21, 2:34 pm, hellfish <[EMAIL PROTECTED]> wrote:
> bumping...
>
> Any clues please?
>
> This should be simple for a more experienced user.
>
> On Jul 16, 11:56 pm, hellfish <[EMAIL PROTECTED]> wrote:
>
> > I've been searching a lot and I'm still having a hard time to model
> > something that I want to include on my bands website
> > [shamelessPlug]http://www.karbonsoul.com[/shamelessPlug].
>
> > What would be the cake (v1.2) way of modeling a small users network
> > where a registered user has the possibility to add other registered
> > users as friends.
>
> > I have a table "users", I know I need a table to have the HABTM
> > associations between users (and a few extra attributes that I want to
> > add later) but what should be the naming here? and the model code?
>
> > In theory I would have a table called "users", the associations table
> > "users_users" and so on, but this doesn't have any logic in this case.
>
> > I've been trying around with no success, every solution I try seems
> > like a hack on cakephp.
>
> > If you have any hints on the path I should follow, I would appreciate
> > very much

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to