Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 04-15-2009, 11:00 AM
altunozara altunozara is offline
 
Join Date: Jul 2006
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Creating new thread/post via MySql

$con = mysql_connect("***","***","***");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$repostinfo[0] = 86994;
$repostinfo[1] = 81628;
$repostinfo[2] = 1;
$repostinfo[3] = 'Altuno';
$repostinfo[4] = 1;
$repostinfo[5] = 'This is an automated post';
$repostinfo[6] = 1212220036;
$repostinfo[7] = 'This should be posted as soon as a thread is deleted, this post is automated under the name of Altuno';
$repostinfo[8] = 1;
$repostinfo[9] = 0;
$repostinfo[10] = '000.000.0.0';
$repostinfo[11] = 0;
$repostinfo[12] = 1;
$repostinfo[13] = 0;
$repostinfo[14] = 0;
$repostinfo[15] = 0;
$repostinfo[16] = 0;

mysql_select_db("gamingwe_forum", $con);$sql=("INSERT INTO post (postid, threadid, parentid, username, userid, title, dateline, pagetext, allowsmilie, showsignature, ipaddress, iconid, visible, attach, infraction, reportthreadid, post_thanks_amount)".
"VALUES
('$repostinfo[0]', '$repostinfo[1]', '$repostinfo[2]', '$repostinfo[3]', '$repostinfo[4]', '$repostinfo[5]', '$repostinfo[6]', '$repostinfo[7]', '$repostinfo[8]', '$repostinfo[9]', '$repostinfo[10]', '$repostinfo[11]', '$repostinfo[12]', '$repostinfo[13]', '$repostinfo[14]', '$repostinfo[15]', '$repostinfo[16]')");
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
mysql_close($con);

when i use this code, it is input into as a row into the "post", but it is not shown on the forum liek every other row in "post"?
Reply With Quote
  #2  
Old 04-22-2009, 02:57 AM
Kidillusion Kidillusion is offline
 
Join Date: Apr 2009
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I would love to see the answer to this post. I also need to do mass insert scripts to import my posts.
Reply With Quote
  #3  
Old 04-22-2009, 03:08 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Take a look in the articles forum on how to insert posts/threads using the datamanager. Just adding a row to the post table is not going to do it. There is necessary info to be added/updated in the thread table also. And the user table. And probably others that I don't feel like thinking about right now.
Reply With Quote
  #4  
Old 04-22-2009, 07:01 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Also see the manual: http://www.vbulletin.com/docs/html/data_managers
Reply With Quote
Reply

Thread Tools
Display Modes

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 10:32 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.05318 seconds
  • Memory Usage 2,182KB
  • Queries Executed 13 (?)
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)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete