CarcaBot
11-28-2009, 05:57 PM
Hello,
I'm interested about one thing...
How can I add new vb thread using php, and get new itemid ?
i inspected rssposter.php from cron folder but i cannot make it to work.
require_once('includes/functions_newpost.php');
require_once('includes/class_rss_poster.php');
require_once('includes/functions_wysiwyg.php');
// init thread/firstpost datamanager
$itemdata =& datamanager_init('Thread_FirstPost', $vbulletin, $error_type, 'threadpost');
$itemdata->set_info('forum', fetch_foruminfo("14"));
$itemdata->set_info('user', "user");
$itemdata->set_info('chop_title', true);
$itemdata->set('iconid', 1);
$itemdata->set('sticky', 0);
$itemdata->set('forumid', "14");
$itemdata->set('prefixid', "");
$itemdata->set('userid', "1");
$itemdata->set('title', strip_bbcode(convert_wysiwyg_html_to_bbcode("titlul meu")));
$itemdata->set('pagetext', "Continutul meu<br/>test");
$itemdata->set('visible', 1);
$itemdata->set('allowsmilie', 1);
$itemdata->set('showsignature', 1);
$itemdata->set('ipaddress', '');
$threadactiontime = 0;
if ($itemid = $itemdata->save())
{
$itemtype = 'thread';
$itemtitle = $itemdata->fetch_field('title');
$itemlink = "../showthread.php?t=$itemid";
echo "<li><a href=\"$itemlink\" target=\"feed\">$itemtitle</a></li>";
} else {
echo "error";}
I'm interested about one thing...
How can I add new vb thread using php, and get new itemid ?
i inspected rssposter.php from cron folder but i cannot make it to work.
require_once('includes/functions_newpost.php');
require_once('includes/class_rss_poster.php');
require_once('includes/functions_wysiwyg.php');
// init thread/firstpost datamanager
$itemdata =& datamanager_init('Thread_FirstPost', $vbulletin, $error_type, 'threadpost');
$itemdata->set_info('forum', fetch_foruminfo("14"));
$itemdata->set_info('user', "user");
$itemdata->set_info('chop_title', true);
$itemdata->set('iconid', 1);
$itemdata->set('sticky', 0);
$itemdata->set('forumid', "14");
$itemdata->set('prefixid', "");
$itemdata->set('userid', "1");
$itemdata->set('title', strip_bbcode(convert_wysiwyg_html_to_bbcode("titlul meu")));
$itemdata->set('pagetext', "Continutul meu<br/>test");
$itemdata->set('visible', 1);
$itemdata->set('allowsmilie', 1);
$itemdata->set('showsignature', 1);
$itemdata->set('ipaddress', '');
$threadactiontime = 0;
if ($itemid = $itemdata->save())
{
$itemtype = 'thread';
$itemtitle = $itemdata->fetch_field('title');
$itemlink = "../showthread.php?t=$itemid";
echo "<li><a href=\"$itemlink\" target=\"feed\">$itemtitle</a></li>";
} else {
echo "error";}