03-24-2020, 04:33 PM
(This post was last modified: 03-24-2020, 04:35 PM by HylianDev. Edited 2 times in total.)
im not sure how the comment liking ability was programmed, but heres my assumptions & suggestion:
ill assume that a table was created: `comment_likes` which contains `user_id` and `comment_id`. if this is the case, you could create a second table, `resource_likes` and give it `user_id` and `resource_id` (or in keeping with TCSMS tradition, `uid` and `rid`)
the better solution is: a table called `likes` with `user_id`, `content_type` and `content_id`. then probably another table called `likes_content_types` or similar with `id` and a description ("Resources", "Comments", etc). then lets say `likes_content_types` has a row `ID: 3, description: "Resources"`. then when youre on a sprite sheet with then ID `123`, youll get likes from `likes` where it has `content_type` 3 and `content_id` 123
there are other things in the TCSMS database that work like this (for instance, resources is a table with all resource types, then there are tables that hold type-specific meta info for sprites, games, etc) so it should fit in without breaking any conventions, if you name the columns accordingly
Bibby Team
ill assume that a table was created: `comment_likes` which contains `user_id` and `comment_id`. if this is the case, you could create a second table, `resource_likes` and give it `user_id` and `resource_id` (or in keeping with TCSMS tradition, `uid` and `rid`)
the better solution is: a table called `likes` with `user_id`, `content_type` and `content_id`. then probably another table called `likes_content_types` or similar with `id` and a description ("Resources", "Comments", etc). then lets say `likes_content_types` has a row `ID: 3, description: "Resources"`. then when youre on a sprite sheet with then ID `123`, youll get likes from `likes` where it has `content_type` 3 and `content_id` 123
there are other things in the TCSMS database that work like this (for instance, resources is a table with all resource types, then there are tables that hold type-specific meta info for sprites, games, etc) so it should fit in without breaking any conventions, if you name the columns accordingly
Vimimin Wrote:Hylian's day job, little did we know, was saying controversial things on the internet.
Mors Wrote:you fool!!!! you fixed it wrong!!!!
Bibby Team