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
  #152  
Old 10-24-2006, 02:24 PM
ctrl-alt-del ctrl-alt-del is offline
 
Join Date: Jul 2006
Posts: 54
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can someone explain this statement?

Code:
if condition="$dropdownchoice2d == $dropdownanswer2">selected="selected"</if>
In the context of:
Code:
<option value="$dropdownchoice2d" <if condition="$dropdownchoice2d == $dropdownanswer2">selected="selected"</if>>$dropdownchoice2d</option>
Reply With Quote
  #153  
Old 10-24-2006, 10:12 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 ctrl-alt-del
Can someone explain this statement?

Code:
if condition="$dropdownchoice2d == $dropdownanswer2">selected="selected"</if>
In the context of:
Code:
<option value="$dropdownchoice2d" <if condition="$dropdownchoice2d == $dropdownanswer2">selected="selected"</if>>$dropdownchoice2d</option>
This 'if' statement is there so the preview can work good. If it's selected when you click 'preview', it will also be selected.
Reply With Quote
  #154  
Old 10-25-2006, 03:07 PM
SeQual SeQual is offline
 
Join Date: Dec 2004
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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


Instead of putting
$formpmname = "user1;user2;user3";

I wanne put a variable in there
$formpmname = "$pmmembers";

But the people in the variable don't get a pm, only works if I put the usernames in manually.

The variable is correct tho, when I show variable in the form itself (form from newthread_start) it shows the usernames.

Members this will get pm'd to: SeQual;user1;user2

(SeQual;user1;user2 is in variable $pmmembers)

any idea's?
Reply With Quote
  #155  
Old 10-26-2006, 03:00 PM
pirotess pirotess is offline
 
Join Date: May 2002
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Abe I could really use a hand here, Im going nuts trying to figure this out.

Im using this mod to post a form to my forums and it works great with no issues. However I recently decided it would be nice if the form created a second thread/post in a different forum. I made the following modifications to the original plugin. Essentially I just duplicated all the variables and code used in the default plugin responsible for creating the post which I know works and modified a few variables. With all my modifications the original code continues to work but the duplicated code refuses to post in the second forum. I cant understand why since its exactly the same code. Any thoughts?

Code:
// Name of the main template
$maintemplate = "wow_appform";
// Name of the answer template
$answertemplate = "wow_apppostcandidate";
// Name of template to be posted to journal forum
$journaltemplate = "wow_apppostjournal";
Code:
//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 = "141";
$journalforumid = "140";
Code:
////////////////////////////////////////////////////////////////////////////////////////////////////
//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 = "$bbuserinfo[username] Recruitment Application";
$journaltitle = "$bbuserinfo[username] Journal";
Code:
    eval('$formsend = "' . fetch_template("$answertemplate") . '";');
    eval('$journalsend = "' . fetch_template("$journaltemplate") . '";');
Code:
        if ($formforum == "1")
        {
            $foruminfo = verify_id('forum', $formforumid, 0, 1);
            $forumperms = fetch_permissions($foruminfo[forumid]);
            $newpost['username'] =& $vbulletin->userinfo['username'];
            $newpost['message'] =& $formsend;
            $newpost['title'] =& $posttitle;
            $newpost['parseurl'] = '1';
            $newpost['poststarttime'] = $poststarttime;
            $newpost['posthash'] = $posthash;

            if ($vbulletin->userinfo['autosubscribe'] != -1)
            {
                $newpost['emailupdate'] = $vbulletin->userinfo['autosubscribe'];
            }
            else
            {
                $newpost['emailupdate'] = 9999;
            }

            if ($vbulletin->userinfo['signature'] != '')
            {
                $newpost['signature'] = '1';
            }
            else
            {
                $newpost['signature'] = '0';
            }

            build_new_post('thread', $foruminfo, array(), array(), $newpost, $errors);

            $foruminfo = verify_id('forum', $journalforumid, 0, 1);
            $forumperms = fetch_permissions($foruminfo[forumid]);
            $newpost['username'] =& $vbulletin->userinfo['username'];
            $newpost['message'] =& $journalsend;
            $newpost['title'] =& $journaltitle;
            $newpost['parseurl'] = '1';
            $newpost['poststarttime'] = $poststarttime;
            $newpost['posthash'] = $posthash;

            if ($vbulletin->userinfo['autosubscribe'] != -1)
            {
                $newpost['emailupdate'] = $vbulletin->userinfo['autosubscribe'];
            }
            else
            {
                $newpost['emailupdate'] = 9999;
            }

            if ($vbulletin->userinfo['signature'] != '')
            {
                $newpost['signature'] = '1';
            }
            else
            {
                $newpost['signature'] = '0';
            }

            build_new_post('thread', $foruminfo, array(), array(), $newpost, $errors);

        }
Reply With Quote
  #156  
Old 10-26-2006, 03:14 PM
pirotess pirotess is offline
 
Join Date: May 2002
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well wouldnt you know it. After fighting with things for 4 hours, I figured out the problem about 5 minutes after I posted here for help. I had my minimum time between posts option set to 15 which was bouncing the second post. Disabling that option let both posts go through.
Reply With Quote
  #157  
Old 10-26-2006, 03:19 PM
ctrl-alt-del ctrl-alt-del is offline
 
Join Date: Jul 2006
Posts: 54
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

My question happens to be basic PHP/HTML, but since I'm not a developer, I can't figure out the issue.

I'm trying to associate values (numeric) based on a selection of a dropdown. The numeric variable is associated to a thread ID wherease the dropdown selection is a recognizable name.

Here's the default code:
Code:
<select name="dropdownanswer1">
<option value="$dropdownchoice1a" <if condition="$dropdownchoice1a == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1a</option>
</select>
I need to change it to something like:
Code:
<option value="$dropdownthreadID" <if condition="$dropdownchoice1a == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1a</option>
Where:
$dropdownthreadID = 100
$dropdownchoice1a = Monday

These variables are called within a newthread_start plugin.
Code:
//EXISTING THREAD ID FOR FORM TO REPLY IN
$formreplythreadid = "$dropdownanswer1";
Here's the problem: I can't seem to figure out how to call the named variable (Monday) when the form is submitted. Instead, I get the numerical value. Perhaps it's just a simple IF statement I need to add that writes Monday into another variable. However, I can't seem to figure it out.

Any help would be appreciated!
Reply With Quote
  #158  
Old 10-28-2006, 02:26 AM
hal05 hal05 is offline
 
Join Date: Aug 2005
Location: Mid-Michigan
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great mod! I change some variable and put my own html over it and it works wonders!
Reply With Quote
  #159  
Old 10-30-2006, 03:24 PM
ctrl-alt-del ctrl-alt-del is offline
 
Join Date: Jul 2006
Posts: 54
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is it possible to insert an IF statement in the Answers form? If so, please tell me how.
Reply With Quote
  #160  
Old 10-30-2006, 10:35 PM
hal05 hal05 is offline
 
Join Date: Aug 2005
Location: Mid-Michigan
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone know how I can pass some of the variables into the thread title?
Reply With Quote
  #161  
Old 10-31-2006, 01:46 AM
TenPercenter's Avatar
TenPercenter TenPercenter is offline
 
Join Date: Sep 2005
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<a href="http://www.chiptalk.net/forum/newthread.php?do=poker_article_submit" target="_blank">Installed</a>! Great hack.

Can I prepopulate any elements? I'd particularly like to pre-populate the vb text area input box. I want to put a template in there, so taht users format article submissions correctly.
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 10: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.05188 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
  • (12)bbcode_code
  • (1)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