Jump to content

Make topic preview image in embed logical


Numbered

Recommended Posts

Posted

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:

Clip2net_180202132751.thumb.png.90b41fcb1c93aee4bcc4790f3a1bcb01.png

Method 'contentImages' not present in \IPS\forums\Topic class, so they calls from parent \IPS\Content\Item class. And it do it little stupid:

Clip2net_180202133028.thumb.png.0ce55161156f0bd3f821b296d6349426.png

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 :thumbsup:

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...