Numbered Posted February 2, 2018 Posted February 2, 2018 Hi friends! If you create a new text topic and after that somebody post a comment with attached image then embed to this topic will show this image. And if you want to change it to something other (and upload it to first or last comment) you couldn't do it. I investigate source of this miss of logic. Embed template get image directly by theyself: Method 'contentImages' not present in \IPS\forums\Topic class, so they calls from parent \IPS\Content\Item class. And it do it little stupid: There are not exist any order in this select query (just 'column', 'table' and 'where' clause) and template get [0] image in returned array. So it will get first uploaded image to topic by the attachment_id and you can't change it (except upload new one, delete old, restore old.. but it is the bad way.. imagine if you post has a lot of images). So my proposal - add this method to \IPS\forums\Topic with a correct way for get first uploaded image, depended on post order, not as currently. This impovement doing very easy, but will be useful. Of course, much better - have a some gui for select better preview image for embeds. But it should get much more working than i proposed. Thanks for you attenstion
Optic14 Posted February 2, 2018 Posted February 2, 2018 8 hours ago, Upgradeovec said: Of course, much better - have a some gui for select better preview image for embeds. Yeah would be nice on core. I think this plugin by @Adriano Faria can do that:
Adriano Faria Posted February 2, 2018 Posted February 2, 2018 46 minutes ago, Optic14 said: Yeah would be nice on core. I think this plugin by @Adriano Faria can do that Nope, it has another purpose.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.