vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Post new thread from a non-vb page? (https://vborg.vbsupport.ru/showthread.php?t=184257)

satorius99 07-03-2008 04:44 AM

Post new thread from a non-vb page?
 
I'm a newbie but can't seem to find a recent article on how to let users post a new thread from a non-vb page. I am able to get the newthread template to appear on my page with the Title box and submit buttons displaying, but the problem is:

1) the Message box doesn't show up
2) I can post the just title to a the forum while logged in from my non-vb page, but when I try posting while not logged in, it takes me to the log in page, and then gives my the invalid security token error.

What is the proper way to achieve this?

Thanks

Dismounted 07-03-2008 07:47 AM

You need to replicate the PHP code that displays/prepares the message box.

satorius99 07-03-2008 02:47 PM

Thanks for the tip--just to clarify, you mean go into the newthread template and copy and paste the template code into my non-vb page? I tried this but it has the same effect. Also, what about issue #2 I mentioned?

What I'm trying to achieve is a Yedda-style "Ask a question" box which will appear on our website's many article pages. Our website is a high traffic home improvement site and we have added a vb forum which is only linked to from one place on our site. This "ask-a-question" box will appear below our articles, which is really just a disguised "new thread" message box. Is there a standard approach for integrating this or an article somewhere that I can look at?

Thanks again for your help.

Dismounted 07-03-2008 03:16 PM

I'm referring to the PHP code - there is more to displaying the box than just the HTML.

satorius99 07-03-2008 03:50 PM

I realize that, but I wouldn't even know where to find php code you're talking about. Also, I'm trying not to reinvent the wheel and want to know if this has been done before and if so, how. Again, I am new to vbulletin.

--------------- Added [DATE]1215128354[/DATE] at [TIME]1215128354[/TIME] ---------------

Well I'm still peeling away more layers of the onion - replicating the newthread php code and trying different things in the header of my page but I keep running into the same "security token" issue when posting as an unregistered user. Any help is appreciated.

Any other examples of what this thread title describes that anybody knows of? Seems like simple enough functionality, but I can't find any help...

Dismounted 07-04-2008 05:29 AM

The security token should be "guest" if the user is not logged in.

satorius99 07-06-2008 06:00 PM

Ok, I tried updating this but no luck. Just to be clear, is this the token you mean? From the new thread non-vb page:

<input type="hidden" name="securitytoken" value="guest" />

--------------- Added [DATE]1215379840[/DATE] at [TIME]1215379840[/TIME] ---------------

I finally figured this out - I had changed the 'CSRF_PROTECTION' to false from the page with the form (the non-vb page), when it needed to be done on the receiving page (newthread.php). This was the line in question:

define('CSRF_PROTECTION', false);

I knew it would turn out to be a newbie mistake!

Thanks for your help.

Dismounted 07-07-2008 06:39 AM

You shouldn't disable CSRF protection - it's there for a reason.

Opserty 07-07-2008 08:45 AM

You could probably generate your own security if you replicate what vBulletin does to generate its own. (Just follow the security token variable backwards, global.php is a good place to start).


All times are GMT. The time now is 04:01 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.01155 seconds
  • Memory Usage 1,723KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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