Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
FORM to THREAD/ FORUM/ POLL/ PM/ EMAIL - CUSTOMIZABLE FORMS - Mod Apps, Orders, News. Details »»
FORM to THREAD/ FORUM/ POLL/ PM/ EMAIL - CUSTOMIZABLE FORMS - Mod Apps, Orders, News.
Version: 1.00, by Erwin Erwin is offline
Developer Last Online: May 2013 Show Printable Version Email this Page

Version: 3.0.3 Rating:
Released: 06-11-2004 Last Update: Never Installs: 214
 
No support by the author.

FORM to THREAD/ FORUM/ POLL/ PM/ EMAIL - Totally CUSTOMIZABLE FORMS
Version 1.6 for vBulletin 3.x.x by Dr Erwin Loh

Features:

Ever wanted an online form that a user can fill out, which when submitted gets:

1. Posted into a new thread in a forum of your choice
2. Create a new poll in the new thread with options of your choice
3. Posted as a reply in an existing thread of your choice
4. PMed to you or someone else
5. Emailed to an email address you specify
6. Choose to redirect to the post, thread or forum, or a custom thank you message
7. Choose to redirect to editpost to upload attachments

Or any combination or all of the above?

Well, this is the hack for you!

You can use this for:

1) Moderator Applications
2) Quiz Submit Form which gets PMed to a moderator
3) Contact Form that goes to PM, email or thread
4) Guests to apply to be members
5) Report a Moderator form that goes as a PM to you
6) Guests can PM you for whatever reason
7) Order form to buy things
8) Donation form
9) News or Articles submissions that can go straight to a thread


Or anything you like - this hack is totally customizable via the PHP file.
Basically, this hack involves modifying 1 PHP file form.php (you add questions, options etc. in the PHP file itself), uploading it, and then adding 2 templates.

The beauty of this hack is that once you have added the 2 templates, to make a new form, all you need to do is copy the form.php and rename it to form2.php, edit the variables in the PHP file, and you have a totally new form!!! You do not need to touch the templates again.

Format of the form:

1. One main input question
2. 2 Radio buttons Choice questions
3. 3 Normal text input questions
4. 1 Long answer question

This is customizable via the PHP file.

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:

1. Add the 2 templates.

2. Edit form.php - the instructions are all inside the PHP file itself, in the top half. Follow the instructions carefully!

3. Upload form.php

Just link to form1.php eg. http://www.yourforum.com/forums/form.php

Done!

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

Enjoy!


Updates:

Version 1.1 - Option to force user to answer all questions.
Version 1.2 - Thread count and lastposter information now updated if form is sent to existing thread.
Version 1.3 - ADDED CREATE POLL OPTION!
Version 1.4 - Fixed bug with Form-to-thread code
Version 1.5 - Major update:
- fixed bug where thread count not updated when form to forum
- fixed default posting to allow smilies and sigs when reply to thread
- added templates to cache (saves 2 queries)
- added option to change thank you message
- added options to redirect to post, thread or forum when submit
Version 1.6 - Choose to redirect to editpost to upload attachments

Screenshot is an example of a form - the form title and questions are customizable:

Show Your Support

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

Comments
  #107  
Old 07-20-2004, 10:21 PM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by bitg
Erwin, this is awesome. However, I am having a problem.

I modified the form.php and added a bunch of questions. I also removed the radio buttons as they were not needed.

However, my form now looks like this.

http://www.dungeonkeepersdomain.com/...st_a_forum.php

It has radion buttons at the top and does not have all my questions.

What did I do wrong?
Edit the form template and remove the radio buttons in it. I can't see the page as you've made the form for registered members only.
Reply With Quote
  #108  
Old 07-20-2004, 10:27 PM
Holidazed's Avatar
Holidazed Holidazed is offline
 
Join Date: May 2002
Location: Van Nuys, CA
Posts: 713
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, if the template needs modifying for this, does this mean I need to modify the template for each and every different form I make? Do I make new templates? What do I call them? How do I tell hte form to look to these templates instead of the old ones?
Reply With Quote
  #109  
Old 07-20-2004, 11:30 PM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by bitg
Well, if the template needs modifying for this, does this mean I need to modify the template for each and every different form I make? Do I make new templates? What do I call them? How do I tell hte form to look to these templates instead of the old ones?
If you don't modify the number of questions, you can use the same templates.

If you want to start changing the type and number of questions, you need to copy and rename the template, and change the template name in form.php - keep doing that for new forms, only if you modify those things.

It's not hard too work out - I've made this hack to be customizable - go forth and change it however you like.
Reply With Quote
  #110  
Old 07-21-2004, 04:58 PM
irishfreakout irishfreakout is offline
 
Join Date: Jul 2004
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just an idea for future versions (something i would fiind really useful!)

Add the ability to post to a text file for either all or part of the form.

For example, ithis would be used for collecting demographic information that is dumped into a text file then imported to Excel for analysis.
Reply With Quote
  #111  
Old 07-21-2004, 07:27 PM
Holidazed's Avatar
Holidazed Holidazed is offline
 
Join Date: May 2002
Location: Van Nuys, CA
Posts: 713
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Erwin
If you don't modify the number of questions, you can use the same templates.

If you want to start changing the type and number of questions, you need to copy and rename the template, and change the template name in form.php - keep doing that for new forms, only if you modify those things.

It's not hard too work out - I've made this hack to be customizable - go forth and change it however you like.
OK, I got that resolved. I currently have the form at http://www.dungeonkeepersdomain.com/...st_a_forum.php set so anybody can use it. It is ustilizing the the "form_request_a_forum" template and "formanswers_request_a_forum" answers template. When I fill out the form, it still says "you need to answer every question!".

I DID ANSWER EVERY QUESTION.

My "form_request_a_forum" template looks like this.

Code:
$stylevar[htmldoctype]
<html id="form" dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$vboptions[bbtitle] - $formtitle</title>
$headinclude
</head>
<body>
$header
$navbar
<br>
<form enctype="multipart/form-data" method="post" action="$phpfilename">
<input type="hidden" value="$userid" name="userid">
<input type="hidden" value="submit" name="action">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
  <tr>
	<td class="tcat" colspan="3">
	  $vboptions[bbtitle] - $formtitle
	</td>
  </tr>
  <tr>
	<td class="panelsurround" align="center" colspan="3">
	  <table class="panel" cellpadding="0" cellspacing="$stylevar[formspacer]" border="0" width="100%">
		<tr>
		  <td align="$stylevar[left]">
			<fieldset class="fieldset" style="margin:0px">
			  <table bgcolor="#FFFFFF" cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
				<tr>
				  <td>
					<font color="#000000">$formpurpose</font>
				  </td>
				</tr>
			  </table>
			  </fieldset>
			</td>
		  </tr>
		</table>
	  </td>
	</tr>
	<tr>
	  <td class="alt2" valign="middle" width="60%">
		<b>Your Username</b>:</td>
	  <td class="alt2" valign="middle" colspan="2" width="40%">
		<b>$bbuserinfo[username]</b>
	  </td>
	</tr>
	<tr>
	  <td class="alt2" valign="middle" width="60%">
		<b>$normalquestion1</b><br>
		<font face="verdana" size="1">$explain1</font>
	  </td>
	  <td class="alt2" valign="middle" colspan="2" width="40%">
		<input type="text" size="30" name="normalanswer1">
	  </td>
	</tr>
	<tr>
	  <td class="alt2" valign="middle" width="60%">
		<b>$normalquestion2</b><br>
		<font face="verdana" size="1">$explain2</font>
	  </td>
	  <td class="alt2" valign="middle" colspan="2" width="40%">
		<input type="text" size="30" name="normalanswer2">
	  </td>
	</tr>
	<tr>
	  <td class="alt2" valign="middle" width="60%">
		<b>$normalquestion3</b><br>
		<font face="verdana" size="1">$explain3</font>
	  </td>
	  <td class="alt2" valign="middle" colspan="2" width="40%">
		<input type="text" size="30" name="normalanswer3">
	  </td>
	</tr>
	<tr>
	  <td class="alt2" valign="middle" width="60%">
		<b>$normalquestion4</b><br>
		<font face="verdana" size="1">$explain4</font>
	  </td>
	  <td class="alt2" valign="middle" colspan="2" width="40%">
		<input type="text" size="30" name="normalanswer4">
	  </td>
	</tr>
	<tr>
	  <td class="alt2" valign="middle" width="60%">
		<b>$normalquestion5</b><br>
		<font face="verdana" size="1">$explain5</font>
	  </td>
	  <td class="alt2" valign="middle" colspan="2" width="40%">
		<input type="text" size="30" name="normalanswer5">
	  </td>
	</tr>
	<tr>
	  <td colspan="3" class="alt2" valign="middle">
		<b>$longquestion6</b><br>
		<font face="verdana" size="1">$longexplain6</font><br>
		<textarea rows="5" cols="60" name="longanswer6" wrap="VIRTUAL" maxlength="225"></textarea>
	  </td>
	</tr>
	<tr>
	  <td colspan="3" class="alt2" valign="middle">
		<b>$longquestion7</b><br>
		<font face="verdana" size="1">$longexplain7</font><br>
		<textarea rows="5" cols="60" name="longanswer7" wrap="VIRTUAL" maxlength="225"></textarea>
	  </td>
	</tr>
<tr>
<td valign="top">
<p align="center">
<input type="submit" value="Submit" 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>
</td>
</tr>
</table>
</form>
$footer
</body>
</html>
And my "formanswers_request_a_forum" template looks like this.
Code:
$formtitle
$bbuserinfo[username]
-----------------------------------------------------
$normalquestion1
$normalanswer1
-----------------------------------------------------
$normalquestion2
$normalanswer2
-----------------------------------------------------
$normalquestion3
$normalanswer3
-----------------------------------------------------
$normalquestion4
$normalanswer4
-----------------------------------------------------
$normalquestion5
$normalanswer5
-----------------------------------------------------
$longquestion6
$longanswer6
------------------------------------------------------
$longquestion7
$longanswer7
------------------------------------------------------
It works perfectly if I do not force all the questions to be answerws.
What am I doing wrong?
Reply With Quote
  #112  
Old 07-21-2004, 09:55 PM
WAR WAR is offline
 
Join Date: Jan 2004
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you need to change the conditional in the PHP file where it checks to see if all questions have been answered to match your new format.

I don't have the files where i can look at them right now, but the line you are looking for is marked with a comment, it is a long string of if ($variable1 == "" OR $variable2 == "" OR etc...

You need to change all of the previously used variable names into the variable names you are using now:

$normalanswer1
$normalanswer2
$normalanswer3
$normalanswer4
$normalanswer5
$longanswer6
$longanswer7

If that isn't clear enough, I will post the specific line you need to change later when I get back home
Reply With Quote
  #113  
Old 07-21-2004, 10:04 PM
Holidazed's Avatar
Holidazed Holidazed is offline
 
Join Date: May 2002
Location: Van Nuys, CA
Posts: 713
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by WAR
you need to change the conditional in the PHP file where it checks to see if all questions have been answered to match your new format.

I don't have the files where i can look at them right now, but the line you are looking for is marked with a comment, it is a long string of if ($variable1 == "" OR $variable2 == "" OR etc...

You need to change all of the previously used variable names into the variable names you are using now:

$normalanswer1
$normalanswer2
$normalanswer3
$normalanswer4
$normalanswer5
$longanswer6
$longanswer7

If that isn't clear enough, I will post the specific line you need to change later when I get back home
OK, it looks like this.

Code:
globalize($_POST, array(
'normalanswer1' => STR,
'normalanswer2' => STR,
'normalanswer3' => STR,
'normalanswer4' => STR,
'normalanswer5' => STR,
'longanswer6' => STR,
'longanswer7' => STR,
'action' => STR
));
Still does not work
Reply With Quote
  #114  
Old 07-21-2004, 10:50 PM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, not that part, that's the wrong section.

You need to modify the bit of code that checks that all questions are answered which is further down the file. The one that checks that if a variable is empty, then the person needs to answer it.
Reply With Quote
  #115  
Old 07-22-2004, 02:02 AM
Holidazed's Avatar
Holidazed Holidazed is offline
 
Join Date: May 2002
Location: Van Nuys, CA
Posts: 713
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Erwin
No, not that part, that's the wrong section.

You need to modify the bit of code that checks that all questions are answered which is further down the file. The one that checks that if a variable is empty, then the person needs to answer it.
Erwin, can you give me the classic "Look for" kind of help? Also, I answered all the questions I had on the form. I left NOTHING blank.
Reply With Quote
  #116  
Old 07-22-2004, 02:25 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Remove the variables you don't need in this line:

PHP Code:
if ($answerall == "1") {
    if (
$normalanswer1 == '' OR $radioanswer1 == '' OR $radioanswer2 == '' OR $radioanswer3 == '' OR $radioanswer3other == '' OR $answer1 == '' OR $answer2 == '' OR $answer3 == '' OR $longanswer1 == ''
Reply With Quote
  #117  
Old 07-22-2004, 12:09 PM
Holidazed's Avatar
Holidazed Holidazed is offline
 
Join Date: May 2002
Location: Van Nuys, CA
Posts: 713
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks
Reply With Quote
  #118  
Old 07-26-2004, 08:54 PM
Aurous Aurous is offline
 
Join Date: Apr 2004
Posts: 138
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

no spam control

:dead:
Reply With Quote
  #119  
Old 07-27-2004, 01:01 AM
pjdaley pjdaley is offline
 
Join Date: Feb 2004
Posts: 189
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by pjdaley
not really a coder though :ermm:
can someone show me what to change in the php file, so i can change the title of the thread thats created into one of the answers? please?
Reply With Quote
  #120  
Old 07-27-2004, 02:41 PM
Holidazed's Avatar
Holidazed Holidazed is offline
 
Join Date: May 2002
Location: Van Nuys, CA
Posts: 713
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by pjdaley
can someone show me what to change in the php file, so i can change the title of the thread thats created into one of the answers? please?
That is pretty self explanitory

Open up the form.php (or whatever you named it) file
Look for:
Code:
////////////////////////////////////////////////////////////////////////////////////////////////////
//TITLE OF FORM (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////
$formtitle = "Generic Form";
Replace:
Code:
$formtitle = "Generic Form";
With:

Code:
$formtitle = "thread title goes here";
Reply With Quote
  #121  
Old 07-27-2004, 03:49 PM
LoOnEyToOnZ LoOnEyToOnZ is offline
 
Join Date: Mar 2004
Posts: 109
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Dont mind if its a silly question, but the 2 templates being mentioned that has to be added, where are they ?
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:10 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.12943 seconds
  • Memory Usage 2,396KB
  • Queries Executed 30 (?)
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
  • (1)bbcode_php
  • (7)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
  • (1)pagenav_pagelinkrel
  • (16)post_thanks_box
  • (16)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (16)post_thanks_postbit_info
  • (15)postbit
  • (16)postbit_onlinestatus
  • (16)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