The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
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 |
#2
|
||||
|
||||
You need to replicate the PHP code that displays/prepares the message box.
|
#3
|
|||
|
|||
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. |
#4
|
||||
|
||||
I'm referring to the PHP code - there is more to displaying the box than just the HTML.
|
#5
|
|||
|
|||
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... |
#6
|
||||
|
||||
The security token should be "guest" if the user is not logged in.
|
#7
|
|||
|
|||
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. |
#8
|
||||
|
||||
You shouldn't disable CSRF protection - it's there for a reason.
|
#9
|
|||
|
|||
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).
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|