Jump to content

a system for friends


ellvini

Recommended Posts

i have a membersystem but ow i want that you can add your friends :P like netlog you can refuse or stop the friendship have some one some ideas ?

 

Have you programmed your own member system? You can simply set up a form where a user can send an 'invite', which will go into a user's table. If the user's table has an invite, it can display it. If they accept using the form, It can send their userID into the other user's 'friends' table.

 

Seems pretty straightforward.

Link to comment
https://forums.phpfreaks.com/topic/186259-a-system-for-friends/#findComment-983711
Share on other sites

It is not that simple because :P you have a lot of factors like how i am goning to display it and yes i have maked my own membersystem

 

..I never said it was that simple. To display the user's friends, Retrieve the aformentioned table, parse the ID's and list the friends however you like.

Link to comment
https://forums.phpfreaks.com/topic/186259-a-system-for-friends/#findComment-983716
Share on other sites

CREATE TABLE users (
  users_id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT,
  users_username VARCHAR(16) NULL,
  users_password VARCHAR(40) NULL,
  PRIMARY KEY (users_id)
);

CREATE TABLE followers (
  followers_followee SMALLINT UNSIGNED NOT NULL,
  followers_follower SMALLINT UNSIGNED NOT NULL,
  PRIMARY KEY (followers_followee, followers_follower)
);

CREATE TABLE tweets (
  tweets_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
  tweets_users_id SMALLINT UNSIGNED NOT NULL,
  tweets_tweet VARCHAR(140) NULL,
  tweets_tweet_date TIMESTAMP NULL,
  PRIMARY KEY (tweets_id, tweets_users_id)
);

 

SELECT tweets_tweet
FROM followers, tweets
WHERE tweets_users_id = followers_follower
AND followers_followee = 1

 

This example features tweets but it can be modified to meet your needs (followers) in this example defines the relationship between two friends.

Link to comment
https://forums.phpfreaks.com/topic/186259-a-system-for-friends/#findComment-983759
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.