voodu191 Posted March 26, 2014 Share Posted March 26, 2014 (edited) единственное что нашел это <?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 Edited March 26, 2014 by voodu191 Link to comment Share on other sites More sharing options...
siv1987 Posted March 26, 2014 Share Posted March 26, 2014 Тут не класс чтобы использовать внутренний указатель объекта $this. http://ipbskins.ru/forum/topic8466.html Link to comment Share on other sites More sharing options...
voodu191 Posted March 26, 2014 Author Share Posted March 26, 2014 по ссылке создание темы, а мне нужно сообщение в теме. Вот в чем дело Link to comment Share on other sites More sharing options...
siv1987 Posted March 26, 2014 Share Posted March 26, 2014 По ссылке еще говорится о некоем методе addReply того же класса, с ссылкой на документацию.Очевидно нужно заменить addTopic на addReply, добавить ид темы setTopicID() и убрать ненужный setTopicTitle. В итоге получится http://ipbskins.ru/forum/topic8466.html#entry84784 Link to comment Share on other sites More sharing options...
voodu191 Posted March 26, 2014 Author Share Posted March 26, 2014 попробую, пасиб) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now