Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: live627 on July 09, 2008, 10:24:44 PM

Title: Custom Form Mod
Post by: live627 on July 09, 2008, 10:24:44 PM
[Link to the mod](https://custom.simplemachines.org/index.php?mod=1279)

## Custom Form
[![MIT license](http://img.shields.io/badge/license-MIT-009999.svg)](http://opensource.org/licenses/MIT)
[![Crowdin](https://badges.crowdin.net/custom-form/localized.svg)](https://crowdin.com/project/custom-form)
[![Latest Version](https://img.shields.io/github/release/live627/smf-custom-forms.svg)](https://github.com/live627/smf-custom-forms/releases)
[![Total Downloads](https://img.shields.io/github/downloads/live627/smf-custom-forms/total.svg)](https://github.com/live627/smf-custom-forms/releases)
[![Support](http://img.shields.io/badge/PayPal-$-009966.svg)](https://www.paypal.me/JohnRayes)

Package name | SMF version | Minimmum PHP version
--- | --- | ---
[Custom Form Mod 4.0.2](https://github.com/live627/smf-custom-forms/releases/download/v4.0.2/custom-forms_4-0-2.tgz) | SMF 2.1.x | PHP 8
[Custom Form Mod 2.2.4](https://github.com/live627/smf-custom-forms/releases/download/v2.2.4/custom-forms_2-2-4.tgz) | SMF 2.0.x, SMF 2.1.x | PHP 7.4
Custom Form Mod 1.7 | SMF 1.1.x, 2.0.x | PHP 4.3 – PHP 7.4

[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/A0A8GEKTO)

[View changelog](https://github.com/live627/smf-custom-forms/blob/master/CHANGELOG.md)

### 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.

### Features Explained:
Settings are found in the admin panel: Administration Center » Configuration » Modifications » Custom Form (or `index.php?action=admin;area=modsettings;sa=customform`).

- **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 `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 `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 `CustomForm.template.php`.

- **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.
  - All forms require visual verification when being filled out by guests and can not be turned off
  - 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 setting's functionality can be found by clicking on the [?] help button.

### Tutorial
**[View more tutorials](https://github.com/live627/smf-custom-forms/tree/master/docs)**
#### Redirect the 'New Topic' button to a form
http://www.simplemachines.org/community/index.php?topic=248871.msg3726297#msg3726297

#### Adding menu buttons for your actions
Download [Ultimate Menu](https://custom.simplemachines.org/index.php?mod=3674) for your menu building needs
Title: Re: Custom Form Mod
Post by: Lady Night Owl 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

:(
Title: Re: Custom Form Mod
Post by: Nathaniel 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...
Title: Re: Custom Form Mod
Post by: Paracelsus on July 10, 2008, 02:34:09 AM
Quote from: LHVWB 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...

I second that request ;)

Btw, is there any demo we can see with some kind of form?
Title: Re: Custom Form Mod
Post by: 4b11l on July 10, 2008, 02:38:05 AM
Quote from: LHVWB 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...

3rd the request.
Title: Re: Custom Form Mod
Post by: Lady Night Owl on July 10, 2008, 02:49:49 AM
Quote from: LHVWB 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...

OK, sweet! :D Thanks!
Title: Re: Custom Form Mod
Post by: Angelotus 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?
Title: Re: Custom Form Mod
Post by: Nathaniel 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.
Title: Re: Custom Form Mod
Post by: Angelotus 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...
Title: Re: Custom Form Mod
Post by: Nathaniel 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.
                  //   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.
Title: Re: Custom Form Mod
Post by: Angelotus on July 10, 2008, 05:26:50 AM
Quote from: LHVWB 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.
                  //   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
Title: Re: Custom Form Mod
Post by: Nathaniel 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?
Title: Re: Custom Form Mod
Post by: PfalzNacht 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.
Title: Re: Custom Form Mod
Post by: Angelotus on July 10, 2008, 08:16:16 AM
Quote from: LHVWB 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?

Yes very shure! Are there any other files to be editted??
Title: Re: Custom Form Mod
Post by: Nathaniel on July 10, 2008, 08:44:07 AM
Quote from: Angelotus on July 10, 2008, 08:16:16 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.
Title: Re: Custom Form Mod
Post by: PfalzNacht on July 10, 2008, 08:52:42 AM
Thanks LHVWB!

That's the answer.  ;)
Title: Re: Custom Form Mod
Post by: Nathaniel 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!  :-\
Title: Re: Custom Form Mod
Post by: Sakae on July 10, 2008, 09:07:27 AM
Quote from: LHVWB 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...

Well, I think you saw already how many people thanks for this but it's never too much: THANKS MAN!!!
Title: Re: Custom Form Mod
Post by: Angelotus on July 10, 2008, 09:41:29 AM
Quote from: LHVWB on July 10, 2008, 08:44:07 AM
Quote from: Angelotus on July 10, 2008, 08:16:16 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
Title: Re: Custom Form Mod
Post by: jossanaijr on July 10, 2008, 03:24:14 PM
Quote from: LHVWB 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!  :-\
One more! WOW! Thanks.
Title: Re: Custom Form Mod
Post by: Nathaniel on July 10, 2008, 08:18:22 PM
@Angelotus, it seems fine to me... Have you tried uninstalling and re-installing the mod?
Title: Re: Custom Form Mod
Post by: Angelotus on July 11, 2008, 01:29:21 AM
Yes, Have done that as well. Didn't work. The mod does work, only the the texts aren't working...I don't understand, have tried everything...
Title: Re: Custom Form Mod
Post by: digit on July 11, 2008, 02:31:50 AM
Quote from: Angelotus on July 11, 2008, 01:29:21 AM
Yes, Have done that as well. Didn't work. The mod does work, only the the texts aren't working...I don't understand, have tried everything...

What language are you using? 
Title: Re: Custom Form Mod
Post by: Angelotus on July 11, 2008, 04:48:34 AM
English
Title: Re: Custom Form Mod
Post by: digit on July 11, 2008, 04:58:57 AM
Quote from: Angelotus on July 11, 2008, 04:48:34 AM
English

It sounds to me like you didn't add your text strings to Modifications.english.php.
Title: Re: Custom Form Mod
Post by: Angelotus on July 11, 2008, 05:24:11 AM
I thought that was the problem to, but see the previous posts, the files are intact and correctly modified...mysterious problem...
Title: Re: Custom Form Mod
Post by: PfalzNacht on July 11, 2008, 06:30:00 AM
I make the translation into german.

Do you need it?
Title: Re: Custom Form Mod
Post by: Angelotus on July 11, 2008, 11:58:38 AM
If you can make it in Dutch (Nederlands) dan biete schon ;)
Title: Re: Custom Form Mod
Post by: PfalzNacht on July 11, 2008, 12:07:15 PM
I can't speak dutch, and i won't speak dutch.  ;D  
Title: Re: Custom Form Mod
Post by: Marduke on July 13, 2008, 11:29:21 PM
Been needing a mod like this for a long time, couldn't believe my eyes when I seen it!  Too bad it's 2.0 only  :'(.

Looking forward to a 1.1.5 release.


And our group would definitely be interested in donating to the author once it's complete if we're allowed to   ;D
Title: Re: Custom Form Mod
Post by: Nathaniel on July 13, 2008, 11:39:11 PM
Quote from: Marduke on July 13, 2008, 11:29:21 PM
Been needing a mod like this for a long time, couldn't believe my eyes when I seen it!  Too bad it's 2.0 only  :'( .

Looking forward to a 1.1.5 release.


And our group would definitely be interested in donating to the author once it's complete if we're allowed to   ;D

I'm working on it.  :D  Its taking a while to port back, because its fairly difficult.  :'(
Title: Re: Custom Form Mod
Post by: Marduke on July 14, 2008, 12:12:56 AM
Quote from: LHVWB on July 13, 2008, 11:39:11 PM
I'm working on it.  :D  Its taking a while to port back, because its fairly difficult.  :'(

Well we appreciate all the work you're putting into it.  When it's released hopefully we can get your paypal so we can show you our gratitude? :D
Title: Re: Custom Form Mod
Post by: Angelotus on July 14, 2008, 01:22:42 AM
Quote from: LHVWB on July 10, 2008, 08:18:22 PM
@Angelotus, it seems fine to me... Have you tried uninstalling and re-installing the mod?

It works now. I guess it had to do with caching the language files. I empty the cache and it worked...
Title: Re: Custom Form Mod
Post by: Nathaniel on July 14, 2008, 02:16:20 AM
Quote from: Angelotus on July 14, 2008, 01:22:42 AM
Quote from: LHVWB on July 10, 2008, 08:18:22 PM
@Angelotus, it seems fine to me... Have you tried uninstalling and re-installing the mod?

It works now. I guess it had to do with caching the language files. I empty the cache and it worked...

Ah, "LHVWB bashes his head against the keyboard, repeatedly."

That's really annoying! The package manager usually does that automatically, but it great that its working now, sometimes the simplest problems can be the most annoying! ;)
Title: Re: Custom Form Mod
Post by: Angelotus on July 14, 2008, 02:58:21 AM
hahaha, anyway thanks for helping ;D
Title: Re: Custom Form Mod
Post by: erlend_sh on July 16, 2008, 09:38:04 PM
Finally got around to start playing with this mod today, and it's exactly what I've been looking for for a very very long time. Just perfect.

I'm very low-tech though, so I'm wondering, what is the difference between 'Text Box' String, Float and Integer? Didn't notice a difference between String and Float after a quick test, but the integer one didn't show...

Feature Suggestions:

We're using this as an application form to our development team. Part of this procedure involves showing us references for previous work, which would be easiest to do by attachments. Any chance you could add the ability to add attachments to the form?

I'd also like to see some squares or some other kind of simple addition to the visuals in order to more easily seperate between the distinctive items. It gets a little crowdy in there sometimes, and when the text appears far away from the text box it can get difficult to spot the appropriate textbox...

Any chance I could have the ability to add a hr wherever I'd like? Possibly as {hr}.

I'd like to be able to make non-textbox fields, e.g. normal text with some bbcode. Here and there I'd like to say a couple words real quick.

See our form here (http://radakan.org/forums/index.php?action=form), and an example posting here (http://radakan.org/forums/index.php/topic,695.0.html).

Oh and also, there seems to be a bug, but I don't know yet how exactly I'm producing it. But sometimes an empty field has been added for some reason.
Title: Re: Custom Form Mod
Post by: Nathaniel on July 16, 2008, 11:13:20 PM
Okay, a text box will allow you to put any text into it, while a float box will only allow numbers that are also floats such as 3, 3.6767, 45.45 and etc. An int box will allow any integers above 0 such as 1, 2, 454656 and 3.

In terms of adding attachments, I think that its moving a bit too far away from the main functionality of this mod, if you want attachments then you should be able to add attachments after you have submited the form by modifying it. I probably won't add that to the mod, because its only useful in certain circumstances, can be done with the above method and it would require a lot of work to add....

In terms of the graphics, I am aware that I'm not particularly good at them, if you want to muck around with the templates then they are mostly located in the "CustomForm.template.php" file, so you can easily edit them, except for the page which shows the form itself which is produced by one of the SMF templates. I don't think I completely understood what you want to do, but I will have a look into it.

I'm not sure of what you mean by "Any chance I could have the ability to add wherever I'd like? Possibly as {hr}.".

The empty field issue may be due to you having a field which you have added in the admin area which has no text/title/etc.

I will have a better look through some of the suggestions that you have made, when I get home - writing from school. I'm glad you like the Mod, I designed it to be very general so it can be useful for as many people as possible. :D Thank you for the comments and suggestions.

Thank you,
LHVWB

Edit: I had a look at your website, and I think I know what you mean with the displaying of graphics, I will have a look into it...
Title: Re: Custom Form Mod
Post by: Nathaniel on July 17, 2008, 02:23:40 AM
Below I have specified the current changes that I will be looking at for a 1.1 version of this mod, if you have any other suggestions then please post them. The main changes for version 1.1 of this mod will be bug-fixes. I will try to update the mod when I get time, but first I want to finish the mod for SMF 1.1.5 which will hopefully have none of the bugs and some of the features of the 1.1 version for SMF 2 Beta, I then want to create a few other Mods, so the timeframe may end up being about 1 to 2+ weeks.

Okay, at the moment here is a list of known bugs:
Features to add/think about:Update for SMF 1.1.5 porting: This is almost finished now, I only have to check the mod for bugs and do some alpha testing then it should be completed. I will hopefully release it sometime this weekend. It might take me a bit longer if I choose to add some of the new features to this version of the Mod.
Title: Re: Custom Form Mod
Post by: 4b11l on July 17, 2008, 03:28:40 AM
Quote from: LHVWB on July 17, 2008, 02:23:40 AM
Update for SMF 1.1.5 porting: This is almost finished now, I only have to check the mod for bugs and do some alpha testing then it should be completed. I will hopefully release it sometime this weekend. It might take me a bit longer if I choose to add some of the new features to this version of the Mod.

Thanks for all the hard work. Keeping this thread bookmarked until 1.1.5.
Title: Re: Custom Form Mod
Post by: erlend_sh on July 17, 2008, 07:43:20 AM
Thanks for considering my suggestions! The sentence you didn't understand was supposed to be
"Any chance I could have the ability to add a hr wherever I'd like? Possibly as {hr}."
so I think I can imagine where the ball dropped :P

I think we're on the same page now. Really, it's just a matter of being able to add descriptional text without any textbox joining the fun. When this is added, this mod is done to me, though I'd probably still make subtle suggestions about further improvements as we'll be using this mod frequently if it turns out the way we hope it will. Oh and btw, our plan is to make the thread made go into a closed forum that only the admins can see, as we'll be reviewing the application in private there. So in our case, the applicant would not be able to edit his post in order to add attachments afterwards. Still, attachments isn't that important, as there are many other ways around this.
Title: Re: Custom Form Mod
Post by: nopity4u on July 17, 2008, 07:33:06 PM
Waiting on the 1.1.5 myself :)
Title: Re: Custom Form Mod
Post by: Marduke on July 17, 2008, 09:15:24 PM
REALLY glad to hear 1.1.5 version is almost done  :D


Will help with organization a TON.  I like things looking nice a neat.  Can never depend on people to follow a template.
Title: Re: Custom Form Mod
Post by: digit on July 18, 2008, 04:25:37 AM
Quote from: Marduke on July 17, 2008, 09:15:24 PM
REALLY glad to hear 1.1.5 version is almost done  :D


Yay!  Me too!
Title: Re: Custom Form Mod
Post by: Nathaniel on July 18, 2008, 05:24:57 AM
Yeah, I'm working on it....

The SMF 1.1.5 version will be at version 1.1 for the mod when I release it, so the next version of the SMF 2 Beta part of the Mod will be coming out soon after as well...
Title: Re: Custom Form Mod
Post by: Shortrnd on July 18, 2008, 12:54:42 PM
Quote from: LHVWB on July 18, 2008, 05:24:57 AM
Yeah, I'm working on it....

The SMF 1.1.5 version will be at version 1.1 for the mod when I release it, so the next version of the SMF 2 Beta part of the Mod will be coming out soon after as well...

Great news!  Patiently awaiting your next release.  Again, thanks for offering this mod and all the support you've given.
Title: Re: Custom Form Mod
Post by: digit on July 19, 2008, 12:18:05 PM
I don't know is this is an issue with the Package manager or this mod...  but I just did a fresh install of SMF 2.0 Beta 3.1 Public,

Then I tried to use the package manager to install the custom form mod.

The tests pass, but I see no way to apply the mod..... see attachment.

There are no mods visible under admin>Configuration>Modifications either.

What gives?
Title: Re: Custom Form Mod
Post by: Nathaniel on July 19, 2008, 07:31:40 PM
@digit,
No idea what the issue is, it may be with your package manager. Have you tried installing any other Mods to see if the same issue occurs?  ???

I have tested this mod on multiple clean copies of SMF 2 Beta 3.1 so it should work.  :(
Title: Re: Custom Form Mod
Post by: digit on July 19, 2008, 09:35:17 PM
Hi....

I think my problem has to do with the fact that my server uses sftp - when I changed my "ftp" details, somehow it got cached, then broke things.  I am having the same problem with other mods.  NOT FUN.  >:(

I normally manually install my mods because of this, but install.php looks greek to me! (I am used to manually installing mods on 1.1.5)  Do you have a manual install version of that file?

For example - I don't understand....

$smcFunc['db_create_table']('cf_forms', $columns, $indexes, array(), 'update_remove');

Thanks!

Edit: woo hoo - I did a fresh re-install, and this time, instead of entering my ftp info - I noticed a small link that says "some files need to be writable see a list of files effected".  I clicked on that and saw I needed to chmod 777 these files....

chmod 777 /mysite/index.php
chmod 777 /mysite/Sources/Admin.php
chmod 777 /mysite/Sources/ManageSettings.php
chmod 777 /mysite/Sources
chmod 777 /mysite/Sources/CustomForm.php
chmod 777 /mysite/Themes/default
chmod 777 /mysite/Themes/default/CustomForm.template.php
chmod 777 /mysite/Themes/default/languages/Modifications.english.php
chmod 777 /mysite/Themes/default/languages/Help.english.php

I did that, and voila - my Install button (submit button) appeared!

It installed perfectly.

Thanks - now I need to see the power of this baby. :)
Title: Re: Custom Form Mod
Post by: Nathaniel on July 19, 2008, 11:03:08 PM
Glad to hear it is working now. :D

If you want to learn more about the "$smcFunc['db_create_table']('cf_forms', $columns, $indexes, array(), 'update_remove');" code, then you can read about it below. It basically creates a new table. :)
http://www.simplemachines.org/community/index.php?topic=224166.0
Title: Re: Custom Form Mod
Post by: nopity4u on July 20, 2008, 12:33:47 AM
This 1.1.5 update is coming at the best time for my new forum.
Title: Re: Custom Form Mod
Post by: Nathaniel on July 20, 2008, 12:52:09 AM
Yeah, I'm working on it... Its taking me a bit longer than expected because I'm releasing it at version 1.1 for this mod and I also had to fix up another mod which had some issues. ;)

But hopefully sometime tonight, (for me). Or tomorrow...
Title: Re: Custom Form Mod
Post by: nopity4u on July 20, 2008, 03:01:07 AM
Thank you, kind sir  :D

It's selfless people like you who enable idiotic people like me to be able to create fully featured websites/forums.
Title: Re: Custom Form Mod
Post by: digit on July 20, 2008, 04:28:22 AM
Quote from: nopity4u on July 20, 2008, 12:33:47 AM
This 1.1.5 update is coming at the best time for my new forum.

lol...  you have hungry wolves hanging around in here (including me!)  8)


ok, I have it working.... are you ready for a few feature requests?

1. I am not sure how the field order works.  I would like to be able to set the field order. (where they appear on the page)

2. I would like to have a text area field option that contains the BBC code stuff. :)

3. I would like these custom fields to appear (optionally) on the standard post page, so users can control the title of the post.

4.  I would like to add fields to the Advanced Search page, so users can search only these new fields.

VERY cool mod, but until I can do #3 & 4, it's not quite what I had in mind / needed.    :(

Thanks again!

Title: Re: Custom Form Mod
Post by: Nathaniel on July 20, 2008, 05:10:26 AM
@digit,
Okay I will go through the requests systematically.

1. The order that fields are placed in, is exactly the same as they are presented on the admin page, which is the order they are created in. I must admit that there probably should be a way of moving them around, I will try to include this in version 1.1 of the mod.

2. Okay, that's actually quite possible and 'easy', only because I've already done it once for this mod. I will consider adding that as a new type to the next version.

3. I am sorry, but this is not the point of the mod at all. I'm not trying to allow you to edit your Post pages, I am trying to allow you to create 'Custom Forms' so that you can allow/force users to submit information in a in a highly structured manner. If I add the 2nd request, it will be fairly similar anyway..

4. With this request, I get the feeling that you are completely misinterpreting how this mod works. This mod does not store the values that are entered into the separate fields by a user, it merely creates a post, thus if a user searches for the correct term then it will come up in the post that was created.

The process works like this,
1) Admin creates a form, adds fields to it, gives it a subject, a body, a board id and etc.
2) User fills in the form and then submits it.
3) The mod then uses the 'output' post for the form, and replaces all necessary {vars} with their values from the user. Then finally the end result is submitted as a post. All other data submitted by the user is ignore and not stored.

I hope that I have cleared up the aims of this mod, I believe that they can be summarized by the sentence below.

"To Allow admin to create their own Custom Forms, thus meaning that users can/have to submit information as a post in a structure manner"

I am more than happy to consider any feature requests though, so thank you for your suggestions. I will definitely implement requests 1 and 2 at some stage.

Thank you,
LHVWB
Title: Re: Custom Form Mod
Post by: digit on July 20, 2008, 05:15:05 AM
Ok, :)  I wasn't really misunderstanding it, I just wanted something a little different.   ;)  I guess I need to submit a new mod request!  I didn't mean to confuse people here!

It's still a GREAT mod - and I do intend to use it for, as you said...  it's intended use... support forms, etc!
  8)

digit.

p.s., about the field order...  I created three fields...  1, a select pull down menu... 2, a text area, and 3 another select menu. I decided I wanted both select menus above the text area field.  So, I deleted the text area field, and recreated it in last position, but when I went back to the form, it was in the middle again.  I repeated all that and the text area field was at the bottom where I wanted it!  quien sabe (http://www.merriam-webster.com/dictionary/quien%20sabe)!
Title: Re: Custom Form Mod
Post by: Nathaniel on July 21, 2008, 02:24:40 AM
I know that its possible to move fields around, but I have implemented a way (more of a nasty hack) with allows you to swap them around, thus saving rebuilding your entire form when you want to add a new field near the top of your 20 field form. Anyway, because of that and some more testing, this mod for SMF 1.1.5 didn't get done last night so I will try to finish my testing and release it tonight. But I want to make sure that there are no bugs below I release it, otherwise that would get really annouying. ;)
Title: Re: Custom Form Mod
Post by: nopity4u on July 21, 2008, 03:24:54 AM
I'm fine with bugs, just send it my way ;)

Title: Re: Custom Form Mod
Post by: Nathaniel on July 21, 2008, 07:09:38 AM
Quote from: nopity4u on July 21, 2008, 03:24:54 AM
I'm fine with bugs, just send it my way ;)

I would, but I want to make sure that the SMF 1.1.5 version is completly bug-free when I release it because otherwise I would have to spend even more time, sorting out exactly what the bugs are, its much easier if I have done a through check and I know about an problems - I would eventually like to move onto some other mod ideas that I have. Anyway, I haven't gotten as much work done on this as I would like so It''ll take some more time... :'(
Title: Re: Custom Form Mod
Post by: nopity4u on July 21, 2008, 10:54:04 AM
I'll pass on this mod idea to ya and see what you think. When you make posts (and replies) you see how you can link pictures or add attachments right? Well I sometimes want my pictures displayed in the post but I don't want to link them and instead want to host them locally. So why not have a mod that is a button above posts/replies that you click to upload a picture. Right after it uploads the picture it links to it.

Example:

Above, by the picture icon there is another picture icon with an up arrow on it. I click this and select the picture and it uploads. After uploading it inserts
the img tag along with the picture already linked. In the Admin panel there could be a place to set the default upload directory.
Title: Re: Custom Form Mod
Post by: Nathaniel on July 21, 2008, 05:55:06 PM
Quote from: nopity4u on July 21, 2008, 10:54:04 AM
I'll pass on this mod idea to ya and see what you think. When you make posts (and replies) you see how you can link pictures or add attachments right? Well I sometimes want my pictures displayed in the post but I don't want to link them and instead want to host them locally. So why not have a mod that is a button above posts/replies that you click to upload a picture. Right after it uploads the picture it links to it.

Example:

Above, by the picture icon there is another picture icon with an up arrow on it. I click this and select the picture and it uploads. After uploading it inserts
the img tag along with the picture already linked. In the Admin panel there could be a place to set the default upload directory.

It sounds like quite a good idea, but maybe you should post it in the Mod Requests Board (http://www.simplemachines.org/community/index.php?board=79.0).  I might have a furthur look into it when I get some time, but its probably best to make a new thread, to see if anyone else is interested in creating it.
Title: Re: Custom Form Mod
Post by: nopity4u on July 21, 2008, 06:40:42 PM
Will do :)

A Question, or possibly suggestion for your mod would be to have conditional options for each custom profile field (perhaps adding 4 more too..)

Right now I am trying to go into usercp.template.php and create an if statement to allow only a certain membergroup from seeing this particular icon.

The icon was supposed to function as a one time click for each member. I have an email/ftp request form that I will be setting up with your mod and I have only one membergroup that is allowed to request it. These members have basically paid for these features through the paid subscriptions mod and were assigned into this group. So, what I am wanting to happen is to have an Icon/Summary show 'ONLY' for this membergroup.

How would I go about editing the template file to enable this?

Thanks!
Title: Re: Custom Form Mod
Post by: Marduke on July 21, 2008, 10:16:27 PM
Never been looking forward to a script so much!   :P


Edit:  And jesus people, let him release 1.1.5 version before making a ton of requests!  Many of us would just love to be able to use this modification, and don't want to wait for things to be added.  The base modification is practically perfect anyways!  ;D
Title: Re: Custom Form Mod
Post by: Marduke on July 22, 2008, 11:09:33 PM
If you need any help testing, I'd be more than willing :)
Title: Re: Custom Form Mod
Post by: Nathaniel on July 23, 2008, 12:10:26 AM
@Marduke, thanks for offering, but its no longer necessary.  :D

Mod Changes v1.1:
Added SMF 1.1.5 version.
Added the new custom template stuff.
Some minor bugfixes.

I have finally completed this mod for SMF 1.1.5, it took a while and the testing phase ended up being really annoying because it had a lot of bugs. I have implemented a few of the suggestions by people and also fixed a few bugs from the 1.0 version of the SMF 2 Beta mod. I will try to update the SMF 2 Beta version of the Mod sometime in the next few days.  :D :D :D

I will also try to update the documentation later today when I have some more time.

Thank you,  :D
LHVWB
Title: Re: Custom Form Mod
Post by: nopity4u on July 23, 2008, 01:04:09 AM
Thanks good sir, you rock.
Title: Re: Custom Form Mod
Post by: nopity4u on July 23, 2008, 01:15:12 AM
Just realized I was asking you a question about the User CP mod. Haha :P
Title: Re: Custom Form Mod
Post by: 4b11l on July 23, 2008, 01:21:36 AM
Woohoo! Thanks a lot bro! Been waiting for a while.
Title: Re: Custom Form Mod
Post by: digit on July 23, 2008, 01:50:01 AM
Yeah - very cool!  Installed it w/o problem.

Any chance we are going to have the BBC stuff and attachments doohickies in the text area box any time soon?

This is going to be a fun mod to play with.  :)  Thanks!
Title: Re: Custom Form Mod
Post by: Nathaniel on July 23, 2008, 01:54:53 AM
Hmm, at the moment I am just really happy that I've actually finished it and It doesn't have many bugs. ;)

I am happy to take more suggestions for types of fields that I could add to this mod in the future. Although I make no promises as to a timeframe for adding them. ;)

Possible New Field Types:I will add to this list if anyone has any other ideas.

Edit:
@nopity4u,
I hadn't even realised that you had made a post in this thread about the "User CP" mod until you pointed it out, I've been too busy concentrating on finishing the mod for SMF 1.1.5. ;)
Title: Re: Custom Form Mod
Post by: 4b11l on July 23, 2008, 01:57:01 AM
Great mod once again LHVWB.

Just want to put this out in case someone have the same problem as I did.

My modsettings.php failed the Test.

I ended up doing that file manually, but then Features and Options in ACP didn't work. So, I moved the
'customform' => 'CustomFormSettings',

down below
'sig' => 'ModifySignatureSettings',

That got my Features and Options working and the link can be accessed via ACP>Features and Options.
Title: Re: Custom Form Mod
Post by: Sudhakar Arjunan on July 23, 2008, 02:03:37 AM
Hey LHVWB,

I have installed your mod and found its really interesting.

I showed me one error in modsettings page and i have manually modified it.

Went through the admin panel , selected custom form. Created a form and entered the text.

But it does not showed me as done and refresh with fields.

First in mod settings , i entered title as support and form text . Clicked Save - nothing happen.
Second went to add form, added a board number, given name , title etc and clicked save. - nothing happened.

came out of add form page and saw the page is already showing . ok then entered setting - saved - nothing happened.

Went to forum support link and it shows only index page.

Any suggestion , and using 1.1.5 and no error while install . Manually modded mod settings page.
Title: Re: Custom Form Mod
Post by: digit on July 23, 2008, 02:09:10 AM
Small suggestion....  A multi-checkbox field would be nice...  instead of the current yes or no checkbox.


Title: Re: Custom Form Mod
Post by: 4b11l on July 23, 2008, 02:17:08 AM
Quote from: digit on July 23, 2008, 02:09:10 AM
Small suggestion....  A multi-checkbox field would be nice...  instead of the current yes or no checkbox.




Hey bro, how did you get the checkboxes to work.

I tried "Yes, No" but that didn't show up correctly. What are you suppose to use when he say Strings. Thanks.

EDIT:
Getting an error after submitting about no board id? The form is posting to the board correctly.
8: Undefined index: article_category
File: /home/xpeng065/public_html/Sources/Subs-Post.php
Line: 1548


FIXED:
Deleted what was on that line:
'ID_CATEGORY' => $topicOptions['article_category'],

Was it something for the smfbeta 2?
Title: Re: Custom Form Mod
Post by: digit on July 23, 2008, 02:24:04 AM
Hmm, I guess it's just a single check box.  8)
Title: Re: Custom Form Mod
Post by: nopity4u on July 23, 2008, 02:26:26 AM
Everythings working fine here. A small and rather trivial feature request would be to have the submit button after entering the form information take you directly to the topic rather than the board.
Title: Re: Custom Form Mod
Post by: nopity4u on July 23, 2008, 02:27:39 AM
Quote from: 4b11l on July 23, 2008, 02:17:08 AM
Quote from: digit on July 23, 2008, 02:09:10 AM
Small suggestion....  A multi-checkbox field would be nice...  instead of the current yes or no checkbox.




Hey bro, how did you get the checkboxes to work.

I tried "Yes, No" but that didn't show up correctly. What are you suppose to use when he say Strings. Thanks.

EDIT:
Getting an error after submitting about no board id? The form is posting to the board correctly.
8: Undefined index: article_category
File: /home/xpeng065/public_html/Sources/Subs-Post.php
Line: 1548


I think that error has to do with Simple Portal.
Title: Re: Custom Form Mod
Post by: Nathaniel on July 23, 2008, 02:29:29 AM
@4b11l, #1
I think that that error would only be occuring if you have a mod which changes or removes the 'karma' tab from the modsettings area. I have made a note of that, and I will make a fix for that in the next version although its not that urgent.

@4b11l, #2
If you have put the {var} in the output post and you have named it correctly then it should show "Yes" for true and "No" For false by default, otherwise you can add them to the "Extra Type Parameters" setting, the help button documents it a bit better. ;)

@asudhakar,
I am not entirely sure what you are talking about, but make sure that you have valid board id, title, output, subject and ect. for the form, as well as at least one field with valid text and title.

@digit,
Okay, I have added it to the list and I will have a think about it. My only thoughts are about what the output would look like, it would have to put together the output like a list or something and its already possible to get similar functionality with a series of checkboxes. If you want to create a peusdo one then you could use the custom template function setting - I will try to document it better later today.

Although if you can show me a good example then you might convince me. ;)
Title: Re: Custom Form Mod
Post by: 4b11l on July 23, 2008, 02:31:23 AM
Quote from: nopity4u on July 23, 2008, 02:27:39 AM

I think that error has to do with Simple Portal.

I see, I'll look into it some more. Thanks.
Title: Re: Custom Form Mod
Post by: 4b11l on July 23, 2008, 02:34:13 AM
Quote from: LHVWB on July 23, 2008, 02:29:29 AM
@4b11l, #2
If you have put the {var} in the output post and you have named it correctly then it should show "Yes" for true and "No" For false by default, otherwise you can add them to the "Extra Type Parameters" setting, the help button documents it a bit better. ;)

I'm a little lost, I was lost in the help button documentation also. So in the output, would I put {yes} {no}?

I have it tested as:

Is today monday?
{yesno}


yesno being the field name/title.
Title: Re: Custom Form Mod
Post by: Nathaniel on July 23, 2008, 02:36:48 AM
Quote from: 4b11l on July 23, 2008, 02:31:23 AM
Quote from: nopity4u on July 23, 2008, 02:27:39 AM

I think that error has to do with Simple Portal.

I see, I'll look into it some more. Thanks.

@4b11l,
The line from your earlier post was not added by this mod as far as I know. Its possible that there may be some compatibility issues with this mod and the Simple Portal Mod. I will try to have a look into this later and if I find some issues I will post a tutorial to show anybody that comes accross the issue, how they can fix it.

You need to put {field Title} in the output, it will be replaced by the value that is sent by the form. So if you called the field "yesno" then it would be '{yesno}'.
Title: Re: Custom Form Mod
Post by: digit on July 23, 2008, 02:44:32 AM
Quote from: LHVWB on July 23, 2008, 02:29:29 AM
@digit,
Okay, I have added it to the list and I will have a think about it. My only thoughts are about what the output would look like, it would have to put together the output like a list or something and its already possible to get similar functionality with a series of checkboxes. If you want to create a peusdo one then you could use the custom template function setting - I will try to document it better later today. Although if you can show me a good example then you might convince me. ;)

Doh!  That works for me!  If I can think of something more complicated, I'll certainly let you know!   8)
Title: Re: Custom Form Mod
Post by: 4b11l on July 23, 2008, 02:45:55 AM
^
Yes, that's how I have it setup. It's not showing properly and I just want to know if I'm entering the parameters right or what I'm doing wrong.

Title: Re: Custom Form Mod
Post by: digit on July 23, 2008, 02:55:42 AM
I did it like this... It's still unfinished.

It might also be nice to create a field that is just for txt or horizontal rulers.

Sigh, and what about radio buttons?

:P


Title: Re: Custom Form Mod
Post by: 4b11l on July 23, 2008, 03:00:24 AM
^
Wouldn't that defeat the purpose? Like if they checked both, it would send you both answers right? Or is that the way you have to actually do it? Just curious. ;)
Title: Re: Custom Form Mod
Post by: digit on July 23, 2008, 03:03:25 AM
Like I said, the form is unfinished. lol.    I own, a Camaro AND a Corvette, might make more sense. :)
Title: Re: Custom Form Mod
Post by: 4b11l on July 23, 2008, 03:08:47 AM
Quote from: digit on July 23, 2008, 03:03:25 AM
Like I said, the form is unfinished. lol.    I own, a Camaro AND a Corvette, might make more sense. :)

I see where you are getting it at.

I was under the impression that it would give you both options in the parameter to checkoff. Either checking off one or the other. After my 100th time reading through the documentation help button; I finally understood it! :D lol

It would have to be like:
Do you have a corvette? Check if yes.

Where checking it will output Yes. Not checking it would output No.
Title: Re: Custom Form Mod
Post by: Nathaniel on July 23, 2008, 03:20:45 AM
@4b11l,
I am glad that you understood it, if you need any more help then I am always happy to try to explain things better.

@digit,
Radio buttons aren't a bad idea, I will add them to the list, although yet again you could just use the 'selectbox' type and then create a custom template function which shows them differently. Because if you think about it and have a look at the current function (the first one in the 'CustomForms.template.php' file) and how it works, you can see that they are the same except for how they are displayed.
Title: Re: Custom Form Mod
Post by: nopity4u on July 23, 2008, 03:37:56 AM
Quite a nice mod this is. I use it in combination with the "User CP"  Mod and the Post Prefix mod. My users go to their profiles for a request button and it links them to the form. It then posts their answers to a forum and I can modify their post and add the Prefix [ACTIVE] to their requests. They all work well together.
Title: Re: Custom Form Mod
Post by: digit on July 23, 2008, 03:47:04 AM
@nopity4u, could you expound on that a little bit?

Another feature request:  I would like users to be able to use a custom form to send me, the admin pm's (so feedback isn't publicly displayed)  Any chance of that in an upcoming release? (and I will also look at the function, and see why radio buttons are not needed)   :P

Title: Re: Custom Form Mod
Post by: Nathaniel on July 23, 2008, 03:54:48 AM
@nopity4u,
Its good to hear that you are using the mod effectively with other mods. :)

@digit,
That could indeed be a useful feature, for the moment you could get a similar functionality, where all the posts are private, by creating a board that users cannot see or post in and then setting that as the board for the form and setting the permissions for the form so that normal users have access. The permissions for posting in/viewing a board actually don't matter to this mod in the slightest, it will make a post in the board and then the user won't be able to see the post, to expand on the idea, it would be nice if you could show a specific message to the user after they have submitted the form, just so they know its worked. ;)

Title: Re: Custom Form Mod
Post by: Nathaniel on July 23, 2008, 08:08:29 AM
@nopity4u,
In response to this post I missed earlier:
Quote from: nopity4u on July 23, 2008, 02:26:26 AM
Everythings working fine here. A small and rather trivial feature request would be to have the submit button after entering the form information take you directly to the topic rather than the board.

I think that that would be a very useful feature, I will investigate it being either according to the setting that you can chose in your profile area or an extra option that you can allow the user to choose for each form.
Title: Re: Custom Form Mod
Post by: erlend_sh on July 23, 2008, 10:23:56 AM
1.1 is out, yay! Thanks a lot LHVWB! We'll be making great use of this mod.

QuoteI have finally completed this mod for SMF 1.1.5, it took a while and the testing phase ended up being really annoying because it had a lot of bugs. I have implemented a few of the suggestions by people and also fixed a few bugs from the 1.0 version of the SMF 2 Beta mod. I will try to update the SMF 2 Beta version of the Mod sometime in the next few days.  :D
Does this mean the 2.0 version is not yet updated with template capabilities ???

The download page also had me confused...
Quote
CustomFormMod_v1.0_SMF2.zip (13KB) [127]  
CustomFormMod_v1.1_SMF1.1.5.tar.gz (14KB)
So, the 1.1 version is for SMF 1.1.5 then, and 1.0 is for 2.0, correct? Also meaning that the 2.0-compatible version is not yet updated with 1.1 functionality? Guess this means I won't be making a new install right away after all. Also, will I be able to upgrade the 2.0-compatible version straight to v1.1 without uninstalling?
Title: Re: Custom Form Mod
Post by: nopity4u on July 23, 2008, 11:14:15 AM
Quote from: digit on July 23, 2008, 03:47:04 AM
@nopity4u, could you expound on that a little bit?

Another feature request:  I would like users to be able to use a custom form to send me, the admin pm's (so feedback isn't publicly displayed)  Any chance of that in an upcoming release? (and I will also look at the function, and see why radio buttons are not needed)   :P



User CP Mod allows you to have a nice User Control Panel area in which you can add custom icons to link to where you want. I made one that links to index.php?action=form
I then have a Request form setup for email/ftp accounts. After they submit the form it places their posts into a board where they can only view their own posts and no one elses, nor can they reply or create topics. (The Mod still works fine and creates the topic in their name)  The mod that does this is called "View Any Topic". So I basically ask them for their username and password for their email accounts and ftp. I then go into cpanel and create both and once done I modify their post prefix to [ACTIVE] and they see that they can now use their FTP and EMAIL.

I use Paid Subscriptions for FTP and EMAIL which places them in the usergroup after payment. This subscriber usergroup allows the view access for the request  board that the custom form mod places the submissions into.

That's basically how I am using the mod :)
Title: Re: Custom Form Mod
Post by: Lady Night Owl on July 23, 2008, 01:18:43 PM
I'm getting this error when I go to features and options:

Parse error: syntax error, unexpected '=', expecting ')' in forums/Sources/ModSettings.php on line 1681

I believe it is coming from the following code:

// Take us to the newly created field.
redirectexit("action=featuresettings;sa=customform;field_id=".$field_id.";");
}


Thank you for getting the 1.1 version out so quickly. :) I can't wait to get this error fixed so I can get the forms up and running.
Title: Re: Custom Form Mod
Post by: Nathaniel on July 23, 2008, 05:26:16 PM
@Sadr,
You are correct in thinking that I have not finished the 1.1 version for SMF 2 Beta, I am currently working on it. It shouldn't take me too long because it will be very similar to the SMF 1.1.5 one, and the main changes were not to do with db queries to I can probably just copy chunks of code to do it relatively quickly. I hope to have it done today or tommorrow so that I can think about finishing another mod. ;)   To upgrade between versions, you will be able to uninstall the old one and then install the new one, the package manager should give you an option not to delete the data that is stored.

@nopity4u,
Sounds good. The trick to an open-ended mod like this, is to be as inventive as possible with the functionality that it has. I have tried to add more with the template functions to make it easier to customize.

@Lady Night Owl,
It would appear to me that that is not the correct line because there is nothing wrond with it. Its possible that the internal error checking in SMF 1.1.5 could be making a mistake due to some iterations or something, I've had it happen before. Could you please post that entire file so I can have a better look at it?

Edit:
Sorry I didn't get around to documenting the new features yet, I will try to do that tonight.
Title: Re: Custom Form Mod
Post by: Lady Night Owl on July 23, 2008, 06:11:49 PM
Ok, here's the file. Thanks for taking a look. Hopefully, it's not another mod interfering with this one.
Title: Re: Custom Form Mod
Post by: Nathaniel on July 23, 2008, 06:31:13 PM
Quote from: Lady Night Owl on July 23, 2008, 06:11:49 PM
Ok, here's the file. Thanks for taking a look. Hopefully, it's not another mod interfering with this one.

Hopefully not, I will have to have a look at this later today now because I am now at school so I can't. ;)
Title: Re: Custom Form Mod
Post by: Gryphoune on July 23, 2008, 08:39:56 PM
I want to use this mod to create an application form for membership to an adult gaming guild. What permissions do I need to set to have the propsed member (guest) view and submit the form which then posts the answers to an officer only board for consideration? I've pretty much created the form but want to make sure I get the permissions set correctly.
Title: Re: Custom Form Mod
Post by: Nathaniel on July 23, 2008, 10:32:30 PM
For the form you need to change the permissions option so that only guests can view and submit forms, then you need to change board id to the id of the board that you want the applications to be sent to. Finally you will have to make sure that only your staff membergroups have access to that particular board.

I suggest making a test user for each of your membergroups and testing out the permissions if you really want to make sure that it works perfectly.
Title: Re: Custom Form Mod
Post by: Nathaniel on July 24, 2008, 02:11:40 AM
@Lady Night Owl,
I am very impressed with your 'ModSettings.php' file, its a classic case of mod installations gone wrong, it appears that you had manually/not manually installed this mod twice. I have removed that error, but also instead of having an equals sign or other normal symbols, the code had somehow been changed so that they were HTML entities like '<' and '=>' probably because you manually copied it from a package parser that give you the entities wrongly, which were causing that error that you posted about earlier.

I have fixed these mistakes and uploaded your ModSettings.php file again. Hopefully it should work now, it definitely wasn't a conflict with any of the other mods.
Title: Re: Custom Form Mod
Post by: Paracelsus on July 24, 2008, 04:06:10 AM
Great Mod LHVWB!

I will use it perhaps in a few weeks, but I can ask you in advance: I would like to do a form to submit soccer score predictions every week, like for example:

X-team (blank square where you put a score) - (blank square...) Y-team
Y-team (blank square...) - (blank square...) Z-team
and so on...

Is it possible to do this? And if so, is it possible that, when form is submitted, posts from all users are created in the same topic?
Title: Re: Custom Form Mod
Post by: Nathaniel on July 24, 2008, 05:00:04 AM
Its definetly possible to create a form like that. However at the moment, every post creates a new thread, but thinking about your use for this mod, I have thought of some new features that I could add to it. But for your purposes, you could create a new child board for each week and then change the form so that it will submit the thread to the correct child board, that would allow people to comment on peoples predictions and etc. If you wanted them to, otherwise you could set the permissions so that they can't.

Possible new features:
A topic id for the form, so that it will make a new post in the topic, instead of an entire new thread. (This would actually be really easy to implement.)

I will add to the list as I think of some more.

Edit:
Quote
I will use it perhaps in a few weeks,
Lol, In a few more weeks I might have made another 5 versions and completed my plans for world domination.  ;D

Title: Re: Custom Form Mod
Post by: Paracelsus on July 24, 2008, 06:09:03 AM
Quote from: LHVWB on July 24, 2008, 05:00:04 AM
Lol, In a few more weeks I might have made another 5 versions and completed my plans for world domination.  ;D

LOL... will you release that as MOD (so that we can also conquer other planets)? :P :P
Title: Re: Custom Form Mod
Post by: Nathaniel on July 24, 2008, 07:39:33 AM
Note to all:
I have now updated the documentation and added a demo site for the SMF 1.1.5 version of this mod:
http://www.verbtest.com/smfdemo/index.php (http://www.verbtest.com/smfdemo/index.php)

Please tell me if you think that I have left anything out of the documentation.

I will now start to port the new version changes to SMF 2 Beta.

Thank you,
LHVWB

Edit:
Conquering other planets might be an added feature, to think about in a later version. ;)
Title: Re: Custom Form Mod
Post by: Lady Night Owl on July 24, 2008, 02:04:55 PM
Quote from: LHVWB on July 24, 2008, 02:11:40 AM
@Lady Night Owl,
I am very impressed with your 'ModSettings.php' file, its a classic case of mod installations gone wrong, it appears that you had manually/not manually installed this mod twice. I have removed that error, but also instead of having an equals sign or other normal symbols, the code had somehow been changed so that they were HTML entities like '<' and '=>' probably because you manually copied it from a package parser that give you the entities wrongly, which were causing that error that you posted about earlier.

I have fixed these mistakes and uploaded your ModSettings.php file again. Hopefully it should work now, it definitely wasn't a conflict with any of the other mods.

lol, that will teach me to install mods when I'm on less than full alert. Thank you for fixing it, I can now view my features and options page. Looking forward to making some forms :D
Title: Re: Custom Form Mod
Post by: nopity4u on July 24, 2008, 02:24:37 PM
Quote from: LHVWB on July 24, 2008, 07:39:33 AM
Note to all:
I have now updated the documentation and added a demo site for the SMF 1.1.5 version of this mod:
http://www.verbtest.com/smfdemo/index.php (http://www.verbtest.com/smfdemo/index.php)

Please tell me if you think that I have left anything out of the documentation.

I will now start to port the new version changes to SMF 2 Beta.

Thank you,
LHVWB

Edit:
Conquering other planets might be an added feature, to think about in a later version. ;)

Better make sure that that sort of option is only available in a premium version that costs $$$ :)
Title: Re: Custom Form Mod
Post by: Gryphoune on July 24, 2008, 03:48:55 PM
I set the permissions so that only guest can view the form view but it is not saving the permission and I'm getting the following error message:

http://ekguild.com/Forums/index.php?action=theme;th=4;sesc;sa=edit;directory=. 
8: Undefined index: allow_forms
File: /hermes/bosweb/web085/b850/d5.ekguildweb/public_html/Forums/Themes/default/Admin.template.php (eval?)
Line: 460

Also, as admin, I can't see the form view page even after adding a button for the custom Waltz theme with the following code?

// The [customform]!
       echo ($current_action == 'customform' || $context['browser']['is_ie4']) ? '<div class="mytab_active_first"></div>' : '<div class="mytab_first"></div>' , '
            <div class="mytab_' , $current_action == 'customform' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=customform">FORMS</a>
            </div>' , $current_action == 'customform' ? '<div class="mytab_active_last"></div>' : '<div class="mytab_last"></div>';

The following are snaps of my form set up:

Title: Re: Custom Form Mod
Post by: Gryphoune on July 24, 2008, 04:30:36 PM
Well, I got the form view page to show and guests can now see it and fill out the form but I have a couple of other problems now. The output data doesn't show in the post (as shown in the 2nd pic). The second problem is more cosmetic but I can't figure out how to get the questions to show in one column instead of two. I would like for the questions to span the page with the reply box directly underneath  except for the shorter questions (or with checkbox) which can have the data at the end of the question.

Title: Re: Custom Form Mod
Post by: Nathaniel on July 24, 2008, 05:34:29 PM
Okay, the issue with the output is that the {vars} are case sensitive, you need to give them capital letters at the start and then it should work.

I am now sure about the issue with the alignment stuffing up, but I have not tested this mod with your particular theme so that may be causing issues. I suggest that you use the "Custom Template Function" feature to try and make your own template that looka how you want it to look.
Title: Re: Custom Form Mod
Post by: Gryphoune on July 24, 2008, 06:15:55 PM
Ok, will try the data changes, but the custom template thing is over my head. I'm not a coder but I can fiddle with things to do minor tweaks.

Should I ask the theme author if he can do anything with it?
Title: Re: Custom Form Mod
Post by: Nathaniel on July 24, 2008, 06:17:47 PM
Quote from: Gryphoune on July 24, 2008, 06:15:55 PM
Ok, will try the data changes, but the custom template thing is over my head. I'm not a coder but I can fiddle with things to do minor tweaks.

Should I ask the theme author if he can do anything with it?

You could try, if you tell me which theme you have then I might be able to do some playing around to see if I can make a template function which works properly because the default one should work.
Title: Re: Custom Form Mod
Post by: Gryphoune on July 24, 2008, 06:30:55 PM
I'm using the Waltz theme by IchBin. He has helped me with a few other problems I was having with the theme but if you want to take a stab at it, I would appreciate it.
Title: Re: Custom Form Mod
Post by: tlknowles on July 24, 2008, 08:17:22 PM
Hi LHVWB ... and everyone else.

First...
I want to thank you for the work you did to port this mod back to 1.1.5
I saw it for 2.0...and was anxious to upgrade to 2.0 JUST for this mod. ( It will be VERY useful to my group. )

Secondly...
I want to tell you that I am NOT a coder. ( I only fiddle with the stuff...and I usually get it wrong. )


That brings me to my questions...
I'm toying with the mod to see how it works.
I beleive I have correctly set-up the form fields for my purposed form
And, I think I have set up the actual form correctly.


MY FORM FIELDS
Quoter_name   Name           Text Box (String)                   (Move Down)   (Edit)   (Delete) 

r_email   Email            Text Box (String)   (Move Up)  (Move Down)   (Edit)   (Delete)

r_rec     Recommend    Check Box            (Move Up)  (Move Down)   (Edit)   (Delete)


MY FORM

Quote

Custom Form Mod Settings -> "Review Form" Form
Title   [ Review Form ]
Board ID [ 124 ]
I got the number from the address bar when the test board is open.
http://www.mysite.com/index.php?action=post;board= 124.0
But...I'm not sure this is correct.

Custom Template Function  [ empty ]  Because I don't understand this function yet.
Permissions [ set for admin only at this time  ]
Subject [ Review ]

Form Output
Reviewer's Name ::
{r_name}

Reviewer's Email ::
{r_email}

Recommend ::
{r_rec}

Then...saving the form...and opening the test board to view the form...I get no form.
What am I doing incorrectly?

If there is an answer already posted...do feel free to point me to it.
I'm just not finding it in all the information I have already read.

In the meantime, I will continue to play with the mod. It's possible I'll stumble on the answer.

TIA
tlknowles

Title: Re: Custom Form Mod
Post by: tlknowles on July 24, 2008, 09:29:28 PM
FOUND IT!

So...at this time...I'm a happy camper!

Quote from: LHVWB on July 10, 2008, 08:44:07 AM

@ 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.

Thanks again, LHVWB!
VERY cool mod!

tlknowles
Title: Re: Custom Form Mod
Post by: Nathaniel on July 24, 2008, 09:31:12 PM
I'm happy that you manage to find it alright. I will try to make the documentation clearer so that you can see that more easily. :)
Title: Re: Custom Form Mod
Post by: Marduke on July 24, 2008, 09:54:48 PM
Awesome mod.  And again, if we can donate to you, let us know.  We'd like to show you our appreciation.'

2 small suggestions:

-Allow BBCode the be used in the 'Text' field that people see when filling out a form (usually the field that is asking a question).
-If possible, it would be cool for a reply button for a forum to go straight to a chosen form.
Title: Re: Custom Form Mod
Post by: 4b11l on July 25, 2008, 12:09:30 AM
^
@Marduke, you can use html.

@LHVWB,
How about being able to just type on the form use bbc/html?

It would be nice to be able to have some writing at the top of the form, then the form on the bottom. The way I have mines setup currently is all the information for event A on one page, then having to link it to event A form registration. It would be nice to have the event A info on the top and form on the bottom.

Hopefully you understand what I'm saying. :)
Title: Re: Custom Form Mod
Post by: Marduke on July 25, 2008, 12:21:07 AM
Ah! HTML works!

And yes, I agree.  Would be cool to just put text in.
Title: Re: Custom Form Mod
Post by: Nathaniel on July 25, 2008, 02:09:24 AM
@4b11l,
You should be able to do that by creating a "Custom Form Template" for that particular form, you should only need to make a quick copy of the default template and then add the text to the locations which are documented in the default template.

@Marduke,
You should not be able to post any HTML or bbc into the form, unless you have put 'parse_bbc' into the "Extra Type Parameters" setting. I will have to investigate the issue of html and bbc, because at the moment no HTML should be allowed through. Could you please tell me what settings you put for the field which allows html?
Title: Re: Custom Form Mod
Post by: 4b11l on July 25, 2008, 02:30:17 AM
Quote from: LHVWB on July 25, 2008, 02:09:24 AM
@4b11l,
You should be able to do that by creating a "Custom Form Template" for that particular form, you should only need to make a quick copy of the default template and then add the text to the locations which are documented in the default template.


Thanks for the reply. I know I'm probably asking too much, but would you be able to give me a template or show me where to write the text at and where to edit? I know enough to get me by and manually install but I have no clue when it comes to actually editing and working with PHP.
Title: Re: Custom Form Mod
Post by: Nathaniel on July 25, 2008, 02:50:32 AM
I am more than happy to try to help you and explain anything that you do not understand.

The default form function looks like this:
// Generic template for showing the submit form page.
function form_template_submit_form()
{
   global $context, $txt, $settings, $scripturl;

   //   Starting text for the form and tables. Don't muck with this, unless you need to change the style!!!
   echo '
   <form action="', $context['post_url'], '" method="post" accept-charset="', $context['character_set'], '">
      <table width="80%" border="0" cellspacing="0" cellpadding="0" class="tborder" align="center">
         <tr><td>
            <table border="0" cellspacing="0" cellpadding="4" width="100%">
               <tr class="titlebg">
                  <td colspan="3">', $context['settings_title'], '</td>
               </tr>
               <tr class="windowbg2">
                  <td colspan="3"><br /></td>
               </tr>';
   
   //   Here you can add rows to the beginning of the table, if you want to...
   /*    Like this:
   echo '
               <tr class="windowbg2">'
                  New row.
               </tr>';
   */
   
   //   Documentation for the contents of each $field_data array, or entry into the $context['fields'] array.
   /*
   $field_name = The name of the field, straight from the value stored by the admin in the admin settings area;
    $field_data = array(
      'text' => This is the text which needs to be displayed next to the setting.,
      'type' => The type of input which the field is ,
      'value' => The value of the field, if this is not the first attempt at submitting the form,
      'data' => The list of options - only for the selection box type,
      'required' => A boolean value telling us wether or not its necessary to have a valid value for this field in order to submit the form,
      'failed' => A boolean value which tells us wether or not this field caused the form to fail to submit,
    );
   */
               
   // Now actually loop through all the variables.
   foreach ($context['fields'] as $field_name => $field_data)
   {
      //   Output the start of the row, as well as a spacer column.
      echo '
               <tr class="windowbg2">
                  <td class="windowbg2"></td>';
     
      //   Show the display text for this field.
      echo '
                  <td valign="top"><label for="', $field_name, '">', $field_data['text'], '</label></td>
                  <td class="windowbg2" width="50%">';

      // Show a check box?
      if ($field_data['type'] == 'checkbox')
         echo '
                     <input type="hidden" name="', $field_name, '" value="0" /><input type="checkbox" name="', $field_name, '" id="', $field_name, '" class="check" ', ($field_data['value']) ? 'checked="checked"' : '', '" />';
      // Show a selection box?
      elseif ($field_data['type'] == 'selectbox')
      {
         echo '
                     <select name="', $field_name, '">';
         foreach ($field_data['data'] as $option)
            echo '
                        <option value="', $option, '"', ($option == $field_data['value'] ? ' selected="selected"' : ''), '>', $option, '</option>';
         echo '
                     </select>';
      }
      // Large Text box?
      elseif ($field_data['type'] == 'largetextbox')
      {
         echo '
                     <textarea rows="4" cols="30" name="', $field_name, '">', $field_data['value'], '</textarea>';
      }
      // Int, Float or text box?
      else
         echo '
                     <input type="text" name="', $field_name, '" value="', $field_data['value'], '"/>';
     
      //   Show the 'required' asterix if necessary.
      if(!empty($field_data['required']))
         echo '
                     <div ', !empty($field_data['failed']) ? 'style="color:#FF0000;"' : '' ,'> *</div>';     
     
      //   End the input column and the entire row.
      echo '
                  </td>
               </tr>';
   }
   
   //   Here you can add rows to the end of the form, if you want to...
   /*    Like this:
   echo '
                  <tr class="windowbg2">'
                     New row.
                  </tr>'
   */
   
   //   Show the "Required Fields" text down the bottom, show it in red if there was a failed submit.
   echo '
               <tr class="windowbg2">
                  <td colspan="3" style="text-align:center;', !empty($context['failed_form_submit']) ? 'color:#FF0000;' : '', '">
                     * ', $txt['CustomForm_required'], '
                  </td>
               </tr>';
   
   echo '
               <tr>
                  <td class="windowbg2" colspan="3" align="center" valign="middle"><input type="submit" value="', $txt['CustomForm_submit'], '" /></td>
               </tr>
            </table>
         </td></tr>
      </table>
      <input type="hidden" name="sc" value="', $context['session_id'], '" />
   </form>';
}


This is an example function of how you could do what you want:
Just replace the "This is some text at the beginning of the table." text with the text that you want and the "Text at the bottom of the form." text with the text that you want at the bottom of the form. To get this to be the template function for your form/s, all you need to do is put it into the 'CustomForm.template.php' file and then change the "test_form" part of the name to whatever you have put into the "Custom Form Template" setting for that form.
// Generic template for showing the submit form page.
function form_template_test_form()
{
    global $context, $txt, $settings, $scripturl;

    //    Starting text for the form and tables. Don't muck with this, unless you need to change the style!!!  ;)
    echo '
    <form action="', $context['post_url'], '" method="post" accept-charset="', $context['character_set'], '">
        <table width="80%" border="0" cellspacing="0" cellpadding="0" class="tborder" align="center">
            <tr><td>
                <table border="0" cellspacing="0" cellpadding="4" width="100%">
                    <tr class="titlebg">
                        <td colspan="3">', $context['settings_title'], '</td>
                    </tr>
                    <tr class="windowbg2">
                        <td colspan="3"><br /></td>
                    </tr>';
    echo '
                     <tr class="windowbg2">'
                         This is some text at the beginning of the table.
                     </tr>';
   
    //    Here you can add rows to the beginning of the table, if you want to...
    /*     Like this:
    echo '
                    <tr class="windowbg2">'
                        New row.
                    </tr>';
    */
   
    //    Documentation for the contents of each $field_data array, or entry into the $context['fields'] array.
    /*
    $field_name = The name of the field, straight from the value stored by the admin in the admin settings area;
     $field_data = array(
        'text' => This is the text which needs to be displayed next to the setting.,
        'type' => The type of input which the field is ,
        'value' => The value of the field, if this is not the first attempt at submitting the form,
        'data' => The list of options - only for the selection box type,
        'required' => A boolean value telling us wether or not its necessary to have a valid value for this field in order to submit the form,
        'failed' => A boolean value which tells us wether or not this field caused the form to fail to submit,
     );
    */
                   
    // Now actually loop through all the variables.
    foreach ($context['fields'] as $field_name => $field_data)
    {
        //    Output the start of the row, as well as a spacer column.
        echo '
                    <tr class="windowbg2">
                        <td class="windowbg2"></td>';
       
        //    Show the display text for this field.
        echo '
                        <td valign="top"><label for="', $field_name, '">', $field_data['text'], '</label></td>
                        <td class="windowbg2" width="50%">';

        // Show a check box?
        if ($field_data['type'] == 'checkbox')
            echo '
                            <input type="hidden" name="', $field_name, '" value="0" /><input type="checkbox" name="', $field_name, '" id="', $field_name, '" class="check" ', ($field_data['value']) ? 'checked="checked"' : '', '" />';
        // Show a selection box?
        elseif ($field_data['type'] == 'selectbox')
        {
            echo '
                            <select name="', $field_name, '">';
            foreach ($field_data['data'] as $option)
                echo '
                                <option value="', $option, '"', ($option == $field_data['value'] ? ' selected="selected"' : ''), '>', $option, '</option>';
            echo '
                            </select>';
        }
        // Large Text box?
        elseif ($field_data['type'] == 'largetextbox')
        {
            echo '
                            <textarea rows="4" cols="30" name="', $field_name, '">', $field_data['value'], '</textarea>';
        }
        // Int, Float or text box?
        else
            echo '
                            <input type="text" name="', $field_name, '" value="', $field_data['value'], '"/>';
       
        //    Show the 'required' asterix if necessary.
        if(!empty($field_data['required']))
            echo '
                            <div ', !empty($field_data['failed']) ? 'style="color:#FF0000;"' : '' ,'> *</div>';       
       
        //    End the input column and the entire row.
        echo '
                        </td>
                    </tr>';
    }
   
    //    Here you can add rows to the end of the form, if you want to...
    /*     Like this:
    echo '
                        <tr class="windowbg2">'
                            New row.
                        </tr>'
    */
    echo '
                         <tr class="windowbg2">'
                             Text at the bottom of the form.
                         </tr>'
   
    //    Show the "Required Fields" text down the bottom, show it in red if there was a failed submit.
    echo '
                    <tr class="windowbg2">
                        <td colspan="3" style="text-align:center;', !empty($context['failed_form_submit']) ? 'color:#FF0000;' : '', '">
                            * ', $txt['CustomForm_required'], '
                        </td>
                    </tr>';
   
    echo '
                    <tr>
                        <td class="windowbg2" colspan="3" align="center" valign="middle"><input type="submit" value="', $txt['CustomForm_submit'], '" /></td>
                    </tr>
                </table>
            </td></tr>
        </table>
        <input type="hidden" name="sc" value="', $context['session_id'], '" />
    </form>';
}


I have tried to make the function as simple and well-documented as possible, if you need any help with it then I am more than happy to offer some.
Title: Re: Custom Form Mod
Post by: tlknowles on July 25, 2008, 03:37:08 AM
Quote from: LHVWB on July 25, 2008, 02:09:24 AM

@Marduke,
You should not be able to post any HTML or bbc into the form, unless you have put 'parse_bbc' into the "Extra Type Parameters" setting. I will have to investigate the issue of html and bbc, because at the moment no HTML should be allowed through. Could you please tell me what settings you put for the field which allows html?

I'm not Marduke...but I have used html tags in the Text field with no apparent problems.
It displays as I intended it to display.

Custom Form Mod Settings -> "Review Form" Form -> "rev_details" Field
Title   [ bk_review ] field name
Text   [ <b>My Review</b><br />Tell us what you thought of your latest read. ] Displayed Text
Type  [ Large ( Multiline ) Text Box ] Input field type
Extra Type Parameters   [ empty ]

Then...on the form...NOT the form output...
The display looks like this:

My Review
Tell us what you thought of your latest read.


I was under the impression that the [ parse_bbc ] entered into the Extra Type Parameters option would allow posters to use bbc on their input.
...no?

tlknowles
Title: Re: Custom Form Mod
Post by: Nathaniel on July 25, 2008, 04:49:54 AM
@tlknowles,
I can see that I probably misinterpreted what you were talking about, you are right there is no reason why html and bbc won't work for the output post that you can create, and the text setting for each field. ;)
Title: Re: Custom Form Mod
Post by: tlknowles on July 25, 2008, 05:23:14 AM
[gush]

This is a SUPER mod!
It's going to make my life so much easier.
I am SOOOO pleased with the flexibility and operation!
I can't imagine any forum that couldn't use it.

LHVWB...
If you won't tell us how to donate to you - for your hard work - in the thread...please send me a private message with the inforomation.

[/gush]

Thanks again.
tlknowles
Title: Re: Custom Form Mod
Post by: Nathaniel on July 25, 2008, 05:37:41 AM
I'll try to set up a paypal account and make a donations page on one of my demo sites sometime... ;)

I kind of made this and the other mods I've been working on for experience and fun, but I am happy to accept donations. I'll just have to set up a system. ;)
Title: Re: Custom Form Mod
Post by: digit on July 25, 2008, 05:41:13 AM
Quote from: LHVWB on July 25, 2008, 05:37:41 AM
I'll try to set up a paypal account and make a donations page on one of my demo sites sometime... ;)

I kind of made this and the other mods I've been working on for experience and fun, but I am happy to accept donations. I'll just have to set up a system. ;)

Cool - 'looking forward to taking a peek at your custom menu mod too!

I stopped using the SMF menu a LONG time ago in favor of my own

that just does...

if logged in... echo
if group.... echo
if admin...  echo

I also do that with a custom pull down menu ;)

some type of form for that would be way cool though!
Title: Re: Custom Form Mod
Post by: Nathaniel on July 25, 2008, 05:49:12 AM
@digit,
Yeah, that mod.... I sort of went insane and worked on it for about a week and a half last semester (starting again from stratch) and then I stopped, and created the SMF 2 Beta version of this mod, as well as a few other mods, and now I have started a few other mods. So it may take a while to finish the Custom Menu Mod, and when I do. Unfortunately it will only be for SMF 2 Beta, unless I go completely insane and port it back, but its unlikely at this stage. ;)

I think the main problem with that mod is that I've it way too complicated, it has several thousand lines of code and allows you to create entire new menu systems complete with submenus, popup menus/subbuttons (if your template allows it) and etc. To the stage where it might be easier for a user to set up their own system, by change SMF code, than trying to use the mod. ;D
Title: Re: Custom Form Mod
Post by: Nathaniel on July 25, 2008, 09:55:27 AM
Okay, I have now finally managed to update the SMF 2 Beta version so that it has the v1.1 features of this mod. It only ended up taking me a few hours, because there wasn't much to change, and any issues had already been worked out for the SMF 1.1.5 version.

Mod Changes v1.1 SMF 2 Beta:
Added the new custom template stuff.
Some minor bugfixes.

I will now consider any ideas/suggestions that I have been given and think about wether or not I need to create another version of this mod, although at the moment I am going to concentraite on supporting this mod and creating a few new ones.

Thank you,
LHVWB

Title: Re: Custom Form Mod
Post by: erlend_sh on July 25, 2008, 04:51:30 PM
QuoteTable 'radakano_main.smf_smf_cf_forms' doesn't exist
File: /home/radakano/public_html/forums/Packages/temp/install.php
Line: 45
Installing on default theme, no problems with earlier mods. Anyone else getting this with 2.0?
Title: Re: Custom Form Mod
Post by: Nathaniel on July 25, 2008, 08:38:59 PM
I have tried it on some clean versions and I have been unable to get this error.

Maybe you should try to do the Database stuff manually. If you still have all your database stuff there then you should be able to just add a 'template_function' column with type 'tinytext' and then maybe the error will stop... ;)
Title: Re: Custom Form Mod
Post by: 4b11l on July 25, 2008, 09:57:04 PM
@LHVWB,

Thanks for the example!

I just want to point out just in case so it wont happen to anyone that is in my situation. In the CustomForm.template.php, the documentation for adding the new row is wrong. There should be no apostrophe directly following the > in the tr tag. The only one that should exist is after the tr closing tag.

So, as of right now, it looks like this:
echo '
<tr class="windowbg2">'
New row.
</tr>';


However, it should be like this:
echo '
<tr class="windowbg2">
New row.
</tr>';


Thanks for all the hard work!
Title: Re: Custom Form Mod
Post by: Nathaniel on July 25, 2008, 10:08:34 PM
@4b11l,
Thanks for pointing that out, I had actually realised that when I made the 1.1 version for SMF 2 Beta, but I didn't think it was worth releasing another version of the SMF 1.1.5 version of the mod just to fix up that documentation. ;)
Title: Re: Custom Form Mod
Post by: Sudhakar Arjunan on July 27, 2008, 08:12:50 AM
Hi LHVWB,

A Simple suggestion.

I use dilber mc , if you kinly help me creating one custom.template which i could use in the form .

I appreciate it.
Title: Re: Custom Form Mod
Post by: Nathaniel on July 27, 2008, 08:14:32 AM
Quote from: asudhakar on July 27, 2008, 08:12:50 AM
Hi LHVWB,

A Simple suggestion.

I use dilber mc , if you kinly help me creating one custom.template which i could use in the form .

I appreciate it.

I don't have much time just at the moment, but I will have a look at the templates and then get back to you sometime in the next day or two. :)

I have worked with that template, and I am more that happy to do some more work with it. So you need a custom form template or one for the forms list?
Title: Re: Custom Form Mod
Post by: Lady Night Owl on July 27, 2008, 03:47:09 PM
Quote from: tlknowles on July 24, 2008, 09:29:28 PM
FOUND IT!

Would you mind sharing what you found, please, as it seems that I'm running into the same problem that you were.

I keep getting this at the end of the address when I submit the form:

index.php?action=form;id=1;submit;

I doesn't redirect me to the designated board (and the ID is correct) after I fill out the form.
Title: Re: Custom Form Mod
Post by: tlknowles on July 27, 2008, 04:29:58 PM
Quote from: Lady Night Owl on July 27, 2008, 03:47:09 PM
Quote from: tlknowles on July 24, 2008, 09:29:28 PM
FOUND IT!

Would you mind sharing what you found, please, as it seems that I'm running into the same problem that you were.

Yeah...no sweat.

The problem I was having was...
...after I created a form...saved it...and tried to display it...I couldn't find the form.
I was under the impression that the form would be the message format for a particular board.
It is not.

The completed forms are presented in a separate list of available forms.
Your forum members can select the appropriate form...and when it is saved to the forum, it is saved to the board you selected on the saved form.

I found my answer in an eariler answer LHVWB ( mod author ) left for Cybertec.

Quote@ 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.

So...in my case...which is probably different than your case.
SMF is in a directory on my server called "4um" ( not in my root directory )
I have to call the list of forms with
http://www.mysite.com/4um/index.php?action=form

If your forum is in your root directory...your link will look like this :: http://www.mysite.com/index.php?action=form

Of course..."mysite.com" would be replaced with your site information.

You could program a button to pull up the list.

I am using User Control Panel By Alan S 2.0, and have programmed a section of the resulting USER CP to bring up the list for my members.

Hope this helps.

tlknowles
Title: Re: Custom Form Mod
Post by: Lady Night Owl on July 27, 2008, 04:53:48 PM
Thank you :)

My forum isn't in my root directory ;) Unfortunately, I think you're right that our issues are different.
I do have the user control panel installed, so when/if I can get this mod to work, I'll have to add a button in there for the users.

I can only get the form to post the answers to the designated board if I enter numbers (like 1234) in the text box. It won't post the answers if I enter my user name (no matter if I choose 'string', 'float' or 'integer'). The same thing happens if I use the multi-line text box. I'm not a coding expert, so I don't know which one I should choose. According to some things I looked up, I should be using 'string' if I want someone to enter their username, for example.

The same thing happened on the demo site, but I thought it might have just be the settings which I have no control over on there. I can enter words in the text box, but not the multi-line (only numbers).




The other problem I'm having is with selection boxes. How do I make them a 'required' field without making "Required" an option for people to select? Maybe the required option should have to be included in the extra parameters, but you could add a check mark to the 'add new field' part. If checked, that field will be required.
Title: Re: Custom Form Mod
Post by: tlknowles on July 27, 2008, 07:19:46 PM
@ Lady Night Owl

Well...let's start at the beginning.
Go to Admin >> Features & Options >> Custom Forms ( tab ).
1) In the Custom Form Mod Settings box, select the  [ Select permissions for each group ]  link to set permissions for those groups that can see/use all the forms you create.
2) Create a title in the View Forms Title box. ( This is displayed at the top of the form list. )
3) Create a description of the list in the View Forms Text box. ( This is displayed below the title of the list. )

Then...click the Add New Form at the bottom of the Custom Forms below the Custom Form Mod Settings box.
Don't worry about the Custom Form Mod Settings -> "" Form box yet. This is for the form output. And you can't create this until you have all the fields created.

Scroll down to the Form Fields box...and click the Add New Field option so we can create a few simple fields to show you how it works.

Add New Field results in a box titled Custom Form Mod Settings -> "" Form -> "" FieldThese are blank right now because a) the form has no name yet...and b) the field has no name yet.

Ok...
Now...enter the following
Title  [name]
Text  [Enter A Name]
Type  [Text Box (String)] Leave this default option to create a single line text box.
Extra Type Parameters [ ---  empty --- ] This is where you would enter the word required if you wanted to make it a required field.

Then...Save.

Create another field :: Click Add New Field
Title  [weather]
Text  [What's the weather like today?]
Type  [Large (Multiline) Text Box]
Extra Type Parameters [ -- empty -- Not sure what parameters would be needed for this option...but I suppose there are some I don't know about...or haven't thought about.

Type  [Large (Multiline) Text box] creates a user box that will allow for longer strings/entries, and display accordingly. It's just a bigger single-line text box.

Then...Save.

Next field :: Click Add New Field
Title  [kansas]
Text  [Click the box if you live in Kansas]
Type  [Check Box]
Extra Type Parameters [ --- empty --- ] This is where you would enter the word required if you wanted to make it a required field.

Type  [Check Box] creates one check-box per field.
You don't have the option to create a list of check boxes for this one field.
It's either on ( checked ) or off ( not checked ).
The way you word the field Text will determine whether you want to see the box checked or not checked.
For example ::
If I enter into the Text box :: [If you read the registration agreement, check the box.]
I will want the user to check the box for yes, and leave it blank for no.

Ok...SAVE again.


Next field :: Click Add New Field
Title   [favorite]
Text   [Pick your favorite type of weather.]
Type  [Selection Box]  Creates a drop down selection box. User highlights their choice.
Extra Type Parameters [-- Select One -- ,Rainning ,Snowing ,Sunny ,Windy ,Hurricane ]

Extra Type Parameters
You can't use commas in your selection options.
The commas seperate the options shown.
So...if you use commas in your options, it will break the line on the selection list.
For example ::
If I tried to enter an option something like this ::
I like sunny days, with lots of wind, so I can fly kites.
It would display like this ::
I like sunny days ( an option )
with lots of sun ( another option )
so I can fly kites. ( another option )

Ok...SAVE again.

I'm not going to go into Text Box (Float) or Text Box (Integer) because I don't fully understand these options yet. I do know Text Box (Integer) probably restricts the entry to numbers. But, Text Box (Float) is foriegn to me at this time.

All righty!
Now...you should be back at the Form Output screen.
And...your saved form fields should be listed below the blank form.

Custom Form Mod Settings -> "" Form
Your form still doesn't have a name, so "" is still empty.

1. Enter a name for your form.
Title [ My Weather Test Form ]

2. Tell the Mod(ification) which board to save the results to.
Board ID [ XXX ] XXX will be the board ID number.
A quick way to determine the board number is to open the intended board in your browser.
The browser address bar will display something like :: http://www.mysite.com/index.php?board=5.0
The board ID is the number at the end of the URL :: 5.0
It's going to be different in your case.
You can leave this blank until you know which board to save to.
If you want to go create a test board for the results...save before leaving the screen.

3. Name your customize template.
Custom Template Function
Sorry...you'll need to seek help on this option from one who knows more about it than me.

4. Make your permission choices.
Permissions  [ Select permissions for each group ]
Pick the groups that can use the form.

5. Create a Subject line that will be displayed when the results are submitted.
Subject [ --- whatever you like - including saved fields --- ]
You can use your saved fields in the Subject line, which, could make finding the result you want much faster.
You'll have to think aboutthis.
But never fear. You can always go back and EDIT the Form / Form Output / Form Fields.

6. Create the way you want the results to be displayed.
Form Output: Let's keep this simple for this example.
In the edit box...enter the following ::

Survey answered by :: {name}

Today, their weather is :: {weather}

Lives in Kansas :: {kansas}

Their favorite weather is :: {favorite}

And SAVE.

...come back to the form and change the board number when you know the correct board ID.

Now! Pull up your list of forms with
http://www.mysite.com/index.php?action=form

Fill out your form.
Save.
Go to the board where you told the Mod(ification) to save it.
And view the results of your good work.

I hope this helps.
This mod(ification) is really very useful.
And very easy to use once you get started.

tlknowles
Title: Re: Custom Form Mod
Post by: Lady Night Owl on July 28, 2008, 03:09:09 AM
Wow! What I'm having trouble with is getting TEXT to go through. I can create the form and all just fine. Sorry to have wasted your time with the explanation, I do appreciate you trying to help. :(

The information gets posted to the board just fine, but only if I enter numbers - and this is after I've chosen 'text (string)'.

For example - let's fill out the little fake form I've created:

First field [name] {is set to text box (string)} << I can't enter a name!

It won't submit the information to the specified board. However, if I enter '1234' it submits and posts. Same goes for the multi-line text box. I can only enter numbers if I want it to work.

On the demo site, text works in the text box field, but it does not for the multi-line text box - I have to enter numbers there as well. If that were really a support ticket, I would be one frustrated member because I couldn't give details on the problem. I'd end up private messaging instead.

So what am I doing wrong on my text box fields? As I said, I'm selecting 'string', and it seems that there is some technical difficulty with the multi-line box on my site as well as the demo site. Some error in the file code maybe?

Now the selection drop down:

Say I want to make this a required field (I wouldn't really for this example lol, but just to show)...in the extra parameters box, I have to enter [Story A, Story B, required] So, "required" is going to show up as an option to be selected for the person who is filling out the form. How do we get around this? Because as it is, unless I'm doing something wrong, it would look like this:

Which story was your favorite?
Option 1  [Story A]
Option 2 [Story B]
Option 3 [required] << :(

This is a very useful mod, but I can't use it if I have to enter numbers where numbers shouldn't be - like it text fields that are intended for letters. Know what I mean?
Title: Re: Custom Form Mod
Post by: Nathaniel on July 28, 2008, 03:15:48 AM
@asudhakar,
I have looked over the templates and how they work the Dilber MC theme, I am happy to help you to create a custom template if you need one, but I will need some more information. Do you want a new template for a custom form or a new template for the forms list? With either it would be nice to either have a detailed explanation of what you want, or an image demonstraiting it.

@Lady Night Owl,
Okay I will try to answer your questions systematically.

Selectbox problem:
The reason that you can't put 'required' into a selectbox its because they are always 'required', when you are submitting a form, even if you don't touch the selectbox, it will return the value for the first option in the selectbox. Because of this, its not necessary to make them required, the system actually checks to make sure that they are always there. I did it like that, because you might want to use the string 'Required' as one of your options in the selectbox.

I am considering that there should be separate fields for required, parse_bbc and etc. because that would avoid making it unclear, but for the moment I am going to leave it.

Multi-line text box issue:
Okay, I can see the problem, its definetly there and its really odd. I am going to investigate this issue and fix it ASAP. I still don't know why its happening, but I will try to keep you informed. I aggree that the error is totally unacceptable, I am just sorry that I haven't had much time lately, so I haven't picked up on this earlier.  :(

Thank you,
LHVWB

Title: Re: Custom Form Mod
Post by: 4b11l on July 29, 2008, 09:51:10 PM
LHVWB,

The mod has been working excellently for me. No problems with the multi text issue above.

One thing I want to add is that I have the forms available to regular members so they can submit it, however the board it submits to is off limits to them. So, instead of having them reach a "this board is off limits or either missing to you" error message; how about redirecting them to the main form page? Or something similar.

Thanks.
Title: Re: Custom Form Mod
Post by: Nathaniel on July 29, 2008, 10:24:12 PM
Yeah, that's one of the issues which I realised very early on and then did nothing about, because I really wanted to release it. ;)

I will try to introduce and option/setting for each form that allows gives you these options.
Redirect to Board Index.
Redirect to Board. (The current setting)
Redirect to Thread.

I might also think about having it do special stuff if the user has got the "Redirect to Topic" option checked.
Title: Re: Custom Form Mod
Post by: 4b11l on July 30, 2008, 12:50:36 AM
Quote from: LHVWB on July 29, 2008, 10:24:12 PM
Yeah, that's one of the issues which I realised very early on and then did nothing about, because I really wanted to release it. ;)

I will try to introduce and option/setting for each form that allows gives you these options.
Redirect to Board Index.
Redirect to Board. (The current setting)
Redirect to Thread.

I might also think about having it do special stuff if the user has got the "Redirect to Topic" option checked.


Very nice. Will keep the thread tag until then. Thanks for the hard work.
Title: Re: Custom Form Mod
Post by: Nathaniel on July 30, 2008, 02:27:41 AM
Okay, I am going to do another version, within the next week.

It will include these changes (at the moment):
Fix the Multiline textbox error, when its required.
Add a form option/setting for redirection to topic, board and maybe home.
Maybe have a submit form to certain thread option?
Add checkboxes for stuff like 'parse_bbc' and 'required', maybe a separate box for the size variable?
Investigate adding html and bbc to fields, to stop it if necessary.
Fix the ' in the comments for the template function.
Try to make things clearer.
Fix html errors from templates (Pointed out by Gryphoune).
Make a fix for the bbc tags parsed by the parsecode() function on output post creation/modification in the admin area (Found by cleanfiles).
Choosing of post images.
Redirecting the 'New Topic' button to a certain form.
Count posts for user stats?

I am open to any other suggestions or reports of bugs. I know that it took a while for some of you, to fully understand this mod, so I will try to make it clearer and include more documentation.

Also, if I have left anything out of the list that you think is needed then please point it out, and I will look into it.
Title: Re: Custom Form Mod
Post by: Gryphoune on July 30, 2008, 03:29:30 AM
Hey, LHVWB. I had the theme author look at the display problem I was having with the form splitting into 2 columns. He said there are some HTML errors in the display template that is causing this. He also said you will be able to see the code errors at this link.

http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fekguild.com%2FForums%2Findex.php%3Faction%3Dform%3Bid%3D1#result (http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fekguild.com%2FForums%2Findex.php%3Faction%3Dform%3Bid%3D1#result)
Title: Re: Custom Form Mod
Post by: Nathaniel on July 30, 2008, 03:48:08 AM
Hmm, okay. Thank you Gryphoune, I will have a look over the errors and fix them in the next version. I have added it to the list. :)
Title: Re: Custom Form Mod
Post by: Lady Night Owl on July 30, 2008, 04:14:05 PM
Quote from: LHVWB on July 30, 2008, 02:27:41 AM
Okay, I am going to do another version, within the next week.

It will include these changes (at the moment):
Fix the Multiline textbox error, when its required.
Add a form option/setting for redirection to topic, board and maybe home.
Maybe have a submit form to certain thread option?
Add checkboxes for stuff like 'parse_bbc' and 'required', maybe a separate box for the size variable?
Investigate adding html and bbc to fields, to stop it if necessary.
Fix the ' in the comments for the template function.
Try to make things clearer.
Fix html errors from templates (Pointed out by Gryphoune).

I am open to any other suggestions or reports of bugs. I know that it took a while for some of you, to fully understand this mod, so I will try to make it clearer and include more documentation.

Also, if I have left anything out of the list that you think is needed then please point it out, and I will look into it.

Cool! :) Thank you for working so hard on this mod.

When you work on the documentation, will you be including the difference between 'string, integer, and float' for those of us that have limited knowledge of that sort of thing?
Title: Re: Custom Form Mod
Post by: Nathaniel on July 30, 2008, 05:17:39 PM
@Lady Night Owl,
Definetly, I can understand that to some people, much of my documentation might be meaningless giberish. So I will try to improve it by adding explanations of the different types. ;)
Title: Re: Custom Form Mod
Post by: Enders on July 31, 2008, 01:23:34 AM
I found a bug... when you make a field "required" you must input an integer to pass that section. How can i fix this?
Title: Re: Custom Form Mod
Post by: Nathaniel on July 31, 2008, 01:44:04 AM
Quote from: Enders on July 31, 2008, 01:23:34 AM
I found a bug... when you make a field "required" you must input an integer to pass that section. How can i fix this?

This was already pointed out by Lady Night Owl, it will be fixed in the next version of this mod, I will try to get it out as soon as possible, probably sometime this weekend. It will consist mostly of bug-fixes such as that.
Title: Re: Custom Form Mod
Post by: Sudhakar Arjunan on July 31, 2008, 02:52:23 AM
Hi LHVMB,

Have you started the improved version you are speaking earlier .

Anytime frame you could complete it, since i planned to use it after doing upgrades of this mod.
Title: Re: Custom Form Mod
Post by: Nathaniel on July 31, 2008, 03:14:42 AM
I haven't started the actual programming of the new version yet, but I have finished listing the improvements that need to be made and the errors which need to be fixed, which can take a while. I prefer to spend a little bit of time thinking about what an update needs, so that I don't have to update the mod as much.

In terms of a time frame, I basically have a lot of time on weekends and then during the middle of the week, so I will either have a new version finished by the end of the weekend or during the middle of next week (I work on Aus EST Time ;) ). I don't like giving strict timeframes because more things which need fixing may appear, even given that I am usually pretty quick.

To cut things short, hopefully a few days, maybe a week. I would have to run into some serious problems (or get some real homework) for it to take longer, although the field validation stuff is kind of really annoying. ;)

Sorry for being vague, but life is vague! ;)
Title: Re: Custom Form Mod
Post by: tlknowles on July 31, 2008, 05:42:40 AM
Request...

My forms are long...and detailed.
It would be very helpful for the user to have it broken into sections.

How might I add an additional option to the current list that would display a simple horizontal rule to use as an indicator that this is a new section? (PS...I'm not a coder.)

Type  Text Box (String)
                  Large (Multiline) Text Box
                  Check Box
                  Selection Box
                  Text Box (Float)
                  Text Box (Integer)
                  Horizontal Rule

And, another request/question for LHVWB...
Is there a chance that your next version will also include the option for radio buttons where the end user can select one or more as the answer to a given question?


TIA
tlknowles
Title: Re: Custom Form Mod
Post by: Nathaniel on July 31, 2008, 05:50:15 AM
@tlknowles,
Okay, a Horizontal Rule type shouldn't be very difficult to add. But I'm still not sure about the radio buttons, to me radio buttons only allow you to chose one option, making them the same as select boxes. You are talking about a type which is essentially a series of checkboxes, which could probably be done by using a whole lot of check boxes, the only difference is how the output is presented.

I could investigate making a type, which has multiple checkboxes, where you put a list of strings/options into the setting for the field and then if the user checks that checkbox, the string will be added to a list of values, probably separated by commas.

That is the only use which I can think of for the type which you are describing, if you can explain it differently, preferably with an example then I will look at it.
Title: Re: Custom Form Mod
Post by: tlknowles on July 31, 2008, 06:07:28 AM
@LHVWB...
Yeah...you're correct. ( I'm asleep. )
Radio buttons are not what I was wanting.
Checkboxes with the ability for the end user to select more than one as an answer to the given questoins.

For instance.
Question :: What are your favorite colors?
Options ( Check all that apply ) ::
Red
Green
Brown
Yellow
White

Results :: end user can select one or ( up to ) all.



Anyways...
On the horizontal rule thingy...
Is there any chance you could give me a hint on how I might add it now?

EDITED TO ADD ::
Even a blank line would serve the same purpose.
But...a  horizontal rule would be pretty definative.
Title: Re: Custom Form Mod
Post by: tk2012 on July 31, 2008, 01:41:53 PM
Sorry for the question here, but having a little problem.

I installed with no errors.  (v2.0 b3.1)

I went in and first created the Name and supporting text of what the Form Box is called... no problem
I created the form fields for the custom form... no problem
I filled out the info for the form itself including the body of the post with the {} listed... PROBLEM!

When I hit SAVE, the page acts like it is going to go to another page or add something, but instead it ends up erasing all the info in the body of the form, but keeps the info above the body in the fields.  I've tried this four times.  How do you get what you've created to SAVE? 

I'm not getting any errors in the error log for this at all.
Title: Re: Custom Form Mod
Post by: Nathaniel on August 01, 2008, 05:31:08 AM
@tlknowles,
I haven't properly investigated this yet, I will just add it to the mod.

@tk2012,
I am not sure why that is happening, I have installed this on clean version of SMF 2 Beta and it worked fine, I am going to have a look into the SMF 2 Beta Version of this mod, because I think that it has some errors.

Note to all:
I am happy to announce that I have began working on the next version of this mod, hopefully it will be finished in a few days, its going to include an overhall of the field adding and editing system so that the information you can add to each type is better defined, ie using checkboxes for parse_bbc and required settings, as well as textboxes for selectbox options and etc. The storage of information in the database will remain the same, but the type vars box will be split into different sections.
Title: Re: Custom Form Mod
Post by: Axodious on August 01, 2008, 04:09:33 PM
Would you be able to add a feature as to where to direct the person after they submit?

I am trying to make an application form for my World of Warcraft guild that posts to a hidden forum that only moderators can see. When they submit the forum it tries to forward them to it and it can't.

Perhaps forward them to a page which says "Thank you for submitting." Then forward them back to the main forum ~3 seconds later, kind of like posting.
Title: Re: Custom Form Mod
Post by: Nathaniel on August 01, 2008, 07:44:39 PM
Quote from: axodious on August 01, 2008, 04:09:33 PM
Would you be able to add a feature as to where to direct the person after they submit?

I am trying to make an application form for my World of Warcraft guild that posts to a hidden forum that only moderators can see. When they submit the forum it tries to forward them to it and it can't.

Perhaps forward them to a page which says "Thank you for submitting." Then forward them back to the main forum ~3 seconds later, kind of like posting.

This is one of the things which I have almost finished adding to the next version, there will be options to redirect to the home page, to a specific thread, to a specific board and to a specific message. I may also add it for a specific url but I will have to think about that.... ;)
Title: Re: Custom Form Mod
Post by: Axodious on August 01, 2008, 08:29:14 PM
Awsome, cheers mate. :D
Title: Re: Custom Form Mod
Post by: PAPABEAR on August 01, 2008, 11:49:15 PM
So the new update is up? I have v1.1.5 and a couple custom themes and mods. Will this install easily with the package manager? What edited will I have to do on my custom themes if any (imagine that...if any...lol)?
Title: Re: Custom Form Mod
Post by: 4b11l on August 01, 2008, 11:52:01 PM
^
I don't think the new one is out yet.
Title: Re: Custom Form Mod
Post by: Nathaniel on August 02, 2008, 12:04:57 AM
@PAPABEAR,
The new version is not up, the mod is still at version 1.1, the new version will be 1.2. This mod should install perfectly with the package manager, as should all mods unless there are clashes.

You shouldn't have to do any edits for your custom themes as this mod doesn't edit any of the important template files, it just adds its own ('CustomForm.template.php'), if you don't like the look of the form list or form submit pages for your particular theme, then you can copy that file from the default into your custom theme and make some edits to it. I can help you do that if you need help.

Title: Re: Custom Form Mod
Post by: Shepx83 on August 02, 2008, 12:42:50 AM
Im sorry if this was asked, I searched and saw that really detailed post on how to setup the forms.

The question I have is whats the command to use in the subject to use the posters forum name because we're using this for a application form and we want it to show $Username [Recruitment]. Thanks for your time and like to say this is a great mod.

Edit: Another issue: When I choose to make the field required. It has the * on the form, and when you input anything, it clear the fields out and makes the * red and says fields required when I have data put into the fields.
Title: Re: Custom Form Mod
Post by: Nathaniel on August 02, 2008, 01:11:53 AM
@Shepx83,

I will see about adding some special variables that you can access from inside the form, like username, maybe user id and etc. That should be easy, and very useful I think. ;)

In terms of the required field issue, there are some know bugs with the multi line for the SMF 1.1.5 version of this mod. Which field types where you having issues with?

Also, which version of SMF you running?

If you have found a new issue then I would definetly like to work it out and fix it in the next version of this mod which I am working on.
Title: Re: Custom Form Mod
Post by: Shepx83 on August 02, 2008, 01:29:52 AM
Appericate the fast response and would be greatful if you could come up with those options. :)

I only tested the required permission out on the regular Textarea box (not the large). I am using SMF 1.1.5.
Title: Re: Custom Form Mod
Post by: Nathaniel on August 02, 2008, 01:34:40 AM
@Shepx83
Okay, if you find any errors with any other field types then please tell me. I will be doing a full check of all of them, but I am always happy for other people to point out the errors.

I will definetly put in the user information vars, it will be in the format {userinfo[name]} or something like that. I will have to do some work on it.

Thank you for reporting the error,
LHVWB
Title: Re: Custom Form Mod
Post by: Shepx83 on August 02, 2008, 01:44:21 AM
Thanks! :)

It was the Text Box (string) to be exact , for the required error.
Title: Re: Custom Form Mod
Post by: PAPABEAR on August 02, 2008, 11:50:22 AM
Quote from: LHVWB on August 02, 2008, 12:04:57 AM
@PAPABEAR,
The new version is not up, the mod is still at version 1.1, the new version will be 1.2. This mod should install perfectly with the package manager, as should all mods unless there are clashes.

You shouldn't have to do any edits for your custom themes as this mod doesn't edit any of the important template files, it just adds its own ('CustomForm.template.php'), if you don't like the look of the form list or form submit pages for your particular theme, then you can copy that file from the default into your custom theme and make some edits to it. I can help you do that if you need help.



Thank you. I tried installing via Package Manager and came up with:

Execute Modification     ./Sources/ModSettings.php     Test failed
Title: Re: Custom Form Mod
Post by: Enders on August 02, 2008, 12:55:11 PM
Can you make a field where you can attach files? This will be useful for reporting bugs with screenshot and such.
Title: Re: Custom Form Mod
Post by: Shepx83 on August 02, 2008, 01:06:51 PM
I also had 1 more question. Is it possible to have it post to multiple forums? I tried listing 2 board ids, seperated by commas, but it only keeps the first when I save.

Again, using this for our Applicant system and we make a discussion by copying the persons post to our guild forums for members to discuss. So by having it post in 2 places would be great in our case. Just wondering of that was possible, if not, Would I beable to request for that to be thrown in on the next patch?

Also do you have a projected time period on the next release? That username feature is going to be great.  :)

Again, thanks for this awesome mod.

http://www.drakenrising.com/ (http://www.drakenrising.com/)
Title: Re: Custom Form Mod
Post by: bros on August 02, 2008, 06:15:48 PM
I just installed this mod on SMF 2.0 Beta 3.1 Public.

http://thecastlehall.com/boards/index.php?action=form

No forms are showing up.

However, I have two forms set up already.

Could it be because I have over 50 membergroups?
Title: Re: Custom Form Mod
Post by: Nathaniel on August 02, 2008, 07:05:11 PM
@PAPABEAR
If that is the only error, then you should be able to install it and then manually fix the error, I can do it if you install the mod and then post your ModSettings.php file.

@Enders,
That has already been suggested and I have thought about it, its easier for me to do that sort of stuff now, but it will require some extra work.

@Shepx83,
At the moment that is not possible, I will however have a think about it. If I also implement the posting to a specific topic then I will also do multiple boards.

@bros,
The number of membergroups should have no effect on the working of this mod, although it will slow down how fast you can physically assign permissions to those groups. ;) Make sure that you have valid fields for the form as well as valid settings.

Note to All:
This new update is becoming quite huge, so I definetly won't have it finished and tested by the end of this weekend, I hope to finished it sometime during the week.
Title: Re: Custom Form Mod
Post by: bros on August 02, 2008, 07:27:40 PM
Quote from: LHVWB on August 02, 2008, 07:05:11 PM
@PAPABEAR
If that is the only error, then you should be able to install it and then manually fix the error, I can do it if you install the mod and then post your ModSettings.php file.

@Enders,
That has already been suggested and I have thought about it, its easier for me to do that sort of stuff now, but it will require some extra work.

@Shepx83,
At the moment that is not possible, I will however have a think about it. If I also implement the posting to a specific topic then I will also do multiple boards.

@bros,
The number of membergroups should have no effect on the working of this mod, although it will slow down how fast you can physically assign permissions to those groups. ;) Make sure that you have valid fields for the form as well as valid settings.

Note to All:
This new update is becoming quite huge, so I definetly won't have it finished and tested by the end of this weekend, I hope to finished it sometime during the week.

I have a test one

Details:
Title: Test
Board ID: 4
Custom Template Function is not filled out
I selected A for a bunch of membergroups. It counts secondary Membergroups, correct?
Subject: Hey
Form Output: :)
Title: Re: Custom Form Mod
Post by: Nathaniel on August 02, 2008, 07:33:36 PM
@bros,
The permissions system will allow anyone with any of the membergroups that you have given access to, to use the form. It doesn't matter if the group that gives them access is secondary or primary.

Make sure that you have added some valid fields, otherwise it will be ignored by the system.
Title: Re: Custom Form Mod
Post by: bros on August 02, 2008, 07:41:53 PM
Quote from: LHVWB on August 02, 2008, 07:33:36 PM
@bros,
The permissions system will allow anyone with any of the membergroups that you have given access to, to use the form. It doesn't matter if the group that gives them access is secondary or primary.

Make sure that you have added some valid fields, otherwise it will be ignored by the system.

So I just read the help thing next to Form Output. I put in {name}
{Time}
Hi


I click save and I goes back to the mod settings page. How would I make the output be something like
Name:
Group Name:
Number of People in Group:
Abbreviation
Forum Link:
Title: Re: Custom Form Mod
Post by: Nathaniel on August 02, 2008, 09:55:37 PM
You could easily do that, but I think that you want to access variables from SMF itself. Such as username and etc. I am ggoing to add that to the next version of the mod.

Output would look like:
QuoteName: {name}
Group Name: {groupname}
Number of People in Group: {numpeople}
Abbreviation
Forum Link: {link}

Edit: Progress with the next version of the mod is coming along badly, I am trying to get some work done on it. But I don't have much free time at the moment, so you will have to wait a while longer for it. Also I want to make sure that I do a proper and preferably bug-free version of this mod.

Thank you,
LHVWB
Title: Re: Custom Form Mod
Post by: PAPABEAR on August 02, 2008, 11:36:00 PM
I will wait for your update. :)
Title: Re: Custom Form Mod
Post by: tlknowles on August 03, 2008, 10:16:00 PM
Quote from: Shepx83 on August 02, 2008, 12:42:50 AM
Im sorry if this was asked, I searched and saw that really detailed post on how to setup the forms.

The question I have is whats the command to use in the subject to use the posters forum name because we're using this for a application form and we want it to show $Username [Recruitment]. Thanks for your time and like to say this is a great mod.

Edit: Another issue: When I choose to make the field required. It has the * on the form, and when you input anything, it clear the fields out and makes the * red and says fields required when I have data put into the fields.

I think I understand what you're trying to do...maybe.
And, if I understand it correctly...it's very easy.

Create a field.
Lets say you create a field called :: new_name

Then...in the Subject box...you want to call the "new_name" field like so ::
Subject   [ {new_name} ]

You can call any created field to the Subject line. Just remember to enclose the field ID in curly brackets. { }
Title: Re: Custom Form Mod
Post by: Nathaniel on August 03, 2008, 11:03:39 PM
@tlknowles,
Shepx83 is actually trying to access information from the $user_info variable that is defined in SMF, so that he can use some data for each member, that the member can't enter into the field.
Title: Re: Custom Form Mod
Post by: Sudhakar Arjunan on August 04, 2008, 12:26:04 AM
Quote from: LHVWB on July 30, 2008, 02:27:41 AM
Okay, I am going to do another version, within the next week.

It will include these changes (at the moment):


Hi LHVWB,

When will be the release, or kindly attach the latest version. Will help you in testing it also.
Title: Re: Custom Form Mod
Post by: jimvy on August 04, 2008, 12:40:12 AM
My users seem to be able to use forms I make fine if they are using firefox but they don't even see the forum in IE. Is this a known problem?
Title: Re: Custom Form Mod
Post by: Nathaniel on August 04, 2008, 01:55:55 AM
Quote from: asudhakar on August 04, 2008, 12:26:04 AM
When will be the release, or kindly attach the latest version. Will help you in testing it also.

I don't really want to have to say this again, the next version of this mod will be ready when I manage to finish it, hopefully as soon as possible. I am not going to give people early copies of it, because it won't be completed. I want to work out all of the bugs and then test it myself, with a relatively small mod like this, there is no point in having people beta test it, because I can work out all of the bugs and have it working relatively quickly. I just need to find the time to do it! ;)

Thank you for offering but I don't need help with testing,
LHVWB

@jimvy,
That is not a known problem, I can't seem to reproduce it either. Are the people with ie having any other problems with your forums? Or just with the forms for this mod?
Title: Re: Custom Form Mod
Post by: 4b11l on August 04, 2008, 03:15:35 AM
Quote from: LHVWB on August 04, 2008, 01:55:55 AM
That is not a known problem, I can't seem to reproduce it either. Are the people with ie having any other problems with your forums? Or just with the forms for this mod?

I have problems with alignment in IE though. Such as the "* required field" normally seen above the Submit button in FF shows out of the table and to the right.
Title: Re: Custom Form Mod
Post by: Nathaniel on August 04, 2008, 03:18:32 AM
Quote from: 4b11l on August 04, 2008, 03:15:35 AM
Quote from: LHVWB on August 04, 2008, 01:55:55 AM
That is not a known problem, I can't seem to reproduce it either. Are the people with ie having any other problems with your forums? Or just with the forms for this mod?

I have problems with alignment in IE though. Such as the "* required field" normally seen above the Submit button in FF shows out of the table and to the right.

I can imagine that happening, in fact I just noticed some of the issues you pointed out. I am not particularly good with templates but I will try to make sure that they work with IE and Firefox, I will also try to run them by another coder, who is better with templates to make sure that they work properly. ;)

Thank you for pointing that out,
LHVWB
Title: Re: Custom Form Mod
Post by: Axodious on August 04, 2008, 08:12:34 PM
There's a bug with the required setting I'm having, some (most) of the items I mark as required when filled out marks them that it wasn't.

Like I'll fill out a test form with a whole pile of required boxes and it will say half of them that I did fill in were marked that they weren't.
Title: Re: Custom Form Mod
Post by: Nathaniel on August 04, 2008, 08:48:03 PM
@axodious,
Could you please post a link to the form where you are having the errors?

There are already known errors with this mod and required fields, are they just multiline textboxes that are having the issues, or are you having issues with other field types?
Title: Re: Custom Form Mod
Post by: Kylezz on August 04, 2008, 11:59:50 PM
You never stop making them! I love it and wont stop downloading Yers.
Title: Re: Custom Form Mod
Post by: tk2012 on August 05, 2008, 02:02:41 AM
Quote from: LHVWB on July 30, 2008, 02:27:41 AM
Okay, I am going to do another version, within the next week.

It will include these changes (at the moment):
Fix the Multiline textbox error, when its required.
Add a form option/setting for redirection to topic, board and maybe home.
Maybe have a submit form to certain thread option?
Add checkboxes for stuff like 'parse_bbc' and 'required', maybe a separate box for the size variable?
Investigate adding html and bbc to fields, to stop it if necessary.
Fix the ' in the comments for the template function.
Try to make things clearer.
Fix html errors from templates (Pointed out by Gryphoune).

I am open to any other suggestions or reports of bugs. I know that it took a while for some of you, to fully understand this mod, so I will try to make it clearer and include more documentation.

Also, if I have left anything out of the list that you think is needed then please point it out, and I will look into it.

YAY!!!   I got it to work after uninstalling it and installing it again. 

Suggestion..  Is it possible to get an actual TAB put in the top nav bar like where "my messages", "profile", and "help" is instead of directing the members to a link to view the forms?  It would make it easier members to access it.
Title: Re: Custom Form Mod
Post by: Nathaniel on August 05, 2008, 02:11:32 AM
Quote from: tk2012 on August 05, 2008, 02:02:41 AM
YAY!!!   I got it to work after uninstalling it and installing it again. 

Suggestion..  Is it possible to get an actual TAB put in the top nav bar like where "my messages", "profile", and "help" is instead of directing the members to a link to view the forms?  It would make it easier members to access it.

The reason that I haven't done this, is because not everyone would necessarily want their members to access the list of forms, you can however add your own, I am more than happy to help you to that. In fact I might add a short tutorial to the download page.

If you have SMF 1.1.5: http://docs.simplemachines.org/index.php?topic=564.msg927#msg927.
If you have SMF 2 Beta, then have a look at the setupMenuContext() function at the end of the Subs.php file.
Title: Re: Custom Form Mod
Post by: tk2012 on August 05, 2008, 02:13:49 AM
That would be great.  I thought the permissions would counter people you don't want to view the form from seeing the tab.  Just like in the way regular members don't have an "Admin" tab show up.

-OR-

If people saw the tab, they wouldn't see the forms that they didn't have permission to use.
Title: Re: Custom Form Mod
Post by: Nathaniel on August 05, 2008, 02:16:28 AM
Quote from: tk2012 on August 05, 2008, 02:13:49 AM
That would be great.  I thought the permissions would counter people you don't want to view the form from seeing the tab.  Just like in the way regular members don't have an "Admin" tab show up.

It could do that, and I will add that to the tutorial, but I was leaving the option for people to decide that they want to allow them to see the form list, but not have it really obvious. Anyway, I will add a thing to the download page, I may eventually add it to the mod itself with an option (probably in the next version, if I ever get around to it ;)).
Title: Re: Custom Form Mod
Post by: cleanfiles on August 05, 2008, 08:20:00 AM
Hello all, I installed this mod and it works fine, I have one little prob though.

One form posts an image with a description.
In the out put i used this for the image

[img]{screen1}[/img]

When I hit save it changes it to this
[img]http://{screen1}[/img]

So at the moment I have to tell members not to add the "http://"  to the image links when submitting a form.

The same happens if I try to use
[url={url1}][img]http://image/image.gif[/img][/url]

It changes to this after saving
[url=http://{url1}][img]http://image/image.gif[/img][/url]

So at the moment I have to tell members not to add the "http://"  to  links when submitting a form.


Any help here would be very appreciated,
Thanks.
Title: Re: Custom Form Mod
Post by: Nathaniel on August 05, 2008, 08:29:44 AM
@cleanfiles
Hmm, okay I can see where that issue is occurring. Thank you for reporting it. I have added it to the to do list for the next version of this mod. Unfortunately I can't post a simple fix now, because its actually a very annoying issue that I will have to work through for a while.

Thank you again for reporting it,
LHVWB
Title: Re: Custom Form Mod
Post by: cleanfiles on August 05, 2008, 08:43:13 AM
No probs, I will be waiting keenly for the next version lol. Oh I'm running 1.1.5 smf too. :)

Edit.
Also for the next version.... A drop down box to choose the post icon would be a great addition.
Title: Re: Custom Form Mod
Post by: SlowPaddle on August 05, 2008, 02:51:40 PM
A question.

I installed the Form Mod on my site no problem and set up a test form.

Then I checked the form using index.php?action=form and the list came up.

But when I click on it the page returned says this:

"An appropriate representation of the requested resource /index.php could not be found on this server."

The link the list page provides is /index.php?action=form;id=1

If I change the link to "/index.php?action=form&id=1" it works.

Any idea of the file that displays this link so I can modify it?

Thanks
Title: Re: Custom Form Mod
Post by: SlowPaddle on August 05, 2008, 03:24:09 PM
Never mind about the last question. I found all the details in the two files "CustomForm.php" and CustomForm.template.php". I just changed the semi-colons to an ampersand and it works fine.

Is there a way to use one of the fields as the title for the post? And can the poster be redirected to the post so they can continue to add in information?

I'm trying to use this as part of a wilderness canoe trip report section. The poster would have to provide certain details about the trip (length, number of portages, etc.) and then after they submit it they would be redirected to the post in edit mode so they could provide the complete trip report.

Maybe I'm asking a bit much?

Title: Re: Custom Form Mod
Post by: Nathaniel on August 05, 2008, 07:19:34 PM
Quote from: cleanfiles on August 05, 2008, 08:43:13 AM
Also for the next version.... A drop down box to choose the post icon would be a great addition.

Do you mean a box in the admin area, or a box for the users. I could do both, I will add it to the list.

@SlowPaddle,
I'll answer your questions in order.

Is there a way to use one of the fields as the title for the post?
Yes, in the admin section there is a subject field for every form. The subject field may contain {variables} just like the output field. So if you create a field called {subject}, you can allow the user to choose the subject by putting {subject} into the subject box on the admin edit form page.

And can the poster be redirected to the post so they can continue to add in information?
That is something which I am working on for the new version.

I am not sure about the error with & for you, it seems odd to me. Do you have any special url related settings, or any url related mods installed?
Title: Re: Custom Form Mod
Post by: cleanfiles on August 05, 2008, 09:41:06 PM
Quote from: LHVWB on August 05, 2008, 07:19:34 PM
Quote from: cleanfiles on August 05, 2008, 08:43:13 AM
Also for the next version.... A drop down box to choose the post icon would be a great addition.

Do you mean a box in the admin area, or a box for the users. I could do both, I will add it to the list.



For the user to choose the icon would be great, I was thinking also if it were possible the option to choose which board the form posts to would be good as well. Like a form could then be used as a template to post a structured post on a board chosen from say a dropdown list.

I had a bit of trouble finding the forms as well, i had to leave the semi colon on the link like this to reach the page
/index.php?action=form;
Title: Re: Custom Form Mod
Post by: jimvy on August 06, 2008, 12:05:56 PM
Will this work for users to fill out the form but to have the form post into a board that they don't have permission to view? Like if I wanted to make a quiz for members to submit but I don't want to allow them to see each others answers, so it's posted in a board only I can see.
Title: Re: Custom Form Mod
Post by: SlowPaddle on August 06, 2008, 02:44:18 PM
Quote from: LHVWB on August 05, 2008, 07:19:34 PM
I am not sure about the error with & for you, it seems odd to me. Do you have any special url related settings, or any url related mods installed?

Nothing installed that would cause the problem. But like I mentioned, it was a rather simple fix.

I'm looking forward to seeing what the new version has to offer.

And thanks for the hard work putting this together. It's really appreciated.
Title: Re: Custom Form Mod
Post by: Nathaniel on August 06, 2008, 05:17:22 PM
Quote from: jimvy on August 06, 2008, 12:05:56 PM
Will this work for users to fill out the form but to have the form post into a board that they don't have permission to view? Like if I wanted to make a quiz for members to submit but I don't want to allow them to see each others answers, so it's posted in a board only I can see.

Yes it will allow them to post to a board they can't see, however at the moment it will try to redirect them to that board, so they will get an error message. I am working on giving admin the option to redirect users to different areas.
Title: Re: Custom Form Mod
Post by: tk2012 on August 07, 2008, 04:17:02 PM
Ok, the problem that I had previously isn't fixed like I thought.  I had something else confused with this one. 

Here the problem..

I'm in Custom Form Mod Settings -> ERROR ASSISTANCE FORM and am entering all the information.  I've added the title which is shown above here, Board ID, left the Custom Template blank since I'm using the default, set the permissions for everyone other than guests, and filled out the subject line.

All of that works fine.

This is the part which does not work for me.  For the Form Output, I have typed in the following information and then hit save only to have the screen go back to the current screen with the Form Output portion blank, but with all the information above still entact.

Quote

Name: {name}

Action being performed: {action}

When did this occur: {time}

What happened: {result}

Any other information: {additional}

Thanks for reporting the error.  Until I can find a solution, go race a few laps on the game and I'll see what I can do in the meantime!


Am I not making my information in the form correct or what could be wrong?

I've gone to the form listing link and have completed the form.  It does make a post with the title and in the correct board, but the post is blank inside because the actual Form Output keeps erasing after I hit save!  LOL. 

Help Me!

Once again, I'm on v2.0 b3.1

Whatever other information you need I'll get!

EDIT:  I don't seem to have the Modification.english-utf8.php or  Help.english-utf8.php files, but I have all the rest.  I'm attaching what I've done. to here.  I've double checked and the two files listed at the bottom of the mod procedulre are in the directories assigned, too.

Does it matter that there is a space between the two lines in this one?
// Load the language and templates....
loadLanguage('Admin');
loadTemplate('Admin');

loadLanguage('Modifications');
Title: Re: Custom Form Mod
Post by: tk2012 on August 07, 2008, 06:13:52 PM
Ok, this is what I've noticed and I don't know really the correct terminology, so work with me here...

All of my edits are done correctly in the files.

It appears that the WYSIWYG function is conflicting when you are in the Custom Form Mod Settings and trying to save.  I have the WYSIWYG set to default ON and when you are in the Form Output, this is where the problem is.  If the WYSIWYG is turned on, it will NOT save my entry there.  However, if I turn the WYSIWYG OFF, it WILL save the entry.

I'm not sure if this would be a bug with the WYSIWYG or a bug with this program.  I thought I would let you know because it was frustrating knowing that I double checked my edits and they were fine, but couldn't get this to work properly.  If it works fine on your forum with the WYSIWYG, then... I'm at a loss as to why it wouldn't be working on mine.  Like I said, turn it off and it is good to go!
Title: Re: Custom Form Mod
Post by: Nathaniel on August 07, 2008, 06:30:18 PM
@tk2012,
Ah, so that's the problem. I was wondering what it could be. I had already noticed the problems with the WYSIWYG editor in the first version of the mod, but I never found time to actually fix it. I had found that if you made edits in the non-WYSIWYG editor then everything works fine, its only if its in the WYSIWYG editor when you save it. Remember that the red A button, will swap between modes, so for the moment you can use that.

When I update the SMF 2 Beta version of this mod to version 1.2, after I have done the SMF 1.1.5 version. I will make sure that I resolve this issue, because it is indeed quite annoying. For now you can edit the output using the WYSIWYG editor, and it will save it, as long as you change to the normal editor before you save.

Please note that this error only occurs for the SMF 2 Beta version of the mod.
Title: Re: Custom Form Mod
Post by: tk2012 on August 07, 2008, 06:33:24 PM
Yepp!  I just have to toggle between modes with the "A"   I'm glad I figured it out because I was about to toss the laptop!!  LOL!
Title: Re: Custom Form Mod
Post by: cleanfiles on August 07, 2008, 09:46:57 PM
Hello again,
I have a problem. I was making a form and using some html in the title section and it has messed the whole form mod up, now i cant view any forms or edit them please see screen shots attached.
The html i was using was ,

<p> <br/> <xmp>  <a href=....  <img src=...  thats about it i think.

I have tried replacing the CustomForm.php  & the  CustomForm.template.php, this made no difference.
If it's a database issue, could you be basic in your answer please lol.
Title: Re: Custom Form Mod
Post by: tk2012 on August 07, 2008, 10:29:40 PM
Everything has been working since I turned off the WYSIWYG mode... but, what exactly do you type into the Extra Type Parameters in order to make people make an entry for the form to submit?

I thought it said to put 'required' like that, so I have, but I've been able to submit forms with nothing entered at all on my testaccount.  Am I just typing it in incorrectly?

Thanks again and sorry for the question!

-TK
Title: Re: Custom Form Mod
Post by: Nathaniel on August 08, 2008, 02:42:00 AM
@tk2012,
The stuff that you can put into those fields, is explained by pop-up from the little help icon [?] next to the setting. It basically allos you to add more needed variables for certain types, I wouldn't worry too much about it though. The next version actually gets rid of that field and replaces it with the relevant options for each field type, to make it much easier to understand.

If you have been having problems with the required field then could you please tell me which type you are having issues with.

@cleanfiles,
I am having a look at that at the moment. ;)
Title: Re: Custom Form Mod
Post by: God Of Mana on August 08, 2008, 09:17:15 AM
Quote from: LHVWB on August 08, 2008, 02:42:00 AM
@tk2012,
The stuff that you can put into those fields, is explained by pop-up from the little help icon [?] next to the setting. It basically allos you to add more needed variables for certain types, I wouldn't worry too much about it though. The next version actually gets rid of that field and replaces it with the relevant options for each field type, to make it much easier to understand.

If you have been having problems with the required field then could you please tell me which type you are having issues with.

@cleanfiles,
I am having a look at that at the moment. ;)

I actually am having a problem with the required fields. Even if I put some input into the boxes, I still get  the "* required fields" thing.

Check the problem out here at http://attish.yfma.com/forums/index.php?action=form;id=3;submit;
Log in as
Username: formtest
Password: 123456
Title: Re: Custom Form Mod
Post by: God Of Mana on August 08, 2008, 09:24:42 AM
I say your test... why on earth does it not work for me?
Title: Re: Custom Form Mod
Post by: Nathaniel on August 08, 2008, 09:25:56 AM
@God Of Mana,
Those errors are to do with how the current version of the mod, parses the inputted data. Basically it has millions of annoying bugs, which I will have to iron out, I am in the process of doing it at the moment. I hope to have to next version of this mod done when I can find the time.

QuoteI say your test... why on earth does it not work for me?

Which test? There are issues with the demo, if that is what you are refering to. At the moment this mod has quite a few bugs. I have to work through them.

@cleanfiles,
I got a bit distracted, but I can tell you that I will be adding some stuff to the next version, to stop you from adding html into the subject or output fields of the form page, because you should really only need to use bbc.

In terms of fixing the problem, I would use phpMyAdmin or whatever you have, to have a look at the '{db_prefix}custom_form' table for your smf database, you should be able to find the form entry in that table which is the issue and delete it.
Title: Re: Custom Form Mod
Post by: God Of Mana on August 08, 2008, 09:49:05 AM
Quote from: LHVWB on August 08, 2008, 09:25:56 AM
@God Of Mana,
Those errors are to do with how the current version of the mod, parses the inputted data. Basically it has millions of annoying bugs, which I will have to iron out, I am in the process of doing it at the moment. I hope to have to next version of this mod done when I can find the time.

QuoteI say your test... why on earth does it not work for me?

Which test? There are issues with the demo, if that is what you are refering to. At the moment this mod has quite a few bugs. I have to work through them.

@cleanfiles,
I got a bit distracted, but I can tell you that I will be adding some stuff to the next version, to stop you from adding html into the subject or output fields of the form page, because you should really only need to use bbc.

In terms of fixing the problem, I would use phpMyAdmin or whatever you have, to have a look at the '{db_prefix}custom_form' table for your smf database, you should be able to find the form entry in that table which is the issue and delete it.

hmm.. someone used the account i provided to test it. lol
Title: Re: Custom Form Mod
Post by: Nathaniel on August 08, 2008, 09:54:00 AM
@God Of Mana,
That was me. I wanted to have a look at specifically what you were talking about, the errors that you are having don't seem to be particularly out of the ordinary for that version of the mod. Like I said, I am working on making a newver and better version.
Title: Re: Custom Form Mod
Post by: God Of Mana on August 08, 2008, 10:08:07 AM
Quote from: LHVWB on August 08, 2008, 09:54:00 AM
@God Of Mana,
That was me. I wanted to have a look at specifically what you were talking about, the errors that you are having don't seem to be particularly out of the ordinary for that version of the mod. Like I said, I am working on making a newver and better version.

Ok, umm no offense, but i uninstalled it, because it isn't very stable.  :)
Title: Re: Custom Form Mod
Post by: tk2012 on August 08, 2008, 04:52:42 PM
I've done the following in my Subs.php file.

I wanted the button to be after the Member List, so I added this code after it.  I'm not a coder.  I have no clue if this is correct or not.  I simply looked at the code in front and behind and gave it my best to try to understand it.  I just want to make a button that when hit, will take my user to the forms page.

I replaced the action with the page location of the form which is action=form.
I put the context thinking that it allows the forms.gif to show in the bar.  (At least I think that is what it does.)
And I didn't list any sub buttons because there are no buttons on that page.


'form' => array(
    'title' => $txt['form'],
'href' => $scripturl . '?action=form',
'show' => $context['allow_forms'],
'sub_buttons' => array(
),
),


I made a button, although I don't know what font they use for these gifs.  I uploaded the button not caring right now what it looked like, but just to see if it would work... no deal.  Not sure what else I need to do.  I attached a button from my default/images/english folder to let you know what i'm talking about.  I'm not even sure if I have to do all this..
Title: Re: Custom Form Mod
Post by: cleanfiles on August 08, 2008, 05:45:31 PM
Thank you LHVWB, i deleted the form in phpmyadmin and now all my other forms are functional again. I'm glad it was so easy to fix and I have learned form this lol.
Thanks again.
Title: Re: Custom Form Mod
Post by: Nathaniel on August 08, 2008, 08:34:08 PM
@God Of Mana,
No offence taken, I know that its absolutely terrible at the moment. I have to do som serious work on it. ;)

@tk2012,
Try using $txt['CustomForm_tabheader'] or $txt['CustomForm_form] instead of $txt['form'].

@cleanfiles,
I am happy to here that it worked. :D
Title: Re: Custom Form Mod
Post by: tk2012 on August 09, 2008, 10:19:29 AM
I was able to get the button to appear.  I had to use the following code and needed to switch "show" to a "true" value.  So, the tab always shows, but only works if you have permission which is good.  If you are a guest, you can click on it all you want, but it won't do anything for ya.


'form' => array(
    'title' => $txt['CustomForm_form'],
'href' => $scripturl . '?action=form',
'show' =>[b] true[/b],
'sub_buttons' => array(
),


I know you said that you would be fixing the redirect after posting, so that if a person posting isn't able to see a particular board where the message goes... it would do something else. 

My question is this...  Where is the text that the error message is currently pulling?  I would just like to change the text that is displayed from the message which states something to the effect "the board you are trying to reach is not visible or doesn't exist" to "Thank you for your submission.  Your request will be handled shortly."

I can't find in the file where that is in order to change it.
Title: Re: Custom Form Mod
Post by: Nathaniel on August 09, 2008, 10:22:33 AM
@tk2012,
I would recommend against it, because that string is used whenever any of your members type in a board id, that they can't view or doesn't exist. You should however be able to find it, by searching for the error message, in your '/themes/default/languages/errors.english.php' file.

BTW, you probably don't need the b tags inside that code, I suspect that doing that would crash php. ;)
Title: Re: Custom Form Mod
Post by: The Saviour on August 09, 2008, 11:28:18 AM
After going to the Mod page and selecting the Manual installation instructions for my version of SMF, which is currently 1.1.5, it states this Mod isn't supported...and there are no manual instructions.

A little help, please?

Are you going to be adding the manual install instructions for 1.1.5, soon?
Title: Re: Custom Form Mod
Post by: Nathaniel on August 09, 2008, 07:13:15 PM
@The Saviour,
The manual install instructions do work. You just have to make sure that you have the radio button next to the mod package for the correct version checked. By default the SMF 2 Beta version is checked, so that isn't compatilible with your version. You can view the manual install instructions for your version by clicking on the option box next to the "CustomFormMod_v1.1_SMF1.1.5.tar.gz" file and then clicking the submit button for your version.
Title: Re: Custom Form Mod
Post by: The Saviour on August 10, 2008, 12:46:38 AM
Thank you...my bad.

Installed and working perfectly.  Can't wait for the changes you intend to make.
Title: Re: Custom Form Mod
Post by: Carlos Gandra on August 11, 2008, 12:11:36 PM
Is there a way to redirect "New topic" button in a certain board, to the form created for that board? :-[
Title: Re: Custom Form Mod
Post by: Nathaniel on August 11, 2008, 05:14:46 PM
Quote from: ac99 on August 11, 2008, 12:11:36 PM
Is there a way to redirect "New topic" button in a certain board, to the form created for that board? :-[

Nope, not at the moment. But a fair few people have asked for that feature, so I will have a look at adding it to the next version.
Title: Re: Custom Form Mod
Post by: Carlos Gandra on August 11, 2008, 07:01:35 PM
Thanks for your answer :)

Just another question... topics created by this form doesn't count as a post? I've a member with topics created using the forms, and his post count is zero :)

If it is suppose to be like that, could I change any bit of code to make forms count as posts?

Thanks a lot,
Regards from Portugal
Title: Re: Custom Form Mod
Post by: Nathaniel on August 12, 2008, 01:55:53 AM
@ac99,
I will have a look into that, I might add an option to the admin form setting page, to turn the counting of posts from a form, on or off.
Title: Re: Custom Form Mod
Post by: Carlos Gandra on August 12, 2008, 09:54:05 AM
Thanks :)
Title: Re: Custom Form Mod
Post by: Enders on August 13, 2008, 04:58:32 AM
Instead of creating a new topic for each submitted form, can we make one for a certain topic id (like a reply with a form)
Title: Re: Custom Form Mod
Post by: Nathaniel on August 13, 2008, 05:22:07 AM
@Enders,
That feature is on the list of things to add to the next version, which I am currently working on. ;)
Title: Re: Custom Form Mod
Post by: Axodious on August 13, 2008, 12:55:14 PM
I know you're obviously very busy working on the next version, do you have an estimated time when it will be released?
Title: Re: Custom Form Mod
Post by: tk2012 on August 13, 2008, 02:57:54 PM
@LHVWB

Could you take a look at a topic I have in the 2.0 category, please?  My forum has crashed and I'm getting database errors.  Part of it looks to be referring to the Custom Forms area.  I'm not sure if it is a cause or effect or totally unrelated.  But, any direction would be helpful to remedy the situation.  Plus, if it does have something to do with the Custom Forms, it may help someone else down the road.

http://www.simplemachines.org/community/index.php?topic=255196.msg1657908#msg1657908
Title: Re: Custom Form Mod
Post by: Nathaniel on August 13, 2008, 05:21:52 PM
@axodious,
It keeps on getting delayed, at the moment I have not ETA on its release.

@tk2012,
I don't think that the errors you are getting are related to this mod, I would try to have a talk to your host, because they seem to be host-related MySQL issues.
Title: Re: Custom Form Mod
Post by: tk2012 on August 13, 2008, 05:24:32 PM
Thanks I've emailed them to find out what is happening.

I just hope this doesn't mean I have to start all over again building my forum!!
Title: Re: Custom Form Mod
Post by: Smoothbrain on August 15, 2008, 08:07:48 AM
I just wanted to thank you for this great mod!  And also thanks to tlknowles for writing that little tutorial which helped me figure out what I was doing wrong.  One quick question, is there a way to get the form title to include the person's name?  Like Application {name}
Title: Re: Custom Form Mod
Post by: Nathaniel on August 15, 2008, 08:10:59 AM
@Smoothbrain,
That is a feature which I am working on for the next version of the mod. :)
Title: Re: Custom Form Mod
Post by: Smoothbrain on August 15, 2008, 09:42:09 AM
Thanks you rule!
Title: Re: Custom Form Mod
Post by: bbates7995 on August 21, 2008, 09:56:35 PM
I've created a form and it works great, except when I have 'Required' fields.

It just redirects back to the form and puts the required fields in red although I completed them originally.
Title: Re: Custom Form Mod
Post by: Nathaniel on August 22, 2008, 01:42:34 AM
@bbates7995,
This is a known bug, I'm working on updating this mod, I just haven't found the time lately. ;)
Title: Re: Custom Form Mod
Post by: Sudhakar Arjunan on August 22, 2008, 02:39:32 AM
Quote from: LHVWB on August 22, 2008, 01:42:34 AM
@bbates7995,
This is a known bug, I'm working on updating this mod, I just haven't found the time lately. ;)

Thanks for it, i also need fix for it.
Its Use Custom Form Mod and its great mod. Thank you LHVWB.
Title: Re: Custom Form Mod
Post by: Gamez on August 27, 2008, 11:59:23 AM
This is indeed a very awesome mod, too bad for the required field  bug. :( *waits impatiently for a fixed release*

edit: I removed the required attribute and now I just get a "Hacking attempt... " message...  :-\
Title: Re: Custom Form Mod
Post by: Nathaniel on August 27, 2008, 05:18:53 PM
@Gamez,
Which page do you get the 'Hacking Attempt' message on?
Title: Re: Custom Form Mod
Post by: Gamez on August 28, 2008, 08:21:05 AM
LHVWB, I get the message upon submitting a form( obviously, with no required fields).
more specifically "/index.php?action=form;id=2;submit;"
Title: Re: Custom Form Mod
Post by: bbates7995 on August 29, 2008, 10:56:40 AM
We use the mod to submit applications which are posted in a restricted board.  The person submitting the board gets an error upon submission because they do not have rights to view the board.

Is there a way to redirect the person submitting the application to a different page?
Title: Re: Custom Form Mod
Post by: Nathaniel on August 29, 2008, 07:54:27 PM
@Gamez,
I will have to investigate this issue. ;)

@bbates7995,
This is a feature that is going to be added to the next version of the mod.
Title: Re: Custom Form Mod
Post by: MrGoodbar on September 02, 2008, 03:06:51 AM
@LHVWB

very cool mod indeed.  Thank you for taking the time to work on something like this.  I am patiently waiting for the new version to come out for 1.1.5  :D

I have read through all the bugs and this post.  I am having having troubles getting the features and options page to load correctly.  As soon as I click on 'features and options' I am directed to a blank white screen. And I have narrowed it down to the form portion that is contained in the modsettings.php file, just do not know where. 

note: i am using TP and helios multi theme. 

some things I had to do to get to where I am now.  By no means am I a coder.  I understand it and can manipulate it and do small things.


// MGB: Had to put this code here before the karma section to get it to work.  also had to comment out the 'is last' => true, because it is not last.
// --- Custom Form Mod -------------
      'customform' => array(
        'title' => $txt['CustomForm_tabheader'],
        'href' => $scripturl . '?action=featuresettings;sa=customform;'
        // 'is_last' => true,   // MGB: i wonder since this is not the last one, should it just be commented out?
// --- End modification ------------
        ),

      'karma' => array(
        'title' => $txt['smf293'],
        'href' => $scripturl . '?action=featuresettings;sa=karma;sesc=' . $context['session_id'],
        'is_last' => true,     
        ),


now after doing that and commenting out the 'form' portion the end of the code; when i click 'features and options' it loads and looks fine.(see progress_thus_far.jpg)
and of course since i comment out the code, when i click on Custom Form, i am directed to a blank page.

And another side note, With the current modifications to my modsettings.php; i have found that the Integrate Lightbox mod does not work.  I am waiting to see if the custom form problem that I am having can be fixed before singling out the customform mod as being the problem with lightbox not working. 
I hope that this just adds some more insight for you.  Also enclosed is my modsettings.php file. 

And again great work!!!!!!!!!! thank you!!!!!

-MGB
Title: Re: Custom Form Mod
Post by: Nathaniel on September 02, 2008, 04:15:57 AM
@MrGoodbar,
I am glad that you like this mod. I have been meaning to make a new version for this mod for quite some time, however I have another project that I am working on, so unfortionately this mod has been put lower on the 'To Do' list. ;)

In terms of your issue:
For some reason, that file has three copies of all of the functions relating to the settings for this mod. Its likely that you had some issues with the package manager when you installed the mod, or you manually installed it and then copied the code too many times. ;)

I have deleted the duplicate functions and attached your 'ModSettings.php' file to this post.

Any other issues, could be caused by other duplicate parts of code from the installation of this mod in your forum. You can try to find an remove them by using the '                Manual Install Instructions for SMF' function on the mod download page, it will give you a list of edits that the mod makes to your forums files.

As an extra note, by default this mod adds its tab to the end of the tabs, so it needs the 'is_last' bit. I don't believe that this would cause any errors because SMF fixes this anyway, so that you can add tabs easily, as with this mod. ;)
Title: Re: Custom Form Mod
Post by: MrGoodbar on September 02, 2008, 09:56:29 AM
thank you very much.  It was nearing 3am for me when i made that post, and I had a feeling that it was multiple things.  Thanks for the reply man.  ty very much indeed. 
Title: Re: Custom Form Mod
Post by: neich on September 05, 2008, 07:38:07 AM
After installing this mod and experiencing problems with the "required" fields, I have taken a look at the code and the problem seems the mix of types. One quick fix is find line 171 in CustomForm.php, which contains this:

&& (($value == '') || ($value == 0))

and change it with:

&& ((is_string($value) && ($value == '')) || (is_int($value) && ($value == 0)) || (is_float($value) && ($value == 0.0)))

In general, the mod should use is_string, is_int and is_float where appropiate to get correct results. I guess that the problem comes from comparing a string with and intger because probably re result is undefined and then you get the random errors.
Title: Re: Custom Form Mod
Post by: Nathaniel on September 05, 2008, 07:52:31 AM
@neich,
I am not entirely sure what is causing those errors, I really haven't had any time to fix the issues with this mod, which is really unfortunate because I like it. :( Hopefully I will find some time to do it in the next few weeks, otherwise it may wait for a few more months....
Title: Re: Custom Form Mod
Post by: neich on September 05, 2008, 07:59:39 AM
Quote from: LHVWB on September 05, 2008, 07:52:31 AM
@neich,
I am not entirely sure what is causing those errors, I really haven't had any time to fix the issues with this mod, which is really unfortunate because I like it. :( Hopefully I will find some time to do it in the next few weeks, otherwise it may wait for a few more months....


I have tried this fix and it works, and I am pretty sure that the problem is that you aure using "==" when you should use "===" in most cases since you are comparing different types.
Title: Re: Custom Form Mod
Post by: Nathaniel on September 05, 2008, 08:11:50 AM
Yep, the problems are probably as simple as that. I just don't have time to do all the testing and fixing that is involved with creating a new version, but when I get time I will. ;)

Thanks for having a look at it. ;)
Title: Re: Custom Form Mod
Post by: Axodious on September 05, 2008, 11:25:13 PM
I feel like a cat who is having a catnip covered toy dangled just out of my reach.  :(
Title: Re: Custom Form Mod
Post by: Nathaniel on September 07, 2008, 05:26:32 PM
@axodious,
Again, I am sorry that I haven't been able to work on this mod. Hopefully I will have some time to fix up these bugs during my holidays (in ~1-2wks).
Title: Re: Custom Form Mod
Post by: tk2012 on September 09, 2008, 09:16:09 AM
I have an error that has crept up on the error log.  I didn't manually enter this portion, so I'm not sure what happened, but it looks like it entered the new code in the wrong area.  Not sure though, so would like confirmation.. or a solution if that isn't the entire problem..

using v2.0 b3.1 on default theme (w/ color changes only)
** can see error info attached **





The code was entered like this thru package manager:
// Mod Authors for a "ADD AFTER" on this line. Ensure you end your change with a comma. For example:
// Place the Custom Form Mod Link.
'customform' => array($txt['CustomForm_tabheader']),
// 'shout' => array($txt['shout']),
// Note the comma!! The setting with automatically appear with the first mod to be added.
'rules' => array($txt['mods_cat_rules']),


Should I clean it up to look like this:
// Mod Authors for a "ADD AFTER" on this line. Ensure you end your change with a comma. For example:
// 'shout' => array($txt['shout']),
// Note the comma!! The setting with automatically appear with the first mod to be added.
'rules' => array($txt['mods_cat_rules']),
// Place the Custom Form Mod Link.
'customform' => array($txt['CustomForm_tabheader']),


Will this help correct the error?  or is it something else?
Title: Re: Custom Form Mod
Post by: Nathaniel on September 09, 2008, 05:24:45 PM
@tk2012,
That error, is being caused by a missing language string from the 'The Rules' mod. You should ask about it in the support topic for that mod:
http://www.simplemachines.org/community/index.php?topic=257740.0
Title: Re: Custom Form Mod
Post by: tk2012 on September 09, 2008, 07:06:46 PM
Thanks... that slipped by me there.  I noticed the words custom form and not cat rules... sorry and thanks!
Title: Re: Custom Form Mod
Post by: Nibogo on September 10, 2008, 09:51:42 PM
Hi LHVWB

I have a little problem with this great mod , i select the option of "Selection Box" , and i can only add one selection , how i can add more??
Title: Re: Custom Form Mod
Post by: Nathaniel on September 10, 2008, 09:59:58 PM
@NIBOGO,
You have to add them as a list separated by ',' commas, to the 'Extra Type Parameters' setting for that field.
Title: Re: Custom Form Mod
Post by: Nibogo on September 10, 2008, 10:11:43 PM
Quote from: LHVWB on September 10, 2008, 09:59:58 PM
@NIBOGO,
You have to add them as a list separated by ',' commas, to the 'Extra Type Parameters' setting for that field.

OMFG!!

lol  :P :P

Thanks
Title: Re: Custom Form Mod
Post by: SpeedHighway on September 16, 2008, 08:49:35 PM
Two things...
One, when I make a form, I cannot get it to "run."
I have made a test forum with a single selection box and when I click "Submit Form" I get this:

QuoteYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's main character name here...', 1, 255), SUBSTRING('My primary game is: Warhamme' at line 4
File: ~/public_html/SMF/Sources/Subs-Post.php
Line: 1542

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 1.1.5, while your database is at version 1.1.2. The above error might possibly go away if you execute the latest version of upgrade.php.

I know that the error about the database files are not accurate and I'm not sure what's wrong with the SQL.  It's just the straight code in that spot for making a post, nothing that this mod changed and making posts everywhere else is perfectly fine when done by hand.

Secondly:
Would it be possible to add a multi-checkbox feature.
This way I can give someone options and they can check multiple items.  Then when it is listed in the post, it lists them, "Item1, Item2, Item4, Item7, Item10", etc. 
Thank you, very much, LHVWB!
Title: Re: Custom Form Mod
Post by: Nathaniel on September 16, 2008, 09:00:43 PM
Does it work without putting any quotes ' into the field?

Ouch, that is an aweful bug. I don't even sanitize those fields properly...... :(

I really have to make a new version of this mod, its absolutely terrible for security at the moment. I will have to fix that. ;)
Title: Re: Custom Form Mod
Post by: SpeedHighway on September 17, 2008, 09:35:10 AM
I actually did not have any quotes in the field.  Adding them into the field, now, as a test, has added them to the list's entries and completely confused the application.  Now when I click Submit Post, it simply turns *Required red and does nothing.  (Mind you, I have no required questions).

Allow me to attach a screenshot of the setup.

First 2 screens are my normal settings.

3rd screen is the reaction when I add quotes into the mix.

EDIT:
As a side note, what username is used to make the post.  Perhaps that's the info missing causing the "POST" to fail?
And on your demo page, you may want to mention that you changed the username/password to testing/testing =D
Title: admin log in
Post by: rizhii on September 17, 2008, 01:55:25 PM
I can not log in as an admin to try the demo, if I create an account I do not get the admin tab?  assistance anyone?
Title: Re: Custom Form Mod
Post by: Nathaniel on September 18, 2008, 03:49:19 AM
@SpeedHighway,
Am I right in saying that you had some quotes in the output for the form? Because that first error is definetly related to having an unescaped comma in the sql query. I am not sure about the second error, although there are some major flaws with the required field code that I have to fix. ;)

@rizhii,
The test account does not have admin privilages, I setup the demo so that you can see what the mod looks like when you are using it as a user. I am not going to allow people to use the admin area, because of moderation/security concerns. ;)
Title: Re: Custom Form Mod
Post by: rizhii on September 18, 2008, 08:46:52 AM
Thanks.... I know I am a complete noob with SMF but I do know what a form looks like.... I don't see any on the demo forum.  The posts that I see are support test posts.  the form action takes me to a page... I finally got it I am slow.
Can I use this as a Q&A for surveys ex. I want to ask the users about 15 questions and each question will have possible 3 answers each.
Also can I post this in a section of the board that user will have to enter a specific code (invitaion only kinda thing) in order to view and fill out the form?


Thanks
Title: Re: Custom Form Mod
Post by: SpeedHighway on September 18, 2008, 09:56:00 AM
Quote from: LHVWB on September 18, 2008, 03:49:19 AM
@SpeedHighway,
Am I right in saying that you had some quotes in the output for the form? Because that first error is definetly related to having an unescaped comma in the sql query. I am not sure about the second error, although there are some major flaws with the required field code that I have to fix. ;)

Actually no.
My output contained only this:

My main game is: {GameTypes}

EDIT: Although the subject said: Will be the user's main character name
Because I had not added the question for that yet

EDIT2:  I removed that ' in the word users's and it works.  Unfortunately, I guess required still does not work?  (It simply comes back with the red "required" when I make anything required. 

And is there any chance of that suggestion or would it be okay if I tried to implement that myself?

Thanks, LHVWB!
Title: Re: Custom Form Mod
Post by: learjet45 on September 23, 2008, 07:42:01 PM
Is there going to be a version for 1.1.5? Or is there something that I can do to get the 1.1.5 version to work with 1.1.6 because it is telling me that the package isnt compatible with my version of SMF/
Title: Re: Custom Form Mod
Post by: Nathaniel on September 23, 2008, 08:37:03 PM
@rizhii,
1) Yes, you should be able to use the 'Selection Box' type.
2) Yes, you can post the forms output into any board.

@SpeedHighway,
If you are referring to the multiline checkbox then that is already on the list of things to add to the next version.

@learjet45,
Try the attached copy, I haven't tested it but it should work. I just changed the versions that the package will allow itself to be installed for. ;)
Title: Re: Custom Form Mod
Post by: 4b11l on September 23, 2008, 11:58:02 PM
Just curious, are you still testing and planning on a next release on this? Don't mean to sound mean or anything, but just curious. :)
Title: Re: Custom Form Mod
Post by: Nathaniel on September 24, 2008, 12:21:21 AM
@4b11l,
At the moment No. I am very busy with another project that I am working on (SimplePortal), so I don't really have any time to update this mod. I am hoping that I will find some time next week, but its unlikely that it will get finished until after my exams (~6weeks).
Title: Re: Custom Form Mod
Post by: 4b11l on September 24, 2008, 12:28:16 AM
Cool, thanks for the updates. I've seen you released many other mods but didn't get time for this one. Anticipating the next release; cheers.
Title: Re: Custom Form Mod
Post by: learjet45 on September 24, 2008, 12:29:00 AM
Thanks. I'll test it out right now and let you know.


Edit: It installed just fine on 1.1.6 although I dont have time to set up a page right now to test it out. I really need to get off to bed. Thanks :)
Title: Re: Custom Form Mod
Post by: GaminGarage on October 01, 2008, 03:19:32 PM
@LHVWB:

i installed the version you just attached and it installs fine to 1.1.6, the only problem is when i try and click on the form i get this:

Not Acceptable

An appropriate representation of the requested resource /index.php could not be found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.8b mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 PHP/5.2.6 mod_perl/2.0.4 Perl/v5.8.8 Server at www.gamingarage.com Port 80


can anyone help?
Title: Re: Custom Form Mod
Post by: Gamez on October 01, 2008, 04:46:14 PM
@LHVWB: I did a lot of testing to narrow down the cause of the 'hacking attempt' message and I figured it out. I was using an {keyword} in the for the subject field with a single quote to denote ownership. I.e. {Name}'s Thread . Once I removed the ' everything works fine(with of course the fix for the required fields a page or so back.)
Title: Re: Custom Form Mod
Post by: Nathaniel on October 01, 2008, 10:26:08 PM
@4b11l,
I know I have been negleting this mod, thats for sure, but I just haven't managed to get around to updating it yet. Thats the truth. ;)

@GaminGarage,
Which pages is that happening for?

@Gamez,
I know that there are some bad errors with 'variable sanity' in the code, thats on the 'to do' list of things that I need to fix.
Title: Re: Custom Form Mod
Post by: SpeedHighway on October 02, 2008, 09:08:26 AM
Quote from: LHVWB on September 23, 2008, 08:37:03 PM
@SpeedHighway,
If you are referring to the multiline checkbox then that is already on the list of things to add to the next version.

Ah, okay.  Can I just verify, then, that the 'required' function is fully inoperable at this time?  If I make ANYTHING 'required' then the user cannot click the finish button at the end.
Title: Re: Custom Form Mod
Post by: Nathaniel on October 02, 2008, 09:11:35 AM
@SpeedHighway,
Yes, I believe that you can. It seems to be totally random in what it does (although nothing in computers is actually random). It doesn't seem to be very useful at the moment which is unfortunate.
Title: Re: Custom Form Mod
Post by: GaminGarage on October 03, 2008, 01:24:48 PM
well the link that leads from the action=form page to this: http://www.gamingarage.com/index.php?action=form;id=2
Title: Re: Custom Form Mod
Post by: Nathaniel on October 03, 2008, 08:52:28 PM
@GaminGarage,
I'm not sure about that error, do you get any errors in your Forum Error Log (http://docs.simplemachines.org/index.php?topic=150) at the same time?

Also, what input did you put into the options in the admin panel for that form?
Title: Re: Custom Form Mod
Post by: SpeedHighway on October 03, 2008, 09:08:27 PM
I was looking at this trying to find the solution..

if(($required

&& (($value == '') || ($value == 0))

&& ($field['type'] != 'checkbox'))

// Failing for selectboxes is far more simple, If there is no valid value, it fails.

|| (($field['type'] == 'selectbox') && ($value == '')))


I can't see any errors offhand, but it may be easier to read if you remove the entire "|| (($field['type'] == 'selectbox') && ($value == '')))" section.  If you are already checking for $value == '' then you don't need to worry about if it's a selectbox or not, I think.

Still looking, but that's all I can see right now :(
Title: Re: Custom Form Mod
Post by: Nathaniel on October 03, 2008, 09:22:09 PM
Yeah, I know. That code is ugly, and I haven't really fixed it up properly yet. Fixing up that code will be the main thing that I do for the next update (when it comes).
Title: Re: Custom Form Mod
Post by: SpeedHighway on October 03, 2008, 09:28:40 PM
Have you ever heard of this one?  Whenever another one of our guild members tries to get to the index.php?action=form page or to any form it states "No Input File Selected" and he can't get to the page.
Title: Re: Custom Form Mod
Post by: GaminGarage on October 04, 2008, 08:54:29 AM
didnt get any forum log errors,

here is what my setup looks like:

(http://i34.tinypic.com/zuiesl.jpg)

my board id 30 goes to:

http://www.gamingarage.com/index.php/board,30.0.html
Title: Re: Custom Form Mod
Post by: Jorin on October 07, 2008, 03:24:27 AM
Sorry, is there a possibility that a custom form is only shown at the first post of a thread? So that the answers in that thread are normal postings without a custom form?
Title: Re: Custom Form Mod
Post by: tk2012 on October 11, 2008, 07:09:08 PM
Hey there -

I just upgraded to b4.0 and I use the default theme.  Everything is working correctly, but one thing; the FORM tab.  It was fine for b3.1

Now, I had no failed tests when I installed this mod after the upgrade.  I even went back and checked every edit in each file to make sure it was complete.  No problems as everything was completed.

Then, I went back and did the things you instructed Angeletos at the beginning of this thread including clearing my cache and still nothing.  I have it visible to all membergroups, but still nothing.

What am I missing?  I've looked at permissions and the admin settings.

If I go to the actual link, I can see everything I created.  I just can't get the tab to be visible to get people to the link.




Possibly related, but not sure...

I've noticed that if I go into permissions of ANY membergroup, the permissions change on the Custom Form Mod when I hit save.

This is what is happening:

*  Go into Admin > Members > Membergroups > Permissions

*  Will just review permissions and then hit save

*  When it returns to the list of membergroups, the # of permissions will be lower than what it was when I originally went in there.  (Even if I didn't make any changes.)

*  Go into the Custom Form settings under Configuration > Modifications and I will notice the permissions for the membergroups (like which forms can be seen) have all been reset.

Title: Re: Custom Form Mod
Post by: Nathaniel on October 13, 2008, 06:13:39 AM
Quote from: SpeedHighway on October 03, 2008, 09:28:40 PM
Have you ever heard of this one?  Whenever another one of our guild members tries to get to the index.php?action=form page or to any form it states "No Input File Selected" and he can't get to the page.

No, that is an odd error. Do you have any similar errors in your Forum Error Log (http://docs.simplemachines.org/index.php?topic=150) that have any more description?

Quote from: GaminGarage on October 04, 2008, 08:54:29 AM
didnt get any forum log errors,

here is what my setup looks like:

my board id 30 goes to:

http://www.gamingarage.com/index.php/board,30.0.html (http://www.gamingarage.com/index.php/board,30.0.html)

I really can't see any issues with that setup. What about errors in your hosting account/server error log?
Does this error happen for every one of your forms that you make?

Quote from: nehcregit on October 07, 2008, 03:24:27 AM
Sorry, is there a possibility that a custom form is only shown at the first post of a thread? So that the answers in that thread are normal postings without a custom form?

No, I have no intention o make this mod add forms anywhere in the forum apart from the forms action. Although you could put a link to the relevant form.

@tk2012,
1) Can you please post your 'Subs.php' file?
2) That is definetly an error with this bug, I will have to fix it next time I update it. I am not sure if its related or not.
Title: Re: Custom Form Mod
Post by: tk2012 on October 13, 2008, 10:57:26 AM
Sure thing.

Like I said... I just can't get the tab to appear on the top nav bar, but it looks like all the edits were completed.  Everything else seems to work fine.



BTW -  If you haven't seen the permisisons error before and want to see it first hand, I can set my TESTaccount logon to be an Admin if you want to jump on and see it. 

Title: Re: Custom Form Mod
Post by: tk2012 on October 14, 2008, 06:52:19 PM
Use this one!!!  I realized that I installed another mod after that file was attached earlier.

Title: Re: Custom Form Mod
Post by: Nathaniel on October 15, 2008, 06:34:33 AM
Try this. I don't believe that the mod actually bothers to add its own tab - Although it should be optional.
Title: Re: Custom Form Mod
Post by: tk2012 on October 15, 2008, 10:19:10 AM
Well, the Tab appears which is the good news.

The bad news is that the Admin > Modifications > Custom Form screen is completely white when you click on it and can't see anything in order to add, delete, change, or save your forms.   :(
Title: Re: Custom Form Mod
Post by: twon on October 15, 2008, 11:29:38 PM
Is there anything that may work with 1.1.6 similar to this....I have been totally out of luck...anyone???
Title: Re: Custom Form Mod
Post by: Nathaniel on October 16, 2008, 01:48:41 AM
@tk2012,
Any related errors in your Forum Error Log (http://docs.simplemachines.org/index.php?topic=150)?

@twon,
This mod should work with any SMF 1.1.x version, you just need to change the versions that it will allow itself to be installed for. ;)

I haven't tested the attached package, but it should install for SMF 1.1.6.
Title: Re: Custom Form Mod
Post by: tk2012 on October 16, 2008, 10:00:44 AM
I just upgraded to b4.0 on Friday and I have ten errors in my log.  I don't see anything that deals with the Custom Form modification.  All I know is when I try to get into the Admin settings for Custom Forms the screen goes blank (white).   :(   I attached my error log in case you can tell something from it.
Title: Re: Custom Form Mod
Post by: JonoJames on October 16, 2008, 11:28:51 AM
Hi there, i've just installed this mod.

However when i create the template which will appear once the form has filled in the post is just blank and nothing appears.

Also when i click save after doing this it just refreshes the page and all the information i entered is gone
Title: Re: Custom Form Mod
Post by: tk2012 on October 16, 2008, 11:49:56 AM
@ JonoJames         Are you using the WYSIWYG as your default editor in your posts?

If so, switch it to the standard editor and then hit save.  Try that.  I had that problem previously and it was fixed just by clicking it to standard editor before saving your form.
Title: Re: Custom Form Mod
Post by: twon on October 16, 2008, 02:16:21 PM
Hello,
Thanks for the support. The version worked kinda. I fixed about 5 errors in coding with the modsettings.php.

Also, I have made a form but i cannot make any fields. I click on the link to make a field and it only gives me the option to save.

Any ideas
Title: Re: Custom Form Mod
Post by: tk2012 on October 18, 2008, 12:23:28 AM
@ LHVWB

I went ahead and reinstalled b4.0 and added that Subs.php edit to it and EVERYTHING is working now.  Something must not have gone correctly during my upgrade!  Thanks for that edit though.  Appreciate it!
Title: Re: Custom Form Mod
Post by: Nathaniel on October 18, 2008, 03:09:13 AM
@twon,
Can you please post your 'ModSettings.php' file, there might be another issue there.

@tk2012,
Good, I like it when things work properly. ;)
Title: Re: Custom Form Mod
Post by: twon on October 18, 2008, 08:24:00 AM
Ok here it is...
Like i said everything seems to work find except when go to the add field section the only thing you can do is save...and it doesnt even save anything.
Title: Re: Custom Form Mod
Post by: Sudhakar Arjunan on October 24, 2008, 11:27:37 AM
HI LHVWB,

I like the custom form mod since i have started using on 1.1.6.

Now some i have got the custom form mod installed in my smf 2.0.4

A Form is created and its working perfectly.

But i could get the access permission error everyday once.

Say example. When i receive a complaint from a users says, they could not use it.

When i check the custom form and i could see all the permission were not selected.

Its like a mystery happen every day once .

I have to go everyday and select / confirm whether the user permissions were selected or not both inside custom form as well the form creation area.
Title: Re: Custom Form Mod
Post by: Nathaniel on October 27, 2008, 01:57:42 AM
@twon,
I just noticed that the package that I posted for 1.1.6 in an earlier post, is actually a dev version. So it won't work at all. I believe you have that installed, try uninstalling it and then installing the attached version.

@asudhakar,
Does this happen every day without fail? Or does it happen whenever you change other permissions? Or etc.

At everyone:
If you installed the mod for SMF 1.1.6, that I posted in an earlier post, then I strongly recommend that you uninstall it and then reinstall the version attached.
Title: Re: Custom Form Mod
Post by: RCC_SaMiaM on October 27, 2008, 12:44:21 PM
Getting a Failed on Sources/ModSettings.php with the 1.1.6 version you have attached to your post.
Title: Re: Custom Form Mod
Post by: vmp1253 on October 29, 2008, 06:26:10 PM
Quote from: RCC_SaMiaM on October 27, 2008, 12:44:21 PM
Getting a Failed on Sources/ModSettings.php with the 1.1.6 version you have attached to your post.
Ya same here
Title: Re: Custom Form Mod
Post by: Nathaniel on October 30, 2008, 01:58:14 AM
@RCC_SaMiaM and vmp1253,
I don't get any install errors with the version of the mod that I posted above. Which edits are you receiving errors for?
Title: Re: Custom Form Mod
Post by: vmp1253 on October 30, 2008, 03:33:26 PM
    ./Sources/ModSettings.php     Test failed
It does not have a line can i get the info for the code that u added to the modsettings.php
Title: Re: Custom Form Mod
Post by: Nathaniel on October 30, 2008, 04:28:08 PM
Hmm, can you post a copy of your 'Sources/ModSettings.php' file as an attachment?
Title: Re: Custom Form Mod
Post by: vmp1253 on October 30, 2008, 07:26:28 PM
ok
Title: Re: Custom Form Mod
Post by: Nathaniel on October 31, 2008, 01:57:17 AM
@vmp1253,
The mod is already installed on that file. Try uninstalling the last version of the mod, before you install the new version. ;)
Title: Re: Custom Form Mod
Post by: vmp1253 on November 02, 2008, 12:00:58 AM
Now have this
Fatal error: Cannot redeclare customformsettings() (previously declared in /homepages/22/d236505996/htdocs/BocSmf/Sources/ModSettings.php:506) in /homepages/22/d236505996/htdocs/BocSmf/Sources/ModSettings.php on line 1204
Title: Re: Custom Form Mod
Post by: Nathaniel on November 02, 2008, 12:24:18 AM
Thats probably because you installed the next version, before all the old parts were gone. If you post your 'ModSettings.php' file as an attachment then I should be able to fix it.
Title: Re: Custom Form Mod
Post by: vmp1253 on November 04, 2008, 01:22:19 PM
k up 4 posts lol
Title: Re: Custom Form Mod
Post by: Nathaniel on November 05, 2008, 01:05:01 AM
Okay, I have uninstalled the mod for the attached file.
Title: Re: Custom Form Mod
Post by: vmp1253 on November 05, 2008, 07:14:56 PM
k still getting      Execute Modification     ./Sources/ModSettings.php     Test failed
Title: Re: Custom Form Mod
Post by: vmp1253 on November 05, 2008, 07:37:21 PM
can u have all info add it to the blank file
Title: Re: Custom Form Mod
Post by: TroyG on November 07, 2008, 11:16:01 PM
Is there a way to post to one thread and have just keep adding to were it makes a running list.
http://www.volkstalk.com/forum/index.php?topic=360.0
instaed of
http://www.volkstalk.com/forum/index.php?board=43.0

I would like it to look something like this

R/T           60Ft            330           1/8 Time           1/8 Mile MPH
.023         1.35            4.25           7.01                      98                   Output from form
.023         1.35            4.25           7.01                      98                   Output from form
.023         1.35            4.25           7.01                      98                   Output from form
.023         1.35            4.25           7.01                      98                   Output from form
.023         1.35            4.25           7.01                      98                   Output from form
.023         1.35            4.25           7.01                      98                   Output from form
.023         1.35            4.25           7.01                      98                   Output from form
Title: Re: Custom Form Mod
Post by: vmp1253 on November 09, 2008, 10:07:11 PM
when update for 1.1.7
Title: Re: Custom Form Mod
Post by: Nathaniel on November 09, 2008, 10:14:08 PM
@TroyG,
Might look at adding that to the next version.

@vmp1253,
When I find time for updating this mod, it will happen. ;)
Title: Re: Custom Form Mod
Post by: Paracelsus on November 10, 2008, 04:03:44 AM
LHVWB,

Your MOD is working flawlessly on 1.1.7. One just need to edit the package-info.xml and add "1.1.7" x2 to the version list.
Title: Re: Custom Form Mod
Post by: Propaganistas on November 11, 2008, 11:32:16 AM
Hiya,

I keep getting this error in my log file:

Quote8: Undefined index: custom_tab_mods_cat
File: /home/*********/public_html/forum/Sources/ModSettings.php
Line: 142

It also seems nothing happens when I press the Submit Form button
Edit: after I removed the 'required' parameters, this came up whilst trying to submit a form:
QuoteYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'gwbbcode';/*
*/ /*
*/ /* Include the overDiv div *//*
*/ var overdiv_div =' at line 4
File: /home/*********/public_html/forum/Sources/Subs-Post.php
Line: 1538
gwbbcode is another modification, which adds a lot of BBCode.

Any help would be appreciated!

Greetz
Propa
Title: Re: Custom Form Mod
Post by: Garou on November 14, 2008, 03:22:16 AM
LHVWB, I am loving this mod. I was using the un-packaged Custom prefills mod I found on Tiny Portal which was usable but this is exactly what I was looking for. Im now using it for an application form on one site and a bug tracker and a hidden support/contact board on another. Its just about perfect. :)

I do have a couple ideas for improvement for ya though.

The first would be being able to set the Message icon for the Forum Output. Sorry I found that that was planned already. Must have missed it the first time.

The other is probably a bit more complicated. The Custom Templates example you listed is excellent but as many people that use SMF are not always that familiar with PHP coding... How much trouble would it be to add a wysiwyg  editor for the templates instead?

I'm picturing something like the input box you have for the forum output editor. That way the admin could set up the form the way they like and would just use the {variable} function to input the form fields.

I'm not sure how much work either would take but its just something that came to mind as I was setting things up on my sites. Either way its still a beautiful mod and I can not thank you enough for making it. You deserve a giant pat on the back.
Title: Re: Custom Form Mod
Post by: Dem0n on November 16, 2008, 10:00:31 AM
How do I actually link to a form? I have one created, and it shows in the list of forms, but I only have the option to edit or delete it. When I view "/index.php?action=form" nothing is listed?
Title: Re: Custom Form Mod
Post by: Dem0n on November 17, 2008, 09:19:44 AM
nvm got it to work. is there any way to change where a user is redirected to after submitting the form?
Title: Re: Custom Form Mod
Post by: Garou on November 17, 2008, 09:29:48 AM
Not yet but LHVWB said it might be in the next version.
Title: Re: Custom Form Mod
Post by: Garou on November 17, 2008, 10:12:23 PM
*edit* Ignore this post I fixed it.

I'm working on making an example form for the other staff on one of my sites to look at and learn from so they can make their own forms without having to bug me. I decided that I really should do something with the template so one, they can see how to do it, and also I could put extra instructions in there for them.

That said I'm running into a few problems that I'm sure I could find if I spent some time actually learning to code rather then just cutting and pasting what I know already works. LOL

OK here is the code I have so far...

// This is an example showing how to alter the submit form page.
function form_template_exampleform()
{
global $context, $txt, $settings, $scripturl;

// Starting text for the form and tables. Don't muck with this, unless you need to change the style!!!  ;)
echo '
<form action="', $context['post_url'], '" method="post" accept-charset="', $context['character_set'], '">
<table width="80%" border="0" cellspacing="0" cellpadding="0" class="tborder" align="center">
<tr><td>
<table border="0" cellspacing="0" cellpadding="4" width="100%">
<tr class="titlebg">
<td colspan="3">', $context['settings_title'], '</td>
</tr>
<tr class="windowbg2">
<td colspan="3"><br /></td>
</tr>';

// Here you can add rows to the beginning of the table, if you want to...
/* Like this:
echo '
<tr class="windowbg2">'
New row.
</tr>';
*/

echo '
<tr class="windowbg2">
This will put something above the form.
</tr>';
echo '
<td class="windowbg2">
This will put something at the top of the form.
</td>';

// Documentation for the contents of each $field_data array, or entry into the $context['fields'] array.
/*
$field_name = The name of the field, straight from the value stored by the admin in the admin settings area;
$field_data = array(
'text' => This is the text which needs to be displayed next to the setting.,
'type' => The type of input which the field is ,
'value' => The value of the field, if this is not the first attempt at submitting the form,
'data' => The list of options - only for the selection box type,
'required' => A boolean value telling us wether or not its necessary to have a valid value for this field in order to submit the form,
'failed' => A boolean value which tells us wether or not this field caused the form to fail to submit,
);
*/

// Now actually loop through all the variables.
foreach ($context['fields'] as $field_name => $field_data)
{
// Output the start of the row, as well as a spacer column.
echo '
<tr class="windowbg2">
<td class="windowbg2"></td>';

// Show the display text for this field.
echo '
<td valign="top"><label for="', $field_name, '">', $field_data['text'], '</label></td>
<td class="windowbg2" width="50%">';

// Show a check box?
if ($field_data['type'] == 'checkbox')
echo '
<input type="hidden" name="', $field_name, '" value="0" /><input type="checkbox" name="', $field_name, '" id="', $field_name, '" class="check" ', ($field_data['value']) ? 'checked="checked"' : '', '" />';
// Show a selection box?
elseif ($field_data['type'] == 'selectbox')
{
echo '
<select name="', $field_name, '">';
foreach ($field_data['data'] as $option)
echo '
<option value="', $option, '"', ($option == $field_data['value'] ? ' selected="selected"' : ''), '>', $option, '</option>';
echo '
</select>';
}
// Large Text box?
elseif ($field_data['type'] == 'largetextbox')
{
echo '
<textarea rows="4" cols="30" name="', $field_name, '">', $field_data['value'], '</textarea>';
}
// Int, Float or text box?
else
echo '
<input type="text" name="', $field_name, '" value="', $field_data['value'], '"/>';

// Show the 'required' asterix if necessary.
if(!empty($field_data['required']))
echo '
<div ', !empty($field_data['failed']) ? 'style="color:#FF0000;"' : '' ,'> *</div>';

// End the input column and the entire row.
echo '
</td>
</tr>';
}

// Here you can add rows to the end of the form, if you want to...
/* Like this:
echo '
<tr class="windowbg2">'
New row.
</tr>'
*/

echo '
<tr class="windowbg2">
This was supposed to put something below the form.
</tr>';
echo '
<td class="windowbg2">
This will put something at the bottom of the form.
</td>';

// Show the "Required Fields" text down the bottom, show it in red if there was a failed submit.
echo '
<tr class="windowbg2">
<td colspan="3" style="text-align:center;', !empty($context['failed_form_submit']) ? 'color:#FF0000;' : '', '">
* ', $txt['CustomForm_required'], '
</td>
</tr>';

echo '
<tr>
<td class="windowbg2" colspan="3" align="center" valign="middle"><input type="submit" value="', $txt['CustomForm_submit'], '" /></td>
</tr>
</table>
</td></tr>
</table>
<input type="hidden" name="sc" value="', $context['session_id'], '" />
</form>';
}


This is what it looks like...
(http://www.wolfshaven.com/example_form.jpg) (http://www.wolfshaven.com/example_form.jpg)

Why the <tr> command prints is up above the entire form doesn't make sense to me when the <td> command will print within the form. I would think that both should be printing in the same place, depending on where you actually put them within the function.

Following the previous template examples I don't understand why the bottom <tr> line posts at the top instead of the bottom. Using the <td> line in the same place prints at the bottom of the fields so shouldn't a <tr> in that section print below the entire form?

The alignment thing I'm sure I can figure out but right now its bugging me. It looks like its using the colspan from the lines above. I'm also assuming that's why the white space is showing to the right of the text.

That said I would think as long as the colspan is not listed in the current as <td> it shouldn't take place. The one above should have closed it out with the </td>, right?

I haven't tried it yet as it just came to mind but should I just put those sections in a table command? Would that actually fix it or am I just grasping at straws?

Any help in understanding this would be greatly appreciated.

Just in case anyone wants what Ive got so far for their own site or has suggestions of other examples I should put in, this is my a dump of my sql file for the form...
--
-- Table structure for table `smf_cf_fields`
--

CREATE TABLE IF NOT EXISTS `smf_cf_fields` (
  `ID_FIELD` smallint(5) NOT NULL auto_increment,
  `ID_FORM` smallint(5) default NULL,
  `title` tinytext,
  `text` tinytext,
  `type` tinytext,
  `type_vars` text,
  PRIMARY KEY  (`ID_FIELD`),
  KEY `ID_FORM` (`ID_FORM`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ;

--
-- Dumping data for table `smf_cf_fields`
--

INSERT INTO `smf_cf_fields` (`ID_FIELD`, `ID_FORM`, `title`, `text`, `type`, `type_vars`) VALUES
(1, 1, 'text_box', 'There should be a small input allowing you to type anything here.', 'textbox', ''),
(2, 1, 'large_text_box', 'There should be a Large Box that you can type anything in here.', 'largetextbox', ''),
(3, 1, 'check_box', 'This will tell you whether the boxed was checked or not when it posts in the forum.', 'checkbox', 'Box was checked., Box was not checked.'),
(4, 1, 'selection_box', 'The Selection Box will allow members to chose from various items.', 'selectbox', 'Item 1, Item 2, Item 3'),
(7, 1, 'float_box', 'This box allows for <a href="http://en.wikipedia.org/wiki/Floating_point">Floating Point Values</a>. <br><br> Mostly it will be used for allowing users to input decimal numbers.', 'float', ''),
(6, 1, 'integer_box', 'The Integer Box will only accept whole numbers. <br><br> You can not type text, decimals, or fractions in this box.', 'int', '');

-- --------------------------------------------------------

--
-- Table structure for table `smf_cf_forms`
--

CREATE TABLE IF NOT EXISTS `smf_cf_forms` (
  `ID_FORM` smallint(5) NOT NULL auto_increment,
  `ID_BOARD` smallint(5) default NULL,
  `title` tinytext,
  `template_function` tinytext,
  `subject` tinytext,
  `output` text,
  PRIMARY KEY  (`ID_FORM`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

--
-- Dumping data for table `smf_cf_forms`
--

INSERT INTO `smf_cf_forms` (`ID_FORM`, `ID_BOARD`, `title`, `template_function`, `subject`, `output`) VALUES
(1, 123, 'Example', 'exampleform', 'Test templates.', '[center][u][b]*This post it the result of someone using the Example Form*[/b][/u][/center]<br /><br /><br />If this post was in the wrong board then the wrong [b]Board ID[/b] was entered in the &quot;Example&quot; Form.<br /><br />index.php?action=featuresettings;sa=customform;<br /><br />[b]Text Box[/b]<br />If something was entered in the Text Box field It will show below.<br /><br />{text_box}<br /><br />[b]Large Text Box[/b]<br />If something was entered in the Large Text Box field It will show below.<br /><br />{large_text_box}<br /><br />[b]Check Box[/b]<br />Was the box checked?<br /><br />{check_box}<br /><br />[b]Selection Box[/b]<br />What item was picked in the Selection Box?<br /><br />{selection_box}<br /><br />');
Title: Re: Custom Form Mod
Post by: the.basement on November 18, 2008, 03:43:28 PM
Quotethe.basement, um its good if you find a fix for something then post what you changed say like

Find some code and
replace with some other code.

Repackaging someones mod like that really isn't a good practice to get into.

ok sorry go and find what i changed......
Title: Re: Custom Form Mod
Post by: pooya on November 18, 2008, 04:39:25 PM
Okay this just makes me a new topic in the board without anything in it .. wtf ?
Title: Re: Custom Form Mod
Post by: Garou on November 19, 2008, 12:07:52 AM
pooya, try this link http://www.simplemachines.org/community/index.php?topic=248871.msg1633514#msg1633514

Its a good example of how to fill out everything.

the.basement, um its good if you find a fix for something then post what you changed say like

Find some code and
replace with some other code.

Repackaging someones mod like that really isn't a good practice to get into.
Title: Re: Custom Form Mod
Post by: Garou on November 19, 2008, 01:53:34 AM
OK I fixed my template problem. I'm still concerned about some of the issues I mentioned before but none the less I have a working template.

(http://www.wolfshaven.com/example_form.jpg) (http://www.wolfshaven.com/images/example_form.jpg)

Paste this code before the ?> in the CustomForm.template.php
  /* This is an example showing how to alter the template for the submit form page.
     To use this template in a form in the Custom Form Mod Settings we would just enter
exampleform not form_template_exampleform in the Custom Template Function field */

function form_template_exampleform()
{
global $context, $txt, $settings, $scripturl;

// Starting text for the form and tables. Don't muck with this, unless you need to change the style!!!  ;)
echo '
<form action="', $context['post_url'], '" method="post" accept-charset="', $context['character_set'], '">
<table width="80%" border="0" cellspacing="0" cellpadding="0" class="tborder" align="center">
<tr><td>
<table border="0" cellspacing="0" cellpadding="4" width="100%">
<tr class="titlebg">
<td colspan="3">', $context['settings_title'], '</td>
</tr>
<tr class="windowbg2">
<td colspan="3"><br /></td>
</tr>';

// Here you can add information at the top of yor form, if you want to...
echo '
        <tr
<td colspan="3"  class="windowbg2" style="text-align:center">
<div>
<h1>Custom Form Mod Example</h1>
<br>
<p>Using templating will allow you to customize the look of your form. It will even allow you to add images like...</p>
<img border="1" src="http://www.google.com/intl/en_ALL/images/logo.gif">
<p style="text-align:left">In fact you can use most any HTML in your SMF forums /Themes/default/CustomForm.template.php as long as all the actual functions for the form remain intact. There should be basic instructions throughout explaining where and how you can modify the template.</p>
<p style="text-align:left">To use a template like this you first have modify the <b>CustomForm.template.php</b>. Then you have to set up your actuall form in your fourms under Admin / Features and Options / Custom Forms.<br><br>Click on <b>Add New Form</b>. If you named your function form_template_exampleform then you would enter exampleform in the <b>Custom Template Function</b> field.<br><br>After that you may customize your form questions as you wish.
<br><hr />
<div><i>Below is an example of some of the functions you can preform with the Custom Form Mod for SMF</i></div>
<br><hr />
</td></tr>';
// End of information in the top section.

// Documentation for the contents of each $field_data array, or entry into the $context['fields'] array.
/*
$field_name = The name of the field, straight from the value stored by the admin in the admin settings area;
$field_data = array(
'text' => This is the text which needs to be displayed next to the setting.,
'type' => The type of input which the field is ,
'value' => The value of the field, if this is not the first attempt at submitting the form,
'data' => The list of options - only for the selection box type,
'required' => A boolean value telling us wether or not its necessary to have a valid value for this field in order to submit the form,
'failed' => A boolean value which tells us wether or not this field caused the form to fail to submit,
);
*/

// Now actually loop through all the variables.
foreach ($context['fields'] as $field_name => $field_data)
{
// Output the start of the row, as well as a spacer column.
echo '
<tr class="windowbg2">
<td class="windowbg2"></td>';

// Show the display text for this field.
echo '
<td valign="top"><label for="', $field_name, '">', $field_data['text'], '</label></td>
<td class="windowbg2" width="50%">';

// Show a check box?
if ($field_data['type'] == 'checkbox')
echo '
<input type="hidden" name="', $field_name, '" value="0" /><input type="checkbox" name="', $field_name, '" id="', $field_name, '" class="check" ', ($field_data['value']) ? 'checked="checked"' : '', '" />';
// Show a selection box?
elseif ($field_data['type'] == 'selectbox')
{
echo '
<select name="', $field_name, '">';
foreach ($field_data['data'] as $option)
echo '
<option value="', $option, '"', ($option == $field_data['value'] ? ' selected="selected"' : ''), '>', $option, '</option>';
echo '
</select>';
}
// Large Text box?
elseif ($field_data['type'] == 'largetextbox')
{
echo '
<textarea rows="4" cols="30" name="', $field_name, '">', $field_data['value'], '</textarea>';
}
// Int, Float or text box?
else
echo '
<input type="text" name="', $field_name, '" value="', $field_data['value'], '"/>';

// Show the 'required' asterix if necessary.
if(!empty($field_data['required']))
echo '
<div ', !empty($field_data['failed']) ? 'style="color:#FF0000;"' : '' ,'> *</div>';

// End the input column and the entire row.
echo '
</td>
</tr>';
}

// Show the "Required Fields" text down the bottom, show it in red if there was a failed submit.
echo '
<tr class="windowbg2">
<td colspan="3" style="text-align:center;', !empty($context['failed_form_submit']) ? 'color:#FF0000;' : '', '">
* ', $txt['CustomForm_required'], '
</td>
</tr>';

//  Here you can add information just before the submit button.
echo '
<tr class="windowbg2">
<td colspan="3"  style="text-align:center">
<hr />
<div>
<p style="text-align:left">Once the user hits the <b>Submit Form</b> button the form will print all the information entered in the fields above in a preformated post to the designated board. Depending on the users access to the board they will be re-directed to it and they may modify the post.</p>
<hr />
</div>
</td></tr>';

  //  Show the Form Submit button
echo '
<tr>
<td class="windowbg2" colspan="3" align="center" valign="middle"><input type="submit" value="', $txt['CustomForm_submit'], '" /><hr /></td>
</tr>';

  //   Here you can add information below the submit button.
echo '
<tr class="windowbg2">
<td colspan="3"  style="text-align:center">
<div>Visit the <a href="http://custom.simplemachines.org/mods/index.php?mod=1279">Custom Form Mod</a> page for more information about how to use this Mod for <a href="http://www.simplemachines.org/">SMF</a>.</div>
</td></tr>

</table>
</td></tr>
</table>
<input type="hidden" name="sc" value="', $context['session_id'], '" />
</form>';
}


In your Custom Form Mod Settings enter "exampleform" (minus the ") in the Custom Template Function field.

Just in case anyone wants what Ive got  for their own site, this is my a dump of my sql file for the form...

--
-- Table structure for table `smf_cf_fields`
--

DROP TABLE IF EXISTS `smf_cf_fields`;
CREATE TABLE IF NOT EXISTS `smf_cf_fields` (
  `ID_FIELD` smallint(5) NOT NULL auto_increment,
  `ID_FORM` smallint(5) default NULL,
  `title` tinytext,
  `text` tinytext,
  `type` tinytext,
  `type_vars` text,
  PRIMARY KEY  (`ID_FIELD`),
  KEY `ID_FORM` (`ID_FORM`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=10 ;

--
-- Dumping data for table `smf_cf_fields`
--

INSERT INTO `smf_cf_fields` (`ID_FIELD`, `ID_FORM`, `title`, `text`, `type`, `type_vars`) VALUES
(1, 1, 'text_box', '<b>Text box (String)</b> adds a small input allowing the user to type anything.', 'textbox', ''),
(2, 1, 'large_text_box', '<b>Large (Multiline) Text Box</b> adds a large input allowing the user to type anything.', 'largetextbox', ''),
(3, 1, 'check_box', '<b>Check box</b> will post whether the boxed was checked or not once the form is submitted to the forum. By default it will post yes if checked and no if not checked. You can chose what is actually posted by using the <b>Extra Type Parameters</b> field.<b', 'checkbox', 'The box was checked., The box was not checked.'),
(4, 1, 'selection_box', '<b>Selection Box</b> will allow the user to chose from various items. Enter the list of items you want seperated by commas in the <b>Extra Type Parameters</b> field.', 'selectbox', '-- Select One -- , Item 1, Item 2, Item 3'),
(7, 1, 'float_box', '<b>Text Box (Float)</b> allows a user to enter <a href="http://en.wikipedia.org/wiki/Floating_point">Floating Point Values</a>. <br><br> Mostly it will be used for allowing users to input decimal numbers.', 'float', ''),
(6, 1, 'integer_box', '<b>Text Box (Integer)</b> Will only allow the user to type whole numbers.<br><br>The user can not type text, decimals, or fractions in this box or the form will fail when submitted.', 'int', ''),
(8, 1, 'require', 'By entering "require" in the <b>Extra Type Parameters</b> field, you can require that the user makes an entry in that field. If the user does not make an entry in the field, the form will not post to the forum and asks that the user complete the form.', 'textbox', 'required');

-- --------------------------------------------------------

--
-- Table structure for table `smf_cf_forms`
--

DROP TABLE IF EXISTS `smf_cf_forms`;
CREATE TABLE IF NOT EXISTS `smf_cf_forms` (
  `ID_FORM` smallint(5) NOT NULL auto_increment,
  `ID_BOARD` smallint(5) default NULL,
  `title` tinytext,
  `template_function` tinytext,
  `subject` tinytext,
  `output` text,
  PRIMARY KEY  (`ID_FORM`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

--
-- Dumping data for table `smf_cf_forms`
--

INSERT INTO `smf_cf_forms` (`ID_FORM`, `ID_BOARD`, `title`, `template_function`, `subject`, `output`) VALUES
(1, 123, 'Example', 'exampleform', 'Test templates.', '[center][u][b]*This post it the result of someone using the Example Form*[/b][/u][/center]<br /><br /><br />If this post was in the wrong board then the wrong [b]Board ID[/b] was entered in the &quot;Example&quot; Form.<br /><br />index.php?action=featuresettings;sa=customform;<br /><br />[b]Text Box[/b]<br />If something was entered in the Text Box field It will show below.<br /><br />{text_box}<br /><br />[b]Large Text Box[/b]<br />If something was entered in the Large Text Box field It will show below.<br /><br />{large_text_box}<br /><br />[b]Check Box[/b]<br />Was the box checked?<br /><br />{check_box}<br /><br />[b]Selection Box[/b]<br />What item was picked in the Selection Box?<br /><br />{selection_box}<br /><br />[Required Text Box]<br />Note there are some problems with this that need to be worked out.<br /><br />{require}<br /><br />');


If anyone has any other ideas for field examples that should be included in this let me know.
Title: Re: Custom Form Mod
Post by: pooya on November 19, 2008, 08:41:40 AM
Okay my custom form output isnt being saved, i click save brings me back to the same page with Form Output being blank.

Also how ot make this show in a single topic rather then making different topics ?
Title: Re: Custom Form Mod
Post by: Garou on November 19, 2008, 09:51:26 AM
It should be saved. The only time it didn't save for me is if I clicked add new button before I clicked saved under the input box.

The singe topic feature should be in the next update when he gets around to it. For now we just have to use a board.
Title: Re: Custom Form Mod
Post by: pooya on November 19, 2008, 04:16:45 PM
Oooooooooo this will populate my board like crazy, better wait then... :(
Title: Re: Custom Form Mod
Post by: happyfeet on November 20, 2008, 01:02:46 PM
LHVWB -

First off, thank you for your hard work in developing this mod!

I understand the time constraints involved with updating this, or any mod. As outlined in previous posts, the 'required' option will function for Text Box (Integer) and will not work for Text Box (String). To be honest, the 'required' option is the only bug I would appreciate being addressed.

Is there any way you could tell me what I would need to change in my PHP files so that this one bug is resolved? I am using SMF 1.1.7

Thanks for your efforts  ;)
Title: Re: Custom Form Mod
Post by: Garou on November 22, 2008, 11:56:50 AM
Quote from: the.basement on November 18, 2008, 03:43:28 PM
ok sorry go and find what i changed......

the.basement,
I looked at theCustomFormModcustom_v1.1_SMF1.1.5.zip you posted. It looks like in your version of the mod you only changed two files CustomForm.php and CustomForm.template.php.

Using WinMerg I only found one difference in the CustomForm.php nothing at all changed CustomForm.template.php.

In the CustomForm.php

Find...
// Do we have an invalid value? Is this field required?
if(($required
&& (($value == '') || ($value == 0))
&& ($field['type'] != 'checkbox'))

Replace...
// Do we have an invalid value? Is this field required?
if(($required
&& (($value == '') || ($value == '0'))
&& ($field['type'] != 'checkbox'))


This does fix the required fields problem. Good work on finding the fix.  :)
Title: Re: Custom Form Mod
Post by: Nvb on November 23, 2008, 08:40:02 AM
Don't know if this is possible, but is there a way to create a form where you can choose from a selection box the correct board id/board description?

Or in other words, i want to create 1 form to use in all my different boards.
But now i have to make always the same form , with a different board id.
If you know i have about 100 boards and sub-boards...  :-\

TY for looking into this


Title: Re: Custom Form Mod
Post by: Garou on November 23, 2008, 09:55:45 AM
Out of the box? No. The board ID is set in the admin section atm.

Its most likely possible to create something like that but I'm not sure where to begin. I'm guessing it would take a complete rework of the mod.
Title: Re: Custom Form Mod
Post by: Nvb on November 23, 2008, 10:01:51 AM
Hmm, where are the Board-ID settings stored?
Maybe i can manually copy/paste the php with notepad, and then change all the id's manually.
I guess i would work quicker than create 100 times the same form for the different boards.
8)

I did find this code in the CustomForm.Template.php

// If we can then show the list of forms.

if(!empty($context['custom_forms_list']))

{

// Show the list of forms.

foreach($context['custom_forms_list'] as $form)

{

echo '

<tr class="windowbg">

<td style="padding:4px;" >

<a href="' , $scripturl , '?action=form;id=' , $form['id'] ,'">' , $form['title'] , '</a>

</td>

<td style="padding:4px;" >

<a href="' , $scripturl , '?board=' , $form['id_board'] ,'">' , $form['board'] , '</a>

</td>

<td style="padding:4px;text-align:center;" >

<a href="' , $scripturl , '?action=form;id=' , $form['id'] ,'">' , $txt[305] , '</a>

</td>

</tr>';

}

}


Where is that 'foreach($context['custom_forms_list'] as $form)' referring to?
Title: Re: Custom Form Mod
Post by: Garou on November 23, 2008, 03:15:27 PM
I think that's how you get the /index.php?action=form
Title: Re: Custom Form Mod
Post by: Nvb on November 23, 2008, 05:26:57 PM
owkey, but where is that data stored then???
Title: Re: Custom Form Mod
Post by: Garou on November 23, 2008, 08:31:21 PM
All information from this mod is stored in the sql database under...
smf_cf_fields
smf_cf_forms
Title: Re: Custom Form Mod
Post by: Nathaniel on November 24, 2008, 03:52:28 AM
Firstly, sorry to everyone that I haven't responded to this topic recently, I have been meaning to, but the list of posts just keeps getting longer and longer. I also mean to look at updating/fixing this mod within the not to distant future, but thats a completely different story. ;)

Anyway, this is going to be a HUGE post. Please bump if I miss your posts.

@Paracelsus,
Good to hear that it works well. I still believe that there are issues. I will try and resolve them with the next version of the mod.

@Propaganistas,
I am not familiar with that mod, could you please post your 'ModSettings.php' and 'Subs-Post.php' file, so that I can have a look over them?

@Garou,
I am glad that you like the mod. The idea of having a WYSIWYG editor for the PHP/HTML is probably not likely to happen (as it would require too much work), although I may add a way to edit the template for each function via the admin area - that may make it easier for admin with lower PHP/HMTL skills.

@Dem0n,
As meantioned by Garou, choice of redirection location after forum submittion is one of the features that I am looking at implementing.

@Garou,
Do you still need any help with those templates?

@the.basement,
After reading through your post, I can't say that I have any idea what you issue actually is. Do you still require assistance?

@pooya,
As Garou said, I am looking at implementing that in the next version.

@happyfeet,
At the moment I haven't even really found the time to find and work out a solution for most of these issues.

@NeQo,
Interesting suggestion, I will think about adding it to a future version. As Garou suggested, making the mod post to different boards based off user input will require quite a few changes within the code of the mod. While the 'board' for each form is stored in the 'smf_cf_forms' database table, the actual use of the information is in the 'CustomForm.php' file. You may be able to archive what you want with some code changes in that file, although I wouldn't recommend it. ;)

Title: Re: Custom Form Mod
Post by: Garou on November 24, 2008, 09:28:39 AM
LHVWB!!! Welcome back to the thread.

I figured out the templates and made a post that hopefully makes it easier for any one else that wants to learn. I figured the WYSIWYG would be to complicated to actually do but I also think you misunderstood. I was thinking more along the lines of dumping the php file all together and having something where Admins could write something up using the BBC that they are familiar with that would save to the database rather then changing the template php.

Either way I know its too complicated and huge of a task to make work. If I had any clue where to begin I do it and give it to you to add. I am learning quite a bit about this mod and others here of late though. A lot of mod authors are busy with other things lately and I'm happy to help where I can. :)

the.basement didn't have any problems, in fact he came up with a fix for the required fields bug. Unfortunately he just repackaged the whole mod when it was one line of code that was actually changed. I compared his package to yours and listed the fix a few posts back.
Title: Re: Custom Form Mod
Post by: Nathaniel on November 24, 2008, 07:00:50 PM
@Garou,
Hmm, interesting suggestion about the BBC editor for the template. I'll have a think about it. I am definetly looking at making this mod easier to use (while adding more features), with the next version, so an option to do that could work well - I also don't think it would be that difficult. ;)
Title: Re: Custom Form Mod
Post by: Garou on November 24, 2008, 09:46:20 PM
Well once I figured out the template thing and the.basement found the required fields bug this mod will do almost everything I need it to do.

The one thing left Id like to see in it is being able to set a message Icon. Mainly because I got an idea for a site that will have multiple forms post in one board. Of course I can set the titles for each type of form but being able to have an icon that stands out a little more would be nice.

I don't know that Id actually use it but Ive come up with a couple of ideas for the suggestion someone else made about it putting all posts from a form in one thread/topic.

The BBC for the template just might make it easier for admins that don't know any php or xml. I personally may have been frustrated at first but I actually enjoyed figuring out how to do the template. I needed and still need more coding experience anyway.  :)
Title: Re: Custom Form Mod
Post by: Nvb on November 26, 2008, 02:18:58 PM
Question:

I have been looking at the smf_cf_forms.sql file and i have noticed the following

This is the file, and i see following forms:
INSERT INTO `smf_cf_forms` VALUES (1, 348, 'P5 test',...
INSERT INTO `smf_cf_forms` VALUES (6, 328, 'test2',...
INSERT INTO `smf_cf_forms` VALUES (5, 5, 'test',...

Am i right that those values are the following:

1e value: form creation number
2e value: form board number
3e value: form name

I think it's a risky thought, but could i copy the form layout and fields (they are mentioned in the file) from 1 form and copy them into another form.
Then i only need to change the 'creation' and 'board' number from another form to have an exact same one, but for another board.
Would it be risky to upload the altered smf_cf_forms.sql file to mySQL database?

Or am i completely "coeckoe"  :P ?

Lemme know what you think
Title: Re: Custom Form Mod
Post by: Garou on November 26, 2008, 04:12:28 PM
Yes it can be done and yes it gets a little risky.

First, make sure you have a backup of your files for both smf_cf_fields and smf_cf_forms. I tried something similar and wound up erasing the data I already had. Luckily I had the forethought to back up.

smf_cf_fields contains all the actual field information that is used. smf_cf_forms contains the data that is in the post to the forums.

smf_cf_forms.sql
1e Form ID     Form Number /index.php?action=form;id=
2e Board ID    Forum Board Number /index.php?board=
3e Title     Form Name
4e template_function    Custom Template Function
5e subject     Subject     Subject of the post in the forum board
6e output     Form Output: The content of the post in the forum board

smf_cf_fields.sql
1e Field ID     Form Fields      in sequential order
2e Form ID     Form Number /index.php?action=form;id=
3e title     Title     This is how the field is listed in the fourm output ex. {name}
4e text     Text     This is the question or comment in the Form
5e type     Type    Text Box, Check Box, Selection Box, etc.
6e type_vars     Extra Type Parameters such as required in a Text Box

Pay close attention to ID_FIELD and ID_FORM. Attaching the wrong field to the wrong form could really get you confused especially if you have a lot of both.

Hope this helps you.
Title: Re: Custom Form Mod
Post by: Nvb on November 26, 2008, 05:17:44 PM
Oh wow, useful info.

Since the fields stay the same for each form, i think i only need to change the froms.sql
I'll try to alter the forms.sql, but leave the fields.sql like it is.
The only thing i need to change is the board id and description.

I'll keep you posted if it works...
Title: Re: Custom Form Mod
Post by: Garou on November 27, 2008, 07:29:59 AM
I don't think it will because the the way the fields.sql stores the info remember I said it was sequential.

Field      Form
1           1
2           1
3           1
4           2
5           2
6           2

Field 1 and field 4 could both be the same question  but if you try to change it to field 1 form 2, form 1 no longer accesses field 1.
Title: Re: Custom Form Mod
Post by: wgfinley on November 27, 2008, 10:38:09 AM
I'm using the DarkBreak theme from Dziner Studios and recently installed Beta 4.  Things were fine with Beat 3 with the mod and my theme but after I upgraded I'm getting an error when I try to reinstall the mod.  The error is as follow:

3.  Execute Modification  ./Sources/Admin.php  Test failed
1. Add After ./Sources/Admin.php Test successful
2. Add After ./Sources/Admin.php Test failed


When I click on the detail I get this:


Find [Select]

// Load the language and templates....
loadLanguage('Admin');
loadTemplate('Admin');

Add After [Select]

loadLanguage('Modifications');



I have not reinstalled the mod because I don't want to screw anything up and the forms aren't used that much for me to risk it.  Any thoughts on what the issue is?

Thanks.

--Guy
Title: Re: Custom Form Mod
Post by: Garou on November 27, 2008, 12:23:33 PM
I haven't tried any of the 2.0 betas yet. I'm a big supporter of Tiny Portal and they haven't  converted their mod to 2.0 yet.

That said, I didn't think it was supposed to happen with 2.0 but it looks like conflicting mods. You'll most likely have to edit the admin.php by hand.

My best guess is open ./Sources/Admin.php and search for loadTemplate('Admin'); then on the next line enter loadLanguage('Modifications');

Conflicting mods seem to be the bane of SMF modification and Manual Installation of Mods (http://docs.simplemachines.org/index.php?topic=402) is your best friend. Custom Form Mod - Installation Instructions for 2.0 Beta 4 (http://custom.simplemachines.org/mods/index.php?action=parse;mod=1279;attach=62428;smf_version=2.0_Beta_4) should be a big help too.  :)
Title: Re: Custom Form Mod
Post by: the.basement on November 27, 2008, 07:27:34 PM
Quote from: LHVWB on November 24, 2008, 03:52:28 AM

@the.basement,
After reading through your post, I can't say that I have any idea what you issue actually is. Do you still require assistance?


Yep i do.
maybe i did not find it in this post, but
if i place a checkbox my formtemplate the makeup is messed up.
is there a little input or change i can make to leave the template intact.
second, if i want to make a new layout {customForm.template.php} on a new form,
how to handel. {multi form layouts}?

ps for the first thing i found the required "bug" but can't find this one why the checkbox change the layout.
the rest is working fine for me.
Title: Re: Custom Form Mod
Post by: Garou on November 27, 2008, 09:39:15 PM
the.basement,
I noticed in the package you had uploaded here that it was based off a older version of the mod. That could be part of your problem. Uninstall the package you have and download the new one here. Then you will have to add the fix for the required bug (http://www.simplemachines.org/community/index.php?topic=248871.msg1810128#msg1810128).

That should fix the check box issue your having.

You can have multiple form layouts in the customForm.template.php.

Copy code from the default one named function form_template_submit_form() and rename it to whatever you want to call yours by, for example form_template_formname1() or form_template_formname2() etc. then place each before the ?> in the customForm.template.php.

Then in the admin panel in the Custom Form Mod Settings in the field named Custom Template Function enter formname1 or formname2 it will use that template instead of the default. You can have as many templates for your forms as you wish.
Title: Re: Custom Form Mod
Post by: the.basement on November 28, 2008, 08:59:07 AM
Quote from: Garou on November 27, 2008, 09:39:15 PM
the.basement,
I noticed in the package you had uploaded here that it was based off a older version of the mod. That could be part of your problem. Uninstall the package you have and download the new one here.

(http://k53.pbase.com/v3/42/267742/1/45921624.thanks.gif)

The template is simple to do.
This is what i did !
Copy/past the normal template to a other theme and give in the admin-panel the link to it.
That is what i did, maybe i had to because the older version.

greetings from
the (http://gratum.com/users/icons/mini/mini-basement.gif)

edit....................
watch out on my version uninstaller bug, have to manual rollback this function!
sorry! (old version it is)

BUT....
i have the hole thing updated cleaned out but still the checkbox is not correct it is on one line not under each other?
Also the required box is in line, see attach?
help????
i installed this one and updated the required box:
http://www.simplemachines.org/community/index.php?topic=248871.300   from LHVWB

Title: Re: Custom Form Mod
Post by: Garou on November 28, 2008, 11:03:44 PM
Take a look at the example template I posted earlier (http://www.simplemachines.org/community/index.php?topic=248871.msg1805119#msg1805119).

Notice the line...
                <td colspan="3"  class="windowbg2" style="text-align:center">
The forms use a three column table and you have to compensate for that.
The line above should help to bring everything back in line. I had that issue as well and it took me a while to figure it out but that should fix it.

If it doesn't fix it, post your template and we will see if we cant figure it out. It could also be the theme you're using but we should be able to work around that.
Title: Re: Custom Form Mod
Post by: fords8 on November 29, 2008, 01:35:18 AM
Quote from: wgfinley on November 27, 2008, 10:38:09 AM
I'm using the DarkBreak theme from Dziner Studios and recently installed Beta 4.  Things were fine with Beat 3 with the mod and my theme but after I upgraded I'm getting an error when I try to reinstall the mod.  The error is as follow:

3.  Execute Modification  ./Sources/Admin.php  Test failed
1. Add After ./Sources/Admin.php Test successful
2. Add After ./Sources/Admin.php Test failed


When I click on the detail I get this:


Find [Select]

// Load the language and templates....
loadLanguage('Admin');
loadTemplate('Admin');

Add After [Select]

loadLanguage('Modifications');



I have not reinstalled the mod because I don't want to screw anything up and the forms aren't used that much for me to risk it.  Any thoughts on what the issue is?

Thanks.

--Guy

I was just trying to install this in SMF2 Beta 4 and got the same error. So I looked the error up in the admin.php file from the file from the zip (smf_2-0-beta4p_install.zip) . The file from the zip is as followed:

// Load the language and templates....
loadLanguage('Admin');
loadTemplate('Admin', 'admin');


The mod is looking for this when it trys to install:

// Load the language and templates....
loadLanguage('Admin');
loadTemplate('Admin');


The mod install looks to be wrong.

EDIT: I changed the modifications_smfv2.xml file and zipped it back up and the install went find.

EDIT AGAIN: I just noticed that this mod is only for 1.1.5 and 2.0 Beta 3.1 Public. And not for SMF2 Beta 4.
Title: Re: Custom Form Mod
Post by: Propaganistas on November 29, 2008, 07:08:03 AM
Quote from: LHVWB on November 24, 2008, 03:52:28 AM
@Propaganistas,
I am not familiar with that mod, could you please post your 'ModSettings.php' and 'Subs-Post.php' file, so that I can have a look over them?

Thanks for your reply!

Files are in attachment :)

Greetz
Propa


Title: Re: Custom Form Mod
Post by: the.basement on November 29, 2008, 09:31:16 AM
Quote from: Garou on November 28, 2008, 11:03:44 PM
Take a look at
If it doesn't fix it, post your template and we will see if we cant figure it out. It could also be the theme you're using but we should be able to work around that.
(http://www.simplemachines.org/community/index.php?topic=248871.msg1805119#msg1805119)

That's what i found out also.  (i the beginning of the code it's in the colspan)
it's a fresh install no changes are made for this moment.
(for testing the form i did take the standard theme, also place this line in you never know maybe the tip works.)
Also in the standard theme gives it the same problem, sadly same thing.
attach is placed maybe you see something i did not see!
and if it's a very hard bug i demolish the checkbox out of this form.
Then i only use the selectionbox, gives alsmost the same output.
(bbc-code i can use no more, bbc not used in test form only yes,no in it)

Title: Re: Custom Form Mod
Post by: the.basement on November 29, 2008, 09:47:35 AM
Quote from: Propaganistas on November 29, 2008, 07:08:03 AM

Files are in attachment :)

Greetz
Propa

The mod was not installed on this.
did it by hand for you only i need the index.php also it loction is the upper folder.
make a copy of the original also, than place this one in.( other name and place ect., you know)
index has to be changed also!
maybe if this is installed correct the other error is no more in your error log.
8)
Title: Re: Custom Form Mod
Post by: Garou on November 29, 2008, 07:48:35 PM
the.basement The template you sent was the one that comes with the install. I pot it on my server and created a form with two check boxes on the "SMF Default Theme - Core", it displays just fine.  Attached is the way it displays on my server.

There must be something else on your server that is causing the problem. When I had that problem on my server it was because I didn't account for the columns when I made my custom template. Once I did account for columns the problem was fixed.

If you haven't tried to customize your template, you shouldn't be having problems on the default theme. I have no idea what could be causing this problem for you.
Title: Re: Custom Form Mod
Post by: the.basement on November 29, 2008, 09:22:32 PM
Quote from: Garou on November 29, 2008, 07:48:35 PM
If you haven't tried to customize your template, you shouldn't be having problems on the default theme. I have no idea what could be causing this problem for you.

well i have no idea also?
Maybe i put a wrong input of this box, what did you fill in this box.
i did .........     yes,no          ................           1,2          ...........
correct!
Title: Re: Custom Form Mod
Post by: Malodorous on November 29, 2008, 11:09:38 PM
This is a really great mod from what im reading, i just installed SMF for my WoW guild. I really need something like this so i can set up a application system of some sorts.

Does anyone know any other mod that will do this?

If not i guess i will be checking this every say :)
Title: Re: Custom Form Mod
Post by: Nvb on November 30, 2008, 07:47:05 PM
That checkbox error only exists in IE.
Just replce the cjeckbox with a selection box (Yes, No) and it will be fine.
Title: Re: Custom Form Mod
Post by: Garou on November 30, 2008, 10:23:54 PM
the.basement, actually you can leave it blank and it will post yes if checked and no if not but either way it should not be causing a problem for you.

It would have made sense to me if it was not displaying correctly on a custom theme but the fact that you are having issues on the default theme with a clean install really has me baffled.

Malodorous, the only other mod I found that comes close to this is Thurnok's Custom Post Prefills (http://www.tinyportal.net/index.php?topic=9419.0). Unfortunately he has no plans to make an actual mod,you have to enter it all in by hand.

It isn't anywhere near as nice as this mod either but it is what I use to use for guild applications and support boards before I found the custom form mod.

NeQo, nice catch. I didn't even think to check the bug on IE as FF is my default browser.
Title: Re: Custom Form Mod
Post by: the.basement on December 01, 2008, 07:19:04 AM
stupid!

normal i check on the two browsers.
and yes explorer is interp it wrong.
in FF it's no problem at all
now i have a Clo what i have to search for, but it won't be easy.
i have to check what the difference in interpretation between both is!
Title: Re: Custom Form Mod
Post by: MrMusic on December 02, 2008, 07:25:01 PM
Hello, first this is a great Mod. It is going to work perfectly with my need on my site.

I am using the Movies07 design by Bloc.
My version of SM is 1.1.7

Problem: I can not get it to work.

Is this designed to work with my version and Mod? If not, can you give me advice on how to make it work?

Thanks...

Ashley
[email protected]
www.mrlivemusic.com
Title: Re: Custom Form Mod
Post by: Garou on December 03, 2008, 10:54:51 AM
First define not working. Are you getting errors in your logs, can you get to part of the features and it fails or what? Specifics would go a long way towards us helping you.

If the Mod does work under the default theme most likely you'll have to make some manual changes to the custom theme your wanting to work with. There are manual install instructions on the download page also there is a link to even more information about manual installs in my signature.
Title: Re: Custom Form Mod
Post by: the.basement on December 04, 2008, 02:25:00 AM
(http://www.extreme4ever.sk/forum/smile/stupid.gif)

I was working on a new code to make the checkbox also working in IE.
On the way to rewrite a hole new set of code-lines i had a error in the script.
Checking the original to find where a code was pointing to, serveral days later and staring to
the original code.

I saw that the code did't close itself.
Closed the code and don't worry be happy, several days on making a new code going to the trashcan.
The code is working how the author wanted it to be.

find in CustomForm.template.php
// Show a check box?
if ($field_data['type'] == 'checkbox')
echo '
<input type="hidden" name="', $field_name, '" value="0" /><input type="checkbox" name="', $field_name, '" id="', $field_name, '" class="check" ', ($field_data['value']) ? 'checked="checked"' : '', '" />';


replace
// Show a check box?
if ($field_data['type'] == 'checkbox')
echo '
<input type="hidden" name="', $field_name, '" value="0" /><input type="checkbox" name="', $field_name, '" id="', $field_name, '" class="check" ', ($field_data['value']) ? 'checked="checked"' : '', ' />';


that's all there is!

and a small repeat for the required field setting to work,
here is the code i found earlier

find  in CustomForm.php
// Do we have an invalid value? Is this field required?
if(($required
&& (($value == '') || ($value == 0))
&& ($field['type'] != 'checkbox'))


replace
// Do we have an invalid value? Is this field required?
if(($required
&& (($value == '') || ($value == '0'))
&& ($field['type'] != 'checkbox'))


And this version i have used to install it on 1.1.17
http://www.simplemachines.org/community/index.php?topic=248871.300

for the original author,
can you make a repack/update for this mod.
I think al is fine now!
8)
Title: Re: Custom Form Mod
Post by: sgilleland on December 05, 2008, 08:59:15 AM
When i try to install this via the package manager, it says it is not compatible with 1.1.7.  Is this true?  If so, will it ever be?  Thanks!
Title: Re: Custom Form Mod
Post by: the.basement on December 05, 2008, 01:50:19 PM
sgilleland look up.
edit a line in extra for you.
8)
Title: Re: Custom Form Mod
Post by: sgilleland on December 05, 2008, 02:03:24 PM
I am getting this error...should I continue?  How do I fix it?

3.     Execute Modification     ./Sources/ModSettings.php     Test failed
Title: Re: Custom Form Mod
Post by: Propaganistas on December 05, 2008, 05:28:46 PM
Quote from: sgilleland on December 05, 2008, 02:03:24 PM
I am getting this error...should I continue?  How do I fix it?

3.     Execute Modification     ./Sources/ModSettings.php     Test failed
You shouldn't continue then.
Instead, follow the manual instructions you can find through the submit button under the downloadable file.
Title: Re: Custom Form Mod
Post by: MrMusic on December 09, 2008, 03:22:26 AM
Ok, I got the Mod installed and I setup some fields for my form.
However, Now, I have no idea what to do to get the form on the board I want.
Can anyone help this poor newbie?

I have 1.1.7
I am using Movies07 theme design by Bloc

I have a locked, sticky post explaining how the form is to be used for my visitors. Now, I just need to get the form working on that board. I have the ID setup but not sure what else to do. I followed instructions from a post on this forum.

Oh, when explaining...explain as if to a child...lol

Thanks in advance for any help.

Ashley
www.mrlivemusic.com

EDIT:
QuoteAnother issue: When I choose to make the field required. It has the * on the form, and when you input anything, it clear the fields out and makes the * red and says fields required when I have data put into the fields.

I am having this same issue as well. My version and theme is listed above.
And, I still have no idea if this is posting anywhere or is not because of the issue just mentioned. Thanks for any help!
Title: Re: Custom Form Mod
Post by: jayman2 on December 10, 2008, 08:00:33 PM
I just installed this great mod on my smf 2.0 test site.  I can create a form just fine, but when I go to the input form and enter text into the field and go to the forum to check it, I just see the variable. 

For exampe, if I use this, Name :: {name} and then go to the form and enter some text, when I go to the page, that's all I get.  It's not capturing and displaying the input.  I there a list of variables that I'm supposed to be using, or am I just creating the input field wrong?
Title: Re: Custom Form Mod
Post by: MrMusic on December 11, 2008, 07:22:00 PM
Ok, I got the link and form working. However, when you get to the form and fill it out and hit submit, it still gives the error that the areas "required" turn red and indicate it needs to be filled out.
It was already filled out, but now they show the red asterisk and is now blank after hitting submit. Please help as I need this working soon!

Thank you for your help.
version 1.1.7
theme movie07
forum can be found at www.mrlivemusic.com/Forum, at the "Looking for Big Band Charts" board.


Title: Re: Custom Form Mod
Post by: Garou on December 12, 2008, 09:14:53 PM
There's a small bug that is causing the the required fields error the link below explains how to fix it.

http://www.simplemachines.org/community/index.php?topic=248871.msg1810128#msg1810128
Title: Re: Custom Form Mod
Post by: MrMusic on December 12, 2008, 10:54:25 PM
QuoteThere's a small bug that is causing the the required fields error the link below explains how to fix it.

http://www.simplemachines.org/community/index.php?topic=248871.msg1810128#msg1810128

I went to the CustomForm.php in my CFM folder and applied the change in the link you provided.

It did NOT fix the problem. Any other suggestions?

Thank You!
Title: Re: Custom Form Mod
Post by: Nvb on December 13, 2008, 04:52:07 AM
Quote from: MrMusic on December 12, 2008, 10:54:25 PM
QuoteThere's a small bug that is causing the the required fields error the link below explains how to fix it.

http://www.simplemachines.org/community/index.php?topic=248871.msg1810128#msg1810128

I went to the CustomForm.php in my CFM folder and applied the change in the link you provided.

It did NOT fix the problem. Any other suggestions?

Thank You!

I had the same problem, but this fixed it for me.
All you have to do is place the 0 between tags -> '0'
Works fine!
Title: Re: Custom Form Mod
Post by: Nvb on December 13, 2008, 06:29:09 AM
I have 2 new questions:

1.) Can you give a example of the Custom Template Function in the Custom Form Settings?
    What does this function do? What needs to filled in there?

2.) Is there a way to let a Selection Box behave different on the results of a previous Selection Box?
    I'll give an example:

In Selection Box A you can choose between lets say: 
- America,Europe,Asia

Now Selection Box B needs to read the result of Selection A and display the correct subsection.
So 3 possible answers are possible:

In case of answer America, Selection Box B1 needs to display: North, Center, South
In case of answer Europa, Selection Box B2 needs to display: Netherlands,Belgium,France, England,Germany,...
In case of answer Asia, Selection Box B3 needs to display: Northern Asia,Central Asia,Eastern Asia,Southeastern Asia,...

En so on in case of a 3e selection box...

I guess it's something like IF {A} THEN display {B1 or B2 or B3}

Can this be scripted in the Custom Form Mod Settings dialog?
Help plz



Title: Re: Custom Form Mod
Post by: Garou on December 13, 2008, 04:34:42 PM
The custom form template is just a basic idea of what you need to change the look of the template, IE if you want to have text or something before or after the questions. I created another example in the link below as well as a beginners form explaining how to use the different fields.

http://www.simplemachines.org/community/index.php?topic=248871.msg1805119#msg1805119

As for the selection box behavior... What your looking for doesn't exist in this mod. I suppose something could be created but I'm not sure how to go about it. Personally I would just use a text box and have the member enter the information by hand.
Title: Re: Custom Form Mod
Post by: MrMusic on December 18, 2008, 08:32:32 AM
Quote from: NeQo on December 13, 2008, 04:52:07 AM
Quote from: MrMusic on December 12, 2008, 10:54:25 PM
QuoteThere's a small bug that is causing the the required fields error the link below explains how to fix it.

http://www.simplemachines.org/community/index.php?topic=248871.msg1810128#msg1810128

I went to the CustomForm.php in my CFM folder and applied the change in the link you provided.

It did NOT fix the problem. Any other suggestions?

Thank You!

I had the same problem, but this fixed it for me.
All you have to do is place the 0 between tags -> '0'
Works fine!

Ok, I have tried what you stated as well. it is the same fix as in the link provided to me in this quote.

PLEASE. Can someone help me with this fix? I really have no idea what to do next.

I will attach my CustomForm.php in hopes someone may find the issue.
Thank you so much for any help you may be able to offer.

Again, my version: 1.1.7 with Movie07 theme
To view my issue, go to www.mrlivemusic.com/Forum
user test
pass test

Board is: Looking for Big Band Charts => here you will find the form link

Ashley
Title: Re: Custom Form Mod
Post by: Nvb on December 18, 2008, 02:31:21 PM
I have added my form for you to test.
It works fine here.
Be sure to add it under your Sources directory.
Title: Re: Custom Form Mod
Post by: Garou on December 18, 2008, 11:42:16 PM
Comparing your file to mine, yours reads...

if(($size != ''))
$value = substr($value, 0, $size);
}
}

                        //   Do we have an invalid value? Is this field required?
            if(($required
            && (($value == '') || ($value == '0'))
            && ($field['type'] != 'checkbox'))


And mine reads as...
// if(($size != ''))
// $value = substr($value, 0, $size);
}
}

// Do we have an invalid value? Is this field required?
if(($required
&& (($value == '') || ($value == '0'))
&& ($field['type'] != 'checkbox'))


Hope that helps  :)
Title: Re: Custom Form Mod
Post by: MrMusic on December 19, 2008, 02:52:04 AM
Quote from: Garou on December 18, 2008, 11:42:16 PM
Comparing your file to mine, yours reads...

if(($size != ''))
$value = substr($value, 0, $size);
}
}

                        //   Do we have an invalid value? Is this field required?
            if(($required
            && (($value == '') || ($value == '0'))
            && ($field['type'] != 'checkbox'))


And mine reads as...
// if(($size != ''))
// $value = substr($value, 0, $size);
}
}

// Do we have an invalid value? Is this field required?
if(($required
&& (($value == '') || ($value == '0'))
&& ($field['type'] != 'checkbox'))


Hope that helps  :)

Ok, I have tried every suggestion that has been put on this forum so far. Nothing has changed.

Now, I am new to all this so I am not sure that I am applying everything properly.

First, I applied the changes to the CustomForm.php in my CFM folder. It did not work.
Then, I noticed that there was another CustomForm.php in my Sources folder as suggested in one of the posts above. I applied the changes there, nothing.

So, now I am getting desperate. I really need this to start working. I have a strong need for it's use and do not know of any other alternative.

Are there any other suggestions on how I can get this operating.

I know your time is valuable and any help is truly appreciated.

Ashley
Title: Re: Custom Form Mod
Post by: Garou on December 19, 2008, 06:05:41 AM
Um there should only be one CustomForm.php file. It should be in your Sources directory.
Then there should be a CustomForm.template.php in the default theme directory. Since your using a custom theme you may need to put it there too but try it without first.

Check out the manual install instructions for the mod, compare it to your files and make sure it matches.
http://custom.simplemachines.org/mods/index.php?action=parse;mod=1279;attach=62066;smf_version=1.1.5

Also are you using the most recent version? LHVWB hasnt put it on the downloads page, he just attached it to a post here (http://www.simplemachines.org/community/index.php?topic=248871.msg1770153#msg1770153) and the file can be found here (http://www.simplemachines.org/community/index.php?action=dlattach;topic=248871.0;attach=73540).

You are right though there isn't an alternative to this mod. There is the custom pre-filled post hack by Thurnok on Tiny portals site but after using this mod for a while I just really cant recommend it any more.
Title: Re: Custom Form Mod
Post by: Garou on December 22, 2008, 09:31:33 PM
It looks like MrMusic's Problem is solved.

The problem wasn't in the Mod but in the syntax of the questions asked.

The "title" for the questions works better when small case is used and there are no spaces. The "text" section is the way you want it to look in your form. Also in the Post output section, you need to format the form input to match the "title".

For instance if you want to use "Your Name" as a question you would need to format it as...

Title                                              your_name
Text                                              Your Name
Type                                             Text Box (String)
Extra Type Parameters                    required


Then in the Form Output section you would use
My name is: {your_name}

In the actual form people fill out you would see...
Your Name                                        Garou

Then when the message is posted to your board you would see...
My name is: Garou
Title: Re: Custom Form Mod
Post by: Swayforth on December 27, 2008, 04:00:58 PM
Hello all,

First i must say this is one awesome mod!

i have been having an issue with the required fields and have narrowed it down to this.

When i make a required field and the input is numeric only i receive no errors.
When i make a required field and the input is alphabetical i do receive the error.

So my question is this, what in the code could cause this issue? I wish i could be of more help but i do not know how to code i only know how to narrow down the issue. Thanks all!!!

The attached images explained
1st image - required_error_abc_name.jpg = All required fileds but the Name file is numeric
2ns image - required_error_abc_forum_name.jpg All required fileds but the Forum Name file is numeric
no setting changes were done between the 2 tests, just the input was changed.


Title: Re: Custom Form Mod
Post by: Garou on December 27, 2008, 09:44:38 PM
The Fix is listed back a few posts. :)

http://www.simplemachines.org/community/index.php?topic=248871.msg1810128#msg1810128
Title: Re: Custom Form Mod
Post by: Swayforth on December 28, 2008, 01:14:59 AM
Sorry Garou i should have specified that i applied that fix before post and i should have attached the file as well.

I did spend some time on this thread looking for answers :) Just seems odd that only numbers are working. We sure it's not some type of formatting only allowing numeric input?

Thanks for the reply


// Restrict the length of value if necessary, can stuff up html, but hey...
if(($size != ''))
$value = substr($value, 0, $size);
}
}

// Do we have an invalid value? Is this field required?
if(($required
&& (($value == '') || ($value == '0'))
&& ($field['type'] != 'checkbox'))
// Failing for selectboxes is far more simple, If there is no valid value, it fails.
|| (($field['type'] == 'selectbox') && ($value == '')))


Title: Re: Custom Form Mod
Post by: Garou on December 28, 2008, 10:41:36 AM
Have you checked the syntax of the titles field when you create a form? That can also cause errors. For instance the title should be something like "member_name", "name" or "membername" and not "Member Name" or "Name". For some reason the form doesn't like large case letters and spaces in the title, that was the problem MrMusic ran in to a few posts back but I bet you read that already too. :)

Those are the only two problems Ive found that cause the required fields errors. The only other thing I can think of is if you tried to create a custom template and did something wrong in there.
Title: Re: Custom Form Mod
Post by: Swayforth on December 28, 2008, 11:29:03 AM
Yes sir, i read that as well. i even created a new form with everything lowercase no spaces with only 1 field and still am seeing the issue(see attached). I am not running a custom template either. I have taken the original files and moved them to my theme folder. i did have to do a manual install. perhaps somewhere in the manual install something is wrong?

im running
1.1.7 + Tiny Portal 1.0.6 beta2
Black-Rain V2 by Crip theme.


Title: Re: Custom Form Mod
Post by: Garou on December 30, 2008, 02:49:53 AM
It shouldn't effect anything as SMF should just pull it from the default directory but have you tried copying the CustomForm.template.php to your Themes/Black-Rain folder?

After you have done that and if it still doesn't work then all I can suggest is uninstalling everything and then reinstall with errors and manually change the files that have errors. That way there is less chance for typo errors. 
Title: Re: Custom Form Mod
Post by: Propaganistas on December 30, 2008, 04:45:41 AM
Hello,

I'm getting this error when trying to submit a form. I'm using the updated version previously attached to one of the posts, all form names are lower case and without any spaces, CustomForm.template.php is also copied to my custom theme,...

QuoteYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'gwbbcode';/*
*/ /*
*/ /* Include the overDiv div *//*
*/ var overdiv_div =' at line 4
File: /home/ecto.nl/www/forum/Sources/Subs-Post.php
Line: 1542

gwBBCode (http://gwshack.us/) is a mod which adds a lot of new bbcode and functions..

My Subs-Post.php file is in attachment.

Thanks in advance,
Propa
Title: Re: Custom Form Mod
Post by: Garou on December 31, 2008, 02:09:09 PM
Propaganistas I know nothing about gwBBCode and after a peek at it, the problem could easily be that it was never properly ported over for SMF. Someone just kinda hacked at it till they got most of what they wanted from it and then left it at that. I found a post on here about it asking for someone to make a real SMF mod out of it but it looks like no one ever did.

Essentially what your working with is a hack and not a mod, sometimes they work and sometimes they don't. 

I looked at your Subs-Post.php file and I cant find the error. Line 1542 doesn't look like its causing the problem and the code listed in the error isn't even in the file at all.

I think you might be better off taking the problem to someone more familiar with SMF and gwBBCode. They will most likely be able to spot something in the hack that I can not. Maybe someone else here might have more luck with it but I'm at a loss.
Title: Re: Custom Form Mod
Post by: Propaganistas on January 01, 2009, 03:22:43 PM
Ok thanks for your reply Garou!

~Propa
Title: Re: Custom Form Mod
Post by: tsmalmbe on January 02, 2009, 07:01:34 AM
Is this mod still alive? I would require attachments for this to be of use.

It installed correctly on 1.1.7, althouhg I had to add some things by hand to modsettings.

Anyway, default values do not seem to work, and if I mark something as required, the form does not submit regardless of if I put a value in the required field or not.
Title: Re: Custom Form Mod
Post by: Nvb on January 02, 2009, 01:57:12 PM
Quote from: tsmalmbe on January 02, 2009, 07:01:34 AM
Anyway, default values do not seem to work, and if I mark something as required, the form does not submit regardless of if I put a value in the required field or not.

Omg! did you read this topic? look at the top of this page to find the solution for this great mod.
Hint: it has something to do with "".... :P
Title: Re: Custom Form Mod
Post by: gadgetfl on January 06, 2009, 04:20:37 AM
Feature Request:
Email Notification on form submit.

The "notify" feature of SMF would be fine but the form save bypasses it by directly writing to SQL DB

Title: Re: Custom Form Mod
Post by: tonyluzzi on January 15, 2009, 05:17:58 AM
I am using No Spam by Guests! (http://www.simplemachines.org/community/index.php?topic=119091.0) which blocks Guests from making posts with links in them. However, I noticed when I made a form post, the links still went through.  Is there a way of combining these 2 mods so that they can submit a form only if it doesn't contain any links?
Title: Re: Custom Form Mod
Post by: Propaganistas on January 26, 2009, 01:44:11 PM
Please take a look here:

http://www.simplemachines.org/community/index.php?topic=288255.0
Title: Re: Custom Form Mod
Post by: happyfeet on February 04, 2009, 11:23:17 AM
Does anyone have any experience integrating reCaptcha into the custom form mod?

reCaptcha for PHP information can be viewed here:

http://recaptcha.net/plugins/php/

I am looking at what it would take to integrate this into the custom form I created with this mod and am looking for some advice.

Thanks!
Title: Re: Custom Form Mod
Post by: tsmalmbe on February 09, 2009, 04:52:39 PM
Quote from: NeQo on January 02, 2009, 01:57:12 PM
Omg! did you read this topic? look at the top of this page to find the solution for this great mod.
Hint: it has something to do with "".... :P
Quote from: NeQo on January 02, 2009, 01:57:12 PM
Quote from: tsmalmbe on January 02, 2009, 07:01:34 AM
Anyway, default values do not seem to work, and if I mark something as required, the form does not submit regardless of if I put a value in the required field or not.

Omg! did you read this topic? look at the top of this page to find the solution for this great mod.
Hint: it has something to do with "".... :P

Yes. The required now works. But the default values do not.

required,default=(str)

makes it require, but does NOT print out "str" (or any other string, even tried quoting).
Title: Re: Custom Form Mod
Post by: tsmalmbe on February 09, 2009, 04:54:17 PM
Also, I would like to add a +1 on getting attachments as a field option.
Title: Re: Custom Form Mod
Post by: fasterthanyours on February 11, 2009, 02:47:11 PM
Ok I'm banging my head.

I modded the install for 1.1.5 to install on all 1.1.X installs so I could get it to run on my 1.1.8 board.

Seems to be working ok and when I was done adding everything to the form I hit save and it just takes me back to the edit form page.

It doesn't list my form when I got to ?action=form

I'm not getting any errors as of yet.

EDIT:I checked the log and I do have the following over and over again.
http://www.charlestonreefers.org/forum/index.php
8: Undefined index: boardViewersClickable
File: /home/minfinge/public_html/charlest/forum/Sources/BoardIndex.php
Line: 345


Someone please tell me what might be going on.
Title: Re: Custom Form Mod
Post by: Enders on February 11, 2009, 04:50:41 PM
there is some kind of bugs... When I edit permissions in admin > members > permissions .... it unchecks them in custom forms?
Title: Re: Custom Form Mod
Post by: fasterthanyours on February 11, 2009, 05:40:54 PM
I figure it out.  What was going on.  I'm not find this mod very user friendly from a back-end admin stand point.

However.  You name the form and such and from what I can tell don't type anything in the normal window.

You have to add entries into the form below that.

Going to take a while for me to test my form as I have about 30 things I need on it.
Title: Re: Custom Form Mod
Post by: olifa on February 15, 2009, 08:27:40 AM
do you have any new information when you are going to release the new version of this mod so the bug with the
[img]http://http://urlofapicture[/img]  disappears?^^

I'm using smf 1.1.x and this mod is so great! I use it for a lot of different purposes! =)
Title: Re: Custom Form Mod
Post by: Garou on February 15, 2009, 09:19:17 AM
I'm not the author of the mod but I have given some support on the mod as Ive become more familiar with it. I'm also not familiar with that error.

When, where, and how do you arrive at that issue? If you point me in the right direction I might be able to come up with a fix for it.
Title: Re: Custom Form Mod
Post by: fasterthanyours on February 19, 2009, 11:44:25 PM
Ok I give up.  I'm really banging my head.

I just made this huge form with like 30 fields and I can't get a single one of them to display in the post after I hit submit.

I'm not even getting the Subject to appear the message is completely blank.

What the heck am I doing wrong?

Even with out the Custom Template field filled in, it still doesn't work.
Title: Re: Custom Form Mod
Post by: Enders on February 20, 2009, 03:10:47 AM
Is there a way to make a form that will post it under one topic instead of creating a new topic?
Title: Re: Custom Form Mod
Post by: Garou on February 20, 2009, 05:53:14 AM
Enders, at the moment no. Each post goes to a new thread but its been talked about as a possibility for a future release to have the option of posting to one topic.

As for the permissions, Custom Forms makes its own permissions and the two are not supposed to be connected. You set the Form up as for who can see that and you use the forum permissions to see who can see the board. However is a person has access to the form they can fill it out and post to the board from the form even if they don't have permission to post. The form ignores the board permissions.

fasterthanyours, I'm going to see if I cant get the form to work right for 1.1.8 and the RC. I have permission from LHVWB to package it up and post it if I can get it to work. :)
Title: Re: Custom Form Mod
Post by: Nathaniel on February 20, 2009, 06:34:13 AM
Just to formalize this. ;)

Garou is now an 'Additional Author' for the Custom Form Mod, so they should be able to help with some support and updating this mod to work with the newer versions of SMF.

Unfortunately I don't really have time at the moment to work on updating and supporting this mod. Although I have plans to rewrite this mod from scratch with all of the functionality which has been requested (for SMF 2 final - when it comes out), but that probably won't happen for a while (maybe even until the end of the year) due to my time constraints.

Sorry that I haven't really responded to any support requests in this topic, they have been building and I really haven't had the time. :/
Title: Re: Custom Form Mod
Post by: fasterthanyours on February 20, 2009, 08:37:37 AM
Quote from: Garou on February 20, 2009, 05:53:14 AM
fasterthanyours, I'm going to see if I cant get the form to work right for 1.1.8 and the RC. I have permission from LHVWB to package it up and post it if I can get it to work. :)

To my knowledge not that much changed between 1.1.5. and 1.1.8 except security.

Please tell me that it's not because I'm running 1.1.8 that it won't push the variables through???

LHVWB, good luck with the SMF2 stuff.  I spent hours trying to get a mod that I took over to get to work in SMF2.  Unfortunately I can't post my mod on SMF's site because they don't approve of it ;)

Here's the 2 files I modified to get it to install.
Title: Re: Custom Form Mod
Post by: Garou on February 20, 2009, 09:52:46 AM
Yeah getting mods approved can be hard at times but remember that they are very busy right now between all the mods being updated for 1.1.8 and the RC. Have you heard back from them at all yet?

As for the mod I just remembered that there is a version that LHVWB posted but its not on the mod page. http://www.simplemachines.org/community/index.php?topic=248871.msg1770153#msg1770153 and the DL is http://www.simplemachines.org/community/index.php?action=dlattach;topic=248871.0;attach=73540.

Ive been able to get this to install on 1.1.8 without issue and I'm currently testing to see if there are any other errors. It does have the required fields issue yet, however that has been addressed and will be fixed in the next update. http://www.simplemachines.org/community/index.php?topic=248871.msg1810128#msg1810128

tsmalmbe, at present you cant add the default values with the required option. It might be possible in the future, we will have to look at that.

There have been other suggestions made that we'll look at as well but the priority now is to make sure it is all running the way it was intended, like it did in earlier versions.

I'm very much looking forward to the rewrite that LHVWB has planed, I know it will be great just like all the other projects hes been working on as well as this one. I'm even more happy that he is willing to let me help out with the mod in its current state.

Title: Re: Custom Form Mod
Post by: Garou on February 20, 2009, 12:51:31 PM
Mod updated for 1.1.8
CustomFormMod_v1.3_SMF1.1.x.zip (http://custom.simplemachines.org/mods/index.php?mod=1279).

Mod updated for 2.0 beta 4 and RC1
CustomFormMod_v1.3_SMF2.x.zip (http://custom.simplemachines.org/mods/index.php?mod=1279).
Title: Re: Custom Form Mod
Post by: Garou on February 20, 2009, 09:04:09 PM
I just went through every post in this thread and made a check list of all bugs and requests.

The requires fields bug has been addressed in the last update but I did find a different fix from another user that I will have to test out. I forgot about the Internet Explorer issue and didn't get it in there, that will be in my next update.

As for the requests some of them I should be able to work out but some will have to wait till the the rewrite LHVWB has planned, either because they are beyond my knowledge or they are just beyond what the existing code can handle without being entirely re-written. I will try to get as many in as I can though.

@ tsmalmbe, I got a better look at what you were asking about your required fields problem and its because you are entering conflicting options.

The default=(str) option is what is posted if the user doesn't fill out the field.
for example you ask  "What is your favorite color"? Then you set default=(red). If the user leaves the field blank then when the form is posted it will automatically post "red".

The required option forces the user to fill out the field.
So if the user doesn't fill out the field then the form pops back up telling them that they have to fill out the field. However when they do fill it out then the default=(str) is overridden because they did.

The two variables can not logically coexist. What result were you expecting to see? Perhaps we can find another way to do it.

As for the attachments, its on the request list and if possible we will add it in a future update.

@ Enders, that has been on LHVWB's to do list for a while now and Ive added it to mine, Id like to have that option for some of my boards as well, hopefully one of us can figure it out.

@ fasterthanyours, you are running into a syntax issue that is confusing the form output.
Quote from: Garou on December 22, 2008, 09:31:33 PM
It looks like MrMusic's Problem is solved.

The problem wasn't in the Mod but in the syntax of the questions asked.

The "title" for the questions works better when small case is used and there are no spaces. The "text" section is the way you want it to look in your form. Also in the Post output section, you need to format the form input to match the "title".

For instance if you want to use "Your Name" as a question you would need to format it as...

Title                                              your_name
Text                                              Your Name
Type                                             Text Box (String)
Extra Type Parameters                    required


Then in the Form Output section you would use
My name is: {your_name}

In the actual form people fill out you would see...
Your Name                                        Garou

Then when the message is posted to your board you would see...
My name is: Garou

Title: Re: Custom Form Mod
Post by: fasterthanyours on February 20, 2009, 11:41:30 PM
Garou,

Check you PM.

Well I was looking at my syntax again and I'm 99% I've got it correct.

Here's my form:
http://www.charlestonreefers.org/forum/index.php?action=form;id=1

My Form Output is the following just to test:
This is my problem: {problem}
Fresh: {Fresh}

I get nothing, not even the subject.

It's just not working.
Title: Re: Custom Form Mod
Post by: Smoky "Rider" Blue on February 21, 2009, 04:21:37 AM
/me slides a coffee to Garou..

cheers!!  ;)
Title: Re: Custom Form Mod
Post by: Garou on February 21, 2009, 07:45:52 AM
Thank ya Smoky  ;)

fasterthanyours, the screen shot you posted earlier was showing the syntax issue.
Even if your not trying to display the questions in the output it was being asked in the form and going to cause issues.

You have...
Title:Tank Size
Text:Tank Size in Gallons

It should be...
Title: tanksize or tank_size either should work
Text: Tank Size in Gallons
The Forum Output would be either {tanksize} or {tank_size} depending on which you use.

Title: Fresh
should be
Title: fresh
Fourm Output should be {fresh}

You have several instances of that type of mistake in the screen shot. The title just does not have to be that descriptive. The Text is what your users are actually going to see anyway. The Title is just a designator and only seen by you and should be short, no capitalization, and no spaces.
Title: Re: Custom Form Mod
Post by: fasterthanyours on February 21, 2009, 09:23:08 AM
Quote from: Garou on February 21, 2009, 07:45:52 AM
The Title is just a designator and only seen by you and should be short, no capitalization, and no spaces.

And what copy of the instructions did you get? LOL

Seriously I didn't see any.  I'll fix all of them and try it again.

But the thing is, it's not even posting the subject, or even the normal text in the Output section.

I'll keep trying.

You get your PM?
Title: Re: Custom Form Mod
Post by: yus786 on February 21, 2009, 10:59:33 AM
Is this at all possible?

I need a form that has a built in lookup table for email addresses?

Example.

Say we have a drop down selection for Departments.

If the user selects Dept1, then the form should be posted to forum/thread 1
If the user selects Dept2, then the form should be posted to forum/thread 2


Is this possible?
Title: Re: Custom Form Mod
Post by: fasterthanyours on February 21, 2009, 11:08:20 AM
I think it is, however documentation blows on this thing.

In theory this form should be able to do anything, however, good ideas sometimes don't get done...?
Title: Re: Custom Form Mod
Post by: Fireguy15 on February 21, 2009, 11:59:25 AM
I am using rc1 and the appropriate mod for rc1,

When I tried to install the package I got:

QuoteTable 'website_forum.cf_forms' doesn't exist
File: /home/website/public_html/forum/Packages/temp/install.php
Line: 45

This was immediately after clicking on "install now"

Any ideas??
Title: Re: Custom Form Mod
Post by: Fireguy15 on February 21, 2009, 12:35:58 PM
I had the table in my database but had to delete it and another cf table and it loaded properly!
Title: Re: Custom Form Mod
Post by: Garou on February 21, 2009, 12:54:53 PM
fasterthanyours, I did get your pm and responded. I agree that better documentation is needed and it is on my to do list. Most of what I know came from combing through this thread as well as my own trial and error early on.

I think this thing got much bigger then LHVWB had intended or really has time for with all his other projects, Simple Portal alone has to be eating up a huge chunk of his time. Not to mention all the other things life outside the net throws at us. That is why I offered to help out where I can.

As far as as this or any mod or even program being able to do anything... Well that's a mighty tall order there my friend and I'm pretty sure it will never be able to get me a date a Hollywood superstar. LOL

yus786, that is an excellent idea and similar ones have been brought up before here. Alas it is beyond what this thing can do at the moment. Ive got it on my to do list but its going to take some time and lots of work. It could be as simple as adding a new function or it might take an entire re-write of the mod.

Fireguy15, that isn't normal but it has happened before, I saw it yesterday and I believe that there was fix for it but for the life of me I cant remember where. I think it was early on. I figured it was something like that. Did you have this mod installed at some point before and removed it?
Title: Re: Custom Form Mod
Post by: Fireguy15 on February 21, 2009, 03:15:10 PM
I had tried to install an older version but it failed and at the time I had no idea how to get all traces out of my database.
Title: Re: Custom Form Mod
Post by: Smoky "Rider" Blue on February 21, 2009, 05:27:17 PM
so its working for you fireguy?  :)
Title: Re: Custom Form Mod
Post by: fasterthanyours on February 21, 2009, 11:22:30 PM
LOL Yeah well potential is there.  If I had some patients with it I could probably figure it out for you.

I DLed the SMFBuyPro for Mono the other day.  OMG that thing is wicked!  So much code.
Title: Re: Custom Form Mod
Post by: Garou on February 22, 2009, 10:34:12 AM
Quote from: olifa on February 15, 2009, 08:27:40 AM
do you have any new information when you are going to release the new version of this mod so the bug with the
[img]http://http://urlofapicture[/img]  disappears?^^

I'm using smf 1.1.x and this mod is so great! I use it for a lot of different purposes! =)

I figured this one out this morning. You have to enter parse_bbc in the Extra Type Parameters field for this to work right.

Example...
Title: image
Text: Please enter the link to your image here.   
Type: Text Box (String)
Extra Type Parameters: parse_bbc

Then in the Form Output: you would enter
[img]{image}[/img]

Images will post from the form to your forum this way, no changes to the mod necessary.  :)
Title: Re: Custom Form Mod
Post by: fasterthanyours on February 22, 2009, 12:16:42 PM
I was kind of thinking that was it too.
Title: Re: Custom Form Mod
Post by: Garou on February 22, 2009, 08:04:57 PM
I started working up a tutorial/help file this morning and was thinking of every possible way this can be used when I remembered olifa's question and the answer was right there in my face when I hit the ? icon next to Extra Type Parameters.

Which reminds me LHVWB did put some good information in those help files but he wrote most of it from a coders perspective. In technical writing classes they stressed that you have to write everything from a layman's perspective so I'm going to try and do that with the help files as well as a tutorial Ill post here once I'm done.
Title: Re: Custom Form Mod
Post by: fasterthanyours on February 22, 2009, 08:37:58 PM
Garou,

I think you hit the nail on the head.  The "instructions" are there, but not real clear.
Title: Re: Custom Form Mod
Post by: PerryM on February 25, 2009, 01:46:28 PM
I've slugged it out with 75+ modules now - eventually got them running with help from their forums.

In this case I can't figure out how to get to a CP or anything - I've spent 30 minutes screwing around with this and I must report that this module really is a waste of time.

I love the concept of it but this module needs to mature a lot more before wasting my time.

I salute the author for trying to bring this module forward but you need to spend a lot more time making this intuitive before bringing it to our attention.  This is a total waste of time and I have no patience to try making this work.

Sad.

I suggest you remove this module before you destroy your own reputation here - its that bad.
Title: Re: Custom Form Mod
Post by: Garou on February 25, 2009, 05:07:03 PM
Ill admit it can be a bit rough if you don't have a clue about what your doing.

With most mods you get to know a bit more if you read the threads associated with them. This one if fairly small and well worth the read. Especially the last half of the thread. Most issues people have come across have been addressed here recently. Also if you ask nicely you might find people willing to help you. It works much better then throwing a child's tantrum.  O:)

It might also be helpful if we knew what version you were running. But lets see here on the page that you downloaded the mod from, You did read that didn't you, Its right here
http://custom.simplemachines.org/mods/index.php?mod=1279 in case you forgot where. It says...

QuoteSettings are found in the Admin panel:
For SMF 1.1.x: "Features and Options" section -> "Custom Forms" tab.
For SMF 2 RC1: "Configuration" drop down menu -> 'Modifications' -> 'Custom Form' Tab.

Now if you have any more problems there's the little ? icons that will tell you more, feel free to ask here politely, or better yet read through this message thread, most everything has been covered. Then again, who knows, if you waste enough time with this mod you just might find something new. Best of luck to you PerryM.
Title: Re: Custom Form Mod
Post by: PerryM on February 25, 2009, 05:10:45 PM
Quote from: Garou on February 25, 2009, 05:07:03 PM
Ill admit it can be a bit rough if you don't have a clue about what your doing.

With most mods you get to know a bit more if you read the threads associated with them. This one if fairly small and well worth the read. Especially the last half of the thread. Most issues people have come across have been addressed here recently. Also if you ask nicely you might find people willing to help you. It works much better then throwing a child's tantrum.  O:)

It might also be helpful if we knew what version you were running. But lets see here on the page that you downloaded the mod from, You did read that didn't you, Its right here
http://custom.simplemachines.org/mods/index.php?mod=1279 (http://custom.simplemachines.org/mods/index.php?mod=1279) in case you forgot where. It says...

QuoteSettings are found in the Admin panel:
For SMF 1.1.x: "Features and Options" section -> "Custom Forms" tab.
For SMF 2 RC1: "Configuration" drop down menu -> 'Modifications' -> 'Custom Form' Tab.

Now if you have any more problems there's the little ? icons that will tell you more, feel free to ask here politely, or better yet read through this message thread, most everything has been covered. Then again, who knows, if you waste enough time with this mod you just might find something new. Best of luck to you PerryM.

Instead of throwing out insults you would do better if you just did some documentation and you would get high praises.

Check my posts and you will see that I've complemented folks who do add value to smf.  Waste time belittling your users and this will just get worse.

Fix the documentation!  It's just as important as the code - not just an afterthought!
Title: Re: Custom Form Mod
Post by: Garou on February 25, 2009, 07:01:54 PM
LOL Obviously you didn't read my post or the documentation. There is documentation, I even told you where its at in my last post. You just aren't reading it or understanding it. In either case I and the other user's are here to help you, just please be more constructive in your post rather then trashing the mod outright.

This was a good mod when it was written and its a good mod now. It provides a feature that is very useful and we have many happy users. Myself included, as I was just a user of it myself till just a few days ago. If it wasn't a good mod I wouldn't have volunteered my services to work on it.

None the less you come in here grandstanding on your high horse, claiming its a waste of time and demanding that we remove the mod because you cant figure it out. You sir are entitled to your opinion, however if you came in here asking questions the smart way (http://docs.simplemachines.org/index.php?topic=494), you would have been given a much more polite answer.

Now if you've read this thread you know that the author regrettably hasn't had the time to make the improvements he'd like and I just a few days ago signed on to help him out with at least keeping it updated and making some of the improvements at least the ones that I can. I even mentioned that I will update the documentation as it can be unclear to a person that isn't a programmer, at times. It is however there if care to look, again I told your where to find it.

Now if you still want to waste your time with this, as you say, immature mod, I will be happy to help you, as long as you act in a mature manner. If you can not then maybe it would be best that you wait till the mod matures a little more to your liking.

Title: Re: Custom Form Mod
Post by: PerryM on February 25, 2009, 07:53:48 PM
Ok, I'm on vacation and normally I'd be on to the next project but I'll slug it thru this.

The first thing I do with a smf mod is to install it, un-installed it, and install it again - getting ready for a new version.

I can install this mod and un-install it but when I try to install it again I get this error:

Table 'm4inform_smf.cf_forms' doesn't exist
File: /home/m4inform/public_html/smf/Packages/temp/install.php
Line: 45

So this would be error #1 I'm reporting...

(This would flunk my criterion to proceed further but I'll slug it out)

P.S.

Used mySQL admin and deleted that record and tried to re-install with this error:

Table 'm4inform_smf.cf_fields' doesn't exist
File: /home/m4inform/public_html/smf/Packages/temp/install.php
Line: 90

This is error #2 I'm reporting.

I'll delete this record too and re-install...
Title: Re: Custom Form Mod
Post by: PerryM on February 25, 2009, 08:04:57 PM
Ok, made it thru the re-install.

Nowhere did I see ANY link to a simple Readme.txt or something else.

So this will be Suggestion #1 - add a simple readme.txt file after or during the install.

Title: Re: Custom Form Mod
Post by: PerryM on February 25, 2009, 08:18:30 PM
Suggestion #2:
During the install inform the user that they need to visit Admin>Configuration>Modification>Custom Forms

And supply information:

Form View Page Permissions help is:

This setting allows you to restrict the membergroups that can see the list of the forms which they can access (At "index.php?action=form"). Note that even if they can see they list, they cannot see or use any forms which they do not have the permissions for.

I'm confused as to what this says so suggestion #2 is to rewrite the help for this field.

I don't know whether to highlight a group or not.  I'm going to guess I should highlight Regular Members – but this is just a guess.
Title: Re: Custom Form Mod
Post by: PerryM on February 25, 2009, 08:28:06 PM
Suggestion #3:
What is Board ID "0 invalid Board", Permissions "Admin"?
Did I make a mistake already?
I don't know the purpose of the invalid record but it irritates me right off the bat.
So my suggestion is to get rid of it or name it something that doesn't look like I've made a mistake before even starting to add a new form.  I'm going to guess that this is an error and delete it.  Wish me luck...

Oops silly me you can't delete it.  So I guess I keep the error - just a guess.
Title: Re: Custom Form Mod
Post by: PerryM on February 25, 2009, 08:34:57 PM
Suggestion #4:
I'm trying to add a new form and the mod wants to know what forum it is to be applied to.  It wants a number I guess and when I go to the forum I want to add the form I see:

wwww.mywebsite.com/smf/index.php?board=1.0

But my suggestion is to have a pop up list of forms and I get to select which one I want – it just looks more classy and prevents users from putting in 1.0 and getting squirrely results.

I'd  bet that a pretty URL mod could change that to even a name for the SEO - but that's a guess.  If it does there is no number to type in.

Title: Re: Custom Form Mod
Post by: PerryM on February 25, 2009, 08:42:49 PM
Suggestion #5:

The field "Custom Template Function" help is:

Attention! You only need to use this setting if you want to customize the templates of your form submit pages.
This setting allows you to chose which template function from the "/themes/{current_theme}/CustomForm.template.php" file will be used for this particular form when a user is submitting it. This allows you to define your own templates to display the "Submit Form" page. Please note that the template function which will be used, has to be named with the format "form_template_{value for this setting}", otherwise the default "form_template_submit_form()" template function will be used.
If you are trying to create a new template then I recommend that you make a copy of the "form_template_submit_form()" function from the beginning of the "CustomForm.template.php" file and rename it, you can then alter your new function to get the desired effects.

This is gobblygook and I doubt that I will ever understand what this is.

My suggestion is to translate from Geek Speak to English and I'd like to see a lot of examples if this is so powerful.
Title: Re: Custom Form Mod
Post by: PerryM on February 25, 2009, 08:55:40 PM
Suggestion #6:
Subject field's help:
"This is the subject/title of the post which will be outputed, like the output area, it can contain values from the form itself."
Outputted is misspelled and at this stage I have no idea what "values from the form itself" is – I'm guessing some kind of variable with { or [ to indicate the variable name.  Just a guess.
Suggestion – more concrete examples.
Title: Re: Custom Form Mod
Post by: PerryM on February 25, 2009, 09:01:38 PM
Error #3:

With all this messing around with my experimental smf site I got a second "Invalid Board" and this time I could delete both of them.  First time I tried this I could not delete the first one".

There's something wrong with inserting "Invalid Board" records which needs to be addressed.
Title: Re: Custom Form Mod
Post by: PerryM on February 25, 2009, 09:08:55 PM
Suggestion #7:
The Form Output's help is:
"This is the actual output setting of the current form. When a user submits their data, the post/thread which is created will follow the exact format of this settings value, except that all variables like this {variable}, will be replace by the values that were entered by the user.

This means that you have to access the values given by the user in the form, using the format of {variable title}. For example if the field was called 'name' then {name} would be replace with the user entered value for the name field."
I can't understand what to do next.  I understand the concepts but I need concrete examples.
At this point I'll have to look at previous posts and links and try to understand what I'm supposed to type in here – cause I'm totally lost now.

P.S.
Time to walk on the Maui beach and pick this up tomorrow after some drinks...
Title: Re: Custom Form Mod
Post by: Garou on February 25, 2009, 11:04:20 PM
Ok error one and two are the same issue and it has been addressed in this thread. For some reason sometimes SMF isn't executing the the drop DB tables on the uninstall. So at the moment you do have to manually drop the cf_forms and and cf_fields databases to re-install. Known bug and is on the to do list, it will be fixed if possible. At the moment I'm not sure if its an issue with the mod or SMF as other mods occasionally have this problem as well. None the less, know that it is being looked into.

With any mod rather then installing and uninstalling on a live site, for testing I always suggest that people have a separate install of SMF for testing all mods and themes to make sure you have what you want before taking it live. It will save you a lot of headaches along the way.

There is an inline readme on install that at the moment just explains the purpose of the of the mod. On uninstall, is a warning that you are uninstalling the mod and that you will lose the functions of the mod. However the information your asking for is on the downloads page for the mod and multiple times in this support thread. Again better documentation is planned for a future release.

In the help file (the ?) next to the Board ID field for form you are creating, tells you
QuoteThis is the ID of the board which this form will submit the output post/thread into. You can find this id by having a look at the "board=" get variable, which is set to the board ID when you are viewing a particular board.
Essentially there is no board 0 in SMF and the default 0 is a place holder till you choose what board you want that data for your form to post to. If a number other then 0 was chosen and you didn't change it the the post could go into a board that you didn't want it to. Using 0 the form will not post anywhere at all till you have set the proper board ID this is done for your safety and is documented in the mod that it has to be changed.

Actually even if you are running a pretty URL mod, SMF does remember the Board ID its just not as easy to find. Its virtually impossible or at the very least extremely tedious to make any mod work properly with every mod out there. Most mod authors only test that their mods work on a fresh install of SMF and the default theme. Aside from anything that might open up the forum to a security breach, this is all SMF requires before they approve a mod as well.

The custom template feature isn't required for your form to actually work and you can leave the field blank. There are better instructions on how to create a custom template both in this support thread and in the CustomForm.template.php (the file you actually have to modify). To use the feature at the moment requires a decent knowledge HTML and php and it is not recommended that you edit this unless you do. LHVWB has mentioned that he plans a major rewrite of this mod in the future and that it will contain many of the requests in this thread, one of which is a different, more user friendly template system.

There is a real good tutorial giving step by step instructions on how to create a form here http://www.simplemachines.org/community/index.php?topic=248871.msg1633514#msg1633514

Your invalid board issue I explained earlier in this post but to make it clearer (since you brought it up twice) if you don't have the board on your site and try to post to it then it will be invalid. You can not post to a board that doesn't exist. Another place to find the number for a board is in the admin section where you actually create the boards for your forum. As for the delete issues, for now Id say chalk it up to a fluke. I have never come across this but I will see if I can replicate the issue to give you a better answer.

Again there is a real good tutorial giving step by step instructions on how to create a form here http://www.simplemachines.org/community/index.php?topic=248871.msg1633514#msg1633514 I think tlknowles did a great job of writing this up.

This is a complicated mod to set up, especially the first time and as I mentioned in another post the documentation was written from a coders perspective. Once you do understand how the mod works, after creating a few forms, it does become much more simple. Ive installed this and set it up for several SMF sites now and the site owners love the feature it provides in the end. It is well worth it to learn how to use the mod.
Title: Re: Custom Form Mod
Post by: PerryM on February 26, 2009, 12:36:10 PM
Suggestion #8

A) Don't have the Admin figure out which Forum/Thread that a form applies to just have a drop down field at the top of each Forum/Thread with a list of the available forms.  This makes much more sense.  The first selectable line of the drop down is "Create New Form" and brings the Admin to the place to add a new form.  User/member never sees this drop down tab.

The first post of this "Form Thread" has the Admin typing in instructions to the user/member - this should be collapsible - the user/member can click a + or - to expand/collapse the first post.

B) Need a [ ] Required field when creating a form - typing in "Required" just doesn't feel right.

C) Need a Category with a large number forms.

D) Are templates really needed?

E) When the user/member clicks "Reply" and a form is attached to a Forum then ONLY the form is displayed to be filled out.  Same with "Modify" - ONLY the user's data conforming to the form pops up.  That way all input goes thru the form; there is no way for the user/member to circumvent the form. 

A "Comment" or "Additional notes" should be there for each form so the user/member can add information that was not called for in the form.  This could be optional too, selectable by the Admin when the form is created.

F) Color shading would be nice from field area to the next, but totally optional.

G) If the above is done then the user data might have to be stored in the form {Field=}[..................] just incase a new version of the mod want's to handle the data differently, or if the Admin decides to drop this mod.

H) A "Sortable" field would be nice that allows the user/member to sort the filled out forms in various ways.  Have an optional drop down field with field names to be sorted.

I) A way to "Include/Exclude" filter such as "Year" = <> "2009" would be nice for the user/member; optional.

P.S.
Done correctly this mod could easily become #1 for smf and an advanced version sold for $25, flat fee - unlimited web sites, would have me buying it.  Put #H and #I in the advanced version.
Title: Re: Custom Form Mod
Post by: Garou on February 26, 2009, 10:58:50 PM
A) As far as having a select box for choosing which board the form posts to would be easier on the admin then looking up the Board ID and is probably doable. Ill add it to the to do list. Having to choose it from within the board its self rather then the setup page wouldn't really work as one form only posts to one board not multiple boards and is best chosen at the creation of the form. You can edit the form later if you want to change what board the form gets posted in again since it only posts to one board its better to do it from the admin section.

B) Required is one of many parameters you have available and doesn't work with some of the other parameters because they depend on the user input or lack there of and requiring them would defeat the purpose.

QuoteC) Need a Category with a large number forms.
Could you expand on this? I'm not sure what you are asking for here.

D) Templates are not really needed but can be quite useful. I often use them for explaining what the particular form is used for or other additional instructions and information.
This is a screen shot from a demo I'm working up.
(http://www.wolfshaven.com/example_form.jpg) (http://www.wolfshaven.com/example_form.jpg)
The template makes the top part of the form (before the entry fields) possible. It is a useful but complicated feature, none the less it isn't required to create a useful form.

E) You can easily get the same result by making the board read only in the board permissions SMF already uses. The only people that would be able to post anything without the form would be an Admin and any moderators assigned to the board.

As far as comments, a user, if they have access to post in a board (as set up in the board permissions) can modify the post after the fact. Alternatively just add a field when creating the form for "Additional Comments". Ive used this in several forms Ive designed and it works well.

F) Color shading might be possible and Ill look into that.

G) Actually I'm thinking it could be handled with an optional predefined template. It wouldn't have to touch the database at all.

H and I) If forms didn't post inside SMF the sorting feature would be easy but what your talking about would take major retooling of SMF and goes way beyond what this mod was intended for by the author. It might be possible to create a separate page that displays information from the database but rewriting the entire posting structure of SMF? Nah sorry I wouldn't take that one on even if I had the skill to do it and I doubt SMF would allow it anyway.
Title: Re: Custom Form Mod
Post by: Garou on February 26, 2009, 11:16:43 PM
Actually I just re-thought H and I. All this mod is meant to do is create a pre-formatted post based on user response.  It doesn't store the user response in a separate database it just posts it in a normal post. If it did store those responses in a separate database then the responses could be pulled out of the database and displayed and sorted on a separate page. 

To do that would entail a major rewrite and goes beyond the scope of what LHVWB actually intended this mod for. He may be willing to add it in his rewrite but it is beyond what the current code can handle.

Title: Re: Custom Form Mod
Post by: PerryM on February 27, 2009, 12:16:03 AM
I'm just reporting things I'd like to see in a Form Tool.

I haven't programmed for 23 years now so I don't know what would be needed.

I need something like this mod - that's why I'm spending the time with feedback.  I can see where one smf would have 20+ forms for all kinds of things.

The Category would simply allow the Admin to place Forms in places that make sense like "Review Forms" and "User Feedback Forms".  Not needed but nice if you start to get a lot of forms.

I'm only suggesting that the user NOT have access to the post to rearrange it but that a Form is always between them and the post.

Once the data is stored like {Country=} [USA] or [Canada] etc then an external php mod could run thru the posts and build an index to be sorted and filtered.  This would be external to smf and not interfere with smf in any way.

I'm serious every smf installation needs Form input and output of some kind.
Title: Re: Custom Form Mod
Post by: Nathaniel on February 27, 2009, 12:43:24 AM
Okay, I will briefly go through your suggestions, although I really shouldn't be.

#1 2: bugs with SMF 2 RC1. They have nothing to do with this mod.

#3: Bug with this mod.

#4 5 6 7: Yep, the documentation needs some work. I know that, I don't have time to do it. If you have any suggestions to improve it then please make theme, I thought it was better to have documentation written from a coders perspective than none.

#8: Most of these suggestions seem fairly reasonable and are related to making the mod more friendly for non-coding admins. Although some are a little bit subjective and I probably wouldn't implement them.

H and I are never going to happen with this mod, because the mod stores information straight into posts. Please remember that this mod is designed only to submit information from the form as a post, I have never intended it to store information in a separate way, so the only search tool that can be used is the SMF one.

I know this mod has major issues. That is why I intend to completely rewrite it when I find the time.

If it doesn't fulfil your needs then don't use it. If you want a perfectly customizable system then you will have to build your own, or pay someone else to do it. This mod was only ever meant to have fairly simple applications. There is a limit to what you can/should do with general modifications.

Thank you for the feedback. :)
Title: Re: Custom Form Mod
Post by: Garou on February 27, 2009, 01:06:42 AM
QuoteThere is a limit to what you can/should do with general modifications.
Well said. Since I work mostly on other peoples forums I often have site owners asking for things that go way beyond what SMF was ever intended to be used for. I'm going to steal that line. :)

Title: Re: Custom Form Mod
Post by: fasterthanyours on February 27, 2009, 09:13:51 AM
Garou,

I click you link to that guys post about the descriptions of how to add new fields.
http://www.simplemachines.org/community/index.php?topic=248871.msg1633514#msg1633514

I folded it and now my form works great!

Here's my finaly form, baring any complaints from my members that I missed something.
http://www.charlestonreefers.org/forum/index.php?action=form;id=1


I like Perry's suggestion of being able to select from the drop down which forum you want you form to go in.  Since my forum is broken up into distinct areas to organize problems threads and new posts, this drop down would help.

I do have one suggestion of my own.
I have fields like Fish, Invertebrates, and others.  These are the larger text boxes, I'd like to be able to put something in the text box so the person filling out the form has a format to use.
Example: Please list as follows: # Name & Type of Animal, # Name & Type of Animal

Maybe when they click in the text box and start typing that info would disappear.

I've seen that on other forms on other web pages, unrelated to SMF, so I know it's an HTML code to make it happen.
Title: Re: Custom Form Mod
Post by: Garou on February 27, 2009, 10:03:25 AM
Glad it worked for you, that one post helped me out greatly as well. I am unable to see your form, I'm guessing you have guest permissions turned off for the form which is fine and probably best for your board. I'm just glad that you got it working.

I like that one as well. I don't think its hard to find the Board ID but I agree this would make it easier for someone that doesn't have a lot of experience with SMF.

As for your suggestion that might be nice but it still doesn't force the user to follow the suggested format. Id ask them in separate fields like {type1} and {type2} or at least be descriptive in the text field about what you expect them to enter. Like...
Please list as follows: <b># Name & Type of Animal, # Name & Type of Animal</b>
It would show to your your users as...
Please list as follows: # Name & Type of Animal, # Name & Type of Animal
The < b > is the html designation for bold text not unlike the [ b ] BBC code you use in the forum every day. It brings more attention to what you want to see but in the end the users will follow it or not.
Title: Re: Custom Form Mod
Post by: fasterthanyours on February 27, 2009, 10:26:46 AM
oooh ok...I'll try that when I get back home.

You get my PM?

Did you DL my mod?

Here's the output for my form:
OK BELOW IS THE FORM.
I'm still working on how to present it to our members old and new.


****REMOVE THIS SECTION AFTER YOU READ****
Please title your post appropriately enough to briefly describe your problem.
Please complete the form below.
Every answer is not required, but you can see how
some of these items will be key to determining the answer to the question.
Please remove this section before submitting the form.
We will attempt to assist you as fast as possible.

^^^^REMOVE THIS SECTION BEFORE SUBMITTING YOUR POST^^^^

My problem is: {problem}

General Information:
What is the Birth Date of this tank (Month/Year): {month}/{year}
Type (Salt or Fresh): {typetank}
Size of Tank in Gallons: {size}
Lighting Type: {lighting}
- How long do you run your main lights?:a {lightingtime}
- When did you last replace your main light bulbs: {lightingreplace}
What type of water do you use? {typewater}
Feeding schedule: {feeding}

Tank Specs:
Type of filtration: {filtration}
Type of Substrate in Display Tank and AVG depth in Inches:
{substrate}

List any additives you are using:
{additives}

List any other equipment you feel is pertinent to answering your question, i.e. Skimmer, Pump(s):
{other}

Tank Parameters
Temperature: {temp}
Salinity: {salinity}
PH: {ph}
Kh: {kh}
Ammonia: {ammonia}
Nitrates: {nitrates}
Nitrites: {nitrites}
Phosphates: {phos}
Calcium: {calc}

Inhabitant Information:
Please list as follows: # Name & Type of Animal, # Name & Type of Animal

Fish:
{fish}

Vertebrates:
{verts}

Invertebrates:
{inverts}
Title: Re: Custom Form Mod
Post by: fasterthanyours on February 27, 2009, 10:30:50 AM
Oh yeah that bolding thing with the < b > works great.  Don't forget you close statements!!

Oh and on that other link, that would make a good addition to an instructions readme.txt
Title: Re: Custom Form Mod
Post by: Garou on February 27, 2009, 11:20:17 AM
Yes always close your statements, Ive had that problem in the past as well. LOL

I'm working on documentation with complete tutorial now, it will be in my next update.
Title: Re: Custom Form Mod
Post by: fivewinds on March 02, 2009, 06:24:19 AM
This is an awesome mod!! Thank you! Unfortunately, I can't get to customizing it yet. I just tried installing CustomFormMod_v1.3_SMF1.1.x (http://custom.simplemachines.org/mods/index.php?mod=1279)  for SMF 1.1.8 and got the following error:

3.     Execute Modification     ./Sources/ModSettings.php     Test failed


Title: Re: Custom Form Mod
Post by: fasterthanyours on March 02, 2009, 07:56:05 AM
Just means that the thing it's looking for in the ModSettings isn't there.

You could apply the Mod and then manual install the entries in the ModSettings.

The installer on this mod isn't perfect.
Title: Re: Custom Form Mod
Post by: Garou on March 02, 2009, 10:45:44 AM
The problems with installing this or any mod usually isn't the fault of the mod itself. Its usually due to a combination of mods on your forum. If a mod is trying to change a bit of code that another mod has already changed, then the current mod you are installing cant find the original code.

You'll find this happens often in SMF when you apply multiple mods to your site and it is usually easy to work around by editing that bit of code by hand. In my signature you will see a link that explains how to install mods manually. This should help you out.
Title: Re: Custom Form Mod
Post by: Sudhakar Arjunan on March 07, 2009, 07:43:36 PM
Hi i have upgrade our forum from 2.0.beta 4 to 2.0 RC1 .

when i installed it ,

It showed me error - Table 'itacumen_smf20beta3.cf_forms' doesn't exist
File: /home/itacumen/public_html/discuss/Packages/temp/install.php
Line: 45

Note : Earlier i was using the mod on SMF 2.0.beta 4 also.
Title: Re: Custom Form Mod
Post by: Nathaniel on March 07, 2009, 07:52:41 PM
@A.SK,
Its an error with SMF 2 RC1, you can avoid it by making a backup of your ''itacumen_smf20beta3_cf_%' tables, deleting them from your SMF database, installing this mod and then restoring the backup of those tables so that you have the data (you will have to delete the new tables that the mod adds when it installs). Its a very annoying error, but its the fault of SMF 2 RC1 not this mod. :/
Title: Re: Custom Form Mod
Post by: Garou on March 07, 2009, 08:03:08 PM
Yep I went tracking it down the other day to see if there was a better work around, http://dev.simplemachines.org/mantis/view.php?id=2963

Hopefully it gets fixed in the next version of SMF.
Title: Re: Custom Form Mod
Post by: ifwmonster on March 11, 2009, 02:24:57 AM
*Feature Request*
Can you add a hidden field option to the list of input types?

That would be amazing.  I keep finding all sorts of new uses for this mod.

*Feature Request*
Would there also be a way to make it so that it can automagically O:) create a poll with the admin options?

I am using 1.1.8, don't have any plans to switch to 2.*

I look forward to more great things from you guys.
Title: Re: Custom Form Mod
Post by: Garou on March 11, 2009, 08:26:09 AM
Define hidden. I'm not sure what you are trying to achieve.

Title: Re: Custom Form Mod
Post by: ifwmonster on March 11, 2009, 02:34:28 PM
Like a way in inject the username of the user filling out the form into it automatically.

I see that in the template, there is a hidden field with the session ID.  I was playing around with that part last night, but for some reason I can't for the life of me figure out how to template it.

Spent a few hours searching for in-depth docs on it last night, to no avail.  This thread is good though.

Also, I understand that the original coder for this is busy, so I can wait patiently for any upgrades, but I know that may not always be possible.

You guys did some really good work on it.
Title: Re: Custom Form Mod
Post by: zagrom on March 11, 2009, 05:26:58 PM
Is there anyway to get this running on 1.1.8?

if not, then oh well  XD
Title: Re: Custom Form Mod
Post by: Garou on March 11, 2009, 09:55:41 PM
The hidden part you see is part of the submit function that posts the form to the forums, it isn't something that gets displayed. Getting the form to pull grab variables from the user DB for registered users is something that has been talked about in the past but I don't know for sure where we are at on that.

Right now LHVWB is planning to rewrite this entire mod to make it more user friendly and he plans to implement many of the requested features from this thread but I'm not sure which ones. In the meantime I'm working on keeping the existing code up to date with the current versions of SMF and adding some features as I can.

One thing I am working on right now is re-doing the documentation with the hopes that it will be easier to understand. I was trying to get a new feature or two in there but its taken me longer then I thought so Ill probably just release with the new documentation in the next day or so.

As far as template's go, when I finally figured it out I posted one here around page 14/15. That might help you see what can be changed a little better.  If you understand basic html you can do some interesting things with the templates. Just try to stay away from the code that the form actually needs, you can break it quite easily as well.

Zagrom, this mod does run on 1.1.8 as of the last update on the download page,  CustomFormMod_v1.3_SMF1.1.x.zip, it should install fine on most versions of the 1.1.x series. If you are running into problems with installing let me know where its failing and what other mods you have on the site already as its most likely a mod conflict. Most mod conflicts can usually be overcome easily by manually installing the code in those files.
Title: Re: Custom Form Mod
Post by: Garou on March 12, 2009, 09:40:17 AM
Mod has been updated, it includes the fix for the bug with check boxes in IE and new documentation. If there is still something that doesn't make sense, let me know.

Oh I also added an example_form to the custom forms template that brings attention to areas of the the template that can be changed. Essentially everywhere you see "Example of something..." is a place where you can edit stuff and not have to worry to much about messing things up.
Title: Re: Custom Form Mod
Post by: ifwmonster on March 13, 2009, 05:08:11 AM
I will checking this out on my text box within the next 48 hours.  Thank you.

Also, I found another bug.  Some of my forums require the use of the $ symbol, but if it's used, it makes it into a variable and will not display the dollar amount.

Would be great, but I have that will work until another update without rush.  Time produces quality ;-)
Title: Re: Custom Form Mod
Post by: Garou on March 13, 2009, 05:52:09 AM
What would it be required for? Where are you trying to enter it at? You should be able to use it in the text area just fine, the post output, and in your users answers.

You cant use it in the title area but try
&#36;
as its the HTML character code equivalent.



Ugh Ok Ive tested this and confirmed it. Its an issue in html as the form as displayed for the user to fill out is in html. I'm sure there is a tag that can be used to get around this but I don't know it off hand. I have to head to work but Ill do more research to find either a fix or work around when I get home tonight.
Title: Re: Custom Form Mod
Post by: Garou on March 13, 2009, 07:50:47 PM
Ok I think I got it, hope this works for you.

Title: dollar_sign
Text: Please enter the your cash on hand. <span style="float:right">$</span>
Type: Text Box (Float)
Extra Type Parameters:

Form Output: Cash on hand ${dollar_sign}

In the form you will see...
Please enter your cash on hand.              $[              ]

And lets say the user enters 15.27

Then in the forum post it would display as...
Cash on hand  $15.27

That's the best work around I can come up with.
Title: Re: Custom Form Mod
Post by: GinaD on March 14, 2009, 12:36:34 PM
OK, I have installed this and added a form but it's not showing on the Custom Forms page or in the forum I used for it?  Where did I go wrong?  Thanks in advance for any help!
*Hugs,
Gina
Title: Re: Custom Form Mod
Post by: Garou on March 14, 2009, 09:06:44 PM
The first thing that comes to mind is did you set a valid Board ID in the form? That's generally the reason nothing shows up on the form page. Also it will only show up for groups that you set the permissions for in the forms settings page but as admin you should be able to see it there at the very least.

As for it showing in the forum, nothing should show other then the actual posts from the form after its been filled out.

The other thing that comes to mind, did you try to modify the CustomForm.template.php. If something is wrong in there it might cause issues as well.
Title: Re: Custom Form Mod
Post by: Tinny on March 21, 2009, 09:33:28 AM
Hi ... I would like to say a HUGE thank you for mod

*post edited as I fixed the problem I was having .... my fault lol*
Title: Re: Custom Form Mod
Post by: pinoypetfinder on March 24, 2009, 11:22:08 PM
hi. does anyone here have a version for 1.1.7? cuz i'm still on it....
we have a classified ad board and i think this will be perfect for it.
Title: Re: Custom Form Mod
Post by: qubbah on March 25, 2009, 01:06:27 AM
when i sett the board can be see only for mod, after filling up the form how can i sett the user not go directly to the board. Because i sett the board is limited to them. I make this because their information is secret for another members.

How can i redirect them after fill up the forum index?
Title: Re: Custom Form Mod
Post by: qubbah on March 25, 2009, 02:08:36 AM
can user can uplod their image in form?
Title: Re: Custom Form Mod
Post by: Garou on March 25, 2009, 08:32:18 AM
pinoypetfinder, Try using the 1.1.8 version. It should work just fine on 1.1.7

qubbah, redirecting to somewhere other then the board that is posted to, is something that is planed in the future. For now, no you cant redirect someplace else.

Also the mod does not support attachments at this time. Its being looked into but right now I cant make any promises. The best I can recommend is that you have your users host their image someplace else and then they can enter the link in form.

To display thier link as an image...
use the parse_bbc parameter in the Extra Type Parameters

Title: image_link
Text: Enter the url for your image here.
Type: Text Box (String)
Extra Type Parameters: parse_bbc

Then in your forum output wherever you put
[img]{image_link}[/img]
The users image will actually display.
Title: Re: Custom Form Mod
Post by: jsanglier on March 25, 2009, 10:36:52 AM
ah, my question answered before I ask! hehe

Yes, it would be nice to redirect somewhere else - a simple thank you page.

I am using this for my members to submit articles to the staff, and also things like messages to the team and so on. These are boards only viewable by the staff, so the members being redirected there, and getting an error is a bit of a shame.

I wait with baited breath!
Title: Re: Custom Form Mod
Post by: pinoypetfinder on March 25, 2009, 07:02:54 PM
thanks Garou, will try to install it and let you know what happens :)
Title: Re: Custom Form Mod
Post by: digit on March 27, 2009, 08:54:55 AM
Sorry to vent, but I am getting REAL frustrated.  I have installed and uninstalled a few times...  the tables are there....  I am getting no link under modifications...

http://www.mysite.com/index.php?action=admin;area=modsettings

And in my error log I am getting....8: Undefined index: CustomForm_tabheader

In my Admin.php, I DO have.... 

   loadLanguage('Admin');
   loadTemplate('Admin', 'admin');
   loadLanguage('Modifications');
   

and in my Modifications.english.php

I DO have....

$txt['CustomForm_tabheader'] = 'Custom Forms';

Thanks in advance...  trying to install on SMF 2.0 RC1


Title: Re: Custom Form Mod
Post by: Garou on March 27, 2009, 01:02:14 PM
I just installed the 2.x version on a fresh install of the RC and it works fine.

Can you go directly to your forums "?action=admin;area=modsettings;sa=customform"?
That's the settings page for the mod.

Ill attach images to show you what the tabs should look like.
Title: Re: Custom Form Mod
Post by: twon on March 27, 2009, 05:52:19 PM
I have a question

I am using SMF 1.1.8 and Joomla 1.5.9
I have SMF linked inside Joomla using a module called Jfusion
I have successfully installed the mod and got it to work but i can only get it to work when i am looking directly at the forums not  when looking at it through Jfusion?
I basically cant pull it up cause there is no link..or the link doesnt pull up the page

any thoughts?
thanks
Title: Re: Custom Form Mod
Post by: Garou on March 27, 2009, 06:44:39 PM
I really have no clue when it comes to Mambo/Joomla related stuff. I played with it for a week or so a couple of years ago and wasn't impressed by it so I deleted everything I had. Not to mention that bridging SMF with them has always been a bit buggy.

The only real restriction in the mod is group permissions, so if the rest of the forum is passed through then the mod should pass as well, theoretically anyway.

No offense but you might have better luck with the Joomla boards here on SMF or in the Joomla community. This is beyond my knowledge base and I just don't really have time to experiment with something that's outside of SMF.
Title: Re: Custom Form Mod
Post by: digit on March 28, 2009, 10:43:29 AM
Quote from: Garou on March 27, 2009, 01:02:14 PM
I just installed the 2.x version on a fresh install of the RC and it works fine.

Can you go directly to your forums "?action=admin;area=modsettings;sa=customform"?
That's the settings page for the mod.

Ill attach images to show you what the tabs should look like.

Thanks...  Yeah, I do get a page - but with no text - as if the language file isn't being read.

I also can't create new forms.  I hit save but nothing happens.




Title: Re: Custom Form Mod
Post by: Garou on March 28, 2009, 09:27:45 PM
Your using a custom theme then? You'll have to copy the language files into that theme manually. Check the package parser http://custom.simplemachines.org/mods/index.php?action=parse;mod=1279;attach=89986;smf_version=2.0_RC1 and copy the code for ./Themes/default/languages into your theme.

Note: if you don't have the utf8 language files just ignore those but Help.english.php and Modifications.english.php are required.
Title: Re: Custom Form Mod
Post by: digit on March 29, 2009, 05:44:06 AM
Well, I am using a 2.0 theme.....  Airy_Midnight....  Somehow it references the default theme...  I am not used to that either!

It uses an theme_info.xml file that contains....

<?xml version="1.0"?>
<theme-info xmlns="http://www.simplemachines.org/xml/theme-info" xmlns:smf="http://www.simplemachines.org/">
<!-- Theme name, used purely for aesthetics. -->
<name>Airy_Midnight</name>
<!-- Author: your email address or contact information.  The name attribute is optional. -->
<author name="Crip">[email protected]</author>
<!-- Website... where to get updates and more information. -->
<website>http://www.simplemachines.org/</website>
<!-- Template layers to use, defaults to "main". -->
<layers>html,body</layers>
<!-- Templates to load on startup.  Default is "index". -->
<templates>index</templates>
<!-- Base this theme off another?  Default is blank, or no.  It could be "default". -->
<based-on>default</based-on>
<id>crip:airymidnight</id>
</theme-info>


As you can see, I have default listed, and that s where I have my language strings...  but they are not showing up.

Thanks in advance f you can help.
Title: Re: Custom Form Mod
Post by: digit on March 29, 2009, 10:57:13 AM
Ok, so this IS some sort of a theme issue - if I reset it to the default theme, it works fine.  HMM.  Does someone know if there are issues with themes that use this schema? (an xml file referencing another theme)

Title: Re: Custom Form Mod
Post by: helphook on March 29, 2009, 02:04:11 PM
THANK YOU SO SO MUCH FOR THIS MOD!

Everyone who's thinking about using this don't be mislead by some of the posts in here, this program is very easy to use, I had no problems using it all

Given that certain versions other than mine may run into issues it works brillianty on 1.1.18

I've only been using smf for 2 days and i have no type of php expierence

you can code the entire thing in bbc too s you wouldn't even need to know html

2 thumbs up
Title: Re: Custom Form Mod
Post by: perro88 on March 30, 2009, 06:47:14 AM
Something that could be cool in the mod is a option(when the form is created) that would do something like this:
In that Board, when someone try to make a topic he will be redirected to the contact form instead of the normal post form. this could be great for support boards etc, making it easy for admins and users. regards nice mod.
Title: Re: Custom Form Mod
Post by: Garou on March 30, 2009, 09:31:00 AM
digit, Ill have to get a copy of the theme and see if I cant figure something out for you. I got the day off from work tomorrow and Ill take a look at it then. You might also want to try asking Crip since its his theme. Hes a pretty good guy and very helpful.

The code you posted should not effect anything other then the theme settings, and install pages as its just info about the theme. It shouldn't actually do anything about how the theme displays.

perro88, Ive thought of that and had a look at new topic code that SMF uses. I'm not going to say that its impossible as Ive seen other authors accomplish things Ive thought impossible before.

I will say that right now its beyond my grasp of coding. The few attempts I made at this either breaks the forum all together or forces the new topic for every board to go to the form, in which case all posts go to the board that the form is set to. Not good. ;)

The two suggestions I have are to either have a sticky post at the top of the board or if your using 2.0, create a child board that will redirect to the form. There is a mod for 1.1.x that does this as well but I haven't tried it.
Title: Re: Custom Form Mod
Post by: perro88 on March 30, 2009, 12:26:10 PM
Quote from: Garou on March 30, 2009, 09:31:00 AM
digit, Ill have to get a copy of the theme and see if I cant figure something out for you. I got the day off from work tomorrow and Ill take a look at it then. You might also want to try asking Crip since its his theme. Hes a pretty good guy and very helpful.

The code you posted should not effect anything other then the theme settings, and install pages as its just info about the theme. It shouldn't actually do anything about how the theme displays.

perro88, Ive thought of that and had a look at new topic code that SMF uses. I'm not going to say that its impossible as Ive seen other authors accomplish things Ive thought impossible before.

I will say that right now its beyond my grasp of coding. The few attempts I made at this either breaks the forum all together or forces the new topic for every board to go to the form, in which case all posts go to the board that the form is set to. Not good. ;)

The two suggestions I have are to either have a sticky post at the top of the board or if your using 2.0, create a child board that will redirect to the form. There is a mod for 1.1.x that does this as well but I haven't tried it.
Thnks for the fast feedback and suggestions. I'll give it a try ;)
Title: Re: Custom Form Mod
Post by: helphook on March 30, 2009, 01:40:45 PM
1 suggestion I have that I think would be cool for this

is after the person is done filling out the form instead of it only going to the forum where the post is made maybe give an option to make a custom page that it goes to that says something like thanks for filling out your application or w/e

just an idea, program is great
Title: Re: Custom Form Mod
Post by: C4G-TK on March 30, 2009, 05:45:48 PM
Is there a way to pull the forum name into the Subject line and bypass making a field that the person fills out?

I was trying to do this and obviously don't have the right code if it is possible.  I tried [UserName] and others.

I was trying to bypass someone being funny and typing in something else other than their name for this one thing.
Title: Re: Custom Form Mod
Post by: Garou on March 31, 2009, 02:42:48 AM
digit, Ive installed the airy_midnight20rc theme on my test site and the only thing I had to do to make it work was to drop the CustomForm.template.php in Themes/airy_midnight20rc folder. You can copy that from the Themes/default or from the zip file. If your still having issues let me know.

helphook, that feature has been suggested and is being looked into.

C4G-TK, that feature has been suggested and is being looked into. On the upside if the user is logged in, the form will post as the user anyway. So even if they put something else in there you'll know who they really are. :)
Title: Re: Custom Form Mod
Post by: zushiba on April 03, 2009, 01:38:32 PM
So I assume this simply doesn't work for 1.1.8? I've installed it and the admin side everything seems to work fine but index.php?action=forms does nothing.
Title: Re: Custom Form Mod
Post by: Ramón Cutanda on April 04, 2009, 09:20:35 AM
Just wanted to say a BIG THANKS

It's been extremely useful for me.
Title: Re: Custom Form Mod
Post by: Garou on April 04, 2009, 09:46:32 AM
zushiba, have you created a form in the admin section? If you haven't then there is nothing to show in index.php?action=forms
Title: Select Box to Radio
Post by: mang on April 05, 2009, 01:11:44 AM
I didn't see this anywhere, so I apologize if this already exists.  Here's a short snippet of code to change the select box into a series of radio buttons using a custom form

1.  Copy and past the example function as it is described in CustomForm.template.php
2. In your custom function, find:

Code () Select
// Show a selection box?

elseif ($field_data['type'] == 'selectbox')

{

echo '

<select name="', $field_name, '">';

foreach ($field_data['data'] as $option)

echo '

<option value="', $option, '"', ($option == $field_data['value'] ? ' selected="selected"' : ''), '>', $option, '</option>';

echo '

</select>';

}


Replace with
// Show a selection box?

elseif ($field_data['type'] == 'selectbox')

{

foreach ($field_data['data'] as $option)

echo '

<input type="radio" name="', $field_name, '" value="', $option , '">', $option , '<BR>';
}


Now whenever you use a select box it appears as radio buttons.  This will change all select boxes on your form to radio buttons.  See the attached image for before/after. 

Title: Re: Custom Form Mod
Post by: Marduke on April 05, 2009, 02:06:31 AM
Awesome mod.

Only question I have is if there is any way to choose the message icon for the threads made using a custom form.  You can choose everything for the thread except the message icon, for some reason.

Would help a ton!

Thanks in advance!
Title: Re: Custom Form Mod
Post by: Garou on April 05, 2009, 07:37:13 AM
mang, You rock, that has been asked for in the past but hasn't been put in. When I came to the team my first goal was to get it working on the newer versions of SMF on install then I updated the wording in some of the help files. Ill pop that the in my next release as an alternative to the select boxes rather then replacing them. I always love it when someone not only makes a request but also provides the answers. ;)

Marduke, I want to get that in my next release as well. Updating the mod went fairly quickly. Adding the newer features Ive always wanted for this mod including the msg icons isn't going as fast as Id like. If SMF doesn't update or LHVWB doesn't do his rewrite done before me, it will be in my next release. :)

Title: Re: Custom Form Mod
Post by: zushiba on April 07, 2009, 01:12:58 PM
Quote from: Garou on April 04, 2009, 09:46:32 AM
zushiba, have you created a form in the admin section? If you haven't then there is nothing to show in index.php?action=forms
Yes I have created a form and there's still nothing shown. Well to be exact all it shows is the standard forum index. http://www.irtguild.net/forums/index.php?action=forms

EDIT: I am using a custom theme and have copied the CustomForm.template.php to the theme directory.
Title: Re: Custom Form Mod
Post by: Garou on April 09, 2009, 11:26:43 AM
Did you update the language files for the theme. Manual install instructions are at http://custom.simplemachines.org/mods/index.php?action=parse;mod=1279;attach=89987;smf_version=1.1.8

Everything listed as Themes/default/ needs to be copied to the appropriate files in the custom theme. You can ignore the utf changes if you're not using it on your server. If the language files aren't in there at all copy them over from the default theme. Theoretically if a file isn't in a theme then SMF should read the data from the default theme. In the past Ive run into issues with other mods and themes, where making sure the files are in the theme often will fix theme problems.

Also go into your profile and switch to the default theme and see if everything works right there. If not compare the rest of the files to the manual instructions and make sure everything is there.

Also I just tested this mod on a fresh install of 1.1.8 again and it installs and runs fine out of the box, on the default theme. So either it didn't install right on your server for some reason or its having conflicts with other mods or the theme itself.

Lastly as it just comes to mind... Do you have the Board ID set to a valid board. If the form doesn't have a valid board set then it will not show up either.
Title: Re: Custom Form Mod
Post by: Baldur on April 09, 2009, 07:16:20 PM
Fantastic MOD, not too tough to work into my custom theme.

But I am having an issue I can't seem to resolve on my own.  I have a custom form made, all of the fields are set up correctly, but when I enter the information into the form fields (most are set to Text Box(String), some are multi-lined) and submit the form, only the information entered in the "Forum Output:" section shows up in the post.

I have it set so a guest could come to my forum and fill out an application to join my guild.

See link: http://www.knightswhosayniguild.com/index.php?action=form

Any help would be great, thanks!
Title: Re: Custom Form Mod
Post by: Garou on April 10, 2009, 12:16:16 AM
You have to format the Form Output how ever you want it to be seen in the forum post.

Lets try this...
We will say your guild is on the Emerald Dream server.

So your filed for the form would look like this...
Title: character_name
Text: What is the name of the character you would like to join the guild with?
Type: Text Box (String)
Extra Type Parameters: required


Now in the Form Output you would enter...
[b]Character Name:[/b] [url=http://www.wowarmory.com/character-sheet.xml?r=Emerald+Dream&n={character_name}]{character_name}[/url]

The post in your forum would look like...
Character Name: character_name (http://www.wowarmory.com/character-sheet.xml?r=Emerald+Dream&n=character_name)

The above not only shows the data the user entered in the field but also links to that characters armory profile.

The code above is what we use on the application for one of the guild sites I work with. :)


Title: Re: Custom Form Mod
Post by: fivewinds on April 12, 2009, 10:31:12 PM
SMF 1.1.8

First of all, when I originally posted to this thread, I was told to try the manual install. It took some time, but it went well. Unfortunately, I had to recover my forum from some hackers and met with the same Modification file error again. I tried the manual install, like before, but I think I screwed up somewhere, but am not sure where. ^^; Here's the current errors I'm seeing under the Features and Options menu. Any thoughts? No idea where those letters are coming from.

Also, I cant locate the form articles. There was one that was made prior, which was still there after the package was reinstalled, but while I can edit it, I can't locate the article itself.

(http://i44.tinypic.com/2j42etw.png)

Title: Re: Custom Form Mod
Post by: Garou on April 13, 2009, 08:28:23 AM
I'm not sure whats causing that either, my guess is that you are missing language strings for some other mod.

As for the articles, I'm confused the Custom Form Mod doesn't use articles. You create a form that when your users fill it out the form information is converted to a post in the forum.
Title: Re: Custom Form Mod
Post by: zushiba on April 13, 2009, 01:20:29 PM
Quote from: Garou on April 09, 2009, 11:26:43 AM
Did you update the language files for the theme. Manual install instructions are at http://custom.simplemachines.org/mods/index.php?action=parse;mod=1279;attach=89987;smf_version=1.1.8

Everything listed as Themes/default/ needs to be copied to the appropriate files in the custom theme. You can ignore the utf changes if you're not using it on your server. If the language files aren't in there at all copy them over from the default theme. Theoretically if a file isn't in a theme then SMF should read the data from the default theme. In the past Ive run into issues with other mods and themes, where making sure the files are in the theme often will fix theme problems.

Also go into your profile and switch to the default theme and see if everything works right there. If not compare the rest of the files to the manual instructions and make sure everything is there.

Also I just tested this mod on a fresh install of 1.1.8 again and it installs and runs fine out of the box, on the default theme. So either it didn't install right on your server for some reason or its having conflicts with other mods or the theme itself.

Lastly as it just comes to mind... Do you have the Board ID set to a valid board. If the form doesn't have a valid board set then it will not show up either.
I switched to the default theme and that seems to work. The form itself shows up when not logged in if I link directly too it using my boards custom layout.
Now here's the million dollar question. Is there a way to allow guests to submit a form that goes to a hidden forum that only allows for admins/high level members access?

What I'm hopeing to use this for is a Guild Application form. I don't want other members of the guild to see the forum itself because we don't need the entire guilds input on who to allow in but we do need guests to be able to submit the form. 
Title: Re: Custom Form Mod
Post by: Garou on April 13, 2009, 09:19:33 PM
Yep the form permissions are separate from the board permissions. Just allow guests for the form and then in the board your posting the form to make sure guest isn't checked in the permissions for that board. Right now the one down side is that if the person filling out a form doesn't have permission to the board then they will see the "you don't have permission to enter this board" error. That will be fixed in an upcoming release.

In the mean time just post something about that either in a custom template or in a forum post that the guests can see just so the can expect that is going to happen.
Title: Re: Custom Form Mod
Post by: uni on April 15, 2009, 01:11:21 PM
After creating the whole form, and submitting the content does not show in the actual post, why?

Don't know if it has anything to do with it, but although the form itself is there, the output is gone every time I save it.

http://i44.tinypic.com/2qjyhhu.jpg
http://i39.tinypic.com/w1zi9t.jpg


Thanks in advance.
Title: Re: Custom Form Mod
Post by: C4G-TK on April 16, 2009, 12:28:11 AM
Quote from: uni on April 15, 2009, 01:11:21 PM
After creating the whole form, and submitting the content does not show in the actual post, why?

Don't know if it has anything to do with it, but although the form itself is there, the output is gone every time I save it.

http://i44.tinypic.com/2qjyhhu.jpg
http://i39.tinypic.com/w1zi9t.jpg


Thanks in advance.

Are you using the WYSIWYG as your default editor?  If you are, before you hit save, click the "A" button to go back to the default editor and then hit save.  I had this problem back when I first tried the mod for another forum that I have.  I discovered that you needed to be out of the WYSIWYG editor.   The problem was discussed earlier in this thread.  Anyway, it was just a conflict with the editor.  Try it and see if that helps you out.
Title: Re: Custom Form Mod
Post by: uni on April 17, 2009, 07:51:48 AM
I guess the posts were lost, the above problem is gone. I tried creating a new form but now it just displays the name fields instead of the actual content.
Title: Re: Custom Form Mod
Post by: C4G-TK on April 17, 2009, 11:06:46 AM
I think they lost some posts yesterday on the site here when they were changing servers or something.  I couldn't log onto the site for awhile and noticed that. 
Title: Re: Custom Form Mod
Post by: n3ith on April 17, 2009, 07:30:06 PM
I love this mod. I do need some help though. I figured everything out- I think.

I can pull up a test form here:
http://www.noxxious.com/index.php?action=form

The form works as far as I know. It just doesnt post in the 1.0 board. Is this because I have a custom template?

Anything you can do to make this work for me? I did read most of this board, so I apologize if I skipped over the answer and it was right in front of my face... :(
Title: Re: Custom Form Mod
Post by: C4G-TK on April 18, 2009, 01:55:10 AM
Did you perform any manual edits in your custom theme?  You need to do manual edits for anything listed in the install instructions under the >themes>default files in your custom theme.  If your custom theme does not have a file, it should pull from the default file automatically, but if it does have one of the files, the edits will need to be performed.
Title: Re: Custom Form Mod
Post by: simpsonetti on April 21, 2009, 05:21:10 AM
Hi, is there a manual out ?
i installed customform and i can create forms an i set up to show the form in forum with ID=42. but where is it ?

Title: Re: Custom Form Mod
Post by: alfzer0 on April 22, 2009, 01:16:22 AM
This mod is EXCELLENT!!!  As is the continued support.

I haven't read through the entire thread, so excuse me if this has been mentioned before, but it would be great to have some syntax to choose how the fields are output based on their value.

ie:
if {field1} = 'value1' then ([b]{value1}[/b]) else ({value1})
could also have <>, <, >, and like comparisons.

Though that may be too complex for this mod, but at least checking to see if the value is blank or not would be quite beneficial...which I'm going to try editing the code to do.  I'm imagining a decent syntax of the output fields (message and topic) would be...

{[text]{fieldname}[text]} where [text] is only output if the value of {fieldname} is not blank.  As an example of how this is benefical, here is what I'm trying to acheive...

*{date} = 4/21/2009
*{loc} = Somewhere, USA
{event} =
*{artist} = Richard Devine
*=required

Currently I've got...
{date} | {location} | {event} | {artist}
...which outputs "4/21/2009 | Somewhere, USA |  | Richard Devine"

But would like to do...
{date} | {loc}{ | {event}} | {artist}
...which would output "4/21/2009 | Somewhere, USA | Richard Devine"

Haven't taken a look at the code yet, but I think I should be able to pull this off.  If any devs familiar with the code know that this will not work without a major rewrite please let me know so I don't waste me time  ;)

Thanks,
-Jeff
Title: Re: Custom Form Mod
Post by: Garou on April 22, 2009, 07:22:04 AM
simpsonetti, There is documentation through out the mod click on the [?] next to the various functions for help about the function.

That said the form itself is not in the forum board, once the form is filled out it will make a post in that board. The form will be found at yoursite.com/forum/index.php?action=form

alfzer0, the mod does not have any type of if/then functions at this time. As it stands, if a user fails to answer a question then the post basically indicates that the field was not filled out.

It will either leave that section blank in the form you can use a default string in the Extra Type Parameters such as "default=Unknown" and then it will say Unknown for that entry in the post or you can simply require  that the user fill it out.

Title: Re: Custom Form Mod
Post by: alfzer0 on April 22, 2009, 08:57:11 AM
^ right, i realize that, it was a feature request and noting that I was going to try it on my own, of which I've gotten pretty far.

Only problem I have left I think is that this is cutting off brackets from the start/end of the entire subject and output fields instead of just the matched regex

The relevant code...

$vars3[] = '/\{[^\{]*\{'.$field['title'].'\}[^\}]*\}/';

$output = preg_replace_callback($vars3, create_function('$matches','return trim($matches[0],"{}");'), $output);
$subject = preg_replace_callback($vars3, create_function('$matches','return trim($matches[0],"{}");'), $subject);


input
{date} | {loc}{ | {event}} | {artist}
output
date} | {loc} | {event} | {artist
desired output
{date} | {loc} | {event} | {artist}

If you have an idea off the top of your head let me know, else I'll probably be able to figure it out after work today.

And thanks again for your efforts!
Title: Re: Custom Form Mod
Post by: Wihl on April 26, 2009, 12:15:14 AM
I'd like a way to make a selection box that changes depending on a different selection box - so...

Selection box 1 has 3 options: X Y Z

User Selects X in Selection Box 1

Selection Box 2 shows options A B C

---------------------------------------------------

Selection box 1 has 3 options: X Y Z

User Selects Y in Selection Box 1

Selection Box 2 shows options D E F

Is this already possible or could it be put in?
Title: Re: Custom Form Mod
Post by: Garou on April 26, 2009, 08:34:41 PM
That has been requested a few times and no its not possible at the moment. The best thing I can suggest is just having your your users enter the info in a text box.

With the current code we are using it really inst possible to add in without totally redesigning the mod.  LHVWB does plan to rewrite the entire mod at some point in the future when he has the time. Whether or not that feature will make it in or if it will be possible to add in after, I cant say, nor do I know exactly when that might happen.

In the mean time I'm currently keeping the mod up to date with the current versions of SMF and adding small features as I have the time and knowledge to implement them.

Title: Re: Custom Form Mod
Post by: bsoren72 on April 27, 2009, 12:35:33 PM
Hi Everyone,

I'm new to some of this stuff (ended my computer science degree at CPM and Pascal) LOL!

Anyway, I did a manual install of the custom form mod -

Im running 1.1.8 with the Babylon theme, but went back to the default just in case - no difference.
Im getting the following error when I click on the Custom Form drop down in "Features and Settings"

Fatal error: Call to undefined function template_show_list() in /home/content/n/j/o/njoeadmin/html/forums/Sources/Load.php(1747) : eval()'d code on line 307


Any help would be GREATLY appreciated as I'm REALLY dusty at this sorta thing. Took me 2 days to figure out how to run the cust_forms and cust_tables query's.

Bryan J. Sorensen
www.oedivers.com
Title: Re: Custom Form Mod
Post by: Garou on April 27, 2009, 09:46:33 PM
Not sure why you did a manual install but you must have copied something wrong. Most likely you are missing a close statement someplace but since this mod doesn't use the Load.php Im not sure where you might have messed up at.

Hopefully you backed up your site before installing the mod. I highly recommend doing so before installing any mod, that makes it easier to roll back if something does go wrong. If not you will have to try and reverse the code manually as well.

Unless you are running into errors during install I don't suggest installing mods by hand. Note that most install errors are caused by multiple mods having to install something on the same line. The first one changes it and then any other mod installed after, that needs to change the line cant find it.

The best thing is to make a note of what files are the errors say they are on and then click on install anyway. Then you go looking in those files to see what parts didn't install.  Then install those by hand, sometimes it may take a little tweaking depending on what the other mod(s) have changed.

The other thing is that you may need to manually install parts of a mod on a custom theme. In your case for this mod you will want to look at http://custom.simplemachines.org/mods/index.php?action=parse;mod=1279;attach=89987;smf_version=1.1.8 then look for any files that start with ./Themes/default/...something... and only change those files in your custom theme.

For the Custom Form Mod in ./Themes/default/ you have the language files, if they don't exist in your theme usually you don't have to worry adding them as SMF should read from the files in the default directory. If you do happen to run into errors with a mod, sometimes copying the files that don't exist over from the default theme to your custom theme will fix it.

All that said...
On a fresh install of 1.1.8 I was able to get the mod to install using the package manager without problems. Then to get it to work on the Babylon theme, the only thing I had to do was copy the CustomForm.template.php (from either the default theme or from the zip file) to the Babylon themes directory and everything works fine.

Good luck and if your still having problems let me know. :)
Title: Re: Custom Form Mod
Post by: bsoren72 on April 28, 2009, 02:25:15 AM
Restored the forums to it's previous state - the package installed fine this time - was able to make a custom form okay and it shows under the features menu - it's there and linked to a valid board now.

Everything seems to be working fine now.......thanks much. I DID eventually find the answer to what the original error was caused by - corrupted CustomForm.php and CustomForm.template.php   But I'm much happier going back to the default theme anyway - eveything seems to work smoother and look cleaner.

Thanks for all the help.
Title: Re: Custom Form Mod
Post by: Garou on April 28, 2009, 05:56:30 AM
Glad it worked for you.

I happen to be a big fan of custom themes, sure sometimes it takes a little more work adding mods to them but you can make your site look really interesting with the right theme. :)
Title: Re: Custom Form Mod
Post by: njtat2dguy on April 28, 2009, 10:43:16 PM
I have a weird question and I did not see anything mentioned in this thread about it and I am not sure if this is even the right place to ask, but here goes.

I have this mod installed on smf v1.8 works flawlessly and I love it. However, I want to do a little trick, I want when my users go into board id 3 (which is where the forms and sent to) when they click 'new thread' I want it to take them to my form, instead of a standard post. How would I go about making this happen? Not sure where to even start..

Anyone want to point me in the right direction on this?
Title: Re: Custom Form Mod
Post by: Garou on April 29, 2009, 07:29:55 AM
I cant remember if it was here or at another site I work on but when I looked into that I didn't see a way to do it without heavily modifying the way SMF posts in general. The best recommendation I can make is to put a sticky post in the board with a link to the form.
Title: Re: Custom Form Mod
Post by: tonnybarros on April 30, 2009, 09:17:58 AM
Staff as I do for that person to click again typical is already redirected to the form?
Title: Re: Custom Form Mod
Post by: Garou on April 30, 2009, 10:55:05 AM
I'm sorry I don't understand what you are asking.
Title: Re: Custom Form Mod
Post by: tonnybarros on April 30, 2009, 11:54:16 AM
Let it go, my friend as I do to make fields mandatory, but without knowing what will be written?

I am from Brazil and I'm using Google to translate, sorry if not out right.
Title: Re: Custom Form Mod
Post by: willerby on May 03, 2009, 07:30:02 PM
Excellent mod working great straight from install in RC1.


Parse error in Admin.php for SimplePortal users (as selected text is interrupted / changed by this mod)  could easily be resolved for future releases making smoother installs through the package manager. Manual edit easy enough though.

One question...

I have set up a form which a Guest can submit but it will appear on a board only Admins can see. Testing results in Guest hitting an error message when he submits form because mod is trying to link to the post created to show the guest but (of course) he has no permission to see it.

Is there any way to modify code to send all form submissions to a custom page thanking them for their submission rather than to the post itself? I can set up the page just need to know how to change the appropriate custom forms php file to link to my page instead of the new post...

Great mod

W
Title: Re: Custom Form Mod
Post by: C4G-TK on May 03, 2009, 07:49:20 PM
I think this was asked previously if I'm not mistaken and it was something to be considered when a newer version was updated.

It would definitely be a nice feature so members don't try to resubmit ten times per form because they think it didn't work.
Title: Re: Custom Form Mod
Post by: Garou on May 04, 2009, 12:02:06 PM
I'm hoping to get it in the next update a long with a couple of other features. Ive just hit a couple of roadblocks that I'm sure are part of my lack of knowledge, which means I can learn more to get past that.  :)
Title: Re: Custom Form Mod
Post by: Sudhakar Arjunan on May 04, 2009, 12:23:42 PM
Hi author,

After installing custom form mod.

I have got memberName errors on register page.

Is there anything to work with this mod.
Title: Re: Custom Form Mod
Post by: Garou on May 04, 2009, 10:53:25 PM
This mod shouldn't have anything to do the register page but it could be conflicting with another mod.

Can you paste the exact error? Did you install manually or use the package installer? What other mods are you running?
Title: Re: Custom Form Mod
Post by: Sudhakar Arjunan on May 05, 2009, 01:50:53 PM
Any update to my query.
Title: Re: Custom Form Mod
Post by: suicidehamster on May 05, 2009, 02:25:37 PM
Hi, hope someone can help.

I've just installed the custom form mod, but have encountered a problem with the large text box. Any text entered into the box is not transferring to the new forum post, but other fields transfer ok.

For testing, I've set the box as required, but it doesn't recognise any text being entered, thus, it won't submit.

The mod (v1.1) is running on smf 1.1.8

Thanks
Title: Re: Custom Form Mod
Post by: allisondk on May 05, 2009, 08:35:15 PM
awesome...just this tiny problem...when a user post the form, they will face this message:
You do not have permission bla bla..well not exactly that....
Anyways i´ve read something about this in a feature release...i´ve now went through 27 (well i might have went through the last ones too fast) pages of reply´s
Is this done? can i edit something myself?

Thanks
Title: Re: Custom Form Mod
Post by: Garou on May 06, 2009, 07:20:07 AM
A.SK, I asked you what other mods you were running. This mod doesn't touch the registry so it shouldn't be cause the problem you are having.

suicidehamster, Ill have to check on that one after I get home tonight, Ive never encountered that particular problem. Have you altered the custom form template in any way?

allisondk, I haven't released a new version as I'm having other problems but Ill see if I cant come up sort of fix this evening, that you can put in by hand.
Title: Re: Custom Form Mod
Post by: mattchewone on May 06, 2009, 12:10:59 PM
I am getting this error message on installation

   3.   Execute Modification   ./Sources/Admin.php   Test failed
   1.   Add After   ./Sources/Admin.php   Test successful
   2.   Add After   ./Sources/Admin.php   Test failed
Title: Re: Custom Form Mod
Post by: allisondk on May 06, 2009, 06:01:38 PM
Garou> that would be awesome. Or at least if i could edit the text myself somewhere.... not that skilled in php though
Title: Re: Custom Form Mod
Post by: Garou on May 06, 2009, 10:12:25 PM
This is a quick and dirty fix for people that have forms posting to boards that the user can not access. When a user completes a form this will redirect them to the forum rather then the post that is made.

./Sources/CustomForm.php
Find...
// Redirect this user as well.
redirectexit('board=' . $board . '.0');


Replace With...
// Redirect this user as well.
redirectexit();


Note that this will effect all forms, hopefully in an upcoming version you will be able to chose where a particular form redirects.

mattchewone, most likely you have other mods installed that already changed the code that this mod is looking for. This happens a lot when installing multiple mods. Refer to the package parser on the download page for this mod to install the mod manually.  You might also want to check out the link in my sig referring to Manual installation of mods.

suicidehamster, I have been able to confirm this bug but I haven't found a fix for it yet. Soon as I figure it out Ill post here. In the meantime I suggest that you don't use the required parameter for multiline text boxes. Sorry I dont have a better answer yet.
Title: Re: Custom Form Mod
Post by: willerby on May 07, 2009, 10:00:31 AM
Thanks Garou.

What is the redirectexit() to forward to a custom page where the full url is http://www.xxxxx/forum/index.php?action=page;sa=xxx ?

Thanks

W
Title: Re: Custom Form Mod
Post by: mattchewone on May 07, 2009, 10:09:13 AM
I installed it fine on my main site but i couldn't seem to get it to work, well not how i thought it was going to work.

I thought that you would create a form template for a specific board. The user clicks on the board and clicks new topic and then in order to post they need to use the form. That is how  i thought or would like it to work.

I have a review section and i would like all posts to be structured and in order to that a form would be fantastic. But it would need to be done in the way that when the user clicks create a topic it gives them the form to fill out. It then posts it as structured into that board. Users can still leave replies as usual.
Title: Re: Custom Form Mod
Post by: allisondk on May 07, 2009, 10:41:20 AM
Thx Garou...
SUPER  ;D works like a charm.

Anyway i can get the "Large (Multiline) Text Box" to have scroll, or make it even bigger?
Title: Re: Custom Form Mod
Post by: willerby on May 07, 2009, 01:33:19 PM
Quote from: willerby on May 07, 2009, 10:00:31 AM
Thanks Garou.

What is the redirectexit() to forward to a custom page where the full url is http://www.xxxxx/forum/index.php?action=page;sa=xxx ?

Thanks

W

Found it in the SMF help files...

To redirect to a specific custom page from the Custom Pages mod you can use

redirectexit('action=page;sa=xxx');

W
Title: Re: Custom Form Mod
Post by: tfs on May 07, 2009, 02:46:01 PM
I get one error on ./Sources/Admin.php

Find:
// Load the language and templates....
loadLanguage('Admin');
loadTemplate('Admin', 'admin');

Put After:
loadLanguage('Modifications');


Here's what's actually in Admin.php

   // Load the language and templates....
   loadLanguage('Admin');
   loadLanguage('SPortalAdmin', sp_languageSelect('SPortalAdmin'));
   loadTemplate('Admin', 'admin');


As you can see, it's broken by Simple Portal, but more importantly, when I try to install anyway I get the message...


Table 'db280860672.cf_forms' doesn't exist
File: /path/path/path/path/path/forum/Packages/temp/install.php
Line: 45

The install doesn't happen, and the package still shows as uninstalled in the package manager.
Title: Re: Custom Form Mod
Post by: Garou on May 07, 2009, 03:22:57 PM
mattchewone the closest thing I know of that comes to that is Thurnok's Pre-filled posts hack that's somewhere on Tiny Portal. You can get it to work without TP but it takes a little bit of work. Its what I was using before I found this mod.

What it essentially does is when a use creates a new topic in a certain board it opens up just like a regular post except that there is a bunch of information already written in the post box that the user can add to or modify. Its not a nice as the forms mod but it might suit your purposes.

allisondk and willerby, I'm glad the tip helped you out.  :)

allisondk, as far as the large text box goes, since I'm not the original author, I'm still learning all the ins and outs of this mod and PHP, so I'm not sure off hand. Ill add that to my very long to do list for the mod. :)

tfs, It looks like youve got two seperate problems the first is a bug in SMF 2.0 RC1, I'm guessing you had the mod installed at some point in the past and removed it. You have to manually drop the cf_forms and and cf_fields databases to re-install. If you were actively using the mod and were upgrading then you may want to back them up before deleting, reinstall the mod, then add the DBs back in. That way you wont lose any forms you have set up. Unfortunately there is no other way around it at this time and hopefully SMF will fix that in their next update.

As for the conflict with SP, the simple fix for now is to just to manually insert "loadLanguage('Modifications');" after "loadTemplate('Admin', 'admin');". Its a common problem when installing multiple mods in SMF that some mods cause conflicts with others and you occasionally have to manually install some or all of a mod that also use the same blocks of code to build on.
Title: Re: Custom Form Mod
Post by: tfs on May 07, 2009, 03:49:43 PM
Quote from: Garou on May 07, 2009, 03:22:57 PMtfs, It looks like youve got two seperate problems the first is a bug in SMF 2.0 RC1, I'm guessing you had the mod installed at some point in the past and removed it. You have to manually drop the cf_forms and and cf_fields databases to re-install. If you were actively using the mod and were upgrading then you may want to back them up before deleting, reinstall the mod, then add the DBs back in. That way you wont lose any forms you have set up. Unfortunately there is no other way around it at this time and hopefully SMF will fix that in their next update.

As for the conflict with SP, the simple fix for now is to just to manually insert "loadLanguage('Modifications');" after "loadTemplate('Admin', 'admin');". Its a common problem when installing multiple mods in SMF that some mods cause conflicts with others and you occasionally have to manually install some or all of a mod that also use the same blocks of code to build on.

Thanks for the feedback.  I figured out that it was the two tables that already existed from when I tried to install this yesterday and couldn't get it to work.  So I dropped the two tables and tried again, but unfortunately I ran into the same problem I had yesterday.  Let me describe what happens.

I install the mod and it says that there's...

2.    Add After    ./Sources/Admin.php    Test failed

No big deal.  The Find and Add After values are listed in my previous post.  So I go through with the install and then make the edit to Admin.php, but then when I go to Admin/Modifications I get a screen full of PHP junk.  Basically it looks like an entire screen of unformatted PHP coding.  I went through the exact same steps today as I did yesterday, and each time I've had the same result.  I've tried "Empty the file cache" but it had no effect.

Now I'm wondering if your loadlanguage() call needs to go before the one that SimplePortal is making?  I can't think of anything else.
Title: Re: Custom Form Mod
Post by: Garou on May 07, 2009, 06:14:00 PM
That shouldn't be a problem Ive got it installed on two other sites the exact same way.  :-\

Just out of curiosity how does the page start out? It sounds like some bit of code is missing a close statement, probably just before where that code starts. The same thing will also happen if something is placed after a close php statement ?>.
Title: Re: Custom Form Mod
Post by: tfs on May 07, 2009, 07:36:24 PM
Quote from: Garou on May 07, 2009, 06:14:00 PMJust out of curiosity how does the page start out? It sounds like some bit of code is missing a close statement, probably just before where that code starts. The same thing will also happen if something is placed after a close php statement ?>.

// Fucntion to handle the settings for the Custom Form Mod. function CustomFormSettings($return_config = false) { global $modSettings, $sourcedir, $txt, $scripturl, $context, $smcFunc; $config_vars = array(); // Get the id of the current element and sanitize it. if(isset($_GET['form_id'])) $form_id = (int) $_GET['form_id']; // Get the
Title: Re: Custom Form Mod
Post by: Enders on May 08, 2009, 01:24:12 AM
Is there a way to make forms posted into just 1 topic instead of making multiple topics.
Title: Re: Custom Form Mod
Post by: Garou on May 08, 2009, 07:06:42 AM
Not at this time.  :(
Title: Re: Custom Form Mod
Post by: amlucent on May 10, 2009, 12:29:36 AM
Quote from: Garou on December 31, 2008, 02:09:09 PM
Propaganistas I know nothing about gwBBCode and after a peek at it, the problem could easily be that it was never properly ported over for SMF. Someone just kinda hacked at it till they got most of what they wanted from it and then left it at that. I found a post on here about it asking for someone to make a real SMF mod out of it but it looks like no one ever did.

Essentially what your working with is a hack and not a mod, sometimes they work and sometimes they don't. 

I looked at your Subs-Post.php file and I cant find the error. Line 1542 doesn't look like its causing the problem and the code listed in the error isn't even in the file at all.

I think you might be better off taking the problem to someone more familiar with SMF and gwBBCode. They will most likely be able to spot something in the hack that I can not. Maybe someone else here might have more luck with it but I'm at a loss.

I am attempting to port gwbbcode to SMF (http://custom.simplemachines.org/mods/index.php?mod=1808).  Currently it is in the process of being approved.  I have a working package (http://gwgoodolddays.net/forums/index.php?action=downloads) but I would appreciate any continued efforts helping me ensure that gwbbcode does not interfere with this mod (or any mod for that matter).  I ask because I am a novice coder... and I am going to get to work trying to solve this issue.
Title: Re: Custom Form Mod
Post by: candidosa2 on May 12, 2009, 10:42:19 PM
nice work
good mod when update dont forget portuguese and brazilian
Title: Re: Custom Form Mod
Post by: Garou on May 13, 2009, 05:49:09 AM
amlucent, if it still has the issue with this mod after SMF approves it let me know.

candidosa2, thanks for the translations, we will get them in there. I always prefer human translations myself, Babelfish and Google aren't always correct.  :)
Title: Re: Custom Form Mod
Post by: Enders on May 13, 2009, 10:42:48 PM
Instead of having forms making topics the whole time, maybe have its own page where you can approve it and view it in a category than the boards.
Title: Re: Custom Form Mod
Post by: Garou on May 14, 2009, 07:40:35 AM
Enders, I doubt that will ever happen, the whole point of this mod is to create a pre-formated post with the data the user supplies.

If you don't want a post seen by the general public then have it posted to an admin only board, if you approve of it then move the post to a different board.  :)
Title: Re: Custom Form Mod
Post by: yol on May 23, 2009, 03:44:47 AM
Quote from: Enders on May 08, 2009, 01:24:12 AM
Is there a way to make forms posted into just 1 topic instead of making multiple topics.

I need too this...

Thanks for this great work!
Title: Re: Custom Form Mod
Post by: Garou on May 24, 2009, 09:55:48 AM
It is on the to do list but no promises on if or when it will  actually make it in a release. I doubt we will see anything soon though.

The original author is planning a complete rewrite of the mod and the rumor mill has it that the next major release of SMF is going to be making some significant changes to their code. Add to that my limited amount of time... I'm not really rushing to add a lot of new things to this right now.
Title: Re: Custom Form Mod
Post by: .Vapor on May 25, 2009, 05:41:08 PM
Love the mod, but i have 1 question.

After i submit a form, it goes to the appropriate forum...but the post is empty?

I am using smf 1.1.9 with a custom theme.
Title: Re: Custom Form Mod
Post by: Garou on May 25, 2009, 11:06:37 PM
I just set this up fresh on my test server and it works fine on the default theme. The only Theme Edits are     './Themes/default/languages/Help.english.php' and './Themes/default/languages/Modifications.english.php'.

Have you tried using the mod with the default theme? That will tell us if your problem is theme specific or it installed improperly.
Title: Re: Custom Form Mod
Post by: .Vapor on May 25, 2009, 11:10:01 PM
i will test this on default theme, and get back to you.
Title: Re: Custom Form Mod
Post by: Garou on May 25, 2009, 11:22:36 PM
Also do you have all the data set up properly in the form, both the Form Output and the Form Fields? Did you follow the suggested format for field names?
Title: Re: Custom Form Mod
Post by: alfzer0 on May 26, 2009, 05:43:26 AM
an update...I've been able to add another set of {} to the output syntax for better control of the output when fields are empty (talked about a few pages back).  I just started working on it again since I last posted, and the coding prob I previously had was easily fixed.

Here's the relevant section of code (aside from declaring the $vars_blank and $vars_non_blank arrays).  My additions have comments starting with "{{ }} Syntax:"...

SMF 1.17 (probably 1.1.x?)
Sources\CustomForm.php

                //    Add this fields value to the list of variables for the output post.
                $vars[] = '/\{'.$field['title'].'\}/';
                $replace[] = $value;

                //    {{ }} Syntax: Setup REGEX for removing entire {{ }} string or just stripping the outermost { }, depending upon the replacement value being blank or not
                if($value == '')
                {
                    $vars_blank[] = '/\{[^\{\}]*\{'.$field['title'].'\}[^\{\}]*\}/';
                    $vars_non_blank[] = '//';
                }
                else
                {
                    $vars_blank[] = '//';
                    $vars_non_blank[] = '/\{[^\{\}]*\{'.$field['title'].'\}[^\{\}]*\}/';
                }

                //    Also add this data back into the data array, just in case we can't actually submit the form.
                $data[$i]['value'] = $value;
               
                //    Do a small fix for the last line, if this is a checkbox.
                if($field['type'] == 'checkbox')
                    $data[$i]['value'] = isset($_REQUEST[$field['title']]) ? $_REQUEST[$field['title']] : false;
                //    Do a small fix for the last line, if this is a largetextbox.
                if(($field['type'] == 'largetextbox'))
                    $data[$i]['value'] = isset($_REQUEST[$field['title']]) ? $_REQUEST[$field['title']] : '';
            }

            //    Do we have completly valid field data?
            if(!$fail_submit)
            {
                require_once($sourcedir.'/Subs-Post.php');

                //    {{ }} Syntax: Strip out everything in {{ }} if value is blank
                $output = preg_replace($vars_blank, '', $output);
                $subject = preg_replace($vars_blank, '', $subject);

                //    {{ }} Syntax: Remove outside brackets if value is not blank
                $output = preg_replace_callback($vars_non_blank, create_function('$matches','return substr($matches[0],1,-1);'), $output);
                $subject = preg_replace_callback($vars_non_blank, create_function('$matches','return substr($matches[0],1,-1);'), $subject);

                //    Replace all vars with their correct value, for both the message and the subject.
                $output = preg_replace($vars, $replace, $output);
                $subject = preg_replace($vars, $replace, $subject);


Garou...I think this would be a great feature to add to the release for everyone.  If you need any additional info on how the code works or how the optional {{ }} syntax is used in the body and subject outputs, just let me know.  And no worries, AFAIK this still leaves the original syntax intact so it's completely optional if someone wants to use the double brackets or not.  Sadly, I don't have SMF 2.0 installed so I couldn't do any testing for it.  Hopefully these additions can easily be added to the CustomForm.php for SMF 2.0 (hell, I'm not even sure if it's different from 1.1.x version).


Also, I'm trying to add a couple other things to this mod...
* An option for large text boxes to be "post boxes" complete with bbcode buttons and smileys.
* An error redirect back to the form page for the subject being larger than what SMF normally allows (80 chars), showing which fields contribute to the subject length, and how many characters need to be trimmed off to be within limits

Garou, if you think you can do either of these easily and would like to, please let me know and I'll leave those for you to code.  Else I'll code them myself (or at least try) and if successful share the code again (unfortunately still only for 1.1.7) .  I've already took a look at whats needed for the second one and I'm sure I can do it, but it will probably take me a lil while cause I'm still not fluent with PHP.  Not sure how easy/difficult the first will be, but I don't think it'll be too difficult to tackle.

Thanks again,
-Jeff

Title: Re: Custom Form Mod
Post by: Garou on May 26, 2009, 08:02:07 AM
Ok Just so I can make sure I understand this...
If the admin sets it up so the forum output is
Your answers are: {{question1},{question2},{question3}}

Then the user only answers 1 and 3 then it would post...
Your answers are: question1, question3

Instead of...
Your answers are: question1,  , question3
Correct?
Title: Re: Custom Form Mod
Post by: alfzer0 on May 26, 2009, 09:57:38 AM
no, it's like this...

let's say you have 3 fields, *{name}, {age}, {weight}
(age and weight are optional)
and in the form output you do...
Name: {name}
{Age: {age}}
{Weight: {weight} lbs.}

If the user enters all values, the output would be like...
Name: Jeff
Age: 27
Weight: 195 lbs.

...but if the user didn't enter {age} or {weight}, the output would be...
Name: Jeff

The best one could do without this feature is...
Name: Jeff
Age:
Weight:  lbs.

is that more clear?
Title: Re: Custom Form Mod
Post by: Garou on May 26, 2009, 10:38:21 AM
Yeah I got it. I had the right idea just the wrong syntax. Now would the user have to add anything different in their form fields or does this work by default as long as the proper syntax is used in the form output? I just want to get it straight for my notes and then later, the help files. I haven't had the chance to test it out. If it works or I can modify it to work on both the 1.1.x and the 2.x versions (there are some variations in the code)  Ill get it in the next release.

I have about a dozen test forums up right now with stuff I'm testing just for this mod. I'm hoping I can get some of them finished and into an update when I get my next vacation. It also depends on where SMF is at with their next release because I'm probably going to have to make a bunch of changes to make this work with the next major release of SMF.

Another thing to keep in mind Nathanial has stated his next release of this mod will completely rewrite the way this mod is coded and will be for 2.x only. As there are many features to build off of in 2.x that do not exist in 1.1.x, it may not be possible to realistically port it backwards.
Title: Re: Custom Form Mod
Post by: alfzer0 on May 26, 2009, 10:55:14 AM
yup, user has to do nothing special when filling out the form. The admin just has to use the proper syntax in the form output (subject or body)

when/if Nathanial rewrites the mod I imagine it would still be easy to add this in as well (if there is no better functionality added that would trump this), and I'd gladly help with it if need be.

I do need to do some more testing on it as well, didn't check out int/float fields or if the outside brackets are on a different line from the inside brackets.
Title: Re: Custom Form Mod
Post by: alfzer0 on May 26, 2009, 11:23:55 AM
btw, I just got a post box working in place of a large text field, except that it's screwing up the theme CSS formatting.  If I can get that ironed out...for giving the admin a choice of what to show, do you think it's better to add a Type Parameter to the Large Text Box (probably 'postbox') or add a new Type specifically just for Post Box?

edit: woohoo, got the theme formatting fixed. Now just to decide on how to present the option to display a Post Box
Title: Re: Custom Form Mod
Post by: alfzer0 on May 26, 2009, 02:08:55 PM
also, I'm noticing that if I have a "$" in a text field, it and everything after it is stripped out.  Haven't looked into the code yet, but I'm guessing this is for security purposes...is there anyway to get around this without sacrificing security?
Title: Re: Custom Form Mod
Post by: Garou on May 26, 2009, 02:19:19 PM
Its one of the things Im working on. The mod is using the smf internal text editor and I havent been able to track it down.

For now Ive been recomending that questions be set up using the css for align right which places the $ next to the input field. The actual code to do so is a couple of pages back. Its just not easy to cut and paste using my cellphone. LOL
Title: Re: Custom Form Mod
Post by: .Vapor on May 26, 2009, 02:21:32 PM
Quote from: [email protected] on May 25, 2009, 11:10:01 PM
i will test this on default theme, and get back to you.

Resolved...thank you.
Title: Re: Custom Form Mod
Post by: alfzer0 on May 26, 2009, 02:53:39 PM
Quote from: Garou on May 26, 2009, 02:19:19 PM
Its one of the things Im working on. The mod is using the smf internal text editor and I havent been able to track it down.

For now Ive been recomending that questions be set up using the css for align right which places the $ next to the input field. The actual code to do so is a couple of pages back. Its just not easy to cut and paste using my cellphone. LOL

lol!  I'm already right aligning the questions (I think they look better that way).  If I find any solution I'll let ya know.

btw, I'm from Portage, IN (living in CA currently though)  Nice to know a fellow hoosier is working on this  ;D
Title: Re: Custom Form Mod
Post by: Garou on May 26, 2009, 03:52:46 PM
Ive been through there a few times. If you make a trip home let me know.

Glad ya got it fixed [email protected], what wound up being wrong? It helps me when someone else has similar problems.
Title: Re: Custom Form Mod
Post by: FragaCampos on May 28, 2009, 07:40:43 PM
Hello there.
I've just read the 29 pages of this thread carefully, cause i wanted to know the ins and outs of this.
I think it's one of the best mods around, a bit hard to get know it, but after you know how to used it, it's just brilliant.
Thanks to Nathaniel for thinking about it and all his support, and Garou for keeping this alive.

All my requests for this mod were already asked, but i'll put them in a list to make sure they don't stay out of the next update (hopefully there will be one :P)

1. When an user press "New Topic" on the board where the form is going to post, it should go to the Form Page instead.

2. An attachment field. This would make this mod even greater.

3. Option to select the post icon.

Also, i noticed the problem with the urls. Garou, i tried your suggestion but it keeps putting the http:// behind, i.e., after i put the parse_bbc in the "Extra Type Parameters:" field it keeps showing this:

[url=http://{link}]Test[/url]
[img]http://{link}[/img]



Quote from: Garou on February 22, 2009, 10:34:12 AM
I figured this one out this morning. You have to enter parse_bbc in the Extra Type Parameters field for this to work right.

Example...
Title: image
Text: Please enter the link to your image here.   
Type: Text Box (String)
Extra Type Parameters: parse_bbc

Then in the Form Output: you would enter
[img]{image}[/img]

Images will post from the form to your forum this way, no changes to the mod necessary.  :)

Any thoughts about this?

Thanks in advance.
Title: Re: Custom Form Mod
Post by: Garou on May 28, 2009, 11:03:37 PM
FragaCampos #3 is in the works for my next update, #1 and 2 are on the to do list once I figure out how to do them. #1 I have made several attempts at and every time I broke the post function for the entire forum. For now its just going to have to wait I get time to figure it out or someone more knowledgeable about the post function lends me the code.  In the mean time there are several other functions planed for my next few updates that I can do.

As for where you quoted me, I just double checked in 2.0 RC1-1 and it works perfectly.
Title: Re: Custom Form Mod
Post by: FragaCampos on May 29, 2009, 08:47:29 AM
Thanks Garou. I appreciate your effort and perseverance on this.
All of the "to do" items for this mod are great, but i think the attachment one would bring the mod to an all new level ;) Still, i understand it's not easy to workaround with the code, i'm a code newbie myself, and i keep giving all the credits to the people who work so hard on SMF and related mods.


Quote from: Garou on May 28, 2009, 11:03:37 PM
As for where you quoted me, I just double checked in 2.0 RC1-1 and it works perfectly.

I'm using 1.1.9. Could it be because of that?
Title: Re: Custom Form Mod
Post by: FragaCampos on May 31, 2009, 09:21:47 AM
Hi there.

After trying the mod and play around with some forms I came up with two more suggestions:

1 - The "Text" field in the "Form Fields" section should accept more characters, so that we can use it for explaining things better to users and bypass the mod's limitations.

2 - When we choose "Selection box" in the "Form Fields" section, and put two strings on the "Extra Type Parameters" like for example "This is good.,This is better" we should be able to use it like this: "The is good.," so that instead of returning a "No" we could return nothing if the checkbox wasn't selected.
Why this? It would make possible to make several checkboxes (or just one from a list) and return only the "true value", i.e., the first one. This would be particularly helpful with images, to select from a list and insert inside a img tag.
Hope i made some sense :P
Title: Re: Custom Form Mod
Post by: Enders on May 31, 2009, 10:17:57 AM
It would also be nice if this mod can post its form content on a separate page rather than a forum page...
Title: Re: Custom Form Mod
Post by: Garou on May 31, 2009, 11:00:39 AM
FragaCampos, #1 Ive been looking for this myself before I was given permission to work on the mod and I cant find anything in the mod forcing the limit  :(

With #2 you do have some control using the Extra Type Parameters and the checkbox. You can enter "The box was checked,The box was not checked" or possibly try  "The box was checked,"

Enders, This has been covered by me after your last post and by the original author to another user a while back and plain and simple its not going to happen. The point of this mod is to create preformated posts based on user responses. As a users answers are not stored in a database but posted to the forum using the post function its not possible to post to content anywhere else.

Suggest it in the help wanted board and maybe someone will want to create a mod that outputs forms to a database for display in another page.
Title: Re: Custom Form Mod
Post by: FragaCampos on May 31, 2009, 12:04:30 PM
Quote from: Garou on May 31, 2009, 11:00:39 AM
FragaCampos, #1 Ive been looking for this myself before I was given permission to work on the mod and I cant find anything in the mod forcing the limit  :(

Oh well... we'll have to work with what we have ;)

Quote from: Garou on May 31, 2009, 11:00:39 AMWith #2 (...) or possibly try  "The box was checked,"

I already tried that and it won't work, it still returns a "No" if the checkbox is not selected... :(


Another thing i just noticed:
Would it be possible to be able to input a blank field in the selection box, so that we can return nothing if we select the empty field?
Title: Re: Custom Form Mod
Post by: Spinx Haplo on May 31, 2009, 01:05:10 PM
OK, finally fixed an issue I was having after install, and trying to admin.  Am using 2.0 1-1, and when it puts the "function CustomFormSettings" in the ManageSettings.php file, it puts it after the php end carat "?>" (outside of the php statement)  Sorry, am a noob, so not sure of the correct phrasing.  I moved the "?>" after the function (back at the end of the file) and it started working corectly again.  Also, as previously stated, if you uninstall and reinstall the mod, it will not reinstall correctly unless you manually drop cf_fields and  cf_forms from the database. Looks like the install.php needs an "if exist drop table" or something like that
Title: Re: Custom Form Mod
Post by: Garou on May 31, 2009, 08:39:28 PM
FragaCampos, you know the whole point of this is to get people to fill out the form. Why go to all the trouble to allow people not to fill out the data. I often use the default string, the first selection in a select box, or an unchecked check box to harass the users who don't fill out the form completely. Stuff like "The user was too lazy to fill this out".  :)

Spinx Haplo, the database problem is actually a problem with SMF not the mod there are other mods that have this issue as well. It should be fixed in an updated release of SMF, they missed it in the last one as they were in a rush to plug a security breach.

As for code not being entered in the correct place sometimes that happens when you uninstall and reinstall a mod. Ive had this happen myself with other mods I couldn't decide if I really wanted them or not, I don't know why it happens. I'm going to guess that it might have to do with mods that were installed prior to the mod being uninstalled.

When removing a mods you really should uninstall all mods installed after it in the reverse order they were installed, then reinstall them after the mod you no longer wanted to use is removed. Personally I now have a test server set up just for this reason and I never install a mod on a live server until I'm sure its what I want. Its rare that I have to uninstall a mod on a live server anymore and when I do its usually due to an SMF update that is no longer compatible with an existing mod. :)
Title: Re: Custom Form Mod
Post by: Spinx Haplo on May 31, 2009, 10:51:33 PM
Actually the "function" problem started at first install
Title: Re: Custom Form Mod
Post by: EDSucation on June 01, 2009, 12:21:32 AM
Hi, I need a bit of help using this.
I'm trying to set it up so that my users can post the following in a new topic:



Doctor's
-


But I don't see anywhere to edit the fields of the form, or how to make the form the mandatory way to START a topic on the board. (obviously I don't want someone to have to reply with a doctor, I want them to be able to comment regularly.)

Thanks,
EDSucation
Title: Re: Custom Form Mod
Post by: FragaCampos on June 01, 2009, 09:33:08 AM
Quote from: Garou on May 31, 2009, 08:39:28 PM
FragaCampos, you know the whole point of this is to get people to fill out the form. Why go to all the trouble to allow people not to fill out the data. I often use the default string, the first selection in a select box, or an unchecked check box to harass the users who don't fill out the form completely. Stuff like "The user was too lazy to fill this out".  :)

Garou, there many, many situations where the option of "none selected" in the selection box would be useful, if not essential.
I have two forms (for now) that would required that, because sometimes there are situations where you don't need to choose anything from the selection box, and if you don't choose anything, the form will still insert the first field :/
Example: Imagine you have a form with two selection boxes to choose between two days. But there are times when you only need to choose one day of the month, how do i do that without choosing the first day of the second selection box?
Do you think it would be difficult to implement this?

@EDSucation, that's a very easy form to build. Just follow this tutorial:
http://www.simplemachines.org/community/index.php?topic=248871.msg1633514#msg1633514

Title: Re: Custom Form Mod
Post by: Garou on June 01, 2009, 10:32:53 AM
Spinx Haplo, Im not sure what the issues is then, it was just a guess anyway.  :-[ I haven't had a chance to test this on rc1-1 but under rc-1 it installed perfectly. Either something has changed in the way rc1-1 installs a mod causing a conflict with this or it was just a fluke. *shrug*

EDSucation, I was just going to suggest the same link FragaCampos did.  ;D When I first started using this mod it helped me out a lot.

FragaCampos, Ill add it to my to do list and see if something can be figured out. In the meantime I suggest you make the first answer "None", "N/A", or something along those lines. You could even set up a text box and just let the the user fill it out.
Title: Re: Custom Form Mod
Post by: FragaCampos on June 01, 2009, 05:32:16 PM
Quote from: Garou on June 01, 2009, 10:32:53 AM
FragaCampos, Ill add it to my to do list and see if something can be figured out. In the meantime I suggest you make the first answer "None", "N/A", or something along those lines. You could even set up a text box and just let the the user fill it out.

Unfortunately, those options won't do, because they will return a value, and the idea is not to return anything at all.
Here's a practical example: i have a selection box to insert the name of a channel in the subject area, but only if the channel is known or available. As it is now, i'm obligated to choose one from the list or choose a text box (which is not so good for the purpose i want). This is an example, but there are many others...
Title: Re: Custom Form Mod
Post by: willerby on June 01, 2009, 05:46:25 PM
Don't you just make the first option "Not available" or "Not known" or is that too simple?

Why code when you can work around what you have...
Title: Re: Custom Form Mod
Post by: alfzer0 on June 02, 2009, 01:12:07 AM
Quote from: FragaCampos on June 01, 2009, 05:32:16 PM
Quote from: Garou on June 01, 2009, 10:32:53 AM
FragaCampos, Ill add it to my to do list and see if something can be figured out. In the meantime I suggest you make the first answer "None", "N/A", or something along those lines. You could even set up a text box and just let the the user fill it out.

Unfortunately, those options won't do, because they will return a value, and the idea is not to return anything at all.
Here's a practical example: i have a selection box to insert the name of a channel in the subject area, but only if the channel is known or available. As it is now, i'm obligated to choose one from the list or choose a text box (which is not so good for the purpose i want). This is an example, but there are many others...
I can almost accomplish this with the addition to the code I wrote about a bit earlier in the thread creating a custom template that adds a blank choice to every select box.  Problem is currently it errors and returns to the form if the choice is left blank as the rest of the code expects there to be a non-blank value from a select box.
Title: Re: Custom Form Mod
Post by: azinoobrus on June 02, 2009, 04:33:18 AM
How can i get russian support language? (Russian_UTF8). Cuz after i'll entering something in forms its look like "????? ?? ?????". Need something supporting Cyrillic symbols...
Title: Re: Custom Form Mod
Post by: Garou on June 02, 2009, 08:11:29 AM
azinoobrus, I don't speak Russian at all. I can offer is this...

Youll want translate the code that goes into
./Themes/default/languages/Modifications.english-utf8.php
./Themes/default/languages/Help.english-utf8.php
Check out http://custom.simplemachines.org/mods/index.php?action=parse;mod=1279;attach=89987;smf_version=1.1.8 to find the code.

Youll want to look for lines like...
$txt['CustomForm_generalsettings_heading'] = 'Custom Form Mod Settings';

And change it to...
$txt['CustomForm_generalsettings_heading'] = 'Установки Mod индивидуальной формы';

Sorry if the translation is a bit off but that's what I got from http://babelfish.yahoo.com.  :)

Then you'll want to add your translated code to
./Themes/default/languages/Modifications.russian-utf8.php before the ?>
./Themes/default/languages/Help.russian-utf8.php after...
$helptxt = array();
Title: Re: Custom Form Mod
Post by: azinoobrus on June 02, 2009, 10:26:19 AM
Ye i got it. But i mean Cyrillic symbols like "игдж". Mod is already translated, its easy, but he is not supporting  Cyrillic symbols in forms at all.
You can check it out here "http://granat-lupanovo.ru/index.php?action=form" latin symbols looks fine, but Cyrillic...
If i'll make a simple question like "Yes or no?" and form tab it will be look great. But if i'll make question "Да или нет?"(It's the same thing like "Yes or no?") then it's will be look like "?? ?? ??"
and sorry for my english
Title: Re: Custom Form Mod
Post by: Garou on June 02, 2009, 11:38:40 AM
Well I tried to test this using  Babel Fish. According you the translation of your site you haven't created any forms yet.

On my test server The questions in the form show correctly but the Form Output changes the symbols to their HTML code equivalent. For instance becomes "Да или нет?" "&#1044;&#1072; &#1080;&#1083;&#1080; &#1085;&#1077;&#1090;?"

I have no Idea why this is. Mind you I haven't installed the SMF Russian language pack on my site as I wouldn't understand it anyway, that may be why Im getting the HTML code for the symbols.

Have you asked anyone in the Russian boards here (http://www.simplemachines.org/community/index.php?board=68.0)? Do to my lack of understanding of the language I'm really at a loss as how to help here.  :(
Title: Re: Custom Form Mod
Post by: FragaCampos on June 02, 2009, 11:44:47 AM
Quote from: willerby on June 01, 2009, 05:46:25 PM
Don't you just make the first option "Not available" or "Not known" or is that too simple?

Why code when you can work around what you have...

It's not a matter of simplicity but effectiveness. If a documentary doesn't have a channel, i.e, was produced and released as it is, without being broadcasted on tv, why should i put "Not availabe or "Not known"?  ::)
Title: Re: Custom Form Mod
Post by: .Vapor on June 08, 2009, 01:39:18 PM
I just upgraded my forums to smf 2.0 rc1.1 and i get this while trying to install on "Core default" theme:


1.     Adapt Database     install.php     
*2.    Execute Modification    ./index.php    Test successful
1.    Add After    ./index.php    Test successful
*3.    Execute Modification    ./Sources/Admin.php    Test failed
1.    Add After    ./Sources/Admin.php    Test successful
2.    Add After    ./Sources/Admin.php    Test failed
*4.    Execute Modification    ./Sources/ManageSettings.php    Test successful
1.    Add After    ./Sources/ManageSettings.php    Test successful
2.    Add Before    ./Sources/ManageSettings.php    Test successful
5.    Extract File    ./Sources/CustomForm.php    
6.    Extract File    ./Themes/default/CustomForm.template.php    
*7.    Execute Modification    ./Themes/default/languages/Modifications.english.php    Test successful
1.    Add Before    ./Themes/default/languages/Modifications.english.php    Test successful
*8.    Execute Modification    ./Themes/default/languages/Help.english.php    Test successful
1.    Add After    ./Themes/default/languages/Help.english.php    Test successful
9.    Execute Modification    ./Themes/default/languages/Modifications.english-utf8.php    Skipping file
10.    Execute Modification    ./Themes/default/languages/Help.english-utf8.php    Skipping file


I downloaded the custom form version for 2.0 also
Title: Re: Custom Form Mod
Post by: pinoypetfinder on June 08, 2009, 10:18:31 PM
Quote from: EDSucation on June 01, 2009, 12:21:32 AM
Hi, I need a bit of help using this.
I'm trying to set it up so that my users can post the following in a new topic:



Doctor's
-

  • Name:
  • Phone Number:
  • Fax Number:
  • Address 1:
  • Address 2:
  • City:
  • State:
  • Country:
  • Specialties:
  • Website:


But I don't see anywhere to edit the fields of the form, or how to make the form the mandatory way to START a topic on the board. (obviously I don't want someone to have to reply with a doctor, I want them to be able to comment regularly.)

Thanks,
EDSucation


was looking for the same thing - for our classified ad section board.
i checked the link that they gave http://www.simplemachines.org/community/index.php?topic=248871.msg1633514#msg1633514 but i am not sure if it will display on a start new topic page  ???  and also, is it possible to have this "form" appear only on selected boards? (like for example, ad section board?)
Title: Re: Custom Form Mod
Post by: .Vapor on June 09, 2009, 12:13:05 AM
Quote from: [email protected] on June 08, 2009, 01:39:18 PM
I just upgraded my forums to smf 2.0 rc1.1 and i get this while trying to install on "Core default" theme:


1.     Adapt Database     install.php     
*2.    Execute Modification    ./index.php    Test successful
1.    Add After    ./index.php    Test successful
*3.    Execute Modification    ./Sources/Admin.php    Test failed
1.    Add After    ./Sources/Admin.php    Test successful
2.    Add After    ./Sources/Admin.php    Test failed
*4.    Execute Modification    ./Sources/ManageSettings.php    Test successful
1.    Add After    ./Sources/ManageSettings.php    Test successful
2.    Add Before    ./Sources/ManageSettings.php    Test successful
5.    Extract File    ./Sources/CustomForm.php    
6.    Extract File    ./Themes/default/CustomForm.template.php    
*7.    Execute Modification    ./Themes/default/languages/Modifications.english.php    Test successful
1.    Add Before    ./Themes/default/languages/Modifications.english.php    Test successful
*8.    Execute Modification    ./Themes/default/languages/Help.english.php    Test successful
1.    Add After    ./Themes/default/languages/Help.english.php    Test successful
9.    Execute Modification    ./Themes/default/languages/Modifications.english-utf8.php    Skipping file
10.    Execute Modification    ./Themes/default/languages/Help.english-utf8.php    Skipping file


I downloaded the custom form version for 2.0 also

Anyone have any ideas on this ?
Title: Re: Custom Form Mod
Post by: Garou on June 09, 2009, 06:22:22 AM
[email protected], you probably have another mod that is conflicting with the install of this one and will have to enter the code manually. Install the mod anyway then check http://custom.simplemachines.org/mods/index.php?action=parse;mod=1279;attach=89986;smf_version=2.0_RC1-1 for the changes to the failed file.

pinoypetfinder, Its been stated many times that the mod does not currently work with the new topic button. Not to say that it never will but for now I haven't been able to figure it out.

A form doesn't display on any board it displays in its own page such as "your forum/index.php?action=form;id=1" the data entered into the form will only be posted in the board that you tell it too. Also each particular form only posts to one board (of your choosing).

To force your users to use a form to post to a board first edit the board settings for that board to either read only or reply only. That way a user can not post a new topic to the board. Then create a sticky post with a link to the form. Alternatively in SMF 2.x, in the board settings, you can create a board that is a link rather then an actual board. You can then use that to link to your form.
Title: Re: Custom Form Mod
Post by: .Vapor on June 12, 2009, 11:49:54 AM
Ok...i installed it anyway, it works (kinda)

I am having to re-do permissions on the forms every 24 hours or so. It's like the permissions just revert to Admin only (weird)


Here are the mods i have installed:

1.     Increase Number of Visitors (cheat)      1.0
2.    Advanced Reputation System    1.7.4
3.    Highslide Image Viewer    1.2
4.    SMF Media Gallery    1.5.6
5.    SMF Affiliates Mod    3.0.3
6.    Anti-Bot Registration Puzzles    1.2
7.    SMF Staff Page    1.6
8.    nCode Image Resizer    1.2
9.    SimplePortal    2.2.2
10.    Member Color Link    3.0.6
11.    Separate Sticky and Normal Topic    1.0
12.    Custom Form Mod


Help please :)
Title: Re: Custom Form Mod
Post by: willerby on June 12, 2009, 12:06:29 PM
Finally gone live using Custom Forms for new members details then linking to Paypal and all of a sudden my required fields show the following next to them instead of having an asterix being highlighted in red...

style="color:#FF0000;" *

Any ideas why they won't just show a red asterix when not filled in?
Title: Re: Custom Form Mod
Post by: C4G-TK on June 12, 2009, 12:30:00 PM
Quote from: [email protected] on June 12, 2009, 11:49:54 AM
Ok...i installed it anyway, it works (kinda)

I am having to re-do permissions on the forms every 24 hours or so. It's like the permissions just revert to Admin only (weird)


This might be the same thing that I pointed out on one of the earlier pages with my other forum account.  It was something that the author is aware of, but I don't think has been fixed, yet.

For some reason the permissions are reset for a membergroup if you go into the main permissions page for that membergroup regardless of making changes. 

So, as an example:

-You make your forms able to be viewed by the regular membergroup via the mod.  :)
-This group will be able to see the form.  :)

-But, if you go into Admin > Members > Permissions and change something for the regular membergroup, it decides to delete that group from being able to see the form or tab.  >:(

You'll have to go back into the admin for the mod and select that group again in order for them to see the tab and forms again.  If this is what you are talking about, it has been pointed out, but right now, you just have to keep adding each membergroup you change or view under Admin > Members > Permissions.

BUT!  I did find a way to get around it deleting the permissions.  If you don't actually go into the membergroup permissions to look or change something and use the ADD/REMOVE permission from the Admin > Members > Permissions page (under the advanced options section at bottom of page) it will NOT remove the permissions that you keep having to re-assign!  :D
Title: Re: Custom Form Mod
Post by: .Vapor on June 12, 2009, 02:20:18 PM
Sweet !

Thanks alot C4G .... i thought i was going crazy  ;)
Title: Re: Custom Form Mod
Post by: canadiancray on June 13, 2009, 12:02:39 PM
I have installed this Mod. Everything installed fine. I am running version 1.1.9.

Made my first couple of forms but when I try to access any of the forms on the "index.php?action=form" page I get the same error.

QuoteMethod Not Implemented

GET to /forum/index.php not supported.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.


Any ideas what could be causing this????

My Website error log says:
Quote[Sat Jun 13 12:14:39 2009] [error] [client 24.141.231.173] File does not exist: /home/camb9550/public_html/501.shtml, referer: http://www.cambridge-district-aquarium-society.ca/forum/index.php?action=form
Title: Re: Custom Form Mod
Post by: Garou on June 13, 2009, 11:03:55 PM
[email protected], sounds like C4G-TK got you fixed up I thought this was fixed before I came on board as its not in my notes but Ill add it back in and see if I cant track it down for a more permanent fix.

willerby, have you edited your CustomForm.template.php at all? The code block should look like...
// Show the 'required' asterix if necessary.
if(!empty($field_data['required']))
echo '
<div ', !empty($field_data['failed']) ? 'style="color:#FF0000;"' : '' ,'> *</div>';


canadiancray, this is actually a problem caused by your host. The first thing to try is to the file permissions for the CustomForm.template.php and CustomForm.php to 644.

If that doesn't fix it then it could be a problem with your php.ini settings (depending on your server setup, you may have to contact your host to adjust this). Set "variables_order = EGPCS", you may also want to set "register_long_arrays" and "register_argc_argv" to "ON". Turning on the latter two can sometimes slow down server performance but leaving them off can cause GET statement errors like yours.

If that isn't it then your host may be running mod_security, version 2.1 and later has been know to cause many problems for a lot of php based software. There is a tendency for rule# 950006 to read false positives with many scripts and you will have to contact your host about bypassing it for your site or at least for CustomForm.template.php and CustomForm.php. Explain your problem and they will know best how to handle it.
Title: Re: Custom Form Mod
Post by: canadiancray on June 14, 2009, 12:49:59 AM
I installed SMF2.0 RC1-1 & reinstalled the mod & the errors went away.
Title: Re: Custom Form Mod
Post by: willerby on June 14, 2009, 06:24:42 AM
Quote from: Garou on June 13, 2009, 11:03:55 PM
willerby, have you edited your CustomForm.template.php at all? The code block should look like...
// Show the 'required' asterix if necessary.
if(!empty($field_data['required']))
echo '
<div ', !empty($field_data['failed']) ? 'style="color:#FF0000;"' : '' ,'> *</div>';


Its exactly that but for some reason on all browsers the asterisk changes to the coding when a required field in not input???
Title: Re: Custom Form Mod
Post by: Garou on June 14, 2009, 06:57:37 AM
willerby, if you haven't modified your CustomForm.template.php, try dropping a fresh copy of the file on your server. I cant think of anything else that would be causing the problem other then the file being corrupted somehow. If you have modified the file, pop it up here and Ill take a look at it.
Title: Re: Custom Form Mod
Post by: willerby on June 14, 2009, 04:32:57 PM
I have modified but not in this area or anything I can see is related. This was working fine until recently so not sure what has change (certainly nothing in this file)?

Attached php as requested - can you see anything wrong?
Thanks
W
Title: Re: Custom Form Mod
Post by: Garou on June 14, 2009, 09:55:49 PM
Yep the file is messed up in a couple of places and has been modified as it looks like someone has tried to customize the example template. The line in question was wrong both in the modified example template and in the default template.

The attached file works fine now.  :)
Title: Re: Custom Form Mod
Post by: willerby on June 15, 2009, 05:21:54 PM
Sorry Garou. I think somewhere I have ended up using a corrupt file, probably an ftp error when editing. I could have resolved this one myself but was sure it was working fine and hadn't made any changes, obviously I had.

Thanks for picking it up
Title: Re: Custom Form Mod
Post by: German_AC on June 18, 2009, 09:52:53 PM
Hi, I just installed the mod under 1.1.9. Change my default language to English, but when I got to Custom Forms menu and try to create a new form, click the link Add form and nothing happens. The page reload but remains the same screen without any form created or added. Even if I try to change permisions and then Save, when page reload all permisions remain unchecked.

Any ideas?

Thanks
Title: Re: Custom Form Mod
Post by: Garou on June 19, 2009, 05:32:41 AM
willerby, glad I could help.

German_AC. it sounds like the database didn't install correctly. You might be better off to uninstall and reinstall.
Title: Re: Custom Form Mod
Post by: German_AC on June 19, 2009, 01:10:26 PM
I tried to reinstall, but afte install, when it redirects to setting page this error shows:

Not Found

The requested URL /action,featuresettings;sa=customform; was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

UPDATE: Well, now appear de configuration form, but Save button is not working. I mean, I create the form but when I click save, the page reload exactly as before and nothing happens.
Title: Re: Custom Form Mod
Post by: German_AC on June 19, 2009, 02:41:14 PM
Well, foget about my last post. I finally got it working.

Nice mod! Thanks a lot!!
Title: Re: Custom Form Mod
Post by: German_AC on June 19, 2009, 03:31:41 PM
Me again, I have a new problem. The mod appears to be working fine, but only for me as an admin. When regular users or moderators try to go to forum/index.php?action=form they are redirected to forum index.

Any help?


Oh, but the way, here is the modification.php file translated to spanish, or in case you alredy have this file, add the content to your currently instalation.
Title: Re: Custom Form Mod
Post by: Garou on June 19, 2009, 04:43:01 PM
Thanks for the translation Ill add it to the next update.

As for the users not being able to get to the form list there is a setting for that in the admin section of the mod where you name your form page. It should say permissions. This is seperate from where you set up the actual form.
Title: Re: Custom Form Mod
Post by: German_AC on June 19, 2009, 06:04:49 PM
Hi Garou, is a placer to colaborate.

What permissions are you saying?

I only have this options at the admin section:

(http://img270.imagevenue.com/loc184/th_48857_Sin_t6tulo-2_122_184lo.jpg) (http://img270.imagevenue.com/img.php?image=48857_Sin_t6tulo-2_122_184lo.jpg)

If I check all chek boxes and save, nothing changes. When I open it again it still all unchecked.

In the two forms I created I have set permission too, I they are ok, they keep checked when I save.


Trying thing I found as a regular user a way to add to the forms, using index.php?action=form;id=1 but when I fill the form and click send the page refresh and the form is empty again and nothing is posted.
Title: Re: Custom Form Mod
Post by: German_AC on June 19, 2009, 07:22:20 PM
Doing some research, I found that the problem is with my URL. I'm using Mambo bridge and when you go from mambo to smf the forum url became like this:

/index.php/component/option,com_smf/Itemid,47/

If an user try to post he got the same error over and over.

If he change the URL manually to:

/index.php?action=form

Then things works fine.

Is there any way to solve this??
Title: Re: Custom Form Mod
Post by: Garou on June 19, 2009, 10:03:03 PM
I personally didn't like Mambo/Joomla when I tried them out a couple years ago. There were way too many issues bridging SMF into it properly. That said I know absolutely nothing when it comes to making them work with SMF now.

There is a bridge support board here on SMF (http://www.simplemachines.org/community/index.php?board=33.0) where there are people much more knowledgeable about these things then I.

Sorry  :(
Title: Re: Custom Form Mod
Post by: FireDitto on June 27, 2009, 07:49:00 PM
I'm loving this mod.


My only request at the moment, would be the ability to organise the way in which the Forms are listed, instead of it defaulting to the order you create them in.


Also, my Astrix aren't red... and they appear under the box that is required. I've included a Screenshot.
Title: Re: Custom Form Mod
Post by: Spinx Haplo on June 28, 2009, 12:29:15 AM
Is it possible to have the porm post to an already existing topic, not just board?  Also, what I would really like to be able to do is make it post to an existing post and simply add the data to that post in a table.  Maybe too much for this mod, but I had to ask.
Title: Re: Custom Form Mod
Post by: Garou on June 28, 2009, 09:23:46 AM
FireDitto, the asterisks for the required fields aren't supposed to show as red until a user has submitted the form without the required fields being filled out.

Spinx Haplo, having a form post to a single thread rather then a board has been discussed and is on the very long to do list that we have for future updates. I'm not sure when we will be able to get it in though.  As far as getting a form to update a table in a single post... Its not impossible but its beyond what this mod was originally created for and due to the specific nature of it, it would probably be best to have it custom designed for your site or at the very least as a separate mod. In which case you should pop it up in the Mod Requests (http://www.simplemachines.org/community/index.php?board=79.0) board.
Title: Re: Custom Form Mod
Post by: Spinx Haplo on June 28, 2009, 10:11:08 AM
Thanks Garou.  I did post in the mod requests, and wasn't getting much of any response.  I finally held my mouth right with a search and came up with your mod.  Sorry I didn't read the entire thread otherwise I would have seen it was discussed before.  Thanks for your effort, as this seems to be an excellent mod.  Even if it put them all in the same thread, I could then modify / compile the posts via moderation.  Not a perfect fix, but doable.  Maybe if the custom form could be embedded into a thread like a poll currently is.  Wish I was better at programming, I would try to assist.

Thanks again
Title: Re: Custom Form Mod
Post by: digit on July 06, 2009, 06:06:39 PM
Is there no way to attach an image?

Also, I have my fields set to required, yet, I fill them ALL in and I get the blank form again, with red asterisks - any idea why?

Thanks in advance.
Title: Re: Custom Form Mod
Post by: Garou on July 06, 2009, 11:48:26 PM
Digit, attachments are not possible at the moment but it is being looked into for the future. It is possible to use the form to link to an image that is hosted elsewhere.
Quote from: Garou on February 22, 2009, 10:34:12 AM
You have to enter parse_bbc in the Extra Type Parameters field for this to work right.

Example...
Title: image
Text: Please enter the link to your image here.   
Type: Text Box (String)
Extra Type Parameters: parse_bbc

Then in the Form Output: you would enter
[img]{image}[/img]

Images will post from the form to your forum this way, no changes to the mod necessary.  :)

The only thing I can think of that is causing the required fields to fail is if there's an error in the CustomForm.template.php. Have you modified or added any custom templates to it? Go a head and attach yours and Ill see if I cant figure it out.
Title: Re: Custom Form Mod
Post by: digit on July 07, 2009, 07:21:19 AM
I don't think I modified it at all...  It is a pretty old version though I am sure....   here it is - thanks....

Also - if you could get image attachment to work, I would use the mod  8)  for my particular application - I NEED it!  :P

THANKS!
Title: Re: Custom Form Mod
Post by: digit on July 07, 2009, 07:53:20 AM
For the record, I just uninstalled v 1.1 and installed 1.4 - and it seems to be working fine now....  but I would LOVE to see an image attachment feature!  8)
Title: Re: Custom Form Mod
Post by: Garou on July 07, 2009, 08:55:56 AM
Like I said its on the to do list. It probably wont make the next version as I'm almost done coding it but if possible I will try to get it in the one after that. Attachments have been asked for here multiple times so if its possible it will be done eventually. :)
Title: Re: Custom Form Mod
Post by: digit on July 07, 2009, 11:56:56 AM
Quote from: Garou on July 07, 2009, 08:55:56 AM
Like I said its on the to do list. It probably wont make the next version as I'm almost done coding it but if possible I will try to get it in the one after that. Attachments have been asked for here multiple times so if its possible it will be done eventually. :)
>:( :-X :-[  ;D

One other request...  a field that is simply a break...  where you can enter some text like ....

<hr> or <br />
Title: Re: Custom Form Mod
Post by: German_AC on July 07, 2009, 12:39:03 PM
Hi, here is the corrected version of spanish language file. There was a problem with the previous version regarding to accents. Sorry.

Title: Re: Custom Form Mod
Post by: FireDitto on July 08, 2009, 05:02:11 AM
Quote from: FireDitto on June 27, 2009, 07:49:00 PM
I'm loving this mod.


My only request at the moment, would be the ability to organise the way in which the Forms are listed, instead of it defaulting to the order you create them in.


As I asked earlier [I think it was missed] is it possible to have the Form List organizable? At the moment they are listed in whatever order they're made in, and my list is quite messy and I'd rather not go through and delete them all simply to tidy it up.

Would this be something you can add to the next release?
Title: Re: Custom Form Mod
Post by: Garou on July 08, 2009, 07:04:29 AM
FireDitto, you are correct I only answered half of your last post. Sorry about that. I don't think it will make the next release but Ill see if its possible for the one after. The ability to reorder the form list is going to be a pretty complicated one to figure out and will take me a little time. It will get done some time in the future and I have actually started working on that as I had the same problem on my test site several months ago.

German_AC, thanks I never would have noticed that as I don't speak the language.  :)

digit, Ive got that one already coded into the next version, there is going to be a "No User Input" field type. That way an admin can enter extra instructions or anything else between the questions in the form.

Just to update the version Ive got coded on my test site now includes a few new field types, the language translations that have been  posted here, a drop down board list so admins no longer have to go looking for board id numbers and the bit I'm working on now is topic icons. The icons are causing me fits, trying to make it work and will be the last bit I put in this version. If I don't get it figured out soon then I'm going to leave it out and try it for the version after.

Title: Re: Custom Form Mod
Post by: FragaCampos on July 08, 2009, 08:03:47 AM
Great work Garou  8)

Just one thing, did you manage to tackle the problem of http:// in image and url tags?
Title: Re: Custom Form Mod
Post by: FireDitto on July 10, 2009, 01:31:34 AM
Quote from: Garou on July 08, 2009, 07:04:29 AM
FireDitto, you are correct I only answered half of your last post. Sorry about that. I don't think it will make the next release but Ill see if its possible for the one after. The ability to reorder the form list is going to be a pretty complicated one to figure out and will take me a little time. It will get done some time in the future and I have actually started working on that as I had the same problem on my test site several months ago.

Okay, that's awesome. I look forward to it!
Title: Re: Custom Form Mod
Post by: bros on July 13, 2009, 12:56:56 PM
Tried to install on SMF 2 RC1-1:
Database Error
Table 'xxxx_smf1.cf_forms' doesn't exist
File: /home/xxxx/public_html/boards/Packages/temp/install.php
Line: 45

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 2.0 RC1-1, while your database is at version 2.0 RC1. The above error might possibly go away if you execute the latest version of upgrade.php.
Title: Re: Custom Form Mod
Post by: Garou on July 13, 2009, 05:50:23 PM
Bros, you will need to manually remove the two cf databases in smf. If you have data in them that you want to use back them up first.

Then install the mod and drop the databases back in. If you dont want to use the old info and want to start fresh then you do not need to install the old DBs.

As for your database not being up to date that has nothing to do with the mod. Look for the thread about upgrading to 2.0 rc1-1 elswhere in this forum.
Title: Re: Custom Form Mod
Post by: bros on July 13, 2009, 06:36:20 PM
Quote from: Garou on July 13, 2009, 05:50:23 PM
Bros, you will need to manually remove the two cf databases in smf. If you have data in them that you want to use back them up first.

Then install the mod and drop the databases back in. If you dont want to use the old info and want to start fresh then you do not need to install the old DBs.

As for your database not being up to date that has nothing to do with the mod. Look for the thread about upgrading to 2.0 rc1-1 elswhere in this forum.

Thanks, that did it.

I didn't need to rerun the upgrader, it just needed to have those tables removed.
Title: Re: Custom Form Mod
Post by: bros on July 13, 2009, 06:58:39 PM
Okay. I know this isn't your job, but this errors with a mod I had made for me: topic description.

An Error Has Occurred!
The database value you're trying to insert does not exist: description

When I try to submit a form.

Would that require the mod to be tweaked around a bit? Maybe add a part to the custom forms table in the DB?

Here is the part that is probably causing the error, with the lines the error log is citing contained in asteriks:

// Insert the post. -Topic description MOD- query modified
$smcFunc['db_insert']('',
'{db_prefix}messages',
array(
'id_board' => 'int', 'id_topic' => 'int', 'id_member' => 'int', 'subject' => 'string-255',  'description' => 'string', 'body' => (!empty($modSettings['max_messageLength']) && $modSettings['max_messageLength'] > 65534 ? 'string-' . $modSettings['max_messageLength'] : 'string-65534'),
'poster_name' => 'string-255', 'poster_email' => 'string-255', 'poster_time' => 'int', 'poster_ip' => 'string-255',
'smileys_enabled' => 'int', 'modified_name' => 'string', 'icon' => 'string-16', 'approved' => 'int',
),
array(
******** $topicOptions['board'], $topicOptions['id'], $posterOptions['id'], $msgOptions['subject'],$msgOptions['description'], $msgOptions['body'],********
$posterOptions['name'], $posterOptions['email'], time(), $posterOptions['ip'],
$msgOptions['smileys_enabled'] ? 1 : 0, '', $msgOptions['icon'], $msgOptions['approved'],
),
array('id_msg')
******** );********
$msgOptions['id'] = $smcFunc['db_insert_id']('{db_prefix}messages', 'id_msg');
Title: Re: Custom Form Mod
Post by: Garou on July 14, 2009, 06:52:52 AM
Ah you are trying to upgrade Rudolph's old mod?

Adding the table in to the Custom Form Mod probably isn't going to do you any good. This mod and a few others that create their own posts like say the RSS feeder mod aren't designed to post a topic description since its not a standard SMF function.

Essentially you would need to adjust the post function of your mod so that if something is posted without data for the description, it would work just like if someone created a post and left the description blank. That would make it work with any mod that creates its own post and not just this one. I would think that would be in the script someplace and not the DB.
Title: Re: Custom Form Mod
Post by: Darnell5 on July 14, 2009, 10:52:52 AM
Love the mod, In the next verion i have a request. could you add an attachment box option so you can add attachments. I use this for a report a hacker/abuse in game servers and it would be awesome if the reporter could upload .dem files. or any other files pictures/zip/rar. have these file types be choosable though so you can specify what can be uploaded.

Thank you for this awesome mod man.

Also if it is already possible to add an attachment to a form could someone tell me how i would do that.
Title: Re: Custom Form Mod
Post by: bros on July 14, 2009, 01:08:37 PM
Quote from: Garou on July 14, 2009, 06:52:52 AM
Ah you are trying to upgrade Rudolph's old mod?

Adding the table in to the Custom Form Mod probably isn't going to do you any good. This mod and a few others that create their own posts like say the RSS feeder mod aren't designed to post a topic description since its not a standard SMF function.

Essentially you would need to adjust the post function of your mod so that if something is posted without data for the description, it would work just like if someone created a post and left the description blank. That would make it work with any mod that creates its own post and not just this one. I would think that would be in the script someplace and not the DB.

How unusual. It works perfectly fine when someone doesn't put a description when creating a topic.
Title: Re: Custom Form Mod
Post by: Garou on July 15, 2009, 10:46:30 AM
Darnell5, attachments have been asked for many times is on the to do list but no promises on when or if it can happen.

bros I don't know what else to tell you, but based on your description of the problem that's what it sounds like.

When the form mod enters something in its own DB its during the creation of the form. It doesn't store any data in its own DB table during posting, all info is passed into SMF's post function and stored in the smf_messages table just like any other post, that is also where your descriptions should be stored. Is it possible that you are storing them in a different table?
Title: Re: Custom Form Mod
Post by: bros on July 15, 2009, 03:25:14 PM
Quote from: Garou on July 15, 2009, 10:46:30 AM
Darnell5, attachments have been asked for many times is on the to do list but no promises on when or if it can happen.

bros I don't know what else to tell you, but based on your description of the problem that's what it sounds like.

When the form mod enters something in its own DB its during the creation of the form. It doesn't store any data in its own DB table during posting, all info is passed into SMF's post function and stored in the smf_messages table just like any other post, that is also where your descriptions should be stored. Is it possible that you are storing them in a different table?

Hmm..

It stores descriptions in smf_messages.
Title: Re: Custom Form Mod
Post by: Jyohan on July 17, 2009, 06:52:34 PM
Hi I'm running 1.1.8 and every time I submit and application it just says "Invalid request variable." i put the board in as 1 then I put 1.0 like the URL says but regardless nothing has worked change it any suggestions?
Title: Re: Custom Form Mod
Post by: Garou on July 17, 2009, 10:21:25 PM
Do you still have a board 1? It may have gotten deleted at some point. There are instructions if you click the [?] next to the Board ID field that tell you how to find the ID for your boards.
Title: Re: Custom Form Mod
Post by: Jyohan on July 18, 2009, 04:22:40 PM
Quote from: Garou on July 17, 2009, 10:21:25 PM
Do you still have a board 1? It may have gotten deleted at some point. There are instructions if you click the [?] next to the Board ID field that tell you how to find the ID for your boards.

I just checked and yes its still listed as board 1.
http://thehighguard.ofthefunk.com/forum/index.php?board=1.0
Title: Re: Custom Form Mod
Post by: bros on July 18, 2009, 09:19:29 PM
Could it be as simple as adding a Description field to the custom form mod where it also puts stuff into the description field?

Like where you specify the title of the topic, you could also specify a description.
Title: Re: Custom Form Mod
Post by: Jyohan on July 18, 2009, 10:04:06 PM
I figured out the problem it apparently doesn't like the title of form fields to be numbers (I had to change 1 to one etc.)
Title: Re: Custom Form Mod
Post by: Garou on July 19, 2009, 10:28:58 AM
bros, that could fix it if you would want to got to that trouble and for your site only . I wouldn't release a mod like that though. There has to be a better fix for it but Id have to see all the code you use for your mod and even then I couldn't make any promises that I could find the fix.

Jyohan, that is very odd. You must be running a mod that causes that problem and stores the board id as a string rather then integer. In any case that should be irrelevant as the next version of this mod will use a dropdown list of your boards rather then making you track down the Board ID. I already have the feature coded into both the 1.x and 2.x version of the mod on my test site, there's just a couple more features I want to finish before I release it.
Title: Re: Custom Form Mod
Post by: nathan42100 on July 22, 2009, 11:34:10 PM
Quick question, can this mod make a post to a forum that a regular user cannot access (aka for support purposes so that confidential info won't be revealed)
Title: Re: Custom Form Mod
Post by: C4G-TK on July 22, 2009, 11:47:45 PM
Yes, it can post into a board that the user and others can't see.  However, it will redirect the person to an error page, since normally it would bring the person to the actual post.  Since the person doesn't have access to where the post/form is posted, the error page shows.  So, you need to inform them via the form that this will happen.

But, it is possible and the form does actually post.
Title: Re: Custom Form Mod
Post by: Ginnas on July 23, 2009, 02:43:41 AM
I just downloaded this and tried to install it to my forum, after uploading it successfully when I go to "Apply Mod" I get the following error.

QuoteThe package you are trying to download or install is either corrupt or not compatible with this version of SMF.

Is this due to the fact that this mod is currently incompatible with version 1.1.10 or is something going wrong with the zip file?

thanks in advance for any response.
Title: Re: Custom Form Mod
Post by: Garou on July 23, 2009, 05:58:20 AM
The truth is I'm not sure. I haven't had time to check what was changed between 1.1.9 and 1.1.10. In theory it should work except the mod is incompatible with anything before 1.1.4 and in the decimal system .10 is the same as .1, so your server is thinking that you are trying to install it on 1.1.1 rather then 1.1.10. That is a mistake in SMF's naming of their versions, they should have named it 1.2 to be mathematically correct or 1.1.11 to follow their current naming structure.

You can either do a manual install using the instructions for version 1.4 of the mod on 1.1.8 that was the last official 1.1.x version the mod was compatible with however it would also install and run on 1.1.9. The other option is to open up the zip file and change the package-info.xml
Change...
<install for="1.1.4 - 1.1.99">
and
<uninstall for="1.1.4 - 1.1.99">
to
<install for="1.1.1 - 1.1.99">
and
<uninstall for="1.1.1 - 1.1.99">

As long as none of the code that they changed effects the mod it should install just fine, otherwise you will have to wait for the next update for the mod, which I'm hoping to have it done in the next few weeks depending on how much time life offline allows me to work on it.  :-\
Title: Re: Custom Form Mod
Post by: Ginnas on July 23, 2009, 08:25:36 PM
Thank you Garou! that worked beautifully.
Title: Re: Custom Form Mod
Post by: tokenn on July 24, 2009, 01:54:13 PM
Thank you for developers, I really love this mod.

However, please someone help me modify the code to link index.php?action=form;id=1 -> when clicking the "New Topic" in corresponding Board(ID).

I knew that this feature will be put in near future, but I really can't wait the new version to have this integration.

Thanks in advance & Cheers.
Title: Re: Custom Form Mod
Post by: Garou on July 25, 2009, 09:04:53 AM
tokenn, This has been asked for many times and is on the to do list. That said, again, I haven't figured out how to do it yet with out breaking the forums altogether. If I could wave a magic wand and make it work along with everything else everyone "needs" the mod to do I would. Sort of that its going to be a while till I get it figured out and there will probably be several releases long before that as there are many features other people want that I already know how to code. Its just a matter of time and knowledge but the best I can promise is someday.
Title: Re: Custom Form Mod
Post by: willerby on July 25, 2009, 01:27:19 PM
Quote from: Garou on July 13, 2009, 05:50:23 PM
Bros, you will need to manually remove the two cf databases in smf. If you have data in them that you want to use back them up first.

Then install the mod and drop the databases back in. If you dont want to use the old info and want to start fresh then you do not need to install the old DBs.

As for your database not being up to date that has nothing to do with the mod. Look for the thread about upgrading to 2.0 rc1-1 elswhere in this forum.

I have this problem too on reinstall using RC1.2

Could you take me through step by step what I need to do to avoid losing existing forms and data. Not sure how to back up data in just two tables and how to 'drop' the data back in. Sorry

Thanks

W
Title: Re: Custom Form Mod
Post by: nathan42100 on July 25, 2009, 03:33:52 PM
Quote from: C4G-TK on July 22, 2009, 11:47:45 PM
Yes, it can post into a board that the user and others can't see.  However, it will redirect the person to an error page, since normally it would bring the person to the actual post.  Since the person doesn't have access to where the post/form is posted, the error page shows.  So, you need to inform them via the form that this will happen.

But, it is possible and the form does actually post.
In /subs/CustomAction.php change line 233 to redirectexit(<put your stuff here>);

that will redirect users when they submit the form to http://myforum.com/index.php?<put your stuff here>

What I did was I installed the custom action mod and had it redirect to action=thanks. Note, <put your stuff here> needs to be in quotes.
Title: Re: Custom Form Mod
Post by: Garou on July 25, 2009, 11:55:17 PM
willerby, its kind of hard to give you a step by step with out knowing what tools your server has for you to use. Many servers have phpMyAdmin (http://www.phpmyadmin.net) to do this sort of thing. If you have access to that then you would use the export function and just choose those two tables to back up, you would use the drop function to delete them, then after you have reinstalled the mod you would use the import function to add your backup back in. Additional info on how to use it can be found at http://docs.simplemachines.org/index.php?board=83.0 or at http://www.phpmyadmin.net

nathan42100, that is a very good suggestion somewhat similar to one I made a while back http://www.simplemachines.org/community/index.php?topic=248871.msg2047400#msg2047400 I just didn't think of using the other mod. I plan on providing a choice of where to redirect your users sometime in the, hopefully, not so far off future. :)
Title: Re: Custom Form Mod
Post by: willerby on July 26, 2009, 11:19:35 AM
Thanks Garou. I think that's all I needed - just not familiar with phrases like 'drop'. I'll give it a shot with PHPMyAdmin

Edit: All fixed. Great mod...still.

W
Title: Re: Custom Form Mod
Post by: nathan42100 on July 28, 2009, 01:00:46 AM
Quote from: Garou on July 25, 2009, 11:55:17 PM
willerby, its kind of hard to give you a step by step with out knowing what tools your server has for you to use. Many servers have phpMyAdmin (http://www.phpmyadmin.net) to do this sort of thing. If you have access to that then you would use the export function and just choose those two tables to back up, you would use the drop function to delete them, then after you have reinstalled the mod you would use the import function to add your backup back in. Additional info on how to use it can be found at http://docs.simplemachines.org/index.php?board=83.0 or at http://www.phpmyadmin.net

nathan42100, that is a very good suggestion somewhat similar to one I made a while back http://www.simplemachines.org/community/index.php?topic=248871.msg2047400#msg2047400 I just didn't think of using the other mod. I plan on providing a choice of where to redirect your users sometime in the, hopefully, not so far off future. :)
Turns out redirectexit works with full urls also
Title: Re: Custom Form Mod
Post by: Garou on July 28, 2009, 08:53:55 AM
willerby, glad you are all fixed up. :)

nathan42100, you are quite correct.  :)
Title: Re: Custom Form Mod
Post by: GhostRider2110 on July 30, 2009, 12:14:43 PM
Base system:
SMF 1.1.9
TP 1.0 B4

I have something I want to do with my SMF/TP forums.  I just installed the following mod:
Custom Form Mod      1.4  And I like what it does.  One of the things I am trying to offer is to allow the Contest Directors around the country an easy way to post the info about the contest and have it added to the calendar.

Maybe this mod have that ability already and I just have not found the right way to apply it, but I would like for me to be able to build a form, where the specific info is asked for, then processed as a forum post and the event linked to the calendar.

How hard would this be to accomplish?

Thanks love the mod!!!

--Mitch

Title: Re: Custom Form Mod
Post by: Garou on August 01, 2009, 11:35:21 AM
While I wont say its impossible, it doesn't really fit the function of the existing mod. To be honest I like the idea but I think it would be better off as a separate calendar mod. None the less Ill add it to the list of things to check out but no promises.
Title: Re: Custom Form Mod
Post by: Garou on August 02, 2009, 08:47:06 AM
Mod Updated to Version 1.5

Replaced Board Id entries with a select box containing the actual boards on your forum. This should make it easier for Admins to find the board that they want the form to post to.

Added New Field Type Info Box. This allows you to display text throughout the form without requiring any user input.

Added New Field Type Radio Box. Thanks to mang (http://www.simplemachines.org/community/index.php?action=profile;u=181176) for supplying the code to make this possible. Like a Selection Box it will allow the user to chose from various items. Enter the list of items you want separated by commas in the Extra Type Parameters field. None of the items will be preselected. Note that this field type can not be required.

Priorities for the next version(s) will be...
thread icons that the Admin can select for a form.
the ability to choose where to redirect your users after they submit a form.
the ability to rearrange the form list.
the ability for users to add attachments through a form.

Of course there are no promises on what will actually be in the next version or when it will be released, this is just what I am trying to focus on. :)
Title: Re: Custom Form Mod
Post by: willerby on August 02, 2009, 02:07:24 PM
Good work garou. Will upgarde and let you know how it goes...
Title: Re: Custom Form Mod
Post by: FragaCampos on August 02, 2009, 07:33:58 PM
Well done, Garou. Thanks a lot for your effort!
I'll give you feedback as soon as possible.
Title: Re: Custom Form Mod
Post by: Rafferty on August 02, 2009, 10:14:00 PM
I have to add this manually but doesnt work with smf parser?
Title: Re: Custom Form Mod
Post by: Garou on August 03, 2009, 10:35:52 AM
Sure it does

2.0 RC1.2
http://custom.simplemachines.org/mods/index.php?action=parse;mod=1279;attach=109551;smf_version=2.0_RC1.2

1.1.10
http://custom.simplemachines.org/mods/index.php?action=parse;mod=1279;attach=109550;smf_version=1.1.10

If your using an older version of SMF you really should upgrade, due to security risks, but the code should work on earlier versions. In fact I wrote it on RC 1.1 and 1.1.9 then tested it on the latest versions to make sure it would work.
Title: Re: Custom Form Mod
Post by: Rafferty on August 03, 2009, 11:39:30 AM
thank you, dunno what happened then when i clicked the link, it said it wasnt compatable or something.



ps: probably because I'm dumb, I had selected version for smf 2 and parse for 1.1.10 duh
Title: Re: Custom Form Mod
Post by: Garou on August 03, 2009, 11:08:23 PM
Thanks for the complements guys  :)

Rafferty, don't feel too bad Ive made that mistake a few times myself. :)
Title: Re: Custom Form Mod
Post by: willerby on August 04, 2009, 09:31:47 AM
Hi Garou,

Can you help me with the hard code change required to redirect different forms to different pages?  I haven't upgraded yet to the latest version (does that do this?) as have an number of edits on the older one. What I need is an if statement on the redirect after creating the post - something like:
      
IF formID=1 THEN redirectexit(this_page) ELSE redirect exit(that_page)

Sorry I can't quite get the syntax and code right despite a few attempts...

Thanks

W
Title: Re: Custom Form Mod
Post by: Garou on August 04, 2009, 10:20:25 AM
Try...

// redirect from form 1
if ($form_id = '1')
redirectexit();

else

// Redirect this user to the board.
redirectexit('board='.$board.'.0');


I havent tested but it might also be...
if (ID_FORM = '1')

But it should be something along those lines.
Title: Re: Custom Form Mod
Post by: willerby on August 05, 2009, 04:17:51 PM
Sorry Garou, tried both (latter gives a parse error) and former not changing redirect at all even after emptying file cache??? Have also tried without apostrophes... I don't know which variable and syntax I should be picking up in the code

Any other suggestions (sorry)

W
Title: Re: Custom Form Mod
Post by: willerby on August 05, 2009, 06:10:37 PM
Found an alternative. The redirects I wanted were to pages created with CustomPages mod...

By numbering the pages in line with the form id I could call the respective ones as follows:

redirectexit('action=page;sa=PageName' . $form_id);

For Custom Form id=1 it redirects to /.../PageName1
For Custom Form id=2 it redirects to /.../PageName2

Thanks for trying to help with the IF/ELSE. Not sure why it didn't work as it seems to be correct. Anyway, solved.

W
Title: Re: Custom Form Mod
Post by: Garou on August 05, 2009, 11:41:31 PM
Well that's what I get for trying to pull it off the top of my head. At least you got it working the way you want. I hope to get the selectable redirect feature in the next version.
Title: Re: Custom Form Mod
Post by: C4G-TK on August 11, 2009, 02:37:21 PM
Running SMF 2.0 RC1.2 on default


I uninstalled the 1.4 version of the mod and tried the 1.5 version.  First thing that I came across was it saying my database was not running current to RC1.2, but still at RC1-1, so I updated that over the weekend.  completed

Next thing, when installing the mod, I got an error stating that the table for cf_forms didn't exist, so I checked my database and it was there since I had the older version already installed.  I went ahead and deleted the two tables cf_forms and cf_fields from the older mod since I only had two forms created and didn't mind doing them over again.  I went ahead and installed and it completed the install.  completed

Now, I did have two failed tests in the install.  Sources/Admin.php (2nd edit) which failed because I had Simple Portal installed in the same area.  This is the way that I manually edited that part.

// Load the language and templates....
loadLanguage('Admin');
loadLanguage('SPortalAdmin', sp_languageSelect('SPortalAdmin'));
loadLanguage('Ads');
loadTemplate('Admin', 'admin');
loadLanguage('Modifications');


The other failed test was in Sources/ManageSettings.php (1st edit), but for the life of me I can not find the correct area to do this edit.  I'm assuming another mod has altered the code that I am to find.  I'm going through the 2K+ lines of code line by line in order to complete the manual edit needed.

Nevermind I GOT IT!!!!!!!!!!!!!!  WOOHOO!!
:-*


Title: Re: Custom Form Mod
Post by: C4G-TK on August 11, 2009, 08:16:57 PM
Ok, I have one problem afterall... I'm showing "TITLE" twice in the mod.  Where do I go to correct this?
Title: Re: Custom Form Mod
Post by: =<|Skary|>= on August 12, 2009, 12:03:31 AM
I need this for a clan application. I just want to set it up so that peeps can enter in:
name
age
location
email
how did you hear about us?
reason for wanting to join
etc.
etc.

i clicked "add new form". in the fields i entered in:
Title...........................................Name
Board ID....................................Admins only
Custom Template Function........BLANK    
Permissions...............................regular members
Subject......................................name
Form Output..............................?

what did i do wrong and/or what next. I don't see anything alloowing me to place it in any specific board or post.
Title: Re: Custom Form Mod
Post by: Garou on August 12, 2009, 10:51:37 AM
C4G-TK,  look for...
<input type="text" name="form_title" id="form_title" value="', $context['custom_form_settings']['form_title'], '" />

in the CustomForm.template.php

Skary|, Have you read http://www.simplemachines.org/community/index.php?topic=248871.msg1633514#msg1633514
Title: Re: Custom Form Mod
Post by: C4G-TK on August 12, 2009, 12:39:28 PM
Ignore my PM, I ended up deleting the following:

<td class="windowbg2" valign="top" width="16"><a name="setting_form_title" href="', $scripturl, '?action=helpadmin;help=CustomForm_form_title" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.gif" alt="', $txt['help'], '" border="0" align="top" /></a></td>
<td class="windowbg2" valign="top"><label for="board_id">', $txt['title'] , '</label></td>
<td class="windowbg2" width="50%">
<input type="text" name="form_title" id="form_title" value="', $context['custom_form_settings']['form_title'], '" />


and it eliminated the 2nd repeated line.


(I still love this mod!! You guys did a great job.)
Title: Re: Custom Form Mod
Post by: =<|Skary|>= on August 12, 2009, 10:08:06 PM
i did not see that. that's exactly was i was looking for. thank you very much.
Title: Re: Custom Form Mod
Post by: nathan42100 on August 14, 2009, 02:34:10 PM
In the 2.0RC1.2 version ( don't know about the 1.1.x version), a required checkbox gets the * but is not required. If anyone can help me fix this, that'd be great!
Title: Re: Custom Form Mod
Post by: C4G-TK on August 14, 2009, 06:20:29 PM
@ Garou

The permissions are still getting wiped out as described in previous posts.  I'm not sure if that was still on your to-do list or not. 

When you set permissions in the CF area when creating forms and then later go into the permissions of specific membergroups, it still erases the permissions of the forms when you save.  You have to then go back into the CF admin area to reset that membergroup on all the forms and the main form setting itself again.  I know it isn't a huge deal, but it gets quite tedious.
Title: Re: Custom Form Mod
Post by: Garou on August 15, 2009, 09:00:07 PM
The two bugs still on my to do list are that one and the one where if you put a $ in a text box it interprets it as a variable. I just haven't figured out the answer to either yet.
Title: Re: Custom Form Mod
Post by: nathan42100 on August 15, 2009, 09:05:29 PM
I fixed it, in CustomForm.php
Find something along the lines of:
// Do a small fix for the last line, if this is a checkbox.
if($field['type'] == 'checkbox'){
$data[$i]['value'] = isset($_REQUEST[$field['title']]) ? $_REQUEST[$field['title']] : false;


Add after:
                    if (($required) && (!$data[$i]['value']))
                    {
                        // Do the 'fail form/field' stuff.
                        $data[$i]['failed'] = true;
                        $fail_submit = true;
                        continue;
                    }


And that $ bug applies to all html with double quotes in it as well, single quotes work fine.

Also something I fixed is the fact that textareas in the template have no size set so they are damn small.
Title: Re: Custom Form Mod
Post by: Garou on August 16, 2009, 07:19:20 AM
Thanks nathan42100, Ill get that in the next update.
As for the input areas, I did increase the size of the large text box some in the last update. As for the other input boxes I didn't enlarge them due to the fact that they are supposed to be for shorter answers. 
Title: Re: Custom Form Mod
Post by: nathan42100 on August 16, 2009, 09:54:32 PM
I meant textareas as in the large text boxs for extended answers
Title: Re: Custom Form Mod
Post by: FragaCampos on August 17, 2009, 08:33:33 AM
Hi there.
What happens to my present forms if i install the last update?
Title: Re: Custom Form Mod
Post by: nathan42100 on August 17, 2009, 08:54:27 AM
Quote from: FragaCampos on August 17, 2009, 08:33:33 AM
Hi there.
What happens to my present forms if i install the last update?
Hopefully nothing, since updates don't erase the database. Upgrading from 1.1.x to 2.0 is a different story...


Also, @Garou (who I am assuming now updates this mod), as my own personal update I also made it that any fields named password show up as the dotted field (input="password" I think). Maybe it would be worth it for the next update to have anyfield that is named pw_somethinghere show up as a passworded field.

And a second note, for the next update, check boxes shouldn't treat the extra parameter 'required' as an option for when it is checked (aka, check box with extra parameter of just required shows up as 'required' in post when the box is checked, no when it isn't unless you set the extra parameters to Yes,No,required
Title: Re: Custom Form Mod
Post by: Garou on August 17, 2009, 02:23:42 PM
FragaCampos, look for my instructions a few posts back about how to backup and reinstall the databases. Your going to get the same DB errors that normally happen with this mod and several others. SiNaN sugested a way to fix that I just have to rip apart Simple Portal and see how they are getting around it for sure.

nathan42100, the reason I haven't added the password input type as it wont provide true password protection. Sure it hides the info from someone looking over the users shoulder but if I were to provide the proper encryption it would also display as encrypted in the post, which is useless to the person reading the post. If it were posting directly to a data base field rather then the post form it would be worthwhile. As is it just provides a false sense of security for the user.

Ill look into the check box thing. I don't remember it doing that in earlier versions so something I may have added along the way may be causing it. Luckily I have copies of older versions on hand to cross reference.

As far as me being responsible for updating the mod, I have done the last three updates but its still LHVWB/Nathanial's mod. He has a complete rewrite planned for it, when he gets the time to do it and I'm going to guess after 2.x goes gold as there are some big changes planned. From what I understand they may not necessarily effect how SMF works on the outside but it will effect how some mods and themes are written. None the less till LHVWB finishes his rewrite I'm doing what I can to keep this version up to date with current versions of SMF and adding improvements where I can.
Title: Re: Custom Form Mod
Post by: C4G-TK on August 17, 2009, 10:29:12 PM
With the Radio Buttons, is there any way it could be made to enable more than one selection?  All the "types" allow one selection, but the Radio Button seems like it could have the ability to have multiples.

An example would be where the question was select "all that apply" and the ability to have a list as Radio Buttons where the person could select more than one choice.

(If this has already been presented, I'm sorry for repeating.  I skimmed over as well as I could.)

Title: Re: Custom Form Mod
Post by: Sabre™ on August 18, 2009, 02:17:53 AM
Great job!
This mod is what I've been waiting on for a while, and I didnt even realise it was already here!! lol

Cheers :)
Title: Re: Custom Form Mod
Post by: Garou on August 18, 2009, 07:35:42 AM
Thanks Sabre, I plan on improving it even more.

C4G-TK, I was working on multiple select boxes and radio buttons, it was one of the things that was holding up this last update, finally I decided to skip them this time around. My problem has been while I can get the option to select multiple items, it only posts the last one selected.

Soon as I figure it out, multi-select will be implemented for both.
Title: Re: Custom Form Mod
Post by: C4G-TK on August 18, 2009, 09:32:24 PM
@Garou

I wish I knew enough to help you with stuff.  I guess I'll stick to being quality control.  LOL ;)
If there's something you want me to test, let me know.
Title: Re: Custom Form Mod
Post by: Largo_npc on August 23, 2009, 07:20:55 AM
This is just what I've been looking for!

My only question is, how would I alter it to post in 2 forum sections?

I'm using it as an Application Form and I want to application to post in the Recruitment section AND another Private Section with a slightly different Subject if possible (although the subject doesn't fully matter).

EDIT:

Nevermind, found it. Easy edit.
Title: Re: Custom Form Mod
Post by: mpp on August 25, 2009, 06:11:59 AM
I like this mod, but have a couple of requests....

when creating new fields for a form, could the "Text" field be expanded to a "big text field" input type box?

And how do you make fields with drop down boxes / radio buttons required fields?  Maybe that would be better as a check box in the "features and options" -> Custom forms page.  Once you have all your items setup, can just check off everything that is required.

I'm using this for an MMO guild application form, and would also like for the person submitting the form to be able to change the subject title to append their name/level/etc, but if you could make it to pull that info out of the form from the, say {name}, {level}, {class} stuff I have in my form, that would be perfect.

And for a required checkbox item, if they don't check that item, it shouldn't default to no.  It should require them them to check it or abandon the form (e.g. "Do you agree to these terms?"  [ ])

Thanks.

running 1.1.10 board version if that makes any difference....
Title: Re: Custom Form Mod
Post by: ginjack on August 25, 2009, 05:43:57 PM
any way that an option could be added to put a member in a specific membergroup upon completion of a form?

we're using this as a guild/clan application form, as well as to post member introductions in our forums

It would be great if the mod could move someone to an "application pending" membergroup once the form is posted.

Thx!
Title: Re: Custom Form Mod
Post by: Garou on August 25, 2009, 08:24:05 PM
Largo_npc, feel free to share your fix. Others have asked for this but we haven't had time to code it for the mod yet. It would be helpful to others that want it sooner and if we use your fix you'll get credit for it.

mpp, to adjust the size of the Large Text Box however you can edit the CustomForm.template.php in your themes folder.

Look For...
// Large Text box?
elseif ($field_data['type'] == 'largetextbox')
{
echo '
<textarea rows="5" cols="45" name="', $field_name, '">', $field_data['value'], '</textarea>';
}


rows="the length of the field", cols="the width of the field". Note this will effect all your Large Text boxes.

There is no required function for Select or Radio Boxes at present. However as a default a Select Box will automatically post the first option listed in the box unless the user selects something else. Radio Boxes do not have anything preselected and will post nothing unless the user selects something.

You can use {title} in the Subject box of the forms settings just as you suggest. ie...
Application for: {name}, Level {level}, {class}.

Required Check Boxes is a known bug and should be fixed in the next update.

ginjack, Ill add that to the list of things to look at.
Title: Re: Custom Form Mod
Post by: angelclawdust on August 25, 2009, 08:33:02 PM
ok im really struggling to get this to post to the forum.....
ive followed the intro on one of the pages and made everything like it said (just changing it to match) but everytime i goto submit the form it just refreshes and says in red at the bottom *required Fields...

i removed all the ones i selected as required so nothing in the form is required anymore but it still does it

do i need to have at least 1 field required?? or have i done somin wrong....

the form can be found at ::    angelclawdust.net23.net/testforumfg/index.php?action=form   ::

any help would be appreciated and thanks in advance
Title: Re: Custom Form Mod
Post by: Garou on August 26, 2009, 11:59:43 AM
hmm that is perplexing. Have you made any modifications to the CustomForm.template.php? Did everything install properly, was there any test failed?

Whats really odd is that even if a required field was not filled in, when the mod pops back to the form any fields that were already filled in should remain as they were filled in previously. Since there is nothing required it should just post.

Have you tried to uninstall and reinstall. Remember that when you uninstall you have to remove the two cf_ databases using phpMyAdmin or some other database management utility. You could back them up and drop them back in but at this point I would just try a fresh install.
Title: Re: Custom Form Mod
Post by: angelclawdust on August 26, 2009, 12:33:24 PM
yes ive done all of the above accept touched the custom template file.......

upon attempting to reinstall i get::

1.     Execute Code     install.php     
2.    Execute Modification    ./index.php    Test successful
3.    Execute Modification    ./Sources/ModSettings.php    Test failed
4.    Extract File    ./Sources/CustomForm.php    
5.    Extract File    ./Themes/default/CustomForm.template.php    
6.    Execute Modification    ./Themes/default/languages/Modifications.english.php    Test successful
7.    Execute Modification    ./Themes/default/languages/Help.english.php    Test successful
8.    Execute Modification    ./Themes/default/languages/Modifications.english-utf8.php    Skipping file
9.    Execute Modification    ./Themes/default/languages/Help.english-utf8.php    Skipping file

any suggestions??
Title: Re: Custom Form Mod
Post by: Garou on August 26, 2009, 10:47:46 PM
You'll probably need to enter those changes by hand. Tell the mod to install install anyway and then use http://custom.simplemachines.org/mods/index.php?action=parse;mod=1279;attach=109550;smf_version=1.1.10 to fill in the blanks. It should be fairly simple I'm just going to guess that another mod you might have installed is causing the conflict.

If you run into problems attach your ModSettings.php and Ill fix it up.
Title: Re: Custom Form Mod
Post by: alfzer0 on August 27, 2009, 03:53:14 AM
For awhile I was procrastinating making my personal additions/tweaks to this mod, but I started up again this past weekend and am working on some great new features to hopefully soon share.

The biggest one that I started and completely finished tonight is displaying a selectbox of available forms on the message index page!  ;D ;D ;D   The code isn't specific at all to my forum so should be able to just drop into the mod.  Although I'm not sure I followed SMF's coding guidelines, but I went by example as much as I could.

Other new features are a subject box on the form submission page that updates in real-time according to the users input (if you used any fields in the subject of course), a counter for the subject which shows how many characters they have remaining, being able to have the first option in selectboxes be blank (so users must pick something instead of leaving the default option cause they are lazy), being able to display a postbox w/ smileys/bbc buttons/etc. as an option of large text boxes.  The code for all this is functional, but is in various stages of completion.  Also as mentioned before, none if it is specific to my forum, so should be able to "drop in" to the current code.

I plan to release all this once I've finished the features in the last paragraph (or given up cause the full implementation proves to be too difficult, but I've been picking up writing PHP/JavaScript for SMF pretty well these last few days).

Sorry to be a tease,
-Jeff
Title: Re: Custom Form Mod
Post by: angelclawdust on August 27, 2009, 07:07:15 AM
ok ive done tht but only did it for the modsettings.php file and its still the same so ive attached the file for you

Title: Re: Custom Form Mod
Post by: Garou on August 27, 2009, 11:38:01 AM
alfzer0, I cant wait to see what you have come up with.

angelclawdust, I have no clue whats going on here and I haven't been able to recreate the problem on my test server. Are you receiving any errors in your logs? What other mods do you have installed?
Title: Re: Custom Form Mod
Post by: Garou on August 27, 2009, 02:08:28 PM
angelclawdust, I figured it out. You are using capital letters and spaces in the Title fields.  Its been stated several places in this thread and it should be listed in the Title help files designated by [?] next to the field that this can cause issues.

I haven't looked into a fix for this nor am I sure that there is one, due to the way the info gets processed into a post. That said titles are really just designations seen only by the admin and processed by the form and SMF.

Since your users never see this part of the form its best just use a short simple designation such as fieldname or field_name as designations like FieldName, field name, and Field Name almost always cause problems.
Title: Re: Custom Form Mod
Post by: angelclawdust on August 27, 2009, 09:11:03 PM
ok thanks its all good now ty :D

sry to have been a pain lol i must have missed that bit while being too busy to figure it out lol

thanks again - gr8 mod :D
Title: Re: Custom Form Mod
Post by: Largo_npc on August 29, 2009, 08:09:32 PM
I'm on my iPod at the minute so can't do much but as soon as I can get to a pc I'll post what I did to fix it.

For those who know what they are doing and can't wait though. In one of the files where the create topic function is called, I just copied that function and the array which was being passed and edited that slightly. The second board I'd and part of the topic is hard coded in to it though. Hope that helps for now.
Title: Re: Custom Form Mod
Post by: Largo_npc on August 30, 2009, 01:34:15 PM
Ok, here's what I did.

I wouldn't suggest it for people who don't know what they're doing.

Sources/CustomForm.php

After
$posterOptions = array(
'id' => $user_info['id'],
);

Add:
$msgOptions2 = array(
'id' =>  0,
'subject' => "[APPLICANT] " . $subject . " (Opinions)",
'body' => $output,
'smileys_enabled' => true,
);

$topicOptions2 = array(
'id' => 0,
'board' => 8,
'mark_as_read' => true,
);


After            
// Finally create the post!!! :D
createPost($msgOptions, $topicOptions, $posterOptions);

Add
createPost($msgOptions2, $topicOptions2, $posterOptions);

Change 'board' => 8, to the ID of the second board you want posting to.
Alter the subject as needed too.

This is just a quick hack I did for myself. To make this customisable you'd likely want to add an array of board IDs and change createPost function slightly.
Title: Re: Custom Form Mod
Post by: Garou on August 30, 2009, 10:58:22 PM
Very interesting. I do have two questions though.

Does this force all forms to use two boards or is the 2nd board optional?
Do they have to manually add columns to the cf_forms table for the extra board ID and  subject?

Ill get and test it out later and see what, if anything, needs to be changed in it before officially adding it to the mod. I just wanted the info to be made available to those that might want to add it in their own beforehand. :)
Title: Re: Custom Form Mod
Post by: Largo_npc on August 31, 2009, 07:49:30 AM
It WILL force the mod to post on both boards.

As you can see from this part that I added
$topicOptions2 = array(
'id' => 0,
'board' => 8,
'mark_as_read' => true,
);


I've taken away the part which gets the user's setting for which board to post on and just hard coded which board to use ('board' => 8,).
In order to realistically use this in your mod, you'll have to add another option for "Enable Second Board" and "Second Board ID", then add something like
$topicOptions2 = array(
'id' => 0,
'board' => *GET SECOND BOARD ID*,
'mark_as_read' => true,
);


And then wrap all of what I added in an If statement like if ($second_board_enabled)

Obviously what I posted there is pseudo code, but I'm sure you can figure out a way.

As for the cf_forms bit...I have no idea what cf_forms table is tbh. The only changed I made were those I posted previously.

My cheap hack has no editable options from Admin panel at all, they are all hard coded for my needs, but it would be easy to add the needed options into the admin section.
Title: Re: Custom Form Mod
Post by: Garou on August 31, 2009, 08:42:23 AM
I agree its all easy enough to do for some and it will be in there when I get the time to add the feature to the mod. In fact just by looking at your code I was pretty sure of what it exactly did, I just wanted to make it known to those that might try to do it on their own. Great examples though  :)
Title: Re: Custom Form Mod
Post by: bros on September 01, 2009, 10:11:28 PM
I found a bug.

When filling out a form, and the input is a text box (string) and for example, you put $188,890,768.43 in, it will put out this: 8,890,768.43

It also doesn't like 0 to be entered
Title: Re: Custom Form Mod
Post by: Garou on September 01, 2009, 11:09:18 PM
Yeah that bug was brought to my attention several pages back. I still haven't been able to track down why it happens or what is needed to fix it.

You can try this work around I came up with at the time.
Quote from: Garou on March 13, 2009, 07:50:47 PM
Ok I think I got it, hope this works for you.

Title: dollar_sign
Text: Please enter the your cash on hand. <span style="float:right">$</span>
Type: Text Box (Float)
Extra Type Parameters:

Form Output: Cash on hand ${dollar_sign}

In the form you will see...
Please enter your cash on hand.              $[              ]

And lets say the user enters 15.27

Then in the forum post it would display as...
Cash on hand  $15.27

That's the best work around I can come up with.
Title: Re: Custom Form Mod
Post by: mpp on September 02, 2009, 05:20:10 AM
Thanks for the quick reply to my previous message Garou...

Put  this live on my forum, and someone managed to trigger a few "Hacking attempt" messages in my error log with it.  I tracked it down to the user inputing this:

it\'s

In a field.  The combination of a backslash followed by an apostrophe is what triggers it.  Although any backslash without an apostrophe seems to be stripped out of the final message that gets posted.  And "it's" alone goes through just fine.

I'd be fine with stripping of any meta characters that could cause problems if a real fix isn't easy.
Title: Re: Custom Form Mod
Post by: Garou on September 02, 2009, 01:18:07 PM
Ill look into it but I dont think that was an actuall hacing attempt. Thats standerd html code for entering "it's" which many forms require the user to enter to pass an appostrophe. Id have to see what else they tried to enter.
Title: Re: Custom Form Mod
Post by: FragaCampos on September 02, 2009, 02:29:50 PM
Following a topic in the portuguese board, margarett  (http://www.simplemachines.org/community/index.php?action=profile;u=41895) managed to get the following solution to the redirection to forms via new topic button:

Go to the MessageIndex.template.php of your theme and find

   // Create the button set...
   $normal_buttons = array(
      'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;sesc=' . $context['session_id']),
      'notify' => array('test' => 'can_mark_notify', 'text' => 125, 'image' => 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';sesc=' . $context['session_id']),
      'new_topic' => array('test' => 'can_post_new', 'text' => 'smf258', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0'),
      'post_poll' => array('test' => 'can_post_poll', 'text' => 'smf20', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
   );


and replace

Code (replace) Select
   // Create the button set...
   if ($context['current_board'] != 82)
   {
      $normal_buttons = array(
         'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;sesc=' . $context['session_id']),
         'notify' => array('test' => 'can_mark_notify', 'text' => 125, 'image' => 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';sesc=' . $context['session_id']),
         'new_topic' => array('test' => 'can_post_new', 'text' => 'smf258', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0'),
         'post_poll' => array('test' => 'can_post_poll', 'text' => 'smf20', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
      );
   }
   else
   {
      $normal_buttons = array(
         'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;sesc=' . $context['session_id']),
         'notify' => array('test' => 'can_mark_notify', 'text' => 125, 'image' => 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';sesc=' . $context['session_id']),
         'new_topic' => array('test' => 'can_post_new', 'text' => 'smf258', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=form;id=1'),
         'post_poll' => array('test' => 'can_post_poll', 'text' => 'smf20', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
      );
   }




Where you have to change the if ($context['current_board'] != 82) part with the id of the board you want to use this redirection and action=form;id=1 for the number of your form.

It worked on my forum :)
All the credit to margarett  (http://www.simplemachines.org/community/index.php?action=profile;u=41895). Hope it's useful  8)
Title: Re: Custom Form Mod
Post by: Garou on September 03, 2009, 11:22:48 AM
FragaCampos That's good and it works as manual quick fix, for an individual site. I couldn't include it in the mod that way though.

The code I have in mind for the mod would have a selectable option for the redirect in the forms settings that one could turn on and off. Then the code for the board would have to check to see if the option was turned on for that board in order for it to redirect. The code for the form settings would also have to check to make sure another form isn't already redirecting the new topic option for the board.

mpp, as of yet I haven't been able to reproduce the error.
Title: Re: Custom Form Mod
Post by: FragaCampos on September 03, 2009, 06:07:50 PM
QuoteThe code I have in mind for the mod would have a selectable option for the redirect in the forms settings that one could turn on and off. Then the code for the board would have to check to see if the option was turned on for that board in order for it to redirect. The code for the form settings would also have to check to make sure another form isn't already redirecting the new topic option for the board.

Of course this would be just great, but untill you don't figure it out, this is a good "quick hack" that works and, in my case, is gold over blue for my forum.
With the attachment option would be even better  O:) ;D
Title: Re: Custom Form Mod
Post by: tonnybarros on September 04, 2009, 09:46:51 AM
Staff have installed the MOD on SMF 2.0 and worked OK, but I translated the MOD in Modifications.portuguese_pt-utf8.php but still all in English, how can this happen?

I'm from Brazil and the translation was made by Google
Title: Re: Custom Form Mod
Post by: Garou on September 04, 2009, 10:41:28 AM
If you entered the file through c-panel, ftp or some such then you need to clear the cache in SMF.
Admin -> Maintenance -> Routine -> Empty the file cache
Title: Re: Custom Form Mod
Post by: mpp on September 05, 2009, 05:00:26 AM
Quote from: Garou on September 03, 2009, 11:22:48 AM

mpp, as of yet I haven't been able to reproduce the error.

You can try it on my forum...

http://alarius.mppsystems.com/board/index.php?action=form;id=1 (http://alarius.mppsystems.com/board/index.php?action=form;id=1)

Try entering it\'s in the Weekly play times field.  You will have to register to use the form.

SMF 1.1.10 is the version I'm running.

Title: Re: Custom Form Mod
Post by: Garou on September 05, 2009, 08:49:39 PM
That is interesting. I still haven't been able to get mine to do that. It just passes the entire "it\'s" through to the post.

Have you made any adjustments to the mod? Outside of that it could be another mod or something in the theme. Outside of that is there some reason that someone other then some sort of Spam Bot would actually need to enter that type of comment? Like I said traditionally that is HTML code that tells a server to treat the apostrophe as actual text rather then interpreting it as code.
Title: Re: Custom Form Mod
Post by: mpp on September 06, 2009, 03:39:11 AM
I've installed the mod without any changes.  And its not a big deal if you can't track it down, or its something with the theme thats installed.  It simply got triggered by someone making a typo in the form, but figured I'd report it.  Thanks for trying!
Title: Re: Custom Form Mod
Post by: tonnybarros on September 08, 2009, 01:53:06 PM
Solved
Title: Re: Custom Form Mod
Post by: Reinaldo23 on September 12, 2009, 12:23:30 AM
hi i have a doubt:
I installed the system tags as I do to create a form to fill out the field labels (the new Topic)?

thank you very much in advance and for this excellent work ;)
Title: Re: Custom Form Mod
Post by: Garou on September 12, 2009, 02:53:07 AM
Reinaldo23, I'm not sure if I understand what you asking for.

If you are asking how to create a form, try...
http://www.simplemachines.org/community/index.php?topic=248871.msg1633514#msg1633514

If you are asking about using the new topic button to redirect to a form, try
http://www.simplemachines.org/community/index.php?topic=248871.msg2241024#msg2241024

Title: Re: Custom Form Mod
Post by: Reinaldo23 on September 13, 2009, 10:57:00 AM
I have this mod

http://custom.simplemachines.org/mods/index.php?mod=579


as I fill in a form field which brings the mod tags
Title: Re: Custom Form Mod
Post by: Garou on September 13, 2009, 06:50:44 PM
Are you asking to include the Tagging System into the Custom Form Mod?

If that's the case, I have to say no. At the very least not anytime soon. There are too many other features to include in the Custom Forms Mod itself without having to include features from other mods. Sorry.
Title: Re: Custom Form Mod
Post by: Reinaldo23 on September 13, 2009, 07:55:06 PM
not only want to create a form to fill in the form of tag system
Title: Re: Custom Form Mod
Post by: C4G-TK on September 14, 2009, 12:17:48 AM
How do I go about changing the display of the form?

I'm not talking about the post that is made, but the form page that appears AFTER you select the form you want to see.

Currently, it is pulling the background color and I would like it to pull the same info as the rest of the form itself.

I want the dark brown area that is circled to be the same as the other part of the container.

Title: Re: Custom Form Mod
Post by: Garou on September 14, 2009, 01:18:19 PM
That's odd, what did you change to get there?

In the CustomForm.template.php...
Through out the default template: function form_template_submit_form() you should see several instances of class="windowbg2". They all should be the same except at the top where it says,  class="titlebg" having that as a different class will highlight the title area better.

You could use any type of style info like...
<tr style="background-color:brown;>
...but I would recommend adding a new class to the bottom of your themes style.css

Something like...
.mybg
{
color: #000000;
background-color: brown;
}


Then change class="windowbg2" to class="mybg"

I would also recommend creating a Custom Template Function of your own for this. Copy this...
// Begin: Racing League Form Template

function form_template_racing_form()
{
global $context, $txt, $settings, $scripturl;

// Starting text for the form and tables. Don't muck with this unless you need to change the style!!!  ;)
echo '
<form action="', $context['post_url'], '" method="post" accept-charset="', $context['character_set'], '">
<table width="80%" border="0" cellspacing="0" cellpadding="0" class="tborder" align="center">
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="4" width="100%">
<tr class="titlebg">
<td colspan="3">', $context['settings_title'], '</td>
</tr>';

   //   Here you can add information at the top of your form, if you want to...
   /* echo '
<tr class="windowbg2">
Example of something above the form title area.
</tr>
<tr>
<td colspan="3"  class="windowbg2">
Example of something at the top of the form.
</td>
</tr>';*/
   // End of information in the top section.

// Documentation for the contents of each $field_data array, or entry into the $context['fields'] array.
/*
$field_name = The name of the field, straight from the value stored by the admin in the admin settings area;
$field_data = array(
'text' => This is the text which needs to be displayed next to the setting.,
'type' => The type of input which the field is ,
'value' => The value of the field, if this is not the first attempt at submitting the form,
'data' => The list of options - only for the selection box type,
'required' => A boolean value telling us wether or not its necessary to have a valid value for this field in order to submit the form,
'failed' => A boolean value which tells us wether or not this field caused the form to fail to submit,
);
*/

// Now actually loop through all the fields.
foreach ($context['fields'] as $field_name => $field_data)
{
// Output the start of the row, as well as a spacer column.
echo '
<tr class="windowbg2">
<td class="windowbg2"></td>';

if ($field_data['type'] == 'infobox')
echo '
<td colspan="2" valign="top"><label for="', $field_name, '">', $field_data['text'], '</label></td>
';
else

// Show the display text for this field.
echo '
<td valign="top"><label for="', $field_name, '">', $field_data['text'], '</label></td>
<td class="windowbg2" width="50%">';

// Show a check box.
if ($field_data['type'] == 'checkbox')
echo '
<input type="checkbox" name="', $field_name, '" id="', $field_name, '" ', (($field_data['value']) ? ' checked="checked"' : ''), ' value="1" class="check" />';

// Show a selection box.
elseif ($field_data['type'] == 'selectbox')
{
echo '
<select name="', $field_name, '" id="', $field_name, '" >';
foreach ($field_data['data'] as $option)
echo '
<option value="', $option, '"', ($option == $field_data['value'] ? ' selected="selected"' : ''), '>', $option, '</option>';
echo '
</select>';
}
// Show a radio box.
elseif ($field_data['type'] == 'radiobox')
{

            foreach ($field_data['data'] as $option)

            echo '
                 
                        <input type="radio" name="', $field_name, '" value="', $option , '">', $option , '<br />';
     }
// Large Text box?
elseif ($field_data['type'] == 'largetextbox')
{
echo '
<textarea rows="5" cols="45" name="', $field_name, '" id="', $field_name, '">', $field_data['value'], '</textarea>';
}
// Show a Info box.
elseif ($field_data['type'] == 'infobox')
{
echo '
';
}
// Int, Float or text box?
else
echo '
<input type="text" name="', $field_name, '" id="', $field_name, '" value="', $field_data['value'], '" />';

// Show the 'required' asterix if necessary.
if(!empty($field_data['required']))
echo '
<div ', !empty($field_data['failed']) ? 'style="color:#FF0000;"' : '' ,'> *</div>';

// End the input column and the entire row.
echo '
</td>
</tr>';
}

    //    Show the "Required Fields" text down the bottom, show it in red if there was a failed submit.
   echo '
               <tr class="windowbg2">
                  <td colspan="3" style="text-align:center;', !empty($context['failed_form_submit']) ? 'color:#FF0000;' : '', '">
                     * ', $txt['CustomForm_required'], '
                  </td>
               </tr>';
               
   //  Here you can add information before the submit button.
   /* echo '
<tr>
<td colspan="3"  class="windowbg2">
Example of something before the submit button.
</td>
   </tr>'; */ 


// Output the save button, the end of the tables and the form.
echo '
<tr>
<td class="windowbg2" colspan="3" align="center" valign="middle"><input type="submit" value="', $txt['save'], '"', (!empty($context['save_disabled']) ? ' disabled="disabled"' : ''), ' /></td>
</tr>';

  //   Here you can add information below the submit button.
  /* echo '
<tr>
<td colspan="3"  class="windowbg2">
Example of something after the submit button.
</td>
</tr> */

</table>
</td>
</tr>
</table>
<input type="hidden" name="sc" value="', $context['session_id'], '" />
</form>';
}
// End: Racing League Form Template


Make your changes and paste it just before the ?> at the bottom of your CustomForm.template.php.

Then in your forms Settings where it says Custom Template Function, enter "racing_form"
Title: Re: Custom Form Mod
Post by: C4G-TK on September 14, 2009, 04:14:27 PM
Quote from: Garou on September 14, 2009, 01:18:19 PM
That's odd, what did you change to get there?


The only thing that I had changed was in the style.css file.  I read in another thread that in order to change the background color, you should add background-color to the following area, so I did.

/* use dark grey for the text, leaving black for headers etc */
body, td, th , tr
{
color: #444444;
background-color: #A19675;
}



Thanks!


I removed this now and it seems to have remedied my problem, but now I need to get the background fixed.  I don't want to hijack your thread here, so I'll continue this here for help:

http://www.simplemachines.org/community/index.php?topic=336405.msg2257681#msg2257681
Title: Re: Custom Form Mod
Post by: rgecy on September 14, 2009, 09:50:03 PM
I recently upgraded from 1.1.9 to 2.0 RC 1.2.  I had the Custom Form mod installed and of course when I upgraded, I had to reinstall.  Now I am getting a Database Error at install.

Database Error
Table 'sid0908711353209.cf_forms' doesn't exist
File: /home/content/r/g/e/rgecy1/html/forums/Packages/temp/install.php
Line: 45 

Any idea whats happening or maybe one of the old files messing things up?

Robert
Title: Re: Custom Form Mod
Post by: Garou on September 14, 2009, 10:58:07 PM
C4G-TK, that's probably for the best. Ive never been that good at creating themes, I just don't have the knack for it I guess. Ive been working on one of my own off and on for about a year now and still cant get it to look the way I want. LOL

rgecy, you installed the mod and uninstalled it at some point in the past. The old data bases are still there and causing the problem. You will have to manually drop them using phpmyadmin or a similar program, Drop  the cf_fields and cf_forms. If there is old data that you want to save you should back them up first then once the mod is installed you can import the old ones back in.

This is a problem in the 2.0 series of SMF http://dev.simplemachines.org/mantis/view.php?id=2963 Hopefully they will fix it in the next release of SMF, in the meantime I'm trying to get some kind of work around set up to prevent this.

Title: Re: Custom Form Mod
Post by: rgecy on September 15, 2009, 12:09:59 AM
Thanks for the help.  Back up and running.  I had never done that before.  Pretty cool and not to difficult.

Thanks again.

Robert
Title: Re: Custom Form Mod
Post by: tonnybarros on September 17, 2009, 04:07:41 PM
   
For me it shows "Required Fields" and "Submit Form" has looked at everything, what to do.
Title: Re: Custom Form Mod
Post by: WyckedDreamz on September 18, 2009, 12:26:08 AM
Great idea for a mod! Saves me from having to custom code a TP php form to post to the forums, but I am having an issue. I have my form set up, I can view it just fine, have it set to post to a board, permisions all set, but when I fill in the form, and click submit, the page just refreshes and the required fields text above the submit button turns red, and noting gets posted... am I missing a setting? I don't have anything set to required.
Title: Re: Custom Form Mod
Post by: zushiba on September 18, 2009, 01:07:32 AM
Hey, might have been asked but this threads 38 pages long and there's no search this threat feature :(

I've got this installed on my site right now and it's freaking beautiful, it's exactly what we need but since I only allow guests to submit the form when they submit the form To a hidden forum, hidden to everyone but admins it obviously asks them to register. I'd rather not ask them to register as it's not necessary.

Is there any way to get this thing to redirect to another page after the form is submitted?
Title: Re: Custom Form Mod
Post by: Garou on September 18, 2009, 10:01:43 AM
For those having problems with required fields...
Quote from: nathan42100 on August 15, 2009, 09:05:29 PM
I fixed it, in CustomForm.php
Find something along the lines of:
// Do a small fix for the last line, if this is a checkbox.
if($field['type'] == 'checkbox'){
$data[$i]['value'] = isset($_REQUEST[$field['title']]) ? $_REQUEST[$field['title']] : false;


Add after:
                    if (($required) && (!$data[$i]['value']))
                    {
                        // Do the 'fail form/field' stuff.
                        $data[$i]['failed'] = true;
                        $fail_submit = true;
                        continue;
                    }


And that $ bug applies to all html with double quotes in it as well, single quotes work fine.

Also something I fixed is the fact that textareas in the template have no size set so they are damn small.

For those looking to redirect to a page other then the board...
Quote from: Garou on May 06, 2009, 10:12:25 PM
This is a quick and dirty fix for people that have forms posting to boards that the user can not access. When a user completes a form this will redirect them to the forum rather then the post that is made.

./Sources/CustomForm.php
Find...
// Redirect this user as well.
redirectexit('board=' . $board . '.0');


Replace With...
// Redirect this user as well.
redirectexit();


Note that this will effect all forms, hopefully in an upcoming version you will be able to chose where a particular form redirects.


I'm working on the next update where the required bug is already fixed and I'm hoping to have something set up so you can choose where to redirect your users after submit.

There's a couple more bugs I'm trying to work out as well as getting another feature or two in there before release. I have a bout 20 things on my "to do list" for the mod and only a few will be in per update. This is mostly due to the amount of time I have (I don't want to leave everyone hanging for a year or so while I try to do it all), also due to my lack of knowledge. I have to be honest and say I just don't know everything yet but I learn a little more each day.  :)
Title: Re: Custom Form Mod
Post by: FragaCampos on September 18, 2009, 03:55:13 PM
I'm sorry to ask you this again Garou, but do you know anything about the http:// problem in the form fields? Do you know if this is going to be solved in a near future?

Thanks a lot for keeping this mod alive  ;)
Title: Re: Custom Form Mod
Post by: Garou on September 19, 2009, 07:04:50 AM
I'm not sure which http:// problem you mean I have 2 I'm working on and haven't found the answer for either yet.
Title: Re: Custom Form Mod
Post by: WyckedDreamz on September 19, 2009, 03:47:30 PM
thanx for the fix Garou :)
Title: Re: Custom Form Mod
Post by: oistarbwoy on September 19, 2009, 04:23:06 PM
Quote from: pooya on November 19, 2008, 08:41:40 AM
Okay my custom form output isnt being saved, i click save brings me back to the same page with Form Output being blank.

Also how ot make this show in a single topic rather then making different topics ?

i have this exact same problem, everything else works fine. the form posts to board you get a blank message as the output is unable to be saved no matter how many times you click that save button you just come back to the screen again, all info you entered there but with a blank space where all your output layout was written.

i dont get it?

any ideas why this is happening?
Title: Re: Custom Form Mod
Post by: Garou on September 19, 2009, 08:06:21 PM
oistarbwoy , there is no single topic option at this time but it is on the "to do list".

As for the form output not saving, The only thing I can think of is that the cf_forms database table wasn't created properly on install for some reason. Uninstall the mod, use phpmyadmin or similar program to manually remove the cf_forms and cf_fields  database tables, then re install the mod.
Title: Re: Custom Form Mod
Post by: C4G-TK on September 20, 2009, 01:08:57 AM
Quote from: oistarbwoy on September 19, 2009, 04:23:06 PM
Quote from: pooya on November 19, 2008, 08:41:40 AM
Okay my custom form output isnt being saved, i click save brings me back to the same page with Form Output being blank.



i have this exact same problem, everything else works fine. the form posts to board you get a blank message as the output is unable to be saved no matter how many times you click that save button you just come back to the screen again, all info you entered there but with a blank space where all your output layout was written.

i dont get it?

any ideas why this is happening?

I see that you looked back to November of last year to find someone who had a problem that you had.  I'm not sure if this is the same thing that you are talking about, but do you use the WYSIWYG editor?

If so, I alerted a problem back on page 8 (reply 155) and then again on page 11 (reply 202) and was able to figure out a workaround for the problem on page 11 (reply 203).  It was discussed in full on page 11 (replies 202-205)  Then again, when someone didn't read the previous posts it was reposted on page 15 (reply 295) and on page 26 (reply 510).  Read over the earliest replies and see if this is what you are talking about and to see if the fix I discovered works for you.  It sounds like the same thing.  Hope it helps.
Title: Re: Custom Form Mod
Post by: Garou on September 20, 2009, 08:37:44 AM
Wow C4G-TK, great catch, I forgot all about that one. In the back of my mind I thought it was fixed because its not even on my to do list. Looks like Ill have to try and set something up to bypass the WYSIWYG editor settings so it forces the use of the standard editor. Its on the list now. :)
Title: Re: Custom Form Mod
Post by: oistarbwoy on September 20, 2009, 09:19:00 AM
Quote from: Garou on September 19, 2009, 08:06:21 PM
oistarbwoy , there is no single topic option at this time but it is on the "to do list".

As for the form output not saving, The only thing I can think of is that the cf_forms database table wasn't created properly on install for some reason. Uninstall the mod, use phpmyadmin or similar program to manually remove the cf_forms and cf_fields  database tables, then re install the mod.

sorry i didnt mean to include the part about the topics i dont care about that at all. its the not being able to save the output thats the problem. clearly this makes the forms not work at all.

also are you sure that there's not a problem in the package? as i also noticed that the title field is there twice in two separate places. i checked the help icon and they are indeed the same feild in oppose to different feilds with similar name.

also quite catastrophically since installing your mod i made the annoying discovery that guests can no longer see anything other then a blank page when they go to index.php or action=forum. all other actions they can see just fine. i tried enabling guest acsess to the form page for guests... but they still cant see my main forum index... they can see the form page though.

please let me know if you have any ideas whats caused the problem so i can fix it in the meantime i'll see what i can figure out myself, but im no coder so i dont fancy my chances :(

i should probably add that uninstalling the mod did not fix my blank screen problem.
Title: Re: Custom Form Mod
Post by: Garou on September 20, 2009, 11:13:18 AM
Quote from: oistarbwoy on September 20, 2009, 09:19:00 AM
sorry i didnt mean to include the part about the topics i dont care about that at all. its the not being able to save the output thats the problem. clearly this makes the forms not work at all.
C4G-TK, covered this in his post, essentially you have to turn off the WYSIWYG editor when creating forms. Its a known and almost forgotten about bug that has been added to my to do list. In the meantime just turn it off at least while creating a form.

Quotealso are you sure that there's not a problem in the package? as i also noticed that the title field is there twice in two separate places. i checked the help icon and they are indeed the same feild in oppose to different feilds with similar name.
You are right about the Title Field being in there twice in the 2.x version of the mod. That is not the cause of your problem but will be fixed in the next update.

Quotealso quite catastrophically since installing your mod i made the annoying discovery that guests can no longer see anything other then a blank page when they go to index.php or action=forum. all other actions they can see just fine. i tried enabling guest acsess to the form page for guests... but they still cant see my main forum index... they can see the form page though.

This mod does not alter any of the existing global permissions, it just adds its own to the list. The only permission problem this mod has is that if you do edit the permissions for a group in index.php?action=admin;area=permissions that it will remove all the Custom Form permissions.

In looking at that problem, its caused by the fact that the mod tries to store it's permissions in the permission database but there isn't a function to display them on the permissions page. Therefore when the group permissions are changed it blanks out the ones for the forms. Now that I know whats causing it Ill either have to edit the permissions page to show the CF permissions or move them to the cf_forms database. None the less this isn't the cause of your problem.

If uninstalling the mod didn't fix the problem, I'm sure that the mod isn't what caused it either. My guess is you need to check your index.php?action=admin;area=permissions or perhaps there is a problem with your theme.

Also of note: if the permission to show the form list for a group isn't set in the Custom Form Mod Settings then it should bounce the user back to the Forum Index page. Also if there are no forms set with the permission for that group then the Form List will not show and forms as they cant use them.


Title: Re: Custom Form Mod
Post by: oistarbwoy on September 20, 2009, 12:29:43 PM
ok well it never did the bounce back thing it just showed a blank page if you were a guest... so clearly that in itself was not working correctly.

as for it not being this mod, i think thats wishfull thinking seeing as how the ONLY change i made to my working forum was installing the mod and then it stopped working.  its not like i was doing anything else to it.

got to my website everything was fine i could see action=forum. i logged on. i installed the mod set up a form wanted to check that guests could not see the form so logout. they couldnt blank white screen. didnt like the blankness so went back to my main page same for my index.php a blank page unfortunately too. i typed in another action it worked fine. used the header to log in. i switched guest acsess on for forms in admin. logged out. guests could see the forms but not the index.

im not trying to insult your mod but really i dont see how there can be much of a question that the install did something to my forum. i was merely asking for your help, not just chucking blame around.
Title: Re: Custom Form Mod
Post by: king kratos on September 20, 2009, 05:38:57 PM
I just noticed in my code that the following portion was missing from the default "function form_template_submit_form()"

    //    Show the "Required Fields" text down the bottom, show it in red if there was a failed submit.
   echo '
               <tr class="windowbg2">
                  <td colspan="3" style="text-align:center;', !empty($context['failed_form_submit']) ? 'color:#FF0000;' : '', '">
                     * ', $txt['CustomForm_required'], '
                  </td>
               </tr>';


I entered the above code just below this:

// Show the 'required' asterix if necessary.
if(!empty($field_data['required']))
echo '
<div ', !empty($field_data['failed']) ? 'style="color:#FF0000;"' : '' ,'> *</div>';

// End the input column and the entire row.
echo '
</td>
</tr>';
}


I'm not sure if this is supposed to not be included in this section, but if it is not included, all fields that are made without specifying a custom template function will not have "* Required Fields" at the bottom of the form.

I have fixed mine, just wanted to let you know that the unedited mod has this error.

Thank you,

Kratos

P.S. I absolutely love this mod. However, some of my forms are submitted to a board and category that is only viewable to admins. This causes an "ugly" error to be displayed when a user submitts a form. Is there any way to submit the form and redirect the user to list of forms or display a less "ugly" message? The message reads as:

Quote
An Error Has Occurred!
The topic or board you are looking for appears to be either missing or off limits to you. 

The board is not missing, it is off limits to unqualified users.

Thank you for any help.
Title: Re: Custom Form Mod
Post by: C4G-TK on September 20, 2009, 09:16:36 PM
Quote from: Garou on September 20, 2009, 08:37:44 AM
Wow C4G-TK, great catch, I forgot all about that one. In the back of my mind I thought it was fixed because its not even on my to do list. Looks like Ill have to try and set something up to bypass the WYSIWYG editor settings so it forces the use of the standard editor. Its on the list now. :)

No problem.  I was running another forum at the time, so that's why I have two names.  They both didn't have the same mods, so I made a 2nd name to keep things organized.  The only reason I remembered the fix was because I was determined to figure out why it was happening since it looked like I had installed everything correctly.
Title: Re: Custom Form Mod
Post by: Garou on September 21, 2009, 08:01:41 AM
oistarbwoy, when you uninstall a mod it will reverse all the changes it made when it was installed, it returns the modified files to the same way they were before the mod was installed. So if your problem still exists after the mod is uninstalled its not the fault of the mod.

king kratos, I noticed that in the 2.x version of the mod as well when I added my custom template example. As I wasn't sure why it was left out I figured and that LHVWB had his reasons for leaving it out, so I haven't changed it but I did put it in the example. It works with or without that line, I just think it looks better with, Ill probably add it in later anyway. :)

As for your problem with people being redirected to the board when they don't have access to the board I posted this a while back... http://www.simplemachines.org/community/index.php?topic=248871.msg2047400#msg2047400. As for the error message being "ugly", blame SMF that's their standard message for when people try to access a board they don't have access to.  :D I do plan to incorporate something better into the mod within my next update or two though. 
Title: Re: Custom Form Mod
Post by: king kratos on September 21, 2009, 08:15:46 AM
Quote from: Garou on September 21, 2009, 08:01:41 AM
As for the error message being "ugly", blame SMF that's their standard message for when people try to access a board they don't have access to.

By "ugly" I simply mean that users see an error that basically says that there is a possibility that their form did not get posted. LOL. Kind of like when Windows throws up random errors and never elaborates on them......

Kratos
Title: Re: Custom Form Mod
Post by: Sramota on September 22, 2009, 07:25:46 AM
I'd love to see the Form Fields section be changed into a a menu where you change the data right on that page instead of having to press the "Edit" button.
Also a "Copy" button for them,
having a good 30+ fields with the difference of one number in each just makes it a royal pain to work with as it is..
Title: Re: Custom Form Mod
Post by: Garou on September 22, 2009, 03:59:27 PM
For the record, oistarbwoy's problem has been fixed and apparently there is some sort of conflict with Simple Portals permissions and CF's Its been added to the bug list but I have a feeling that once the disappearing permissions bug is fix it will fix this as well.

Sramota  A copy function has been talked about before and is on the to do list but so are several other things so no promises on when it will get added.

As for having all the fields on one page, that's probably not going to happen. It would take a major rework of the mod and I can honestly see it causing more issues then it solves, for most admins and the mod itself.
Title: Re: Custom Form Mod
Post by: deciph3red on September 25, 2009, 01:28:36 AM
Question.

It may have been asked in this forum, but i cannot find it for the life of me.

Is there a way to use if-then statements in the actual form itself?

Lets say the custom form is setup like this.  2 Dropdown (selection) boxes labeled like below:
{gamename} = AA2, AA3, CS:S
{laddername} = TWL , CAL

For example. . . the user filling out the form is going to select AA2 for the game, and we are only on TWL for the ladder, so CAL should not be an option.  Is it possible to only have it display TWL for the laddername selection box if they select a game that we compete only on TWL with and vice versa?

Not sure if im explaining it correctly, but having a dropdown box that will only display things that are enabled by selecting a specific option in the dropdown box before it. . .

Also, is it possible to make it create an event in the calendar?
Title: Re: Custom Form Mod
Post by: Garou on September 25, 2009, 07:31:00 AM
That  would be nested  or multi-teared selection boxes and no its not possible at this time, I also don't think it can be possible with the current way the mod is structured. The HTML code involved is "option groups" and there isn't really a decent way to create them with a program such as this. Its much better suited to a stand alone form.

As far as where this mod posts, it will never be able to do anything but a forum post with this mod.
Title: Re: Custom Form Mod
Post by: deciph3red on September 25, 2009, 06:08:02 PM
Thanks for the quick reply!

I still love it.
Title: Re: Custom Form Mod
Post by: ɔɔɔɔɔɔuɥoɾ on September 25, 2009, 06:21:51 PM
I requested a mod recently, this seems similar to what I requested, just asking to be sure

http://www.simplemachines.org/community/index.php?topic=336535.0 (http://www.simplemachines.org/community/index.php?topic=336535.0)

Does this mod do that?
Title: Re: Custom Form Mod
Post by: rgecy on September 26, 2009, 03:55:49 AM
Didn't know if this had been requested yet or not, but thought it would be a great addition to the mod.

We need a description field for the field names so it would give the user a little more information on what to enter.  Here is an example of what I did using html.  It can be done this way, but would be much simpler if it was incorporated into the mod.

Thanks again!

Robert
Title: Re: Custom Form Mod
Post by: Garou on September 26, 2009, 09:19:40 AM
johncccccc, This is more like what you are looking for. http://www.tinyportal.net/index.php/topic,9419.0.html I use to use it before I found the custom form mod. Its not really a mod but more of a hack that you have to install manually, and really requires either Tiny Portal or you can probably make it work using some other portal software. Alternatively if you don't want to use portal software you can make it work using the custom action mod, http://custom.simplemachines.org/mods/index.php?mod=331.

With the form mod the user fills out a regular form and then it put those answers in a forum post based on the format you set up. I think the form mod is a better option especially once we get a few more features added to it, like being able to use the new topic button to open a form. (Yes I'm working on this folks I just want to get rid of some or preferably all of the existing bugs first.) Then again I am biased as I now work on the mod but I did make the switch before I started working on it.  ;D

rgecy, You don't really need to add another field for this to work just use some basic HTML in your "Text " field.

For instance
This is the question to be answered. <br /> <i>This is how your answer should be formatted.</i>

It will display in the form as...
QuoteThis is the question to be answered.
This is how your answer should be formatted.     [       ]

You can also use the "Info box" to add additional instructions, line breaks, horizontal rules, or even advertisements between questions.

Being able to use these two existing features makes the mod extremely flexible for just this type of situation as well as many others. Its much better the bloating the mod with extra unnecessary code that wouldn't be useful to everyone.
Title: Re: Custom Form Mod
Post by: ɔɔɔɔɔɔuɥoɾ on September 26, 2009, 12:22:57 PM
hmmm, So with the custom form mod, when someone starts a topic, the post can be pre filled with some information, thus making all topics 1st posts uniform (if the user uses them) for example, if I wanted to have a aboard where everything is listed, I could set up that board with the custom form fill to
1.
2.
3.
and so forth

Saving the user time having to do that.
or is the hack/manual install for that?
Title: Re: Custom Form Mod
Post by: Garou on September 26, 2009, 09:46:44 PM
Not exactly, right now Custom Form Mod does not start when some one clicks new topic but that feature is planned for the future. For now you have to tell your users to go to the form and you can use the board settings to set the board as read only or reply only so they can not post to the board with out using a form.

Second it doesn't pre-fill a post (that is the other option I pointed you to) it actually creates a post based on the answers a user gives when they fill out a form.

You create a form where you set up fields like name, age, op_system, etc. When you set up those fields you also set up the questions to be answered.

What is your name?                           [     ]
How old are you in years?                  [     ]
What operating system do you use?   [     ]

Then you set up the format that you want the answers to be posted into.

Hi, my name is {name}.
I am {age} years old.
My computer runs on on {op_system}.

Then when your user fills out the form and answers with ...
What is your name?                           [Garou]
How old are you in years?                  [38]
What operating system do you use?   [Linux]

A post is created that says...
Hi, my name is Garou.
I am 38 years old.
My computer runs on on Linux.

A new topic is created in a board of your choosing, using that format, every time a user fills out the form.

Does that make more sense to you?
Title: Re: Custom Form Mod
Post by: ɔɔɔɔɔɔuɥoɾ on September 26, 2009, 11:42:55 PM
Yea, that makes more sense, I pretty much assumed that but wanted to get a clearer answer.

I'm curious to know, how much different is your mod and my idea code wise, would it be a lot of work to make it standard on the default form on a chosen board?
Title: Re: Custom Form Mod
Post by: rgecy on September 27, 2009, 05:01:18 AM
Garou,

Like I said in my post, I know it can be done with HTML, thats how I did it.  I just think it would be a nice addition to the mod.  There are a lot of users who don't know how to format html.

Just a thought.

RGecy
Title: Re: Custom Form Mod
Post by: Garou on September 27, 2009, 09:43:10 AM
johncccccc, if you are just wanting the pre-formatted text in the post with out the user filling out a form you should use the custom prefills hack I mentioned earlier. That's an entirely different concept and wouldn't be possible with this mod.

Of you are looking to redirect the user to a custom form rather then creating a new topic,  FragaCampos made this suggestion http://www.simplemachines.org/community/index.php?topic=248871.msg2241024#msg2241024. That will do the trick but I plan to add something better to the mod in the future.

rgecy, for those that don't know HTML there are several examples in this thread of how to do that type of thing and they can always ask here. As for adding the field to the mod I just don't really see it as something that's necessary when it can be done quite simply by adding the little bit of HTML that isn't much different from BBC in the "Text" field.

More importantly there are many features on the very long "to do list" that actually add to the functionality and usability of the mod rather then just redoing something that can already be done in a slightly different way. Seriously it isn't that hard to add a <br /> to the existing field.
Title: Re: Custom Form Mod
Post by: ɔɔɔɔɔɔuɥoɾ on September 27, 2009, 11:28:59 AM
OK then, got it, just wanted to know that. :)
Title: Re: Custom Form Mod
Post by: rgecy on September 27, 2009, 01:46:07 PM
Garou,

I certainly understand!  :D  I agree, they can find the info here if needed. 

I truly appreciate the work on this mod.  Thanks again!

RGecy
Title: Re: Custom Form Mod
Post by: Sramota on September 28, 2009, 04:55:54 PM
Since I can't search for it...

Anyone noticed you can't enter a "0" as an answer when it's set to integer..?
Title: Re: Custom Form Mod
Post by: Garou on September 28, 2009, 11:24:12 PM
Actually you can not enter just a "0" in a text or float box either. Its a common problem using just about any type of form software  because "0" is considered the same as null or empty in most programing languages.

In the case of this mod "0" will leave the field blank when it posts to the forum, as if the user hasn't filled anything in at all. Its even worse the field is required as the mod specifically rejects "0" as an answer when required mainly for the fact that again "0" is considered the same as empty.

There might be some sort of string replace function that could be added which means using a regular expression and I'm terrible when it comes to those.  :-[ Ill have to try some things out to see if I can get it to work and make sure that it doesn't replace empty fields with "0".
Title: Re: Custom Form Mod
Post by: Sramota on September 30, 2009, 12:08:28 PM
textbox works for me.. :S
Title: Re: Custom Form Mod
Post by: tonnybarros on October 01, 2009, 08:49:25 AM
Hello, I use this MOD and I think very good, but every message that the members not to send the messages that appear in the member profile that appears in messages.
pesquisar

http://tectonny.com
Title: Re: Custom Form Mod
Post by: Garou on October 01, 2009, 09:53:49 AM
Sramota, You are correct text boxes are working with "0". Originally I didn't test it I just went looking on the internet for answers and found several instances of where "0" doesn't work with input boxes and made the assumption that it applied to this mod.

After testing I found that the problem is caused by this code in the CustomForm.php

case 'int':
$value = isset($_REQUEST[$field['title']]) ? intval($_REQUEST[$field['title']]) : '';
// If value is empty then set it to the default.
if(($value == '')
&& !$required)
$value = $default;
// Restrict the length of value if necessary.
if(($size != ''))
$value = substr($value, 0, $size);
break;
case 'float':
$value = isset($_REQUEST[$field['title']]) ? floatval($_REQUEST[$field['title']]) : '';
// If value is empty then set it to the default.
if(($value == '')
&& !$required)
$value = $default;
// Restrict the length of the float value if necessary.
if(($size != ''))
$value = rtrim(substr($value, 0, $size), '.');
break;


The mod uses "intval" and "floatval" to limit the users input to an integer or float, both of those commands do have issues with "0's". Its now on the to do list to find something fix these with.

tonnybarros, the mod not effecting a users post count is a known issue. Its been on the to do list for a while, even before I came to the team but we have yet to find the fix for it. We are looking though.
Title: Re: Custom Form Mod
Post by: king kratos on October 02, 2009, 12:13:49 PM
Is there a way to add a captcha box to forms visible to guests?

Kratos
Title: Re: Custom Form Mod
Post by: deciph3red on October 03, 2009, 02:28:27 AM
Quote from: king kratos on October 02, 2009, 12:13:49 PM
Is there a way to add a captcha box to forms visible to guests?

Kratos

I second this.
Title: Re: Custom Form Mod
Post by: Garou on October 03, 2009, 06:11:09 AM
Capthcha is on the to do list I just haven't gotten to that yet.
Title: Re: Custom Form Mod
Post by: king kratos on October 03, 2009, 09:17:16 AM
Would this require a hearty overhaul of the mod? Or is this something I could simply add in the code for the form I want it on?
Title: Re: Custom Form Mod
Post by: Garou on October 03, 2009, 11:17:34 AM
Im not sure off hand but Im going to guess that you would have to change stuff in the custom teplate an custom form php as well as the settings. So im guessing it might be complicated but I really havent had the chance to look at it yet.
Title: Re: Custom Form Mod
Post by: Garou on October 04, 2009, 11:41:25 AM
Ok This should work to use captcha and should be in the next version
This works using your Anti-Spam Verification settings, everyone that would normally have to use captcha to post to a board will also have to use it to post using a form.

In CustomForm.template.php
find...
// Output the save button, the end of the tables and the form.
add before...
         // Show CAPTCHA on the form     
   if ($context['visual_verification'])
   {
      echo '
      <tr><td class="windowbg2" colspan="3" align="center" valign="middle"><b>', $txt['verification'], ':</b></td><tr>
      <tr><td class="windowbg2" colspan="3" align="center" valign="middle">', template_control_verification($context['visual_verification_id'], 'all'), '</td></tr>';
   }


CustomForm.php
find...
// This function shows the custom forms and submits them.
function CustomForm()
{
global $smcFunc, $context, $txt, $scripturl, $sourcedir, $user_info, $modSettings;

add after...

   // Generate a visual verification code to make sure the user is no bot.
      $context['require_verification'] = !$user_info['is_mod'] && !$user_info['is_admin'] && !empty($modSettings['posts_require_captcha']) && ($user_info['posts'] < $modSettings['posts_require_captcha'] || ($user_info['is_guest'] && $modSettings['posts_require_captcha'] == -1));
      if (!empty($modSettings['reg_verification']) && $context['user']['is_guest'])
      {
         require_once($sourcedir . '/Subs-Editor.php');
         $verificationOptions = array(
            'id' => 'register',
         );
         $context['visual_verification'] = create_control_verification($verificationOptions);
         $context['visual_verification_id'] = $verificationOptions['id'];
      }
      // Otherwise we have nothing to show.
      else
         $context['visual_verification'] = false;


The last piece of the code in the CustomForm.php should be...
// Check whether the visual verification code was entered correctly.
      $context['require_verification'] = !$user_info['is_mod'] && !$user_info['is_admin'] && !empty($modSettings['posts_require_captcha']) && ($user_info['posts'] < $modSettings['posts_require_captcha'] || ($user_info['is_guest'] && $modSettings['posts_require_captcha'] == -1));
      if ($context['require_verification'])
{
require_once($sourcedir . '/Subs-Editor.php');
$verificationOptions = array(
'id' => 'register',
);
$context['visual_verification'] = create_control_verification($verificationOptions, true);

if (is_array($context['visual_verification']))
{
loadLanguage('Errors');
foreach ($context['visual_verification'] as $error)
fatal_error($txt['error_' . $error], false);
}
}


the problem is everywhere I try to put it the form still posts even with out the captcha not filled in. I was thinking it should be around...
// Do we have completly valid field data?

Using this code the feature is always on but I plan to implement it in the next version as an option that you can turn off or on for each individual form.

I should also note that this only works for the 2.x version of SMF as its based on post verification. 1.1.x only verifies posts with the aid of additional mods but Im looking for some sort of work around seeing as how it does use captcha for PM's and registration.
Title: Re: Custom Form Mod
Post by: ɔɔɔɔɔɔuɥoɾ on October 05, 2009, 08:09:10 PM
Thanks, it took me quiet a while to figure this mod out lol..

Im having one issue, when filling in the forms, its all good, except that it creates a blank post with no data in it.

I dunno if this is a coding error, or its just me missing something ???

EDIT:
The form I'm filling to create the post is staying blank after clicking save, I'm suspecting its just not saving the data to the database
Title: Re: Custom Form Mod
Post by: king kratos on October 05, 2009, 08:39:34 PM
In your AC (where you make the form), make sure that the "Form output" is filled in. Use {****} (where *** is the name of the form field) to pull data form the form to the post.

Example form:

Name: (textbox named "user")
Date: (textbox named "date")

Example output:

On {date}, {user} filled out this form.

If you put Kratos in for the name and Monday for the date, it would post like this:

On Monday, Kratos filled out this form.

Hope that helps,
Kratos
Title: Re: Custom Form Mod
Post by: ɔɔɔɔɔɔuɥoɾ on October 05, 2009, 09:24:36 PM
OK, its definiatly not saving to the database, I had tried your exact instructions several times

it only worked when I manually added that data to the database myself, is there any reason why it would not be saving?
Title: Re: Custom Form Mod
Post by: Garou on October 05, 2009, 10:20:06 PM
Yep there's some sort of bug with the WYSIWYG editor and the Form Output, its been covered here a few times but I haven't tracked it down yet.

To be honest its kinda low on my priority list as it works fine with the standard editor and personally I feel every form admin should be fluent in BBC. Of course I'm old and I was using the net long before WYSIWYG editors were created for message boards.  :-[

It is on the to do list and will be fixed eventually but there are other bugs and features that I feel are more important to get into the mod first.

Turn it off while creating forms for now and it should save just fine .  ;D

While were on the topics of quirks, be sure to make sure the Title field for your Form Fields does not contain capital letters, spaces, or any odd characters other then an underscore "_" as that can cause a variety of issues.

For instance usersname and users_name will work fine but UsersName, user's name, user'sname and a ton of other variations will cause your form or forms post to not display correctly. This is due mainly to the way HTML code works and there just isn't a decent way around it.
Title: Re: Custom Form Mod
Post by: king kratos on October 05, 2009, 10:30:46 PM
Interesting! I usually try very hard (I mean I do everything) to use single words for the filed names as they are easier to check for accuracy when creating a form that contains more than 20 or 30 fields.

I'll keep that in mind though as I'm sure I will eventually need to use more than one word.

Kratos
Title: Re: Custom Form Mod
Post by: ɔɔɔɔɔɔuɥoɾ on October 05, 2009, 10:55:36 PM
well its really weird,

I have the table open, its remembering all the columns, just not the output one ???
Title: Re: Custom Form Mod
Post by: king kratos on October 05, 2009, 11:09:25 PM
Like Garou said, it may be the WYSIWYG editor causing the issue.

Have you tried disabling the WYSIWYG editor temporarily in order to save the form output settings?

Also, when you say "all the columns", are you talking about the form field columns? I ask because the form output is located above those columns and is a large text box like what you see when making posts on this forum. It is located just underneath the "Subject" and "Form name" and "membergroup permissions" boxes.

Kratos
Title: Re: Custom Form Mod
Post by: ɔɔɔɔɔɔuɥoɾ on October 05, 2009, 11:55:34 PM
Damn, sorry I was on the way out when reading the reply, I didnt see his reply, but yes, that is definitely the issue, I didnt disable the WYSIWYG on the main options, but rather just toggled it before saving.

So in theory you can use WYSIWYG editor, just toggle it before saving it :)

when I said columns, I mean in the database directly, within the database table
Title: Re: Custom Form Mod
Post by: king kratos on October 06, 2009, 12:04:31 AM
Gotcha.

Glad to hear that it was something as simple as the WYSIWYG! (We all know that database issues can be a major pain in the butt. LOL) And as for your theory, yes, that seems to be the case. I however (knock on wood) have not had these issues with the WYSIWYG editor. But just to be safe, I plan to do the same form now on. I really don't want to have to retype some of the form outputs (with upwards of 50 fields on some of my forms, it is a pain by itself).

Kratos
Title: Re: Custom Form Mod
Post by: ɔɔɔɔɔɔuɥoɾ on October 06, 2009, 12:06:48 AM
yea, well this is a very nice mod and can be used for so many things.

You seem to know alot about this mod, is there anyway the title of the post can be controlled by the user filling the form?
Title: Re: Custom Form Mod
Post by: king kratos on October 06, 2009, 12:18:40 AM
The subject of the post made by the form is only controlled by what you add as variables.

For example, if you had fields for "user, date, and issue (select box: major, moderate, minor):

Enter in subject:

{user} has submitted a {issue} problem on {date}

If:
user= Kratos
date= Monday
issue= major

Then:
The subject will read:

Kratos has submitted a major problem on Monday.

There is no way (that I know of at least) to allow the user to control the subject. But, if you are creative (such as the example above), you can make relatively unique subjects for each individual user and post.

Kratos
Title: Re: Custom Form Mod
Post by: ɔɔɔɔɔɔuɥoɾ on October 06, 2009, 12:24:10 AM
That's a shame, I wish there was a way for the form filler to control the title of the topic or at least add to it, that would be great, as some titles should be descriptive to the content in the post,

Maybe in the next update  ::) lol...
Title: Re: Custom Form Mod
Post by: king kratos on October 06, 2009, 12:31:23 AM
Well, you could add a field to your form for the subject, then just call that variable into the subject field.

Form:

Subject (field name= subject): .................

Form subject:

{subject}

That would allow a user to have full control in what goes in the subject field (I didn't think about this until just now).

Kratos
Title: Re: Custom Form Mod
Post by: ɔɔɔɔɔɔuɥoɾ on October 06, 2009, 12:42:39 AM
But would that be actual subject of the topic or something within the post its self?

I did think about that, about to try it actually, but its not coded for that though is it not?

EDIT:
just tested it

{subject} in the subject option.

then add the subject field, your sorted, that's so cool, thanks for the heads up

This mod is so great, congratulations on such a great mod creator :D
Title: Re: Custom Form Mod
Post by: king kratos on October 06, 2009, 12:57:28 AM
In the Admin Panel, in the form creation area, edit the form you wish to have this functionality.

In the top part (just above the Form Output area) look for "subject".

As long as you reference the variable ({***}) in the subject section and not the large textbox Form Output section, the entered info will only show up in the topic subject line and not in the actual post itself.

P.S. See the attached screenshots showing examples of this. Do these help you better understand what to do to achieve this? I have a hard time verbally (with text) explaining what to do. I hope these screenshots help better tell my "story".

The first is showing the subject box itself, the second is showing the subject form field (the part the user fills in), the third is showing the subject with the form field title (variable) filled in, and the fourth is showing everything with extras in the form output field (the actual post).

Kratos
Title: Re: Custom Form Mod
Post by: ɔɔɔɔɔɔuɥoɾ on October 06, 2009, 01:00:05 AM
Yep, I think I edited my post a few seconds before you posted yours, it works great :D
Title: Re: Custom Form Mod
Post by: Garou on October 06, 2009, 05:57:26 AM
Glad you got that figured out. One of the things I loved most about this mod even before Nathanial let me start helping with it was its versatility. There's only a couple more things I need to add to it to suit all of my own needs but there are many more that people have asked for on my to do list.

About the only thing I know for sure that people have asked for that I know will never make into the mod of is getting it to store the users input someplace other then a forum post. While I agree it would be handy in some cases but it just doesn't work well at all.

For instance in order to store the user input in a database you would have to either limit the amount of fields that can be be used in a form or create an entirely new database for every form. Either way it just isn't practical and extremely complicated to do using a program such as this and much better suited to a stand alone form.

Outside of that just about everything that has been asked for is doable except for a few things that are entirely subjective and would only benefit a few sites so I'm reluctant to add them. Then there are a few things that are just beyond my knowledge to do right now but I keep learning more everyday.  :)
Title: Re: Custom Form Mod
Post by: Garou on October 06, 2009, 07:53:28 AM
Sramota, I found the answer to your question about using "0's" in an integer or float box.

In the CustomForm.php you will need to change...
case 'int':
$value = isset($_REQUEST[$field['title']]) ? intval($_REQUEST[$field['title']]) : '';
// If value is empty then set it to the default.
if(($value == '')
&& !$required)
$value = $default;
// Restrict the length of value if necessary.
if(($size != ''))
$value = substr($value, 0, $size);
break;
case 'float':
$value = isset($_REQUEST[$field['title']]) ? floatval($_REQUEST[$field['title']]) : '';
// If value is empty then set it to the default.
if(($value == '')
&& !$required)
$value = $default;
// Restrict the length of the float value if necessary.
if(($size != ''))
$value = rtrim(substr($value, 0, $size), '.');


too...
case 'int':
$value = isset($_REQUEST[$field['title']]) ? intval($_REQUEST[$field['title']]) : '';
// If value is empty then set it to the default.
if(($value === '')
&& !$required)
$value = $default;
// Restrict the length of value if necessary.
if(($size != ''))
$value = substr($value, 0, $size);
break;
case 'float':
$value = isset($_REQUEST[$field['title']]) ? floatval($_REQUEST[$field['title']]) : '';
// If value is empty then set it to the default.
if(($value === '')
&& !$required)
$value = $default;
// Restrict the length of the float value if necessary.
if(($size != ''))
$value = rtrim(substr($value, 0, $size), '.');
break;

You will also need to change in the same file...
// Do we have an invalid value? Is this field required?
if(($required
&& (($value == '') || ($value == '0'))

to
// Do we have an invalid value? Is this field required?
if(($required
&& (($value == '')


In changing

if(($value == '') && !$required)

to

if(($value === '') && !$required)

also causes one more small problem, if the user leaves the field empty "0" will automatically display in the post. Its a trade off as in php language "0" is set as the default for intval and floatval. I read someplace that this is "an incredibly poor design decision" by those that write the php language and  I have to agree.

For everyone using the v1.5 of this mod for the 1.1.x series of SMF take not of the code listed above for floats. You will see that when I messed up my copy/paste when editing the mod for radio boxes and there is no " break;" closing the code for float. This is causing floats not to work properly at all in v1.5 on 1.1.x and will be fixed in v1.6 of the mod.
Title: Re: Custom Form Mod
Post by: ɔɔɔɔɔɔuɥoɾ on October 06, 2009, 11:22:07 PM
Oh, one more thing, more of a feature request for this mod.

Would it be too much work to be able to add one more king of field

A field which can choose which board the topic is posted, so if you were having reviews and the competition was Operating systems for example
the boards are named after OS's example, "Windows XP Reviews" and another called "Windows Vista Reviews". The created form would have a drop down menu with the boards you have chosen for custom fields.
That extra feature would make this custom form mod the ultimate in custom forms
Title: Re: Custom Form Mod
Post by: deciph3red on October 07, 2009, 03:00:34 AM
Not sure what happened (according to my host no changes have been made) but it stopped working.

PHPInfo can be found here:
http://www.clangoat.com/phpinfo.php

I am getting the following error:
An appropriate representation of the requested resource /index.php could not be found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Title: Re: Custom Form Mod
Post by: Garou on October 07, 2009, 07:09:14 AM
deciph3red, first check that your ./index.php contains
'form' => array('CustomForm.php', 'CustomForm'),

Have you added any other mods to your site? If not it really sounds to me like your site may have changed your security settings even if they say they haven't. Most likely they may have been supposed to be set for your site but previously were not, so your average tech support wouldn't realize that they have changed. Try to chmod your CustomForm.php and CustomForm.template.php to 755 or 644.

Other then that I don't know what to tell you other then most mods don't break randomly unless something has changed either in the mod's files, SMF files, or server settings many of which you can't control and don't always show up in your php.ini.

johncccccc , I'm not sure what you are asking for there. Are you saying you want the form to post to both boards or that you want the user to be able to choose what board the form posts to?

If its the first, there's a post a couple pages back on how to get your forms to post to multiple boards.

If its the second then its really complicated to do from with in the form and I would suggest creating two separate forms, one posting to each board and letting the users decide which one to use.
Title: Re: Custom Form Mod
Post by: ɔɔɔɔɔɔuɥoɾ on October 07, 2009, 08:55:56 AM
Yep, its the second one :)

I knew it would likely be complicated, but it would be a great feature as so save time setting up several forums which will essentially be the exact same thing, besides the board the data is sent to, it would be very convenient.
It was just an idea, but if its possible, I would certainly like it and I'm sure many others will too
Title: Re: Custom Form Mod
Post by: Garou on October 07, 2009, 07:01:55 PM
Tell you what, Ill add it to my to do list. I like the idea myself but I have no clue about how to make it work or if it really is possible. Ill have to set it aside for now as there are still several other things I do need to get in there first. Since its on the list It wont be forgotten, it might be a while but if it is possible Ill get it in there eventually.

While I'm on the subject I am working on v1.6 now. So far Ive got floats working again in 1.1.x, Ive fixed the problem with using $'s in both Text boxes and Large Text boxes, and Ive added Captcha to both 1.1.x and 2.x. I mentioned in the earlier post with the manual install of captcha for 2.x that I planned on making it optional but in order to make using the mod more secure Ive decided to make it default instead. In both versions of SMF it will always appear for Guests using a form, after that its based on the captcha settings that already exist in SMF. It will be described in greater detail in the help files within the mod.

There's a couple more bug fixes I want to do and Id also like to add a couple more features but I'm planning on releasing v1.6 in the next couple weeks. I should be on vacation from my day job and will have plenty of time to work on it then.
Title: Re: Custom Form Mod
Post by: ɔɔɔɔɔɔuɥoɾ on October 07, 2009, 07:12:01 PM
Yea thanks for adding to list.

another option to make forms quickly for different boards, (keeping mod as it is) would be to introduce a "Copy Form" option, which would Copy all settings and fields from that form setup and then you can make the quick changes like board data is sent to and such, then save it as another form. I think that would probably be easier to code up.

I got that idea earlier when I was trying to simply open the database and copy the records 6 at a time, but it wouldn't work as the ID for each field is different regardless of the name been the same, copying them like that would result in duplicate records which is no good.

So if there is some code to add for that feature it may well be easier than adding the other feature
Title: Re: Custom Form Mod
Post by: Garou on October 07, 2009, 07:27:05 PM
A copy function has been on my to do list for a while now. I even attempted it once but I ran into the same issues you describe. The problem is the numbering system that is used to store the forms. Its probably going to have to take an entire rewrite to make it work or at the very least some weird mathematical formula.

As Nathaniel is working on rewriting the entire thing from scratch I'm hoping he decides to store and number them in an easier to manage format. That way even if he doesn't put a copy function in, I can always add one to it later. :)
Title: Re: Custom Form Mod
Post by: ɔɔɔɔɔɔuɥoɾ on October 07, 2009, 08:04:07 PM
Well, I have a somewhat useful idea, maybe the ability to use the same field on several forms would help

the database would store the fields in use on a chosen form as the IDs, but multiple IDs can be used in each column,
Im unsure of MySQL programming, if its possible to set the ID form ( in smf_cf_fields) column to add several form IDs inside, this would let you simply add already existing fields to new form setups
Title: Re: Custom Form Mod
Post by: deciph3red on October 08, 2009, 11:56:57 PM
Quote from: Garou on October 07, 2009, 07:09:14 AM
deciph3red, first check that your ./index.php contains
'form' => array('CustomForm.php', 'CustomForm'),

Have you added any other mods to your site? If not it really sounds to me like your site may have changed your security settings even if they say they haven't. Most likely they may have been supposed to be set for your site but previously were not, so your average tech support wouldn't realize that they have changed. Try to chmod your CustomForm.php and CustomForm.template.php to 755 or 644.

Other then that I don't know what to tell you other then most mods don't break randomly unless something has changed either in the mod's files, SMF files, or server settings many of which you can't control and don't always show up in your php.ini.

I did speak to my host again, and the guy im dealing with is actually one of the lead techs.  Ive known him for years and he seems to know his stuff.  He has told me they have made no changes in the previous weeks.  I did check for that line in my index.php and it was there.  Also changed permissions, to no avail (added the .htaccess as well).

Im not sure why it would just break.  Heres a list of mods im using:
1.  Favicon  1.2    [ Uninstall ]  [ List Files ]  [ Delete ]
2. Post Prefix 1.1 [ Uninstall ] [ List Files ] [ Delete ]
3. SimplePortal 2.3 [ Uninstall ] [ List Files ] [ Delete ]
4. Anti Spam! 1.1 [ List Files ] [ Delete ]
5. Downloads System 1.2.6 [ Uninstall ] [ List Files ] [ Delete ]
6. Stop Spammer 2.2 [ Uninstall ] [ List Files ] [ Delete ]
7. delete inactive users 1.0.3 [ List Files ] [ Delete ]
8. reCAPTCHA for SMF 0.9.6 [ Uninstall ] [ List Files ] [ Delete ]
9. Treasury 2.36 [ Uninstall ] [ List Files ] [ Delete ]
10. Aeva ~ Auto-Embed Video & Audio 6.9.101 [ Uninstall ] [ List Files ] [ Delete ]
11. Custom Profile Field Mod 3.20 [ Uninstall ] [ List Files ] [ Delete ]
12. Custom Form Mod 1.5 [ Uninstall ] [ List Files ] [ Delete ]


I havent installed anything new. . . so im confused.
Title: Re: Custom Form Mod
Post by: Elindris on October 09, 2009, 12:25:27 AM
Hi deciph3red,

  I had the same issue and it was because my host installed mod_security 2.0 on the servers (which do not like ";id=" in the url for some reason... and doesn't accept to be bypassed by the .htaccess code like mod_security 1.x).

To solve the problem, simply change the url to be "...action=form&id=1" instead of "...action=form;id=1"

In order to do so, modify ./Sources/CustomForm.php
Search:
action=form;id=
and replace it with:
action=form&id=

Repeat the operation in ./Themes/Default/CustomForm.template.php

Note: Solution found on SMFHacks.com for Gallery Pro which had the same issue : SMFHacks.com -> Forum -> SMF Gallery Pro -> Support -> Topic: New Gallery Pro Installation Issue (sorry, not allowed to post external links)

Hope this helps!



By the way, LOVE the mod! It's exactly what we've been looking for! And with such a good/active support on the forum, I've also found the answers/workarounds to all my questions/problems. Thanks a lot!

Elindris
Title: Re: Custom Form Mod
Post by: Garou on October 09, 2009, 07:39:32 AM
Elindris, Thanks for the help. I seem to remember that fix being posted before but didn't even think about it as its an uncommon problem with the mod. It is something I think Ill have to look into though because mod_security is so widely used. Its also becoming the bane of my personal existence as their last couple releases have made things so restrictive that its not worth using IMHO. Of course unless you own your own server you usually dont have much say in the matter. LOL

deciph3red, try Elindris' fix and let us know if that works.
Title: Re: Custom Form Mod
Post by: FireDitto on October 11, 2009, 12:17:27 AM
Something messed up between the change of 1.4 and 1.5, because I now can't access my Features and Options section under Administration... It simply loads as a blank page with the URL in the address bar.

If I go to Installed Packages, and click "Uninstall" it says "An Error Has Occurred!
Unable to find package file!"


If I try to reinstall, I get:

"Apply Mod
This package is already installed, and no upgrade was found!

You should uninstall the old version first to avoid problems, or ask the author to create an upgrade from your old version.

Please remember to always make regular backups of your sources and database before installing mods, especially beta versions."



I am on SMF 1.1.10 and have 50 Installed mods.
Title: Re: Custom Form Mod
Post by: deciph3red on October 11, 2009, 12:33:35 AM
Quote from: Garou on October 09, 2009, 07:39:32 AM
Elindris, Thanks for the help. I seem to remember that fix being posted before but didn't even think about it as its an uncommon problem with the mod. It is something I think Ill have to look into though because mod_security is so widely used. Its also becoming the bane of my personal existence as their last couple releases have made things so restrictive that its not worth using IMHO. Of course unless you own your own server you usually dont have much say in the matter. LOL

deciph3red, try Elindris' fix and let us know if that works.

Worked great!

Thanks.

On a side note, is there a variable to actually show the forum username?
For example, I want it to show it he subject like this
{Forumname} has applied.
Title: Re: Custom Form Mod
Post by: Gmaster83 on October 11, 2009, 12:34:17 AM
I install the mod forum CustomFormMod_v1.5_SMF2.x in SMF 2.0 RC1.2.

When I click on any "?" I returned the form:

Fatal error: Cannot create references to/from string offsets nor overloaded objects in /home/xxx/public_html/foro/Sources/Help.php on line 106

I made a form, and when I click on "send" shows me a blank page with:

Numeric request keys are invalid.

Try different configuration without result. Know of any solution?.

Thanks.
Title: Re: Custom Form Mod
Post by: Garou on October 11, 2009, 07:49:15 AM
Since this mod doesn't touch ./Sources/Help.php I have to assume you have another mod (I'm going to guess one of the search engine optimization mods) that does and and therefor this mod and most likely other parts of SMF are unable to read the language strings in ./Themes/default/languages/Help.english.php

That or possibly ./Themes/default/languages/Help.english.php is corrupted in some way and the language strings didn't get copied to the file. Compare your file to the changes listed in the package parser for your version.
Title: Re: Custom Form Mod
Post by: Gmaster83 on October 11, 2009, 06:15:01 PM
I have the Spanish language forum. That error "?" is the least important.

I Uninstall the MOD, and found an error:

./Sources/ManageSettings.php

Proceed with uninstall.

Then I reinstall the MOD:

(http://img198.imageshack.us/img198/8107/forms.png)

And when clicking Aply gives me the following error:

Table 'gmaster_foro.cf_forms' doesn't exist
Archivo: /home/gmaster/public_html/foro/Packages/temp/install.php
Línea: 45


This forum is new, and installed a few Mods. I still have not released, wanted to use this form for donations.

Help  :(

(I use google translator  8) )
Title: Re: Custom Form Mod
Post by: ɔɔɔɔɔɔuɥoɾ on October 11, 2009, 06:48:30 PM
I think it would be OK to continue installing if you don't use utf8 text in your forum :)
Title: Re: Custom Form Mod
Post by: Gmaster83 on October 11, 2009, 07:56:24 PM
       
I Remove the entries from the DB, change the forum language to English, reinstall the mod and now I can view the help, but when I fill out the form and send it keeps showing me a blank page with:

Numeric keys are invalid request.

>:(
Title: Re: Custom Form Mod
Post by: ɔɔɔɔɔɔuɥoɾ on October 11, 2009, 07:59:05 PM
I had that same message about the database, you need to remove the tables from the database and uninstall the mod, then reinstall the mod :)

the address is yoursite.com/index.php?action=form
Title: Re: Custom Form Mod
Post by: Gmaster83 on October 11, 2009, 08:30:44 PM
   
That's what I did and still the error.

Clear smf_cf_fields
Clear smf_cf_forms

Change language of the Forum, remove mod, download and install the same mod. And the error still ...

View image:
Quote
http://img387.imageshack.us/img387/8053/85529425.png
http://img202.imageshack.us/img202/8787/19865280.png
http://img202.imageshack.us/img202/2457/70244442.png
http://img408.imageshack.us/img408/2695/33006012.png

DOES NOT WORK!  >:(
Title: Re: Custom Form Mod
Post by: ɔɔɔɔɔɔuɥoɾ on October 11, 2009, 08:37:11 PM
hmmm, strange, He will have to get to you on this one, I only know a few things about the mod.

Is your forum up and running normal though now? (without this mod)
Title: Re: Custom Form Mod
Post by: Garou on October 11, 2009, 08:52:16 PM
There has been a problem with the database for this and some other mods not uninstalling since 2.0 RC1 I keep hoping that it will be fixed in an upcoming SMF release. Soon as I get a chance to test this on RC2 Ill find out if I still need to code some kind of work around for the next version of the mod.

The language strings are failing on install because the code that the mod is looking for isn't present. In other words one of the other mods you have installed changed or moved that hook and you have to manually make the changes. If you cant figure it out, attach the files here after the mod is installed and I will fix it for you. That's what's causing your help text [?] problem.

You might also want to attach your ./Sources/ManageSettings.php as I have a feeling that if it didn't uninstall properly you will end up with the code that is supposed to be in there, multiple times and it will need to be fixed manually as well as it will cause other problems in the future.

The problem with the language files could also be causing the "Numeric request keys are invalid.
" error, however in searching the forums here, I have found that error is usually caused by various SEO (search engine optimization) mods like "Pretty URL's" and others. If you have one of those installed you should try uninstalling it as well.

In fact now that you have posted your screen shots I'm convinced that something is messing with your URL's as in your image it says "/foro/form/?id=1 and it should say "/foro/index.php?action=form;id=1"

To be perfectly honest it sounds like your forum is pretty well screwed up right now, to make sure everything is right you might want to have some sort of expert take a look at it. Then again since its new and doesn't have any users yet, a better suggestion would be to just start all over and install the Custom Forms mod before any other mod. That will make sure that it installs properly and you will see that its one of the other mods that is causing your problem.
Title: Re: Custom Form Mod
Post by: king kratos on October 11, 2009, 09:03:11 PM
http://img387.imageshack.us/img387/8053/85529425.png (http://img387.imageshack.us/img387/8053/85529425.png)
http://img202.imageshack.us/img202/8787/19865280.png (http://img202.imageshack.us/img202/8787/19865280.png)
http://img202.imageshack.us/img202/2457/70244442.png (http://img202.imageshack.us/img202/2457/70244442.png)
http://img408.imageshack.us/img408/2695/33006012.png (http://img408.imageshack.us/img408/2695/33006012.png)

This does seem to be more of a different mod/forum issue as compared to a Custom Form Mod issue. Looking at your form, I can say that it looks to be set up correctly. As long as each individual field doesn't have something screwy in the "Extra Type Parameters", your form looks just fine.

Like Garou said, the fact that your URL does not look correct, there is probably an error with a different mod you have installed. Please list the mods you have installed (and any you can remember uninstalling).

Kratos
Title: Re: Custom Form Mod
Post by: Gmaster83 on October 11, 2009, 11:35:05 PM
I checked Pretty and the other mods and found no problems.

Install SMF 2 RC1.2 original (in English) on my PC with WAMP. He gives the same problem when you submit a form.

Do the same and see that it's true. The problem is in the Custom Form MOD and not the forum nor in the other mods.

Greetings!.
Title: Re: Custom Form Mod
Post by: ɔɔɔɔɔɔuɥoɾ on October 11, 2009, 11:58:02 PM
Quote from: Gmaster83 on October 11, 2009, 11:35:05 PM
I checked Pretty and the other mods and found no problems.

Install SMF 2 RC1.2 original (in English) on my PC with WAMP. He gives the same problem when you submit a form.

Do the same and see that it's true. The problem is in the Custom Form MOD and not the forum nor in the other mods.

Greetings!.

You have pretty urls, that's one of those mods that causes a lot of issues with other mods.
I have installed this mod on my forum and test form, despite a few bugs it works pretty much fine :)
Title: Re: Custom Form Mod
Post by: Gmaster83 on October 12, 2009, 01:09:25 AM
You do not understand ... I think this translator to use is not very good.

I just install a clean forum (not Pretty) with only the Form and gives the same mistake in filling out and submitting a form. Which proves that is not problem of Pretty or any other mod, but a problem of Mod Form.

   
Your forum is SMF2 RC1.2 ??
Title: Re: Custom Form Mod
Post by: Garou on October 12, 2009, 09:27:50 AM
The Test server I have set up om my home PC doesn't have the issue nor the multitude of live servers I have set this up on over the last year or so. I have never encountered this kind of error nor has anyone else ever mentioned it in the support thread.

That said I think you may be the first person ever to use only numbers for the Titles in your form fields. I went ahead and created a form on my test server and was able to replicate the problem with "Numeric request keys are invalid". The problem was solved by simply changing the Titles to q1, q2, q3 instead of 1, 2, 3.

I'm going to add this to my list of quirks with the mod, but I'm not going to call it a bug as this is extremely uncommon and most people wouldn't create a form that way. I will add the information in the help file for Titles in the next version to help others avoid the practice of using only numbers in the Title field as it may cause errors.
Title: Re: Custom Form Mod
Post by: Gmaster83 on October 12, 2009, 01:14:38 PM
   
Solved!. Thanks for your help!  :D :D :D
Title: Re: Custom Form Mod
Post by: Gmaster83 on October 12, 2009, 01:36:53 PM
Another problem, jejejeje. I made a form to be sent a post created in a section where the administrator has access only.

This form is to donate, so I need that created the post is only seen by the administrator.

If configured so that the post was created in a section where the user has no access, this generates an error.

There a solution?
Title: Re: Custom Form Mod
Post by: king kratos on October 12, 2009, 02:43:13 PM
Quote from: Gmaster83 on October 12, 2009, 01:36:53 PM
Another problem, jejejeje. I made a form to be sent a post created in a section where the administrator has access only.

This form is to donate, so I need that created the post is only seen by the administrator.

If configured so that the post was created in a section where the user has no access, this generates an error.

There a solution?

Yep, see this post: http://www.simplemachines.org/community/index.php?topic=248871.msg2264994#msg2264994 (http://www.simplemachines.org/community/index.php?topic=248871.msg2264994#msg2264994)

Use the "redirect this user as well" to send them to wherever you want after they submit the form.

Kratos
Title: Re: Custom Form Mod
Post by: Garou on October 12, 2009, 04:27:38 PM
Thanksfor the help king kratos, you can also use the "custom action mod" but you don't really need an extra mod at all. You  can easily create a basic web page that says, "Thank you for completing our form.". Then use...
redirectexit('http://siteurl.com/thankyou.html');
Your options are limitless. :)

I was in the middle of coding this function directly into the mod itself when RC2 was released to Charter Members. There are a couple of issues with the mod on RC2 that need fixing, then Ill finish this function and release the mod with the other fixes and features I mentioned earlier. Then its on to coding even more features from my to do list.  :)
Title: Re: Custom Form Mod
Post by: Gmaster83 on October 12, 2009, 10:53:07 PM
Perfect!, Thanks, no more annoying!  :D
Title: Re: Custom Form Mod
Post by: Spoogs on October 14, 2009, 08:20:22 PM
I saw this mod and figured it would work wonders on my site, i was able to install the mod seemingly successfully, i was able to create forms as instructed but was never able to view the forms at my mysite/index.php?action=form neither on smf default nor my default theme. I decided that i would just uninstall the mod and wait for the updates that have been talked about in the thread so far as they seem to be exactly what i was hoping. In these pics it shows what my screen looks like when i try to access the list of forms created, i also notice i dont have a forms button at the top the way some of the photos provided by others have.

(http://i35.tinypic.com/2uh0eug.jpg)

or

(http://i33.tinypic.com/30t6t5s.jpg)

After uninstalling the mod i was curious as to why it wouldn't work for me so i click apply mod to re-add the mod and hope to get some support but have been getting the following error message since the uninstall
Type of error: Database
Database Error: Table 'mafiawar_smf1.cf_forms' doesn't exist
Line: 45

I even get this message now when i try to install other mods. Any advice on how to fix this problem,  I am new to all this so I would appreciate some basic explanations. I know nothing at all about php and probably wouldnt know where to find most of the files i've seen talked about all over this form.

Would greatly appreciate if anyone can give me some help on this issue.
Title: Re: Custom Form Mod
Post by: ɔɔɔɔɔɔuɥoɾ on October 14, 2009, 08:24:16 PM
You will need to just delete those tables from the database manually then try to install again, i will work then :)
Title: Re: Custom Form Mod
Post by: Spoogs on October 14, 2009, 08:34:14 PM
trust me when i say i am really new to all this, where would i go to delete these tables.
Title: Re: Custom Form Mod
Post by: ɔɔɔɔɔɔuɥoɾ on October 14, 2009, 08:36:34 PM
you would go to your phpmyadmin in your hosts cpanel and open the database, check off those 2 and only those 2 tables, then click drop tables.

I would recommend making a complete database backup before doing this, as your new to it and accidentally deleting the wrong database/table is the diffeence between a working forum and no forum.
Title: Re: Custom Form Mod
Post by: Spoogs on October 14, 2009, 08:39:53 PM
ok will try that, thanks, also just realized that if had had just kept reading after page 41 i would have noticed you just recently explained this.
Title: Re: Custom Form Mod
Post by: ɔɔɔɔɔɔuɥoɾ on October 14, 2009, 09:42:02 PM
Yep, this is a small topic so far at only 41 pages, its quiet easy to find things out, once it gets to 200 pages, it starts getting hard to manually find things, there is a search feature, look at top right side, it will search this topic.

A search for those database errors would have taken you right to the page where I explained ;)
Title: Re: Custom Form Mod
Post by: Garou on October 14, 2009, 10:25:32 PM
spoogs, first see if you can get to a form directly as in /index.php?action=form;id=1
If everything is working and the user belongs to a user group that has permission to view the form then it should display. If it does, then its possible you didn't set the permissions for "Form View Page Permissions". Its important to note that there is a bug where if you edit a usergroups permissions in the manage permissions area of SMF after the forms permissions have set up, the permissions in the form need to be set again. Hopefully Ill be able to fix this in the near future.

As a side note Ive almost finished with the changes need to work with RC2 and the problem with the database has been fixed not by me but in RC2 itself. I'm going to try and get some other features in before RC2 goes public but its ready to go seems to be working normally, existing bugs and all.  ;D
Title: Re: Custom Form Mod
Post by: derelicta on October 15, 2009, 11:15:12 AM
I'd like to say thank you very much to the creators of this mod.
It works perfectly on my SMF 2, and I dont' even know anything about php.
Just one thing. Please write in the MOD docs how to create automatically the content of a  topic. I've discovered just by chance that i had to use in the output form: {namefield}.

Thank you again.
Title: Re: Custom Form Mod
Post by: Garou on October 15, 2009, 11:27:56 AM
Good suggestion, its been talked about here so many times I didn't realize that it wasn't in the help files. Ill add it into the next version.  :)
Title: Re: Custom Form Mod
Post by: Spoogs on October 15, 2009, 11:31:04 AM
Quote from: Garou on October 14, 2009, 10:25:32 PM
spoogs, first see if you can get to a form directly as in /index.php?action=form;id=1
If everything is working and the user belongs to a user group that has permission to view the form then it should display. If it does, then its possible you didn't set the permissions for "Form View Page Permissions". Its important to note that there is a bug where if you edit a usergroups permissions in the manage permissions area of SMF after the forms permissions have set up, the permissions in the form need to be set again. Hopefully Ill be able to fix this in the near future.

As a side note Ive almost finished with the changes need to work with RC2 and the problem with the database has been fixed not by me but in RC2 itself. I'm going to try and get some other features in before RC2 goes public but its ready to go seems to be working normally, existing bugs and all.  ;D
Hey Garou, i wasnt able to access any form no matter what input i tried form id's all the way up to 10 even tho i only made 3 forms.

I deleted the tables as explained, i havent reinstalled the mod as i was just going to wait for the update anyway, there was another mod i tried to uninstall and i now get this error

       Type     Action     Description
*    1.    Execute Modification    ./Themes/default/languages/Modifications.english.php    Test successful
      1.    Replace    ./Themes/default/languages/Modifications.english.php    Test successful
*    2.    Execute Modification    ./Themes/default/languages/Who.english.php    Test successful
      1.    Replace    ./Themes/default/languages/Who.english.php    Test successful
*    3.    Execute Modification    ./index.php    Test failed
      1.    Replace    ./index.php    Test failed
*    4.    Execute Modification    ./Sources/Admin.php    Test successful
      1.    Replace    ./Sources/Admin.php    Test successful
*    5.    Execute Modification    ./Sources/Subs.php    Test successful
      1.    Replace    ./Sources/Subs.php    Test successful
      2.    Replace    ./Sources/Subs.php    Test successful
*    6.    Execute Modification    ./Sources/ManagePermissions.php    Test successful

by any chance would this be related to the current issue, if so what can i do?

Edit - custom form mod has been re-installed and works as intended, thanks for help, i'm very grateful.
Title: Re: Custom Form Mod
Post by: Nvb on October 16, 2009, 06:16:40 PM
Garou,

I think my problem has passed by here, but i can't find any records of it.
So excuse me if i ask a question already posted...

This is the situation:
I want to use the information input from a form 2 times.

Let's say a user uses a form to input information.
Is there a way to use parts of that form 2 times?

1) the normal post in a public board.
2) Only parts of that same inputted form information into a separated 'admin' only board.
I also want to change the post information into an other text contect.

hold on i'll give an example:

A user gives this information:
- Name
- Place
- Age
- Sex
- Telephone number

i want to create 2 posts in different boards from that one input.

Post 1:
Name
{Name}

Place
{Place}

Age
{Age}


Post 2 (in a different board then 1):
Name
{Name}

Place
{Place}

Sex
{Sex}

Phone
{Telephone Number}

Title: Re: Custom Form Mod
Post by: Garou on October 17, 2009, 06:33:12 AM
NeQo, there is a hack that one of the users came up with a few pages back that allows forms to be posted in two boards. Right now I really cant add it to the mod because it forces every form to post in two boards and Ill have to figure out how to make it optional. That said it may solve part of your problem.

As far as splitting the info from one form between two different types of output, posting different parts of it to each... I honestly don't think its possible, I know for sure its not possible to do with this mod and I cant even think of a way to do it with a stand alone form unless there is way to pull it off with some sort of java script. That gets beyond what I even know how to do as I have very little java script knowledge but its the only thing I can think might work.

There is a mod that uses BBC to hide info from certain member groups in a post. I cant remember the name of it or if it will actually work. IIRC there is an issue with that mod that if another user uses the quote function it will show the hidden info no mater what their status. It is out there someplace though if you want to go looking for it and that's the only thing I can think of that comes close to what you want to do.
Title: Re: Custom Form Mod
Post by: Nvb on October 18, 2009, 01:42:58 PM
Hmm, your solution is a bit complicated

So, not possible to have a 2e Form Output with a different board ID...?  :-[
Title: Re: Custom Form Mod
Post by: ɔɔɔɔɔɔuɥoɾ on October 18, 2009, 01:54:36 PM
Quote from: NeQo on October 18, 2009, 01:42:58 PM
Hmm, your solution is a bit complicated

So, not possible to have a 2e Form Output with a different board ID...?  :-[

Not yet, its gonna be a lot of work to change, I already ask for a feature for the form filler to be able to choose the board(s) and its been added to the to do list for this mod.

It will likely be added in a newer version.
Title: Re: Custom Form Mod
Post by: Garou on October 18, 2009, 02:45:43 PM
NeQo, like I said in the other post, thats the best we have right now. Once I can get it so you have a choice of whether or not you want 1 or 2 boards Ill get it in the mod. Right now there are a lot of requests and Im getting to them as best as I can so it might be a while and possibly multiple releases before we see it.

Johnccc that board selector will even take longer. The mod as written just cant do it, I tried. The entire mod would have to be re-written from scratch to be able to do that. That effectively moves it to the bottom of the list as I dont have the time to write such a complicated mod from scratch. When I started working this mod it was already done and working. I just keep it updated to work on current versions of SMF and add new features as I can figure out how to do them, sorry.
Title: Re: Custom Form Mod
Post by: ɔɔɔɔɔɔuɥoɾ on October 18, 2009, 03:13:01 PM
Yea, I'm willing to wait, I know it takes a lot of time and thinking to get these things working :)

Maybe the board selector and multi board posting can be one feature together, where with the form saying which boards with a drop down check box thing going on, this way you could post the form in may boards at one, of course this will help your average spammer, a limit on the amount of boards would solve that though.

With additions, equals more time and work on the mod authors part, which in most cases is worth waiting for :)
Title: Re: Custom Form Mod
Post by: Nvb on October 19, 2009, 06:38:36 AM
I know you put a lot of time and hard work in it, much appreciated!
Good to know you are taking all our requests in consideration.
(Must be a long list  ;))

Maybe another little question:

Can a form be published without the BBC tags?
I have tried to add the [nobcc ] [/nobbc] in the body of the Form Output, but it just dont work...

Like this

[nobbc ]<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
<name>{Name} - {Cname}.kmz</name>
and so on....blablabla
[/nobbc]

(It works when i ,as admin, modify the post and save again, very strange.)

Is there a way to set this in the Custom Template Function or hardcode it in the Form output?

Actually this is a way to try and auto-generate *.kml files for further use in Google maps/earth.
But the form need to be published in xml.

Title: Re: Custom Form Mod
Post by: ɔɔɔɔɔɔuɥoɾ on October 19, 2009, 09:13:37 AM
As long as your BBC works in general it should work here too as this form just sends the information you enter, plus the created variables as a normal post.

If your having a problem with BBcode tags, try it on a post normally, this will tell you if you have a BB code problem in general, or if its just this mod :)
Title: Re: Custom Form Mod
Post by: Nvb on October 19, 2009, 10:02:03 AM
Indeed, my bbc code works perfect.
It is even included in the posted form result, but you can't see it.

I need to open (modify) that post and save it again without changing anything in the body.
The nobbc tags are in place where they should be.

After saving the post is without bbc...

Strange!
Title: Re: Custom Form Mod
Post by: Garou on October 19, 2009, 12:01:27 PM
Make sure you use "parse_bbc"  "Extra Type Parameters field". That way if you are using BBC in the Form Output or if you want your users to be able to use BBC in their entry then the BBC will work, otherwise BBC is not passed through the form by default.

Also note that if you want to use either URL or IMG tags in the Form Output you have to ask the users to not enter the http:// in their entry because it will automatically enter that in the field anyway so you will get that twice and links will not work. This is due to the way SMF has coded the box that we use for the Form Output and not really fixable but in looks like it will no longer be a problem in SMF RC2.
Title: Re: Custom Form Mod
Post by: Nvb on October 19, 2009, 03:05:42 PM
Never mind, i give up.
It's not working!
Title: Re: Custom Form Mod
Post by: Spoogs on October 19, 2009, 03:15:22 PM
i'm not sure if this has been asked already

When i create a field that requires multiple parameters such as select box and required.... it gives required as 1 of the options to select, is there anyway to correct this.

Also a suggestion maybe in future updates the extra parameters can be check boxes so we can check multiple parameters if needed. The space thats currently provided should just be used for text.

exmple:
Title: Re: Custom Form Mod
Post by: ɔɔɔɔɔɔuɥoɾ on October 19, 2009, 03:18:59 PM
Quote from: spoogs on October 19, 2009, 03:15:22 PM
i'm not sure if this has been asked already

When i create a field that requires multiple parameters such as select box and required.... it gives required as 1 of the options to select, is there anyway to correct this.

Also a suggestion maybe in future updates the extra parameters can be check boxes so we can check multiple parameters if needed. The space thats currently provided should just be used for text.

exmple:

Why do you have looter and fighter in there ???

Thats for entering parameters like parse_bbc required field and some others. :)

Do you mean to ask, is it possible to use 2 parameters at once?
Title: Re: Custom Form Mod
Post by: Spoogs on October 19, 2009, 03:22:15 PM
Looter and fighter are the options the poster would choose from the radio box... this would be a required field, but when i enter "required", it also gave required as an option.
Title: Re: Custom Form Mod
Post by: ɔɔɔɔɔɔuɥoɾ on October 19, 2009, 03:28:34 PM
ok I got confused with Select Box and Required lol.


I see what your doing now :)

Radio buttons, aren't they required by default in general?
Title: Re: Custom Form Mod
Post by: Spoogs on October 19, 2009, 03:31:19 PM
radio button just happen to be the last option i tried, i realized that any of the option whether "radio, select, or check box" they all did the same thing. i wanted to make it required that they choose an option but it shows "required" as one of the option  :P
Title: Re: Custom Form Mod
Post by: ɔɔɔɔɔɔuɥoɾ on October 19, 2009, 03:39:01 PM
Quote from: spoogs on October 19, 2009, 03:31:19 PM
radio button just happen to be the last option i tried, i realized that any of the option whether "radio, select, or check box" they all did the same thing. i wanted to make it required that they choose an option but it shows "required" as one of the option  :P

Did you just try making the buttons without having "required" in the parameters area.

I mean, every single time I see multi-choice radio buttons, there almost all the time must choose 1, thus required.
Title: Re: Custom Form Mod
Post by: Spoogs on October 19, 2009, 03:41:37 PM
thats what i ended up doing for now... (any logical person would think so, but sadly i dont have all logical posters)
Title: Re: Custom Form Mod
Post by: ɔɔɔɔɔɔuɥoɾ on October 19, 2009, 03:49:36 PM
Quote from: spoogs on October 19, 2009, 03:41:37 PM
thats what i ended up doing for now... (any logical person would think so, but sadly i dont have all logical posters)

So with that set like that, your not required to choose one?
Title: Re: Custom Form Mod
Post by: Garou on October 19, 2009, 03:55:37 PM
NeQo, that's odd unless you changed something else in another file along the way, just dropping the original in should work. For starters it looks like its not reading the language strings for some reason. What errors are you getting in your error log?

The hack to get the form to post in multiple boards was in Largo_npc'a post at http://www.simplemachines.org/community/index.php?topic=248871.msg2235951#msg2235951 It doesn't modify the ./Themes/default/CustomForm.template.php just the ./Sources/CustomForm.php. Were you trying to accomplish something else?

Go ahead and attach both of the files listed above as well as your ./Sources/ManageSettings.php (./Sources/ModSettings.php if using the 1.1.x version of  SMF) and ./Themes/default/languages/Modifications.english.php whatever is messed up will be in one of those 4 files. Ill get it fixed and add the the multiple boards hack for you, it shouldn't be that hard.  :)

spoogs, At present you cant require select and radio boxes, its on the to do list but it will require a big change to the way the mod works so I haven't worked on it yet. The change will be removing, required and probably parse_bbc from the Extra Type Parameters field and creating check boxes for them. It entails more work then that but that's the short version.   ;)

For now the way it works, Radio boxes can not be required and will not display anything without user input. Selection boxes will always post the first option in the list unless the user picks something else. Entering "required" in the Extra Type Parameters is going to display required as one of your selections and then may or may not work as expected.
Title: Re: Custom Form Mod
Post by: Spoogs on October 19, 2009, 03:57:46 PM
Quote from: ♪ JohnCcCcCc ♫ on October 19, 2009, 03:49:36 PM
Quote from: spoogs on October 19, 2009, 03:41:37 PM
thats what i ended up doing for now... (any logical person would think so, but sadly i dont have all logical posters)

So with that set like that, your not required to choose one?
They are required to choose one but u know not everyone does what they are suppose to... its really 5 options that will be there.

Its not the biggest deal for now if they skip it but it would be nice to make it a required field so they cant submit the form without choosing.
Title: Re: Custom Form Mod
Post by: Spoogs on October 24, 2009, 12:21:33 AM
I have a few boards which require new topics to be hidden until approved, however the forms seem be overriding that function, is there a way to correct this... maybe i'm just overlooking something
Title: Re: Custom Form Mod
Post by: Garou on October 24, 2009, 02:46:15 AM
The forms do not override that function, you set up the board permissions like you would any other board. If you don't want a member group to be able to see that board then you don't give access to that board in the board permissions. The form will post to the board even if the user does not have access to the board.

If you haven't edited the redirect function as described a while back the user will be directed to the board but they will receive a message from SMF telling them that they are trying to access an area of SMF that they do not have permission to.
Title: Re: Custom Form Mod
Post by: Spoogs on October 24, 2009, 03:02:06 AM
i have a board where the posts need to be approved by a moderator before its shown.... when the form is used on that board it shows instantly without a moderators approval.

Every other topic stays hidden until approved (only the forms show right away)
Title: Re: Custom Form Mod
Post by: Garou on October 24, 2009, 03:31:34 AM
Well just like a the forms allow you to bypass a users ability to post to a board that they normally wouldn't have access to, it will bypass the approval function. Have the form post to a board that users don't have access to and then if you approve of it them move it to the correct board. Its pretty much the same thing just a slightly different way of doing it.
Title: Re: Custom Form Mod
Post by: Spoogs on October 24, 2009, 03:41:40 AM
Quote from: Garou on October 24, 2009, 03:31:34 AM
Well just like a the forms allow you to bypass a users ability to post to a board that they normally wouldn't have access to, it will bypass the approval function. Have the form post to a board that users don't have access to and then if you approve of it them move it to the correct board. Its pretty much the same thing just a slightly different way of doing it.
hmmmm hadnt thought of that thanks, will see how it goes (as this board is pretty active at times)
Title: Re: Custom Form Mod
Post by: C4G-TK on October 24, 2009, 05:19:15 PM
How do I get the forms to appear alphabetically when someone views the "action=form" page?

I think it makes more sense to have them list in alphabetical order than some random order.  I know it would make it easier for people to find the correct one.
Title: Re: Custom Form Mod
Post by: FireDitto on October 24, 2009, 05:27:35 PM
I had 1.4 installed, and created several forms with it.

However, when I changed it to 1.5, I can no longer choose which board I want to have it sent to; it just remains on "0 ("Invalid Board")" I've attached a screen cap. Those forms already attached to a board when I used 1.4, are unable to have that board changed, and appear as per the screen shot.

... How do I go about fixing this?
Title: Re: Custom Form Mod
Post by: Garou on October 24, 2009, 06:18:28 PM
C4G-TK, the forms should appear numerically in the order they were created, form_id=1, form_id=2, form_id=3, etc.

FireDitto, it appears that the mod didn't install correctly. Compare your ./Sources/ManageSettings.php to the changes in the package parser.
Title: Re: Custom Form Mod
Post by: FireDitto on October 24, 2009, 09:03:57 PM
Quote from: Garou on October 24, 2009, 06:18:28 PM
FireDitto, it appears that the mod didn't install correctly. Compare your ./Sources/ManageSettings.php to the changes in the package parser.

Ah... I don't appear to have a ./Sources/ManageSettings.php file?

I have everything from ./Sources/ManageAttachments.php to ./Sources/ManageTimezones.php

The only ManageS files I have are:
Search, Server and Smileys



Also, when I ask for the manual instructions for 1.1.10, it tells me it is unavailable...
Title: Re: Custom Form Mod
Post by: Garou on October 24, 2009, 10:21:59 PM
Ah you are using 1.1.10. First off you need to check ./Sources/ModSettings.php instead of ManageSettings Its just a slight change between the two versions.

Also due to the complexity of this mod we have two separate versions of the mod, one for SMF 1.1.x and one for 2.x. Once RC2 is public there will end up being 3 versions of the mod for a while as the RC2 version isn't compatible with prior versions of 2.0. Once people have had ample time to upgrade, this mod will no longer support versions of 2.0 prior to RC2.

In any case the parsed version of the 1.1.x mod can be found at http://custom.simplemachines.org/mods/index.php?action=parse;mod=1279;attach=109550;smf_version=1.1.10
Title: Re: Custom Form Mod
Post by: FireDitto on October 24, 2009, 10:44:05 PM
Thanks, I've managed to fix it and it works properly now. =)
Title: Re: Custom Form Mod
Post by: Deathvein on October 28, 2009, 04:45:59 PM
I've successfully managed to install this mod, and I've made a couple of forms, but when I go to the form list (index.php?action=form), there are no forms there.

I am presented with a table with three columns: Title, Board and View. Underneath that, it just says 'This list is currently empty.'

Any ideas on how this can be fixed? Am I doing something wrong?

Thanks!
Title: Re: Custom Form Mod
Post by: Garou on October 28, 2009, 06:24:36 PM
Can you view them in the list as admin? If you can and your members cant see them you have to set the permissions.

I also forgot to ask if you can view a form by going to it directly? Something like yoursite.com/forum/index.php?action=form;id=1
Title: Re: Custom Form Mod
Post by: Deathvein on October 29, 2009, 05:23:35 AM
Quote from: Garou on October 28, 2009, 06:24:36 PM
Can you view them in the list as admin? If you can and your members cant see them you have to set the permissions.

I also forgot to ask if you can view a form by going to it directly? Something like yoursite.com/forum/index.php?action=form;id=1

Nope, I can't view the list as an admin. I also tried a direct link, and that didn't work either. :-\
Title: Re: Custom Form Mod
Post by: Garou on October 29, 2009, 04:24:42 PM
If you can not see the form or form list as an admin then either the form is not set up correctly or the mod did not install correctly.

Here is instructions on how to create a form http://www.simplemachines.org/community/index.php?topic=248871.msg1633514#msg1633514

Also remember that you can not use capital letters, spaces, or special characters other then an underscore in the Form Fields Title. It has been known to cause a variety of issues with forms. For instance fieldname or field_name will work, Field Name, FieldName, field name, Field name etc. will not in most cases.
Title: Re: Custom Form Mod
Post by: The Goblin on October 29, 2009, 05:38:36 PM
Hello,

I think this mod is awesome and Im so glad that I found it.  I finally figured out how to create my form  :D

I know others have had this problem too from reading all 44 pages.

My Version Information:
Forum version: SMF 2.0 RC1.2
Current SMF version: SMF 2.0 RC1.2

I fill out the form and hit save and it sends it to the thread that I want.  when I get directed there (which Im going to change soon)  there is nothing there but an empty post.

Not sure where to go to fix this problem with version SMF 2.0 RC1.2

Thanks bunches  :D

Title: Re: Custom Form Mod
Post by: king kratos on October 29, 2009, 05:50:35 PM
I sounds to me like you have not filled out the "Form Output" section. Just use the form field titles in this format: {example} in the "Form Output" section. Also, make sure you click save or your changes will not be saved.

See the attached screenshot to understand what I mean.

Kratos
Title: Re: Custom Form Mod
Post by: king kratos on October 29, 2009, 06:39:10 PM
Well, I have not heard of this problem. The mod's author is really good about getting back to users in this thread, so I'll let him take care of this.

Sorry,

Kratos
Title: Re: Custom Form Mod
Post by: The Goblin on October 29, 2009, 06:43:27 PM
Quote from: king kratos on October 29, 2009, 06:39:10 PM
Well, I have not heard of this problem. The mod's author is really good about getting back to users in this thread, so I'll let him take care of this.

Sorry,

Kratos

You did help me thank you so much. 

All I had was
{name}

I put in this...
Name {name}

and it worked.  I had to have both for it to show  :D

Go figure it was that simple.
Title: Re: Custom Form Mod
Post by: Garou on October 29, 2009, 07:09:53 PM
hmmm interesting You should be able to enter just the {tag} and whatever the user enters in the appropriate field should post.
Title: Re: Custom Form Mod
Post by: The Goblin on October 29, 2009, 08:40:02 PM
Quote from: Garou on October 29, 2009, 07:09:53 PM
hmmm interesting You should be able to enter just the {tag} and whatever the user enters in the appropriate field should post.

That is what I thought, but for some reason I have to enter the exact words I want it to say along with the {} or it sends a blank post.
Title: Re: Custom Form Mod
Post by: bros on October 30, 2009, 01:41:31 PM
Hm. I know this is totally outlandish, but could there be a way to have a form keep adding to a message?
Title: Re: Custom Form Mod
Post by: Garou on October 30, 2009, 03:21:00 PM
You mean post to the same topic rather then creating a new topic? If so that is on the to do list already.
Title: Re: Custom Form Mod
Post by: bros on October 30, 2009, 05:07:29 PM
Quote from: Garou on October 30, 2009, 03:21:00 PM
You mean post to the same topic rather then creating a new topic? If so that is on the to do list already.

Yeah, that is what I meant :P
Title: Re: Custom Form Mod
Post by: bros on October 30, 2009, 05:12:14 PM
I just tried to update to the new version of the mod, got this error:
Table 'xxxx_smf1.cf_forms' doesn't exist
File: /home/xxxx/public_html/boards/Packages/temp/install.php
Line: 45

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 2.0 RC1.2, while your database is at version 2.0 RC1. The above error might possibly go away if you execute the latest version of upgrade.php.

That table does exist
Title: Re: Custom Form Mod
Post by: Garou on October 30, 2009, 05:26:07 PM
You have to manually remove the database tables for cf_forms and cf_fields using phpmyadmin or similar utility prior to re installing the mod. This is due to a bug in SMF 2.0 but it looks like its fixed in RC2.

If you don't want to have to recreate your existing forms make a backup of the tables prior to deleting them. Then install the mod and drop the old tables back in.
Title: Re: Custom Form Mod
Post by: hellbilly on October 30, 2009, 06:11:39 PM
After some reading through this post i got the mod working on my guilds website, the only problem im having now is the form shows in the center block and it doesn't fill the entire section.
as you can see by visiting: http://forum.aion-atrophy.net/index.php?action=form;id=1

Im not very savvy with this type of stuff, i was barely able to get the site functioning properly..
Is there any simple way to make the application form fill the entire space in between the left/right blocks?

edit: temporarily allowing guests to view the form.
Title: Re: Custom Form Mod
Post by: bros on October 30, 2009, 06:12:10 PM
Ah. Thanks :P
Title: Re: Custom Form Mod
Post by: Garou on October 30, 2009, 06:37:35 PM
hellbilly, part of that is due to the portal but try editing the CustomForm.template.php in your themes directory where it says

// Generic template for showing the submit form page.
function form_template_submit_form()
{
global $context, $txt, $settings, $scripturl;

// Starting text for the form and tables. Don't muck with this unless you need to change the style!!!  ;)
echo '
<form action="', $context['post_url'], '" method="post" accept-charset="', $context['character_set'], '">
<table width="80%" border="0" cellspacing="0" cellpadding="0" class="tborder" align="center">
<tr>

change table width="80%" change to 100% and see if that makes it a little better.
Title: Re: Custom Form Mod
Post by: hellbilly on October 30, 2009, 06:47:07 PM
Quote from: Garou on October 30, 2009, 06:37:35 PM
hellbilly, part of that is due to the portal but try editing the CustomForm.template.php in your themes directory where it says

// Generic template for showing the submit form page.
function form_template_submit_form()
{
global $context, $txt, $settings, $scripturl;

// Starting text for the form and tables. Don't muck with this unless you need to change the style!!!  ;)
echo '
<form action="', $context['post_url'], '" method="post" accept-charset="', $context['character_set'], '">
<table width="80%" border="0" cellspacing="0" cellpadding="0" class="tborder" align="center">
<tr>

change table width="80%" change to 100% and see if that makes it a little better.

you rock.. simple and worked perfectly.

Thank you very much. you just saved me from bashing my head into the keyboard :p
Title: Re: Custom Form Mod
Post by: Mario on November 04, 2009, 03:22:18 PM
To it my me works quite correctly unless the content of the post is empty.

Someone knows because
Title: Re: Custom Form Mod
Post by: Garou on November 04, 2009, 07:52:01 PM
Mario, I'm not sure I understand what you are having a problem with.
Is the data the user enters not being passed to the post? Have you entered something in the Form Output:?
Do you mean that your user's are not filling out the form? If so try requiring some fields.


Have you read http://www.simplemachines.org/community/index.php?topic=248871.msg1633514#msg1633514
It provides a pretty good example of how to create a form.
Title: Re: Custom Form Mod
Post by: - = Orfeo = - on November 04, 2009, 11:06:02 PM
Guys! i need your help with this mod!  :o

i read the fragacampos post: http://www.simplemachines.org/community/index.php?topic=248871.msg2241024#msg2241024

But i have a question:

How make a question for this button (ex. if the ID_Board =15 then search a id_form that have associated this ID_Board (15)) then send me directly to index.php?action=form;id=(id_form) when i click in this button?

And if this id_board have associated some id_form, else don't show the button?  :(  :o
Title: Re: Custom Form Mod
Post by: Garou on November 05, 2009, 07:38:30 AM
I do plan to add a feature for the "new topic" button sometime in the future but as for hiding it if there isn't a form present gets even more complicated as the new topic button is a global feature and any such code would probably hide the button for all boards.

I would suggest just making the board read or reply only. That way no user could create a post in the board unless they are an admin or moderator.

If you are using SMF 2.0 you can create a child board within that board that is a redirect to the form you want to use. This is what I do on my sites now and it works quite well.

If you are using 1.1.x then there is a mod Redirection Boards (http://custom.simplemachines.org/mods/index.php?mod=38) that does the same thing.

That said, if you really must have this feature you might want to try the help wanted board (http://www.simplemachines.org/community/index.php?board=50.0) but its beyond anything I have the time or knowledge to do right now.
Title: Re: Custom Form Mod
Post by: king kratos on November 05, 2009, 10:12:39 AM
Something really weird has started happening to my custom forms permissions recently.  As I have just learned about how to create new permissions, I tried looking into this myself, but cannot figure it out.

Here's the scoop; I have three custom primary membergroups set up (Student, Parent, Leader). I have various forms that allow different primary membergroups access to them. Whenever I make a change to one of the primary membergroups' permissions (the full permissions control found in admin panel under members section), they automatically loose their permissions for Custom Forms Mod.

Example: I have a form called Incident Reports and Leaders are the only group allowed to see/use this form. I recently went into the Leaders permissions and added some new permissions for the SMF Quiz I installed. I saved the permissions and about a day later I had a leader complain to me that they could not access the Incident Reports or the Prayer Request forms. they said that when they click on the "redirect to a url" board I have set up to take them to the forms quickly, they are simply sent back to the forum. I checked in the custom forms mod and the permission just to access the forms had put the leaders back to not allow. Along with that, all of the forms that leaders had access to had done the same thing as well. I had to manually give Leaders permissions to view the forms again.

This has happened with all three primary membergroups as well as the default guests membergroup. I have two forms that guests are allowed to use and when I changed their permissions for the SMF Quiz, they also lost access to the forms they were allowed to see/use.

I would really appreciated some help and advise on this issue. Thus far, I have been able to remember that if I change a membergroups permissions, I also must give them access back in the custom forms. However, I cannot continue this way much longer and need to figure this out.

Thank you,
Kratos
Title: Re: Custom Form Mod
Post by: Mario on November 05, 2009, 11:17:23 AM
Thank you Garou, already which was my failure.

In the form output have not written nothing.

Pass 6 of the message that you me link
Title: Re: Custom Form Mod
Post by: Garou on November 05, 2009, 11:33:38 AM
Kratos, Ive been working on that bug for a while now and haven't been able to track it down myself. I'm almost done with all the coding for 1.6 I just have to get message icons working in the version for SMF 1.1.x. I hope to release 1.6 once SMF 2.0 RC2 goes public.

Depending on when they do that I hope to have permissions fixed in either 1.6 or 1.7 of the mod.
Title: Re: Custom Form Mod
Post by: king kratos on November 05, 2009, 11:37:53 AM
Ok, so this is a known bug and has probably been around since I first installed the mod. I just never noticed it until now. Thanks for the information. I'll keep trying to figure it out myself as well and will post back here IF I can figure it out.

Kratos
Title: Re: Custom Form Mod
Post by: Mario on November 05, 2009, 01:20:02 PM
Does it design someone in order that it orders an e-mail when one orders the form?

I have edited the file Customform.php

And I have added after:
createPost($msgOptions, $topicOptions, $posterOptions);

This line but it does not work

mail("[email protected]",$msgOptions, $topicOptions, $posterOptions);
Title: Re: Custom Form Mod
Post by: - = Orfeo = - on November 05, 2009, 04:36:27 PM
Oh thanks Garou for the explanation! but i have a question:

Is possible duplicate forms? for a post-modification ... for a simple creation of similar forms .....  >:(

And change the order of the forms?

Or decide from some form select determinate board while complete the form?
Title: Re: Custom Form Mod
Post by: ɔɔɔɔɔɔuɥoɾ on November 05, 2009, 08:31:31 PM
Quote from: tintin16 on November 05, 2009, 04:36:27 PM
Oh thanks Garou for the explanation! but i have a question:

Is possible duplicate forms? for a post-modification ... for a simple creation of similar forms .....  >:(

And change the order of the forms?

Or decide from some form select determinate board while complete the form?

This mod currently only creates new posts, cannot edit existing ones.
Title: Re: Custom Form Mod
Post by: Garou on November 05, 2009, 11:53:16 PM
Kratos, from what I have been able to tell, the code for the mod is supposed to add permissions for each board to standard SMF permissions table. If you use phpMyAdmin to look at the table they don't appear in the table. I,m thinking that rather then adding to the table its getting stored in some sort of cache. Then whenever the actual permissions get modified or the cache is cleared the CF permissions get deleted from that cache.

I think the fix would be to add the setting to the CF_forms table instead of the smf permissions, I just havent had the chance to test it yet.

Mario, if you are just wanting an email in addition to posting in the board, it would be better to use the notification system already built into SMF.

If your wanting to have the form emailed rather then posting to the forums, I don't have an answer and probably wont for a long time. The entire point of this mod is to create a pre-formatted forum post based on the users input. Somewhere down the road I might consider looking into how to add email and or PM's but there are many more features to add based on what the mod was originally intended to do.

tintin16, the ability to reorder the forms and a copy function are on the very long "to do" list already. I plan to get to them as soon as I can.

As for the ability to select what board to post the form from within the form rather then the admin settings, probably isn't going to happen. You are not the first to mention it and Ive added it to my notes but based on the way the existing code is written, it really isn't possible to add in. The entire mod would have to be re-written from scratch and I just don't have the time to do that.





Title: Re: Custom Form Mod
Post by: king kratos on November 06, 2009, 12:12:35 AM
Quote from: Garou on November 05, 2009, 11:53:16 PM
Kratos, from what I have been able to tell, the code for the mod is supposed to add permissions for each board to standard SMF permissions table. If you use phpMyAdmin to look at the table they don't appear in the table. I,m thinking that rather then adding to the table its getting stored in some sort of cache. Then whenever the actual permissions get modified or the cache is cleared the CF permissions get deleted from that cache.

I think the fix would be to add the setting to the CF_forms table instead of the smf permissions, I just havent had the chance to test it yet.

That would make sense. I can tell you that it is not being stored in the SMF file cache. I just emptied that cache and the permission settings are still set correctly.

I am setting up a test site to play around with and learn more about php and the system that SMF uses. I will install this mod and play around with the php and database and see what I can figure out. I cannot guarantee that I will be able to figure this out as I am still learning, but it is a good opportunity for me to learn more about the permissions system.

If you have any suggestions as to where I should start looking (files, etc), I would love to hear them.

Thanks,
Kratos
Title: Re: Custom Form Mod
Post by: Garou on November 06, 2009, 11:55:18 AM
The lines for the permissions are in the CustomForm.php, CustomForm.template.php, and ManageSettings.php for 2.x or ModSettings.php for 1.1.x. The easiest way to find them is just do a search through the files for "permission" or even just "perm" as I know there is one line that uses "CustomForm_view_perms". The two CF files look like they just check for permissions and the settings files have the commands to save them.

It uses the command save_inline_permissions (http://support.simplemachines.org/function_db/index.php?action=view_function;id=154) but I cant find any info about where its supposed save the data to. In checking the database tables I don't see where it actually saves to any of them, which I assume is the crux of the problem. However since the form permissions work till the regular permissions are changed it must be storing them someplace, since I cant see where I guessed it must be in cache.
Title: Re: Custom Form Mod
Post by: - = Orfeo = - on November 07, 2009, 01:32:55 AM
This can help to order the columns in action=form:

<a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=subject', $context['sort_by'] == 'subject' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[70], $context['sort_by'] == 'subject' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '

This organizate the board posts, changing some else from the code may be order the action=form page   :D
Title: Re: Custom Form Mod
Post by: wladymeer on November 08, 2009, 05:42:44 AM
I was reading a dozen of pages and couldn't find on it - is there any way I could actually make this custom form mod posts inside one same topic?

For example first form input created a topic and another one just add post to that same topic instead of creating another topic with same name?

Sorry if this was already explained how to do it - I've tried to search it before I posted but no luck I guess.
Title: Re: Custom Form Mod
Post by: king kratos on November 08, 2009, 06:10:06 AM
Quote from: wladymeer on November 08, 2009, 05:42:44 AM
I was reading a dozen of pages and couldn't find on it - is there any way I could actually make this custom form mod posts inside one same topic?

For example first form input created a topic and another one just add post to that same topic instead of creating another topic with same name?

Sorry if this was already explained how to do it - I've tried to search it before I posted but no luck I guess.

This is currently not a feature that is available in this mod. I believe that this feature is on the very long to-do list, but don't quote me on that.

Kratos
Title: Re: Custom Form Mod
Post by: SAFAD on November 08, 2009, 09:32:12 AM
d**n man i was working to add a form to the guest post from month (it is not simple cuz it do many more things plus of  this)
i will try it for sure
Title: Re: Custom Form Mod
Post by: Largo_npc on November 08, 2009, 01:24:16 PM
Not sure if this has been asked or mentioned yet, but would it be possible to have a tick box for if a field is Required rather than having to use the same text box as options?

If I choose radio button and set it to Yes and No, I can't have it required or it uses required as an option.
A tick box in the Add Field settings would be much better.

Max characters, default value ect would all be great additions too.

Also, with my custom mod to this mentioned a few pages back for posting more than one topic. Looking at it again, it could easily be attainable by adding a couple of if statements and a couple of new fields in the database table.
Title: Re: Custom Form Mod
Post by: Garou on November 08, 2009, 03:02:47 PM
check boxes for various functions are on thebto do list.

look in the help file for the extra parameters it explains max chars and required check boxes.

Ive got ideas on how to make the post to multiple bors function you made fit better with the mod I just havent had time to work on it just yet.
Title: Re: Custom Form Mod
Post by: Schuyler113 on November 09, 2009, 12:57:02 AM
I am getting a 501 error
QuoteMethod Not Implemented

GET to /index.php not supported.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Title: Re: Custom Form Mod
Post by: king kratos on November 09, 2009, 02:39:11 AM
I'm not sure if you have updated this to be compatible with RC2 yet, but when I use package manager to download this mod, it lets me. It them lets me install it, but gives an error while attempting to install it. The error is pointing to a non existing database table. It appears that the installer is not creating the database table like it's supposed to.

The exact error given is:

Table 'DBPREFIX_smf2.smf2_cf_fields' doesn't exist
File: /home/ACCOUNT_USERNAME/public_html/test/Packages/temp/install.php
Line: 97

Note: The all all caps represents information that has been removed for my own security and privacy. No other information from this error has been altered.

What database tables do you add to the database for this mod to work? I tried looking through the files to find the tables, but couldn't find them. Please list the tables and any attributes that are added to each table.

Also, the test install fails on the help file language strings. This is easy to get around as I just simply manually edit the code into the help file.

Thanks,

Kratos
Title: Re: Custom Form Mod
Post by: Garou on November 09, 2009, 08:41:59 AM
Yep there were a handful of changes I had to make to the mod to make it work with RC2. I will release version 1.6 of the mod that makes it compatible with RC2 soon Ive got one more tweak I'm in the middle of and soon as its completed I will post the update.

This will also be the last version of the mod that is compatible with versions of 2.0 prior to RC2 so I've trying to get as much into it as possible before release.
Title: Re: Custom Form Mod
Post by: Garou on November 09, 2009, 12:22:31 PM
Version 1.6 of the Custom Form Mod is available on the Downloads page.

It fixes a couple bugs, adds support for Message Icons and CAPTCHA, a field for redirection after a user submits a form has also been added, also some documentation has been made more clear.

There are three separate downloads for v1.6 one for 1.1.x versions of SMF, one for 2.0 through 2.0 RC1.2, and one for 2.0 RC2.

Screen Shots will  be updated in the near future to represent the new features.

As always if anyone runs into any problems let me know here and Ill address it soon as possible.

Enjoy  :)
Title: Re: Custom Form Mod
Post by: king kratos on November 09, 2009, 01:47:52 PM
Great! It looks awesome and works great. I like the new features, especially the redirect to feature. Now, I don't have to change the code for that function.

One possible bug I have noticed is that the very main page where you name the list of forms. The list of forms is all the ways at the bottom of the page instead of right underneath the area where you name the form list section. I have two screenshots to show this because it is so far down the page, I couldn't fit it all on one screenshot.

Kratos
Title: Re: Custom Form Mod
Post by: Garou on November 09, 2009, 04:49:04 PM
Odd its not doing that on my test site nor the one upgraded live site I've put it on today.

What browser are you using? Are there any other mods on the site? Since you have spent some time looking through the mod in the past do you notice anything odd in the CustomForm.template.php
Title: Re: Custom Form Mod
Post by: Flammifer on November 09, 2009, 04:56:09 PM
It looks like you've already got a lengthy wish list for this great mod. I'm hoping that attachments are on that list as it would add a lot of possibilities for uses (including my particular case). If not, please add it  :)
Title: Re: Custom Form Mod
Post by: Garou on November 09, 2009, 06:14:26 PM
Attachments are on the list and I hope to get to it within the next couple updates.
Title: Re: Custom Form Mod
Post by: bros on November 09, 2009, 07:10:52 PM
Yay. This works on SMF 2 RC2 almost perfectly (errors on Help.Template, I believe)
Title: Re: Custom Form Mod
Post by: king kratos on November 09, 2009, 07:38:18 PM
Quote from: Garou on November 09, 2009, 04:49:04 PM
Odd its not doing that on my test site nor the one upgraded live site I've put it on today.

What browser are you using? Are there any other mods on the site? Since you have spent some time looking through the mod in the past do you notice anything odd in the CustomForm.template.php

I have glanced through that template and am not seeing anything that jumps out at me. I will take a closer look at it when I get home from school tonight.

I have used IE7, IE8 w/o compatibility mode, IE8 w/ compatibility mode, FireFox 3, and Safari (unknown version) and it happens on all browsers.

Kratos
Title: Re: Custom Form Mod
Post by: C4G-TK on November 09, 2009, 09:34:25 PM
When installing this, I got one error on SMF2.0 RC2 on default (curve).

This was the line that was pulling the error from the Packages.php file.

$context['package_readme'] = parse_bbc($context['package_readme']);


http://www.channel4gaming.com/forum2/index.php?action=admin;area=packages;sa=install;package=CustomFormMod_v1.6_SMF2_RC2.zip
8: Undefined index: package_readme
File: /var/www/html/forum2/Sources/Packages.php
Line: 365


345: 
346: // Now prepare things for the template.
347: foreach ($actions as $action)
348: {
349: // Not failed until proven otherwise.
350: $failed = false;
351:
352: if ($action['type'] == 'chmod')
353: {
354: $chmod_files[] = $action['filename'];
355: continue;
356: }
357: elseif ($action['type'] == 'readme')
358: {
359: if (file_exists($boarddir . '/Packages/temp/' . $context['base_path'] . $action['filename']))
360: $context['package_readme'] = htmlspecialchars(trim(file_get_contents($boarddir . '/Packages/temp/' . $context['base_path'] . $action['filename']), "\n\r"));
361: elseif (file_exists($action['filename']))
362: $context['package_readme'] = htmlspecialchars(trim(file_get_contents($action['filename']), "\n\r"));
363:
364: if (!empty($action['parse_bbc']))
==>365: $context['package_readme'] = parse_bbc($context['package_readme']);
366: else
367: $context['package_readme'] = nl2br($context['package_readme']);
368:
369: continue;
370: }
371: // Don't show redirects.
372: elseif ($action['type'] == 'redirect')
373: continue;
374: elseif ($action['type'] == 'error')
375: $context['has_failure'] = true;
376: elseif ($action['type'] == 'modification')
377: {
378: if (!file_exists($boarddir . '/Packages/temp/' . $context['base_path'] . $action['filename']))
379: {
380: $context['has_failure'] = true;
381:
382: $context['actions'][] = array(
383: 'type' => $txt['execute_modification'],
384: 'action' => $smcFunc['htmlspecialchars'](strtr($action['filename'], array($boarddir => '.'))),
385: 'description' => $txt['package_action_error'],
Title: Re: Custom Form Mod
Post by: Garou on November 09, 2009, 10:11:13 PM
Kratos, I'm completely at a loss Ive installed this on 4 different servers and cant seem to replicate the problem. The settings page is only partially created by the CustomForm.template.php the section where it says "function template_CustomForm_FormSettings()" The rest of the page is based off of SMF's Admin template maybe the problem is in there.

TK, the mod doesn't edit the Packages.php, if the error is in that file, it probably got messed up in an upgrade. Other then that you might want to open up the zip file and change the package-info.xml where it says

<readme parsebbc="true">ReadMe.txt</readme>
to
<readme>ReadMe.txt</readme>

drop the file back in the zip and try to install it.

It makes the readme file look a lot less pretty but its the same info that's on the downloads page so you can always look there if you need that info.  :-\
Title: Re: Custom Form Mod
Post by: king kratos on November 09, 2009, 10:23:21 PM
Quote from: Garou on November 09, 2009, 10:11:13 PM
Kratos, I'm completely at a loss Ive installed this on 4 different servers and cant seem to replicate the problem. The settings page is only partially created by the CustomForm.template.php the section where it says "function template_CustomForm_FormSettings()" The rest of the page is based off of SMF's Admin template maybe the problem is in there.

Well, I am at a loss as well. It's not a big deal since I am the only admin on my forum and it doesn't really bother me that much. If it is not doing this for you, then that means that it is specific to my forum.

Anyways, I really like the new features that you have implemented. This mod is one of the most useful mods that I have installed!

Kratos
Title: Re: Custom Form Mod
Post by: C4G-TK on November 09, 2009, 10:53:06 PM
Ok, will do that.

I didn't perform an upgrade though.  I installed a RC2 test site from the download site.
Title: Re: Custom Form Mod
Post by: MarcusJ on November 10, 2009, 08:31:14 PM
I just installed this mod today.  It worked the first try, is easy to use and very robust.  Thank you to the authors!
Title: Re: Custom Form Mod
Post by: zushiba on November 11, 2009, 06:49:39 PM
Tried to update from 1.5 to 1.6 and am getting the following error when I attempt to add a form.
QuoteYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 3
File: /path/to/my/forums/Sources/ModSettings.php
Line: 612
There is also a phantom form that I can't seem to get rid of in 0 ("Invalid Board")

EDIT: oh this is SMF 1.1.10
Title: Re: Custom Form Mod
Post by: Garou on November 11, 2009, 11:44:55 PM
Attach your ModSettings.php, ill have to see whats causing the error. it could be the same bit of code causing both problems.

I just thought of something, did you uninstall 1.5 before installing 1.6? There could be duplicate code causing the problem otherwise.
Title: Re: Custom Form Mod
Post by: zushiba on November 12, 2009, 12:39:10 AM
I did uninstall it yes.
Title: Re: Custom Form Mod
Post by: Garou on November 12, 2009, 11:24:05 AM
Quoted below is lines 115 - 124 of your file
$subActions = array(
'customform' => 'CustomFormSettings',
'actions' => 'ModifyActionSettings',
'customform' => 'CustomFormSettings',
'aeva' => 'ModifyAevaSettings',
'aevasites' => 'ModifyAevaSettings',
'basic' => 'ModifyBasicSettings',
'layout' => 'ModifyLayoutSettings',
'karma' => 'ModifyKarmaSettings',
);


The fact that there are two instances of "'customform' => 'CustomFormSettings'," is the only thing I see wrong with the file. Try deleting the 2nd one other then that and the code from Aeva and the Custom actions mod this file is identical to the on on my test server. Depending on what webserver and OS software your host is running this could cause a problem but it ran fine on my test server running Windows Vista, and Xampp Apache.

Line 612 and all the code around it is identical to the code in Post.php that allows a user to set message icons in a post. It seems to me if this was the problem you'd also be having problems posting on your forum all together.  :-\

None the less delete the duplicate code at line 118 and see if this solves the problem. If not let me know.
Title: Re: Custom Form Mod
Post by: zushiba on November 12, 2009, 11:33:46 AM
I removed the extra code but I'm still getting the same error.
Title: Re: Custom Form Mod
Post by: Garou on November 13, 2009, 02:15:11 PM
Check your cf_forms database table and make sure there are fields for,
ID_FORM, ID_BOARD' title, icon, form_exit, template_function, subject, output.

Its possible that the cf_forms DB didn't update for some reason but there are no changes made to the message_icons DB that section of code is referencing.

I'm really perplexed about this one.
Title: Re: Custom Form Mod
Post by: zushiba on November 13, 2009, 03:30:07 PM
Field Type Collation Attributes Null Default Extra
ID_FORM smallint(5)**No*auto_increment
ID_BOARD smallint(5)** Yes NULL*
title tinytext latin1_swedish_ci* Yes NULL*
icon tinytext latin1_swedish_ci* Yes NULL*
form_exit tinytext latin1_swedish_ci* YesNULL*
template_function tinytext latin1_swedish_ci* Yes NULL*
subject tinytext latin1_swedish_ci* Yes NULL*
output text latin1_swedish_ci* Yes NULL*
Title: Re: Custom Form Mod
Post by: Garou on November 14, 2009, 11:04:31 PM
OK I'm really running out of ideas here. Try backing up the cf_forms and cf_fields DB's then delete them. Uninstall the mod and re-install it, then drop the DB's back in. If that don't work I really don't have a clue on how to fix it other then to start fresh and manually re-create your forms.
Title: Re: Custom Form Mod
Post by: zushiba on November 15, 2009, 06:31:20 AM
I tried dropping the fields reinstalling the mod it just spits out the same error so I already took the next step