By Philippe on Thursday, 19 July 2018
Posted in Technical Issues
Likes 0
Views 638
Votes 0
Hello,

I would like to associate some photo albums with a Group.
They are currently associated with a User.

It seems to me that the tables concerned are :
#_social_albums
#_social_photos
#_social_stream
#_social_stream_item
#_social_comments
#_social_likes

I do not want to do any nonsense, can you give me the SQL queries to run ?

Thank you for your help,
Philippe
Hi Philippe,

I've consult this with our developer, it is not advisable to move user photo album to group photo album using sql query, as there will be much complication will occur as it was related with privacy, ownership, notification and stream generate
·
Friday, 20 July 2018 15:17
·
0 Likes
·
0 Votes
·
0 Comments
·
Thank you for response Fadhli.

Ok. In this case, are the following manual SQL manipulations correct ?


ALBUM USER TO GROUP


Most important

#_social_albums
uid : put group id
type : put group

#_social_photos
uid : put group id
type : put group



Optional

#_social_stream
cluster_id : put group id
cluster_type : put group
cluster_access : put 1

#_social_stream_item
params :
If "uid":"USER ID","type":"user"
replace to "uid":"GROUP ID","type":"group"



Comments and Reactions

#_social_comments
element :
If albums.user.create
replace to albums.group.create

If photos.user.add
replace to photos.group.create


#_social_likes
type :
If photos.user.add
replace to photos.group.create

If comments.user.like
keep this value (same for Group)


I am aware that this is complex. But I tried and it works.
What do you think ?

Thank you,
Philippe
·
Friday, 20 July 2018 17:12
·
0 Likes
·
0 Votes
·
0 Comments
·
Yes Philippe correct!
·
Friday, 20 July 2018 19:06
·
0 Likes
·
0 Votes
·
0 Comments
·
That is true ? I did not make any mistakes, nor any forgets ?

No other table is impacted ?

Thanks
·
Friday, 20 July 2018 19:17
·
0 Likes
·
0 Votes
·
0 Comments
·
Yes
·
Friday, 20 July 2018 20:02
·
0 Likes
·
0 Votes
·
0 Comments
·
Ok nice

And for Pages, I've tested same methods and this works too.
I know that in principle a user can not create an album in his name on a Page.
But thanks to customs files, it's possible.


There is just the word "group" which becomes "page" :

You also confirm that it's good ?


ALBUM USER TO PAGE


Most important

#_social_albums
uid : put page id
type : put page

#_social_photos
uid : put page id
type : put page



Optional

#_social_stream
cluster_id : put page id
cluster_type : put page
cluster_access : put 1

#_social_stream_item
params :
If "uid":"USER ID","type":"user"
replace to "uid":"PAGE ID","type":"page"



Comments and Reactions

#_social_comments
element :
If albums.user.create
replace to albums.page.create

If photos.user.add
replace to photos.page.create


#_social_likes
type :
If photos.user.add
replace to photos.page.create

If comments.user.like
keep this value (same for Page)


Philippe
·
Friday, 20 July 2018 20:38
·
0 Likes
·
0 Votes
·
0 Comments
·
The dataset seems correct but I really would not recommend you to alter data through the database as it may eventually cause corrupted data if you are not careful.
·
Saturday, 21 July 2018 14:48
·
0 Likes
·
0 Votes
·
0 Comments
·
Thank you Mark. Yes I will be careful.

I have a question.
For #_social_stream_item and #_social_stream, is the value "params" mandatory ?
And indicating the group id and type.

Or can I leave #_social_stream_item as is, without changing anything ?
To limit my intervention.

What is the usefulness of this data "params"?

Philippe
·
Saturday, 21 July 2018 20:39
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Philippe,

Basically, the use of params is related to performance, where as stream items on feed might load the easysocial's table vigorously. Getting data from param will make your site performance a lot better
·
Monday, 23 July 2018 15:52
·
0 Likes
·
0 Votes
·
0 Comments
·
Ok I see

Thanks Fadhli
·
Monday, 23 July 2018 23:18
·
0 Likes
·
0 Votes
·
0 Comments
·
You are most welcome,

Just for your information, I have locked and marked this thread as resolved to avoid confusions in the future. Please start a new thread if you have any other issue in the future so it will be easier for us to manage your inquiries.

Thanks for understanding
·
Tuesday, 24 July 2018 00:22
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post