vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Auto-creation of threads? (https://vborg.vbsupport.ru/showthread.php?t=61030)

Wired1 12-02-2004 09:20 PM

One of the side menus in the admin section, a dropdown accessible only within that area.

sabret00the 12-02-2004 09:26 PM

Quote:

Originally Posted by Wired1
One of the side menus in the admin section, a dropdown accessible only within that area.

oh that i thought for the form it would've been admincp based anyway, it's not too hard to add a new page, the hardest bit comes when trying to add something to an existing page.

lowspeed 01-14-2005 06:00 PM

I used this code, IT actually adds the thread but i get the following warning

Warning: array_merge() [function.array-merge]: Argument #1 is not an array in \global.php on line 329

Warning: Invalid argument supplied for foreach() in \includes\functions.php on line 2177


Also if the subject in the forum ID is send again then it just exits it doesn't flow through the code.



Help :)

Thanks,
LOW LOW.


Quote:

Originally Posted by StefanS
Hi,

just tested the following code:

PHP Code:

<?
require('./global.php'); 
require('./includes/functions_newpost.php'); 
$userid = 10;
$forumid = 100;
$foruminfo = fetch_foruminfo($forumid); 
$bbuserinfo = fetch_userinfo($userid); 
$post[title] = 'subject'; 
$post[message] = 'message'; 
$post[poststarttime] = TIMENOW; 
$post[posthash] = md5($post[poststarttime] . $bbuserinfo['userid'] . $bbuserinfo['salt']); 
build_new_post('thread', $foruminfo, array(), 0, $post, $errors); 
?>

works for me with 3.03 without problems ...


Xenon 01-14-2005 11:51 PM

that's a problem with php5

before the require global.php add these lines:

PHP Code:

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array();

// get special data templates from the datastore
$specialtemplates = array();

// pre-cache templates used by all actions
$globaltemplates = array();

// pre-cache templates used by specific actions
$actiontemplates = array(); 


lowspeed 01-15-2005 01:10 AM

Thanks for the quick help !

I have a small follow up. I know how to get the threadid, but how would i post a reply to that ID ?

Do i put instead of the 0, you put the threadid (lets say 3212) ? example:

build_new_post('thread', $foruminfo, array(), 3212, $post, $errors);

lowspeed 01-16-2005 09:27 PM

I tried doing something like this ...

build_new_post('reply', $foruminfo, array(), 3212, $post, $errors);

where 3212 is the thread i'm replying to, but it didn't work :(

lowspeed 01-17-2005 05:20 PM

Ok i found how to do it

You need these added:

$threadid=1091; // the thread you want to reply to
$threadinfo = fetch_threadinfo($threadid);

build_new_post('reply', $foruminfo, $threadinfo, $_POST['postid'], $post, $errors);

lowspeed 01-17-2005 07:38 PM

Hi Guys,

It works fine when called independently from the rest of my code.

I have a feeling that because my php site uses a database as well it gets confused to which database its refering to.

How can i make sure that when i run the post thread section it looks at the VB db and after it reverts back to my db. ??

Andreas 01-17-2005 08:58 PM

Use a different dbuser/pass for your application

lowspeed 01-17-2005 11:00 PM

doesnt work :(

I decided to use URL stream instead.


All times are GMT. The time now is 10:50 AM.

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.01180 seconds
  • Memory Usage 1,740KB
  • 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
  • (2)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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