Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Form Hack Details »»
Form Hack
Version: 4.1, by Abe1 Abe1 is offline
Developer Last Online: Jun 2010 Show Printable Version Email this Page

Category: New Posting Features - Version: 3.6.x Rating:
Released: 09-14-2006 Last Update: 04-23-2008 Installs: 1216
Uses Plugins Template Edits
 
No support by the author.

Form Hack 4.1


Features:

Ever wanted an online form that a user can fill out, which when submitted gets:
  • Posted into a new thread in a forum of your choice
  • Create a new poll in the new thread with options of your choice
  • Posted as a reply in an existing thread of your choice
  • PMed to you or someone else
  • Emailed to an email address you specify
  • Choose to redirect to the post, thread or forum, or a custom thank you message
  • Choose to redirect to edit post
  • See a preview before they submit

Or any combination or all of the above?

Well, this is the hack for you!

You can use this for:
  • Moderator Applications
  • Quiz Submit Form which gets PMed to a moderator
  • Contact Form that goes to PM, email or thread
  • Guests to apply to be members
  • Report a Moderator form that goes as a PM to you
  • Guests can PM you for whatever reason
  • Order form to buy things
  • Donation form
  • News or Articles submissions that can go straight to a thread

Or anything you like - this hack is totally customizable via the AdminCP.

The beauty of this hack is that once you install this hack, to make a new form all you need to do is copy the main hook, rename it to whatever you want, edit the variables in the hook, and you have a totally new form!!! You do not need to touch the templates again, but can always create new ones and use different templates for different forms.

Format of the form:
  • One main input question
  • 3 Radio buttons Choice questions
  • 3 Normal text input questions
  • 1 Drop down menu
  • 3 Check boxes
  • 1 Long answer question
  • 1 VB message editor text box question
  • Upload attachments

This is customizable via the hook.

Also:
  • You can set the usergroups you want access to this form.
  • Depending on your forum permissions, if the new thread is in a public forum, members can reply to it. This hack allows a form to submit the new thread or post wherever you want it to go.
  • Force the user to answer all questions.

INSTALLATION
Easy - takes only a few minutes:
  • Import the XML into products. (admin cp -> Plug-in System -> Manage Products -> Add/Import Product)
  • Edit the main plug-in - the instructions are all inside the hook itself, in the top half. Follow the instructions carefully!
  • To get to the form, go to: /newthread.php?do=form (change "form" to the name of your form if you have few)

Done!

Use this hack to make as many forms as you like!

Enjoy!

Updates:

Version 4.0: (09/15/2006)
  • Ported over for vb3.6
  • Send to multiple emails.
  • Send multiple PMs.
  • Parse emails for BBCode
  • And finally, ATTACHMENTS!

Version 4.1: (04/24/2008)
  • Fixed for vb 3.6.10
  • Small bug fixed.
  • List of the 2 quick edits are in the zip file so you don't have to start making a form from scratch.

MAKE SURE YOU CLICK INSTALL!
You will get an email when a new version is released.

Abe1 with rights from Dr Erwin Loh

Supporters / CoAuthors

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #1132  
Old 07-18-2008, 01:01 PM
RedGTiVR6 RedGTiVR6 is offline
 
Join Date: Dec 2006
Location: Little Elm, TX
Posts: 817
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That I don't know, but you might try the programing discussions forum?
Reply With Quote
  #1133  
Old 07-18-2008, 04:28 PM
AsscBB AsscBB is offline
 
Join Date: Dec 2007
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there a way to have the dropdown menu selections be a variable? I have a need for a variable length dropdown based on the results of a query so rather than using a drop down for static results like gender, I would like it to be able to return a variable length of options such as all of the members of a particular usergroup.

any ideas?

Thanks!
Reply With Quote
  #1134  
Old 07-18-2008, 04:31 PM
Stryker412 Stryker412 is offline
 
Join Date: May 2005
Posts: 326
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How do I do three drop downs side by side rather than under each other? I want one for Month, Day, year.

If I want the thread title to be the username of the applicant it would be $posttitle = $bbuserinfo ?

Also, is there anyway to have the submitted form posted in a section that the user cannot see? I want each application to be submitted to the admin section so we may comment/vote on each one.

Is it possible to only allow the person to submit an application once?

Lastly, is there a way to automatically reject an application (once it's filled out) if a certain variable is not met (such as age)?
Reply With Quote
  #1135  
Old 07-20-2008, 12:47 PM
Stryker412 Stryker412 is offline
 
Join Date: May 2005
Posts: 326
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

bump, anyone?
Reply With Quote
  #1136  
Old 07-21-2008, 02:38 PM
Stryker412 Stryker412 is offline
 
Join Date: May 2005
Posts: 326
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by RedGTiVR6 View Post
I'd keep using letters.

As for the answers, did you ad them to the answer template as well?

No ideas on the separate section other than perhaps creating multiple forms.
This is how my formanswers looks:


Code:
$formtitle
$bbuserinfo[username]

$question1
$answer1

$question2
$answer2

$question3
$answer3

$question4
$answer4

$dropdownquestion1
$dropdownanswer1

$dropdownquestion2
$dropdownanswer2

$dropdownquestion3
$dropdownanswer3

$dropdownquestion4
$dropdownanswer4

-----------------------------------------------------
$longquestion1
$longanswer1
------------------------------------------------------
Reply With Quote
  #1137  
Old 07-21-2008, 03:09 PM
RedGTiVR6 RedGTiVR6 is offline
 
Join Date: Dec 2006
Location: Little Elm, TX
Posts: 817
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

1.) Make sure each answer is added to the plug-in in the top section.
2.) Make sure each answer is also listed as an option in the form template. (usually as such: <select name="dropdownanswer2">) - you MUST tell the system essentially this: What ever the users pics as their answer to the drop down, that becomes dropdownanswerx.
3.) Make sure each answer is listed in the form answer template.

If you have them listed in each, then you should see it showing up.
Reply With Quote
  #1138  
Old 07-21-2008, 03:36 PM
Stryker412 Stryker412 is offline
 
Join Date: May 2005
Posts: 326
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by RedGTiVR6 View Post
1.) Make sure each answer is added to the plug-in in the top section.
2.) Make sure each answer is also listed as an option in the form template. (usually as such: <select name="dropdownanswer2">) - you MUST tell the system essentially this: What ever the users pics as their answer to the drop down, that becomes dropdownanswerx.
3.) Make sure each answer is listed in the form answer template.

If you have them listed in each, then you should see it showing up.
I have the questions I'm not using commented out, could that be an issue?

Code:
// Part 1
$vbulletin->input->clean_array_gpc('p', array(
//'normalanswer1' => TYPE_STR,
//'radioanswer1' => TYPE_STR,
//'radioanswer2' => TYPE_STR,
//'radioanswer3' => TYPE_STR,
//'radioanswer3other' => TYPE_STR,
'answer1' => TYPE_STR,
'answer2' => TYPE_STR,
'dropdownanswer1' => TYPE_STR,
'dropdownanswer2' => TYPE_STR,
'dropdownanswer3' => TYPE_STR,
'dropdownanswer4' => TYPE_STR,
'answer3' => TYPE_STR,
'answer4' => TYPE_STR,
//'checkboxanswer1_1' => TYPE_STR,
//'checkboxanswer1_2' => TYPE_STR,
//'checkboxanswer1_3' => TYPE_STR,
'longanswer1' => TYPE_STR
));

// Part 2
//$normalanswer1 = $vbulletin->GPC['normalanswer1'];
//$radioanswer1 = $vbulletin->GPC['radioanswer1'];
//$radioanswer2 = $vbulletin->GPC['radioanswer2'];
//$radioanswer3 = $vbulletin->GPC['radioanswer3'];
//$radioanswer3other = $vbulletin->GPC['radioanswer3other'];
$answer1 = $vbulletin->GPC['answer1'];
$answer2 = $vbulletin->GPC['answer2'];
$dropdownanswer1 = $vbulletin->GPC['dropdownanswer1'];
$dropdownanswer2 = $vbulletin->GPC['dropdownanswer2'];
$dropdownanswer3 = $vbulletin->GPC['dropdownanswer3'];
$dropdownanswer4 = $vbulletin->GPC['dropdownanswer4'];
$answer3 = $vbulletin->GPC['answer3'];
$answer4 = $vbulletin->GPC['answer4'];
//$checkboxanswer1_1 = $vbulletin->GPC['checkboxanswer1_1'];
//$checkboxanswer1_2 = $vbulletin->GPC['checkboxanswer1_2'];
//$checkboxanswer1_3 = $vbulletin->GPC['checkboxanswer1_3'];
$longanswer1 = $vbulletin->GPC['longanswer1'];
Reply With Quote
  #1139  
Old 07-21-2008, 03:46 PM
RedGTiVR6 RedGTiVR6 is offline
 
Join Date: Dec 2006
Location: Little Elm, TX
Posts: 817
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, that wouldn't cause the problem.

In your form template, the call for the drop down should look something like this, does it?

Code:
<td class="alt1" valign="middle">
<b>$dropdownquestion2</b>:
</td>
<td class="alt1" valign="middle" colspan="2">
<select name="dropdownanswer2">
<option value="$dropdownchoice2a" <if condition="$dropdownchoice2a == $dropdownanswer2">selected="selected"</if>>$dropdownchoice2a</option>
<option value="$dropdownchoice2b" <if condition="$dropdownchoice2b == $dropdownanswer2">selected="selected"</if>>$dropdownchoice2b</option>
<option value="$dropdownchoice2c" <if condition="$dropdownchoice2c == $dropdownanswer2">selected="selected"</if>>$dropdownchoice2c</option>
</select></td>
</tr>
Reply With Quote
  #1140  
Old 07-21-2008, 04:07 PM
Stryker412 Stryker412 is offline
 
Join Date: May 2005
Posts: 326
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Mine:

Code:
<tr>
<td class="alt2" valign="middle">
<b>$dropdownquestion1</b>:
</td>
<td class="alt2" valign="middle" colspan="2">
<select name="dropdownanswer1">
<option value="$dropdownchoice1a" <if condition="$dropdownchoice1a == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1a</option>
<option value="$dropdownchoice1b" <if condition="$dropdownchoice1b == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1b</option>
</select></td>
</tr>
Reply With Quote
  #1141  
Old 07-21-2008, 04:20 PM
Stryker412 Stryker412 is offline
 
Join Date: May 2005
Posts: 326
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Stryker412 View Post
This is how my formanswers looks:


Code:
$formtitle
$bbuserinfo[username]

$question1
$answer1

$question2
$answer2

$question3
$answer3

$question4
$answer4

$dropdownquestion1
$dropdownanswer1

$dropdownquestion2
$dropdownanswer2

$dropdownquestion3
$dropdownanswer3

$dropdownquestion4
$dropdownanswer4

-----------------------------------------------------
$longquestion1
$longanswer1
------------------------------------------------------
ok I think I found the issue. I forgot to edit the one section of the hack.

Code:
if ($answerall == "1")
    {
        if ($answer1 == '' OR $answer2 == '' OR $answer3 == '' OR $answer4 == '' OR $dropdownanswer1 == '' OR $dropdownanswer2 == '' OR $dropdownanswer3 == '' OR $dropdownanswer4 OR $longanswer1 == '')
I edited the line but am still getting the error that I have to answer all questions.
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:28 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.16747 seconds
  • Memory Usage 2,329KB
  • Queries Executed 26 (?)
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
  • (6)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (4)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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_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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete