Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons

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
  #462  
Old 05-08-2007, 03:34 PM
Deepdog009's Avatar
Deepdog009 Deepdog009 is offline
 
Join Date: Dec 2004
Location: Almost out of PHP TZone
Posts: 485
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ComputerVitals View Post
How do I make it so,

When someone selects a radio button, pushes the submit button, it still emails, but depending on which radio button they pushed, it will direct you to a certain page.

ComputerVitals take a look C at this post...

https://vborg.vbsupport.ru/showpost....&postcount=409
Reply With Quote
  #463  
Old 05-08-2007, 06:09 PM
ComputerVitals ComputerVitals is offline
 
Join Date: Oct 2005
Posts: 131
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Deepdog009 View Post
ComputerVitals take a look C at this post...

https://vborg.vbsupport.ru/showpost....&postcount=409
Rock and roll
Thanks Deepdog009 & rayw

Tweaked that for the radio buttons and now it work just like it did before..
Now to add your image verification to it!!
Reply With Quote
  #464  
Old 05-08-2007, 08:03 PM
Deepdog009's Avatar
Deepdog009 Deepdog009 is offline
 
Join Date: Dec 2004
Location: Almost out of PHP TZone
Posts: 485
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ComputerVitals View Post
Rock and roll
Thanks Deepdog009 & rayw

Tweaked that for the radio buttons and now it work just like it did before..
Now to add your image verification to it!!


ComputerVitals i released a Forms Pack *** add-on that helps with Java Calendar pop-up window 2 help with events.

BBcode smileys add-on 2 help with answer template look and feel.

Posticons & Subtitle add-on 2 help with posting topic image.

ABE1 Form Hack takes all credit and hopefully add these to his hack...

Good Luck
Reply With Quote
  #465  
Old 05-09-2007, 02:09 AM
ComputerVitals ComputerVitals is offline
 
Join Date: Oct 2005
Posts: 131
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A little tweaking.
When you enable the:
$answerall = "1";

The error message will display if you dont fill it out.
Is there a way to add a text link for a "go back" instead of the user hitting the browser back button?
If not i'll just change the words to tell them to hit the back button.
Reply With Quote
  #466  
Old 05-16-2007, 01:43 PM
ComputerVitals ComputerVitals is offline
 
Join Date: Oct 2005
Posts: 131
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm getting this error when I click the submit button:

Error: 'vB-Editor_.vB_Editor_001' is null or not an object

It has the yellow exclamation in the lower left of the browser when submitting.
On reference to vb_editor in the hack I have found was in the form template.
Code:
<form name="vbform" action="newthread.php" method="post"<if condition="!is_browser('webtv')"> onsubmit="return vB_Editor['$editorid'].prepare_submit(0, $vboptions[postminchars])"</if>>
Any ideas how to fix this?
Reply With Quote
  #467  
Old 05-16-2007, 08:07 PM
JTMON's Avatar
JTMON JTMON is offline
 
Join Date: Oct 2001
Posts: 279
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi, I haven't found this problem searching this thread so here goes...did the edits, made sure part 1 and 2, had all working until I finished..now I get this error:

Parse error: parse error, unexpected '}' in /home/www/ticketdoctor/forums/newthread.php(71) : eval()'d code on line 608

My code is:
Code:
// #######################################################################
// ######################## CUSTOMIZE VARIABLES ##########################
// #######################################################################

////////////////////////////////////////////////////////////////////////////////////////////////////
////// BEGIN CUSTOMIZATION BELOW////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//VARIABLES
//Study how variables are add here to add or remove any. If you add a variable to your form, you must add it to part one and part two.
////////////////////////////////////////////////////////////////////////////////////////////////////

// Part 1
$vbulletin->input->clean_array_gpc('p', array(
'FirstNameAnswer' => TYPE_STR,
'LastNameAnswer' => TYPE_STR,
'AddressAnswer' => TYPE_STR,
'CityAnswer' => TYPE_STR,
'StateAnswer' => TYPE_STR,
'ZipcodeAnswer' => TYPE_STR,
'DOBAnswer' => TYPE_STR,
'PrimaryPhoneNumberAnswer' => TYPE_STR,
'SecondaryPhoneNumberAnswer' => TYPE_STR,
'ValidLicenseAnswer' => TYPE_STR,
'NotValidLicenseAnswer' => TYPE_STR,
'EmailAddressAnswer' => TYPE_STR,
'NewsletterSignupAnswer' => TYPE_STR,
'LicenseNumberAnswer' => TYPE_STR,
'AccidentInvolvedAnswer' => TYPE_STR,
'CriminalRecordAnswer' => TYPE_STR,
'OneTicketOnStopAnswer' => TYPE_STR,
'TicketNumberAnswer' => TYPE_STR,
'Charges1Answer' => TYPE_STR,
'Charges2Answer' => TYPE_STR,
'Charges3Answer' => TYPE_STR,
'Charges4Answer' => TYPE_STR,
'ViolationCode1Answer' => TYPE_STR,
'ViolationCode2Answer' => TYPE_STR,
'ViolationCode3Answer' => TYPE_STR,
'ViolationCode4Answer' => TYPE_STR,
'CourtToAppearInAnswer' => TYPE_STR,
'AppearanceDateAnswer' => TYPE_STR,
'AppearanceTimeAnswer' => TYPE_STR,
'HowHeardAboutUsAnswer' => TYPE_STR
));

// Part 2
$FirstNameAnswer = $vbulletin->GPC['FirstNameAnswer'];
$LastNameAnswer = $vbulletin->GPC['LastNameAnswer'];
$AddressAnswer = $vbulletin->GPC['AddressAnswer'];
$CityAnswer = $vbulletin->GPC['CityAnswer'];
$StateAnswer = $vbulletin->GPC['StateAnswer'];
$ZipcodeAnswer = $vbulletin->GPC['ZipcodeAnswer'];
$DOBAnswer = $vbulletin->GPC['DOBAnswer'];
$PrimaryPhoneNumberAnswer = $vbulletin->GPC['PrimaryPhoneNumberAnswer'];
$SecondaryPhoneNumberAnswer = $vbulletin->GPC['SecondaryPhoneNumberAnswer'];
$ValidLicenseAnswer = $vbulletin->GPC['ValidLicenseAnswer'];
$NotValidLicenseAnswer = $vbulletin->GPC['NotValidLicenseAnswer'];
$EmailAddressAnswer = $vbulletin->GPC['EmailAddressAnswer'];
$NewsletterSignupAnswer = $vbulletin->GPC['NewsletterSignupAnswer'];
$LicenseNumberAnswer = $vbulletin->GPC['LicenseNumberAnswer'];
$AccidentInvolvedAnswer = $vbulletin->GPC['AccidentInvolvedAnswer'];
$CriminalRecordAnswer = $vbulletin->GPC['CriminalRecordAnswer'];
$OneTicketOnStopAnswer = $vbulletin->GPC['OneTicketOnStopAnswer'];
$TicketNumberAnswer = $vbulletin->GPC['TicketNumberAnswer'];
$Charges1Answer = $vbulletin->GPC['Charges1Answer'];
$Charges2Answer = $vbulletin->GPC['Charges2Answer'];
$Charges3Answer = $vbulletin->GPC['Charges3Answer'];
$Charges4Answer = $vbulletin->GPC['Charges4Answer'];
$ViolationCode1Answer = $vbulletin->GPC['ViolationCode1Answer'];
$ViolationCode2Answer = $vbulletin->GPC['ViolationCode2Answer'];
$ViolationCode3Answer = $vbulletin->GPC['ViolationCode3Answer'];
$ViolationCode4Answer = $vbulletin->GPC['ViolationCode4Answer'];
$CourtToAppearInAnswer = $vbulletin->GPC['CourtToAppearInAnswer'];
$AppearanceDateAnswer = $vbulletin->GPC['AppearanceDateAnswer'];
$AppearanceTimeAnswer = $vbulletin->GPC['AppearanceTimeAnswer'];
$HowHeardAboutUsAnswer = $vbulletin->GPC['HowHeardAboutUsAnswer'];

////////////////////////////////////////////////////////////////////////////////////////////////////
//USERGROUPS ALLOWED
//You can add or remove usegroups that are ALLOWED to use this form by changing the numbers below in the array.
//To enable this feature, remove the '//' before the 'if'.
////////////////////////////////////////////////////////////////////////////////////////////////////

// if (!in_array($vbulletin->userinfo['usergroupid'], array(2,5,6,7)))print_no_permission();

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//NAME OF TEMPLATES - DO THIS BIT IF YOU ARE MAKING MORE FORMS AND WANT TO USE A DIFFERENT LOOKING TEMPLATE
////////////////////////////////////////////////////////////////////////////////////////////////////

// Name of the main template
$maintemplate = "form";
// Name of the answer template
$answertemplate = "formanswers";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//CHOOSE WHETHER YOU WANT FORM TO BE POSTED IN A NEW THREAD, NEW POLL, REPLY TO EXISITING THREAD, PMed OR EMAILED
///////////////////////////////////////////////////////////////////////////////////////////////////

//ENABLE FORM TO BE POSTED - 1 = yes, 0 = no
$formforum = "0";

//FORUM TO POST NEW THREAD IN
//You CAN make this number a variable. You can have a drop down menu or in the link like do=form&f=1. Make sure you add it the variables list.
$formforumid = "2";

//ENABLE POLL TO BE CREATED - 1 = yes, 0 = no
$formpoll = "0";
$polloption[1] = "Yes";
$polloption[2] = "No";
$polloption[3] = "Maybe";

//Make poll public - 1 = yes, 0 = no
$pollpublic = "0";

////////////////////////////////////////////////////////////////////////////////////////////////////

//ENABLE FORM TO REPLY TO EXISTING THREAD - 1 = yes, 0 = no
$formreply = "0";

//EXISTING THREAD ID FOR FORM TO REPLY IN
$formreplythreadid = "12345";

////////////////////////////////////////////////////////////////////////////////////////////////////

//ENABLE FORM TO BE PMED (guests CANNOT use this option) - 1 = yes, 0 = no
$formpm = "0";

//USERNAME TO PM TO (separate multiple usernames with a ';')
$formpmname = "ticketdoctor";

////////////////////////////////////////////////////////////////////////////////////////////////////

//ENABLE FORM TO BE EMAILED - 1 = yes, 0 = no
$formemail = "1";

//EMAIL ADDRESS TO EMAIL TO (separate multiple usernames with a ';')
$formemailaddress = "computerguy@ticketdoctor.net";

////////////////////////////////////////////////////////////////////////////////////////////////////

//ENABLE ATTACHMENTS - 1 = yes, 0 = no
//attachments can only be used if the form is going to make a new thread or post
$allow_attachments = "0";

////////////////////////////////////////////////////////////////////////////////////////////////////



////////////////////////////////////////////////////////////////////////////////////////////////////
//REDIRECT OPTIONS:
// 0 - thank you message (thread, reply, pm, or email)
// 1 - redirect to post (thread or reply)
// 2 - redirect to thread (thread only)
// 3 - redirect to forum (thread only)
// 4 - redirect to editpost (thread or reply)
//
// Feel free to change the thank you message if you choose option 0
////////////////////////////////////////////////////////////////////////////////////////////////////

$redirectoption = "0";
//This is the thank you message
$errormessage = "Thank you for submitting your ticket! Someone from our office will contact you shortly.";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//FORCE USER TO ANSWER ALL QUESTIONS - 1 = yes, 0 = no
//If you added or deleted variables, you must edit what it checked for. Search for "$answerall ==" and edit 2 lines under it.
////////////////////////////////////////////////////////////////////////////////////////////////////

$answerall = "0";

////////////////////////////////////////////////////////////////////////////////////////////////////
//TITLE OF FORM (do not use quotation marks or you will get a parse error, besides the quotes around the whole title)
////////////////////////////////////////////////////////////////////////////////////////////////////

$formtitle = "Ticket Submission Form";

////////////////////////////////////////////////////////////////////////////////////////////////////
//TITLE OF THREAD/POST/PM/EMAIL (do not use quotation marks in the title or you will get a parse error)
//You may use variables from the form for this.
////////////////////////////////////////////////////////////////////////////////////////////////////

$posttitle = "$formtitle";

////////////////////////////////////////////////////////////////////////////////////////////////////
//PURPOSE OF FORM (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
////////////////////////////////////////////////////////////////////////////////////////////////////

$formpurpose = "Use this form to submit your ticket information. If you submit it during normal business hours we will contact you within 30 minutes.";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 1 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
////////////////////////////////////////////////////////////////////////////////////////////////////

$FName = "First Name:";
$LName = "Last Name:";
$MAddress = "Mailing Address:";
$City = "City:";
$State = "State:";
$ZipCode = "Zip Code:";
$DOB = "Date of Birth:";
$PrimaryPhoneNumber = "What is your primary phone number?";
$SecondaryPhoneNumber = "Please provide a second phone number where we can reach you.";
$ValidLicense = "Do you have a Valid NY State License?";
$EmailAddress = "Email Address:";
$LicenseNumber= "What is your 9 digit license number? (located on top of your Drivers License).";
$TicketNumber = "What is your ticket number (located in the upper left corner of ticket in bold, can be a letter-number combination:";
$Charges = "What are your charges? (Speeding, Passed Stop Sign, etc):";
$SectionSub = "What is the Section-Subsection code of your charge? (located above charge description, usually 4 digits and a letter)";
$CourtToAppearIn = "What Court do you need to appear in?:";
$AppearanceDate = "What is your appearance date?:";
$AppearanceTime = "What is your appearance time?:";
$HowHeardAboutUs = "How did you hear about us?:";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 1 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
////////////////////////////////////////////////////////////////////////////////////////////////////

$NewsLetterSignup = "Would you like to sign up for our future Newsletter?";

// The following choices must NOT have quotation marks
$NewsLetterSignupChoicea = "Yes";
$NewsletterSignupChoiceb = "No";

$AccidentInvolved = "Was there an accident involved?";

$AccidentInvolvedChoicea = "Yes";
$AccidentInvolvedChoiceb = "No";

$OneTicketOnStop = "Did you only receive this ONE ticket on THIS stop?";

$OneTicketOnStopChoicea = "Yes";
$OneTicketOnStopChoiceb = "No";

$CriminalRecord = "Do you have a criminal record?";

$CriminalRecordChoicea = "Yes";
$CriminalRecordChoiceb = "No";

////////////////////////////////////////////////////////////////////////////////////////////////////
////// END OF CUSTOMIZATION ////////////////////////////////////////////////////////////////////
any ideas? Line 71 in newthread is eval..and the normal stuff doesn't go to line 608?


any help is mucho appreciated..thanks!
Reply With Quote
  #468  
Old 05-17-2007, 03:01 AM
ComputerVitals ComputerVitals is offline
 
Join Date: Oct 2005
Posts: 131
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

did you modify the lower part of the hook?
If you did, look there for line 608, looks like an extra curly is there.
If you need a free text editor with line numbers try winsyntax
Reply With Quote
  #469  
Old 05-17-2007, 04:44 AM
JTMON's Avatar
JTMON JTMON is offline
 
Join Date: Oct 2001
Posts: 279
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I even checked it with araxis merge and found no difference other than variables..maybe it's in the template?
Reply With Quote
  #470  
Old 05-17-2007, 02:14 PM
samual samual is offline
 
Join Date: Apr 2007
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I added an extra raido button to this form but it is showing up on the right side of the page. What do I need to do to move it back to the other side?
Reply With Quote
  #471  
Old 05-17-2007, 05:17 PM
JTMON's Avatar
JTMON JTMON is offline
 
Join Date: Oct 2001
Posts: 279
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I found out my problem, I had chopped off the little bit of code above the variables.

Samual..you need to edit the "form" template.
Reply With Quote
Reply

Thread Tools

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 06:11 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.11006 seconds
  • Memory Usage 2,352KB
  • 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
  • (2)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
  • (3)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