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
  #402  
Old 04-11-2007, 11:45 AM
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 rayw View Post
I'm trying to modify this form a little bit so that I have a drop down box with a list of 2-3 forums that users can choose to post the information too. I'm not an experienced programmer so I'm having a little trouble getting this working.

Would anyone be willing to post exactly what needs to be modified for this to work correctly?

THanks!

Next goto MAIN Template and adddddddd that new dropdown there also...>>>
Use your own code or template code to add...
3 dropdowns below in code

HTML Code:
<TABLE width="100%"><TR>
  <TD class="radio_button_question question" colspan="4">
<B>* </B>
$dropdownquestion4 
</TD>
</TR>
<TR><TD class="radio_button_answer" ><table cellspacing="0" cellpadding="0"><tr><td class="radio_button_answer">
<!--DROP_DOWN_TYPE --><select name="dropdownanswer4" class="radio_button">
<option value="$dropdownchoice4a" <if condition="$dropdownchoice4a == $dropdownanswer4">selected="selected"</if>>$dropdownchoice4a</option>
<option value="$dropdownchoice4b" <if condition="$dropdownchoice3b == $dropdownanswer4">selected="selected"</if>>$dropdownchoice4b</option>
<option value="$dropdownchoice4c" <if condition="$dropdownchoice4c == $dropdownanswer4">selected="selected"</if>>$dropdownchoice4c</option>
</SELECT>
</td></tr></table></TD></TR></TABLE>
<p></p>
<div align="center">
<tr>
<td class="alt2" valign="middle" colspan="3">
<b>$vbtextquestion</b><br />
$vbtextexplain
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
$messagearea
</td>
</tr>
</table>
</div>
</td>
</tr>
<if condition="$attachmentoption">
<tr>
<td class="alt1" colspan="3" align="center">
<div style="width:$stylevar[formwidth]" align="$stylevar[left]">$attachmentoption</div>
</td>
</tr>
</if>
<tr>
<td valign="top" colspan="3">
<p align="center">
<input type="submit" value="Submit" name="submit" style="font-family: Verdana; font-size: 10pt" class="button" />
<input type="submit" value="Preview" name="submit" style="font-family: Verdana; font-size: 10pt" class="button" />
<input type="reset" value="Reset" name="reset" style="font-family: Verdana; font-size: 10pt" class="button" />
</p></td></tr>
</table>

</form>

$footer
</body>
</html>
Reply With Quote
  #403  
Old 04-11-2007, 11:50 AM
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 rayw View Post
I'm trying to modify this form a little bit so that I have a drop down box with a list of 2-3 forums that users can choose to post the information too. I'm not an experienced programmer so I'm having a little trouble getting this working.

Would anyone be willing to post exactly what needs to be modified for this to work correctly?

THanks!
Add to plugin code with NEW dropdown...
Add to proper location...
'dropdownanswer4' => TYPE_STR,
$dropdownanswer4 = $vbulletin->GPC['dropdownanswer4];


HTML Code:
// Part 1
$vbulletin->input->clean_array_gpc('p', array(
'answer1' => TYPE_STR,
'answer2' => TYPE_STR,
'radioanswer1' => TYPE_STR,
'radioanswer2' => TYPE_STR,
'radioanswer3' => TYPE_STR,
'radioanswer4' => TYPE_STR,
'radioanswer5' => TYPE_STR,
'radioanswer6' => TYPE_STR,
'radioanswer7' => TYPE_STR,
'dropdownanswer1' => TYPE_STR,
'dropdownanswer2' => TYPE_STR,
'answer3' => TYPE_STR,
'radioanswer8' => TYPE_STR,
'radioanswer9' => TYPE_STR,
'radioanswer10' => TYPE_STR,
'radioanswer11' => TYPE_STR,
'answer4' => TYPE_STR,
'dropdownanswer1' => TYPE_STR,
'answer5' => TYPE_STR,
'answer6' => TYPE_STR,
));

// Part 2
$answer1 = $vbulletin->GPC['answer1'];
$answer2 = $vbulletin->GPC['answer2'];
$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'];
$dropdownanswer1 = $vbulletin->GPC['dropdownanswer1'];
$dropdownanswer2 = $vbulletin->GPC['dropdownanswer2'];
$answer3 = $vbulletin->GPC['answer3'];
$radioanswer8 = $vbulletin->GPC['radioanswer8'];
$radioanswer9 = $vbulletin->GPC['radioanswer9'];
$radioanswer10 = $vbulletin->GPC['radioanswer10'];
$radioanswer11 = $vbulletin->GPC['radioanswer11'];
$answer4 = $vbulletin->GPC['answer4'];
$dropdownanswer3 = $vbulletin->GPC['dropdownanswer3'];
$answer5 = $vbulletin->GPC['answer5'];
$answer6 = $vbulletin->GPC['answer6'];

Lower Plugin code area...> questions...>

HTML Code:
////////////////////////////////////////////////////////////////////////////////////////////////////
//DROP DOWN CHOICES : QUESTION 4 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
////////////////////////////////////////////////////////////////////////////////////////////////////

$dropdownquestion4 = "Which forum to post to question here...<<<";

// The following choices must NOT have quotation marks
$dropdownchoice4a = "MLB";
$dropdownchoice4b = "NFL";
$dropdownchoice4c = "NBA";

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

Good Luck
Reply With Quote
  #404  
Old 04-11-2007, 12:23 PM
rayw rayw is offline
 
Join Date: Mar 2007
Location: Australia
Posts: 171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks a lot for taking the time to explain that Deepdog009, but I don't think it answers my question (if it does, then I don't understand it).

For example, say you wanted a form to post news in your forum. There are 3 different forums which represent the catergories the for news. They are Sport, Weather and Other - each of which are different forums.

Basically, depending on what you select in the drop down box will determine which forum the news is posted in to.

I hope that makes more sense.

Reply With Quote
  #405  
Old 04-12-2007, 02:03 AM
Deepdog009's Avatar
Deepdog009 Deepdog009 is offline
 
Join Date: Dec 2004
Location: Almost out of PHP TZone
Posts: 485
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

RayW what you be asking requires some code modifications. Im good with CSS and HTML but at this time Im still reading and learning on PHP, Perl and Java.

ABE1 can help you better.

Take a peek in the earlier posts and maybe theres something there that might help U.

Good Luck
Reply With Quote
  #406  
Old 04-12-2007, 05:26 AM
rayw rayw is offline
 
Join Date: Mar 2007
Location: Australia
Posts: 171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No worries, thanks a lot.

Cheers!
Reply With Quote
  #407  
Old 04-12-2007, 07:29 AM
rayw rayw is offline
 
Join Date: Mar 2007
Location: Australia
Posts: 171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, I've been trying to nut this out based on what others have posted in the thread.

Basically, I want a drop down box which defines what forum the news will be posted too.

I have the following:

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.

if ($dropdownanswer1 == 'Hardware'){
$formforumid = "96";}
if ($dropdownanswer1 == 'Software'){
$formforumid = "99";}
Further down:
Code:
////////////////////////////////////////////////////////////////////////////////////////////////////
//DROP DOWN CHOICES : QUESTION 1 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
////////////////////////////////////////////////////////////////////////////////////////////////////

// The following choices must NOT have quotation marks

$newscatchoice1a = "Hardware";
$newscatchoice1b = "Software";
Template:
Code:
<select name="dropdownanswer1">
<option value="$newscatchoice1a" <if condition="$newscatchoice1a == $dropdownanswer1">selected="selected"</if>>$newscatchoice1a</option>
<option value="$newscatchoice1b" <if condition="$newscatchoice1b == $dropdownanswer1">selected="selected"</if>>$newscatchoice1b</option>
</select>
EDIT - THIS IS FIXED - SEE POST BELOW: When I submit the form using this, I get: Warning: Cannot use a scalar value as an array in /includes/functions_newpost.php on line 356

Could someone offer some advice. I'm assuming the problem lies in the above somewhere; maybe!!

THanks!
Reply With Quote
  #408  
Old 04-12-2007, 07:35 AM
rayw rayw is offline
 
Join Date: Mar 2007
Location: Australia
Posts: 171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

HEY!!!! I figured it out. I just noticed that <select name="dropdownforum1"> should be <select name="dropdownanswer1">.

I will post the finished product once I have fine tuned it.

EDIT: I've updated the code above so it should work fine now.
Reply With Quote
  #409  
Old 04-12-2007, 11:34 AM
Deepdog009's Avatar
Deepdog009 Deepdog009 is offline
 
Join Date: Dec 2004
Location: Almost out of PHP TZone
Posts: 485
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

U da Man RayW:up:

Yes please post your outcome when finished.

If statements seem easy until you place them. But eventually hard work and patience will prevail.

Cya
Reply With Quote
  #410  
Old 04-15-2007, 06:55 AM
VHLinks VHLinks is offline
 
Join Date: Jan 2005
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey guys, maybe I missed it, I also ran a search. Is there way to set this up so you can select a post icon, and not have it be blank when it posts the topic? I was trying to figure out a way to do it, but I kept breaking the code. Any ideas would be great. Thanks!
Reply With Quote
  #411  
Old 04-16-2007, 04:04 PM
upnorth upnorth is offline
 
Join Date: Jul 2003
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm looking for some guidance in formatting the answer template so that I can control the way the finished post looks. Is there any way to use conditionals in the answer template?

For example I have

$question1
$checkboxAnswer1_1
$checkboxAnswer1_2
$checkboxAnswer1_3

If only the first checkbox is selected on the form then the $checkboxAnswer1_2 and $checkboxAnswer1_3 put spaces in the final post. I'd like to do something like

if ($checkboxAnswer1_2==""){
echo "";
}
That way I can eliminate the spaces?

Any ideas?
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 03:57 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.05901 seconds
  • Memory Usage 2,347KB
  • 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
  • (3)bbcode_html
  • (2)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