Jump to content

Не могу сделать добавление темы через php скрипт

Featured Replies

Нашел примеры в гугле, но не работают.

Подскажите простой вариант добавления темы(название,текст).

Link to comment
https://ipbmafia.ru/topic/9450-ne-mogu-sdelat-dobavlenie-temy-cherez-php-skript/
Share on other sites

Нашел, всем спс :)

<?php
//-------------------------
// Init
//-------------------------

define( 'IPB_THIS_SCRIPT', 'public' );
define( 'IPS_PUBLIC_SCRIPT', 'index.php');
define( 'IPS_ENFORCE_ACCESS', true);
require_once( 'initdata.php' );

require_once( IPS_ROOT_PATH . 'sources/base/ipsRegistry.php' );
require_once( IPS_ROOT_PATH . 'sources/base/ipsController.php' );

$registry = ipsRegistry::instance();
$registry->init();
$DB = $registry->DB();

require_once( IPSLib::getAppDir('forums') . '/sources/classes/post/classPost.php' );

$member_id = 1;
$member = IPSMember::Load( $member_id, 'members' );
$member['member_group_id'] = 4;
$member['g_post_new_topics'] = 1;

$forumID = 181;

$postClass = new classPost( $registry );
$postClass->setForumID( $forumID );
$postClass->setForumData( ipsRegistry::getClass('class_forums')->forum_by_id[$forumID] );
$postClass->setTopicTitle( "title" );
$postClass->setPostContent( "text" );
$postClass->setAuthor( $member );
if($postClass->addTopic())
{
	echo "ok";
}
else
{
	echo $postClass->_postErrors."<br>".
			$postClass->getAuthor( 'member_id' )."<br>".
			$postClass->getAuthor('g_post_new_topics')."<br>".
			$perm_array;
}
?>
Guest
This topic is now closed to further replies.

Последние посетители 0

  • No registered users viewing this page.