Jump to content

Make topic preview image in embed logical


Recommended Posts

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

Link to comment
Share on other sites


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

  • Recently Browsing   0 members

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