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
  #202  
Old 12-13-2006, 01:17 PM
optrex optrex is offline
 
Join Date: Sep 2005
Posts: 344
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice hack Abe1,

I have a couple of questions before I install.

1) Is there a need/requirement for flood control
2) Is there a need/requirement for image verification

Just wondering if these would be measures to put in to prevent "spamming" ?
Reply With Quote
  #203  
Old 12-14-2006, 09:57 PM
blacklancer's Avatar
blacklancer blacklancer is offline
 
Join Date: Jan 2006
Location: so cal
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm having problems with this hack...

I have the need for 2 forms. I made the easier one of the 2 first and tested it and it works fine. When I do the 2nd one, it gives me the following error when I try to submit the form.

Quote:
Fatal error: Unable to proceed with save while $errors array is not empty in class vB_DataManager_PM in \includes\class_dm.php on line 763
any advice on what to do??
Reply With Quote
  #204  
Old 12-15-2006, 05:31 PM
blacklancer's Avatar
blacklancer blacklancer is offline
 
Join Date: Jan 2006
Location: so cal
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

anyone?
Reply With Quote
  #205  
Old 12-18-2006, 02:31 AM
laittnet laittnet is offline
 
Join Date: Feb 2006
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I wanna write the form variables to the database, but it turn in to trouble if one field contains quote mark, for example " or '

PHP Code:
        //$db->query_write(" 
        //    INSERT IGNORE INTO agent_register(userid, fullname, email, phone_mobile, phone_fixed, address, city, country, agent_type, ic_owner, ic_pc, sell_already, sell_cards, cards_month, pay_direct, pay_atm, pay_transfer, pay_post, pay_mb, pay_other, otherinfo, date_submit) 
        //    VALUES 
        //    ({$vbulletin->userinfo['userid']}, {$vbulletin->GPC['answer1']},  {$vbulletin->GPC['answer2']}, {$vbulletin->GPC['answer3']}, {$vbulletin->GPC['answer4']}, {$vbulletin->GPC['answer5']}, {$vbulletin->GPC['answer6']}, {$vbulletin->GPC['answer7']}, {$vbulletin->GPC['radioanswer3']}, {$vbulletin->GPC['radioanswer4']}, {$vbulletin->GPC['radioanswer4other']}, {$vbulletin->GPC['radioanswer5']}, {$vbulletin->GPC['radioanswer5other']}, {$vbulletin->GPC['dropdownanswer1']}, {$vbulletin->GPC['checkboxanswer1_1']}, {$vbulletin->GPC['checkboxanswer1_2']}, {$vbulletin->GPC['checkboxanswer1_3']}, {$vbulletin->GPC['checkboxanswer1_4']}, {$vbulletin->GPC['checkboxanswer1_5']}, {$vbulletin->GPC['checkboxanswer1_6']}, $vbtextanswer, ". TIMENOW . ") 
        //"); 
How can I handle this problem?
Reply With Quote
  #206  
Old 12-18-2006, 06:01 PM
DarkDraco07's Avatar
DarkDraco07 DarkDraco07 is offline
 
Join Date: Apr 2002
Posts: 414
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

can anyone help with my problem? i want only members that are logged in to be able to use the form =/
Reply With Quote
  #207  
Old 12-18-2006, 08:32 PM
civil78's Avatar
civil78 civil78 is offline
 
Join Date: Nov 2005
Location: Greece
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by DarkDraco07 View Post
can anyone help with my problem? i want only members that are logged in to be able to use the form =/
Search in form hack php code, this phrase

PHP Code:
//USERGROUPS ALLOWED 
It's in the start of php.

After that find this if check

PHP Code:
// if (!in_array($vbulletin->userinfo['usergroupid'], array(2,5,6,7))) print_no_permission(); 
Remove the // and in the array(2,5,6,7) set the id numbers of the user groups that you want to allow.
Reply With Quote
  #208  
Old 12-22-2006, 02:55 PM
DarkDraco07's Avatar
DarkDraco07 DarkDraco07 is offline
 
Join Date: Apr 2002
Posts: 414
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

wow... how did i not see that...
thx
Reply With Quote
  #209  
Old 12-22-2006, 05:58 PM
gullystation gullystation is offline
 
Join Date: Jun 2006
Location: England UK
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

where is this : /newthread.php?do=form ? Where do i put it, can anyone help me?
Reply With Quote
  #210  
Old 12-22-2006, 06:49 PM
civil78's Avatar
civil78 civil78 is offline
 
Join Date: Nov 2005
Location: Greece
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by gullystation View Post
where is this : /newthread.php?do=form ? Where do i put it, can anyone help me?
Go to Plugins & Products --> Plugin Manager and edit under the the Product : Form Hack the Form Hack plugin (you can add more forms if you go down in the [Add New Plugin], see the example of Form Hack and clone it) and in the inside the php code find this

PHP Code:
$formname "form"
The varieble formname is the name of your form. To call your form from your site just write "http://www.yoursitename.com/newthread.php?do= + $formname". like http://www.yoursitename.com/newthread.php?do=form

As you see you can add multiple forms just change the name in the $formname varieble in every new plugin.

Also if you want to make new forms you have to change or add a new template in Styles & Templates, the templates with names in this variebles.

PHP Code:
// Name of the main template
$maintemplate "form";
// Name of the answer template
$answertemplate "formanswers"
$maintemplate is the varieble that contains the name of the template as it show if you call the newthread.php?do=form url, and the $answertemplate contains the name of the template of the post.

I hope that you are undestand that.
Reply With Quote
  #211  
Old 12-26-2006, 07:39 PM
elricstorm's Avatar
elricstorm elricstorm is offline
 
Join Date: Aug 2006
Location: Stamford, CT
Posts: 216
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm starting to become very proficient with this plugin and I've created 5 separate "advanced" forms, but now I'd like to take it to a new level.

I want to move the form from posting a message in a thread to posting a calendar event. How difficult would this be?

For instance, the normal forms point to newthread_start and I'm guessing I would change this to calendar_start. So my questions are thus:

1. What form elements would I use to handle date parameters that are already in the existing calendars?
2. Would the form elements have to be separate to account for single day, multi-day, and recurring events?
3. If you look at a "recurring calendar event" I would want to start the form so that it looks exactly like this, with the exception of the editor box which the rest of the form would replace so that I could choose the type of questions/answers I would use here.

I know this might sound difficult, but I feel that if I'm pointed in the right direction, I'm positive I could figure it out. I'm good at hacking/editing existing code due to having a photographic memory.

Thanks in advance.
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:05 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.06023 seconds
  • Memory Usage 2,330KB
  • 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
  • (5)bbcode_php
  • (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
  • (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