Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>thats a tricky and not so easy thing to do. I worked for a start up social network and it was something they wanted as well. I dont think i still have the code laying around but if i recall correctly i went about it something like this</p> <p>DB:</p> <h2>USERS</h2> <p>id : guid "a unique identifier for this user" "other user info"</p> <h2>ACTIONS</h2> <p>when : unix_timestamp who : guid "the user who made the actions guid" type : set('image','news') "replace with a list of the type of things you want to track" what : url "not like a web address but the guid of the thing that was made"</p> <h2>FRIENDS</h2> <p>id1 : guid "one of the 'friends' guid's id2 : guid "the other persons guid</p> <h2>PHOTOS</h2> <p>id : guid "a unique identifier for the image" url : varchar(255) "where is the image stored (file name directory etc) who : guid "the user who posted the photos guid" "other info you want to keep track of"</p> <h2>NEWS (think status update)</h2> <p>id : guid "a unique identifier for this statu update" who : guid "the guid of the person who posted this" when : unix_timestamp "timestamp of when it was posted what : text "the contents"</p> <p>using the above structure i would have my code make an entry into the ACTIONS table anytime a user posted a photo or a status update. then when their friend logged on it would go through the ACTIONS table pulling out all the actions of anyone it found was friends (via the FRIENDS table) the TYPE field is used to differentiate what table to use when linking the IDs of the actions. so if the person posted an image when it writes the action to the screen it can set the link up to point to whatever script your using to display images. etc etc</p> <p>ill see if i can find the code, if i can ill post it (company went under and i retain ownership of the code)</p> <p>If my explanation isnt clear ill take some more time later to better document the process and code.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload