The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Button and code to create a new thread
I've created custom search modules for two different channels on my website. These modules are displayed on my home page. When a user clicks on the "View All" button, it takes them to the actual channel, rather than return a bunch of search results.
I'm looking to add one more button to each module...I'd like my users to be able to "Post an ad" directly from the module. What I mean by this is, if they click the button, it will begin the process of creating a new topic within the predefined channel. Is it possible? Anyone have code to accomplish this in VB5? |
#2
|
||||
|
||||
Yes, it's possible. I have the basic code somewhere. I'll have to do some digging to find it.
--------------- Added [DATE]1467593017[/DATE] at [TIME]1467593017[/TIME] --------------- I found my notes. This is the basic form with the minimum requirements to start a new thread, reply, or comment. It is in no way intended to be a production design, but more as a guideline. The security token is available via js variable pageData.securitytoken. The forum to post to is a different story. You will need to come up with a way to find the nodeid's of the forums you wish to post the new thread to and auto fill the form for each result probably with JS and regex. securitytoken - self explanatory title - The title of the new thread parentid - The nodeid of the forum to start the new thread in text - The content portion of the first post in the new thread. This is SQL/HTML safe since it is going through the vBulletin filters AND BBCode is allowed. Code:
<form action="http://www.k5blazersplus.com/forum/create-content/text/" method="post"> <input type="hidden" name="securitytoken" value="Use Javascript to insert security token here on page load"> Title:<br> <input type="text" name="title"><br> Forum:<br> <input type="hidden" name="parentid" default="Nodeid of forum to post to"><br> Text:<br> <input type="text" name="text"><br> <input type="submit" value="Submit"> </form> |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|