Quote:
Originally Posted by MoT3rror
PHP Code:
// CREATE THREAD IN PUBLIC RECRUITING $forumURL = "/var/www/html/test/forumstest"; // no forward slash $curdir = getcwd (); chdir($forumURL); require_once('./global.php'); chdir ($curdir); require_once(DIR . '/includes/class_dm.php'); require_once(DIR . '/includes/class_dm_threadpost.php'); require_once(DIR . '/includes/functions_databuild.php'); $threaddm =& datamanager_init('Thread_FirstPost', $vbulletin, ERRTYPE_ARRAY, 'threadpost');
/* vars */ $forumid = 31; // can also be a number ;) $forumid= 12; $title = $charNames . ' ' . $charClass; $pagetext = $message; $foruminfo = fetch_foruminfo($forumid); $threaddm->set_info('forum', $foruminfo);
/* strip *///What is it with the (int) AND (string) $forum_id = (int)$forum_id; $pagetext = (string)strip_tags($pagetext); $title = (string)strip_tags($title); //
$threaddm->set('forumid', $foruminfo['forumid']); $threaddm->set('userid', 3963); $threaddm->set('title', $title); $threaddm->set('pagetext', $pagetext); $threaddm->set('allowsmilie', 1); $threaddm->set('visible', 1); $threaddm->set('dateline', TIMENOW);
$threaddm->pre_save();
if (count($threaddm->errors) > 0) { print_r($threaddm->errors); } else { $threaddm->save(); build_forum_counters($forum_id); echo 'Yay!'; }
|
Thank u for this code.
It's work.
But i have a problem.
If i set HTML Tags on 'pagetext', it will delete Tags!!!
I set the HTML permission to True on the destination forum, but ...
what can i to do?!
(sry for my bad english)