Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin 3 Articles
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Create Posts
fly
Join Date: Oct 2003
Posts: 1,215

 

Show Printable Version Email this Page Subscription
fly fly is offline 12-06-2005, 10:00 PM

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); 
Reply With Quote
  #2  
Old 12-20-2005, 10:24 PM
Rich's Avatar
Rich Rich is offline
 
Join Date: Mar 2004
Location: U.S.A
Posts: 921
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #3  
Old 12-20-2005, 10:49 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 12-21-2005, 02:39 AM
Daniel's Avatar
Daniel Daniel is offline
 
Join Date: Jul 2005
Location: USA
Posts: 707
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wouldn't it be easier to just use the "Create Thread" button and call it Hi Mom?
Reply With Quote
  #5  
Old 12-21-2005, 03:51 AM
Code Monkey's Avatar
Code Monkey Code Monkey is offline
 
Join Date: May 2004
Posts: 1,080
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 12-21-2005, 11:12 AM
fly fly is offline
 
Join Date: Oct 2003
Posts: 1,215
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #7  
Old 01-07-2006, 10:52 PM
Razz Razz is offline
 
Join Date: Dec 2001
Location: UK
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #8  
Old 01-11-2006, 07:36 PM
laddil laddil is offline
 
Join Date: Nov 2005
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #9  
Old 04-10-2006, 10:15 AM
grana grana is offline
 
Join Date: Dec 2005
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
Reply With Quote
  #10  
Old 04-17-2006, 10:27 PM
Cloud Strife Cloud Strife is offline
 
Join Date: Jun 2002
Posts: 137
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

edit
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:20 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.12087 seconds
  • Memory Usage 2,321KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (1)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete