The basics version of the db structure of activities is quite simple: create table activities ( id int not null, title char(255) not null, body text, owner int not null, created int not null index(owner, created) )
to show activities on the user's *home* page, do something like select * from activities where owner in (select user from friends where friend = FOO) order by created desc limit 20; to show activities on the users *profile* page do something like: select * from activities where owner = FOO order by created desc limit 20; On Wed, Dec 24, 2008 at 3:28 AM, Basit <[email protected]> wrote: > > hmm this is useful to know.. well one last, can you guide me with this > activity table, relationship with user id.. like how face book is > doing.. any tips for what fields should i put and what kind of values > it should have, it will be really helpful and its last thing i need. > thanks in advance > > On Dec 20, 5:28 pm, Chris Chabot <[email protected]> wrote: > > Hey Basit, > > > > The OpenSocial spec actually tries very hard *not* to tell you which > fields > > you need in your system; The spec was created by looking at the common > > elements of the larger social network sites and took the popular fields > from > > that; But almost every field in it is optional. > > > > The 'must have' fields are: > > > > - id > > - name > > - profile url > > - (not required but makes social apps more useful) thumbnail url > > > > Everything else is optional, and if your using shindig ( > http://incubator.apache.org/shindig) you can configure which fields your > > supporting by editing shindig/config/container.js. The gadgets can then > > check for the available fields through the OS API calls. > > > > Now you don't have to model your DB after the OpenSocial spec, again > > presuming you would use shindig (there's a php and java version available > > btw, and also a c# port athttp://code.google.com/p/baadal/), you > implement > > 3 basic classes that tie shindig to your local db; In those classes your > > free to do what ever translation between your own data structure and the > > data format that shindig expects. > > > > Hope that helps! > > > > -- Chris > > > > On Sat, Dec 20, 2008 at 3:04 AM, Basit <[email protected]> wrote: > > > > > i was wondering, if anyone head any quick erd for me, because i was > > > creating open social site and i want to see what fields are requried > > > or need to be saved in database and bit kind of confused from google > > > specs.. can you please provide maybe erd or somethign to help me.? > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Implementing OpenSocial Containers" 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/opensocial-container?hl=en -~----------~----~----~----~------~----~------~--~---
