vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   New Thread from php (https://vborg.vbsupport.ru/showthread.php?t=229066)

CarcaBot 11-28-2009 05:57 PM

New Thread from php
 
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.

Code:

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";}


CarcaBot 11-30-2009 08:50 AM

nobody know ?

Lynne 11-30-2009 01:39 PM

There is an article about using the datamanager to create new posts (and in there they also talk about new threads). Have you looked up the article?

CarcaBot 11-30-2009 09:31 PM

I've searched but i didn't found that thread. :( can you share it ?

Lynne 11-30-2009 09:42 PM

The first article that comes up when searching "post*" in "articles" "titles only" is this - Create Posts

CarcaBot 12-01-2009 10:49 AM

Oke, thank you so much..


All times are GMT. The time now is 01:05 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02029 seconds
  • Memory Usage 1,727KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete