I am happy to help explain the schema. There are 4 tables to start with (5th is their API):
MEDIA
id bigint(20) NOT NULL AUTO_INCREMENT ,
blog_id bigint(20) NULL DEFAULT NULL,
media_id bigint(20) NOT NULL ,
media_author bigint(20) NOT NULL,
media_title text,
album_id bigint(20),
media_type varchar(100) NULL DEFAULT NULL ,
context varchar(100) NULL DEFAULT NULL ,
context_id bigint(20) NULL DEFAULT NULL ,
source varchar(100) NULL DEFAULT NULL ,
source_id bigint(20) NULL DEFAULT NULL ,
activity_id bigint(20) NULL DEFAULT NULL ,
cover_art varchar(250) NULL DEFAULT NULL,
privacy int(3) NULL DEFAULT NULL ,
views bigint(20) NULL DEFAULT 0 ,
downloads bigint(20) NULL DEFAULT 0 ,
ratings_total bigint(20) NULL DEFAULT 0 ,
ratings_count bigint(20) NULL DEFAULT 0 ,
ratings_average decimal(4,2) NULL DEFAULT 0 ,
likes bigint(20) NULL DEFAULT 0 ,
dislikes bigint(20) NULL DEFAULT 0 ,
upload_date datetime DEFAULT '0000-00-00 00:00:00',
file_size bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (id),
KEY media_id (media_id),
KEY media_author (media_author),
KEY album_id (album_id),
KEY media_author_id (album_id,media_author),
KEY context_author_album_id (context_id,album_id,media_author),
KEY context_data (context),
KEY activity_id (activity_id)
privacy
setting, as you may see above, is stored within the media table.
Group media privacy depends on group status (public, private, hidden)
$media_type_array = array( 'photo', 'music', 'video', 'album', 'playlist' )
if ( intval( $result['result'][0]->context_id ) > 0 ) {
$result['result'][0]->context = 'profile';
} else {
$result['result'][0]->context = 'group';
}
MEDIA META
id bigint(20) NOT NULL AUTO_INCREMENT ,
media_id bigint(20) NOT NULL DEFAULT 0,
meta_key varchar(255),
meta_value longtext,
PRIMARY KEY (id)
ACTIVITY
activity_id bigint(20) NULL DEFAULT NULL ,
user_id bigint(20) NOT NULL,
privacy int(3) NULL DEFAULT NULL ,
blog_id bigint(20) NULL DEFAULT NULL,
KEY activity_id (activity_id),
KEY user_id (user_id),
KEY privacy (privacy)
INTERACTIONS
id bigint(20) NOT NULL AUTO_INCREMENT ,
user_id bigint(20) NOT NULL DEFAULT 0,
media_id bigint(20) NOT NULL DEFAULT 0,
action varchar(255),
value varchar(255),
action_date TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id)
-
This reply was modified 8 years, 2 months ago by
OC2PS.
-
This reply was modified 8 years, 2 months ago by
OC2PS.
-
This reply was modified 8 years, 2 months ago by
OC2PS.