Go Back   vb.org Archive > vBulletin 5 Connect Discussion > vB5 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 07-02-2016, 09:36 PM
caimakale's Avatar
caimakale caimakale is offline
 
Join Date: Nov 2004
Posts: 325
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 07-03-2016, 03:00 AM
Replicant's Avatar
Replicant Replicant is offline
 
Join Date: Sep 2014
Location: Phoenix, Az. USA
Posts: 485
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>
Once you understand this code, you may decide to design a free floating popup template that encompasses the CKEditor to give your users a full featured interface.
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 12:03 PM.


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.05870 seconds
  • Memory Usage 2,171KB
  • 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)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (2)post_thanks_box
  • (2)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit_info
  • (2)postbit
  • (2)postbit_onlinestatus
  • (2)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