ellvini Posted December 24, 2009 Share Posted December 24, 2009 i have a membersystem but ow i want that you can add your friends like netlog you can refuse or stop the friendship have some one some ideas ? Quote Link to comment https://forums.phpfreaks.com/topic/186259-a-system-for-friends/ Share on other sites More sharing options...
oni-kun Posted December 24, 2009 Share Posted December 24, 2009 i have a membersystem but ow i want that you can add your friends 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. Quote Link to comment https://forums.phpfreaks.com/topic/186259-a-system-for-friends/#findComment-983711 Share on other sites More sharing options...
ellvini Posted December 24, 2009 Author Share Posted December 24, 2009 It is not that simple because you have a lot of factors like how i am goning to display it and yes i have maked my own membersystem Quote Link to comment https://forums.phpfreaks.com/topic/186259-a-system-for-friends/#findComment-983715 Share on other sites More sharing options...
oni-kun Posted December 24, 2009 Share Posted December 24, 2009 It is not that simple because 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. Quote Link to comment https://forums.phpfreaks.com/topic/186259-a-system-for-friends/#findComment-983716 Share on other sites More sharing options...
ignace Posted December 24, 2009 Share Posted December 24, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/186259-a-system-for-friends/#findComment-983759 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.