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
  #302  
Old 02-17-2007, 11:36 AM
RedGTiVR6 RedGTiVR6 is offline
 
Join Date: Dec 2006
Location: Little Elm, TX
Posts: 817
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've used the search feature that's built into the AdminCP to search all templates.

I've searched for the following in all templates:

applyanswers
begin template
end template
<!-- BEGIN TEMPLATE: applyanswers -->
<!-- END TEMPLATE: applyanswers -->

Nothing comes up.

That's searching through all of the templates and all of the styles.

I was getting these lines even before I modified the hack. I installed it and immediately tested it.
Reply With Quote
  #303  
Old 02-17-2007, 01:34 PM
thalamus's Avatar
thalamus thalamus is offline
 
Join Date: Sep 2005
Location: UK
Posts: 66
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by thalamus View Post
I can't see anywhere the issue of these forms going into the moderation queue being resolved, or even a pointer as to why this happens when the forum and usergourp permissions have been set accordingly.
OK, I finally managed a workaround to this problem (if you can call it that)... basically, I copied the build_new_post function into a separate file (for instance, includes/functions_formhack.php) and renamed the function to build_newform_post. I then commented out the relevant forum permission settings to avoid the post going into the moderation queue, then in the formhack plugin, within the "if ($_REQUEST['action'] == "submit")" braces I included a "require_once" of the functions file. The call to build the new post then went to build_newform_post. Seems to work fine...
Reply With Quote
  #304  
Old 02-18-2007, 12:36 PM
Kiint Kiint is offline
 
Join Date: Nov 2006
Posts: 191
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by RedGTiVR6 View Post
I've used the search feature that's built into the AdminCP to search all templates.

I've searched for the following in all templates:

applyanswers
begin template
end template
<!-- BEGIN TEMPLATE: applyanswers -->
<!-- END TEMPLATE: applyanswers -->

Nothing comes up.

That's searching through all of the templates and all of the styles.

I was getting these lines even before I modified the hack. I installed it and immediately tested it.
I've found the solution, and if you are anything like me you are going to kick yourself....

Quote:
If you have the option "Add Template Name in HTML Comments" in the General Settings set to YES you get the template info in PM and emails:

<!-- BEGIN TEMPLATE: warn_pm_alert -->
Taken from this post https://vborg.vbsupport.ru/showthrea...TE#post1150078

Right, off to headbutt the wall a few times....
Reply With Quote
  #305  
Old 02-18-2007, 03:06 PM
alternity alternity is offline
 
Join Date: Nov 2006
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I cannot get a form I've created to show up. When I try to access it vB gives me the following error:
Code:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/www/web2/web/newthread.php(71) : eval()'d code on line 39
And says "Invalid Forum specified. If you followed a valid link, please notify the administrator".

I've looked over my code but I can't figure out what is wrong for the life of me. Any help would be extremely appreciated .

EDIT: Found the error! I didn't put a comma after declaring one of my datatypes. I've corrected the code below to show that. However, now I have a different error message and still says the Invalid Forum specified error. The new error seems to be coming from the script part, which doesn't make sense because I haven't touched it at all. Here's the error:
Code:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/www/web2/web/newthread.php(71) : eval()'d code on line 278
Code:
// To add more then one form, copy this whole text, and creat a new plug-in with the hook location 'newthread_start'.
// After, change the form name. You can't have 2 forms with the same name.

// Name of this form
$formname = "form";

if ($_REQUEST['do'] == $formname)
{

// #######################################################################
// ######################## 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(
'radioanswer1' => TYPE_STR,
'radioanswer2' => TYPE_STR,
'radioanswer3' => TYPE_STR,
'radioanswer4' => TYPE_STR,
'radioanswer5' => TYPE_STR,
'radioanswer6' => TYPE_STR,
'radioanswer7' => TYPE_STR,
'radioanswer8' => TYPE_STR,
'answer1' => TYPE_STR,
'answer2' => TYPE_STR,
'answer3' => TYPE_STR,
'answer4' => TYPE_STR,
'answer5' => TYPE_STR,
'longanswer1' => TYPE_STR,
'longanswer2' => TYPE_STR,
'longanswer3' => TYPE_STR,
'longanswer4' => TYPE_STR,
'longanswer5' => TYPE_STR,
'longanswer6' => TYPE_STR
));

// Part 2
$radioanswer1 = $vbulletin->GPC['radioanswer1'];
$radioanswer2 = $vbulletin->GPC['radioanswer2'];
$radioanswer3 = $vbulletin->GPC['radioanswer3'];
$radioanswer4 = $vbulletin->GPC['radioanswer4'];
$radioanswer5 = $vbulletin->GPC['radioanswer5'];
$radioanswer6 = $vbulletin->GPC['radioanswer6'];
$radioanswer7 = $vbulletin->GPC['radioanswer7'];
$radioanswer8 = $vbulletin->GPC['radioanswer8'];
$answer1 = $vbulletin->GPC['answer1'];
$answer2 = $vbulletin->GPC['answer2'];
$answer3 = $vbulletin->GPC['answer3'];
$answer4 = $vbulletin->GPC['answer4'];
$answer5 = $vbulletin->GPC['answer5'];
$longanswer1 = $vbulletin->GPC['longanswer1'];
$longanswer2 = $vbulletin->GPC['longanswer2'];
$longanswer3 = $vbulletin->GPC['longanswer3'];
$longanswer4 = $vbulletin->GPC['longanswer4'];
$longanswer5 = $vbulletin->GPC['longanswer5'];
$longanswer6 = $vbulletin->GPC['longanswer6'];

////////////////////////////////////////////////////////////////////////////////////////////////////
//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,6))) 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 = "memberappcss";
// Name of the answer template
$answertemplate = "memberappcssanswers";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//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 = "1";

//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 = "24";

//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 = "Abe";

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

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

//EMAIL ADDRESS TO EMAIL TO (separate multiple usernames with a ';')
$formemailaddress = "youremail@yourforums.com";

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

//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 = "2";

$errormessage = "Thank you for submitting this form!"; //This is the thank you message

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//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 = "Application";

////////////////////////////////////////////////////////////////////////////////////////////////////
//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 = "Test";

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

$formpurpose = "If you wish to join The Legion's Counter-Strike Source Division you will need to fill out this application as completely as possible.  Once you have finished this form you will be redirected to the post, where you will need to wait for your sponsor to post his approval, at which point you will be added to The Legion's member list!";

$question1 = "What is your screen name:";
$explain1 = "Please enter your screen name here.";

$question2 = "What is your real name:";
$explain2 = "Please enter your real name here, this is optional and you don't need to answer if you would prefer not to.";

$question3 = "Who was your recruiter/how did you find us:";
$explain3 = "Please enter the name of the person who recruited you here or if you found us someplace else please tell us where.";

$question4 = "What is your age:";
$explain4 = "Please specify your age.  The Legion does not discriminate in any way based on your age and if your uncomforable giving this information than you don't need to.";

$question5 = "What is your xFire screen name:";
$explain5 = "Please tell us your xFire screen name.  If you do not have xFire is is extremely advised that you get it, as The Legion uses xFire for clan communication and to help judge how active members are.";

$longquestion1 = "What clan experiance do you have:";
$longexplain1 = "Please tell us about what clan's you've been in, how long you were a member, what positions you held, etc.  Feel free to be as detailed as you want.";

$longquestion2 = "What gaming experiance do you have:";
$longexplain2 = "Please tell us what games you have played over the years and your experience in them, and also what games you are currently playing.";

$longquestion3 = "What leadership positions have you held:";
$longexplain3 = "Please tell us about any leadership positions you've had and what your responsibilities were.  This can be anywhere, in a clan, at school, in a club, at work, etc.";

$longquestion4 = "Why do you want to join The Legion:";
$longexplain4 = "Please tell us why you wish to join The Legion.";

$radioquestion1 = "What kind of gamer do you consider yourself to be:";

$radiochoice1a = "Occasional gamer, I game a few times each week.";
$radiochoice1b = "Weekend warrior, I'm too busy to play during the week.";
$radiochoice1c = "Fulltime gamer, I play every day as much as possible.";

$radioquestion2 = "What is your internet speed:";

$radiochoice2a = "Dialup";
$radiochoice2b = "DSL/Cable";
$radiochoice2c = "T1/ISDN or Faster";

//////////// Division Specific Questions //////////

$longquestion5 = "What hours are you available for game play:";
$longexplain5 = "Please tell us  during which hours of the week are you usually avaliable for gaming?";

$longquestion6 = "What is your preferred weapons combination:";
$longexplain6 = "Please tell us what weapons you prefer to use when playing Counter-Strike Source.";

$radioquestion3 = "You must have a Microphone. Do you currently have one?:";

$radiochoice3a = "yes";
$radiochoice3b = "no";

$radioquestion4 = "You must have X-Fire. Do you currently have it?:";

$radiochoice4a = "yes";
$radiochoice4b = "no";

$radioquestion5 = "You must have Ventrilo. Do you currently have it?:";

$radiochoice5a = "yes";
$radiochoice5b = "no";

$radioquestion6 = "Do you understand that you will be required to attend practices:";

$radiochoice6a = "yes";
$radiochoice6b = "no";

$radioquestion7 = "Are you aware that we have a Code of Conduct?:";

$radiochoice7a = "yes";
$radiochoice7b = "no";

$radioquestion8 = "Have you read our Code of Conduct and agreed to it?:";

$radiochoice8a = "yes";
$radiochoice8b = "no";

$vbtextquestion = "Is there anything else you'd like to add?:";
$vbtextexplain = "If you have any other information you would like us to know please tell us here.";

////////////////////////////////////////////////////////////////////////////////////////////////
////// END OF CUSTOMIZATION ////////////////////////////////////////////////////////////////////

....
Reply With Quote
  #306  
Old 02-18-2007, 05:45 PM
blind-eddie's Avatar
blind-eddie blind-eddie is offline
 
Join Date: Apr 2006
Location: Michigan
Posts: 2,310
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I see some of your problem, Find all instances of ?:";
get rid of :
That will stop some if not all errors.

EDIT: I also deleted all :....didnt work...Give me a min....



THis is line 278 $_REQUEST['action'] = "form";

It must say stay the same
Reply With Quote
  #307  
Old 02-18-2007, 07:01 PM
Abe1's Avatar
Abe1 Abe1 is offline
 
Join Date: Feb 2004
Location: I LOVE New York!
Posts: 2,886
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Kiint View Post
Anyone have an answer to this problem?
Disable the option in your vb main settings not to show the template name.
Reply With Quote
  #308  
Old 02-19-2007, 09:42 AM
mrgrimes's Avatar
mrgrimes mrgrimes is offline
 
Join Date: Mar 2006
Location: Birmingham, UK
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by |oR|Greg View Post
Important FYI - If you have "Guest Post Image Verification" turned on, posting to a thread will not work because the form hack doesn't integrate the Image Verification system.
This is proving a major pain for me. My forms need to be able to post to threads, but with 'Guest Post Image Verification' turned off I get ENORMOUS amounts of spam. Any suggestions as to how I could combat this?
Reply With Quote
  #309  
Old 02-19-2007, 01:21 PM
blind-eddie's Avatar
blind-eddie blind-eddie is offline
 
Join Date: Apr 2006
Location: Michigan
Posts: 2,310
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, dont allow guest to post. Set usergroup setting for guest, not to be able to post. Make them register.
Reply With Quote
  #310  
Old 02-19-2007, 05:18 PM
Silverstangs Silverstangs is offline
 
Join Date: Nov 2003
Location: Roseville Sacramento CA
Posts: 93
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Form installed and works fine... I'll be using it for Feedback uses.
Reply With Quote
  #311  
Old 02-19-2007, 10:54 PM
RedGTiVR6 RedGTiVR6 is offline
 
Join Date: Dec 2006
Location: Little Elm, TX
Posts: 817
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Kiint View Post
I've found the solution...
SWEET! Thanks a million!

I didn't even know that was an option to set!

All fixed now!

Now I'm going to move on to making the 'New Thread' button in the forums where the forms will be posted, lead directly to the form, instead of a new thread.
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 06:59 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.05443 seconds
  • Memory Usage 2,354KB
  • 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
  • (3)bbcode_code
  • (6)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