Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 07-03-2008, 04:44 AM
satorius99 satorius99 is offline
 
Join Date: Jun 2008
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 07-03-2008, 07:47 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You need to replicate the PHP code that displays/prepares the message box.
Reply With Quote
  #3  
Old 07-03-2008, 02:47 PM
satorius99 satorius99 is offline
 
Join Date: Jun 2008
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 07-03-2008, 03:16 PM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm referring to the PHP code - there is more to displaying the box than just the HTML.
Reply With Quote
  #5  
Old 07-03-2008, 03:50 PM
satorius99 satorius99 is offline
 
Join Date: Jun 2008
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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...
Reply With Quote
  #6  
Old 07-04-2008, 05:29 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The security token should be "guest" if the user is not logged in.
Reply With Quote
  #7  
Old 07-06-2008, 06:00 PM
satorius99 satorius99 is offline
 
Join Date: Jun 2008
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 07-07-2008, 06:39 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You shouldn't disable CSRF protection - it's there for a reason.
Reply With Quote
  #9  
Old 07-07-2008, 08:45 AM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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).
Reply With Quote
Reply


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 04:27 AM.


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.04385 seconds
  • Memory Usage 2,234KB
  • 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
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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