vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Build_new_post only works if you are logged in? (https://vborg.vbsupport.ru/showthread.php?t=153768)

x3sphere 07-30-2007 04:05 AM

Build_new_post only works if you are logged in?
 
This is the code I have:

PHP Code:

            $rforuminfo fetch_foruminfo($forumid);
            
$newpost = array(
                
'userid' => $userid,
                
'username' => $comment_username,
                
'message' =>  $comment_text,
                
'thread' => $threadid
);
            
$threadinfo['threadid'] = $threadid;
            
build_new_post('Post'$rforuminfo$threadinfo, array(), $newpost$errors);
                    if (
sizeof($errors) > 0)
        {
            
$error_text construct_errors($errors);
            echo 
$error_text;
        }
            
build_forum_counters($forumid); 

Works great, but only if you are logged into the forum. When I'm not logged in, it spits out this:

That username is already in use. If you are x3sphere and you have forgotten your password, click here.
The string you entered for the image verification did not match what was displayed.

Any ideas on to get this working while you are logged out?

nico_swd 07-30-2007 04:29 PM

Admin CP -> Forums and moderation -> Forum permissions -> Select forum -> Edit "Unregistered / Not Logged In" -> Can Post Threads: Yes.

x3sphere 08-04-2007 04:35 PM

Quote:

Originally Posted by nico_swd (Post 1305498)
Admin CP -> Forums and moderation -> Forum permissions -> Select forum -> Edit "Unregistered / Not Logged In" -> Can Post Threads: Yes.

Thx :) Although I still wanted member only posting on the forum. Using the data manager directly worked fine, instead of going through the build_new_post function.

toucan42 09-25-2007 05:35 PM

Quote:

Originally Posted by x3sphere (Post 1309773)
Thx :) Although I still wanted member only posting on the forum. Using the data manager directly worked fine, instead of going through the build_new_post function.

How did you address the datamanager work to avoid this error? This is exactly the problem I am facing.


All times are GMT. The time now is 11:14 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.02034 seconds
  • Memory Usage 1,722KB
  • 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)post_thanks_navbar_search
  • (1)printthread
  • (4)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete