Опубликовано: 26 марта 201411 г единственное что нашел это <?php if (!defined('IPB3_ROOT')) { define('IPB3_ROOT', '/home/admin/domains//public_html'); } define('IPB_THIS_SCRIPT', 'public'); define('IPS_PUBLIC_SCRIPT', 'index.php'); define('IPS_ENFORCE_ACCESS', true); require_once IPB3_ROOT.'/initdata.php'; require_once IPS_ROOT_PATH.'sources/base/ipsRegistry.php'; require_once IPS_ROOT_PATH.'sources/base/ipsController.php'; ipsRegistry::init(); $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/sources/classes/post/classPost.php', 'classPost', 'forums' ); $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/sources/classes/post/classPostForms.php', 'classPostForms', 'forums' ); $this->post = new $classToLoad($this->registry); try { $this->post->setBypassPermissionCheck( true ); $this->post->setIsAjax( true ); $this->post->setPublished( true ); $this->post->setTopicID( 123 ); $this->post->setForumID( 2 ); $this->post->setForumData( $this->registry->class_forums->getForumById( 2 ) ); $this->post->setAuthor( IPSMember::load( 1 ) ); $this->post->setPostContentPreFormatted( "This is the already formatted post" ); $this->post->setSettings( array( 'enableSignature' => 1, 'enableEmoticons' => 1, 'post_htmlstatus' => 0 ) ); if( $this->post->addReply() === false ) { print_r( $this->post->getPostError() ); return false; } $post = $this->post->getPostData(); } catch( Exception $e ) { print $e->getMessage(); return false; } ?> но оно не работает выдает ошибку Fatal error: Using $this when not in object context in /home/admin/domains//public_html/444.php on line 22 Изменено 26 марта 201411 г пользователем voodu191
Опубликовано: 26 марта 201411 г Тут не класс чтобы использовать внутренний указатель объекта $this. http://ipbskins.ru/forum/topic8466.html
Опубликовано: 26 марта 201411 г Автор по ссылке создание темы, а мне нужно сообщение в теме. Вот в чем дело
Опубликовано: 26 марта 201411 г По ссылке еще говорится о некоем методе addReply того же класса, с ссылкой на документацию.Очевидно нужно заменить addTopic на addReply, добавить ид темы setTopicID() и убрать ненужный setTopicTitle. В итоге получится http://ipbskins.ru/forum/topic8466.html#entry84784
единственное что нашел это
<?php if (!defined('IPB3_ROOT')) { define('IPB3_ROOT', '/home/admin/domains//public_html'); } define('IPB_THIS_SCRIPT', 'public'); define('IPS_PUBLIC_SCRIPT', 'index.php'); define('IPS_ENFORCE_ACCESS', true); require_once IPB3_ROOT.'/initdata.php'; require_once IPS_ROOT_PATH.'sources/base/ipsRegistry.php'; require_once IPS_ROOT_PATH.'sources/base/ipsController.php'; ipsRegistry::init(); $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/sources/classes/post/classPost.php', 'classPost', 'forums' ); $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/sources/classes/post/classPostForms.php', 'classPostForms', 'forums' ); $this->post = new $classToLoad($this->registry); try { $this->post->setBypassPermissionCheck( true ); $this->post->setIsAjax( true ); $this->post->setPublished( true ); $this->post->setTopicID( 123 ); $this->post->setForumID( 2 ); $this->post->setForumData( $this->registry->class_forums->getForumById( 2 ) ); $this->post->setAuthor( IPSMember::load( 1 ) ); $this->post->setPostContentPreFormatted( "This is the already formatted post" ); $this->post->setSettings( array( 'enableSignature' => 1, 'enableEmoticons' => 1, 'post_htmlstatus' => 0 ) ); if( $this->post->addReply() === false ) { print_r( $this->post->getPostError() ); return false; } $post = $this->post->getPostData(); } catch( Exception $e ) { print $e->getMessage(); return false; } ?>но оно не работает выдает ошибку Fatal error: Using $this when not in object context in /home/admin/domains//public_html/444.php on line 22
Изменено пользователем voodu191