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
  #1342  
Old 12-12-2008, 10:11 PM
8dayssooner 8dayssooner is offline
 
Join Date: May 2007
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've just edited my form, and now i get the error message
Quote:
Parse error: syntax error, unexpected T_STRING in /mnt/web2/33/89/51544289/htdocs/forums/newthread.php(71) : eval()'d code on line 888
Line 71 of newthread.php refers to
Quote:
($hook = vBulletinHook::fetch_hook('newthread_start')) ? eval($hook) : false;
and the error message dissapears when i disable form hack... is there anyone who could support me with this on 3.6?

Help would be much appreciated as i'm trying to use this as a Nominations form for a board awards!

Many thanks in advance!

Mike
Reply With Quote
  #1343  
Old 12-13-2008, 01:58 PM
WNxWakko's Avatar
WNxWakko WNxWakko is offline
 
Join Date: Apr 2003
Location: Paradise, Texas
Posts: 309
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Digital Jedi View Post

Only other thing I can think of is to check to the forum ID variable in the plugin, as well as ENABLE FORM TO BE POSTED setting.
None of that has changed. Ive been using these forms for 2 years and they have always worked. They do work if your logged into an account, the issue is if you are unregistered, the form never creates the thread even though you get the confirmation message. The forum ID is correct because it works right if im logged in.

The only change ive made after the upgrade to 3.7.x is adding the security input code bit. Outside of that, nothing has changed. I suspect something is different for unregistered users from 3.6 to 3.7
Reply With Quote
  #1344  
Old 12-14-2008, 12:17 AM
xTerMn8R xTerMn8R is offline
 
Join Date: Mar 2004
Posts: 116
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone get tables to work in the answer Template?

I can get my Bold to show in the PM's using the bbcode [B]space{varible}space[B/]

But when I export them or look at the e-mails each line has the BBcode tags and that looks like crap. Am I doing something wrong here. Also does anyone know of a hack to allow you to print PM's

Thanks,
Tom
Reply With Quote
  #1345  
Old 12-15-2008, 06:47 PM
2dub 2dub is offline
 
Join Date: Dec 2007
Location: Moyock, NC
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just got this to work after many hours of trying to get it to work. I wish it were editable in vB options.

It is a great hack once you figure it out.
Reply With Quote
  #1346  
Old 12-16-2008, 02:59 AM
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Location: PopCulturalReferenceLand
Posts: 5,171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by etzero View Post
DJ, This is a question in referance to post #1313 where a someone asked:



Which I think I may have found a solution to. If you could please verify or deny this I would appreciate it.

The default code looks like this:

Code:
if ($vbulletin->userinfo['autosubscribe'] != -1)
            {
                $newpost['emailupdate'] = $vbulletin->userinfo['autosubscribe'];
            }
            else
            {
                $newpost['emailupdate'] = 9999;
            }
My thought is that it if changed to this it should always delete the users subscrition regardless if he was set up though the user CP.

Code:
$newpost['emailupdate'] = 9999;

By looking at functions_newpost.php, '9999' apears to be the correct value to delete any subscritions for that thread?

Code:
// ### DO THREAD SUBSCRIPTION ###
    if ($vbulletin->userinfo['userid'] != 0)
    {
        require_once(DIR . '/includes/functions_misc.php');
        $post['emailupdate'] = verify_subscription_choice($post['emailupdate'], $vbulletin->userinfo, 9999);
 
        ($hook = vBulletinHook::fetch_hook('newpost_subscribe')) ? eval($hook) : false;
 
        if (!$threadinfo['issubscribed'] AND $post['emailupdate'] != 9999)
        { // user is not subscribed to this thread so insert it
            /*insert query*/
            $vbulletin->db->query_write("INSERT IGNORE INTO " . TABLE_PREFIX . "subscribethread (userid, threadid, emailupdate, folderid, canview)
                    VALUES (" . $vbulletin->userinfo['userid'] . ", $threadinfo[threadid], $post[emailupdate], $post[folderid], 1)");
        }
        else
        { // User is subscribed, see if they changed the settings for this thread
            if ($post['emailupdate'] == 9999)
            {    // Remove this subscription, user chose 'No Subscription'
                $vbulletin->db->query_write("DELETE FROM " . TABLE_PREFIX . "subscribethread WHERE threadid = $threadinfo[threadid] AND userid = " . $vbulletin->userinfo['userid']);
            }
            else if ($threadinfo['emailupdate'] != $post['emailupdate'] OR $threadinfo['folderid'] != $post['folderid'])
            {
                // User changed the settings so update the current record
                /*insert query*/
                $vbulletin->db->query_write("REPLACE INTO " . TABLE_PREFIX . "subscribethread (userid, threadid, emailupdate, folderid, canview)
                    VALUES (" . $vbulletin->userinfo['userid'] . ", $threadinfo[threadid], $post[emailupdate], $post[folderid], 1)");
            }
        }
    }
It seems counter intuitive as I would have guessed a value of ?0? would remove subscriptions.
That's probably just a little beyond my current level of understanding right now. But my gut is telling me that your on the right track. Is this not going to try to remove the subscription before the user is actually subscribed?
Reply With Quote
  #1347  
Old 12-16-2008, 02:41 PM
j_86 j_86 is offline
 
Join Date: May 2003
Posts: 275
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I attach a slightly cleaner, indented copy of the standard form template (with the 3.6 security token fix applied (Form Hack 4.1)).

I find it easier to use with clear indentation.
Reply With Quote
  #1348  
Old 12-20-2008, 04:32 AM
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Location: PopCulturalReferenceLand
Posts: 5,171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Looks like I'm running into the Invalid Forum specified message myself now. The URL doesn't append with a thread ID. I see for most people it "fixed itself" when that happened. Any one ever figure out how that actually happened? I just copy and pasted a working Form Hack plugin from my demo board and it's working fine there. Just doesn't seem to work on a new install.
Reply With Quote
  #1349  
Old 12-29-2008, 02:38 AM
bluesoul's Avatar
bluesoul bluesoul is offline
 
Join Date: Jul 2004
Location: Paducah, KY USA
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry, I couldn't find a good search string, but how does one update the script to work with 3.7.4?
Reply With Quote
  #1350  
Old 01-02-2009, 12:49 PM
wacodep wacodep is offline
 
Join Date: Mar 2005
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Searched through the thread, but to no avail.

The Form Hack is working fine, the message is being posted to the hidden forum correctly, yada blah etc.

The problem is with manage attachments. While it DOES show the link on the form to "Attach Files", when you click the button labeled "Manage Attachments", the new window pops up, but then the users get the "No Permissions" message. I can see it fine as admin.

The hack results ARE being posted to a "hidden" forum just fine (sans the attachment, obviously).

Permissions for the usergroups (for the user attempting to add attachments) ARE set to allow attachments and allow posting to the otherwise hidden forum (but no permission to view).

This worked fine with the previous version of the Form Hack under vB 3.5. I'm now using Form Hack 4.1 under vB 3.7.4.

Any suggestions would be appreciated.
Reply With Quote
  #1351  
Old 01-06-2009, 03:23 AM
Trek Trek is offline
 
Join Date: Sep 2003
Posts: 664
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have this all working pretty good, it looks great and almost does what I want.

It posts to a forum as it should, but:

I want this forum to be locked down from posting new posts any way other than through the Form Hack.

I want those who have created threads using Form Hack to be able to edit and reply to their own posts, but no others.

Everyone should be able to view the posts.

Most of this is doable through the permissions, the problem seems to be making it so people can only post through FormHack to the forum (I don't want a bunch of non-standard templated messages posted there).

I've looked through the threads, but with 90 pages, I didn't see everything. Did a few searches, but couldn't find the answer either.

Thanks for any help!
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 05:16 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.06471 seconds
  • Memory Usage 2,331KB
  • 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
  • (4)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
  • (3)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