vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   Create Posts (https://vborg.vbsupport.ru/showthread.php?t=102418)

fly 12-06-2005 10:00 PM

Create Posts
 
PHP Code:

require_once('./global.php');
require_once(
'./includes/class_dm.php');
require_once(
'./includes/class_dm_threadpost.php');

$postdm = new vB_DataManager_Post($vbulletinERRTYPE_STANDARD);

$postthreadid '4473';
$postusername 'admin';
// Use $postusername if posting as a guest, use $postuserid if posting as a user
//$postuserid = '1';
$postpagetext 'Hi mom!';

$threadinfo fetch_threadinfo($postthreadid);
$foruminfo fetch_foruminfo($threadinfo['forumid']);

$postdm->set_info('forum'$foruminfo);
$postdm->set_info('thread'$threadinfo);  
$postdm->set('threadid'$postthreadid);
$postdm->set('username'$postusername);
// Use $postusername if posting as a guest, use $postuserid if posting as a user
//$postdm->set('userid', $postuserid);
$postdm->set('pagetext'$postpagetext);
$postdm->set('allowsmilie'1);
$postdm->set('visible'1);
$postdm->set('dateline'TIMENOW);
$postdm->save();
unset(
$postdm); 


Rich 12-20-2005 10:24 PM

Hello,

I am a pretty crafty fellow and can figure out most things but I am a tad confused here. As a tutorial, I would expect this to tell me what it does and how to implement it.

(I am guessing it creates a thread that reads"Hi mom!")

All I see is some code but what I would do with this code and what it would do for me I am at a loss for. Is there any chance you could expand on this for us not so knowledgeable individuals. lol

Paul M 12-20-2005 10:49 PM

I thought the title pretty much gave it away > [How To] Create Posts

That is the code to create a post in an existing thread.

Daniel 12-21-2005 02:39 AM

Wouldn't it be easier to just use the "Create Thread" button and call it Hi Mom?

Code Monkey 12-21-2005 03:51 AM

Quote:

Originally Posted by Daniel
Wouldn't it be easier to just use the "Create Thread" button and call it Hi Mom?

Yes, but that's not as fun as doing it with the Data Manager. ;)

fly 12-21-2005 11:12 AM

Quote:

Originally Posted by iguanairs
Hello,

I am a pretty crafty fellow and can figure out most things but I am a tad confused here. As a tutorial, I would expect this to tell me what it does and how to implement it.

(I am guessing it creates a thread that reads"Hi mom!")

All I see is some code but what I would do with this code and what it would do for me I am at a loss for. Is there any chance you could expand on this for us not so knowledgeable individuals. lol

As stated, this is code you would use in a hack to reply to a certain thread. What else do you want to know?

Razz 01-07-2006 10:52 PM

I tried this out but it doesn't seem to update the view and reply counters when it creates the new post or did I miss something?

laddil 01-11-2006 07:36 PM

I have a quick question about using this method to put in a post...

Does it take into account user preferances (i.e., emoticons, smilies, etc.) and forum security settings (vBcode, raw HTML, etc.)?

The modification I'm writing needs to add posts to a specific forum, but I have consern about the potential of this bypassing security and causing mischief.

grana 04-10-2006 10:15 AM

I have a question: if I create a post in this way, does vb send the "update notification emails" to the subscribed users?
If not, how can I trigger this?

Thanks!

Cloud Strife 04-17-2006 10:27 PM

edit


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

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

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01197 seconds
  • Memory Usage 1,744KB
  • 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_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete