Trying to use the "Topic Summary" cached content in an application, and hitting a brick wall. So, here goes again (tried already in the Slack channel)
Do the following:
Create a new PHP file in your IPS install root, add the code below and save it.
Create a new topic, add an image attachment, submit the topic
Open your PHP file in a browser.
Q: why does the image information for the most recent topic (the one you created) get reproduced for all other topics, regardless of whether those other topics have no images or have images of their own?
Important: it's going to return ALL topics so feel free to finesse the query to just a single forum.
<?php
require 'init.php';
\IPS\Session\Front::i();
$tids = \IPS\Db::i()->select('tid','forums_topics', array(),'tid DESC');
foreach ($tids as $tid) {
$topic = \IPS\forums\Topic::load($tid);
$images = $topic->imageAttachments();
var_dump($images);
}
Note: I know it's related to the cachekey being the same for all topics; mainly looking for a hint on whether that behaviour can be changed.