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)

Wild-Wing 04-24-2006 02:47 PM

how can this be used to edit a post already posted?

fly 04-25-2006 11:43 AM

afaik, it can't. :D

Evercraft 04-26-2006 09:53 AM

You need to add the following code, after the post has been created, to update forum counters and last post index etc.

PHP Code:

require_once(DIR '/includes/functions_databuild.php');
build_forum_counters($threadinfo['forumid']); 

Quote:

Originally Posted by laddil
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.

It doesn't check permissions.

nj_vb 07-22-2006 07:28 PM

This doesn't work with 3.5.x for me...

It's saying "the user is already logged in, if you have lost your pw click here" or something to that effect. Any ideas?

Atakan KOC 07-24-2006 04:52 AM

3.5.x

PHP Code:

$rforuminfo fetch_foruminfo($Feed['forumid']);
$newpost = array(
    
'emailupdate' => 9999,
    
'userid' => 'Userid',
    
'username' => 'Username',
    
'title' => 'Title',
  
'message' =>  'Message',
  
'thread' => 'threadid'
);
$threadinfo['threadid'] = 'threadid';
build_new_post('Post'$rforuminfo$threadinfo, array(), $newpost$errors); 


fly 07-24-2006 11:32 AM

Quote:

Originally Posted by nj_vb
This doesn't work with 3.5.x for me...

It's saying "the user is already logged in, if you have lost your pw click here" or something to that effect. Any ideas?

I remember that happening to me as well. iirc, you populated BOTH the username and userid. Only fill in one.

ragtek 08-25-2006 05:24 PM

i've created a hook :
PHP Code:

if ($forumid==7)
{
$newpost = array(
    
'emailupdate' => 9999,
    
'userid' => '120',
    
'username' => 'Informationsminister',
    
'title' => 'Info',
  
'message' =>  '[SHOWTOGROUPS="10"]folge dem wei?n wolf
:P oder w?hle folgende nummer[/SHOWTOGROUPS]'
,
  
'thread' => '$threadid'
);
$threadinfo['threadid'] = 'threadid';
build_new_post('Post''7'$threadinfo, array(), $newpost$errors);} 

the start is newpost_complete
i want to make a automatic answer on every thread that someone creates in forum=7 but it doesn do that

FreekBoy 08-29-2006 01:35 AM

Is there a way like this to create forums?

Derschizo 10-04-2006 01:53 PM

What if you put it in the function_new reply and you want it to be a auto second post, what would you put for the threadid?
b/c
$threadinfo['threadid'] = 'threadid'; doesn't seem to work.

I want it in the same thread.

ruinernix 10-07-2006 03:03 AM

Quote:

Originally Posted by Atakan KOC
3.5.x

PHP Code:

$rforuminfo fetch_foruminfo($Feed['forumid']);
$newpost = array(
    
'emailupdate' => 9999,
    
'userid' => 'Userid',
    
'username' => 'Username',
    
'title' => 'Title',
  
'message' =>  'Message',
  
'thread' => 'threadid'
);
$threadinfo['threadid'] = 'threadid';
build_new_post('Post'$rforuminfo$threadinfo, array(), $newpost$errors); 


This works, but all messages created end up in a moderation queue even though the forum is not set to moderate posts/threads. I tried adding 'visible'=>'1' but it doesn't make a difference. Any clues? I suppose it's because I'm running this from an outside script, that isn't really logged into VB. I made a modification to functions_newpost.php
PHP Code:

Replaced:
    
// see if post has to be moderated or if poster in a mod
    
if ( 
        ((
With:
    
// see if post has to be moderated or if poster in a mod
    
if ( ($post['visible'] == 0) AND
        (( 

It does the job, but I'd like to understand why it's not working properly..

I also added build_forum_counters($forumid); after posting, otherwise the lastthread info doesn't get updated in the forum list.

Quote:

Originally Posted by Derschizo
What if you put it in the function_new reply and you want it to be a auto second post, what would you put for the threadid?
b/c
$threadinfo['threadid'] = 'threadid'; doesn't seem to work.

I want it in the same thread.

You should be using

$threadinfo['threadid'] = 3310; (ie: 3310 is the thread id)


All times are GMT. The time now is 07:57 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.03180 seconds
  • Memory Usage 1,759KB
  • 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
  • (5)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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