Advertisement:

Author Topic: Custom Form Mod  (Read 532091 times)

Offline live627

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,272
  • Gender: Male
  • Cat: Destroy!
    • live627 on Facebook
    • live627 on GitHub
    • live627 on LinkedIn
    • @live627 on Twitter
    • livemods
Custom Form Mod
« on: July 09, 2008, 10:24:44 PM »
Link to Mod

Custom Form Mod Version 1.7



Overview:
This Mod allows you to create custom forms for your forum which your users can access at "index.php?action=form", these forms are essentially a structured way of allowing your users to submit posts to certain boards, meaning that you can get them to enter certain information into a form and then you can chose how you want that information to be presented within the final outputted post.

You can access a list of your forms and the links to the actual forms themselves by going to "index.php?action=form".

Possible uses for this Mod could include, Support Forms, Staff Application Forms, Error Reporting Forms and etc.

Settings are found in the Admin panel:
For SMF 1.1.x: "Features and Options" ->"Custom Forms" or index.php?action=featuresettings;sa=customform;

For SMF 2.x: "Configuration"-> "Modifications" -> "Custom Form"  or index.php?action=admin;area=modsettings;sa=customform

Features Explained:

Creating/Editing Forms:
This is done in the settings area for this mod, you just need to create a new form by clicking on "Add New Form", and then set up the information for that form making sure that you have entered in the relevant data for each setting, you will also need to add some fields to the form, otherwise it will be ignored.

Viewing a list of forms that you can post:
This is done at the '"form" action "index.php?action=form", you will be able to view a list of forms that you can view and post, as well as a link to the board they belong to and etc.

Posting a form:
This is done at the '"form" action "index.php?action=form;n=#", Replace # with the actual number of the form. Once the user has filled out the form and saved/submitted, the results will be posted to the appropriate board. You can change the look of this page by creating a Custom Template Function.

Custom Template Functions:
This is a feature allows you to create your own custom template function for each form, to do this we suggest that you make a duplicate of the "form_template_example()" function within the 'CustomForm.template.php' file. You can then use the documentation from that function to see how information is passed to it by the Mod, allowing you to change it for your purposes.

Please remember that you have to name the new template function in this format "form_template_{Custom Template Name}", and you will have to put the correct value from "{Custom Template Name}" into the "Custom Template Function" setting for the form that you wish to use you new template. Further explanation for custom templates can be found in the 'CustomForm.template.php'.

Three Custom Templates are included with the mod; example, left, and center. Enter the appropriate name into the "Custom Template Function" field, click save, then go to your form and see how the look of your form changes.

CAPTCHA Visual Verification:
Visual verification often referred to as CAPTCHA and used by SMF for registration and posting, is included in the mod to help prevent against bots from using forms as a way to post your forum. Visual verification requires that the user type letters or digits from a distorted image that appears on the screen in order for a form to submit correctly.

By default all forms require visual verification when being filled out by guests and can not be turned off. Alternatively registered members will also be required to use visual verification based on existing settings in SMF.

To access verification settings in for SMF 1.1.x: go to Admin => Registration => Settings or index.php?action=regcenter;sa=settings

To access verification settings in for SMF 2.x: go to Admin => Configuration => Security and Moderation => Anti-Spam or ?action=admin;area=securitysettings;sa=spam.

Further explanation of a settings functionality can be found by clicking on the [?] help button next to each setting.

Tutorial:

Linked below is a step by step tutorial on how to make the 'New Topic' Button re-direct to the form you wish the user to use for posting in that forum.
http://www.simplemachines.org/community/index.php?topic=248871.msg3726297#msg3726297

Compatibility:

While it is highly recommended that you update to the most current versions of SMF...
CustomFormMod_v1.7_SMF1.1.x: Supports most versions of SMF 1.1.
CustomFormMod_v1.7_SMF2.x: Supports most SMF 2.0 versions after 2.0 RC2.

Version Changes:
https://github.com/live627/smf-custom-forms/blob/development/CHANGELOG.md
Try not to become a man of success, but rather try to become a man of value.
- Albert Einstein

Offline Lady Night Owl

  • Jr. Member
  • **
  • Posts: 133
  • Gender: Female
Re: Custom Form Mod
« Reply #1 on: July 09, 2008, 11:56:45 PM »
Looks like a good mod - I was actually looking for something like this - but, I'm running 1.1.5

:(
Running SMF 2.0.1

Offline Nathaniel

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,117
  • Gender: Male
    • Verbtest.com
Re: Custom Form Mod
« Reply #2 on: July 09, 2008, 11:59:49 PM »
Okay, I am working on porting this backwards for SMF 1.1.5. It might take a while though...

There are millions of things which need to be changed such as db queries, templates and etc, but I will try...
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

Offline Paracelsus

  • Sr. Member
  • ****
  • Posts: 874
  • Gender: Male
Re: Custom Form Mod
« Reply #3 on: July 10, 2008, 02:34:09 AM »
Okay, I am working on porting this backwards for SMF 1.1.5. It might take a while though...

There are millions of things which need to be changed such as db queries, templates and etc, but I will try...

I second that request ;)

Btw, is there any demo we can see with some kind of form?

Offline 4b11l

  • Jr. Member
  • **
  • Posts: 355
Re: Custom Form Mod
« Reply #4 on: July 10, 2008, 02:38:05 AM »
Okay, I am working on porting this backwards for SMF 1.1.5. It might take a while though...

There are millions of things which need to be changed such as db queries, templates and etc, but I will try...

3rd the request.

Offline Lady Night Owl

  • Jr. Member
  • **
  • Posts: 133
  • Gender: Female
Re: Custom Form Mod
« Reply #5 on: July 10, 2008, 02:49:49 AM »
Okay, I am working on porting this backwards for SMF 1.1.5. It might take a while though...

There are millions of things which need to be changed such as db queries, templates and etc, but I will try...

OK, sweet! :D Thanks!
Running SMF 2.0.1

Offline Angelotus

  • Sr. Member
  • ****
  • Posts: 881
  • Gender: Male
    • Weeklyfun.nl | The Dutch Society of Fun
Re: Custom Form Mod
« Reply #6 on: July 10, 2008, 03:12:05 AM »
Hi, seems like a nice mod, I installed it, but there is no link in modifications! How to add one? And what is the link to edit?

Offline Nathaniel

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,117
  • Gender: Male
    • Verbtest.com
Re: Custom Form Mod
« Reply #7 on: July 10, 2008, 04:17:34 AM »
@ Paracelsus, I've been a bit slack, I will try to get some demo sites up and running as well as soon as possible, I will also write some decent documentation, because its not very good at the moment. ;)

@ Angelotus, I am not sure why you can't see a link, please make sure that you are viewing it in English because otherwise there will not be text for the link. If you are viewing it in English then see if you can access the settings at "index.php?action=admin;area=modsettings;sa=customform;".

If that doesn't work then the mod may not have installed correctly and you should try to re-install it.
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

Offline Angelotus

  • Sr. Member
  • ****
  • Posts: 881
  • Gender: Male
    • Weeklyfun.nl | The Dutch Society of Fun
Re: Custom Form Mod
« Reply #8 on: July 10, 2008, 04:23:34 AM »
I have only english installed and the mod does work, only the link in the modifications center doesn't work. I think the necessary language string isn't on it's place because if I take a look in the source I see the link tagged, but no txt for the link.
I have manually gone through all steps adding the language strings, but no succes...

Offline Nathaniel

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,117
  • Gender: Male
    • Verbtest.com
Re: Custom Form Mod
« Reply #9 on: July 10, 2008, 04:38:07 AM »
Okay, there are three possible places where something could have gone wrong:

1. This line: "$txt['CustomForm_tabheader'] = 'Custom Forms';" could be missing from your 'themes/{theme}/languages/Modifications.english.php' file.

2. The line below could be missing from your 'sources/Admin.php' file.
Code: [Select]
                  //   Place the Custom Form Mod Link.
                  'customform' => array($txt['CustomForm_tabheader']),

3. The code "loadLanguage('Modifications');" could be missing from the beginning of the AdminMain() function from Admin.php.

If you have check your 'Modifications.english.php' file then maybe you could post your Admin.php file and I could check over it?

All of those errors would have only occurred if there was some sort of mistake made by the package manager so it may be fixed by re-installing the mod.
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

Offline Angelotus

  • Sr. Member
  • ****
  • Posts: 881
  • Gender: Male
    • Weeklyfun.nl | The Dutch Society of Fun
Re: Custom Form Mod
« Reply #10 on: July 10, 2008, 05:26:50 AM »
Okay, there are three possible places where something could have gone wrong:

1. This line: "$txt['CustomForm_tabheader'] = 'Custom Forms';" could be missing from your 'themes/{theme}/languages/Modifications.english.php' file.

2. The line below could be missing from your 'sources/Admin.php' file.
Code: [Select]
                  //   Place the Custom Form Mod Link.
                  'customform' => array($txt['CustomForm_tabheader']),

3. The code "loadLanguage('Modifications');" could be missing from the beginning of the AdminMain() function from Admin.php.

If you have check your 'Modifications.english.php' file then maybe you could post your Admin.php file and I could check over it?

All of those errors would have only occurred if there was some sort of mistake made by the package manager so it may be fixed by re-installing the mod.

Here is my admin.php, the txt string is in place
« Last Edit: July 10, 2008, 05:28:26 AM by Angelotus »

Offline Nathaniel

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,117
  • Gender: Male
    • Verbtest.com
Re: Custom Form Mod
« Reply #11 on: July 10, 2008, 06:08:54 AM »
Okay, nothing wrong with your Admin.php file. It should be working as far as I can see...

Are you certain that the "$txt['CustomForm_tabheader']" variable is defined in your 'Modifications.english.php' file?
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

PfalzNacht

  • Guest
Re: Custom Form Mod
« Reply #12 on: July 10, 2008, 06:50:19 AM »
Hi!

Really good mod.

But, how can i get the forms into e post?

I created a form, but i can't choose a form.

Offline Angelotus

  • Sr. Member
  • ****
  • Posts: 881
  • Gender: Male
    • Weeklyfun.nl | The Dutch Society of Fun
Re: Custom Form Mod
« Reply #13 on: July 10, 2008, 08:16:16 AM »
Okay, nothing wrong with your Admin.php file. It should be working as far as I can see...

Are you certain that the "$txt['CustomForm_tabheader']" variable is defined in your 'Modifications.english.php' file?

Yes very shure! Are there any other files to be editted??

Offline Nathaniel

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,117
  • Gender: Male
    • Verbtest.com
Re: Custom Form Mod
« Reply #14 on: July 10, 2008, 08:44:07 AM »
Yes very shure! Are there any other files to be editted??

In terms of that particular link showing/not showing, there should be no other factors which effect it at all. I will have a think about any other possible ways that this error could be occuring, but your Admin.php file is definitely okay, could you post your Modifications.english.php file so I can check it?

@ Cybertec,
I am not entirely sure what you are talking about, but I am going to add more documentation to the downloads page so hopefully that will explain everything. To post a form, you need to access it from the index.php?action=form, also remember that the form settings in the admin area have to be done properly, ie. the board id has to be valid, there have to be fields in the form and etc.
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

PfalzNacht

  • Guest
Re: Custom Form Mod
« Reply #15 on: July 10, 2008, 08:52:42 AM »
Thanks LHVWB!

That's the answer.  ;)

Offline Nathaniel

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,117
  • Gender: Male
    • Verbtest.com
Re: Custom Form Mod
« Reply #16 on: July 10, 2008, 09:02:47 AM »
Okay, I have added some more documentation to the downloads page, I will continue to try to improve the documentation and then I will try to port this mod back to SMF 1.1.5. Which should be fun!  :-\
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

Offline Sakae

  • Full Member
  • ***
  • Posts: 498
  • Gender: Male
    • TigreLOG
Re: Custom Form Mod
« Reply #17 on: July 10, 2008, 09:07:27 AM »
Okay, I am working on porting this backwards for SMF 1.1.5. It might take a while though...

There are millions of things which need to be changed such as db queries, templates and etc, but I will try...

Well, I think you saw already how many people thanks for this but it's never too much: THANKS MAN!!!
http://www.tigrelog.com.br
l: simple p: machines

Offline Angelotus

  • Sr. Member
  • ****
  • Posts: 881
  • Gender: Male
    • Weeklyfun.nl | The Dutch Society of Fun
Re: Custom Form Mod
« Reply #18 on: July 10, 2008, 09:41:29 AM »
Yes very shure! Are there any other files to be editted??

In terms of that particular link showing/not showing, there should be no other factors which effect it at all. I will have a think about any other possible ways that this error could be occuring, but your Admin.php file is definitely okay, could you post your Modifications.english.php file so I can check it?

@ Cybertec,
I am not entirely sure what you are talking about, but I am going to add more documentation to the downloads page so hopefully that will explain everything. To post a form, you need to access it from the index.php?action=form, also remember that the form settings in the admin area have to be done properly, ie. the board id has to be valid, there have to be fields in the form and etc.

Here is my modifications.english.php

Offline jossanaijr

  • SMF Hero
  • ******
  • Posts: 2,131
  • Gender: Male
    • Netbook Forum
Re: Custom Form Mod
« Reply #19 on: July 10, 2008, 03:24:14 PM »
Okay, I have added some more documentation to the downloads page, I will continue to try to improve the documentation and then I will try to port this mod back to SMF 1.1.5. Which should be fun!  :-\
One more! WOW! Thanks.