Inactive User
7 years agoSELECT cover photo using LiQL
How can I SELECT the cover photo using LiQL?
SELECT * FROM images WHERE messages.id = '740'
Gives me the two images for this post; one is in the body, the other is the cover but there's no apparent distinction between them. How can I know which is which?
Result:
{ "status" : "success", "message" : "", "http_code" : 200, "data" : { "type" : "images", "list_item_type" : "image", "size" : 2, "items" : [ { "type" : "image", "id" : "140iB4FAF2B355B5AD53", "href" : "/images/140", "view_href" : "/t5/media/gallerypage/image-id/140iB4FAF2B355B5AD53", "title" : "798.jpg", "description" : "tanks alot", "tiny_href" : "/t5/image/serverpage/image-id/140iB4FAF2B355B5AD53/image-size/tiny?v=1.0&px=100", "thumb_href" : "/t5/image/serverpage/image-id/140iB4FAF2B355B5AD53/image-size/thumb?v=1.0&px=150", "small_href" : "/t5/image/serverpage/image-id/140iB4FAF2B355B5AD53/image-size/small?v=1.0&px=200", "medium_href" : "/t5/image/serverpage/image-id/140iB4FAF2B355B5AD53/image-size/medium?v=1.0&px=400", "large_href" : "/t5/image/serverpage/image-id/140iB4FAF2B355B5AD53/image-size/large?v=1.0&px=999", "original_href" : "/t5/image/serverpage/image-id/140iB4FAF2B355B5AD53/image-size/original?v=1.0&px=-1", "width" : 735, "height" : 551, "owner" : { "type" : "user", "id" : "38", "href" : "/users/38", "view_href" : "/t5/user/viewprofilepage/user-id/38", "login" : "IanAtJMP" }, "upload_time" : "2018-01-04T09:00:06.950-08:00", "upload_time_friendly" : "3m ago", "album" : { "type" : "album", "id" : "36", "href" : "/albums/36", "view_href" : "/t5/media/gallerypage/album-id/36", "title" : "Hidden (IanAtJMP)" }, "messages" : { "query" : "SELECT * FROM messages WHERE images.id = '140iB4FAF2B355B5AD53'" }, "comments" : { "query" : "SELECT * FROM messages WHERE images.id = '140iB4FAF2B355B5AD53' AND is_image_comment = true" }, "kudos" : { "query" : "SELECT * FROM kudos WHERE image.id = '140iB4FAF2B355B5AD53'" }, "visibility" : "public" }, { "type" : "image", "id" : "141iD8A4CDD9B9529974", "href" : "/images/141", "view_href" : "/t5/media/gallerypage/image-id/141iD8A4CDD9B9529974", "title" : "cthulhu.jpg", "description" : "", "tiny_href" : "/t5/image/serverpage/image-id/141iD8A4CDD9B9529974/image-size/tiny?v=1.0&px=100", "thumb_href" : "/t5/image/serverpage/image-id/141iD8A4CDD9B9529974/image-size/thumb?v=1.0&px=150", "small_href" : "/t5/image/serverpage/image-id/141iD8A4CDD9B9529974/image-size/small?v=1.0&px=200", "medium_href" : "/t5/image/serverpage/image-id/141iD8A4CDD9B9529974/image-size/medium?v=1.0&px=400", "large_href" : "/t5/image/serverpage/image-id/141iD8A4CDD9B9529974/image-size/large?v=1.0&px=999", "original_href" : "/t5/image/serverpage/image-id/141iD8A4CDD9B9529974/image-size/original?v=1.0&px=-1", "width" : 1280, "height" : 720, "owner" : { "type" : "user", "id" : "38", "href" : "/users/38", "view_href" : "/t5/user/viewprofilepage/user-id/38", "login" : "IanAtJMP" }, "upload_time" : "2018-01-04T09:00:27.151-08:00", "upload_time_friendly" : "3m ago", "album" : { "type" : "album", "id" : "36", "href" : "/albums/36", "view_href" : "/t5/media/gallerypage/album-id/36", "title" : "Hidden (IanAtJMP)" }, "messages" : { "query" : "SELECT * FROM messages WHERE images.id = '141iD8A4CDD9B9529974'" }, "comments" : { "query" : "SELECT * FROM messages WHERE images.id = '141iD8A4CDD9B9529974' AND is_image_comment = true" }, "kudos" : { "query" : "SELECT * FROM kudos WHERE image.id = '141iD8A4CDD9B9529974'" }, "visibility" : "public" } ] }, "metadata" : { } }
Inactive User - You can achieve this using below query.
SELECT cover_image from messages where id = '<message.id>'