Z moda welcome members:
//-----------------------------------------
// Forum app Init and get post class
//-----------------------------------------
require_once( IPSLib::getAppDir( 'forums' ) . '/app_class_forums.php' );
$appClass = new app_class_forums( ipsRegistry::instance() );
require_once( IPSLib::getAppDir( 'forums' ) . '/sources/classes/post/classPost.php' );
$this->_postClass = new classPost( ipsRegistry::instance() );
//-----------------------------------------
// Setup post settings
//-----------------------------------------
if ( IPSText::getTextClass( 'editor' )->method == 'rte' )
{
$post_contents = IPSText::getTextClass( 'bbcode' )->convertForRTE( preg_replace( $search, $replace, $this->settings['aw_topic_message'] ) );
}
else
{
$post_contents = IPSText::getTextClass( 'bbcode' )->preEditParse( preg_replace( $search, $replace, $this->settings['aw_topic_message'] ) );
}
$this->settings['aw_topic_author'] == '0' ? $author_id = $member['member_id'] : $author_id = intval($this->settings['aw_topic_author']);
$this->_postClass->setIsPreview( false );
$this->_postClass->setForumData( ipsRegistry::getClass('class_forums')->forum_by_id[ intval( $this->settings['aw_topic_forum'] ) ] );
$this->_postClass->setForumID( intval( $this->settings['aw_topic_forum'] ) );
$this->_postClass->setPostContent( $post_contents );
$this->_postClass->setAuthor( $author_id );
$this->_postClass->setPublished( true );
$this->_postClass->setSettings( array( 'enableSignature' => 1,
'enableEmoticons' => 1,
'post_htmlstatus' => 0,
'enableTracker' => 0 ) );
$this->_postClass->setTopicTitle( preg_replace( $search, $replace, $this->settings['aw_topic_title'] ) );
//-----------------------------------------
// Post it now. Single Ladies
//-----------------------------------------
try
{
if( $this->_postClass->addTopic() )
{
$topic_data = $this->_postClass->getTopicData();
if( $this->settings['aw_pin_topics'] == '1' )
{
$this->pinTopic( $topic_data['tid'] );
}
if( $this->settings['aw_close_topics'] == '1' )
{
$this->closeTopic( $topic_data['tid'] );
}
$search[] .= "/%topic_link%/";
$replace[] .= "[url='".$this->registry->getClass('output')->formatUrl( $this->registry->getClass('output')->buildUrl( "{$this->settings['board_url']}/index.{$this->settings['php_ext']}?showtopic={$topic_data['tid']}", 'none','' ), "{$topic_data['title_seo']}", "showtopic" )."']{$this->lang->words['view_welcome_topic']}[/url]";
}
}
catch( Exception $error )
{
}