Jump to content

Retrieve topic information after its creation via Post API


Jibeji

Recommended Posts

Posted

Hello,

I was using classPost.php with IPS 3. After having created a topic, I was able to retrieve some information like SEO Title with:

$classPost = new classPost( ipsRegistry::instance() );
[...]
$classPost->addTopic()
$topic = $classPost->getTopicData();
$title_seo=$topic['title_seo'];

 

I have found how to create a topic on IPS 4 with:

$topic = \IPS\forums\Topic::createItem($member, $member->ip_address, \IPS\DateTime::ts( time() ), $forum );
$topic->title = $topic_title;
$topic->save();
$post = \IPS\forums\Topic\Post::create($topic_title, $topic_content, TRUE, NULL, TRUE, $member, \IPS\DateTime::ts( time() ));
$topic->topic_firstpost = $post->pid;
$topic->save();

Is there a way to retrieve some information on the recently created topic?

Archived

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

  • Recently Browsing   0 members

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