правда! Я ж с самого начала говорил, что плаваю в классах (но всетаки немного понимаю). Значит так, в api_topics_and_posts.php и правда есть комментарии ) Вот что там написано /**
* API: Topics & Posts
*
* IMPORTANT: This API DOESN'T check permissions, etc
* So, it's entirely possible to add replies to closed topics
* and to post new topics where the user doesn't normally have
* permission.
* EXAMPLE USAGE
* <code>
* $api = new api_topics_and_posts();
* // ADD POST REPLY
* $api->set_author_by_name('matt');
* $api->set_post_content("<b>Hello World!</b> :D");
* $api->set_topic_id( 100 );
* # Default for show_signature is 1, added here for completeness
* $api->post_settings['show_signature'] = 1;
* # Optionally turn off rebuild to not rebuild topic, forum and stats
* # $api->delay_rebuild = 1;
* $api->create_new_reply();
* // ADD NEW TOPIC
* $api->set_author_by_name('matt');
* $api->set_post_content("<b>Hello World!</b> :D");
* $api->set_forum_id( 10 );
* $api->set_topic_title('Hello World');
* $api->set_topic_description('I am the description');
* $api->set_topic_state('open');
* $api->create_new_topic();
* </code>
*
* @package InvisionPowerBoard
* @subpackage APIs
* @author Matt Mecham
* @copyright Invision Power Services, Inc.
* @version 2.1
*/ По идее все просто. Поставил значит свои параметры. получилось: <?php
define( 'IPB_THIS_SCRIPT', 'public' );
define( 'IPB_LOAD_SQL' , 'queries' );
require "conf_global.php";
require_once( './init.php' );
$INFO = array();
require_once "sources/ipsclass.php";
require_once( 'sources/api/api_topics_and_posts.php');
$api = new api_topics_and_posts();
// ADD POST REPLY
$api->set_author_by_name('matt');
$api->set_post_content("<b>Hello World!</b> :D");
$api->set_topic_id( 137 );
# Default for show_signature is 1, added here for completeness
$api->post_settings['show_signature'] = 1;
# Optionally turn off rebuild to not rebuild topic, forum and stats
$api->delay_rebuild = 1;
$api->create_new_reply();
// ADD NEW TOPIC
$api->set_author_by_name('matt');
$api->set_post_content("<b>Hello World!</b> :D");
$api->set_forum_id( 4 );
$api->set_topic_title('Hello World');
$api->set_topic_description('I am the description');
$api->set_topic_state('open');
$api->create_new_topic();
?> Но опять ошибка Fatal error: Call to a member function on a non-object in /home/script/1/sources/api/api_topics_and_posts.php on line 521 Ошибка вот в этой стороке $this->author = $this->ipsclass->DB->build_and_exec_query( array( 'select' => '*',
'from' => 'members',
'where' => "LOWER(name) = '".$this->ipsclass->DB->add_slashes(strtolower($user_name))."'",
'limit' => array( 0, 1 ) ) ); Как я понял, я опять не подключил какой-то класс