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)

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:



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)

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



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

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


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



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: V@POR 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 V@POR, 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: V@POR 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
V@POR, 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: V@POR 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
V@POR, 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/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:



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.



or



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. I needed the functionality of this mod and I figured if I was going to start over or upgrade I might as well upgrade. So I just copied my old forum, upgraded it to 2.0 and moved everyone over.

I'm using this to do guild applications. Before it was forcefully injecting the application into the forums from a custom form but if any changes needed to be made to the form it was a huge pain in the ass. This way the officers can go edit the form on a whim.
Title: Re: Custom Form Mod
Post by: Garou on November 15, 2009, 10:22:24 AM
OK I just couldn't figure it out on my end my only other thing I would know to do is to get access to you server and get hands on. Glad it didn't come to that.  *sigh*

2.x is a much better system anyway  :)
Title: Re: Custom Form Mod
Post by: Illori on November 15, 2009, 12:21:02 PM
Has anyone had any issues with using ' in their forms? for example {user}'s Application.

I have tried this a few times and the form next appears on the forum after it was submitted.
Title: Re: Custom Form Mod
Post by: king kratos on November 15, 2009, 12:26:46 PM
Quote from: illori on November 15, 2009, 12:21:02 PM
Has anyone had any issues with using ' in their forms? for example {user}'s Application.

I have tried this a few times and the form next appears on the forum after it was submitted.

What do you mean by this statement?

Quote from: illori on November 15, 2009, 12:21:02 PM
the form next appears on the forum after it was submitted.


I use single quotes in many of my forms and do not have any issues with them. If we could better understand what is happening, we can help you easier.

Kratos
Title: Re: Custom Form Mod
Post by: Illori on November 15, 2009, 01:03:36 PM
I have attached my form, notice the 's in the subject, i have also attached the error when submitting the form
Title: Re: Custom Form Mod
Post by: king kratos on November 15, 2009, 01:18:40 PM
It appears that your database is at an incorrect version to be compatible with the version of forum you are running.

Go to the Download Page (http://download.simplemachines.org/) and download the large upgrade package form Version 1.1.10.

Upload the file named upgrade.php to your SMF root directory (same place where SSI.php is located).

Make a backup of your database (you can do this with either SMF maintenance or your host's control panel).

Point your browser to your_forum/upgrade.php and follow the directions.

Kratos
Title: Re: Custom Form Mod
Post by: Illori on November 15, 2009, 02:05:30 PM
I just installed this version a few days ago with fantastico de luxe, it should be  the correct version for the db. I am not sure that upgrading it would help any in admin panel it says all files are of the correct version 1.1.10.

[edit] upgraded db and i get this error now
Title: Re: Custom Form Mod
Post by: Garou on November 16, 2009, 08:22:13 PM
Fantastico would be your problem then. Ive never used it myself but when it comes to using it with SMF I have heard nothing but horror stories.

You would be much better off with a clean install of SMF.
Title: Re: Custom Form Mod
Post by: Illori on November 16, 2009, 08:36:51 PM
I have had no issues other then this one with any of my smf installs with  Fantastico. No one else have any ideas?
Title: Re: Custom Form Mod
Post by: Garou on November 17, 2009, 04:35:47 PM
Ok after some testing, if you are installing over an existing database, somehow the new fields added in the latest 1.1.x release can cause issues on some servers. A fresh install of SMF 1.1.10 and the mod should work just fine but if you have existing forms you'll have to backup cf_forms and cf_fields and delete those tables from the db, install the mod, and drop your backup back in. It might even help to create a dummy form then delete it before dropping your old db back in.

I'm not sure what is causing this issue but this is how to get around it. I'm sure its nothing in the code because as far as the database table is concerned the install file is the same as its always been save for the addition of the two new fields in the same format as was used in the past.  Its probably some server configuration as it only happened on 1 of the 3 servers I tested this on.
Title: Re: Custom Form Mod
Post by: Illori on November 17, 2009, 09:50:29 PM
What do you mean install over an existing database? When i installed the mod it was the first time with this database, the related tables did not exist before this install.
Title: Re: Custom Form Mod
Post by: Garou on November 17, 2009, 10:19:48 PM
The only way I was able to replicate your error was when a previous version of the mod had been installed and uninstalled prior to installing version 1.6 and I explained how I was able to make it work. On a fresh install of SMF 1.1.10 and version 1.6 of the mod I could not replicate your error.

Since I'm unable to reproduce the error I'm not sure what is causing it on your server. The only thing I can suggest uninstall the mod, manually remove the cf_forms and cf_fields tables from the database and reinstall the mod.
Title: Re: Custom Form Mod
Post by: Afro on November 24, 2009, 10:29:44 AM
I want to use this form on the post page.
That is adding the created fields on the usual post page.

something like

after
SUBJECT
you get

PRICE -------------------------
MODEL-------------------------
EMAIL---------------------------
PHONE NUMBER-----------------
AND MORE

All in the same post page.
I will use the post box as description

How can i do this ?
Title: Re: Custom Form Mod
Post by: Garou on November 25, 2009, 04:15:59 AM
That is outside the scope of this mod and should be discussed in SMF Coding Discussion (http://www.simplemachines.org/community/index.php?board=60.0).
Title: Re: Custom Form Mod
Post by: Zirc on November 27, 2009, 03:25:14 PM
I did a search of the topic but did not see my question asked yet.

What would be the easiest way to add a poll to all submitted forms?  One of the forms I use is an application that I would like moderators to vote on whether the submitter's application is approved or not.  I can go in and add a poll to each submitted application manually but if there is a way to automate this it would make my life easier. :D

Thanks in advance.
Title: Re: Custom Form Mod
Post by: Garou on November 27, 2009, 10:11:54 PM
It was asked before and I looked into it but there is no easy way. I haven't checked if its any easier with 2.0 RC2 but I also tend to avoid functions for this mod that aren't easily integrated into both the 1.1.x and 2.x versions of SMF.

You would have to go through at least ./Themes/default/Poll.template.php and ./Sources/Poll.php to find what you need to incorporate into the mod and if I remember right there are parts buried in the display and post functions as well.

When adding new functions into the mod generally there are 3 files that need to be modified based on what the functions do in the end.

./Sources/CustomForm.php and ./Sources/ManageSettings.php, handle most of the behind the scenes functions, the stuff that gets processed but the user never sees.
./Themes/default/CustomForm.template.php, effects what actually appears in the form the user fills out and in the admin area.

The other 2 files that generally get modified is ./Themes/default/languages/Modifications.english.php which contains the actual text that the mod displays and ./Themes/default/languages/Help.english.php which displays the text contained in the help files designated by [?].
Title: Re: Custom Form Mod
Post by: deciph3red on November 30, 2009, 08:21:33 PM
Is there a way to setup 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: Garou on November 30, 2009, 09:09:32 PM
Not at this time, the feature has been asked for before but its low on the priority list as if the user is logged in then such data as user name, time of post, ect. is all in the post information anyway.
Title: Re: Custom Form Mod
Post by: Studio on December 02, 2009, 06:39:28 PM
Quote from: 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.

Hi Garou... i hope all is well with the update.
This mod is really a great tool and would be perfect if it comes with an option to attach an image.
Godspeed mate.
Title: Re: Custom Form Mod
Post by: FragaCampos on December 07, 2009, 10:25:45 AM
A upgraded version 1.5 to 1.6. First i backed up the permissions, cf_forms and cf_fields tables, unistalled the mod, installed the new version and uploaded the tables.
But i get the following error when trying to edit a form:

Unknown column 'icon' in 'field list'
File: /Sources/ModSettings.php
Line: 626


Any suggestion on how to fix this? Thanks.

PS: added the file to facilitate.
Title: Re: Custom Form Mod
Post by: Garou on December 07, 2009, 11:44:27 AM
FragaCampos, is "icon" listed in the cf_forms database table?

studio, Attachments is a priority for the next update right after Permissions bug in both versions of the mod is fixed and there is apparently issues with the database in 1.1.x but it is coming soon.
Title: Re: Custom Form Mod
Post by: FragaCampos on December 07, 2009, 12:58:25 PM
You're right, Garou. It isn't there.

Here's a snapshot of that table:



How do i insert that field?
Title: Re: Custom Form Mod
Post by: KensonPlays on December 07, 2009, 01:30:30 PM
I HAVE THIS ERROR (image).

What I edit, etc... to fix this, before I install it!?

anyway, great mod!
Title: Re: Custom Form Mod
Post by: KensonPlays on December 07, 2009, 05:47:57 PM
Quote from: 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?

Same error, tryed re-caching it, and didn't modify ANY files except for forum CSS...
Title: Re: Custom Form Mod
Post by: FragaCampos on December 07, 2009, 07:20:31 PM
Ok, i managed to add
  `icon` tinytext,
  `form_exit` tinytext,

to the cf-forms table. At least, i can use the forms again.

But now i get this error when i try to edit the forms in admin panel:
You 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: /Sources/ModSettings.php
Line: 830


:(
Title: Re: Custom Form Mod
Post by: Garou on December 08, 2009, 10:33:45 AM
Kcmartz, Im going to take a wild guess that you are running Simple Portal. Both that mod and this one edit the same bit of code.

Open up
./Sources/Admin.php

It should look something like with a line from SP thrown in there

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


add after

loadLanguage('Modifications');


If that doesn't work compare your files to the parser on the downloads page for your version.

FragaCampos, attach your ModSettings.php and ill see if I can find it in there.
Title: Re: Custom Form Mod
Post by: FragaCampos on December 08, 2009, 11:05:32 AM
Ok, here it goes.
Thanks for helping.
Title: Re: Custom Form Mod
Post by: Garou on December 08, 2009, 01:00:03 PM
hmmm everything in that file checks out and everything is working on a fresh install of SMF 1.1.11.

uninstall the mod, delete the DB tables, reinstall the mod, and see if you can create a form before importing your old dB.

If its working then use the mod to delete the form you just created and then import your DB without deleting the existing tables. Maybe that will work.  :-\
Title: Re: Custom Form Mod
Post by: Hoodie on December 08, 2009, 02:47:59 PM
Quote from: deciph3red on November 30, 2009, 08:21:33 PM
Is there a way to setup a variable to actually show the forum username?
For example, I want it to show it he subject like this
{Forumname} has applied.

I know you said it's low on the priority list but I'd like to be able to add this too..  Just wanted to show there is interest for this feature..
Title: Re: Custom Form Mod
Post by: FragaCampos on December 08, 2009, 05:37:22 PM
Quote from: Garou on December 08, 2009, 01:00:03 PM
hmmm everything in that file checks out and everything is working on a fresh install of SMF 1.1.11.

uninstall the mod, delete the DB tables, reinstall the mod, and see if you can create a form before importing your old dB.

If its working then use the mod to delete the form you just created and then import your DB without deleting the existing tables. Maybe that will work.  :-\

I unistalled the mod, deleted the tables, and installed de mod (v 1.6). I can't create a new form... it gives me the same error i told you above... :(
Title: Re: Custom Form Mod
Post by: FragaCampos on December 10, 2009, 10:18:18 AM
Garou can you please give me a link to v1.5 so that i can at least edit my forms and see if it has something to do with v1.6 or something else?
(unfortunately i deleted v1.5's file in the server...)
Title: Re: Custom Form Mod
Post by: Garou on December 10, 2009, 11:05:35 AM
Ive got an archive at http://smf.balancegames.net/index.php?action=mgallery;sa=album;id=5
Title: Re: Custom Form Mod
Post by: FragaCampos on December 10, 2009, 11:36:23 AM
Thank you, Garou.
With version 1.5 everything is fine :/
Title: Re: Custom Form Mod
Post by: Axodious on December 12, 2009, 10:23:35 PM
Would it be possible to add an option that if turned on redirects guests to the "Sorry, you cannot post new topics in this board.
Please login below or register an account." page or something similar. Also if possible a way to say to certain membergroups "you are already in x membergroup" or something like that.

To be more detailed I am using this as an application form for an MMO video game. I need the people filling out the form to be registered so I can adjust their account if they are accepted. As for the second part I don't want people who already have been accepted to be able to fill it out again.

P.S.

There are typos in your help messages, some of them say index.php?action=form while others say index.php?action=forms.
Title: Re: Custom Form Mod
Post by: MarcusJ on December 14, 2009, 12:22:24 AM
Hello SMF2 RC2 User here.

For some reason the only form I use keeps resetting to no user groups being able to view it.

I use the following mods:

1.     Custom Form Mod      1.6
2.    Pretty URLs    1.0RC
3.    SimplePortal    2.3.1
4.    Downloads System Pro    1.0.10
5.    cbi, 1.0    1.5.6
6.    Aeva ~ Auto-Embed Video & Audio    7.0
7.    SMF Media Gallery    2.0.5

Thanks for any help you can provide.
Title: Re: Custom Form Mod
Post by: Garou on December 14, 2009, 09:09:41 AM
MarcusJ, Im still trying to track that bug down. It happens in both 2.x and 1.1.x as it stands now you'll have to reset the group permissions in the mod every time you add or edit user groups in your forum.

Axodious, if you don't want a group to access a form don't check that group in the permissions for the form. They wont even be able to see it in the form list if they don't have permission to use it.

Typos noted it will get fixed in the next update.
Title: Re: Custom Form Mod
Post by: Axodious on December 15, 2009, 04:34:29 PM
Well, the reason I asked is because I have an button on the index page called "Apply" and right now if someone doesn't have permission to use the form they don't receive any warning that they don't. I have currently put together a small workaround for it so to speak, simple added an if user is guest to redirect them to the login screen.
Title: Re: Custom Form Mod
Post by: FragaCampos on December 16, 2009, 02:13:37 PM
Garou, i'm sorry to bother you again with this...
I installed v1.6 in a clean install of SMF 1.1.11 and it's working fine.
I installed manually the mod in my server and i'm keep getting the same error when i try to create a new form...

Do have any idea what's going on? I mean, this must be something related to the DB, right?
Can´t i just make an addition to the sql table?
Title: Re: Custom Form Mod
Post by: Garou on December 16, 2009, 06:02:43 PM
The only thing I can think of is maybe you have another mod that effects the icons or icon management in some form.

The code that is erroring out for you is directly related to the icons and is an almost identical copy of the code that SMF uses by default to enter icons in a post. Now if you have a mod that somehow changes that then it could possibly be causing problems with the code this mod uses. Outside of that I'm at a loss.
Title: Re: Custom Form Mod
Post by: FragaCampos on December 16, 2009, 08:06:06 PM
Yes, it's probably something to do with the icons, since version 1.5 works just fine. But your suggestion doesn't apply to me, since i don't think i have any mod that messes with the icons...
Oh well, i think i'll have to install one at a time in a fresh SMF install to see which one of them is conflicting with Custom Form Mod.

Thanks anyway.
Title: Re: Custom Form Mod Error After Upgrading to 1.1.11
Post by: jkfriends on December 19, 2009, 12:54:58 PM
I upgraded to 1.1.11 from 1.1.10.  When I add a new form now via Configurations > Features & Options > Custom Forms > Add a Form, I get this error.

You 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: /home/reviews2/public_html/mysite/forums/Sources/ModSettings.php Line: 656

I looked into this file and I see this section....

      if (($temp = cache_get_data('posting_icons-' . $board, 480)) == null)
      {
         $request = db_query("
            SELECT title, filename
            FROM {$db_prefix}message_icons
            WHERE ID_BOARD IN (0, $board)", __FILE__, __LINE__);   <=== line# 656
         $icon_data = array();
         while ($row = mysql_fetch_assoc($request))
            $icon_data[] = $row;
         mysql_free_result($request);

         cache_put_data('posting_icons-' . $board, $icon_data, 480);
      }


Also I attached the whole ModSettings.php file as well.

Please help me how to fix this?

Thanks.
Title: Re: Custom Form Mod
Post by: macii on December 19, 2009, 01:50:52 PM
I first tested this mod on the desktop (on XAMMP).. no problems.

I put a clean install of SMF 2 RC2 on a live server and installed this mod fresh.

I set up a form.. when I access the forms page and click to view a form, I receive this error message:

501 Method 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.

From other topics in this community, it appears this is a mod security issue. And, from all my readings is directly related to the use of id in the code.

Given that the access to the forms uses id=1 etc.. is there anyway round this issue.. or do I delete the mod ??
Title: Re: Custom Form Mod
Post by: FragaCampos on December 19, 2009, 06:40:29 PM
Well... jkfriends has the same error than me. Good to know i'm not alone :P
Title: Re: Custom Form Mod
Post by: jkfriends on December 19, 2009, 06:56:30 PM
I tried to uninstall and reinstall this mod.  When it uninstalled, it deletes cf_forms and cf_fields tables correctly.  After reinstall, it recreates these 2 tables correctly but the mod is not usable.

However when I go to Configurations > Features & Options > Custom Forms page, it still remembers the form name and form title that I gave prior to uninstall.  So does anyone know where the form name and form title get stored?  Perhaps deleting that table entry would make the whole thing clean so that I can start from scratch?
Title: Re: Custom Form Mod
Post by: macii on December 19, 2009, 07:08:10 PM
I have now resolved the issue.. however, I suspect a lot more users will suffer the same issue.

The error 501 is caused by a security device, which nearly ALL shared servers have and it is switched ON. What causes the issue is the reference to "id" in the mod itself. So, this will not be the only mod having this problem.

There is an htaccess workaround - which is mentioned in other support threads. However, again, in the majority of cases, this will also NOT be permitted.

Therefore, the ONLY recourse - apart form a mod re-write (which is apparently also possible) is to contact the host provider and ask them to cancel Security for the site.

Now.. I can understand the issues from the server providers point of view - that could be dangerous. I can also understand it from the ease of use point of view when it comes to a Mod..

BUT, somewhere along the line, this error is going to keep re-surfacing until some guidelines ARE in place for writers of mods.. which will NOT trigger Security issues...

I think this is something SMF needs to look at and work out the best method. I expect, once the new release becomes the "working model" a LOT more people are going to get error 501 issues..
Title: Re: Custom Form Mod
Post by: Garou on December 20, 2009, 09:18:16 AM
jkfriends there is some sort of conflict with another mod, on a fresh install of SMF with the 1.6 version of this mod, it works fine. As of yet I haven't been able to track down what mod is causing the conflict. If you look for the code in question in  /Sources/Post.php it should be identical. If its different try replacing the code the mod uses.

As for the database it should not be deleted with the mod. Most mods dont delete the data in a database, that way if an admin wishes to re-install a mod they dont have to recreate all the data. With the mod removed use phpMyAdmin to manually delete the database tables cf_fields and cf_forms in your database for SMF.

macii, Mod_Security created a couple of rules about a year or so ago that causes problems for some SMF mods, Most other forum software, Word Press, and other web based software. The Problem is that Mod_Security made these rules way too restrictive. Being secure is one thing but when it causes so many problems its a bit impractical.

That said your host doesn't have to turn off all security for your site they just need to get around those couple rules. This is an article on Mod_Security's Blog that explains how a host can work around them. http://blog.modsecurity.org/2007/02/handling-false.html
Title: Re: Custom Form Mod
Post by: svpernaut on December 20, 2009, 11:15:50 AM
IS there any way I can make this mod appear on a html or php template?
Title: Re: Custom Form Mod
Post by: jkfriends on December 20, 2009, 12:09:02 PM
Thanks Garou for a reply.

The error message that I get is from ModSettings.php file (line 656).  Could you please take a look at this (if you see on page-49 of this post, I've included an attachment of this file) and let me know what's causing this?  Also could you explain about post.php?  I don't see any references of custom form mod within that file nor I see this file in the 1.6 ZIP file.  Please explain.

Title: Re: Custom Form Mod
Post by: Garou on December 21, 2009, 10:05:32 AM
svpernaut, sorry no. The mod doesn't store a users input, it only creates the forum post.

jkfriends, the mod doesn't edit the Post.php but the code the mod uses in the ModSettings.php (which you referenced in your last post)  is a copy of the code from Post.php. My belief is that if another mod either edits the code in the Post.php or another file that the code refers to then it could be causing the problem in the mod.

The code from the mod in in the file you attached matches correctly to my code which does work on a fresh install of SMF. However once you start adding multiple mods they can often conflict with each other. We mod authors go to great lengths to prevent code conflicts where we can but with the hundreds of mods out there its impossible check every possible combination and sometimes conflicts happen. In the end as long as a mod runs on a fresh install of SMF without causing forum errors or security loopholes we go ahead and publish as that's pretty much all SMF asks of us.

That said in reviewing your ModSettings.php I noticed code from the Pretty URLs mod. In the past some users have had problems with these  two mods due to the way they work and I was unable to come up with a way around it. Whether or not that is the problem in this case I cant say for sure, its just an observation but you could try uninstalling Pretty URLs to see if that is the problem.
Title: Re: Custom Form Mod
Post by: FragaCampos on December 21, 2009, 12:04:28 PM
I don't have Pretty URLs mod installed, so it can't be from that.  ::)

jkfriends, can you list your mods so that i can see which are in common?


Title: Re: Custom Form Mod
Post by: ŦώεαЖзяŁ on December 21, 2009, 12:09:23 PM
A not perfect way to make posts made through custom forms count towards the user post count is to do the following

open CustomForm.php in \sources

find:
Quote$posterOptions = array(
               'id' => $user_info['id'],

add in the next line:
Quote'update_post_count' => !$user_info['is_guest'],

The reason why it's not perfect is that it will not check whether the target board has post count enabled and therefore will add increase the count even if the target board is not supposed to count posts... In my case, that solved my problem because all my forms are supposed to count, so if that's you case, cool...
Title: Re: Custom Form Mod
Post by: Garou on December 21, 2009, 12:21:02 PM
TweakerL, Ill take a look at it and see if I can find the code that checks the board as well. Either way Ill get it in and credit you in the next update. Hopefully that will be shortly after the new year. Maybe a bit longer if I dont get the vacation I put in for. LOL

Priorities for the next version are, fixing permissions, figuring out the Icon problems some are having in 1.1.x, attachments, and getting the ability for the new topic button to link to a form. :)
Title: Re: Custom Form Mod
Post by: macii on December 21, 2009, 12:32:05 PM
Thanks for your reply garou, and your link to the explanation, I am sure that will come in handy for others.

By the way.. your Mod works great now..  ;D
Title: Re: Custom Form Mod
Post by: svpernaut on December 21, 2009, 12:37:36 PM
Thanks Garou
1 more question.
How do I make it when the form is filled out it makes the topic name: [pending]          but in front of the pending have it like a game name or something like this:
http://www.misfitmafia.com/smf/index.php?board=63.0

Nevermind I got it.
Title: Re: Custom Form Mod
Post by: Garou on December 21, 2009, 01:06:12 PM
You can enter anything in the Subject line in the admin settings for the form including form fields.
For instance you could enter...
Application for {name} [pending]

Then if I entered Garou in the name field of the form, it should read as...
Application for Garou [pending]
Title: Re: Custom Form Mod
Post by: GohighVoltage on December 21, 2009, 02:54:12 PM
I am having same problem as below.   Nothing shows on the Forms page.

Quote from: jkfriends on December 19, 2009, 06:56:30 PM
I tried to uninstall and reinstall this mod.  When it uninstalled, it deletes cf_forms and cf_fields tables correctly.  After reinstall, it recreates these 2 tables correctly but the mod is not usable.

However when I go to Configurations > Features & Options > Custom Forms page, it still remembers the form name and form title that I gave prior to uninstall.  So does anyone know where the form name and form title get stored?  Perhaps deleting that table entry would make the whole thing clean so that I can start from scratch?

Title: Re: Custom Form Mod
Post by: GohighVoltage on December 21, 2009, 03:39:57 PM
Never Mind.  It is fine. Works great.
Title: Re: Custom Form Mod
Post by: Axodious on December 21, 2009, 04:35:46 PM
If using: [img]{something}[/img] It is not being resized according to the SMF max width/height of posted pictures option.
Title: Re: Custom Form Mod
Post by: Axodious on December 21, 2009, 05:45:42 PM
I am receiving errors in my administration panel about:

http://*****/forum/index.php?action=admin;area=modsettings;sa=customform;field_id=1;
Undefined index: field_type
File: forum/Sources/ManageServer.php
Line: 1801


Everytime I edit one of the fields, this does not seem to be harming the form or forum in anyway however.

The line in question is:
'value' => $config_var[0] == 'select' ? $modSettings[$config_var[1]] : (isset($modSettings[$config_var[1]]) ? htmlspecialchars($modSettings[$config_var[1]]) : (in_array($config_var[0], array('int', 'float')) ? 0 : '')),
Title: Re: Custom Form Mod
Post by: jkfriends on December 21, 2009, 07:15:40 PM
OK.  I tried Garou's suggestion to uninstall the Pretty URL mod and I still get the same error.  Here is the list of mods that I'm currently using:

   Mod Name     Version     
1.    reCAPTCHA for SMF    0.9.5.4b    [ Uninstall ]
2.    Enhanced Profile Header    1.0    [ Uninstall ]
3.    SMF Sitemap    1.2.2    [ Uninstall ]
4.    SMF 1.0.18 / 1.1.10 / 2.0 RC1-2 Update    1.1    [ Uninstall ]
5.    Custom Action Mod    2.04    [ Uninstall ]
6.    Generic Avatars    1.1    [ Uninstall ]
7.    68 High Quality Avatars depicting occult symbolism old and new    1.0    [ Uninstall ]
8.    Reflection Avatar    1.1    [ Uninstall ]
9.    Aeva ~ Auto-Embed Video & Audio    6.9.99    [ Uninstall ]
10.    Custom Form Mod    1.6    [ Uninstall ]
11.    Related Topics    1.3.3    [ Uninstall ]
12.    Abstract black and white 100    1.0.0.1    [ Uninstall ]
13.    Hide SMF Version    1.0.3c    [ Uninstall ]
14.    Pretty URLs    1.0RC    [ Uninstall ]

[ Delete Mod List ]

Please let me know.  All of them were working fine in 2.1.10 version.

GohighVoltage, You mentioned that you had the same problem but you fixed it now....could you share what you did to fix it?

Thanks.
Title: Re: Custom Form Mod
Post by: FragaCampos on December 21, 2009, 09:54:55 PM
Ok, the only mods i have from that list are:

1. reCAPTCHA for SMF    0.9.5.4b
9 .Aeva ~ Auto-Embed Video & Audio    6.9.99

So the problem must be with one of those... hope it helps  O:)
Title: Re: Custom Form Mod
Post by: kripz on December 22, 2009, 05:57:28 AM
You 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 Call of Duty 4 Application', 1, 255), SUBSTRING('asd
asd', 1, 65534), SUB' at line 4
File: /var/www/pure/Sources/Subs-Post.php
Line: 1539


Line ~1539
// Insert the post.
db_query("
INSERT INTO {$db_prefix}messages
(ID_BOARD, ID_TOPIC, ID_MEMBER, subject, body, posterName, posterEmail, posterTime,
posterIP, smileysEnabled, modifiedName, icon)
VALUES ($topicOptions[board], $topicOptions[id], $posterOptions[id], SUBSTRING('$msgOptions[subject]', 1, 255), SUBSTRING('$msgOptions[body]', 1, 65534), SUBSTRING('$posterOptions[name]', 1, 255), SUBSTRING('$posterOptions[email]', 1, 255), " . time() . ",
SUBSTRING('$posterOptions[ip]', 1, 255), " . ($msgOptions['smileys_enabled'] ? '1' : '0') . ", '', SUBSTRING('$msgOptions[icon]', 1, 16))", __FILE__, __LINE__);
$msgOptions['id'] = db_insert_id();


1. Treasury 1.01 [ Apply Mod ] [ List Files ] [ Delete ]
2. TinyPortal 1.083  [ Uninstall ] [ List Files ] [ Delete ]
3. Custom Form Mod 1.6  [ Uninstall ] [ List Files ] [ Delete ]


SMF 1.1.11
Title: Re: Custom Form Mod
Post by: Garou on December 22, 2009, 09:10:27 AM
Axodious, as for Images it shouldn't override board settings on display are you using parse_bcc in the Extra Type Parameters? Also have you tried something like...
[img width=48 height=48]{something}[/img]

As for the errors, thats a very unusual error for this mod. Usually odd errors like that are due to admins not following the naming conventions outlined in the help file. How are you naming your title fields, are you using any capital letters, special characters or spaces?

For those still having issues with 1.1.x I'll probably have to end up removing icon support from the 1.1.x version of the mod in the next release. In the meantime just use the older 1.5 version found at http://smf.balancegames.net/MGalleryItem.php?id=15
Title: Re: Custom Form Mod
Post by: jkfriends on December 22, 2009, 09:20:10 AM
FragaCampos, I uninstalled both but still I have the same problem.....
Title: Re: Custom Form Mod
Post by: Axodious on December 22, 2009, 02:39:21 PM
The error seems to be related to SMF 2 (or a mod) as I am getting it with the search crawler enabled as well.

http://*****/forum/index.php?action=admin;area=sengines;sa=settings;a9576f81=e1bf431b12d8ed07b163f15506b565e4
8: Undefined index: show_spider_online
File: /home/gsadmin/public_html/forum/Sources/ManageServer.php
Line: 1801


As for the images if I manually add a width/height it works.
Title: Re: Custom Form Mod
Post by: Garou on December 23, 2009, 10:44:30 AM
Yeah I just did a quick search for ManageServer.php
And there are several threads going about the exact error so its definitely not the CF mod in this case. :)
Title: Re: Custom Form Mod
Post by: GohighVoltage on December 23, 2009, 02:11:44 PM
Hi,  GREAT Mod!!!    Question:  Is there a way to have a field to upload an attachment?   this would be great if possible.
Title: Re: Custom Form Mod
Post by: Spoogs on December 23, 2009, 02:13:29 PM
Quote from: Garou on December 21, 2009, 12:21:02 PM
Priorities for the next version are, fixing permissions, figuring out the Icon problems some are having in 1.1.x, attachments, and getting the ability for the new topic button to link to a form. :)
Title: Re: Custom Form Mod
Post by: GohighVoltage on December 23, 2009, 02:49:54 PM
AWESOME!  Thanks!
Title: Re: Custom Form Mod
Post by: GohighVoltage on December 23, 2009, 03:14:12 PM
Ok,  when adding a radio box.     In Extra Type Parameters ,   I type:  yes,no

But how do I make this a "required" field as well?
Title: Re: Custom Form Mod
Post by: Spoogs on December 23, 2009, 03:22:02 PM
Thats been a concern of mine also... i think it would be nice if the extra parameters were separate, maybe have its own field or check box so we can just check the ones that apply.
Title: Re: Custom Form Mod
Post by: GohighVoltage on December 23, 2009, 03:25:04 PM
Is this in the works on fixing also?   Or is there a work around?
Title: Re: Custom Form Mod
Post by: Spoogs on December 23, 2009, 03:36:11 PM
i dont think its in the works at this time but only Garou can tell us that. There's no work around that i know of.. just have to leave out the required, maybe put an information box just above stating that the field below is required and hope they deal with it. Maybe someone else has a better suggestion but thats what i do.
Title: Re: Custom Form Mod
Post by: kripz on December 24, 2009, 07:23:26 AM
Anybody have any ideas for my problem?

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

Edit: Found out the problem, you need to escape characters. ' will break it.
Title: Re: Custom Form Mod
Post by: divekennene on December 24, 2009, 04:58:57 PM
I think I need some real help.  I am very green to all this php stuff.  I have installed the custom form mod for SMF 1.1.11 and I'm not having a whole lot of luck with it.  For some reason I can't get the form to show up in my selected board so my members can use it.  Any one have any ideas what might keep that from happening?  If I type "index.php?action=form" into my browser address bar, it takes me to the form...but that is the only way I am able to access the form.  Why am I not getting any kind of link anywhere in my forum?  What files do I need to provide so someone can help me?  Thank you so much for any help...this is driving me nuts.

Matt
Title: Re: Custom Form Mod Error After Upgrading to 1.1.11
Post by: emanuele on December 25, 2009, 12:19:31 PM
Quote from: jkfriends on December 19, 2009, 12:54:58 PM
I upgraded to 1.1.11 from 1.1.10.  When I add a new form now via Configurations > Features & Options > Custom Forms > Add a Form, I get this error.

You 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: /home/reviews2/public_html/mysite/forums/Sources/ModSettings.php Line: 656

I looked into this file and I see this section....

      if (($temp = cache_get_data('posting_icons-' . $board, 480)) == null)
      {
         $request = db_query("
            SELECT title, filename
            FROM {$db_prefix}message_icons
            WHERE ID_BOARD IN (0, $board)", __FILE__, __LINE__);   <=== line# 656
         $icon_data = array();
         while ($row = mysql_fetch_assoc($request))
            $icon_data[] = $row;
         mysql_free_result($request);

         cache_put_data('posting_icons-' . $board, $icon_data, 480);
      }


Also I attached the whole ModSettings.php file as well.

Please help me how to fix this?

Thanks.

Regarding this error I noticed that a value is never assigned to the variable $board in the function CustomFormSettings.
Could it be the source of the problem?
Title: Re: Custom Form Mod
Post by: jkfriends on December 25, 2009, 09:06:26 PM
I was about to post the answer but emanuele already posted the solution to my problem (Thanks emanule).  I removed $board from the WHERE clause (i.e., WHERE ID_BOARD in (0) only).  The root of the problem is that somehow $board variable is not set and it is NULL.  As a result the SQL query fails.

Mod author, please shed some light on why $board is NULL at this spot in the code?

After removing $board reference from the WHERE clause, I'm able to view the forms correctly. I'm back online with forms now.

Feature requests:

A) It would be nice to keep the form fields as global as possible so that the same fields can be reused in multiple forms.  I've a recipe forum where people submit recipes in various categories.  I have about 8 sub-boards (for each category of recipe) with the same field information (recipe name, ingredients, procedure, picture, notes, etc) in all submit recipe forms.  With the current mod design, all fields are tied to the form level.  This means that I have to repeat the same field info in all 8 forms unnecessarily.  If we have the fields at the global level, then the same fields can be leveraged in all forms.

To overcome this, I made one form with all requied form fields.  Then I created 7 other forms but with no form fields.  Then I wrote a little SQL script that copies all form fields into all 7 forms (smf_cf_fields) and this saved me 2 hours of typing.  The reason I have to make 8 forms is that each form would post into a different board.

Please consider this for your next revision.  If this would drastically change the overall design, please at least consider a copy field option (between the forms) which would result in the samething as my SQL script does.

Perhaps ths is already supported that don't know how to do this?

B) I have a form field that accepts the image URL.  Then in my output window, I specify something like this:

[left][img]{image}[/img][/left]

As soon as I save this, it becomes like this:

[left][img]http://{image}[/img][/left]

As a result of this, when the user submits an image URL with http:// prefix in the field, the end result contains two http:// references. Hence no picture is embedded into the post.  Natually when someone submits an image URL into a post, they typically cut and copy the URL from somewhere and generally no one would be manually removing the http:// prefix.

Why are you forcing "http://" prefix automatically when I save the form?

Again to overcome this problem, I wrote a little "update" command that removes "http://".   So now everytime I change the form output, I have to remember to do the update also to be correct.

C) Since this custom form is tied to a specific board, when someone submits a recipe (in my case), the post count for that person who submitted is not incremented.  It is still staying at the old post count for that person.  Why is that?  Can you please do postCount ++ after a successful submit?

D) A single form to post into multiple boards depending upon a drop-down choice.  This would have eliminated 8 custom forms in my case.  One custom form with 8 drop-down values in a form field and each drop-down value would be assigned to a specific board ID.   Voila...this would be perfect.

This truely is a great mod  8)  It would be even better if the above things are accounted for in the next rev.

Thanks again all and happy holidays, JK
Title: Re: Custom Form Mod
Post by: GohighVoltage on December 26, 2009, 02:04:49 PM
WOW jkfriends!!

That is a bit over the top, don't ya think?


The idea of custom forms was a basic way to post in an easy, form, and keep consistency.   Some of the minor requests that were made in the other posts here are within reason and probably would not involve a whole lot to do.

The request your making seems like your looking for a all out commercial database.     I wouldn't think the author of this mod would even consider making this kind of change to this mod.

Title: Re: Custom Form Mod
Post by: airric00 on December 26, 2009, 04:54:56 PM
I installed on 2.0RC2, go to form settings, setup the forum, create a form, set permissions to everyone,  link it to this page  http://www.jkcrawlers.com/index.php?topic=92.0  and then I get nothing..  what's up?   My idea is to have an automatic link submission for our members to create a link database for our club..  Any help greatly appreciated!



Title: Re: Custom Form Mod
Post by: Garou on December 27, 2009, 11:06:03 AM
GohighVoltage and Spoogs , moving the required and maybe even parse_BBC to their own separate function have been considered for a long time. The problem there is that to do so means a rather large portion of the mod will have to be re-written, both Nathanial (the original author) and I just haven't  had the time to put into it but it will be done eventually.

kripz, where do characters need to be escaped?

airric00 and divekennene, the form doesn't display in the board itself, you direct your users to the form, they fill it out, and the results are displayed in a normal forum post in the format you set up. It just creates a nice standardized forum post in the board you designate. In the hopefully near future I hope to have an option where if a user hits the new topic button in a board that they are directed to the form. In the meantime you have to place a link to the form someplace else and if you dont want the users to be able to post to a board with out the form then you need to set the permissions for the board in the standard SMF board settings as either read only or reply only. To direct your users to the form you'll either have make a forum post with the link, place a link someplace on your site, if you are using SMF 2.0 there is the redirection board feature where if a person clicks on that board they are redirected to the link you enter, there is a mod for SMF 1.1.x that also preforms this function.

jkfriends , if you look at the rest of that code section its reading the board ID from the table for message icons. That table is default in SMF and I haven't done anything to it. Also the code I use is a copy from the code SMF uses for icons in its post function. It should work as is and it does indeed work on my test server and some others so its not just something in the code its also something to do either with server setup or other mods. The fact that only some people are having problems with it makes it hard to track down, especially when even I haven't come across the problem yet myself.

Also I got to agree with GohighVoltage. When Nathanial originally created this mod it was just supposed to be a simple way to create a simple pre-formatted post using data the users supplied. He wanted/wants to do more with it, he just hasn't had the free time to really work on it. I myself was quite happy with the mod the last time he touched it, but at some point one of the SMF updates broke the mod and I needed it fixed sooner then he had time to fix it. I wound up fixing it for myself and offered to help him fix and then help make some of the improvements people were asking for. Its come a long way since I came on board but there is still room for improvement so I keep working on it when I can.

The problem with globalizing fields is that something of that is something that was never concidered when the mod was originally created and as far as I can tell it is not possible without rewriting the entire mod from scratch. Nathanial plans on re-writing the mod at some point when he finds the time and maybe then that sort of feature can be accounted for. It is something that I personally do not have time to take on myself at all at the moment, its taking most of my spare time just to put in some of the more minor requests some have asked for as is.

The feature you want is not impossible but its just to large of a task to take on at this point. This mod is the only thing that comes close to what you want an it looks like you have a usable if complicated workaround for it so I hope that can suffice you for a while because there are many more features that are more much useful to the community as a whole and much easier to implement with the little time I do have to work on this.

With that said and not to sound rude, I do highly encourage people to learn how to code for themselves and share with the community. There are a couple of features and bug fixes for this mod that others have submitted that I have implemented and credited them with. I'm happy to accept more as it does take some of the pressure off of Nathanial and I but more importantly it benefits the community as a whole. :)
Title: Re: Custom Form Mod
Post by: airric00 on December 27, 2009, 11:59:19 AM
Quoteairric00 and divekennene, the form doesn't display in the board itself, you direct your users to the form, they fill it out, and the results are displayed in a normal forum post in the format you set up. It just creates a nice standardized forum post in the board you designate. In the hopefully near future I hope to have an option where if a user hits the new topic button in a board that they are directed to the form. In the meantime you have to place a link to the form someplace else and if you dont want the users to be able to post to a board with out the form then you need to set the permissions for the board in the standard SMF board settings as either read only or reply only. To direct your users to the form you'll either have make a forum post with the link, place a link someplace on your site, if you are using SMF 2.0 there is the redirection board feature where if a person clicks on that board they are redirected to the link you enter, there is a mod for SMF 1.1.x that also preforms this function.

I prepared a the form, but how do I make the link?  Does it auto generate a link?
Title: Re: Custom Form Mod
Post by: jkfriends on December 27, 2009, 12:39:31 PM
Thanks Garou for a detailed reply.

Regarding my post, I did understand that it requires some of amount of work to get them done.  Since I understand the process flow of this mod now, I will take a stab at these requests (B & C)

* Removing http:// prefix before storing into the table for image URLs from the output text.
* Incrementing the post count for logged-in user after a successful submission.

Please let me know how do I share these enhancements to you so that you can publish to everyone to leverage them.

Thanks, JK
Title: Re: Custom Form Mod
Post by: Spoogs on December 27, 2009, 01:22:21 PM
Quote from: airric00 on December 27, 2009, 11:59:19 AM
Quoteairric00 and divekennene, the form doesn't display in the board itself, you direct your users to the form, they fill it out, and the results are displayed in a normal forum post in the format you set up. It just creates a nice standardized forum post in the board you designate. In the hopefully near future I hope to have an option where if a user hits the new topic button in a board that they are directed to the form. In the meantime you have to place a link to the form someplace else and if you dont want the users to be able to post to a board with out the form then you need to set the permissions for the board in the standard SMF board settings as either read only or reply only. To direct your users to the form you'll either have make a forum post with the link, place a link someplace on your site, if you are using SMF 2.0 there is the redirection board feature where if a person clicks on that board they are redirected to the link you enter, there is a mod for SMF 1.1.x that also preforms this function.

I prepared a the form, but how do I make the link?  Does it auto generate a link?
yoursite.com/index.php?action=form or yoursite.com/index.php?action=form;id=# (#= form number)
Title: Re: Custom Form Mod
Post by: airric00 on December 27, 2009, 02:29:36 PM
Quote from: Spoogs on December 27, 2009, 01:22:21 PM
Quote from: airric00 on December 27, 2009, 11:59:19 AM
Quoteairric00 and divekennene, the form doesn't display in the board itself, you direct your users to the form, they fill it out, and the results are displayed in a normal forum post in the format you set up. It just creates a nice standardized forum post in the board you designate. In the hopefully near future I hope to have an option where if a user hits the new topic button in a board that they are directed to the form. In the meantime you have to place a link to the form someplace else and if you dont want the users to be able to post to a board with out the form then you need to set the permissions for the board in the standard SMF board settings as either read only or reply only. To direct your users to the form you'll either have make a forum post with the link, place a link someplace on your site, if you are using SMF 2.0 there is the redirection board feature where if a person clicks on that board they are redirected to the link you enter, there is a mod for SMF 1.1.x that also preforms this function.

I prepared a the form, but how do I make the link?  Does it auto generate a link?
yoursite.com/index.php?action=form or yoursite.com/index.php?action=form;id=# (#= form number)


Worked!!  Thank you...   Will be nice when the form appears when the reply button is pushed! 
Title: Re: Custom Form Mod
Post by: Garou on December 27, 2009, 03:47:00 PM
JK you can feel free to post anything you create for the mod here in the support thread, that way if someone really wants to implement it on their site before I get time to update the mod, they can.

Its also best use the standard SMF format for code changes ie...

QuoteSMF Version
File name
Find...
Code to look for

Add before / after, Replace,  etc...
New code

Thanks in advance for anything submitted. :)
Title: Re: Custom Form Mod
Post by: Axodious on December 29, 2009, 12:46:30 PM
I have the following line for one of my forms, if you input a proper URL it works if you input an incorrect one (such as a one word answer) it posts the URL of my website with the incorrect URL at the end. An example would be if I put in test as the url it would show up as http://my.website.com/test.

Here's the form:
[b]Screenshot of your UI (Mandatory):[/b] [img width=640]{ui}[/img]
[url={ui}]{ui}[/url]


Basically what I want is to post an image of the link and a link to the link in case they do not post a correct URL.
Title: Re: Custom Form Mod
Post by: kripz on December 30, 2009, 08:55:32 AM
Quotekripz, where do characters need to be escaped?

I cannot confirm as i moved hosts and this one i am having problems with. I think its related to mod_Security because you are using "ID" in the links for the html GET. IIRC it was when you submit the actual form. It doesnt matter what you type in, if the subject is like "{name}'s Submission" it will break.
Title: Re: Custom Form Mod
Post by: bwallac7 on December 30, 2009, 09:42:50 AM
Hello, I am having troubles installing this mod on my site.

QuoteAt least one error was encountered during a test installation of this package. It is strongly recommended that you do not continue with installation unless you know what you are doing, and have made a backup very recently. This error may be caused by a conflict between the package you're trying to install and another package you have already installed, an error in the package, a package which requires another package that you don't have installed yet, or a package designed for another version of SMF.

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


SMF Version SMF 2.0 RC2
Current Packages running

Treasury      2.02      
2.    Custom Form Mod    1.6    
3.    PortaMx v0.971    0.971    
4.    PortaMx v0.971-1 upgrade    0.971-1

I would like to use this Package on my website. If anyone can help that would be great.

Thank you.
Title: Re: Custom Form Mod
Post by: Garou on December 30, 2009, 11:27:19 AM
bwallac7, Im going to guess this is similar to the problem this mod has with Simple Sortal. It installs part of its code in the same area as this mod and causes conflicts on install.

You can manually install this mod with errors and manually change your ./Sources/Admin.php

Find...

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


It may look slightly different due to PortaMx just manually enter...

loadLanguage('Modifications');


after...
loadTemplate('Admin', 'admin');

If that doesn't work check the manual install instructions for the mod
http://custom.simplemachines.org/mods/index.php?action=parse;mod=1279;attach=122918;smf_version=2.0_RC2 to make sure all the code is in the Admin.php

Axodious, Ill add this to the list but that is a pretty standard thing in php, an incomplete url like that points to the web servers root directory .

SMF is essentially translating the code to
[url]http://test[/url]
and then to
<a href="/test"></a>
Then the server is translating it to
<a href="root directory/test"></a>

When I can, Ill see if there is a work around but Id be telling my users to make sure they are entering the proper url or quit posting.   O:)

Title: Re: Custom Form Mod
Post by: bwallac7 on December 30, 2009, 12:19:09 PM
it works thank you!
Title: Re: Custom Form Mod
Post by: jokesa157 on December 31, 2009, 10:59:36 AM
OK I INSTALLED the the mod and when i make a form i and try to post it some where it doesnt show up in that area. is there any tut on how to use this mod. thanks
Title: Re: Custom Form Mod
Post by: Garou on December 31, 2009, 11:13:08 AM
Its a bit out of date as a few features have been added since but it should give you the general idea...
http://www.simplemachines.org/community/index.php?topic=248871.msg1633514#msg1633514

Also there is plenty of information in the help files for the mod look for the [?]s next to the various fields in the admin area.
Title: Re: Custom Form Mod
Post by: bwallac7 on January 01, 2010, 11:03:36 AM
Well I got it installed and it works just fine, but I cannot find the mod in the admin area. It is not in any of the menus. Any suggestions? Thanks.

SMF info below.


Quote from: bwallac7 on December 30, 2009, 09:42:50 AM
SMF Version SMF 2.0 RC2
Current Packages running

Treasury      2.02      
2.    Custom Form Mod    1.6    
3.    PortaMx v0.971    0.971    
4.    PortaMx v0.971-1 upgrade    0.971-1

I would like to use this Package on my website. If anyone can help that would be great.

Thank you.
Title: Re: Custom Form Mod
Post by: Garou on January 01, 2010, 12:16:15 PM
bwallac7  In SMF 2.0 it should be listed in the admin section under Configuration => Modification Settings => Custom Forms like most mods. If its not listed there then something didn't install right.

You should also be able to get to it using a direct link yourforum//index.php?action=admin;area=modsettings;sa=customform
Title: Re: Custom Form Mod
Post by: bwallac7 on January 01, 2010, 12:36:41 PM
Yea it's not there :( What do I need to edit, because other admins need to use this too.
Title: Re: Custom Form Mod
Post by: Bugo on January 01, 2010, 02:01:48 PM
Look at screenshots. Variant A - the normal distance between the forms. Variant B - the second form is too low. Can you fix this in future versions?
Title: Re: Custom Form Mod
Post by: Garou on January 01, 2010, 08:25:27 PM
bwallac7, check ./Sources/Admin.php

find...

// Mod Authors for a "ADD AFTER" on this line. Ensure you end your change with a comma. For example:


Add after...
// Place the Custom Form Mod Link.
'customform' => array($txt['CustomForm_tabheader']),


Bugo, Ive never had that problem with any install of the mod. I also dont know what you mean by variant unless you are trying to install wrong version of the mod on RC2. You should be using CustomFormMod_v1.6_SMF2_RC2.zip (http://custom.simplemachines.org/mods/index.php?action=download;mod=1279;id=122918) as stated in the compatibility section of the mod description on the mods download page.

The next update for SMF 2.x will not be backward compatible of versions of SMF 2.0 prior to RC2. Due to the extra time involved in codeing everything multiple times I even have reservations about doing the extra work to maintain backwards compatibility with 1.1.x. In fact once 2.0 goes final Ill most likely will not be adding new features in 1.1.x anymore.
Title: Re: Custom Form Mod
Post by: Axodious on January 01, 2010, 08:56:28 PM
Quote from: Garou on December 30, 2009, 11:27:19 AM
Axodious, Ill add this to the list but that is a pretty standard thing in php, an incomplete url like that points to the web servers root directory .

SMF is essentially translating the code to
[url]http://test[/url]
and then to
<a href="/test"></a>
Then the server is translating it to
<a href="root directory/test"></a>

When I can, Ill see if there is a work around but Id be telling my users to make sure they are entering the proper url or quit posting.   O:)

The reason I am putting the URL like that is specifically for people who don't understand how to post a URL. It's there to show the people looking at the form what they actually entered. I did a small workaround of my own and just wrapped the text in a code block.
Title: Re: Custom Form Mod
Post by: Bugo on January 01, 2010, 09:31:23 PM
Garou, obviously, you are not carefully studied the screenshots that I provided. I use a version of SMF 2.0 RC2 and installed it exactly CustomFormMod_v1.6_SMF2_RC2 version of your mod.

Try it yourself to install a mapping panel of administration as in the screenshot B :)
Title: Re: Custom Form Mod
Post by: Tunga on January 04, 2010, 05:13:04 AM
Just found this mod, been wanting something like it for over a year but didn't know anything existed!

A quick suggestion, on line 220 of the default CustomForm.template.php, regarding the following echo:
<div', !empty($field_data['failed']) ? 'style="color:#FF0000;"' : '' ,'> *</div>'
I've found it looks a lot neater if you replace the div with a span.  Otherwise you get an extra line with just the asterisk underneath every field.  Moving it to the side of the input looks a lot better in my view.  (Also there is an additional space before the asterisk in the code though this doesn't actually cause any visible difference in the output so meh.)

Perhaps there is some genuine reason for this (and I admit I didn't look through much of the thread to check if this has been mentioned before) and it was easy enough for me to change anyway but thought I'd mention it.

The only other issue I've found is regarding the required field for selection boxes.  I guess there are two parts to this really.  What I would like to achieve is for the box to be blank when it first loads and then the user is required to choose an option from the drop down.  Firstly there is no way to set the default text to anything other than the first drop down option.  Secondly, you can enter "required" as one of the options and it does mark the box as required (though this functionally does nothing since the first option is already selected) but then it also includes "required" as one of the options.  I'm not sure if the first part is workable at all, but regarding the second the handling of "required" seems to be a little unituitive at least, perhaps it should just be ignored for selection boxes?

Thanks for all your work on this mod, it's going to save us a lot of time.
Title: Re: Custom Form Mod
Post by: Garou on January 04, 2010, 10:47:08 AM
Bugo, I do see what you mean now. After a quick look at the code in the mod and even the raw source code of the displayed page I dont have an answer of how to fix or even why its doing it. Its added to the to do list though and Ill give it a more thorough look.

Tunga, changing the div to a span is a good idea, and it will make the mod look more like a traditional form. The mods been that way from the beginning and I'm not sure if there was an actual reason for coding it that way as the bulk of the code was written before I came on board. Ill test it with the next update and if it doesn't cause other issues Ill add it in.

Changing the way the required function works has been on the to do list for a while. Unfortunately its a rather large task as much of the mod will have to be rewritten to do so. Ive personally been putting it off as I haven't had the kind of time to put into it but it will be done eventually.

As far as changing which option is  preselected, its quite easy if one were writing an HTML form from scratch. Unfortunately with a program such as this that creates forms there isn't really a good way. If I recall correctly the main reason the pre-selection is there at all was because when select boxes were written into the mod the required function was already written, the easiest way to make something be entered in the form if the user didn't select something was the pre-selection. Once the required function is rewritten pre-selection will be removed from select boxed all together.

Alternatively radio boxes do not use pre-selection. When I came on board and another user supplied the code for the radio boxes the pre-selection was left out just because select boxed already had it and it offered an alternate option.

A couple of other workarounds Ive used on sites I work on, either make the first selection the answer most people will end up picking or setting required as the first selection. That way the user will see required and the asterisk and think they have to select something. A little subversive but it works most of the time. :)
Title: Re: Custom Form Mod
Post by: Tunga on January 04, 2010, 07:50:36 PM
Thanks for explaining, that makes sense.  With a bit of fiddling I'm sure I will be able to get things how I would like them.  If I can get the selection boxes working I'll post the changes for anyone else that might want them, though it will most likely be a bit of a bodge :) .
Title: Re: Custom Form Mod
Post by: ŦώεαЖзяŁ on January 05, 2010, 01:14:59 AM
Quote from: jkfriends on December 25, 2009, 09:06:26 PM

C) Since this custom form is tied to a specific board, when someone submits a recipe (in my case), the post count for that person who submitted is not incremented.  It is still staying at the old post count for that person.  Why is that?  Can you please do postCount ++ after a successful submit?

Like I said back on page 50 to force all forms to update the post count of users simply add

Quote'update_post_count' => !$user_info['is_guest'],

after

Quote$posterOptions = array(
                   'id' => $user_info['id'],

in Sources/CustomForm.php

Beware that this modification will make the post count update even in boards where post count is disabled, but as it seems to be your case, and it was mine, all my forms are expected to update post count, so no harm done.

And as for an update on that issue, the main reason why I couldn't get the script to check if the board has post count on or not is because I can't call $board_info['posts_count']... I'm still somewhat noob in PHP, i tried calling the global $board_info in the beginning of the script but that didn't work. I'm guessing more needs to be done in order to do that, but essentially, if you can make:

Quote'update_post_count' => !$user_info['is_guest'] && $board_info['posts_count'],

work, then it will only update the post count in boards where post count is enabled; this is based off of Post.php where you have

Quote'update_post_count' => !$user_info['is_guest'] && !isset($_REQUEST['msg']) && $board_info['posts_count'],

However "!isset($_REQUEST['msg'])" is unecessary as it only checks if the message already exists i believe (used for making sure that the createpost function is not called if the message is only being edited).

Also, on an extra note, for anyone else who like me, uses the Post Ratings mod and would like posts created by Custom Forms to be rated by default, add the following bold lines to CustomForm.php:

Quote$msgOptions = array(
               'id' =>  0,
               'subject' => $subject,
               'icon' => $icon,
               'body' => $output,
               'smileys_enabled' => true,
               'ratings_enabled' => true,
            );
            
            $topicOptions = array(
               'id' => 0,
               'board' => $board,
               'mark_as_read' => true,
               'ratings_mode' => 1,

Kudos for SoloGhost for telling me how to do this. Maybe there's a way (i'm sure there is a possible if statement) to check if post ratings exists and only set the variable if it does so that the change could be implemented dinamically without breaking the mod for people that don't have post ratings; so maybe that could be done in the future.

I'm guessing something like:
Quoteif (isset($_POST['ratings_topic']) && !empty($modSettings['post_ratings_enable']))
before each of the aforementioned variables. Not sure though, maybe I'll try it later; I'm kinda busy finishing my website (Still trying to get 50+ addons (no smiley/avatars) to work without breaking each other with my limited knowledge of php  ;D).

And also (sorry that I keep adding stuff, I really love this mod, think it should be implemented into vanilla smf, so please don't be mad if I try to help improve it), jkfriends, I'm not sure if you already fixed it, but my custom forms are not having http:// added automatically inside [ img ] tags; any chance you have another mod that could be doing that?
Title: Re: Custom Form Mod
Post by: Garou on January 05, 2010, 06:58:34 AM
TweakerL, I did make a note of your post count fix and I plan to implement it in the next version, hopefully with the ability to recognize the board permissions for post count.

As for implementing code to account for features of other mods, that's not something I want to get into doing. First and for most because it does cause unnecessarily bloat in the code and could slowdown peoples servers especially if they don't have the mod.  More importantly if I started adding features for all the different mods that could improve this mod Id never have time to do much else. :)

Having the code available in this thread is a boon though, that way if someone wants to add it for their own site they can.

As for the issue with the img and url tags that is specifically a 1.1.x problem, it has something to do with the way SMF works and has been a problem for the mod since the beginning. When the mod was written for 2.0 the same code was used to call those tags but doesn't have the problem, I'm still looking into it though. :)
Title: Re: Custom Form Mod
Post by: Tunga on January 05, 2010, 09:13:12 AM
Here's my fix for the selection box issue.

Find (around line 76):
foreach ($field_data['data'] as $option)
echo '
<option value="', $option, '"', ($option == $field_data['value'] ? ' selected="selected"' : ''), '>', $option, '</option>';


Replace with:
foreach ($field_data['data'] as $option)
if ($option != 'required')
echo '
<option value="', $option, '"', ($option == $field_data['value'] ? ' selected="selected"' : ''), '>', $option, '</option>';
else
echo '
<option value=""></option>';


What this does is to simply replace any instances of "required" (sans quotes) in the list of options with a blank option.  Therefore if you put required as the first entry you get a blank option at the top which is then selected by default.  If the user submits without selecting a non-blank option then the existing code rejects it anyway so no other changes are needed.  This is a quick fix and I expect not how you would want to implement it in the actual mod but maybe some other users will find it useful.  It is at least a quick and easy change and shouldn't break anything else.

Thanks again, great mod :) .
Title: Re: Custom Form Mod
Post by: ŦώεαЖзяŁ on January 05, 2010, 04:58:09 PM
I just mentioned the change to make it update the post count again because jkfriends asked how to do it after i had explained, so I guess he didn't see it before :)...
Title: Re: Custom Form Mod
Post by: FragaCampos on January 06, 2010, 01:23:36 PM
Quote from: TweakerL on January 05, 2010, 01:14:59 AM
Like I said back on page 50 to force all forms to update the post count of users simply add

Quote'update_post_count' => !$user_info['is_guest'],

after

Quote$posterOptions = array(
                   'id' => $user_info['id'],

in Sources/CustomForm.php

Hi TweakerL. I don't have that in my CustomForm.php, maybe because i'm still using v 1.1.5 of the mod. Can you point me how to do this?
What i have is this
$posterOptions = array(
'id' => $ID_MEMBER,
);


Quote from: TweakerL on January 05, 2010, 01:14:59 AM
...jkfriends, I'm not sure if you already fixed it, but my custom forms are not having http:// added automatically inside [ img ] tags; any chance you have another mod that could be doing that?

Hmm, you're using smf 2, right?
Title: Re: Custom Form Mod
Post by: ŦώεαЖзяŁ on January 06, 2010, 07:46:25 PM
Yes I'm using SMF2 RC2...

As for how to do the fix on 1.x, I'm not entirely certain how you would go about it. I'll tell you how I figured it out, and you can try the same process.

Go to your Sources/Post.php and try to find the createPost function. I'm not sure if it's called exactly that but I'm guessing it is.

It will be something like this:
QuotecreatePost($msgOptions, $topicOptions, $posterOptions);

You wanna see what the $posteroptions for your post.php is called, in 2.0 it's called $posteroptions. Now you want to search for that inside of Post.php until you find something like this

Quote$posterOptions = array(
      'id' => $user_info['id'],
      'name' => $_POST['guestname'],
      'email' => $_POST['email'],
      'update_post_count' => !$user_info['is_guest'] && !isset($_REQUEST['msg']) && $board_info['posts_count'],

You wanna figure out what 'update_post_count' is called for your version, so look for the line most similar to the one above. It will most likely have 3 conditionals like the one above, one to make sure the user is not guest (!$user_info['is_guest']) one to make sure that the message is new !isset($_REQUEST['msg']) and one to check that the board has post count ($board_info['posts_count']). You wanna take note of of conditional for the user not being a guest.

Now that you know that your $posteroptions is called, what your update_post_count is called and what your notguest conditional is called, you wanna go into CustomForm.php and search for the name you have for $posteroptions. It will look something like this:

Quote$posterOptions = array(
               'id' => $user_info['id'],

You wanna add one line under it that says:
Quote'update_post_count' => !$user_info['is_guest']

Of course you want to replace each of the 3 colored things with whatever your version is using. The red one should be the same thing you see in the line above, that's basically the set variable operator.

Conversely, if you think this is too difficult feel free to post both your post.php and your customform.php here, if Garou doesn't mind, and i'll look at it and see if I can tell exactly what to change
Title: Re: Custom Form Mod
Post by: FragaCampos on January 07, 2010, 08:00:19 PM
First, i want to thank you for your 5* detailed explanation. Although i'm a complete newbie i understood everything and it worked. The form posts are now counting.
So the solution for the 1.1.x versions is:

find in /Sources/CustomForm-php
$posterOptions = array(
               'id' => $user_info['id'],


and replace with
$posterOptions = array(
               'id' => $user_info['id'],
'update_post_count' => !$user_info['is_guest']


Thank you very much ŦώεαЖзяŁ  ;)
Title: Re: Custom Form Mod
Post by: ŦώεαЖзяŁ on January 07, 2010, 08:23:27 PM
Quote from: FragaCampos on January 07, 2010, 08:00:19 PM
find in /Sources/CustomForm-php
$posterOptions = array(
               'id' => $user_info['id'],


and replace with
$posterOptions = array(
               'id' => $user_info['id'],
'update_post_count' => !$user_info['is_guest']


Thank you very much ŦώεαЖзяŁ  ;)

Glad to help, just remember that as I said, this fix won't check if the board has post_count enabled, it will just count even if it's not enabled for the specific board. The reason for this is that I haven't figured out how to make the $board_info['posts_count'] variable check work, just calling it makes the count not work at all. If I figure it out, I'll post it here :)
Title: Re: Custom Form Mod
Post by: FragaCampos on January 08, 2010, 06:15:36 PM
That would be surely important to others, but in my case there's no problem, since i have post count enabled everywhere ;)
Title: Re: Custom Form Mod
Post by: Jaymjaym on January 09, 2010, 05:10:40 PM
Hello folks, I've recently installed this mod and have run into an error. I'll post the error at the end of the message. This is occurring when I try to view a form I have created. This post is somewhat empty as I have no idea what info you need for the troubleshoot, but I'll provide whatever you need. :)

QuoteNot Acceptable

An appropriate representation of the requested resource /forums/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: ŦώεαЖзяŁ on January 09, 2010, 07:23:42 PM
when you installed it through the packages manager, did it say there were any errors?

what version of SMF do you have?
Title: Re: Custom Form Mod
Post by: Garou on January 09, 2010, 10:59:47 PM
Jaymjaym, generally SMF version, Mod version, a list of other mods on the forum, and a link to the site would be helpful when asking for support with any mod.

That said it looks like it could be that your host is running ModSecurity which has been known to produce similar errors. You might want to check the logs for your site and see if it says anything about GET errors with either CustomForm.php or CustomForm.template.php. If it does you'll have to ask your host to white list those files in ModSecurity. Instructions on how to do that can be found at http://blog.modsecurity.org/2007/02/handling-false.html
Title: Re: Custom Form Mod
Post by: Jaymjaym on January 10, 2010, 12:05:19 PM
Quote from: ŦώεαЖзяŁ on January 09, 2010, 07:23:42 PM
when you installed it through the packages manager, did it say there were any errors?

what version of SMF do you have?

Quote from: Garou on January 09, 2010, 10:59:47 PM
Jaymjaym, generally SMF version, Mod version, a list of other mods on the forum, and a link to the site would be helpful when asking for support with any mod.

That said it looks like it could be that your host is running ModSecurity which has been known to produce similar errors. You might want to check the logs for your site and see if it says anything about GET errors with either CustomForm.php or CustomForm.template.php. If it does you'll have to ask your host to white list those files in ModSecurity. Instructions on how to do that can be found at http://blog.modsecurity.org/2007/02/handling-false.html

hey folks, thanks for the quick response.

@ŦώεαЖзяŁ, It install without any errors through package manager. Also, the SMF version is 1.1.11


@Garou, Mod version is 1.6, Other form mods are:

SMF Arcade      2.0.18
Tar Game Uploader      1.0
(Note that both of these were install after I posted here originally, so probably shouldn't be contributing to the error)

Forums are here: http://cn-gondor.net/forums/index.php

I don't seem to see anything in the error logs regarding what you mentioned.
Title: Re: Custom Form Mod
Post by: bros on January 10, 2010, 06:22:00 PM
Have a bit of an issue with the newest version on SMF 2 RC 1.2

I can't see any of the forms I made on the old version of Custom Form Mod in the admin panel (I can see them in action=form, though)

Here are the errors in the error log:
2: Invalid argument supplied for foreach()
File: /home/xxxx/public_html/boards/Sources/Subs-List.php
Line: 120

2: call_user_func_array() [<a href='function.call-user-func-array'>function.call-user-func-array</a>]: First argument is expected to be a valid callback, 'list_CustomForms' was given
File: /home/xxxx/public_html/boards/Sources/Subs-List.php
Line: 116

8: Undefined variable: scripturl
File: /home/xxxxx/public_html/boards/Themes/default/languages/Modifications.english.php
Line: 395 (also lines 297, 296, 156, 155)
Title: Re: Custom Form Mod
Post by: Garou on January 10, 2010, 09:05:27 PM
Jaymjaym, did you check your site logs or your forum logs? what kind of errors are you getting if any?

Bros, this mod doesn't edit the Subs-List.php so I'm not sure whats going on there. Have you compared your language files to the install? Also did you accidentally install the version for RC2 instead of 2.x? The two files have some differences as RC2 has some specific code changes.  Also youll probably want to update your site to RC2 for security reasons also future versions of this mod will no longer support versions of SMF 2.0 prior to RC2.
Title: Re: Custom Form Mod
Post by: bros on January 11, 2010, 01:48:46 AM
Quote from: Garou on January 10, 2010, 09:05:27 PM
Jaymjaym, did you check your site logs or your forum logs? what kind of errors are you getting if any?

Bros, this mod doesn't edit the Subs-List.php so I'm not sure whats going on there. Have you compared your language files to the install? Also did you accidentally install the version for RC2 instead of 2.x? The two files have some differences as RC2 has some specific code changes.  Also youll probably want to update your site to RC2 for security reasons also future versions of this mod will no longer support versions of SMF 2.0 prior to RC2.

Then it must be another one of the mods that is messing with subs-list, how unusual.

I'll update to RC2 after a few essential mods get updated.
Title: Re: Custom Form Mod
Post by: Wh1teLeopard on January 12, 2010, 09:12:13 AM
Hiya!

I'm really sorry if this has already been covered I read a lot of the pages at the start and end, and did a search of the topic but couldn't find my answer.

I wouldn't be surprised if it's something simple and daft that I've not done, but I created a form, assigned it etc and it posts a new topic, but that topic is blank.

I tried typing in the names of the fields but I guess I'm doing it wrong.

Did a manual install for SMF 2.0 RC2, only other install is Custom Page and Tab from the mods section.
Title: Re: Custom Form Mod
Post by: Garou on January 12, 2010, 09:17:44 AM
Where it says subject.

From the help file for that field...
QuoteThis is the subject/title of the post created by the form, like the Form Output area, it can contain values from the form itself.

Example:
Form name: {field_name}
Title: Re: Custom Form Mod
Post by: Wh1teLeopard on January 12, 2010, 09:40:06 AM
Ah ha! Case sensitive d'uh! Thanks for the help :)

Sorry guys... back to the naughty corner for me!
Title: Re: Custom Form Mod
Post by: bros on January 12, 2010, 06:37:59 PM
Quote from: Garou on January 10, 2010, 09:05:27 PM
Jaymjaym, did you check your site logs or your forum logs? what kind of errors are you getting if any?

Bros, this mod doesn't edit the Subs-List.php so I'm not sure whats going on there. Have you compared your language files to the install? Also did you accidentally install the version for RC2 instead of 2.x? The two files have some differences as RC2 has some specific code changes.  Also youll probably want to update your site to RC2 for security reasons also future versions of this mod will no longer support versions of SMF 2.0 prior to RC2.

Can you think of why the lists aren't displaying in the admin panel?
Title: Re: Custom Form Mod
Post by: Garou on January 12, 2010, 07:19:18 PM
QuoteHave you compared your language files to the install?

Using SMF's parser for the 2.x version of the mod http://custom.simplemachines.org/mods/index.php?action=parse;mod=1279;attach=122917;smf_version=2.0_RC1.2

Modifications.english.php and Help.english.php should be edited in the language folder of the default theme and if they exist then in any other custom theme you may be using. If those files aren't in the language folders for your theme then SMF is supposed to be pulling them from the default theme but sometimes this doesn't happen and you may want to copy the files from your default theme to any custom themes.

Title: Re: Custom Form Mod
Post by: Jaymjaym on January 13, 2010, 11:51:00 AM
Quote from: Garou on January 10, 2010, 09:05:27 PM
Jaymjaym, did you check your site logs or your forum logs? what kind of errors are you getting if any?

I don't see anything in the forum logs, and this is what I'm seeing in the site logs:

[Wed Jan 13 08:47:53 2010] [error] [client xxx.xxx.xxx.xxx] File does not exist: /home/xxx/public_html/406.shtml, referer: http://cn-gondor.net/forums/index.php?action=form
Title: Re: Custom Form Mod
Post by: bros on January 13, 2010, 01:12:22 PM
Quote from: Garou on January 12, 2010, 07:19:18 PM
QuoteHave you compared your language files to the install?

Using SMF's parser for the 2.x version of the mod http://custom.simplemachines.org/mods/index.php?action=parse;mod=1279;attach=122917;smf_version=2.0_RC1.2

Modifications.english.php and Help.english.php should be edited in the language folder of the default theme and if they exist then in any other custom theme you may be using. If those files aren't in the language folders for your theme then SMF is supposed to be pulling them from the default theme but sometimes this doesn't happen and you may want to copy the files from your default theme to any custom themes.



Yep I have the custom form stuff in default/languages/modifications-english.php

Custom themes don't have language folder and depend on default
Title: Re: Custom Form Mod
Post by: Garou on January 13, 2010, 01:35:03 PM
Well try copying the languge files to the theme folder. I know its suposed to work anyway but sometimes it doesnt always work.

Other then that something must have not installed corectly. Compare the other files listed in the parser.
Title: Re: Custom Form Mod
Post by: bros on January 13, 2010, 07:08:06 PM
I'll just look through each file to see what might've been left over from a previous install.
Title: Re: Custom Form Mod
Post by: xterreur on January 16, 2010, 04:54:34 PM
Hello

A user kept getting 'Hacking attempt' when filling out the form, this goes for the application form for my World of Warcraft guildwebsite

I run SMF 1.1.11 with TinyPortal beta4 and Custom Form Mod 1.6

This is the error message found in the logs:

Hacking attempt...

INSERT INTO system_messages
(ID_BOARD, ID_TOPIC, ID_MEMBER, subject, body, posterName, posterEmail, posterTime,
posterIP, smileysEnabled, modifiedName, icon)
VALUES (4, 0, 35, SUBSTRING('Application: Goldiedixie, 80 Warlock', 1, 255), SUBSTRING('[b]Character name:[/b] Goldiedixie
[b]Class:[/b] Warlock
[b]Applying for role:[/b] DPS
[b]Armory Link: [/b]
eu.wowarmory.com/character-sheet.xml?r=Blade%27s+Edge&n=Goldiedixie

[hr]

[b]Where are you from?[/b]
Poland

[b]How old are you?[/b]
17

[b]What is your current occupation?[/b]
School

[b]How good would you rate your computer? Do you ever suffer random disconnecting or crashes?[/b]
my computer is pretty good, but I sometimes suffer disconnects etc, but that\'s rare

[b]What addons do you use? And why?[/b]
Quartz - casting bar,
Deadly Boss Mode - for boss encounters, Gladius - arena,
Recount - DPS and some arena addons liek spellalert etc.

[b]Do you have ventrilo, a working microphone, and are you not afraid to use them?[/b]
yes

[b]In what guild are you in now or have you been before? Why did you leave?[/b]

im in Guardian now, but im there as an alt of my brother who is a raider there and they dont seem like they want me on raids or they dont like the fact that we\'re brothers - the prob is that my brother told them to inv me to their guild as his alt so that i coudl alwas find team for randoms etc. and now they dont want to take \"both of us\" to the raids - told the whole truth, want everything to be clear

[b]Do you see yourself as a experienced player?[/b]
hmm, as a warlock, yes

[b]Please list all the raids you have experience with.[/b]
Ulduar, ToC, ICC mainly, abit Naxx.

[b]If an officer wants to have a talk with you, and tells you that you were underperforming, how would you react?[/b]
I\'d tell him that I\'ll try to improve as much as I can

[b]We normally raid 4 or 5 times per week from 19:30 till midnight realmtime, will you be able to at least make 3 of them?[/b]
yes

[b]Please explain the Lady Deathwhisper encounter in YOUR OWN WORDS[/b]
The tactics I know is taht we stand behind her, tanks are tanking adds and dps are killing adds (melee-anhedrents/something like that and casters fanatics) untill her mana shield fades. we should avoid death and decay(or what\\'s that?)  and CC the controlled by her players. IN phase2 we should be aware of the ghosts

[b]What loot system do you prefer?[/b]

Loot Council, dont really like DKP


[b]Do you know any of our members?[/b]
Not personally but I saw Terreur doing some dungeons with my brother and I was really impressed

[b]What do you expect from ACP and what can we expect from you?[/b]
I expect good fun with friendly players, maybe some raiding. You can expect best dps that I could pull with my gear and firendly player from my side


[b]What do you feel your class and spec bring to the raid? Do you feel like you need to explain some talent choices in the spec you have chosen?[/b]
My class brings nothing but D P S! Thats clear I think :) (Oh, maybe the demo buff, but? ow, and some soulstone and healthstone!)

[b]Are you willing to change your talent spec to help the guild, and if so, do you have gear for any off-specs already?[/b]
If guild needs me in other spec Im ready to change but im most skilled in destro/affi so the learing of demo could take me 1-2 days

[b]Please explain the reasons behind your choice of professions.[/b]
Tailoring - for Lightweave on back and enchanting for ring enchants + making some cash some time ago

[b]Is there anything you would like to add?[/b]
Not really, just that I think that I\'m kinda \"in\" my class and I thnik that I pull close to MAX DPS that could be pulled with that gear  (copied from my old-site application) 
', 1, 65534), SUBSTRING('Goldiedixie', 1, 255), SUBSTRING('[email protected]', 1, 255), 1263676747,
SUBSTRING('83.26.223.139', 1, 255), 1, '', SUBSTRING('xx', 1, 16))
File: /home/c9556hcp/domains/acp-guild.com/public_html/site/Sources/Subs-Post.php
Line: 1539


I have no idea what went wrong..  :-\

Any ideas?

edit
To clarify some stuff, when he entered 'test' in every field all went fine..
Title: Re: Custom Form Mod
Post by: Garou on January 16, 2010, 06:34:55 PM
In several places he tries to enter stuff like
we\'re
I\'ll
I\'m
\"in\"


Traditionally something like that is only used in some programing languages to escape characters so a program can tell the difference between text and actual code. There is absolutely no need to escape characters like that when posting to a forum like this.

Essentially the forum is thinking someone is trying to use a 3rd party script to insert malicious code into the site. In looking at what hes written I dont think this is the case however I do see...

', 1, 65534), SUBSTRING('Goldiedixie', 1, 255), SUBSTRING('[email protected]', 1, 255), 1263676747,
SUBSTRING('83.26.223.139', 1, 255), 1, '', SUBSTRING('xx', 1, 16))


That bit actually is code and I dont know if it was intentional, something from the error code, or what but that could be a problem for you to consider.  :-\



Title: Re: Custom Form Mod
Post by: xterreur on January 16, 2010, 10:40:52 PM
This is indeed true, though he said when he tried to post it that he got a DB error, so he hit back in IE and tried again which led to this error, and he kept refreshing

Is is possible to first strip all slashes and then add where needed again? To avoid it happening again..
Title: Re: Custom Form Mod
Post by: Garou on January 16, 2010, 11:02:25 PM
Try it with out the slashes and if there is a DB error again let me know what it is. Also what database software you are using and version.

The issue with escaped characters came up once before but I couldn't find a quick answer as to why and the more I thought about it I decided that most human users wouldn't use escaped characters, however a spam bot or hacker very well could. It made for an interesting unintentional security feature so I chose not to pursue the matter further.

I am concerned about the database error that led to all of this to begin with though. Any information about that could be helpful in tracking down a possible bug. If it cant be reproduce it could just be a fluke caused by a hiccup in your server at the time.
Title: Re: Custom Form Mod
Post by: Jaymjaym on January 17, 2010, 07:51:01 PM
Quote from: Jaymjaym on January 13, 2010, 11:51:00 AM
Quote from: Garou on January 10, 2010, 09:05:27 PM
Jaymjaym, did you check your site logs or your forum logs? what kind of errors are you getting if any?

I don't see anything in the forum logs, and this is what I'm seeing in the site logs:

[Wed Jan 13 08:47:53 2010] [error] [client xxx.xxx.xxx.xxx] File does not exist: /home/xxx/public_html/406.shtml, referer: http://cn-gondor.net/forums/index.php?action=form

Any idea what's happening here, or have I missed something that's sitting right in front of me?  :-[
Title: Re: Custom Form Mod
Post by: Garou on January 17, 2010, 10:46:56 PM
If everything installed right then possibly its being cause by the problem with the msg icons in 1.1.x or possibly the form wasn't set up correctly? When a forms title fields are not set up correctly, for instance you cant use capital letters, spaces, or special characters... it has been know to cause a variety of odd issues with the mod.

Outside of that I keep coming back to it being an issue with the host running ModSecurity on the server. There isn't anything I can do from here about that, you really have to talk to your host like I mentioned back in the other post.
Title: Re: Custom Form Mod
Post by: farao25 on January 21, 2010, 11:22:30 AM
Hello friends!!!
I want to ask you about  Custom Form Mod
a)Is there any way to make a form like this and use it when a member opens a new topic ?

b) if the answer is yes is there any way to force the members to complete all the form fields to apply for the topic ?
c) is there any way to send "Topic Title" or Artist + Album to another form in another topic and in that way to create an alphabetic list ?

Last but not least, due to the fact that I don't have any knowledge of HTML, XML, and PHP can somebody tell me how to do it ?
Title: Re: Custom Form Mod
Post by: jokesa157 on January 21, 2010, 09:31:07 PM
This mod is great for my clan apps. Im just having a little problem. I made all the required forms i just dont know how to make a submit button. Please check it out at my site and tell me what i did wrong. oh by the way i link it to a pic on the side of my forum so when they ckick the pic join us it will take them to the form. Also when they finish the app where does it go and how could i see who filled out the form. www.a157team.com/forum/ and the pic is in the join us. and this is the link to the form  http://a157team.com/forum/index.php?PHPSESSID=0ka1ah4knjd2inq7ub2c0l2q84&action=form;id=3
Title: Re: Custom Form Mod
Post by: Garou on January 22, 2010, 06:21:45 AM
farao25 While there isnt anything in the mod itself to have the new topic button direct you to a form this is a a hack a user came up with to made it do just that.
http://www.simplemachines.org/community/index.php?topic=248871.msg2241024#msg2241024

You can currently force a user to complete all field types except selection boxed an radio boxes. by entering  "required" in the Extra Type Parameters field.

There is another user submitted hack that allows you to force your forms to post to multiple boardshttp://www.simplemachines.org/community/index.php?topic=248871.msg2235951#msg2235951

jokesa157 I went to your site and there is a save button at the bottom of the form, however there must be some sort of issue with visual verification on your site. Perhaps you have some mod that is altering captcha or something?
Title: Re: Custom Form Mod
Post by: jokesa157 on January 22, 2010, 09:29:39 AM
yeah that what i was thinking. Im going to ask the creator of the theme about the verification . That save button dont work it always tells me to fill the red * required  and i fill it out.
Title: Re: Custom Form Mod
Post by: jokesa157 on January 22, 2010, 10:02:51 AM
i changed the theme on my site to default and i see the verification letters and i register as a new member and it works and i go to the form and fill out but the form says the same thing. one more thing how do i link the form to go to a topic on the forum. I have a board that is named join us and thats where i point it to go but its not there. www.a157team.com
Title: Re: Custom Form Mod
Post by: farao25 on January 22, 2010, 01:43:19 PM
thanks  Garou !!
now can somebody help me step by step to make the form just like the picture i posted above ?
Also
c) is there any way to send "Topic Title" or Artist + Album to another form in another topic and in that way to create an alphabetic list ?
Thanks in advance.
Title: Re: Custom Form Mod
Post by: Garou on January 22, 2010, 04:07:20 PM
jokesa157, I just pulled up the source code on your form and you are not following the recommendation for the "Title" field listed as described several places here in this thread and in the help file in the mod.
QuoteThis is the title that will be used to access the user input from this field, when the forum post is displayed.

Note that the "title" field is only seen by admins and not general users, it is only used to designate where the users input from the form is displayed when it is posted in the forum. For best results keep the titles short, all lower case, and do not use special characters like # & * @ [ etc.

Example: name, username, and user_name will work fine. If the title is "User Name" the information the user types in the form will not be displayed in the forum post.

Something like "X-Fire name" is going to cause the mod not to work right. The way yours is failing is just one way, then there is what I listed in the help file, and there are a variety of issues other people have had.

You could use something like xfire or x_fire_name or xfirename. That is just one of them I pulled up but every single title field on your form is messed up like that.

farao25 this is a tutorial another user wrote long ago. http://www.simplemachines.org/community/index.php?topic=248871.msg1633514#msg1633514 I need to get and update it as there have been new features added to the mod but this along with the help files in the mod should give you the gist of it.

Also I have a demo form up on my site http://smf.balancegames.net/index.php?action=form;id=1

Step by Step instructions of what was entered to create the demo form is at http://smf.balancegames.net/index.php?topic=7.0 Looks like I need to update that with some newer features as well.
Title: Re: Custom Form Mod
Post by: jokesa157 on January 24, 2010, 01:17:22 PM
thanks for all the help. Ill work on it.
Title: Re: Custom Form Mod
Post by: Garou on January 26, 2010, 04:09:27 PM
For those having issues using this mod on a site with ModSecurity... I almost for got about a fix presented by Elindris. http://www.simplemachines.org/community/index.php?topic=248871.msg2299541#msg2299541

./Sources/CustomForm.php and ./Themes/default/CustomForm.template.php
Search for...
action=form;id=
and replace it with...
action=form&id=
Note: there are multiple instances that need to be changed in the CustomForm.template.php

Ill have to test this on sites that do not run ModSecurity and if it works on both then it will become a permanent change to the mod in the future.

Title: Re: Custom Form Mod
Post by: Nvb on January 27, 2010, 03:10:56 PM
I noticed something strange today:

When there is a lot of text added to a 'Large Text Box' i receive the following error when i modify the topic:
"The message body was left empty."

It is solved when i reduce the text added from the large text box.
So i guess this comes from a limit in the maximum characters allowed in the Large text box.
So, maybe a stupid question, but where and how can i change the "maximum allowed characters" in a large text box?

TY
Title: Re: Custom Form Mod
Post by: GhostRider2110 on January 27, 2010, 03:50:01 PM
Hi all, I upgrade to the latest version for SMF 1.1.11 .. and hit go before reading the warning.. No real big problems, just had to recreate a couple forms.  One thing I can't find, which I thought I had before I updated, was a way to put into the post the username of who posted... But I can't find where I found how to do that... Any help would be greatly appreciated...

--Mitch
Title: Re: Custom Form Mod
Post by: Garou on January 27, 2010, 11:28:12 PM
NeQo, there is no limit set in the mod itself and the way its written should override any max post length  any other mod might theoretically set up.

However after doing a little bit of research the problem may be in the database.  In the messages database SMF uses the type TEXT which has maximum length of 65,535 characters. That would include everything else a user might put in the form based on what setup you have plus everything you put in the Form Output area.

You can try changing it to MEDIUMTEXT (16,777,215 characters) or LONGTEXT (4,294,967,295 characters). Those limits are set by default in MYSQL. Im not 100% this will fix it but its the only thing I can think of at this point.

Mitch, if you had that I dont know where you may have picked it up from. I dont remember another user providing code for that anywhere in the thread either.  Its never been included it in the mod and even though its been asked for a couple of times its low on my priority list. If a user is logged in when they fill out a form the resulting post will be posted by them anyway.
Title: Re: Custom Form Mod
Post by: Eammeny on February 01, 2010, 02:17:11 AM
I keep getting an error and i'm not sure how to fix this.
8: Undefined variable: boardFile: /home/ourplace/public_html/forums/Sources/ManageSettings.php
Line: 2313
I'm not sure what this means and i've played around with it trying not to edit the file since i'm not wanting to cause more errors due to lack of knowledge.
Any clues?
Title: Re: Custom Form Mod
Post by: Garou on February 01, 2010, 09:31:24 AM
Can you give a little more detail like SMF version, mod version (note the 2.x version wont work on RC2 and viceversa), link to the site and form, other mods you have? Also either paste a chunk of code from ManageSettings.php that includes line #2313 or even attach the whole file.
Title: Re: Custom Form Mod
Post by: MeisterBruno on February 02, 2010, 11:13:28 AM
Hello everyone. I am certainly a newbie here and seeing thousands of posts it seems to be a bit hard to find what I am looking for. I am totally new to PHP coding and perhaps have a very simple and maybe stupid question to ask.

I am running SMF 1.1.11, and want to install CFM (Custom Form Mod). I used the package installer and brought the mod to the right theme, etc. When I tried to create a form I get the error: "You 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: /home/content/mywebsite/forum/Sources/ModSettings.php Line: 562.

Like I said I am not a code guy by any means, and at least for now. All I want is to install the thingy and create the forms I need. Any help is greatly appreciated.

Thanks ~ Meister
Title: Re: Custom Form Mod
Post by: Eammeny on February 02, 2010, 11:31:40 AM
currently using custom form mod 1.6 and SMF 2.0 RC2
the line of code reads as follows:
'selected' => !empty($_SESSION['move_to_topic']) && $_SESSION['move_to_topic'] == $row['id_board'] && $row['id_board'] != $board,


(and due to adding another mod, the line is now 2382)

Also, I decided to try and push the CFM further and attempt to make a full form. This error came up.

Quote8: Undefined index: field_type
File: /home/ourplace/public_html/forums/Sources/ManageServer.php
Line: 1801

both files are attached.
Title: Re: Custom Form Mod
Post by: Garou on February 03, 2010, 09:59:53 AM
MeisterBruno, Some sites are having issues with icons and version 1.6 of the mod for 1.1.x.

in ./Sources/ModSettings.php find
      if (($temp = cache_get_data('posting_icons-' . $board, 480)) == null)
      {
         $request = db_query("
            SELECT title, filename
            FROM {$db_prefix}message_icons
            WHERE ID_BOARD IN (0, $board)", __FILE__, __LINE__);
         $icon_data = array();
         while ($row = mysql_fetch_assoc($request))
            $icon_data[] = $row;
         mysql_free_result($request);

         cache_put_data('posting_icons-' . $board, $icon_data, 480);
      }


Some people have had luck with changing
WHERE ID_BOARD IN (0, $board)", __FILE__, __LINE__);
to
WHERE ID_BOARD IN (0)", __FILE__, __LINE__);

Eammeny the line you posted is not part of this mod but Ill look at the file when I get home from work tonight. It looks like somewhere another line isnt closed properly.

ManageServer.php issues are part of an SMF bug not the this mod it should be fixed by the time 2.0 goes final.
Title: Re: Custom Form Mod
Post by: Horthon Gorthy on February 08, 2010, 02:48:27 PM
Hi there,

I've gotten all the pages except one to work great. I made my form in the admin area index.php?mode=form shows me my list but when i click view and head to the index.php?mode=form&id=1 (in my case id=2) i get a 406 unnaceptable, Ive never got this error before so im not fammiliar with it, (i have tons of other mods)

running 1.1.11 thanks!
Title: Re: Custom Form Mod
Post by: Garou on February 08, 2010, 03:05:07 PM
I noticed you are using the ModSecurity fix, usually this fixes that issue. Since you mention id=2 have you been able to make other forms work? If so it could be something you have put into that particular form that is causing the error.
Title: Re: Custom Form Mod
Post by: Horthon Gorthy on February 08, 2010, 03:26:13 PM
I've never touched modsecurity, nor do I know of such a fix. However, I did just try and whip up another quick little form with basic/nothing in it and I get the same error. (id=1 i delete cause i was still playing with the new mod at the time)
Title: Re: Custom Form Mod
Post by: Garou on February 08, 2010, 03:45:53 PM
Quote from: Garou on January 26, 2010, 04:09:27 PM
For those having issues using this mod on a site with ModSecurity... I almost for got about a fix presented by Elindris. http://www.simplemachines.org/community/index.php?topic=248871.msg2299541#msg2299541

./Sources/CustomForm.php and ./Themes/default/CustomForm.template.php
Search for...
action=form;id=
and replace it with...
action=form&id=
Note: there are multiple instances that need to be changed in the CustomForm.template.php

Ill have to test this on sites that do not run ModSecurity and if it works on both then it will become a permanent change to the mod in the future.


Title: Re: Custom Form Mod
Post by: Horthon Gorthy on February 08, 2010, 04:13:13 PM
thank you very much. That fixed it, sorry to waste your time.
Title: Re: Custom Form Mod
Post by: Nvb on February 08, 2010, 05:10:12 PM
Quote from: ŦώεαЖзяŁ on December 21, 2009, 12:09:23 PM
A not perfect way to make posts made through custom forms count towards the user post count is to do the following

open CustomForm.php in \sources

find:
Quote$posterOptions = array(
               'id' => $user_info['id'],

add in the next line:
Quote'update_post_count' => !$user_info['is_guest'],

The reason why it's not perfect is that it will not check whether the target board has post count enabled and therefore will add increase the count even if the target board is not supposed to count posts... In my case, that solved my problem because all my forms are supposed to count, so if that's you case, cool...

Is there a reason why this does not work with version 1.6 on Board version 2.0 RC2 ?
Does the modification need an update? or did i do something wrong?
I changed into this:
$posterOptions = array(

'id' => $user_info['id'],
'update_post_count' => !$user_info['is_guest'],


Thank you for looking into this
N.
Title: Re: Custom Form Mod
Post by: Garou on February 08, 2010, 09:04:03 PM
Horthon Gorthy, dont worry, I use to be one to say use the search function but if you try to search a single thread it only lists one post and it not always one with the actual answer. In light of that Ive taken to archiving some of the most common questions that way I can just cut and paste. :)

NeQo, that's actually code for 1.1.x I dont know if anyone ever posted the fix for 2.x was ever posted but its probably a slightly different syntax but I'm not sure what off hand.
Title: Re: Custom Form Mod
Post by: Horthon Gorthy on February 09, 2010, 11:28:56 AM
thanks Garou

In that case im back!

I know you can change the template function but I was wondering if you could choose for the form page to run on a seperate theme entirely, just like when you force a forum to use a different theme than the rest of the forum? Thanks in Advance.
Title: Re: Custom Form Mod
Post by: Garou on February 09, 2010, 12:39:15 PM
Nope it uses whatever forum template the user is using. It wasn't coded with its own template system it just simply attaches to the existing system. The template system in the mod really only effects what is displayed around and within the form and then that is set within the forum template.

Maybe you could set up a link to the form like index.php?action=form;id=1;theme=1 but when the user gets sent back to the forum they will be viewing it within that theme as well. Maybe you could edit the CustomForm.php to reflect the default theme during the redirect.
Look for...
// Redirect this user as well.
if ($exit == 'board' || $exit == '')
  redirectexit('board=' . $board . '.0');
elseif ($exit == 'forum')
  redirectExit();
elseif ($exit == 'form')
  redirectExit("action=form;");
else
  redirectexit("$exit");


and edit as needed.
Title: Re: Custom Form Mod
Post by: Horthon Gorthy on February 09, 2010, 03:47:41 PM
yup that worked. if anyone is curious.


// Redirect this user as well.

if ($exit == 'board' || $exit == '')

  redirectexit('board=' . $board . '.0&theme=2');

elseif ($exit == 'forum')

  redirectExit("action=index&theme=2");

elseif ($exit == 'form')

  redirectExit("action=form&theme=3&id=2");

else

  redirectexit("$exit");

}


I know it's a huge hack, but it works for me.
Title: Re: Custom Form Mod
Post by: Nvb on February 09, 2010, 04:09:53 PM
Quote from: NeQo on February 08, 2010, 05:10:12 PM
Is there a reason why this does not work with version 1.6 on Board version 2.0 RC2 ?
Does the modification need an update? or did i do something wrong?
I changed into this:
$posterOptions = array(

'id' => $user_info['id'],
'update_post_count' => !$user_info['is_guest'],



Can someone modify this for SMF 2.0 RC 2?
What is the correct code for this command: !$user_info['is_guest'],?

TY
Title: Re: Custom Form Mod
Post by: Garou on February 09, 2010, 08:01:23 PM
I just checked the Post.php and that is correct for 2.0 they use...
'update_post_count' => !$user_info['is_guest'] && !isset($_REQUEST['msg']) && $board_info['posts_count'],
Which I believe will also check to see if the board is set up to count posts.
Title: Re: Custom Form Mod
Post by: Studio on February 10, 2010, 05:34:52 AM
Hi folks, hi Garou - (I hope you see this one...)

I've made a new table inside the same DB my SMF board is using, with fields and data types according to the custom form I created on the forum.

Is there a way I can tell CustomForm.php to insert the values of the fields to that new table (about 51 columns per record) at the same time it would post to a board in the forum?

Thanks in advance.
Title: Re: Custom Form Mod
Post by: Garou on February 10, 2010, 08:30:04 AM
Not the structure of the mod isn't set up for that at all and it would take creating the mod from scratch to support it. Add to that Nathaniel and I have both stated in this thread multiple times that we would never set up the mod that way.

In order to make something like that work, you would either have to create a new DB table every time a form is created or you end up limiting the amount of fields that can be used in a form. The first isn't practical at all and could cause more issues then it solves, its much better to create a stand  alone form and database that way. The second severely limits the mod and that is not something I at least can not support. Sorry.
Title: Re: Custom Form Mod
Post by: Brandi on February 11, 2010, 02:27:14 PM
I installed this mod on my WoW Guild's forum a few days ago in hopes of using it as an application.  It worked just fine when I first set it up, but now every time it's giving me "Hacking Attempt" errors.

Hacking attempt...

INSERT INTO smf_messages
(ID_BOARD, ID_TOPIC, ID_MEMBER, subject, body, posterName, posterEmail, posterTime,
posterIP, smileysEnabled, modifiedName, icon)
VALUES (19, 0, 4, SUBSTRING('Brandi's Guild Application for test', 1, 255), SUBSTRING('Name: Brandi
Age: 26
Email: [email protected]
Character name: test
Character class: test
Character level: 80
Character spec: test
Armoury link: test

Why Dusk Fellowship?
test test test

What days and times are you available to raid?
test test test

Do you consider yourself a mature player?  Explain:
test test test

Tell us a bit about yourself.  We'd love to get to know you!
test test test

[hr]

Discuss.
', 1, 65534), SUBSTRING('Korlae', 1, 255), SUBSTRING('[email protected]', 1, 255), 1265915844,
SUBSTRING('173.27.206.185', 1, 255), 1, '', SUBSTRING('exclamation', 1, 16))
File: /home/lunarius/public_html/df/Sources/Subs-Post.php
Line: 1535


The application used to be longer, but as the error popped up I thought perhaps I had too many questions -- there were only three more -- but it's never gone away.

To use the form a person needs to first register on the forum; this is not something we're interested in changing if we can help it.

Thanks very much!
Title: Re: Custom Form Mod
Post by: Illori on February 11, 2010, 03:01:50 PM
take a look at this

Quote from: Garou on January 16, 2010, 06:34:55 PM
In several places he tries to enter stuff like
we\'re
I\'ll
I\'m
\"in\"


Traditionally something like that is only used in some programing languages to escape characters so a program can tell the difference between text and actual code. There is absolutely no need to escape characters like that when posting to a forum like this.

Essentially the forum is thinking someone is trying to use a 3rd party script to insert malicious code into the site. In looking at what hes written I dont think this is the case however I do see...

', 1, 65534), SUBSTRING('Goldiedixie', 1, 255), SUBSTRING('[email protected]', 1, 255), 1263676747,
SUBSTRING('83.26.223.139', 1, 255), 1, '', SUBSTRING('xx', 1, 16))


That bit actually is code and I dont know if it was intentional, something from the error code, or what but that could be a problem for you to consider.  :-\

in your form you have <name>'s somewhere or similar try <name>\'s instead and it should work.
Title: Re: Custom Form Mod
Post by: Brandi on February 11, 2010, 04:29:21 PM
Hi illori!

Actually, I don't have any apostrophes in my form; I was careful to reword and remove any that were present when I first started having the error and read up on this thread.

If there are any I'm completely missing them, so a fresh pair of eyes to point it out is always welcome, though.

Edit:  Actually, you know what?  As soon as I finished typing this up and tabbed back to the form I found an apostrophe, plain as day.  I fixed it, and I'm still coming up with the error.

Edit2:  Hah!  Found it.  The very last apostrophe was lurking in the Subject box.  Thanks very much, illori.  I thought I had them all, and I doubt I would have looked so closely if you hadn't brought that post to my attention again.

Quick question, though:  If an applicant types "I'm" rather than "I am," are we going to run into this problem all over again?  Is there a work-around for this, or is it just limited to the form inner-workings themselves?
Title: Re: Custom Form Mod
Post by: Illori on February 11, 2010, 04:31:57 PM
QuoteINSERT INTO smf_messages
(ID_BOARD, ID_TOPIC, ID_MEMBER, subject, body, posterName, posterEmail, posterTime,
posterIP, smileysEnabled, modifiedName, icon)
VALUES (19, 0, 4, SUBSTRING('Brandi's Guild Application for test', 1, 255), SUBSTRING

check the part in bold
Title: Re: Custom Form Mod
Post by: Garou on February 11, 2010, 11:06:03 PM
Please submit mod version, SMF version, and a link to the site, even better if the form is set to allow guest post.

Most syntax issues I can figure out without creating an account on the site. I'm pretty sure there is some sort of syntax issue, normally that's what causes errors like this, if not related to apostrophes then something else.
Title: Re: Custom Form Mod
Post by: Loading001 on February 12, 2010, 12:14:20 AM
I have installed the mod (CustomFormMod_v1.6_SMF2_RC2.zip) on my board running Forum version: SMF 2.0 RC2. Any way I have made a form but when I go to index.php?action=form all I see is This list is currently empty. 
Title: Re: Custom Form Mod
Post by: Garou on February 12, 2010, 01:19:00 AM
Generally if a form doesn't show up on a list like that it hasn't been set up properly. Make sure you are not using any capital letters, spaces or special characters other then an underscore "_" in the title field of your form fields as this is generally the culprit in such cases.
Title: Re: Custom Form Mod
Post by: Loading001 on February 12, 2010, 02:32:45 AM
That didn't work I'm going to attach some screen caps I hope someone can help.
Title: Re: Custom Form Mod
Post by: Garou on February 12, 2010, 09:43:02 AM
You have nothing in the text fields. That is where the questions would actually be asked of the user. Since the questions dont exist there is nothing to display in the form, if it did display there would just be empty boxes. It should be set up something like...

Title: ingamename
Text: What is the name of the character you play in game?
Type: Text Box (String)
Extra Type Parameters: required


Note in the text field you can also use simple HTML tags to add extra emphasis. For instance the instructions on how I set up my demo form are at http://smf.balancegames.net/index.php?topic=7.0
Title: Re: Custom Form Mod
Post by: Nvb on February 12, 2010, 04:06:03 PM
Quote from: NeQo on February 08, 2010, 05:10:12 PM
Quote from: ŦώεαЖзяŁ on December 21, 2009, 12:09:23 PM
A not perfect way to make posts made through custom forms count towards the user post count is to do the following

open CustomForm.php in \sources

find:
Quote$posterOptions = array(
               'id' => $user_info['id'],

add in the next line:
Quote'update_post_count' => !$user_info['is_guest'],

The reason why it's not perfect is that it will not check whether the target board has post count enabled and therefore will add increase the count even if the target board is not supposed to count posts... In my case, that solved my problem because all my forms are supposed to count, so if that's you case, cool...

Is there a reason why this does not work with version 1.6 on Board version 2.0 RC2 ?
Does the modification need an update? or did i do something wrong?
I changed into this:
$posterOptions = array(

'id' => $user_info['id'],
'update_post_count' => !$user_info['is_guest'],


Thank you for looking into this
N.

Still not working... plz help
Title: Re: Custom Form Mod
Post by: Garou on February 12, 2010, 10:01:47 PM
In thinking about it try...
'update_post_count' => true,
or
'update_post_count' => auto,

It might cause errors with guests, I'm not sure but I'm thinking that this should recognize any permissions set in the boards by default for 2.0. I'm using this as a reference http://support.simplemachines.org/function_db/index.php?action=view_function;id=323;sa=viewall
Title: Re: Custom Form Mod
Post by: Shades. on February 15, 2010, 05:58:48 PM
I installed this mod, created a form and set it up to post the results into one of my event forums. I have all the permissions set up correctly as far as I can tell, and even created a new permission profile called "approval" so that when the form is submitted the results or the post automatically posted in the event forum would need approval. I can post a regular post in that forum and it needs approval as it should, but submitting the form into that forum bypasses the permission set and posts it anyways without approval. Any suggestions?

Basically, I just want a user to be able to submit the form, and it go into "waiting for approval" status. Then once I (admin) click on "approved", the form then appears in the forum as a new topic.

(Am I rambling?...lol! :o ::)
Title: Re: Custom Form Mod
Post by: Garou on February 15, 2010, 09:40:45 PM
Haven't tested it and not 100% sure it will work so be sure to back up but it should be in ./Sources/CustomForms.php
Find...
// Collect all necessary parameters for the creation of the post.
$msgOptions = array(
'id' =>  0,
'subject' => $subject,
'icon' => $icon,
'body' => $output,
'smileys_enabled' => true,
);

Replace with...
// Collect all necessary parameters for the creation of the post.
$msgOptions = array(
'id' =>  0,
'subject' => $subject,
'approved' => 0,
'icon' => $icon,
'body' => $output,
'smileys_enabled' => true,
);


and find...
$topicOptions = array(
'id' => 0,
'board' => $board,
'mark_as_read' => true,
);

replace with
$topicOptions = array(
'id' => 0,
'board' => $board,
'mark_as_read' => true,
'is_approved' => false,
);


Note as this is a quick fix it will effect all forms created with the mod, the code needed to make this selectable per form would be much more in depth.
Title: Re: Custom Form Mod
Post by: oOo--STAR--oOo on February 17, 2010, 04:13:35 PM
Hi I have installed the mod massive error..

Who ever fills one of the forms in.
It sets there post count to 0

How can i fix this?

using SMF2.0 RC2

EDIT : Sorry when i was testing this i was deleting topics and it was reducing the post count..
Because it didnt add to post count thats the reason it made my post count goto 0

I need to modify it so that it will add to post count when a post is submitted.. But i would like it to check board permissions to see if post count adding is enabled.. Is there any fix for this or can anyone confirm they have got this working?

EDIT2:
also is there an option where when guests try to enter the form and there permissions are denied that it displays a message to say "You Currently don't have permision to view this Form please Register or Login to gain access"
Title: Re: Custom Form Mod
Post by: Garou on February 17, 2010, 06:12:50 PM
several posts bak I list an untested fix for updating post count on 2.0. let me know if it works.

as for the user not having permission to use the form, at preseent it redirecs a user without permissions to the list of forms they can use and if they dont have permission to view the list it redirects them to th forum. there might be something else that can be done but Ill have to look at it later as Im at work atm.
Title: Re: Custom Form Mod
Post by: oOo--STAR--oOo on February 17, 2010, 06:44:58 PM
Hi yeah i did test that method on auto and true.. they both work.. but if unticked on speciic board to add to post count it stil overides and adds to the members post count.

also the auto alternative should be
'update_post_count' => 'auto',

Im looking into the checks it makes to se if that option is ticked or unticked.
I wonder if any of this code could help make the checks.
if (!empty($posterOptions['update_p​​ost_count']) && !empty($posterOptions['id']) && $msgOptions['approved'])

Thanks.



Title: Re: Custom Form Mod
Post by: oOo--STAR--oOo on February 17, 2010, 08:09:58 PM
I have also noticed another error that is really fustrating..

When you have required fields and Miss one.. then goto submit your entry..
You get fileds required error ..

Then when you have inserted your text into the required fields and then goto submit your entry.
You get captcha error.

No matter how many time you try you will always get captcha error even though the captcha you entered is correct.

I'm hoping there is something some one can do to Fix this.. as people who miss a field then try and submit there entries would just get rejected every time.

Title: Re: Custom Form Mod
Post by: Garou on February 17, 2010, 09:45:46 PM
Hmm I haven't encountered that issue yet but Ill put it on the bug list. Ill see if I cant come up with something. Ive always thought that captcha was messed up anyway because when you request a new image instead up updating the session and giving a new code it just presents the same code with a different image scheme. This too might be part of the problem.

According to the functions database in 2.0 "auto" is supposed to follow the boards settings for post count. Ill probably end up having to contact one of the current or former SMF developers to see if they know whats going on there. It very well could be either an undocumented or unknown bug in SMF 2.0.

The thing is this mod was originally coded with the most simple idea of creating preformated posts filled out with user entered responses. Since there have been so many features that have been requested that the simple patching I keep doing is impractical if not darned near impossible. I keep hitting walls anyway, some of which is probably due to my own inexperience but the mod needs a complete re-write, even its creator has stated as much. He has been planning on doing that himself for some time but he has so many projects on top of real life stuff that he hasn't had the time to do it.

For me lack of time and lack of desire has been a major issue lately. I just really dont feel like coding lately especially with the current situation between SMF management and the "Friends"/former developers. I'm on the side of the friends by the way and much more excited about the new project they are working on.
Title: Re: Custom Form Mod
Post by: oOo--STAR--oOo on February 17, 2010, 10:03:01 PM
Hi Guru Thanks for your reply.. I did read that the Captcha problem is that it will refresh the image to show it in a different manner 3 times then on the 4th click will give you a different set of Chars.

The bug maybe related to a bug that is currently in quick reply.. When you do a quick reply and have to enter Captcha it takes you to full edit mode saying that you have not entered the quick reply properly. even though you have because u can pres submt on the next form.. Kinda defeats the object of having quick reply lol.

So yeah.. For now i just disabled captcha on new posts only way around it.. But it does leave room for spammers alot of room.
So a simple fix would be great..
I use it for child boards and links so people can introduce them selvs like a template and Im going to be adding it for support.
Great for having them fill out the fields to simple Explain there problem and system setup :)

So I'm not using the action=form just linking directly to the forms.

Quote from: Garou on February 15, 2010, 09:40:45 PM
Haven't tested it and not 100% sure it will work so be sure to back up but it should be in ./Sources/CustomForms.php
Find...
// Collect all necessary parameters for the creation of the post.
$msgOptions = array(
'id' =>  0,
'subject' => $subject,
'icon' => $icon,
'body' => $output,
'smileys_enabled' => true,
);

Replace with...
// Collect all necessary parameters for the creation of the post.
$msgOptions = array(
'id' =>  0,
'subject' => $subject,
'approved' => 0,
'icon' => $icon,
'body' => $output,
'smileys_enabled' => true,
);


and find...
$topicOptions = array(
'id' => 0,
'board' => $board,
'mark_as_read' => true,
);

replace with
$topicOptions = array(
'id' => 0,
'board' => $board,
'mark_as_read' => true,
'is_approved' => false,
);


Note as this is a quick fix it will effect all forms created with the mod, the code needed to make this selectable per form would be much more in depth.

BTW THIS WORKS.. I HAVE TESTED IT.. if a member has been issued a warning and needs posts to be moderated it put them in awaiting 2.. Nice one.

I dont think it needs a rewrite I have been playing with it for some time now.. and it works perfectly just need 2 errors Ironing out and its cured..

With and optional extra..
The size of the boxs is there a way to change the,.. Looks a bit Ugly and boring all have the same size Multi Text Box.

Its a great mod.. and i have heard alot about the lack of love for doing it in SMF and seing alot of people leaving.. WHY. SMF is fantastic software and with the support from members it will be EVEN better. :) they rely on us :) Great work Thumbs up
Title: Re: Custom Form Mod
Post by: Garou on February 17, 2010, 11:29:30 PM
Yep setting the size of the textarea (multi-line text box))in the admin area is one of the things that does require a rewrite to do it properly. There might be an improper way way to put it into the mod I just haven tracked it down yet. If you want it to be larger then it is now there is a post somewhere on here about how to do it but it does effect the size of all of them.

There are more then 2 errors/bugs on my to do list atm. The biggest is the permissions one, Ive been through the code in SMF and a couple mods trying to figure this one out and no luck yet. Then there is a long list of requested features. Top priority on the features is attachments along with some of the other code that myself and a couple others have submitted elsewhere in this thread.

As for the issues with SMF you are right the software is fantastic (still plenty of room for improvement but its still tops for what it does, dont know how long it will stay there if things dont change), the community is great too, though it was even better a few years ago. Still that isnt the problem and its not my place to go into the details. That said some of the greatest minds to have ever work on SMF have banded together and are working on something that has the potential to make this look like child's play. I'm looking forward to being a part of that. It would have been nice to see another machine to complement this one but the powers that be have pushed it in another direction.
Title: Re: Custom Form Mod
Post by: oOo--STAR--oOo on February 18, 2010, 01:49:19 AM
I like smf its the only forum that i have enjoyed using and there is many lovers out there..

I Like this mod. Its great.. And It's already installed and setup to use on a new site I'm currently making.
Great work..
I will look forward to updates and fix's
Thanks for your support and great mod's
Title: Re: Custom Form Mod
Post by: bros on February 25, 2010, 09:09:21 PM
Quote from: Garou on January 13, 2010, 01:35:03 PM
Well try copying the languge files to the theme folder. I know its suposed to work anyway but sometimes it doesnt always work.

Other then that something must have not installed corectly. Compare the other files listed in the parser.

Tried that, didn't fix it.

If I downgrade to the previous version of the mod, the forms do appear in the admin panel
Title: Re: Custom Form Mod
Post by: piku2008 on February 26, 2010, 01:24:41 PM
Really great mod
Title: Re: Custom Form Mod
Post by: Garou on February 26, 2010, 01:39:31 PM
Bros, I dont know what to tell you other then you seem to have a unique set of problems probably due to a conflict between the way the two versions of SMF handles the DB files.

I would uninstall the mod, make a backup of the cf_forms and cf_fields tables and delete them off the server, and reinstall the mod, then see if you can create a new form. If everything works this way you may just end up having to re-create your forms from scratch.
Title: Re: Custom Form Mod
Post by: MarcusJ on March 09, 2010, 04:06:06 AM
Will this mod be updated for RC3?
Title: Re: Custom Form Mod
Post by: Garou on March 09, 2010, 08:54:04 AM
Probably its just going to take a while as real life is kicking my rear pretty hard right now.

Edit: Just tested and the version for RC2 works fine on RC3 as well.
Title: Re: Custom Form Mod
Post by: MarcusJ on March 09, 2010, 05:03:04 PM
Thanks for the update.  Here's hoping life gives you some time to relax soon.  :)
Title: Re: Custom Form Mod
Post by: okae on March 10, 2010, 07:46:11 AM
dont work for me, all appear to be ok, but custom forms dont appear when you want to open a new topic, permissions and all is ok, so i dont know whats wrong.
Title: Re: Custom Form Mod
Post by: Garou on March 10, 2010, 11:16:58 AM
 Its been covered here several times, forms do not open when you create a new topic. There is a user created workaround listed elsewhere in this thread that will allow you to do that though.

To get to your forms go to yourforum/index.php?action=form and it will give users a list of forms that they have permission to use. Also you can give them a direct link to a form using index.php?action=form;id=#.
Title: Re: Custom Form Mod
Post by: okae on March 10, 2010, 01:41:06 PM
ok now i understand how this mod work and is awesome!!! i have only one question, why this scrool bar appear if my "description" field is a litle big?:

Title: Re: Custom Form Mod
Post by: okae on March 11, 2010, 02:35:48 PM
Quote from: okae on March 10, 2010, 01:41:06 PM
ok now i understand how this mod work and is awesome!!! i have only one question, why this scrool bar appear if my "description" field is a litle big?:



nobody know how to solved this issue? im using 2.0rc3 and that field is setting as a large text box
Title: Re: Custom Form Mod
Post by: Garou on March 11, 2010, 04:23:00 PM
That has something to do with SMF itself you will have the same issue if you type something like that into a standard post.

Your best option to prevent something like that would be to use the "Break up words with more letters than" function under Admin -> Forum -> Post settings.
Title: Re: Custom Form Mod
Post by: Axodious on March 11, 2010, 06:19:39 PM
I'm not sure if this has been covered before, I tried searching but came up with nothing. When people use < or > in custom form fields it does not post in the forum post. For example one of the answers on a form is "something something <something>" the third word (symbols and all) would not appear.

Using SMF2 RC2 (going to be upgrading to SMF2 RC3 shortly).
Title: Re: Custom Form Mod
Post by: Defenestrate on March 13, 2010, 07:22:04 PM
I'm using Padexx's WoW-DK theme on 1.1.11. It seems that the theme breaks the mod. When it's installed and I go to setup page, I have no text at all. Just a couple blank boxes. Has anyone else had this problem with other themes? And is there an easy fix for this problem.
Title: Re: Custom Form Mod
Post by: Garou on March 13, 2010, 08:11:31 PM
Axodious, it was kinda covered before, the processing of special characters like that has been causing issues as its getting passed to the DB as code. Ive added an odd hack to fix a couple chars, Ill just have to add GT and LT to it.

Defenestrate, you will have to manually add the language strings to the file in the theme.
Title: Re: Custom Form Mod
Post by: sveta41 on March 15, 2010, 08:27:08 PM
Ok i have a problem with accessing created forms, to test them up on a "/index.php?action=form" link works, but its sais that list is currently empty. My SMF is 1.1.11 and form version is 1.6, while when i go to my admin panel i can clearly see all the forms..
Title: Re: Custom Form Mod
Post by: tommybishop on March 16, 2010, 10:54:16 PM
hello guys, setting up a new forum, just got done installing some mods and... im getting a parse error... im using smf 2.0RC3

   
1.    Reason For Editing Mod    2.3.2    
2.    Advanced Reputation System    1.8.1    
3.    Add Honey Pot to Track IP    1.1
4.    HotBrackets    2.0
5.    Sorted Package Manager Listing    1.0.1    
6.    Spoiler Tag    0.7.2    
7.    httpBL    2.3.4    
8.    Profile Comments    2.0
9.    AvatarSelect    1.2.1    
10.    Thank-O-Matic    2.0 RC1.4    
11.    Signature Area BBCode Buttons    2.0.1    
12.    Post History    0.3    
13.    Enhanced PM Popup    1.0.1    
14.    Stop Spammer    2.3.7    
15.    Add IP2Location to Track IP    1.3
16.    Buddy Page    1.2    
17.    Aeva Media    1.1a    
18.    Users Online Today    1.5.6    
19.    Proxy Blocker    1.1.4    
20.    Custom Form Mod    1.6    
21.    Custom Tab    1.2    
22.   Sortable Packages (and Installed Time)      1.3     
23.    Ultimate Profile    0.9.1    
24.    Simple Award System    2.1    
25.    Menu Order    0.2.2    
26.    SimplePortal    2.3.1    
27.    Countdown_BBCode    1.2    
28.    Redirect Banned Users    1.1    
29.    Current Signature Mod    1.0    
30.    Last Active On MemberList    1.02    
31.    SMF Arcade

-->link to forum (http://thisisawf.co.cc)

that is a list of the packages i have installed.... it was all fine right up until i installed Custom Forum Mod then it went a little hinky.. i got an error message and checked it out, did a couple things and i was pretty sure it was fine... got done and went to check out all my new toys and i cant get into the features and options section of my forum..  I will be removing the mod for now but would really love it if anyone could give me a hand with figuring out exactly what went wrong as this mod would suit my needs incredibly well.. 

Thank you in advance for any and all help..

Tommy Bishop
Title: Re: Custom Form Mod
Post by: Garou on March 16, 2010, 11:05:08 PM
sveta41, You probably dont have the forms created properly. This is a tutorial written by another user a while back so its missing a few field types but it should help you out. http://www.simplemachines.org/community/index.php?topic=248871.msg1633514#msg1633514

Tommy, I'm guessing its simple portal messing it up check out this post on how to make it work. http://www.simplemachines.org/community/index.php?topic=248871.msg2395677#msg2395677
Title: Re: Custom Form Mod
Post by: sveta41 on March 16, 2010, 11:22:33 PM
Quote from: Garou on March 16, 2010, 11:05:08 PM
sveta41, You probably dont have the forms created properly. This is a tutorial written by another user a while back so its missing a few field types but it should help you out. http://www.simplemachines.org/community/index.php?topic=248871.msg1633514#msg1633514

Tommy, I'm guessing its simple portal messing it up check out this post on how to make it work. http://www.simplemachines.org/community/index.php?topic=248871.msg2395677#msg2395677

i am sorry i forgot to post that i figured out what was the problem and managed fix it, i just didnt make the forms right, now its working...
Title: Re: Custom Form Mod
Post by: Axodious on March 19, 2010, 09:37:17 AM
Quote from: Garou on March 13, 2010, 08:11:31 PM
Axodious, it was kinda covered before, the processing of special characters like that has been causing issues as its getting passed to the DB as code. Ive added an odd hack to fix a couple chars, Ill just have to add GT and LT to it.

I'll keep my eyes out for the update, thanks.
Title: Re: Custom Form Mod
Post by: svpernaut on March 27, 2010, 01:20:05 PM
OK so I successfully installed and configured this mod!
But when a user enters all the requirements and hit save it doesn't post in the forum? any help?

Im using RC3

here is my form location:
http://headshotdistrict.com/index.php?action=form;id=1

And its suppose to post here:
http://headshotdistrict.com/index.php?board=8.0
Title: Re: Custom Form Mod
Post by: Garou on March 27, 2010, 05:14:11 PM
Can you make the form public till I can see whats going on and dont have to sign up please?
Title: Re: Custom Form Mod
Post by: svpernaut on March 27, 2010, 08:03:09 PM
ok I just did it
Title: Re: Custom Form Mod
Post by: Garou on March 28, 2010, 01:01:25 AM
Hmm well the only thing I see that might be causing a problem is that the title for the Steam ID is "id". Try changing that to steam steamid or something else. Since id often gets processed for other things in the web realm it might effect it. Other then that everything looks ok from the outside.

If changing that doesn't work, are there any errors popping up in the logs?
Title: Re: Custom Form Mod
Post by: svpernaut on March 28, 2010, 10:28:27 AM
Thanks man! That seemed todo the trick!
Title: Re: Custom Form Mod
Post by: luuuciano on April 01, 2010, 03:04:51 PM
mmm, I have installed it, all ok, no errors neither warnings...

Buit I just see this:


then I hit save... and nothing happen... just save the values... where is located the add new forms button... or something similar?
Title: Re: Custom Form Mod
Post by: Garou on April 01, 2010, 03:47:22 PM
It looks like something didn't install properly to your custom theme. The Custom form list and an Add Form button should be displayed just under what you have there. Check to make sure CustomForm.template.php is in your themes directory. Also check tour themes /languages/Modifications.english.php and  /languages/Help.english.php to make sure the changes were made there as well.

A direct link to the add a form would be /index.php?action=admin;area=modsettings;sa=customform;add_form;
Title: Re: Custom Form Mod
Post by: luuuciano on April 01, 2010, 05:21:11 PM
thanks Garou!
it looks like that... I can see it using the "direct link"
will do a parse and check all the files too...

edit: I have uploaded the CustomForm.template.php to the theme directory... and do not work

I have not uploaded the language files there, because it should get them from the default template directory, or not?
(all the other mods I have get them from there... or not? Im in doubt now...)

I have checked Admin.php ManageSettings.php index.php and all the files have the mod code in there...
CustomForm.php is in Sources and CustomForm.template.php in the themes default and the theme I am using too...

Then I tried uploading the Modifications.english.php to the theme used, and I lost the main Custom Forms link the the mods section... I have tried naming it as Modifications.spanish_latin-utf8.php (my language)

edit2:

LOL
I have found it!
it was always there!


just at the bottom!!!
something in the css, or html code, makes that section go down... I have search in the document code and saw the code in there... then scrolled to the bottom and the Add new form, edit, delete, etc... all was there!
Title: Re: Custom Form Mod
Post by: Kelmino on April 03, 2010, 09:06:39 AM
I'd like to say thank you very much for creating this mod, it helps our forum out greatly.

I have two requests though.

1 - Is there any way for it to post two times in two separate forums?

We use this particular mod for new applications into our guild.  We then take the original it posts and copy it to another forum.  If we could get the mod to automatically post it in two separate forums it would save us one step.  It's not a huge deal as we've been using this mod this way for a year now.  I just thought I would ask to see if it's already possible, or if it's possible to add as an added feature at some point.

2 - I know I've seen this request in this thread before, but the ability to post the completed form to an existing thread as a reply would also come in handy.  Again no deal breaker, but it's something we would use every once in a while.
Title: Re: Custom Form Mod
Post by: Garou on April 04, 2010, 06:47:16 AM
For Request #1 there is a post in this thread on how to do that. #2 not at this time.
Title: Re: Custom Form Mod
Post by: Pegasys on April 11, 2010, 10:27:10 AM
Is there a pre-defined way to auto-populate a form field with forum variables... or include forum variables in the resulting posted message?

I know the resulting message will be posted by the user who submits the form... but can that user's info also be included in the message text... or displayed in some fashion on the form itself?

* Something similar to how values are stored and passed along in hidden elements on a normal html form.

For example: 

On a form... in an Info Box... can the text have something like "Hello {[username}..." or the Parameters  be set to default={username}... where {username} is the forum variable for the user's name?
Title: Re: Custom Form Mod
Post by: Garou on April 11, 2010, 11:06:59 AM
From the Extra Type Parameters help file in the mod
Quotedefault=(str) This allows you to set default text that will display in the forum post if the user fails to fill out the entry.

Example: If you enter "default=User did not enter any data in this field.", in the Extra Type Parameters field and the user does not enter any input in the filed when filling out the form then "User did not enter any data in this field." will automatically be displayed in the forum post.

This only works with the various Text Boxes, a Select Box will automatically select the first option if the user fails to select one, that's about all you can pre-define.

For something like that there are other mods such as the you bbc and other bbc types that can accomplish something like that and then you just enter that bbc code in the form output. Ive never included something like that in the mod itself as I consider it bloat for the amount of code needed to add something like that and the data is in the post information anyway.

Other then making sure the existing code works with current versions of SMF I'm not planning on adding anything new to this anytime soon either. I just dont have the time right now.
Title: Re: Custom Form Mod
Post by: Pegasys on April 11, 2010, 09:36:34 PM
Quote from: Garou on April 11, 2010, 11:06:59 AM
This only works with the various Text Boxes, a Select Box will automatically select the first option if the user fails to select one, that's about all you can pre-define.

For something like that there are other mods such as the you bbc and other bbc types that can accomplish something like that and then you just enter that bbc code in the form output. Ive never included something like that in the mod itself as I consider it bloat for the amount of code needed to add something like that and the data is in the post information anyway.

Other then making sure the existing code works with current versions of SMF I'm not planning on adding anything new to this anytime soon either. I just dont have the time right now.


Thanks for responding. I fully understand the limited time factor.

* The "YOU" BBCode would only display the name of the person reading the message. Not sure about other BBCodes though..

I was just wondering (hoping) there was already some predefined mechanism that would allow the use of the system $user_info array to pass along data to the resulting message about the user submitting the form.  Some of that data would be useful... especially in a form related to site reporting problems or issues that user had with the website, etc...


The $user_info array is already a global in the CustomForm function... so it won't be too difficult to expand upon it and pass the data over to the form template. I'll just have to figure out a way to define that data as a hidden field type so it can be easily added to the form.

Or just take the easy road and define a new custom form template.   ;)


Thanks for sharing such a great mod!! 
Title: Re: Custom Form Mod
Post by: Tunga on April 15, 2010, 07:17:38 AM
Great mod, been using it for a few months as our guild recruitment system and it is perfect for our needs.  Unfortunately it has suddenly stopped working.

The main form page works:
http://www.bottleortree.co.uk/index.php?action=form

But when you click on the form link it gives a strange error:
http://www.bottleortree.co.uk/index.php?action=form;id=1
"501 Method Not Implemented - GET to /index.php not supported."

I did some reading on 501 errors and it sounds like it may be a server issue and I will ask my host about it as well but though I'd check here in case it was a known issue.

This was working on the 10th April because someone used it, and I haven't touched the code for this site for the last couple of months so I'm pretty sure I didn't break it but I'm open to any suggestions.

Thanks.

Edit:
If I use this URL it works fine:
http://www.bottleortree.co.uk/index.php?action=form&id=1
Most likely my host changed something in Apache's mod_settings which broke this.  I believe this this is actually the correct/standard format so it might be worth changing it in the Custom Forms code.
Title: Re: Custom Form Mod
Post by: bros on April 18, 2010, 02:14:25 AM
Quote from: luuuciano on April 01, 2010, 03:04:51 PM
mmm, I have installed it, all ok, no errors neither warnings...

Buit I just see this:


then I hit save... and nothing happen... just save the values... where is located the add new forms button... or something similar?

I get this same thing.

Upgraded to RC3 from RC1.2 today.

Want me to upload any files for you to look at?
Title: Re: Custom Form Mod
Post by: luuuciano on April 18, 2010, 10:51:14 AM
look at bottom... you have the other form settings there?

it looks like something in the html/css makes that go down...
Title: Re: Custom Form Mod
Post by: Meister GN006 on April 20, 2010, 06:19:18 PM
I have my Custom Form Mod successfully setup and posting correctly to my forums. My only issue is that the custom theme I am using doesn't display the *Required Fields text or the Submit Button as well as the Captcha box not exactly being level with the input box. Yet it works just fine on the default SMF theme.

The errors I am currently receiving are:
8: Undefined index: CustomForm_required
File: /home/username/public_html/forums/Themes/wow-dk119v1/CustomForm.template.php (submit_form sub template - eval?)
Line: 132


8: Undefined index: CustomForm_submit
File: /home/username/public_html/forums/Themes/wow-dk119v1/CustomForm.template.php (submit_form sub template - eval?)
Line: 200




Any Ideas?
Title: Re: Custom Form Mod
Post by: Kenamura on April 22, 2010, 06:30:35 PM
love the mod, used it before when it was more or less new, lol dont let the  join date fool you but i am looking forward to seeing how much this mod has improved in the time i discontinued the use. And i only discontinued it mainly because i toned my site down and used third party forms, so im gonna start up using Custom Forms once again. Congrats on the awesome mod guys, hope to see more like this down the road.

-edit-
Hmmm it seems that an error has happened with the install process

Error-

You 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: /hosted/subs/com.net.sc/t/e/temptedsouls/public_html/Sources/ModSettings.php
Line: 831

-end edit-
Title: Re: Custom Form Mod
Post by: catstrat on April 25, 2010, 09:40:51 PM
Hi guys,

Well this is my first foray into forums and this mod. Loving it so far. I have a question I couldnt find the answer to in a search of this thread, namely:

1. Is there a way that I can include an image attachment option in one of the fields? I am using the form as a way to standardize classified postings on my site and I would like my "item description" (large multiline text box) field to include both text and any images of the item for sale that the poster has.

I realise that posters could simply post links to the location that their images are hosted but for less technically capable users it would be great for them to be able to post images as they would in any normal forum post via wysiwyg.

Thanks guys, really appreciate this mod.

Catstrat
Title: Re: Custom Form Mod
Post by: Vyache on April 27, 2010, 09:24:23 PM
Hello,

I was wondering if it were possible to create a form that after it is filled out, the information is private, not posted in a thread, but posted in the admin panel as a table of users who entered the data for the fields and the answers to the fields. This information should be generated on request of the admin...

Is this possible ?
Title: Re: Custom Form Mod
Post by: Arantor on April 28, 2010, 05:24:53 AM
You could have it posted into a thread in a private admin only board I think... anything else is likely a rewrite of the mod.
Title: Re: Custom Form Mod
Post by: Vyache on April 28, 2010, 09:26:47 AM
Quote from: Arantor on April 28, 2010, 05:24:53 AM
You could have it posted into a thread in a private admin only board I think... anything else is likely a rewrite of the mod.

Oh okay.
Thank you for your reply.
Title: Re: Custom Form Mod
Post by: Vyache on April 29, 2010, 12:26:49 AM
Hello,

Is it possible to route the information submitted in the form to the database so that it will not be posted on any topic, but just to be stored, so that it can be taken out ?
Title: Re: Custom Form Mod
Post by: Arantor on April 29, 2010, 03:13:58 AM
Not without a significant overhaul, I believe.
Title: Re: Custom Form Mod
Post by: Jaymjaym on May 03, 2010, 01:39:18 PM
Hello folks, I was wondering if it was possible to have a {date} variable, or equivalent?

For example, a topic title such as "5/2/10 - Blue", generated from {date} - {favorite_colour}

I'm not particularly worried if that date format is used or not, but just hoping to be able to add the date to it without requiring user input. 
Title: Re: Custom Form Mod
Post by: recived on May 04, 2010, 05:16:26 AM
Tell me how to make checkbox? Inserted into the "Extra Type Parameters" test1, test2, test3 but the form does not display them.
Title: Re: Custom Form Mod
Post by: SOC Caesar on May 06, 2010, 12:28:39 PM
Works great thanks.  8)

SMF 2.0RC3
Title: Re: Custom Form Mod
Post by: SmackDaddy on May 06, 2010, 08:40:20 PM
I have this installed on SMF 2.0 RC3.....I can enter form fields and other information.....but when I put the Form Output in and "Save", nothing that I typed into the "Form Output" block saves.  I have tested the form by going to "http://somethinghere.com/index.php?action=form;id=1", I can fill out the forms, and submit.  It posts a topic in the appropriate forum, but obviously since the Form Output never saves, the topic ends up blank.

I CHMOD'd the CustomForm.template.php and CustomForm.php files to 755 to check to see if that fixed it, but it didn't.... (just was trying something).......

Where should I look for this issue?  What can I do? 

Also, is there any way to auto-create a Yes/No POLL after the form is submitted? 

Thanks in advance for any replies.
Title: Re: Custom Form Mod
Post by: C4G-TK on May 06, 2010, 08:44:22 PM
Quote from: SmackDaddy on May 06, 2010, 08:40:20 PM
I have this installed on SMF 2.0 RC3.....I can enter form fields and other information.....but when I put the Form Output in and "Save", nothing that I typed into the "Form Output" block saves.  I have tested the form by going to "http://somethinghere.com/index.php?action=form;id=1", I can fill out the forms, and submit.  It posts a topic in the appropriate forum, but obviously since the Form Output never says, the topic ends up blank.

I CHMOD'd the CustomForm.template.php and CustomForm.php files to 755 to check to see if that fixed it, but it didn't.... (just was trying something).......

Where should I look for this issue?  What can I do? 

Also, is there any way to auto-create a Yes/No POLL after the form is submitted? 

Thanks in advance for any replies.

Are you using the WYSIWYG as your default editor?  If you are, be sure to hit the red A to change it back to the non-WYSIWYG editor before hitting save.  Try that.  And yes, you will need to do this each time you go in and make a form if you are defaulted with the WYSIWYG.  I reported this problem many many pages ago and have restated this every time someone brings it up.  I don't think it has been corrected, yet, if this is the problem you are experiencing.  Give me a second and I will post the link to where it is discussed here.


Originally brought up posts #294 & 295
Then again in posts #509-510
Then again in posts #746 + 748-752 + 754
Title: Re: Custom Form Mod
Post by: SmackDaddy on May 06, 2010, 10:35:28 PM
Quote from: C4G-TK on May 06, 2010, 08:44:22 PM
Quote from: SmackDaddy on May 06, 2010, 08:40:20 PM
I have this installed on SMF 2.0 RC3.....I can enter form fields and other information.....but when I put the Form Output in and "Save", nothing that I typed into the "Form Output" block saves.  I have tested the form by going to "http://somethinghere.com/index.php?action=form;id=1", I can fill out the forms, and submit.  It posts a topic in the appropriate forum, but obviously since the Form Output never says, the topic ends up blank.

I CHMOD'd the CustomForm.template.php and CustomForm.php files to 755 to check to see if that fixed it, but it didn't.... (just was trying something).......

Where should I look for this issue?  What can I do? 

Also, is there any way to auto-create a Yes/No POLL after the form is submitted? 

Thanks in advance for any replies.

Are you using the WYSIWYG as your default editor?  If you are, be sure to hit the red A to change it back to the non-WYSIWYG editor before hitting save.  Try that.  And yes, you will need to do this each time you go in and make a form if you are defaulted with the WYSIWYG.  I reported this problem many many pages ago and have restated this every time someone brings it up.  I don't think it has been corrected, yet, if this is the problem you are experiencing.  Give me a second and I will post the link to where it is discussed here.


Originally brought up posts #294 & 295
Then again in posts #509-510
Then again in posts #746 + 748-752 + 754

Thank you.....I skipped some pages and missed those........(doing some skimming as there was A LOT to read - *facepalm*)
Title: Re: Custom Form Mod
Post by: C4G-TK on May 07, 2010, 12:34:24 AM
It seems to be brought up again every 200 posts or so.. lol
I only know about the bug because I brought it up under my other name before I started another forum.

Hope it helps you until it gets fixed.  I know how frustrating it can be to work on your form and then BOOM it isn't there any longer whenyou save and have to do it over and over again. :o
Title: Re: Custom Form Mod
Post by: Vyache on May 08, 2010, 02:28:16 AM
Hello,

I mentioned my idea before, a few posts earlier, but I just want to reroute my form data into the sql database to be printed in a table of all the submissions of that particular form.

I'm trying to figure out how to redirect the information sent from the form by changing the variable $context['post_url'] to a url pointing to a php file that I created.

According to the customForm.template.php file the fields are sent as post method, so I was wondering if within my php I can create a table based on that info. However, the table columns (fields) would have to be passed as an array, I believe I have to use $_REQUEST['name']; The reason I think it should be an array is because I don't want to go back to that file to edit it each time I change to a different form.

This way it creates a table of w/e number of fields it needs.

I'm stuck at the part where how to stop the post from making a thread on the actual form and parsing the array of fields to create a actual table in the sql database.

Any idea's on how to do this ?

I'd appreciate any help,
thank you!

Title: Re: Custom Form Mod
Post by: rienholt on May 12, 2010, 11:48:25 PM
Hello,
Thanks for the great mod guys it works really well for what I need. I just ran into a little snag when I tried to do a bit of customization work o the forum.
Whenever I turn on "Enable customized message icons:" I get this error when trying to create a new form or edit an old one:

You 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: <root>/forum/Sources/ModSettings.php
Line: 627


I am using 1.1.11 and the error even with no other mods installed. If anyone has any ideas or fixes they would greatly appreciated.
Title: Re: Custom Form Mod
Post by: fyndler on May 17, 2010, 09:14:10 AM
My problem or maybe i made it wrong, got it like this for example

Title     Text     Type     Modify
name    Your name    Large (Multiline) Text Box

But when i submit it, it only says for exmaple 55 years in the forum post, the question isent there :/


Second problem seems to have is that all my post i made is not counted anymore :/ Set to 0 for some reason, made a fresh new smf forum made 2 forum rules post, installed the mods, my profile says 0 posts :/ Any ideas ?

*edit*

btw is there a way to make so the name off the topic is the posters username ?
Title: Re: Custom Form Mod
Post by: AK_CCM on June 06, 2010, 03:27:44 AM
Hello,

at first much thanks to the programmers - the mod is very useful.

It would be great for a future version, if users could group fields for a more user-friendly input mask. For example I use a form wich could be used by people to inform other users about fungus poisoning. I would like to group the location data of the toadstools such as country, federal state, regency, district, city or area and ecology. The next group could be the data about the fungi such as poisonous mushroom and the collected alleged edible fungus.

Another idea is to add a selection "post" to the option "Submit Redirect" so users could be redirected to the new topic, wich was generated by the data of the form.

At last a question: Does anyone know how to change a field into a required field?

After I changed the language from german to english a click of the icon with the question mark results help:
QuoteYou can also enter 'required' in the Extra Type Parameters field which will force the user to enter valid data for this field before the form  will submit.
Title: Re: Custom Form Mod
Post by: AK_CCM on June 06, 2010, 02:06:12 PM
I found a little bug: If I want to edit the text of a form field and the content contains quote signs:

Quote<b>Country:</b><br>e.g. "Germany" oder shortly "D"

...the text after the first quote sign is cutted off:

Quote<b>Country:</b><br>e.g. "
Title: Re: Custom Form Mod
Post by: AK_CCM on June 06, 2010, 05:33:36 PM
It seems that CFM ignores the activated post moderation of the boards in wich the new topics will be saved.

How could I use the post moderation? Because it's important that we could do a sanity and privacy check of the transmitted data before the topics go online.
Title: Re: Custom Form Mod
Post by: AK_CCM on June 07, 2010, 03:07:56 AM
Quote from: AK_CCM on June 06, 2010, 05:33:36 PM
How could I use the post moderation?

Sorry, I haven't read the post from Garou (http://www.simplemachines.org/community/index.php?topic=248871.msg2502955#msg2502955) before.
After I did the changes in the ./Sources/CustomForms.php the post moderation works fine. :)
Title: Re: Custom Form Mod
Post by: bgroins on June 12, 2010, 07:27:13 PM
I was thinking about making a custom form that outputs the result to action=search2 instead of a forum post.  Any idea on how I could achieve that?

Title: Error when I click on Add Form
Post by: dsantana on June 15, 2010, 09:30:04 PM
constraint failed

File: /home/content/51/5932751/html/hitandrun/Sources/ManageSettings.php
Line: 2533

Little help please? Anyone? Any idea why this fails?

I've attached the ManageSettings.php file

Thanks
Title: Re: Custom Form Mod
Post by: edu_9230 on June 21, 2010, 08:36:49 AM
Hi i have a SMF v1.1.11 forum and i have tried to install this mod using "CustomFormMod_v1.6_SMF1.1.x" & "CustomFormMod_v1.1_SMF1.1.5" but i can´t insrtall it!

Quote from: SMFThe package you are trying to download or install is either corrupt or not compatible with this version of SMF

How can i install it succesfully in my forum?
Title: 2nd request...Little help please?
Post by: dsantana on June 22, 2010, 01:11:06 PM
constraint failed

File: /home/content/51/5932751/html/hitandrun/Sources/ManageSettings.php
Line: 2533

Little help please? Anyone? Any idea why this fails?

I've attached the ManageSettings.php file

Thanks
Title: Re: Custom Form Mod
Post by: Raths Rants on June 30, 2010, 09:17:04 AM
I think this mod is great and I finally got it to work. Was making some simple errors.

However I have another problem. The link to my form works correctly with Firefox but not Internet Explorer.

The link will simply not display when viewed in Internet Explorer.

I am currently running SMF 2.0 RC3, SimplePortal 2.3.2 & Stealth theme.

Thanks in advance.
Title: Re: Custom Form Mod
Post by: Phoestre on July 01, 2010, 10:58:06 AM
Hello guys, is there a way to make a radio selection required?
When you write "required" in the extra parameters, it also shows up in the selections. Althought the radio selections becomes required at the cost of having "required" as a radio button :)
I searched thru the forums but can't find anything related to this. I'm trying to make a support form where you select category of your support request.
Thanks
Title: Re: Custom Form Mod
Post by: Raths Rants on July 01, 2010, 12:11:42 PM
Quote from: rathsrants on June 30, 2010, 09:17:04 AM
I think this mod is great and I finally got it to work. Was making some simple errors.

However I have another problem. The link to my form works correctly with Firefox but not Internet Explorer.

The link will simply not display when viewed in Internet Explorer.

I am currently running SMF 2.0 RC3, SimplePortal 2.3.2 & Stealth theme.

Thanks in advance.

I goofed up on the permissions. It seems this was not an issue with the browsers. I messed with it for a while last night and finally figured out what happened.

The permission level to view the form page itself is different from the permission to view the form. You have to set it correctly for each area.
Title: Re: Custom Form Mod
Post by: dsantana on July 01, 2010, 12:39:56 PM
I'll take a look at that too
Title: Re: Custom Form Mod
Post by: Raths Rants on July 02, 2010, 10:47:50 AM
What I did was set Required as an option. Like on the pull down Selection Menus because I did not see a way for setting a selection to "BLANK".

So I set the options to Required, No, Yes for the multiple select areas forcing the use to interact with the form correctly. So far it has worked out.
Title: Re: Custom Form Mod
Post by: dsantana on July 02, 2010, 02:49:51 PM
Quote from: rathsrants on June 30, 2010, 09:17:04 AM
I think this mod is great and I finally got it to work. Was making some simple errors.

However I have another problem. The link to my form works correctly with Firefox but not Internet Explorer.

The link will simply not display when viewed in Internet Explorer.

I am currently running SMF 2.0 RC3, SimplePortal 2.3.2 & Stealth theme.

Thanks in advance.

I get this error when trying to add a new form
Title: Re: Custom Form Mod
Post by: Raths Rants on July 02, 2010, 03:47:23 PM
The mod adds an area where all forms are shown.

This has it's own permission.

Then each form has it's own permission. You have to set it when you are editing that form. The problem I was having was not with the browser but with the permissions not being set correctly.

As an Admin I did not catch it till I was in the testing phase to make sure everything was working using a dummy account.
Title: Re: Custom Form Mod
Post by: Taija299 on July 05, 2010, 09:01:03 PM
I just wanted to say thank you.  :)  I'm about to start a role-playing game within my Watership Down forums and this mod is the perfect way to let the members submit information about their characters.

I've noticed some bugs, like when I create a new field it sometimes creates another empty field along with it, but nothing that really bothers me.
Title: Re: Custom Form Mod
Post by: Bugo on July 15, 2010, 07:14:31 AM
@Nathaniel, I propose to add (in next version of this modification) the button in the main menu and the ability to change the name of this button. The screenshot below will explain what I mean. Also quote the code with necessary changes to SMF 2.x:


<file name="$sourcedir/ManageSettings.php">
<operation>
<search position="before"><![CDATA[array('text', 'CustomForm_view_text'),]]></search>
<add><![CDATA[
array('text', 'CustomForm_view_button'),]]></add>
</operation>
</file>

<file name="$sourcedir/Subs.php" error="skip">
<operation>
<search position="after"><![CDATA[
'mlist' => array(]]></search>
<add><![CDATA[
'forms' => array(
'title' => !empty($modSettings['CustomForm_view_button']) ? $modSettings['CustomForm_view_button'] : $txt['CustomForm_forms'],
'href' => $scripturl . '?action=form',
'show' => allowedTo('CustomForm_view_perms'),
'sub_buttons' => array(
),
),]]></add>
</operation>
</file>

<file name="$languagedir/Modifications.english.php">
<operation>
<search position="end" />
<add><![CDATA[
$txt['CustomForm_forms'] = 'Forms';
$txt['CustomForm_view_button'] = 'View Form Button';
]]></add>
</operation>
</file>

<file name="$languagedir/Modifications.english-utf8.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
$txt['CustomForm_forms'] = 'Forms';
$txt['CustomForm_view_button'] = 'View Form Button';
]]></add>
</operation>
</file>


By analogy, there is a code for SMF 1.x below:
<file name="$sourcedir/ModSettings.php">
<operation>
<search position="replace"><![CDATA[updateSettings(array('CustomForm_view_title' => $_REQUEST['view_title'], 'CustomForm_view_text' => $_REQUEST['view_text']));]]></search>
<add><![CDATA[updateSettings(array('CustomForm_view_title' => $_REQUEST['view_title'], 'CustomForm_view_text' => $_REQUEST['view_text'], 'CustomForm_view_button' => $_REQUEST['view_button']));]]></add>
</operation>
</file>

<file name="$themedir/index.template.php">
<operation>
<search position="after"><![CDATA[
// the [member] list button
]]></search>
<add><![CDATA[
// the [form] button
global $modSettings;
if (allowedTo('CustomForm_view_perms'))
echo ($current_action == 'form' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'form' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=form">' , !empty($modSettings['CustomForm_view_button']) ? $modSettings['CustomForm_view_button'] : $txt['CustomForm_forms'] , '</a>
</td>' , $current_action == 'form' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
]]></add>
</operation>
</file>

<file name="$themedir/CustomForm.template.php">
<operation>
<search position="before"><![CDATA[<tr>
<td class="windowbg2" valign="top" width="16"><a name="setting_view_text" href="', $scripturl, '?action=helpadmin;help=CustomForm_view_text" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.gif" alt="', $txt[119], '" border="0" align="top" /></a></td>
<td class="windowbg2" valign="top"><label for="view_text">', $txt['CustomForm_view_text'] , '</label></td>
<td class="windowbg2" width="50%">
<input type="view_text" name="view_text" id="subject" value="', isset($modSettings['CustomForm_view_text']) ? $modSettings['CustomForm_view_text'] : '', '" />
</td>
</tr>]]></search>
<add><![CDATA[
<tr>
<td class="windowbg2" valign="top" width="16"></td>
<td class="windowbg2" valign="top"><label for="view_button">', $txt['CustomForm_view_button'] , '</label></td>
<td class="windowbg2" width="50%">
<input type="text" name="view_button" id="view_button" value="', isset($modSettings['CustomForm_view_button']) ? $modSettings['CustomForm_view_button'] : '', '" />
</td>
</tr>]]></add>
</operation>
</file>

<file name="$languagedir/Modifications.english.php">
<operation>
<search position="end" />
<add><![CDATA[
$txt['CustomForm_forms'] = 'Forms';
$txt['CustomForm_view_button'] = 'View Form Button';
]]></add>
</operation>
</file>

<file name="$languagedir/Modifications.english-utf8.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
$txt['CustomForm_forms'] = 'Forms';
$txt['CustomForm_view_button'] = 'View Form Button';
]]></add>
</operation>
</file>
Title: Custom Form Mod not triggering SMF notifications
Post by: brbeaird on July 21, 2010, 02:31:58 PM
I've done a lot of searching to try to see if I'm missing something obvious, but so far I haven't found anything.

I've got a SMF Custom Form set up which creates a post in a topic.  I have a forum user account set up to receive e-mail notifications on that board when new topics are created.  If I manually create a topic, I get an e-mail.  However, if I fill out my custom form so that it creates a topic, the notification is apparently not triggered and I never get an e-mail.  Is anyone else trying to do this?

All I'm really looking for is to get an e-mail when someone submits a form.  I thought the easiest way would be to just use the built-in board topic notifications with SMF.  Is there some other way I should be doing this?
Title: Re: Custom Form Mod
Post by: fionax on July 26, 2010, 03:04:37 PM
I love love love this mod! We are using it for applications to our RPG, which it is perfect for.

The only issues we have thus far is that we have it where it goes directly into an admin only area, so the person posting never sees the final outcome since the board is off limits to them. We were wondering if there was a way to add/hack some changes...

1. If we could have it do a preview of the post before they send it.

2. If there is a way to have a PM sent that lets them know it has been sent to an admin board. Or a pop up... or anything really. We are not code savvy people :S

Running 2.0 RC3
Title: Re: Custom Form Mod
Post by: MarcusJ on July 26, 2010, 04:32:02 PM
Quote from: fionax on July 26, 2010, 03:04:37 PM
2. If there is a way to have a PM sent that lets them know it has been sent to an admin board. Or a pop up... or anything really. We are not code savvy people :S

For this one you can simply make a page/post to redirect to which explains the application process to them, and lets them know the application is in a private area.
Title: Re: Custom Form Mod
Post by: Snuffsis on July 31, 2010, 10:35:29 AM
Hi,
I've been trying to make an application for a guild, but i'm running into some problems with this form.
When i'm trying to make a selection box(i think it's the one i should use) with a drop down menu so that applicants can choose from a multiple of different races and classes. But it doesn't really work, anyone know how to fix this, or am i choosing the wrong type for it?

EDIT: Figured it out, but now i'm running into some other wierd problem.
It keeps saying "Required field" whenever i have any kind of selection box in the form. If i remove them i don't get a problem, but as soon as i put them in there, i can't submit the form to the forum. Why is this happening, anyonw knows?

The text i'm trying to put in there is this.
Alchemy, Blacksmithing, Enchanting, Engineering, Herbalism, Inscription, Jewelcrafting, Leatherworking, Mining, Skinning, Tailoring
Title: Re: Custom Form Mod
Post by: Camealion on July 31, 2010, 03:43:13 PM
Quote from: Snuffsis on July 31, 2010, 10:35:29 AM
Hi,
I've been trying to make an application for a guild, but i'm running into some problems with this form.
When i'm trying to make a selection box(i think it's the one i should use) with a drop down menu so that applicants can choose from a multiple of different races and classes. But it doesn't really work, anyone know how to fix this, or am i choosing the wrong type for it?

EDIT: Figured it out, but now i'm running into some other wierd problem.
It keeps saying "Required field" whenever i have any kind of selection box in the form. If i remove them i don't get a problem, but as soon as i put them in there, i can't submit the form to the forum. Why is this happening, anyonw knows?

The text i'm trying to put in there is this.
Alchemy, Blacksmithing, Enchanting, Engineering, Herbalism, Inscription, Jewelcrafting, Leatherworking, Mining, Skinning, Tailoring

In the Extra Type Parameters field you would put....

Alchemy,Blacksmithing,Enchanting,Engineering,Herbalism,Inscription,Jewelcrafting,Leatherworking,Mining,Skinning,Tailoring

Separated by just comma's no spaces.
Title: Re: Custom Form Mod
Post by: Snuffsis on July 31, 2010, 05:10:30 PM
Quote from: Camealion on July 31, 2010, 03:43:13 PM
Quote from: Snuffsis on July 31, 2010, 10:35:29 AM
Hi,
I've been trying to make an application for a guild, but i'm running into some problems with this form.
When i'm trying to make a selection box(i think it's the one i should use) with a drop down menu so that applicants can choose from a multiple of different races and classes. But it doesn't really work, anyone know how to fix this, or am i choosing the wrong type for it?

EDIT: Figured it out, but now i'm running into some other wierd problem.
It keeps saying "Required field" whenever i have any kind of selection box in the form. If i remove them i don't get a problem, but as soon as i put them in there, i can't submit the form to the forum. Why is this happening, anyonw knows?

The text i'm trying to put in there is this.
Alchemy, Blacksmithing, Enchanting, Engineering, Herbalism, Inscription, Jewelcrafting, Leatherworking, Mining, Skinning, Tailoring

In the Extra Type Parameters field you would put....

Alchemy,Blacksmithing,Enchanting,Engineering,Herbalism,Inscription,Jewelcrafting,Leatherworking,Mining,Skinning,Tailoring

Separated by just comma's no spaces.
Tried this, i'm still getting the "Required field" error, and it's only with that selection box, i can use selection boxes for class and race, so it's very wierd this, because there is another site that has the very same thing and it works for them.
Title: Re: Custom Form Mod
Post by: Camealion on July 31, 2010, 05:12:47 PM
Are you getting the error when you're saving/editing the block or when you are submitting a form?
Title: Re: Custom Form Mod
Post by: Snuffsis on July 31, 2010, 05:14:59 PM
Quote from: Camealion on July 31, 2010, 05:12:47 PM
Are you getting the error when you're saving/editing the block or when you are submitting a form?
When i'm trying to submit a form.
Title: Re: Custom Form Mod
Post by: Camealion on July 31, 2010, 05:36:56 PM
When you submit you form where does the red * show up at?
Title: Re: Custom Form Mod
Post by: Spoogs on July 31, 2010, 05:38:25 PM
Take out the word required from your list of options. I had this same problem. Just put the list of options and hope your users know its a required field.. most will fill it out just because its there.
Title: Re: Custom Form Mod
Post by: Snuffsis on July 31, 2010, 05:40:27 PM
Quote from: Camealion on July 31, 2010, 05:36:56 PM
When you submit you form where does the red * show up at?
At the bottom where it says "*Required Field"
Quote from: Spoogs on July 31, 2010, 05:38:25 PM
Take out the word required from your list of options. I had this same problem. Just put the list of options and hope your users know its a required field.. most will fill it out just because its there.
I've done that, there is no "Required" for any of the options i got, that's why it's so strange.
Title: Re: Custom Form Mod
Post by: bros on August 03, 2010, 03:12:52 PM
Requesting a feature for the next version of the mod - any chance that a permission could be added so that I can make it so a person can admin the custom forms?
Title: Re: Custom Form Mod
Post by: fionax on August 04, 2010, 05:54:47 PM
I dunno man, I think the makers of the forms are MIA and not planning on doing another version (At least that is what one of their posts said)

If they do though, I would like to make the suggestion of having a preview button >>
Title: Re: Custom Form Mod
Post by: Raths Rants on August 06, 2010, 03:44:24 PM
I was trying to get a colored output. When a person fills out the form depending on what they select I want it to be a specific color based on their selection.

I have chosen {select_object}

However on the form in the pull down menu of the selection window it will display as [color=red]Object 1[/color].

Is there a way to hide the coding on the pull down selection menu and still post correctly to the forum.

Object 1
Object 1
Object 1
Object 1

I fiddled with some of the HTML tags but they seem to break the selection field.
Title: Re: Custom Form Mod
Post by: cosoa on August 10, 2010, 01:52:47 AM
I don't know if this is even possible, but in the future I would really love for there to be a way to make certain html/text conditional depending on the existence of input. For example, if a user leaves a field blank, certain text will not be posted. (I have a Nickname box; if there's no nickname entered, it still prints "Nickname:" and nothing after it.)

If I had my druthers I would make it behave a bit like the custom profile fields; each field has its own unique surrounding html/text. If each individual Custom Form option had this feature, and I could specify the surrounding html, then plug the entire thing into the main form output box with {optionname}, it would only show up if someone entered something into the input box. This way, if someone leaves a field blank, it doesn't print the surrounding html/text at all, everything looks neat and tidy, etc.

Just a thought! I was wondering if this sort of thing was already possible with the extra type parameters. There's an option for a conditional string if the field is left empty, but none for a string that prints only if there IS something entered into the field.
Title: Re: Custom Form Mod
Post by: Raths Rants on August 10, 2010, 10:53:37 AM
I think the real issue comes back to the limitations of posting HTML code inside a forum post.

The setup is in HTML with the final output being in BBC code.

One of the tricks I used for the {input} field is use a basic naming structure.

So if I wanted to display a specific picture I would setup a selection field. The naming setup would be rw_{picname}.jpg. This would limit the input a user could supply helping prevent them from breaking the final output field.

[img]http:www.yourdomain.com/images/rw_{picname}.jpg[/img]

The selections would be "This Picture", "That Picture" and the file names would be rw_This Picture.jpg and rw_That Picture.jpg as an example.

As my above post I tried putting HTML code in the selection field and it seems to break it. Perhaps I am not doing the coding correctly.

This would be a work around for you cosoa. You might try that.
Title: Re: Custom Form Mod
Post by: thellie on August 18, 2010, 05:34:11 AM
i'm interested in using this mod, but before i convert my existing form, spending hours creating new fields, i have a question...

can i use dynamic data in the fields, and if so how? i mean can i create menu lists based on data from mysql tables?

the add field boxes seem pretty basic, so i'm wondering if this is just for simple forms, and i would do better to convert my existing form and drop it into a simpleportal page?

i'll probably use this for things like the terms and conditions 'i agree' page, but at first glance, it doesn't seem versatile enough for what i want...
Title: Re: Custom Form Mod
Post by: thellie on August 24, 2010, 01:27:18 AM
can this be adapted so that the entered data is put into custom fields (created by me) in the smf_members table?

i currently have an application form, as well as a number of others, and am struggling to adapt the coding in those to do this update. if the above is possible, the it may be worth my while to create new versions of the forms instead of trying to recode the old ones...

i have been at that for days now and getting nowhere with it  :'(
Title: Re: Custom Form Mod
Post by: Nekrotik on August 28, 2010, 01:26:15 PM
Quote from: Snuffsis on July 31, 2010, 05:40:27 PM
Quote from: Camealion on July 31, 2010, 05:36:56 PM
When you submit you form where does the red * show up at?
At the bottom where it says "*Required Field"
Quote from: Spoogs on July 31, 2010, 05:38:25 PM
Take out the word required from your list of options. I had this same problem. Just put the list of options and hope your users know its a required field.. most will fill it out just because its there.
I've done that, there is no "Required" for any of the options i got, that's why it's so strange.

I'm doing exactly what you're doing with no issues. That is to say, I'm using a form to have people apply to my WoW guild and I'm using a drop down box for professions.
Title: Re: Custom Form Mod
Post by: Nekrotik on August 29, 2010, 04:16:15 PM
Quote from: cosoa on August 10, 2010, 01:52:47 AM
I don't know if this is even possible, but in the future I would really love for there to be a way to make certain html/text conditional depending on the existence of input. For example, if a user leaves a field blank, certain text will not be posted. (I have a Nickname box; if there's no nickname entered, it still prints "Nickname:" and nothing after it.)

Or even better than the existence would be context depending fields.

If someone selected "druid" from a list of wow class types, the following box would have the options "Feral,Restoration,Balance", but if they picked "hunter", the following box would have the options "Marksman,Survivalist, Beast Mastery".
Title: Re: Custom Form Mod
Post by: Nekrotik on August 29, 2010, 04:27:39 PM
Quote from: Defenestrate on March 13, 2010, 07:22:04 PM
I'm using Padexx's WoW-DK theme on 1.1.11. It seems that the theme breaks the mod. When it's installed and I go to setup page, I have no text at all. Just a couple blank boxes. Has anyone else had this problem with other themes? And is there an easy fix for this problem.
I have the same problem with the same theme. I simply change the theme that i'm using to the core them, make all the forms I want, and then change back.
Title: Re: Custom Form Mod
Post by: Angelotus on September 03, 2010, 06:19:02 AM
Hi, is there a way to add the visual verification to the forms? I know how to add it, but I don't know where. In the customform.template.php file I can't find the form;id= template where to add it.
Title: Re: Custom Form Mod
Post by: Grim Line on September 08, 2010, 05:20:17 PM
When i try to add the checkbox option and i add 20 options to choose from nothing comes up but 1 checkbox with no writing.
Title: Re: Custom Form Mod
Post by: Zirc on September 10, 2010, 07:54:55 PM
Okay I searched this topic for my question but I didn't find it, if this issue has been answered already I apologize.  I use this on my SMF 1.1.11 forums currently and it works great.  I am currently setting up and testing an SMF 2.0 RC3 forums and have installed version 1.6 of this mod but when I click on the Add New Form button I get the following error.

Database Error
Field 'title' doesn't have a default value
File:  \test\Sources\ManageSettings.php
Line: 2506

Not sure what I need to do to fix it.
Thanks
Title: Re: Custom Form Mod
Post by: FragaCampos on September 12, 2010, 07:35:01 PM
This mod was abandoned by it's authors, so it's going to be difficult to get help...
Title: Re: Custom Form Mod
Post by: Zirc on September 12, 2010, 08:33:08 PM
Well I guess I'll have to wait and hope that somebody has a solution to the problem since this is pretty much and integral part of my guild website.  New members need to submit an application and I'd rather do it through forms so that they get submitted to an Admin only board and not a public one.  This was a great mod and I've used it alot in 1.1.11 and there isn't another one that I've seen that has the same functionality.
Title: Re: Custom Form Mod
Post by: Zirc on September 12, 2010, 09:23:23 PM
Well it seems I found the problem.  I was looking at the database entry from the 1.1.11 version that I have and in the cf_forms table all the entries except for the first one (id_form) should be Null: Yes and Default: Null which was not the case if you look at the attached screenshot I took before I modified the tables.  Everything seems to be working just fine now.
Title: Re: Custom Form Mod
Post by: uninvited13th on September 20, 2010, 11:06:59 PM
when i run the install.php it gives me an error..

QuoteFatal error: Function name must be a string in /xxxxxxxxx.xxx/install.php on line 53


im using 2.0rc3
Title: Re: Custom Form Mod
Post by: cddude on October 13, 2010, 05:25:06 AM
Hi there.

Im getting an error when clicking on my form at index.php?action=form. I get the following error code:


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


This happens when trying to load the page index.php?action=form;id=1

After a quick search on google, I found a website suggesting to change all

;id to &id.

Which worked and took me to the next page with the form it self. Unfortunatly, the submit button links to a page with ;id instead of &id.

I then decided to open my ftp client and edit the CustomForm.php and CustomFormTemplate.php files and changed all ;id into &id, but that did not help much.
The submit button worked after this quick editing, but on the board where the stuff are posted, the topic says {First Name} instead of the First Name I typed at index.php?action=form&id=1.
And if I make the field required, even if I actually type something in the filed, it says "field required" and won't continue, or post.

I even talked to my hosting support, and asked them to inactivate mod_security, but that didnt help either.

My question is if anyone could tell me how to fix this, or if the mod could be reuploaded with this problem taken care of.

Thanks!
Title: Re: Custom Form Mod
Post by: HostDash on October 13, 2010, 05:53:50 AM
Awesome mod.

And awesome its SMF 2.0 RC3 compatible :).
Title: Re: Custom Form Mod
Post by: TheDeath on October 13, 2010, 07:54:37 AM
Hello

i have found a bug.


8: Undefined index: 60
Apply Filter: Only show the errors from this file
File: /var/www/web6/html/pmt/Sources/ManageSettings.php
Line: 3348


in


function list_CustomForms()
{
...
...
// Go through every form.
While($row = $smcFunc['db_fetch_assoc']($request))
{
// Create a list of the groups which can use this form.
$permissions_string = $txt['admin'];
if(isset($permissions['custom_forms_'.$row['id_form']]))
foreach($permissions['custom_forms_'.$row['id_form']] as $membergroup_id)
$permissions_string .= ', '.$membergroups[$membergroup_id];


Cause is membergroup_id is the id from a "Post count based groups".


and another error is this:


8: Undefined variable: board
Datei: /var/www/web6/html/pmt/Sources/ManageSettings.php
Zeile: 3004



function CustomFormSettings($return_config = false)
{
..
..
         $context['categories'][$row['id_cat']]['boards'][] = array(
            'id' => $row['id_board'],
            'name' => strip_tags($row['name']),
            'category' => strip_tags($row['cat_name']),
            'child_level' => $row['child_level'],
            'selected' => !empty($_SESSION['move_to_topic']) && $_SESSION['move_to_topic'] == $row['id_board'] && $row['id_board'] != $board,
         );
..
..


I hope everyone can help me.
Title: Re: Custom Form Mod
Post by: TheSniperK2R on October 22, 2010, 10:08:48 AM
Ok i ran into a quick problem, the forum looks and works great, the redirect works fine but i found when i hit submit.. it does post a new topic in a section but the topic is empty and dosent contain any of the custom forum anwsers users filled out? its just blank, how do i fix this issue?
Title: Re: Custom Form Mod
Post by: colby2152 on October 27, 2010, 01:35:07 PM
Quote from: TheSniperK2R on October 22, 2010, 10:08:48 AM
Ok i ran into a quick problem, the forum looks and works great, the redirect works fine but i found when i hit submit.. it does post a new topic in a section but the topic is empty and dosent contain any of the custom forum anwsers users filled out? its just blank, how do i fix this issue?

I assume you entered in the correct functions and filled out the title?
Title: Re: Custom Form Mod
Post by: colby2152 on October 27, 2010, 03:07:41 PM
Any clue how I can make a custom search form to look for input items, within the specified board, based on this form?
Title: Re: Custom Form Mod
Post by: Galatea on October 28, 2010, 03:17:38 AM
Quote from: cddude on October 13, 2010, 05:25:06 AM
Hi there.

Im getting an error when clicking on my form at index.php?action=form. I get the following error code:


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


This happens when trying to load the page index.php?action=form;id=1
**snippity snip**

I encountered this bug tonight and have hacked together a workaround that revived the form for me.  My hypothesis was that mod_security was choking on the call for a GET var named "id", so I changed all instances to "gid" and it seems to have solved the problem for now.  If your host has configured the regexes in mod_security differently, "gid" may not work, so you might have to go further afield and try something wacky like "myform".

In CustomForm.php:

Find on line 29:

if(isset($_REQUEST['id'])
&& intval($_REQUEST['id']))
{
$form_id = intval($_REQUEST['id']);


and replace with:

if(isset($_REQUEST['gid'])
&& intval($_REQUEST['gid']))
{
$form_id = intval($_REQUEST['gid']);


Also find on line 363:

$context['post_url'] = $scripturl.'?action=form;id='.$form_id.';submit;';


And replace with:

$context['post_url'] = $scripturl.'?action=form;gid='.$form_id.';submit;';


Then, in CustomForm.template.php on line 198, find:

<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['view'] , '</a>
</td>
</tr>';


and replace with:

<tr class="windowbg">
<td style="padding:4px;" >
<a href="' , $scripturl , '?action=form;gid=' , $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;gid=' , $form['id'] ,'">' , $txt['view'] , '</a>
</td>
</tr>';


If you've made edits to your MessageIndex Template to point to a certain form by default, you'll want to change the ;id var to ;gid over there as well.
Title: Re: Custom Form Mod
Post by: shaenn on November 05, 2010, 12:04:25 AM
Looks like a great mod but is there a site where I can give it a test drive? It was posted way back on page one that there would be a demo website but after going through 62 pages I did not see it brought up again, sorry if I missed it.
Title: Re: Custom Form Mod
Post by: Vakiel on November 05, 2010, 08:40:23 AM
Anyone know of a way to make this mod work with 1.1.12?   I'm in the process of finishing up my forums, and would love the ability to create a custom template for user input.. ie, application template like.   Unless I'm missing another venue or option for making something like that.

Title: Re: Custom Form Mod
Post by: GohighVoltage on November 05, 2010, 10:37:55 AM
Will this work with RC4
Title: Re: Custom Form Mod
Post by: Makar on November 05, 2010, 04:52:27 PM
how to add verification of captcha and control question when is a form filled by guests ?

how to send forms filled by guests on pre-moderators ?


now mod is ignored all tuning of division
and captcha in general is not foreseen
Title: Re: Custom Form Mod
Post by: Thakrage on November 08, 2010, 06:50:55 AM
I have got this working on RC4 with no problems except one. - Checkboxes always return false (no) regardless of if they are checked or not.

EDIT: Radiobuttons don't work either.

EDIT#2: Seems I was wrong. The checkboxes and radiobuttons DO work after all.
But I had to delete the fields and add them again to make them work. If you just change the type, they won't work.

SMF 2.0 RC4
Title: Re: Custom Form Mod
Post by: Gwydion Frost on November 08, 2010, 01:37:49 PM
So, yeah. everything installed as the 2RC3 is supposed to, except... yeah. Look at the pic. Apparently, I cannot edit nor create new ones. I did this on a clean install that had never seen this mod before, so.... yeah, it's not priors uninstalling correctly.

Any clue why only the mod settings are appearing but not the options to actually use the mod minus the prior test form created..?
Title: Re: Custom Form Mod
Post by: Illori on November 08, 2010, 01:46:30 PM
did you need to do any manual edits of your theme to apply the mod? Looks like some edits got missed. if you try out on the default theme does it work there?
Title: Re: Custom Form Mod
Post by: Gwydion Frost on November 08, 2010, 05:45:11 PM
Nope, here's the maddening part. I just went through every single edit of this mod, and checked to make sure everything was done.


It was.
Title: Re: Custom Form Mod
Post by: Illori on November 08, 2010, 05:48:09 PM
do you have the file CustomForm.template.php in your Themes/default folder? I am starting to run out of ideas on what could be wrong.
Title: Re: Custom Form Mod
Post by: Gwydion Frost on November 08, 2010, 06:33:05 PM
Okies, so.... just went through a second time. ENotify under ManageSettings kinda overlapped it. Well, the db ending to ENotify.

So, separated them. I can see it now, but here's the strange part... the forms listing, rather than be directly below the Settings...?

Yeah, WAAAAAAAAAY down, near the copyrights.

Why...?
Title: Re: Custom Form Mod
Post by: Illori on November 08, 2010, 07:46:11 PM
does it do this under the default smf theme or just your custom theme?
Title: Re: Custom Form Mod
Post by: Spacecadet on November 11, 2010, 12:14:50 PM
Can someone expand on this comment please?

"The permission level to view the form page itself is different from the permission to view the form. You have to set it correctly for each area."

I don't understand how to see the list of form that I have created.

Title: Re: Custom Form Mod
Post by: Spacecadet on November 12, 2010, 03:08:13 PM
I know the authors don't check this thread anymore but does anyone know why i don't have a custom forms link on my index page?? or Where i cand link to the forms without the button on main page? I only have 1 form.
Title: Re: Custom Form Mod
Post by: king kratos on November 12, 2010, 03:17:14 PM
Quote from: Spacecadet on November 12, 2010, 03:08:13 PM
I know the authors don't check this thread anymore but does anyone know why i don't have a custom forms link on my index page?? or Where i cand link to the forms without the button on main page? I only have 1 form.

http://www.yourdomain.com/index.php?action=form

Note the ?action=form as that is how you get to the list of your forms. Then, click on the form and when it is open, copy the address. You then can just add a board that is a redirect to that address.

Kratos
Title: Re: Custom Form Mod
Post by: Spacecadet on November 12, 2010, 03:28:43 PM
Sweet thanks! I have been asking for days. I did that and got a list but there is nothing on it?? yet in the create forms area i see it. Strange.
Title: Re: Custom Form Mod
Post by: Spacecadet on November 12, 2010, 06:01:37 PM
All i see on the forms page is "This list is currently empty." Yet I have created the form and see it in the admin, edit forms area???
Title: Re: Custom Form Mod
Post by: Illori on November 12, 2010, 07:03:14 PM
did you grant a member group permission to view the form?
Title: Re: Custom Form Mod
Post by: Spacecadet on November 12, 2010, 08:25:26 PM
There are 2 diffrent permission settings right? One in the main area where you create forms and the other in the actual form. 3 check boxes right? I have all checked except for Guests. Plus I'm an admin which by default is auto aproved right? What am i missing?
Title: Re: Custom Form Mod
Post by: Spacecadet on November 13, 2010, 01:26:54 AM
OMG I'm going to lose my mind! Are there any permissions outside the mod itself that maybe I haven't seen? Non of the forms are visible, I have tried every kind of account from Guest to Administrator and no success. All I see is:

"This list is currently empty."

I have checked all the boxes in both the form itself and the MOD.
Title: Re: Custom Form Mod
Post by: Spacecadet on November 13, 2010, 04:43:03 PM
Ok got it working. I'm going to post this because I want everyone who comes after me not to have to read 60+ pages to figure this thing out even though most of you probably know already.

This is an example of how it is possible to do everything wrong!

Here we go:

Don't use capitals in the title fields anywhere on the form,
or, the form will not show up at all.

When you are adding the text fields the text box cannot be empty,
or, the form will show up at all.

make sure you set both permissions in the actual mod itself and in each form you create,
or, you know.

And last but not least if you know nothing about PHP! LIKE ME!
To view the list of forms you created it should look like this in your address bar:

www.yourdomain.com/forumdirectory/index.php?action=form

After all that if your MOD still does not work, format the hard drive and start over. No don't I'm kidding. (you never know)

This is your brain  :) this is your brain after pissing around with this stinking MOD for 3 days  :o , any questions?
Title: Re: Custom Form Mod
Post by: Bugo on November 15, 2010, 04:48:01 PM
Quote from: Spacecadet on November 12, 2010, 03:08:13 PM
I know the authors don't check this thread anymore but does anyone know why i don't have a custom forms link on my index page?? or Where i cand link to the forms without the button on main page? I only have 1 form.
http://www.simplemachines.org/community/index.php?topic=248871.msg2703484#msg2703484
Title: Re: Custom Form Mod
Post by: Spacecadet on November 15, 2010, 11:34:55 PM
Thanks Bugo
Title: Re: Custom Form Mod
Post by: Meister GN006 on November 21, 2010, 05:23:13 PM
Is there anyway to modify the Text Box (String) width using the cols tag like the way its used to modify the Large Text Boxes as found in this post http://www.simplemachines.org/community/index.php?topic=248871.msg2229078;topicseen#msg2229078 ?
Title: Re: Custom Form Mod
Post by: loriac on November 30, 2010, 02:02:04 PM
Hello!

I have:

- SMF: 1.1.12
- Custom Forms: 1.6
- Mysql: 5.1.52

And the error I attached in the image!!!  :-\

this is my Modsettings.php  code

      // Array for all icons that need to revert to the default theme!
      $context['javascript_icons'] = array();

      if (($temp = cache_get_data('posting_icons-' . $board, 480)) == null)
      {
         $request = db_query("
            SELECT title, filename
            FROM {$db_prefix}message_icons
            WHERE ID_BOARD IN (0, $board)", __FILE__, __LINE__);
         $icon_data = array();


The 852 line is:

WHERE ID_BOARD IN (0, $board)", __FILE__, __LINE__);

can someone help me? There is an error with version mysql? I need this mod! Please :(
Title: Re: Custom Form Mod
Post by: C4G-TK on December 05, 2010, 02:09:56 PM
I used the most recent package for RC3 on my RC4 forum and it works as expected.
Installed cleanly and is functioning.
Title: Re: Custom Form Mod
Post by: rescue119 on December 28, 2010, 11:01:10 AM
i just installed and just finished making up the form and I have had to problems. First when I submitted a form and would show up in the forum i selected but there would be no subject title or subject body...........

second.......

now i get this

Database Error
You 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: /home/teamtffr/public_html/forums/Sources/ModSettings.php
Line: 562 


I am new to this so not sure what to do. I tried uninstalling the mod and reinstalling but still get this message.

I am using 1.1.12, TP 1.0 RC1, and using SMF web hosting
Title: Re: Custom Form Mod
Post by: StrangerWithin on December 28, 2010, 11:08:30 AM
Quote from: rescue119 on December 28, 2010, 11:01:10 AM
now i get this

Database Error
You 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: /home/teamtffr/public_html/forums/Sources/ModSettings.php
Line: 562 

Have you tried overwriting the problem file on your server?

If not, try FTP'ing a fresh copy of ModSettings.PHP from the original installation files and that could well fix it.

On another note,

Have installed this mod and have had no problems at all. However to access the forms menu I and anyone else would have to access the forms menu via the url http://mysite.co.uk/forum/index.php?action=form. So my question is, can I modify the New Topic tab to say, New Post and then alter the destination of the tab to point to the respective new form in other words make the tab point to http://mysite.co.uk/forum/index.php?action=form;id=1 so as when the tab is clicked it opens up the new form page ready to filled out.
Title: Re: Custom Form Mod
Post by: rescue119 on December 28, 2010, 11:26:05 AM
I tried reinstalling, deleting and using orginal modsettings.php file i have. Still get the same error
Title: Re: Custom Form Mod
Post by: rescue119 on December 28, 2010, 11:52:17 AM
Quote from: Garou on February 03, 2010, 09:59:53 AM
MeisterBruno, Some sites are having issues with icons and version 1.6 of the mod for 1.1.x.

in ./Sources/ModSettings.php find
      if (($temp = cache_get_data('posting_icons-' . $board, 480)) == null)
      {
         $request = db_query("
            SELECT title, filename
            FROM {$db_prefix}message_icons
            WHERE ID_BOARD IN (0, $board)", __FILE__, __LINE__);
         $icon_data = array();
         while ($row = mysql_fetch_assoc($request))
            $icon_data[] = $row;
         mysql_free_result($request);

         cache_put_data('posting_icons-' . $board, $icon_data, 480);
      }


Some people have had luck with changing
WHERE ID_BOARD IN (0, $board)", __FILE__, __LINE__);
to
WHERE ID_BOARD IN (0)", __FILE__, __LINE__);

Eammeny the line you posted is not part of this mod but Ill look at the file when I get home from work tonight. It looks like somewhere another line isnt closed properly.

ManageServer.php issues are part of an SMF bug not the this mod it should be fixed by the time 2.0 goes final.


this solution i found seems to have worked..............so far
Title: Re: Custom Form Mod
Post by: StrangerWithin on December 28, 2010, 11:56:35 AM
Fingers crossed then fella :)
Title: Re: Custom Form Mod
Post by: rescue119 on December 28, 2010, 12:07:20 PM
well so far so good. now back to my orginal problem of where the form is sent to after it is submitted.

I have it assigned to a recruitment forum. So after I submit it there will be a new post in that forum but there post has nothing in it. It says no subject in the top and the body is empty?

Title: Re: Custom Form Mod
Post by: StrangerWithin on December 28, 2010, 12:40:43 PM
Without a title I dont think it will work. Did you format the text field correctly with bracketed text?
Title: Re: Custom Form Mod
Post by: Meister GN006 on December 28, 2010, 01:46:24 PM
Quote from: rescue119 on December 28, 2010, 12:07:20 PM
So after I submit it there will be a new post in that forum but there post has nothing in it. It says no subject in the top and the body is empty?

Sounds as if you created the form fields but now you need to create the BB code for the form to actually post the information to the forum. You need to create the form field then you need to tell the form where and how to post the data. The form field is only for the html side of the mod. The form output field is what posts the data to your forum. Here are some screenshots of my own setup:

First create tags in the Form Field and as an example here are some of the tags I created, Ive highlighted the name tag as an example:

The parse_bbc command under the extra type parameters is so that the BB code I add into the form output is displayed correctly in the forum when the data is posted such as font size, color, etc. You can see what I mean in the 3rd screenshot below. The required command means they must fill out that area before submitting the form.



Then after your form fields are typed out you need to tell the mod how and where to put the form field answers in your forum. To have the data from a form field displayed in your forum post you must put the title of the form field item in { } tags as shown below:

So for the the questions to be displayed on the forum you must type out the question yourself and use the form field tag to display whatever answer the submitter gave.

You can even pull the form field answers and have it added to the subject line if you want as shown below:


Typically when I have to create new form fields I type them all out into notepad or notepad++ and the same with the Forum Output questions + form field tags.

Here is a thumbnail of a fullscreen shot for a better overview (i'd just embed the fullscreen shot link into the thumbnail but due to preposterous limitations of these forums I cant post a direct link until 10 posts have been logged so I put it into the code text tag):


http://nocturnalguild.info/misc/customformmod/form-mod-fullscreen.jpg

You can see what my form looks like by going to

http://nocturnalguild.info/forums/index.php?action=form;id=4

and the end result posted here

http://nocturnalguild.info/forums/index.php?board=4.0

Hope this helps  8)
Title: Re: Custom Form Mod
Post by: rescue119 on December 28, 2010, 03:39:04 PM
well i did all that stuff..........and it still doesnt show up in the forum i want it to .........it comes up blank with no subject and no body............

Title: Re: Custom Form Mod
Post by: Meister GN006 on December 28, 2010, 03:42:58 PM
If everything is blank you aren't formatting the Form Output correctly or you aren't requiring the text box to be filled in.

If the post isnt submitting to the correct forum you arent selecting the correct forum under "Board" in the Form Settings

If you are absolutely sure the above things are correct you most likely have an issue with permissions for your forum / Form Mod.

What are you permissions set for for the form itself?
Title: Re: Custom Form Mod
Post by: rescue119 on December 28, 2010, 03:54:54 PM
i have everything put in the same as yours.......i attached the screen shot of what the post looks like..........


as for formatting the Form Output. Is there code or something i have to put at the very beginning/end?

permissions are for the 3 that it lets me, on both the form mod settings and the form itself.....guest, member, global mod.
Title: Re: Custom Form Mod
Post by: Garou on December 29, 2010, 12:24:41 AM
rescue119, it sounds like you have an issue with another mod or this mod didn't install properly. In either case check your ./Sources/ModSettings.php against the manual install instructions for 1.1.12

http://custom.simplemachines.org/mods/index.php?action=parse;mod=1279;attach=122916;smf_version=1.1.12

Meister GN006, that is an awesome tutorial you have there, it should help out a lot of people. *big thumbs up*

StrangerWithin, I never found a good solution for overriding the new topic button. There is however a manual hack provided via FragaCampos and margarett that does the trick with a little of work. Its not the perfect solution and there's no way to actually put it in the mod as is, but it does work.

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

Title: Re: Custom Form Mod
Post by: rescue119 on December 29, 2010, 06:05:31 PM
thanks. I will let you know. the mods i have are the TinyPortal 1.102   and User Info In Place Of SMF Logo. thsoe are the only 2.......i will check though
Title: Re: Custom Form Mod
Post by: rescue119 on December 30, 2010, 05:09:25 PM
Well i went to that page.........looked at everything........found one thing off.........fixed it.........still no results..........same thing........
Title: Re: Custom Form Mod
Post by: Kris on January 01, 2011, 05:52:08 AM
Can a form be sent by mail to0?
Title: Re: Custom Form Mod
Post by: Tibbetts on January 22, 2011, 10:05:50 PM
I installed this mod, and it says it did so correctly.  However, there is no button or anything saying Apply nor a form to use.  I have SMF 2.0 RC4.


-Tibbetts
Title: Re: Custom Form Mod
Post by: Garou on January 23, 2011, 09:44:41 AM
There are no default forms, this mod lets you create your own. Look at the downloads page for the mod http://custom.simplemachines.org/mods/index.php?mod=1279

and this post for more information on how to create your forms.

http://www.simplemachines.org/community/index.php?topic=248871.msg2894255#msg2894255
Title: Re: Custom Form Mod
Post by: Tibbetts on January 23, 2011, 06:07:36 PM
Yes, I know about those links and have read them.  However, when I created my own, nothing showed hinting at a button for the form on the Tiny Portal page, nor the Forums page.

Could Tiny Portal be interfering?


-Tibbetts
Title: Re: Custom Form Mod
Post by: Garou on January 24, 2011, 12:56:51 AM
your_forum/index.php?action=form is where the form list for your users is located. If there are no forms located there then either a form has not been created properly or something went wrong with the install.

If you mean that there is no navigation button linking to that page where it says forum, messages, help search etc... There isn't one, the original author of the mod lists a reason someplace in this thread. If you want to add one then there are plenty of tutorials on how to create one throughout the SMF site, there is even a mod that will let you add them.
Title: Re: Custom Form Mod
Post by: Tibbetts on January 24, 2011, 12:44:52 PM
Oh cool!  Thanks for the help, bro! :D

I'll go look for those tutorials/mod now.


-Tibbetts
Title: Re: Custom Form Mod
Post by: Tibbetts on January 24, 2011, 01:34:14 PM
Still doesn't work.  Only option it shows is the where I ask for the name and the rest don't show up. :(


-Tibbetts
Title: Re: Custom Form Mod
Post by: Garou on January 25, 2011, 12:05:17 AM
Well the most common mistake people make when creating a form is with the naming conventions for the title field someplace. Be sure that are not using any capital letters, spaces, or special characters. The only special character that works is "_" in other words you could use a title like name, yourname, or your_name. Something like Your Name, YourName, Name, your/name will not work and can effect the form in a variety of ways.

Some sites will have problems with numbers in the title as well. Usually this can be fixed by making sure there is some alphabetic character before the numeral.   for instance 1, 2, 3.. may not work but a1, a_1 might and one, two, three will always work but One, Two, Three probably won't because of capital letters.

Since the title is never seen on the user end only in the admin section and mainly for database purposes you dont have to worry about how it looks.
Title: Re: Custom Form Mod
Post by: Tibbetts on January 25, 2011, 12:18:25 AM
Oh...  Okay.  I think.  I'll give it a try and see what happens. lol...


-Tibbetts
Title: Re: Custom Form Mod
Post by: staycrunchy on January 27, 2011, 11:38:08 PM
I installed this mod on smf2.0 RC4, and have yet to get the Form Output working.  I am aware it states only up to 2.0 RC3, however the mod did install properly so I had hoped it would work.  Has anyone been able to achieve the Form Output saving what is placed in there with RC4?
Title: Re: Custom Form Mod
Post by: Tibbetts on January 27, 2011, 11:52:41 PM
I haven't yet.  I just decided to have a post saying what I want to know from Clan Applicants and left it at that.


-Tibbetts
Title: Re: Custom Form Mod
Post by: staycrunchy on January 28, 2011, 11:17:33 AM
I've been looking through the PHP file for this to see if I could find the error.  Not saving the data only for your form output seems like it just might be a variable that needs to be changed on how it is saved or where it is used.  I'll continue to check it out.
Title: Re: Custom Form Mod
Post by: Garou on January 29, 2011, 11:31:16 AM
Are you using the wysiwyg editor in the form output? That has been a problem for some users.

The mod does work in the current versions of smf. Depending on what code SMF changes it should work in future versions as well.
Title: Re: Custom Form Mod
Post by: liability on January 30, 2011, 05:13:29 PM
We just installed this mod (SMF 1.1.2) and seems to work great, with one exception.

It has trouble with usernames that have an apostrophe in them.

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 '[end]', 1, 255), SUBSTRING('[email]', 1, 255), 1296420349,
SUBSTRING(' at line 4
File: [path]/forums/Sources/Subs-Post.php
Line: 1535

Obviously anything in brackets [ ] I replaced for this example.

These users can post to the forums (and do everything else) just fine. And Subs-Post.php is unmodified from this mod, judging by the date on the server. So that points me back to the mod itself. I can only find where it gets the member ID, but I'm probably missing something here. (We did a quick test, and removed the apostrophe, and the mod worked for them.)

Anyone else have this problem, and/or a suggest on how to fix it?

Thanks!
Title: Re: Custom Form Mod
Post by: staycrunchy on January 31, 2011, 02:58:58 AM
Quote from: Garou on January 29, 2011, 11:31:16 AM
Are you using the wysiwyg editor in the form output? That has been a problem for some users.

The mod does work in the current versions of smf. Depending on what code SMF changes it should work in future versions as well.

I disabled wysiwyg and it worked fine.  Still can't find where the error stems from though.
Title: Re: Custom Form Mod
Post by: staycrunchy on February 04, 2011, 11:37:05 PM
Just wondering how difficult it would be to add your own custom form fields, like a date type field, currency, etc.
Title: Re: Custom Form Mod
Post by: Garou on February 06, 2011, 03:13:39 PM
For currency I usually just use Text Box (Float), then in the text field I'll enter something like...
Please enter the dollar amount. <span style="float:right">$</span>
That puts the $ right next to the box for user input and tehy can just enter the amount. Its much easier then creating a whole new field type. :)

If you got something else planned and its something a lot of people would want to use put the changes up here and if I ever find the time to work on this again I'll include your feature and give you credit you for it.


That said... It really depends on what you want to add. usually you'll need to modify  ./Sources/CustomForm.php, ./Themes/default/CustomForm.template.php, and ocassionally ./Sources/ManageSettings.php. Then if your are doing it right you'll also want to edit the language files but if you know what your doing and for your own site its not really needed. The language files just make it easier to convert the mod to other languages.
Title: Re: Custom Form Mod
Post by: Kimmen on February 08, 2011, 01:37:08 PM
A little bit about permission:

"This is the permissions setting for this form, to be able to view or submit a form, a user must be in one of the member groups selected."

- When i select Regular Members and Staff, and press save, i would imagen that guest's that try to submit the form, would get a message to login. Instead, they get this message: "This list is currently empty."

How can i add to the message that they must register and login to submit the form?
Title: Re: Custom Form Mod
Post by: Garou on February 08, 2011, 04:12:11 PM
./Themes/default/languages/Modifications.english.php
$txt['CustomForm_list_noelements'] = 'This list is currently empty.';

This is the default code for any member group that currently doesn't have access to any forms, not just guests.

Also if you do decide to allow guests to fill out a form, they will also have to pass captcha in order to post. It adds a little security.
Title: Re: Custom Form Mod
Post by: teddyuk on February 08, 2011, 05:21:55 PM
Need Help  :-[

I installed the custom form mod on my forum (SMF 2.0 RC4 )

and when I try to add a new form it comes up with this message

Unknown column 'icon' in 'field list'
File: /home/cgl/domains/consolegl.com/public_html/Sources/ManageSettings.php
Line: 2425


What do i have to do
Title: Re: Custom Form Mod
Post by: Garou on February 08, 2011, 06:04:11 PM
It sounds  like the database  files didn't  install properly.
uninstall and re-install making sure you have rc2 version of the mod. With rc2 SMF made some significant changes causeing me put up 2 versions of the mod.

I havent had to update the mod or had time to add features since so I haven't taken the older version down yet.
Title: Re: Custom Form Mod
Post by: teddyuk on February 08, 2011, 06:16:35 PM
Still no luck :(

I've un-installed and installed and even deleted but everytime I install it back my old forms from a previous version still remain

1016 ("Invalid Board")   Admin   
(Edit)    (Delete)
TEST   1032 ("Invalid Board")   Admin   
(Edit)    (Delete)
Post results for Be a Pro here (TEST!)   1028 ("Invalid Board")   Admin   
(Edit)    (Delete)
0 ("Invalid Board")   Admin   
(Edit)    (Delete)
0 ("Invalid Board")   Admin   
(Edit)    (Delete)
0 ("Invalid Board")   Admin   
(Edit)    (Delete)
0 ("Invalid Board")   Admin   
(Edit)    (Delete)

:(
Title: Re: Custom Form Mod
Post by: Garou on February 09, 2011, 09:35:45 AM
Invalid board means that you have a board selected that doesn't exist. Edit your form select a new board from the dropdown list and click save.

take a look at this post here http://www.simplemachines.org/community/index.php?topic=248871.msg2894255#msg2894255

it has some good instructions for how to create a form.
Title: Re: Custom Form Mod
Post by: Kimmen on February 09, 2011, 12:15:51 PM
If i want a image on the top of the form, and some intro text, how would i get that done? I tried with info box, however, its very short on letters and i cant style the text with BBC. Is there somewhere i can manually type it on?

Edit: If i cant put an image at the form, i would like to replace the tables at this place: "http://www.yoursite.com/index.php?action=form" With images. Can that be done?
Title: Re: Custom Form Mod
Post by: teddyuk on February 09, 2011, 01:33:45 PM
Quote from: Garou on February 09, 2011, 09:35:45 AM
Invalid board means that you have a board selected that doesn't exist. Edit your form select a new board from the dropdown list and click save.

take a look at this post here http://www.simplemachines.org/community/index.php?topic=248871.msg2894255#msg2894255

it has some good instructions for how to create a form.

Must be my most unluckest day lol

I cannot edit them either as this message appears when I click edit

Unknown column 'icon' in 'field list'
File: /home/cgl/domains/consolegl.com/public_html/Sources/ManageSettings.php
Line: 2427

:(
Title: Re: Custom Form Mod
Post by: Garou on February 09, 2011, 09:14:28 PM
Kimmen I have a breif tutorial on how to make custom templates here. http://www.simplemachines.org/community/index.php?topic=248871.msg1805119#msg1805119

As for wanting images in the form list... Im not exacty sure what you are looking for but it might be possible to display the icon used for the post. It might take some work though.

Teddy the only thing I can think of is there might be a conflict with another mod but I cant reproduce the problem on my servers.
Title: Re: Custom Form Mod
Post by: staycrunchy on February 10, 2011, 11:20:10 PM
Quote from: Garou on February 06, 2011, 03:13:39 PM
For currency I usually just use Text Box (Float), then in the text field I'll enter something like...
Please enter the dollar amount. <span style="float:right">$</span>
That puts the $ right next to the box for user input and tehy can just enter the amount. Its much easier then creating a whole new field type. :)

If you got something else planned and its something a lot of people would want to use put the changes up here and if I ever find the time to work on this again I'll include your feature and give you credit you for it.


That said... It really depends on what you want to add. usually you'll need to modify  ./Sources/CustomForm.php, ./Themes/default/CustomForm.template.php, and ocassionally ./Sources/ManageSettings.php. Then if your are doing it right you'll also want to edit the language files but if you know what your doing and for your own site its not really needed. The language files just make it easier to convert the mod to other languages.

Thanks Garou.  I'm going to look into it but my programming skills are extremely rusty and I'm currently fiddling around with Ajax.  I was hoping to be able to have it create an Ajax form page and use a lot of the jquery form options like calendar, specified type data fields like currency, date, time, etc.    It sounds like a large project and one probably outside of my ability currently. 

Thanks for the tips though, definitely helped.
Title: Re: Custom Form Mod
Post by: King Death II on February 11, 2011, 12:09:34 AM
Can you please update this for SMF 2.0 RC4? I upgraded my forum today to that and didnt realize this wont work with it and my forum depends on this mod.

thanks!
Title: Re: Custom Form Mod
Post by: Garou on February 11, 2011, 12:14:10 AM
It works just fine on RC4
Title: Re: Custom Form Mod
Post by: King Death II on February 11, 2011, 07:52:46 PM
It does? My forum said it was corrupted and didnt work or something like that.

Quote
INSTALLATIONS ACTIONS FOR "CUSTOM FORM MOD"
The package you are trying to download or install is either corrupt or not compatible with this version of SMF.

Title: Re: Custom Form Mod
Post by: Garou on February 11, 2011, 08:41:34 PM
You need the version that says RC2. The 2.x version is for those using prior versions of SMF as stated in compatibility section of the download page. If you have the RC2 version the try and download it again. It is possible that it didnt download properly.

The mod is compatible though as Ive installed it on several RC4 sites.
Title: Re: Custom Form Mod
Post by: King Death II on February 11, 2011, 09:01:51 PM
Yea that was it, thanks!
Title: Re: Custom Form Mod
Post by: UMag on February 15, 2011, 01:09:51 PM
I have noticed a couple of bugs, one of which is affecting the behavior of my forum.

First off, thank you for this mod...it rawks!

Okay, now the technical stuff,

When a user posts using a form, there are two things that happen (and I am pretty sure they are interlinked): Their post count is unaffected and they have no posts show up when clicking "My Messages"

Thanks in advance
Title: Re: Custom Form Mod
Post by: Garou on February 16, 2011, 08:44:58 AM
They are both known bugs but I havent found the fix yet. It also effects board notifications as well and possibly a few other functions. Im workin on it along with a few other things as I get time.
Title: Re: Custom Form Mod
Post by: UMag on February 16, 2011, 11:39:47 AM
Okay, great.  Thanks.
Title: Re: Custom Form Mod
Post by: staycrunchy on February 16, 2011, 11:06:59 PM
Garou,

     Given that the jquery library is rather useful and also rather easy to use, do you think it would be possible to add the datepicker from the jquery UI as a field for the custom form mod?  I'm not asking you do it, just wondering if the possibility is reasonable.

Thanks!

Title: Re: Custom Form Mod
Post by: Garou on February 17, 2011, 12:54:18 AM
Yes its do able, it's on my to do list but based on past projects Id rather not use any 3rd party scripts. It either has to be incorporated into the mods code or tied to existing smf code like the calendar, if I were to include it into the mod.
Title: Re: Custom Form Mod
Post by: FragaCampos on February 17, 2011, 05:14:56 PM
Quote from: UMag on February 15, 2011, 01:09:51 PM
Their post count is unaffected

I'm pretty sure the answer to this is somewhere in this thread cause i already solved it in my forum.
Title: Re: Custom Form Mod
Post by: Garou on February 18, 2011, 09:18:32 AM
First off I want to say Google is your friend, well in this particular case anyway. To find the posts in this topic for "post count" I used these search terms
post count "Custom Form Mod" site:www.simplemachines.org

Using a Google search in this manner is the best way to search large topic/threads like this one.

Laughing at FragaCampos, you provided one of the fixes.  ;D

Fix for the 2x versions of SMF
http://www.simplemachines.org/community/index.php?topic=248871.msg2415175#msg2415175

Fix for the 1.1x versions of SMF
http://www.simplemachines.org/community/index.php?topic=248871.msg2443545#msg2443545


Edit: Oops, I should also mention that these are not true fixes. This will force all posts from the form mod to count even if the the board being posted to has permissions blocking the count for posts in that board. I never found the fix for that, so it was never included in the mod.
Title: Re: Custom Form Mod
Post by: FragaCampos on February 18, 2011, 10:28:10 AM
It was not my fix, it was ŦώεαЖзяŁ's ;) and it works if you just post the forms in regular boards with post count enabled. Better than nothing, but still not perfect.
Title: Re: Custom Form Mod
Post by: Garou on February 19, 2011, 10:49:18 AM
FragaCampos dont give yourself enough credit, ŦώεαЖзяŁ listed the fix for 2.x and he gave you the info on how to find the fix for 1.1x. You did the ground work and actually found the fix.

I had some time to actually look at the code the other day and I think I may have found the rest of it, so it will work with the board permissions. I haven't had the chance to test it yet though.

I am starting to work on the mod again, primarily I'm focusing on bug fixes but I might get another feature or two in as well. I'm not going to set a deadline for release as I have no clue what time Ill actually have to work on it but I am working on it again.

I am working on the Balance SMF site again. This time it is a Google site rather then an actual SMF site, its easier to maintain and the hosting is free. There I and a few associates can post SMF information for easy reference when supporting things here at SMF rather then providing support at multiple locations. For instance I have posted a link to the hack for using the new topic button to link to a form. My to do list for the mod there too.

Also I want to give everyone a heads up. Once SMF 2.0 goes Gold/Final or whatever they are going to call it and they publish the next beta version of SMF, I will stop mod development for 1.1x. Since SMF 1.1x is pretty much in security fix mode only anyway, whatever the last version of the mod for 1.1x winds up being, should continue to work as is till SMF drops support for it completely. Probably sometime after the next beta gets close to final release at which point everyone should be transitioned to 2.0, for security reasons if nothing else. Besides it's enough trouble maintaining two versions of the mod let alone three.
Title: Re: Custom Form Mod
Post by: WolFDarK on February 19, 2011, 12:10:44 PM
Hi,

I could not successfully install your mod, on SMF 2 RC5

My server throws me this> Error 500: Script Execution Failure,
and Premature end of script headers: index.php

I tried to emulate RC2, RC3..., uploading files in ASCII mode with 755 permissions

I also tried to install it in localhost, but when I'm going to admin-panel is all white

Thanks in advance.

Title: Re: Custom Form Mod
Post by: FragaCampos on February 19, 2011, 01:31:41 PM
Thanks Garou.
It's great to know you're back to the mod and it's not dead because it's incredibly useful.

Regarding SMF 2.0, as soon as it goes final, i will certainly upgrade from 1.1.x ;)

Title: Re: Custom Form Mod
Post by: Garou on February 19, 2011, 02:20:15 PM
WolFDarK, I hate 500 errors as they dont give enough information about the problem. This is a 'catch-all' error generated by the Web server. Basically something has gone wrong, but the server can not be more specific about the error condition in its response to the client. In addition to the 500 error notified back to the client, the Web server should generate some kind of internal error log which gives more details of what went wrong.

Id first suggest  that you make sure you have the correct file. CustomFormMod_v1.6_SMF2_RC2.zip is the current version for smf RC2 and beyond.

I know it can be a little deceiving but I haven't added any features since the 2.x version. Due to code changes in SMF2.0 RC2, I had to update the install specifically for that version at the time and it has continued to work on every version of SMF 2.0 since.

The next update of the mod will go back to traditional naming conventions and will not support outdated versions of SMF.

I just installed a fresh version of SMF 2.0 RC5 with CustomFormMod_v1.6_SMF2_RC2.zip, it works as expected.

So if that doesn't fix the problem check both your SMF error logs as well as the ones from your host. Usually the error logs most host provide to their clients will tell you where the code is failing and we can progress from there.

Title: Re: Custom Form Mod
Post by: WolFDarK on February 19, 2011, 10:21:30 PM
@Garou
In my log appears this:
8: Undefined index: package_readme
File: /~/www/mysite/Sources/Packages.php
Line: 365

I will try on a different hosting because I'm trying to install Custom Form in a virgin SMF installation and this looks weird,

I will back to comment the result.
Title: Re: Custom Form Mod
Post by: Garou on February 19, 2011, 11:32:28 PM
That problem came up for another user at one point and I sugested...

Quote from: Garou on November 09, 2009, 10:11:13 PM
...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.  :-\

I didn't hear back on that but I know he is using the mod, so that might have fixed it. *shrug*
Title: Re: Custom Form Mod
Post by: WolFDarK on February 19, 2011, 11:50:16 PM
I already tested in a different hosting and works fine.

Now... I have a little question:
I want to create a form for example about cars...
Number of cars= 5 "<-- user input"
then the form replic's himself 5 times with the pertinent form-info for each car
Title: Re: Custom Form Mod
Post by: Garou on February 20, 2011, 07:22:58 PM
Sorry WolFDarK but that is way beyond what this mod can handle. Come to think about it, it would also be difficult using a standard form from scratch. You would probably have to find a professional web designer to make that one work.
Title: Re: Custom Form Mod
Post by: WolFDarK on February 20, 2011, 08:05:23 PM
No problem, thanks for this awesome mod.
Title: Re: Custom Form Mod
Post by: bigjoe11a on February 23, 2011, 10:58:53 PM
I have SMF 2.0 RC5 and Custom Form MOD 1.6. and I didn't want to have to read threw 66 pages for some thing that mite not be there.

I did read that the documents didn't give any good details on how to start that I can under stand.
Does any one have a step by step tutorial showing me just how to create a form and how to use it.

I'm new to this so I mite not under stand every thing. So some extra help would be great.

Joe
Title: Re: Custom Form Mod
Post by: Garou on February 24, 2011, 02:21:16 AM
http://www.simplemachines.org/community/index.php?topic=248871.msg2894255#msg2894255
And
http://www.simplemachines.org/community/index.php?topic=248871.msg1633514#msg1633514
Title: Re: Custom Form Mod
Post by: GRoger on March 01, 2011, 03:58:43 AM
Hi there,

First of all this mod is incredibly usefull for us.
I got it installed, and setted up everything.

The only problem I get is whene I press the form i will get this error:

Quote403 Forbidden

Forbidden
You do not have permission to access this document.

I setted up permissions and they are correct as far as I know.
Title: Re: Custom Form Mod
Post by: Garou on March 01, 2011, 04:51:16 PM
GRoger, check your site error logs and let me know if there is something specific that is triggering the error.

Off hand the only thing I can think of that would cause that type of error is if your host is using a program known as mod_security and they have a rule that doesn't like something in the mod. If it is a problem with mod_security, that's something you'll have to talk to the host about. Your host would either have to turn off the rules that dont like the mod or better still the preferred method would be to white list the CustomForm.template.php and custom CustomForm.php

While the standard mod_security rules have no problem with this mod, there are a couple of custom rule sets that dont like the fact that the mod uses "id" and or ";" in the address.
Title: Re: Custom Form Mod
Post by: Arantor on March 01, 2011, 05:09:46 PM
The main mod_security rule will foul on ;id= specifically.
Title: Re: Custom Form Mod
Post by: Garou on March 01, 2011, 09:36:39 PM
Thanks for the help Arantor.

All I really know is I hate the dog gone thing, it's too restrictive to be functional. I've dumped every host I've ever had that used it and wasn't willing to find a way to work around it.

Oh and I almost forgot there was a fix for this at one point.
The line numbers probably dont match as I think the mod has been updated once or twice since then but the process should be the same.
Quote from: Galatea on October 28, 2010, 03:17:38 AM
Quote from: cddude on October 13, 2010, 05:25:06 AM
Hi there.

Im getting an error when clicking on my form at index.php?action=form. I get the following error code:


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


This happens when trying to load the page index.php?action=form;id=1
**snippity snip**

I encountered this bug tonight and have hacked together a workaround that revived the form for me.  My hypothesis was that mod_security was choking on the call for a GET var named "id", so I changed all instances to "gid" and it seems to have solved the problem for now.  If your host has configured the regexes in mod_security differently, "gid" may not work, so you might have to go further afield and try something wacky like "myform".

In CustomForm.php:

Find on line 29:

if(isset($_REQUEST['id'])
&& intval($_REQUEST['id']))
{
$form_id = intval($_REQUEST['id']);


and replace with:

if(isset($_REQUEST['gid'])
&& intval($_REQUEST['gid']))
{
$form_id = intval($_REQUEST['gid']);


Also find on line 363:

$context['post_url'] = $scripturl.'?action=form;id='.$form_id.';submit;';


And replace with:

$context['post_url'] = $scripturl.'?action=form;gid='.$form_id.';submit;';


Then, in CustomForm.template.php on line 198, find:

<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['view'] , '</a>
</td>
</tr>';


and replace with:

<tr class="windowbg">
<td style="padding:4px;" >
<a href="' , $scripturl , '?action=form;gid=' , $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;gid=' , $form['id'] ,'">' , $txt['view'] , '</a>
</td>
</tr>';


If you've made edits to your MessageIndex Template to point to a certain form by default, you'll want to change the ;id var to ;gid over there as well.
Title: Re: Custom Form Mod
Post by: Arantor on March 01, 2011, 09:38:23 PM
The workaround is to not use ;id=, basically - that's why SMF does topic=, board=, u=, attach= and all the other things that aren't id=
Title: Re: Custom Form Mod
Post by: Garou on March 04, 2011, 09:05:26 AM
Thanks Arantor, I will change it to form;n= in the next update. *thumbs up*
Title: Re: Custom Form Mod
Post by: WolFDarK on March 04, 2011, 01:33:09 PM
This mod will support emmm a upload imagen button?
Title: Re: Custom Form Mod
Post by: Garou on March 04, 2011, 08:57:55 PM
WolFDarK, sorry, this mod does not currently support attachments but it is on the wish list. Hopefully we will be able to add it to the mod in the future.

For now the best you can do is have your users link to an image from another source such as "Fliker".

Title: image
Text: Enter a link to an image such as http://somesite.com/my_image.jpg
Type: Text Box (String)
Extra Type Parameters : parse_bbc

Then in the Form Output: Here is my pretty picture...[br][img width=300]{image}[/img]


I almost forgot, in SMF 1.1x the http:// automatically gets entered after you save the form output. I never figured out why.
Title: image
Text: Enter a link to an image such as somesite.com/my_image.jpg. Do not enter the http://
Type: Text Box (String)
Extra Type Parameters : parse_bbc

Then in the Form Output: Here is my pretty picture...[br][img width=300]http://{image}[/img]
Title: Re: Custom Form Mod
Post by: GRoger on March 05, 2011, 06:16:24 AM
Awsome, it works now! thx for your help guys!
Title: Re: Custom Form Mod
Post by: WolFDarK on March 06, 2011, 01:08:43 AM
Thanks for the help Garou.
Title: Re: Custom Form Mod
Post by: Garou on March 06, 2011, 06:16:07 PM
Ive updated the mod to
V1.7:
Updated: Due to conflicts with mod_security, the url syntax "index.php?action=form;id=#" has been changed to, "index.php?action=form;n=#" Thanks to Galatea (http://www.simplemachines.org/community/index.php?action=profile;u=17752) and Arantor (http://www.simplemachines.org/community/index.php?action=profile;u=265135) for the fix.
Added: All posts created by a form are now attributed to a users post count. Unfortunately there is no way for a form not to be counted, however this one fix also fixes several other bugs. Thanks to ŦώεαЖзяŁ (http://www.simplemachines.org/community/index.php?action=profile;u=214356) and FragaCampos (http://www.simplemachines.org/community/index.php?action=profile;u=94593).
Bugfix: Posts created by the form should now properly display under the "Show Posts" and "Board Notifications" sections of SMF.
Added: Selection and Radio boxes can now use the required option. When using the required option for a selection box, be sure to use "required" the first selection. Thanks to Tunga (http://www.simplemachines.org/community/index.php?action=profile;u=61036).
Added: an option to hide sections of the "Form Output". If a form field is not required and the user decides not to enter anything in the related field. Example: {My name is {name}}. The hidden sections will be replaced with a blank line. Thanks to  alfzer0 (http://www.simplemachines.org/community/index.php?action=profile;u=168713)
Added: two new custom templates. "left" displays the input boxes on the left. "center" displays the description text above the input boxes, centered on the screen.
Revised: the Custom Template "example" to include features from the last several updates, as well as highlighting the example text in red.
Revised: the default template, the * for required fields now display on the right hand side of the input boxes rather then below them.
Added: a standard thank you page that can be used as an optional "Submit Redirect" option.
Updated: Documentation
Removed: compatibility for SMF 2.0 versions prior to RC2

A large chunk of this version is based on code by other members of the community in this thread. I just want to say thank you again to all of them for their help.
Title: Re: Custom Form Mod
Post by: Swayforth on March 06, 2011, 06:46:58 PM
Awesome work guys!

and to think i just installed this mod today and did the db fixes and all that (upgraded to 2.0 rc5 a few weeks ago) to just get it back up and running no more than 2 hours ago haha what timing i have.

Uninstall 1.6 then reinstall new version i'd imagine?
Title: Re: Custom Form Mod
Post by: Garou on March 06, 2011, 07:26:17 PM
Yeah unless you want to make the changes manually. lol
Title: Re: Custom Form Mod
Post by: nmartin413 on March 08, 2011, 01:14:09 AM
I was hoping you could help me with the following errors. I really need this mod - its great!

Add After   ./Sources/Admin.php   Test failed

Find: // Mod Authors for a "ADD AFTER" on this line. Ensure you end your change with a comma. For example:

Select:                   //   Place the Custom Form Mod Link.
                  'customform' => array($txt['CustomForm_tabheader']),

Add After   ./Sources/ManageSettings.php


      // Mod authors, once again, if you have a whole section to add do it AFTER this line, and keep a comma at the end.

Add After       'customform' => 'CustomFormSettings',
Title: Re: Custom Form Mod
Post by: Garou on March 08, 2011, 06:43:58 AM
That is due to other mods that are already installed on your site or possibly removed.
It's nearly impossible to account for what other mods do, so most mods are made only to update the original SMF code.

Essentially you'll have to tell the mod to install with the errors and then add those specific changes manually.
Title: Re: Custom Form Mod
Post by: Midnitelove on March 08, 2011, 10:49:29 PM
Oh I installed the mod and went back and parsed to make sure there were no skipped files. However When I view it in index.php?action=form it say form empty even thought I have successfully created one. (yes I checked permissions in both places)


I was also careful to make sure the titles didn't includes spaces, caps, etc...


What am I missing?
Title: Re: Custom Form Mod
Post by: Garou on March 09, 2011, 10:03:57 AM
If the form list is saying its empty to on an admin account then the form is definitely missing something.

Perhaps the Title in the form settings isn't correct. While I have never come across an issue with the form title field it doesn't mean that there isn't something that will conflict.

Its rare but on some sites I've have to open the drop down menu for the boards and select a board and click save. Sometimes even though the first board is displayed it doesn't save properly without actively selecting it at least once. If that's the case in mod settings page at index.php?action=admin;area=modsettings;sa=customform it will say under board something like  "0 invalid board".

Is this the first time you have used the mod or did you upgrade over an old version? Sometimes you have uninstall the mod and use a program such as phpmyadmin to back up/export the databases tables cf_forms and cf_fields, then drop them from the database, install the mod then import your old tables back in. Even though the structure of the tables hasn't changed in the last several versions of the mod, sometimes the mod doesn't recognize the old tables when installing a new version.

Short of one of those, I'm really not sure off hand but I'm always learning something new about this mod. Just last night I learned that using a field title with "action" in it will cause the mod not to work correctly. Every time I submitted the form it wouldn't post and I was redirected to the main forum. It took me two hours before I figured out what the problem was.
Title: Re: Custom Form Mod
Post by: Garou on March 17, 2011, 03:04:19 PM
Ive been doing some research and I am extremely excited and extremely depressed about HTML5.

Where the Form Mod is concerned, we will have roughly double the amount of field types that could be easily added to the mod due to the new types and attributes available in HTML5. For instance...

There are types where you could ask for an a phone number, an email, or web address, and they would be validated by the browser.

There's a couple of new ways to handle number input.

Several different ways of handling dates and times.

Set an minimum and maximum value that can be entered into a text or date and time function.

A color picker that would be very useful to web designers or designers of just about anything.

Like a radio or selection box there is now a list function that would allow your users to enter something in a text box from a list of items.

There is an easier way of handling the height and width of input boxes.

Predefined text would now be displayed in the various text boxed rather then hidden the way it is now. the user would see what is going to be printed in the output if they dont do it themselves.

You can even display hints in the text boxes that while not posted in the end would give your users and idea of what you expect them to enter.

There is a new way of requiring any type of input at the browser level meaning that we would save a step and several lines of code that the mod uses for the function now.

Granted most of the above could be added now but it would take a lot of extra code and in most cases some Java scripts which I personally am not good with yet.

The depressing part of all of this is even in the beta versions of the more popular browsers many if not all of these functions are not supported yet. Even the HTML5 standard hasn't been finalized yet but the future of forms and and this mod definitely look bright.

Edit:
I know I recently said I didn't want to have to use 3rd party scripts for certain features of the mod... I found a set of scripts that once they are loaded, will recognize and simulate HTML5 code when a browser doesn't already support it natively.
http://www.useragentman.com/blog/2010/07/27/cross-browser-html5-forms-using-modernizr-webforms2-and-html5widgets/

The script set does need a little more fleshing out, especially where IE is concerned, but its a work in progress. Once it's finished web designers will be able to use all HTML5 code that relate to forms without worry. I'm already using it out on my test server and its looking really good.  :D
Title: Re: Custom Form Mod
Post by: FragaCampos on March 20, 2011, 12:53:00 PM
Garou, i have to congratulate you for all your work and enthusiasm about this, especially at a time when SMF is sick without willing developers. I miss the days when we came here and this was full of ideas and people working to make this the best forum software of all.
Kudos for you.
Title: Re: Custom Form Mod
Post by: Garou on March 21, 2011, 09:29:56 AM
Tell me about it. Don't get me wrong I do have a fair amount of disgust for the situation that led to the brightest minds to ever work on SMF, including its founders, to up and abandon the project. In-fact I too abandoned web design for almost a year.

Of all the free forum programs available, it is my opinion that SMF, even in its current state, is the best. There are only a couple of paid ones that I think are better but the average admin that uses SMF could not afford them, including myself. The thing is, in the current situation, I dont know how long SMF is going to hold ground.

In the future there are a couple of planned SMF forks that look very interesting to me, as well as another project that isnt a forum at all but one can easily be added to it. Once those are up and running Ill probably switch my focus to one of them but I will still support this mod and a few others that I have worked on.

The nice thing is that there isnt too much left to be done with this mod. As I said before there are several features in HTML5 that have been asked for in the past that will be able to be added easily. Then there is the new topic feature and attachments. The new topic function I think I might have figured out, I just have to work out the bugs. As far as attachments go, uploading a file is easy but making it work with the attachments functions in SMF has been a nightmare for me. I will get both added eventually even if it kills me. :)

A few months ago I got involved with a group of people that needed a website with a forum. After some research of the alternatives, I found myself back here at SMF and unfortunately having to upgrade most of the add-ons we used for it myself. That lead to a renewed interest in programing and a commitment to this mod. Like so many other mods it's become so widely used, to let it die like some of the others is a disservice to the users and myself, no matter what my opinions on the state of SMF are.

What I'm really passionate about is HTML 5. It eliminates the need for several of the most common java script and widget functions. Web designers will just have to use a couple of lines of code, where previously hundreds of lines may be required to make them work right. Of course this doesn't eliminate the need for java but eliminates the need to re-invent the wheel in many cases. Its a good thing, not only for those who dont want to use java but for many of those write java but find themselves having to constantly recreate things that should be standard functions.  :laugh:
Title: Re: Custom Form Mod
Post by: wintermoon on March 23, 2011, 04:49:47 AM
i don't mean to interrupt the conversation and i'm sorry if the answer for this is somewhere already. i've searched and while i've seen many instances of it, i haven't seen the solution.

i'm using smf 1.1.13 and i keep getting:

You 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: /home/diviaroc/public_html/forums/Sources/ModSettings.php
Line: 609

when i try to add a new form. i've checked the parser, the code is as i should be. my forums database is up to date. there was also a note about bugs in upgrading forum versions? or is there supposed to be a board specified? i don't know what else i could do. please help. :(
Title: Re: Custom Form Mod
Post by: Garou on March 23, 2011, 07:26:46 AM
I have never been able to reproduce the error on my servers, so there has never been an official answer.

Some have been able to fix this by with a reinstall of the mod where after the uninstall they have deleted the cf_forms and cf_fields from the database manually before reinstall.

others have been able to fix it by changing this bit of code in the ModSettings.php.

// Array for all icons that need to revert to the default theme!
$context['javascript_icons'] = array();

if (($temp = cache_get_data('posting_icons-' . $board, 480)) == null)
{
$request = db_query("
SELECT title, filename
FROM {$db_prefix}message_icons
WHERE ID_BOARD IN (0, $board)", __FILE__, __LINE__);
$icon_data = array();
while ($row = mysql_fetch_assoc($request))
$icon_data[] = $row;
mysql_free_result($request);


Where it says
WHERE ID_BOARD IN (0, $board)", __FILE__, __LINE__);
to
WHERE ID_BOARD IN (0)", __FILE__, __LINE__);

That bit of code comes directly from the default files in SMF and in theory should break the icon function in the mod, but if it works it works. *shrug*
Title: Re: Custom Form Mod
Post by: wintermoon on March 24, 2011, 11:22:08 AM
thank you so much. that worked! :)
Title: Re: Custom Form Mod
Post by: bfallgren on April 04, 2011, 02:56:57 AM
When I tried adding a form I got this error:

You 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: /Sources/ModSettings.php
Line: 757


Any idea of what could have gone wrong?
Title: Re: Custom Form Mod
Post by: Garou on April 04, 2011, 05:32:15 AM
Quote from: Garou on March 23, 2011, 07:26:46 AM
I have never been able to reproduce the error on my servers, so there has never been an official answer.

Some have been able to fix this by with a reinstall of the mod where after the uninstall they have deleted the cf_forms and cf_fields from the database manually before reinstall.

others have been able to fix it by changing this bit of code in the ModSettings.php.

// Array for all icons that need to revert to the default theme!
$context['javascript_icons'] = array();

if (($temp = cache_get_data('posting_icons-' . $board, 480)) == null)
{
$request = db_query("
SELECT title, filename
FROM {$db_prefix}message_icons
WHERE ID_BOARD IN (0, $board)", __FILE__, __LINE__);
$icon_data = array();
while ($row = mysql_fetch_assoc($request))
$icon_data[] = $row;
mysql_free_result($request);


Where it says
WHERE ID_BOARD IN (0, $board)", __FILE__, __LINE__);
to
WHERE ID_BOARD IN (0)", __FILE__, __LINE__);

That bit of code comes directly from the default files in SMF and in theory should break the icon function in the mod, but if it works it works. *shrug*
Title: Re: Custom Form Mod
Post by: bfallgren on April 05, 2011, 03:03:36 AM
Thank you so much
Title: Re: Custom Form Mod
Post by: Nvb on April 10, 2011, 05:35:29 PM
Installed v1.7 today on my updated RC5 forum.
My forms are still there, but when i try to access and use them i get this error:

Unknown column 'icon' in 'field list'
File: /customers/myforum.com/myforum.com/httpd.www/MyForumname/Sources/CustomForm.php
Line: 53


Did it do something wrong?
It there a manual solution?
Maybe good to know my previous install was v1.6 RC2

Thx
Title: Re: Custom Form Mod
Post by: Garou on April 10, 2011, 11:02:26 PM
Sound like the database didn't install properly. If you are wanting to preserve your old db make a back up of the cf_forms and cf_fields tables using phpmyadmin or similar program. Then uninstall the mod, drop those two tables, reinstall the mod, then insert your old tables.
Title: Re: Custom Form Mod
Post by: dorje77 on May 13, 2011, 08:30:15 AM
Hello! :)

I installed Custom Form mod and... Works fine, so thank you Nathaniel and Garou. ;)

I've a question. I'm using two forms for some special tasks on my community. The first one creates post in a public area, so if users have to change something they can edit messages without problem. The second form creates posts in a hidden area - so I want to know if there is a simple way to let users edit that kind of posts, or not.

Thank you!
Title: Re: Custom Form Mod
Post by: Garou on May 13, 2011, 09:19:58 AM
Posts are just normal forum posts and work the same as always. The Form just forces the initial post to follow the format you set up in the form.
Title: Re: Custom Form Mod
Post by: king kratos on May 24, 2011, 08:39:44 PM
I am using RC5 and just installed CF1.7. I uninstalled CF1.6, but saved data because 1.6 was triggering mod_security on our new server.

Everything is working fine, except that when I submit a form, I am presented with a single screen that states "Numeric request keys are invalid". It is simple plain text on a completely white page. However, the data is actually posted to the forum it is supposed to be posted to.

What is going on here?

EDIT: Nevermind... I figured it out. The database is set to use tinyint(4) for the form output and really needs to be tinytext(). Probably just caused by me saving the data from the prev install.

Kratos
Title: Re: Custom Form Mod
Post by: doo2002 on May 28, 2011, 03:03:54 PM
I've installed this on a SMF 1.1.13 with a simple portal website (http://www.39thguards.org/index.php)

I have created a form with fields and such. But I can't access them. Every time I try to go to the link that I am suppose to it automatically redirects me to our forum.

Any ideas on whats wrong?
Title: Re: Custom Form Mod
Post by: Garou on May 31, 2011, 04:57:08 PM
More then not when the mod acts screwy its due to naming conventions in the title for an entry. Give this http://smf.balancegames.org/mods/forms/tutorial a read.
Title: Re: Custom Form Mod
Post by: doo2002 on June 01, 2011, 10:02:56 AM
I already followed that tutorial on that link. That is how I got it setup in the first place. I have already went over this several times. Had others go over it, nothing. We resorted to deleting it and moving on.
Title: Re: Custom Form Mod
Post by: BlueBA on June 04, 2011, 11:29:28 PM
I wanted to know is there any way where when somone Submits the form, it will place there user name in the title? Like <Members Name> Ban Appeal
Title: Re: Custom Form Mod
Post by: Garou on June 05, 2011, 03:08:34 AM
no you have to create a field where the user enters the name then you can use that field in the subject.
Title: Re: Custom Form Mod
Post by: wintermoon on June 05, 2011, 10:06:54 PM
Is there any way to auto-create a Yes/No POLL after the form is submitted? 
Title: Re: Custom Form Mod
Post by: Garou on June 08, 2011, 02:37:41 PM
Not through the mod but depending on your access to the forums you can add one to the post normally.
Title: Re: Custom Form Mod
Post by: darkprodigy08 on June 09, 2011, 07:10:55 PM
Is their anyway someone could upload v1.6? I desperately need this mod to work on 2.0 RC1, and unfortunately I'm locked to that version because a few of my mods I need aren't compatible with 2.0 RC1+ Thanks so much!
Title: Re: Custom Form Mod
Post by: Arantor on June 09, 2011, 07:23:52 PM
Honestly, you're recommended to upgrade seeing how there are security vulnerabilities in that version.
Title: Re: Custom Form Mod
Post by: darkprodigy08 on June 09, 2011, 07:33:10 PM
Quote from: Once Upon A Star on June 09, 2011, 07:23:52 PM
Honestly, you're recommended to upgrade seeing how there are security vulnerabilities in that version.
Except that if I upgrade, 1/2 of my mods and themes will break... I understand their are security vulnerabilities but my site targets a very small audience.
Title: Re: Custom Form Mod
Post by: WillyP on June 09, 2011, 08:22:26 PM
With security it's not about the audience you target but the audience that targets you.
Title: Re: Custom Form Mod
Post by: darkprodigy08 on June 09, 2011, 09:00:06 PM
Quote from: WillyP on June 09, 2011, 08:22:26 PM
With security it's not about the audience you target but the audience that targets you.
I understand that, but as I said, the mods that are crucial to my forum, are not compatible with any version higher than 2.0 RC1... So I have no choice... Is their anyway someone could upload an older version of this mod that is compatible with my site? I mean I'd love to upgrade to 2.0 RC5, or even 2.0 Gold when it's released, but in the past when I've tried applying the mods and theme I use to it, it is completely broken because they were never updated...
Title: Re: Custom Form Mod
Post by: Arantor on June 10, 2011, 04:02:58 AM
Try looking in the mod's threads to see if someone has posted how to modify them for RC5. Or even thought about paying someone to upgrade them for you.
Title: Re: Custom Form Mod
Post by: Garou on June 11, 2011, 12:16:07 AM
I cant find copies of the older versions of the mod any more, I must have deleted them the last time I cleaned my hard drive. In the event that you do happen to find a copy of the older version I will not provide any support for it. Many if not most of the bugs in the mod were worked out with the last update. Also several requested and user submitted features were added, greatly increasing the functionality of the mod.

I also agree with most here that you desperately need to upgrade. As far as breaking your old mods, the more popular mods out there that the authors no longer support, community members have stepped up to the plate and submitted instructions on how to fix them manually. Also dont forget that many mods that wont install on the latest version of SMF is due to the way the author entered the supported version numbers. If you go through the manual instructions on the downloads page you can often see that the code being modified is the same between the varying versions of SMF. To compensate for this there is now a compatibility mode in SMF that will ignore the versioning system as long as the code changes match up.

Lastly necessity is the mother of invention. I learned to code for SMF because I or my clients needed features that didn't exist or existed in mods that no longer had support. Sometimes if you want things done you just need to do it yourself.
Title: Re: Custom Form Mod
Post by: Zagdul on June 30, 2011, 07:19:02 PM
This question was asked earlier, but I'd like to re-ask as the answer wasn't what I was looking for.

I'd like to duplicate a form I've already created then edit it's properties to potentially post to a new forum/have a different name.

The best example I could give would be, if you're in a large corporation and you'd like to apply to different departments. The overall application form would be similar however it would post to a different forum.

Any assistance on making a duplicate form would be awesome.
Title: Re: Custom Form Mod
Post by: Garou on July 01, 2011, 03:41:34 PM
There is not a function in the Mod to do this.

You might be able to accomplish it by modifying the database by hand using phpmyadmin or whatever tools you host has available for it, although I have never tried this myself.
Title: Re: Custom Form Mod
Post by: rspsloading on July 09, 2011, 04:57:12 PM
can you please release it for 2.0 !!!
Title: Re: Custom Form Mod
Post by: Garou on July 09, 2011, 06:08:08 PM
Should install just fine as is. To the best of my knowledge nothing has changed from RC5 that effects the mod.

Edit: Actually you might need to use the advanced mode and set it to rc5 emulation for the install.
Title: Re: Custom Form Mod
Post by: sornok on July 10, 2011, 08:08:44 AM
I just installed this mod and I loved it. Most of its functions suit me perfectly.

Although, there is something a bit complex that I want to do, and I am curious
to see if it is possible.

Using selection boxes or radio boxes, I can specify which answers I want to get.
Sometimes those answers affect the options of a later selection or radio box.

For example, selectionbox1 has two options, male and female.
selectionbox2 has 4 options, Michael, George, Maria, Penelope.

If the user selects male on selectionbox1 (or while it is selected), is it possible that
the options Maria and Penelope disappear from selectionbox2 as options ?

Hope it made sense, looking forward to know if it possible to be done.
Title: Re: Custom Form Mod
Post by: Alderman on July 12, 2011, 09:12:43 PM
Garou,


****EDITED****/index.php?action=admin;area=modsettings;sa=customform;eff519785=ad882b2f99685d741cdf60f49581d45a
Apply Filter: Only show the errors with the same message
8: Undefined index: 4
Apply Filter: Only show the errors from this file
File: ****EDITED****/public_html/Sources/ManageSettings.php
Line: 2744

Been trying to fix it. When I submit the specific form having this problem it just takes me immediately back to the forum index and does not submit the form. I have looked through everything. All the other forums work. What is the source of the issue? I am normally pretty good and solving this stuff on my own. Much thanks for an amazing mod. So much my organization was almost thinking of contacting you on this forum and seeing if we could work something out for a little bit of development, obviously involving you as a independent contractor contracted by our organization.
Title: Re: Custom Form Mod
Post by: Garou on July 13, 2011, 10:05:50 PM
sornok, something like that is way to complicated to do with a form generation program like this. There are just too many variables to account for. To accomplish something like that you really need to make a stand alone form that posts to your forum.

Alderman, your results are similar to an occasional Mod_Security issue that was popping up but that was corrected with the last update. The only thing I can think of is that another mod is conflicting with this one. Apparently something is interfering with the post function but I have no clue as to what.

Ill need a list what other mods you are running and attach your ManageSettings.php hopefully I can figure it out from there.
Title: Re: Custom Form Mod
Post by: frytec on July 15, 2011, 04:30:34 PM
Hello!

im using your custom form mod and its really great!
But im having an little anoying issue.

The board where the form creates a topic is an ADM only board, guests cant see it.
But the guests are alowed to use the form.
It works ok with guests, but when they finish submitting the form, they are redirected to the login form with the information that the page or board where not found.

how can i fix that? Maybe redirect to index after submiting the topic or to a page saying "Your message was sent". Can u give me a hand?

really thank you for your help.
Title: Re: Custom Form Mod
Post by: frytec on July 15, 2011, 07:10:35 PM
Nevermind.
I solved my problem using the fiield Submit Redirect on Custom Form Mod Settings!

Sorry for that.
Title: Re: Custom Form Mod
Post by: CGObob on July 17, 2011, 10:56:06 AM
Great mod, but just wanted to ask if it's possible to have multiples of the same field type (ie currency, float etc) on the same form as it all works fine until I try adding a second (but different) currency field and the original one gets ignored.

Hope I've explained that clearly!
Title: Re: Custom Form Mod
Post by: CGObob on July 17, 2011, 01:49:11 PM
Quote from: CGObob on July 17, 2011, 10:56:06 AM
Great mod, but just wanted to ask if it's possible to have multiples of the same field type (ie currency, float etc) on the same form as it all works fine until I try adding a second (but different) currency field and the original one gets ignored.

Hope I've explained that clearly!

Don't worry - Sorted it!  Phew :)

Title: Re: Custom Form Mod
Post by: FireAllianceNX on July 18, 2011, 11:05:48 PM
Hi there! I just installed your awesome mod.

I'm trying to make the form guest only and I notice you said it needs CAPTCHA... after creating the form, a CAPTCHA field is not automatically generated. How do I add this field?

When I submit the form as a guest, it say that I entered the wrong letters/numbers for CAPTCHA but there was no place for me to enter it. Am I missing something?
Title: Re: Custom Form Mod
Post by: Garou on July 21, 2011, 08:16:28 PM
The CAPTCHA should always show for guests.  After that its based on the CAPTCHA settings in the forums themselves. are you running any mods that alter the CAPTCHA for the forums?
Title: Re: Custom Form Mod
Post by: Garou on July 21, 2011, 08:39:30 PM
frytec, just tested your site and it does work well. I just dont speak the language. LOL I just wish I had read your post between reading your PM and going to the site.

That also shows me that the CAPTCHA is working fine on 2.0, I still haven't had the chance to test the mod on 2.0 gold but it seems to be working fine on your site. Now I just need to figure out what isnt working for FireAllianceNX specifically.

CGObob, glad you figured it out, can you share the solution for other users that might be have the same problem at some point? :)
Title: Re: Custom Form Mod
Post by: FireAllianceNX on July 21, 2011, 11:04:12 PM
I have reCAPTCHA instead of the SMF one, do you think it would be the issue? I have the forum one disabled.

Quote from: Garou on July 21, 2011, 08:16:28 PM
The CAPTCHA should always show for guests.  After that its based on the CAPTCHA settings in the forums themselves. are you running any mods that alter the CAPTCHA for the forums?
Title: Re: Custom Form Mod
Post by: Garou on July 21, 2011, 11:58:56 PM
Yep, definitely the issue.  I dont think you can have both enabled.

The mod looks for the specific CAPTCHA code that is the default in the forums. It works just like SMF does if you allow guests to post in a board. In fact if I remember right I copied most of  the code directly out of SMF's post function and tweaked it a bit, as most of this mods posting functions work the same way as if someone created a post themselves.

To make it work you would have to look and see how the reCAPTCHA mod changes the post functions of SMF and compare it to the code in this mod.
Title: Re: Custom Form Mod
Post by: Kimmen on July 22, 2011, 11:57:25 AM
Okay, so i have this issue:

Got some help to upgrade my forums form SMF2 RC4 to SMF 2.0 final. All mods went missing, so i started to re-install them all. When i installed this mod, all forms etc came back. But when i want to enter a form, it just wont display to me. I got a form for join us, when clicking it, it takes me to the overview, where u can see all the forms. When i want to enter any specific forms, it wont allow me, no errors, just as if it was not there. Here is a link to my website: www.efclan.eu

ill make them available to guest..

EDIT:
"Due to conflicts with mod_security, the url syntax "index.php?action=form;id=#" has been changed to, "index.php?action=form;n=#" Thanks to Galatea and Arantor for the fix."

This is my problem, when i change my link from: http://www.efclan.eu/index.php?action=form;id=1
To this: http://www.efclan.eu/index.php?action=form;n=1

It shows, how to make that permanent??
Have i installed this the wrong way? is it still old files present somewhere?? Maybe my database is not correct? This i need some help on.
Title: Re: Custom Form Mod
Post by: Garou on July 22, 2011, 02:02:51 PM
Probably your best bet would be to back up the DB tables cf_forms and cf_fields, uninstall the mod, manually remove those tables from the DB, reinstall the mod then add the tables back in. Somewhere in this thread I recommend that with every update of the mod anyway. For some reason the mod doesn't like being installed over the old DB tables and causes issues.

There was one update where I added a column to one of the tables (I forget which), with that update dropping the tables back in didn't always work either. You had to install the mod fresh and recreate all the forms.  :(
Title: Re: Custom Form Mod
Post by: Kimmen on July 22, 2011, 02:27:29 PM
Would you be so kind and do that for me? I am no good using Mysql and Db stuff. I do manage to follow steps and find files etc, and edit them with the info people give me. In other words, a noob lol. If its okay for you to help me, just send me a PM, and ill give you the details you need.

Greets
Kimmen
Title: Re: Custom Form Mod
Post by: Garou on July 23, 2011, 06:44:57 PM
No, I dont do that kind of work anymore. It would take admin access to your site, not just the forums but the site itself to be able to manipulate the db manually. There is a post someplace in this thread and all over these forums detailing how to do that process using phpMyAdmin. Most hosts offer that to their clients or there are other programs that work similar.

Sorry.
Title: Re: Custom Form Mod
Post by: Eclipse16V on July 24, 2011, 03:48:34 AM
Thanks for this MOD
Title: Re: Custom Form Mod
Post by: studiowi33 on July 25, 2011, 09:16:30 PM
Helluva job Garou (et.al.)! I started to use this an hour or 2 ago, and I worked my way thru your tutorial. I ran into a couple of things that didn't immediately register, but by & large, this is an incredible feat of coding. Your perseverance is duly noted and appreciated.

Thank you.

s.w
Title: Re: Custom Form Mod
Post by: zombietuesday on July 26, 2011, 09:05:45 AM
First and foremost, let me thank you for making this excellent mod. I have found it very easy to install and configure.

One thing I can't seem to do at the minute is make it so it is the default for a new topic, so if for instance a reader goes to a board (say for instance sales items) which I have attached this form to, any new topics I would like to use my created from rather than the standed post form (however replies should be normal) Is there a way of doing this ? Kind regards M
Title: Re: Custom Form Mod
Post by: studiowi33 on July 26, 2011, 01:11:19 PM
After thinking everything was going swimmingly, I checked the Error Log and found 30 pages of:


8: Undefined index: 8
Apply Filter: Only show the errors from this file
File: /home/theozcc1/public_html/Sources/ManageSettings.php
Line: 2785


but i have Undefined index: 4, 5, 6, 7, & 8 as well as the above example.

I don't think that it's a mod_security issue...i php infoed and there was no trace of mod security found.

Any ideas?

As always, any insight is appreciated.

-s.w

EDIT: I entered a new url for the redirect, and all my errors vanished.
Title: Re: Custom Form Mod
Post by: Goss on July 26, 2011, 08:47:54 PM
I just installed this mod on my forum and I'm loving it!  I'm in the process of getting my first form setup and was wondering if there was a way to increase the size of the text field when setting up a field.  I have some pretty lengthy directions I need to include in some places, and they currently don't fit. 

I browsed through the thread for a bit already, but haven't found any similar questions asked yet.

I'm using SMF 2.0 RC4.  Thanks!
Title: Re: Custom Form Mod
Post by: Garou on July 27, 2011, 08:30:57 AM
zombietuesday, there is nothing in the mod for that at the moment, I have never got it to work right. Check out this tip by some fellow users,  http://www.simplemachines.org/community/index.php?topic=248871.msg2241024#msg2241024

studiowi33, Ill look into that, do you get the error when using any of the other options for the submit redirect? Check the help file by clicking on the [?] next to the field for a list of options available.

Gross, the limitation is created by the type of database entry used and what limits your you host has set for it in MYSQL. That is why I created the "info box" This allows you to add extra instructions or any other type of text between questions without requiring user input. 
Title: Re: Custom Form Mod
Post by: zombietuesday on July 27, 2011, 08:10:44 PM
Many thanks!

will look it up tomorrow!
Title: Re: Custom Form Mod
Post by: FireAllianceNX on July 28, 2011, 01:05:36 PM
I actually don't use SMF's CAPTCHA. Where should I start to look to see how reCAPTCHA work. It's a lot of stuff to wad through (and I'm not a real programmer :( )
Title: Re: Custom Form Mod
Post by: zombietuesday on July 28, 2011, 01:42:36 PM
Quote from: 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)



Hi Thanks for this .. Im using V2 .. and when i try this mod of yours .. all my buttons disappear! Any idea what I'm doing wrong ? Im no programmer :(

Thanks!
Title: Re: Custom Form Mod
Post by: FireAllianceNX on July 28, 2011, 04:00:55 PM
Alright, so I attempted to go through a reCAPTCHA "install" for the custom form mod.
I would like to put it in the default template in CustomForm.template.php. The reCAPTCHA form doesn't come up.

This is pasted after // Display visual verification on the form

// reCAPTCHA form
echo '
<tr class="windowbg2">
<th width="50%" align="right">
<label for="recaptchaEnable_check">', $txt['recaptcha_enabled'], '</label>:
</th>
<td width="50%" align="left">
<input type="checkbox" name="recaptchaEnable" id="recaptchaEnable_check" ', !empty($modSettings['recaptcha_enabled']) ? 'checked="checked"' : '', ' class="check" />
</td>
</tr><tr class="windowbg2">
<th width="50%" align="right">
<label for="recaptchaTheme">', $txt['recaptcha_theme'], '</label>:
</th>
<td width="50%" align="left">
<select name="recaptchaTheme" id="recaptcha_theme_select">
<option value="clean"', empty($modSettings['recaptcha_theme']) ? ' selected="selected"' : '', '>', $txt['recaptcha_theme_clean'], '</option>
<option value="blackglass"', !empty($modSettings['recaptcha_theme']) && $modSettings['recaptcha_theme'] == "blackglass" ? ' selected="selected"' : '', '>', $txt['recaptcha_theme_blackglass'], '</option>
<option value="red"', !empty($modSettings['recaptcha_theme']) && $modSettings['recaptcha_theme'] == "red" ? ' selected="selected"' : '', '>', $txt['recaptcha_theme_red'], '</option>
<option value="white"', !empty($modSettings['recaptcha_theme']) && $modSettings['recaptcha_theme'] == "white" ? ' selected="selected"' : '', '>', $txt['recaptcha_theme_white'], '</option>
</select>
</td>
</tr><tr class="windowbg2" valign="top">
<th width="50%" align="right">
<label for="recaptchaPublicKey_input">', $txt['recaptcha_public_key'], '</label>:
</th>
<td width="50%" align="left">
<input type="text" name="recaptchaPublicKey" id="recaptchaPublicKey_input" value="', !empty($modSettings['recaptcha_public_key']) ? $modSettings['recaptcha_public_key'] : '', '" size="40" maxlength="40" />
</td>
</tr><tr class="windowbg2" valign="top">
<th width="50%" align="right">
<label for="recaptchaPrivateKey_input">', $txt['recaptcha_private_key'], '</label>:
</th>
<td width="50%" align="left">
<input type="text" name="recaptchaPrivateKey" id="recaptchaPrivateKey_input" value="', !empty($modSettings['recaptcha_private_key']) ? $modSettings['recaptcha_private_key'] : '', '" size="40" maxlength="40" />
</td>
</tr><tr class="windowbg2" valign="top">
<td colspan = "2" align="center">',
$txt['recaptcha_no_key_question'],' <a href="http://recaptcha.net/api/getkey?app=recaptcha_for_smf&amp;domain=', $_SERVER['SERVER_NAME'], '">', $txt['recaptcha_get_key'], '</a>
</td>
</tr><tr class="windowbg2">
<td width="100%" colspan="2" align="center">
<hr />
</td>';


I don't see anything unusual about it for it to not come up. :/
Title: Re: Custom Form Mod
Post by: Kimmen on July 29, 2011, 03:50:48 AM
Ive got another issue.

After all forms are created, i set the permissions. i don't know when and how it happens, but the permissions sometimes "reset" back to admin only. This is a real pain, since i have made it for applications to join my clan, also for making new bans on gameserver we own. We also use it for contact us, and all this is removed, by the form changing permissions on its own. Can the creator or someone, please digg into this?
Title: Re: Custom Form Mod
Post by: Raths Rants on August 10, 2011, 10:40:26 AM
Quote from: Kimmen on July 29, 2011, 03:50:48 AM
Ive got another issue.

After all forms are created, i set the permissions. i don't know when and how it happens, but the permissions sometimes "reset" back to admin only. This is a real pain, since i have made it for applications to join my clan, also for making new bans on gameserver we own. We also use it for contact us, and all this is removed, by the form changing permissions on its own. Can the creator or someone, please digg into this?

This happens to me from time to time also. Not sure why. What I finally ended up doing was creating an account for each permission group. So if a problem arises I can log into that test user and normally find the issue quicker then when I am using my admin account. Great way to test your own forum also.

I guess I am a control freak. I like to know exactly what my users can and cannot see based on their group  ::)
Title: Re: Custom Form Mod
Post by: Alb0 on August 11, 2011, 12:33:17 PM
Quote from: Kimmen on July 29, 2011, 03:50:48 AM
Ive got another issue.

After all forms are created, i set the permissions. i don't know when and how it happens, but the permissions sometimes "reset" back to admin only. This is a real pain, since i have made it for applications to join my clan, also for making new bans on gameserver we own. We also use it for contact us, and all this is removed, by the form changing permissions on its own. Can the creator or someone, please digg into this?

Having the same issue. It's really starting to irritate me, as I have to check up on it every time.
Title: Re: Custom Form Mod
Post by: frytec on August 21, 2011, 06:45:45 PM
hey, how can i allow more characters on 'infobox' ??????????
Title: Re: Custom Form Mod
Post by: TPT on August 22, 2011, 08:36:17 PM
Just a heads up that for the default theme in English on 2.0, I was able to get the Form to come up properly by modifying this line:

   'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=form;id=1' . $context['current_board'] . '.0', 'active' => true),


The fix from the earlier posts about doing this was to change '?action=form;id=1' to '?action=form;n=1'

Title: Re: Custom Form Mod
Post by: TPT on August 22, 2011, 11:41:09 PM
Is there a way (or would it be possible) to have a form field pre-populate a profile field?

What I would like to do is to have a form for member introductions and have the form business name field prepopulate the Profile - "custom title" field.
Title: Re: Custom Form Mod
Post by: Garou on August 23, 2011, 10:46:43 PM
zombietuesday, Sorry that is the code for that is an older version of the mod, check where its says something like ?action=form;id=1 and change it to ?action=form;n=1

FireAllianceNX, There is code for CAPTCHA in a couple other places that will probably need to be changed as well.

rathsrants & Alb0 The permissions issue is a known problem that a fix was never found for. I happens every time you add a new user group or change permissions for an existing user group. For some reason it resets all the form permissions.

frytec, you have to manually edit the cf_forms database table and change the type for the column text from tinytext to something else.

TPT sorry, this mod only creates posts.
Title: Re: Custom Form Mod
Post by: frytec on August 24, 2011, 12:01:40 PM
Quote from: frytec on August 21, 2011, 06:45:45 PM
hey, how can i allow more characters on 'infobox' ??????????
Title: Re: Custom Form Mod
Post by: Eclipse16V on August 25, 2011, 12:54:50 AM
Quote from: frytec on August 21, 2011, 06:45:45 PM
hey, how can i allow more characters on 'infobox' ??????????

The same problem and another. How do I get it out the more you can drop down to select?
Title: Re: Custom Form Mod
Post by: Garou on August 26, 2011, 09:55:07 PM
Quote from: Garou on August 23, 2011, 10:46:43 PM
frytec, you have to manually edit the cf_forms database table and change the type for the column text from tinytext to something else.

To elaborate, you would need to use a program like phpmyadmin to manually change the database. in your forum database look for the table "cf_forms" and change the properties for the column "text"

The more characters you allow the greater toll you can put on your database potentially bogging down your site.

TINYTEXT: maximum length of 255 characters.

TEXT: maximum length of 65535 characters.

MEDIUMTEXT: maximum length of 16777215 characters.

LONGTEXT: maximum length of 4294967295 characters.

Eclipse16V, same solution but the column is type_vars. Unless you are looking for multi-tier selection boxes in which case it can not be done with this type of program, you would need to custom build a stand alone form/webpage to handle something like that.
Title: Re: Custom Form Mod
Post by: frytec on August 27, 2011, 02:44:03 PM
@garou
got it.. thank you.
Title: Re: Custom Form Mod
Post by: tectonny on August 29, 2011, 06:11:48 PM
Hello,
Dear, you can capture the user ID and email registration? If so what procedure?
Title: Re: Custom Form Mod
Post by: akronwarrior on September 13, 2011, 06:08:36 PM
Hows it goin,
    first off this is an epic mod i have been looking for one for a while now and finally came across this.

I am running SMF 2.0 RC3, i have installed this mod everything seems to have installed correctly and all but after making a form and then checking the form selection page there are no froms to be selected. Its almost like its not putting the forms in to be selected. Is there a code set some where i need to modify or do i need to use the v1.1 instead of the v1.7?


EDIT: problem fixed.

another question: I am trying to get it so an image is at the top of the application to correspond with the section applying for. how would i introduce this into the app?
Title: Re: Custom Form Mod
Post by: Eclipse16V on September 14, 2011, 09:55:54 AM
Hello,
either I'm too stupid or the mod will not run properly with SMF 2.0. If this mod is filled with a form, the user gets no post more in its statistics. Exactly on the contrary, the value is set to 0 down. Is this a bug or do you still make a difference? Posts are counted in the entire forum just not in the profile of the user.
Title: Re: Custom Form Mod
Post by: minhajnyc on September 17, 2011, 11:24:35 AM
Hello,

Just want to say what a fantastic mod. Can't tell you how grateful I am to find this mod.

I do have a question however and I apologize in advance as I'm not an expert with this kind of stuff. I just fumble my way thru things till it works lol.

So, I've installed the mod, read the documentation and tried to understand as much as I could. I've created a form and entered all the required fields. The form works beautifully and even posts the "topic" in the forum section that I would like it to.

My only problem is that once I click that topic in that forum there's nothing. No text, just a blank post. I see the posters name but there's nothing in that post. What did I do wrong? Can someone please help? that's the only thing missing from this beautiful mod working perfectly :(

Thank you kindly
Title: Re: Custom Form Mod
Post by: Kimmen on September 17, 2011, 01:26:56 PM
You need to setup what info should be sent to the forumpost.

Form Output.

Mine looks like this:

[u][b]Your Ingame Nick:[/b][/u]
[color=pink][b]{name}[/b][/color]

[u][b]Your E-mail:[/b][/u]
[color=pink][b]{email}[/b][/color]

[u][b]Subject:[/b][/u]
[color=pink][b]{subject}[/b][/color]


{name} - {email} - {subject} are some of the things i have in the form, which i want to read in the post. You have to use "title" in the form output to make it display.
Title: Re: Custom Form Mod
Post by: minhajnyc on September 17, 2011, 01:50:12 PM
Editing this post:

I've solved the problem. stupid me forgot that the author said specifically to turn OFF WSIYWIG editor and turn on BBCode before saving the form output. Once I did that voila, form works perfectly.

Thanks again all
Title: Re: Custom Form Mod
Post by: RedtopX on September 19, 2011, 01:44:59 PM
Hi, I am using this MOD in SMF2.0

I want to know if I can add "Submit Redirect" Javascript option?

Ex: http://www.hyperized.net/index.php?req=jack/cod4rankconfiggen,en
Title: Re: Custom Form Mod
Post by: donquixote1 on September 28, 2011, 09:58:28 AM
Hello I am trying to use this mod and in the test it works fine.  The only problem I have is the list of groups, I can't seem to see any more other than Guest, Regular Members and Global Moderator.

How do I get more to show up on that list?  I am maybe missing something obvious here.

Also is it possible to get the text in form fields to be bigger than the black, small text that shows up on the completed form?  I just wanted to make it a bit bigger and maybe add a colour?

Any help here would be great, thanks.
Title: Re: Custom Form Mod
Post by: donquixote1 on September 28, 2011, 03:22:14 PM
Okay I have investigated more I see Guest, Regular Members and Global Moderator are permission groups, and the groups I mentioned above are member groups.

I have over 60 membergroups.  I want each to use a form, the same form, but post in their own board.  I see I can do this by making a separate form for each one.  I don't want to have to do this.  Is there a way to have one form available for all to post in separate  blogs?

Again any help would be appreciated.

I still don't know how to change the text size and colour in form fields, help here would be good too.

Thanks
Title: Re: Custom Form Mod
Post by: Azphat12 on September 29, 2011, 10:16:41 PM
Need some help....
I am currently going through the many pages...but figured I would post incase someone reads it before I find it.

I am getting this error...

You 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
Line: 627

I believe that refers to this section.

$request = db_query("
SELECT title, filename
FROM {$db_prefix}message_icons
WHERE ID_BOARD IN (0, $board)", __FILE__, __LINE__);
$icon_data = array();
while ($row = mysql_fetch_assoc($request))
$icon_data[] = $row;
mysql_free_result($request);

cache_put_data('posting_icons-' . $board, $icon_data, 480);


I am not overly familiar with proper code...but I have tried changing this line.
WHERE ID_BOARD IN (0, $board)", __FILE__, __LINE__);

Nothing is working so far....
Title: Re: Custom Form Mod
Post by: luuuciano on September 29, 2011, 11:48:02 PM
ok... line 3... wich file?
Title: Re: Custom Form Mod
Post by: Azphat12 on September 30, 2011, 12:37:00 AM
ModSettings.php

I have added it as an attachment.

I should add that I can see the Form tab and set permissions and everything.
When I click "Add new form" it gives me that error above.
Then when I refresh it will say this...

   0 ("Invalid Board")

In the place where I assume a newly created form would be.
Title: Re: Custom Form Mod
Post by: Azphat12 on October 01, 2011, 08:39:48 PM
Installed SMF 2.0.1 instead.  Mod is working.... now to figure out how to create a good form.
Title: Re: Custom Form Mod
Post by: Azphat12 on October 01, 2011, 10:20:27 PM
Ok new question!

Mod working great.  I have everything working as intended....however....

I want to make some separation to the form itself....everything looks cramped.

I found if I make a new field as an info box....that it gives my sections "headings" so to speak.
I want to make those larger...so you can really see the separation and clean the looks up.
Right now everything is kind of cramped together on the form.

The output into a post is awesome.....just cant figure out how to make the form itself look better.

Any ideas?

Here is a brief idea of what I am trying....

General Information

blah blah blah
blah blah blah

Personal Information

blah blah blah
blah blah blah

Detailed Information

blah blah blah
blah blah blah

I am trying to get those headings a different size and or color so they stand out on the form when people are filling it out.
Title: Re: Custom Form Mod
Post by: dazer7 on October 05, 2011, 11:21:12 AM
is possible to insert images? In the selection box I would put for example 10 football teams, when i Post the logo appears

Title: Re: Custom Form Mod
Post by: dimdom on October 09, 2011, 02:25:48 AM
Quote from: Eclipse16V on September 14, 2011, 09:55:54 AM
Hello,
either I'm too stupid or the mod will not run properly with SMF 2.0. If this mod is filled with a form, the user gets no post more in its statistics. Exactly on the contrary, the value is set to 0 down. Is this a bug or do you still make a difference? Posts are counted in the entire forum just not in the profile of the user.

Same problem here. I use latest versions of this mod and SMF
Title: Re: Custom Form Mod
Post by: frytec on October 17, 2011, 03:45:50 PM
hey my guest permission to view forms are becoming disabled from time to time.

Every time i have to edit the form again to set guest permission.

why is that happening?
Title: Re: Custom Form Mod
Post by: FragaCampos on October 20, 2011, 12:22:20 PM
Normally, that happens when you change the id of a group or create a new one. It's a known bug, so you must build the forms' permissions every time you change your group members.
Title: Re: Custom Form Mod
Post by: Saiyan1337 on October 21, 2011, 07:10:20 PM
Im not sure why Im getting this error. The site was installed last night and is running 2.0.1. The theme is 2.0.1 as well.

Title: Re: Custom Form Mod
Post by: DanCarroll on October 24, 2011, 09:57:17 AM
Installed the Custom Form Mod and it works as far as the Modifications Settings => Custom Forms go. My problem is I can't get the forms action to work. I am new to this and using SMF 2.0.1. Shouldn't "index.php?action=forms" work?


EDIT: Fixed! The instructions with the mod say to use "index.php?action=forms" but doesn't work. Checked with the mods index and the note there says to use "form", not the plural 'forms'. Changed it and it works fine. Thanks everyone.
Title: Re: Custom Form Mod
Post by: DanCarroll on October 24, 2011, 10:23:57 AM
Database Integration

Has anyone been able to use this mod to integrate with, or post to, a data file? I would love to be able to use some forms for data collection.


ADD: Okay, I see that the Custom Form Mod is designed to post to Boards. I see that the creator as posted "At some point we will write a tutorial explaining how to create a stand alone form and database and information page, that ties to SMF and can even create a forum post." on his website.  Now if I can just find something like that.
Title: Re: Custom Form Mod
Post by: dorje77 on October 24, 2011, 10:39:49 AM
Quote from: DanCarroll on October 24, 2011, 10:23:57 AM
Database Integration

Has anyone been able to use this mod to integrate with, or post to, a data file? I would love to be able to use some forms for data collection.

I use this mod to obtain posts/thread in a hidden section (ignored by the index: http://forum.artistimarziali.net/index.php?board=121), that are then read by another script (via SSI) to display as records in a particular page:

http://www.artistimarziali.net/?page=eventi

A second form is used with a similar system to collect data for a map:

http://www.artistimarziali.net/?page=scuole
Title: Re: Custom Form Mod
Post by: DanCarroll on October 24, 2011, 01:00:05 PM
Thanks dorje77. I may look into your solution sometime. I really need a standalone form (page) with database access that will integrate with SMF. Looks like a project I might have to complete on my own. But the creator of Custom Form Mod posted this on his website: "At some point we will write a tutorial explaining how to create a stand alone form and database and information page, that ties to SMF and can even create a forum post."

If only that was available now.
Title: Re: Custom Form Mod
Post by: dorje77 on October 25, 2011, 04:17:01 AM
Quote from: DanCarroll on October 24, 2011, 01:00:05 PM
Thanks dorje77. I may look into your solution sometime. I really need a standalone form (page) with database access that will integrate with SMF. Looks like a project I might have to complete on my own. But the creator of Custom Form Mod posted this on his website: "At some point we will write a tutorial explaining how to create a stand alone form and database and information page, that ties to SMF and can even create a forum post."

If only that was available now.

But why you want to use Custom Form? It's purpouse is to generate posts in boards with "blocked" fields/layout. If you have to connect to another database, the best way is to forward users to another form.

If you prefer Custom Form just for SMF theme integration, it is easy moddable also to work with other databases. :)
Title: Re: Custom Form Mod
Post by: frytec on October 25, 2011, 12:04:43 PM
For SEO porposes, i need to set up title for the form page.

so im wondering, how can i make the title bar show the form name, and not the url of the form?

thanks.
Title: Re: Custom Form Mod
Post by: DanCarroll on October 25, 2011, 02:03:01 PM
dorje77, thanks for the interest. Was just looking for a shortcut to creating forms tied  to database. Unless I come up with something else,
I will have to hand-craft the form. Maybe a mod to act as a database manager complete with a form & report editor? Hmmm, that's an idea.
Title: Re: Custom Form Mod
Post by: DanCarroll on October 25, 2011, 02:19:39 PM
frytec, the Custom Form Mod Settings -> View Forms Title setting will show up as the page title. Other than that, only thing I can think of is to hand-code an
action/template combo and code in your Page Title there.
Title: Re: Custom Form Mod
Post by: frytec on October 25, 2011, 02:26:57 PM
Dan, that setting is for the list of forms, i need title to each form.
Title: Re: Custom Form Mod
Post by: DanCarroll on October 28, 2011, 12:58:12 PM
Well frytec, I'm sure it could be done but may have to mod the mod. Or code it by hand. May not really need coding but some file additions, mods, to have
it show up as the Page Title.

Have you done any file manipulations already to get what you want? Try a search on adding a page title to custom actions.

Let me know how it goes. I have some mods to mods in mind myself now. I don't allow guest access and some mods show themselves up in the Guest
login. I need to hide this so will search the mod boards for others who may have already done this. Or will do it by hand with an idea to update the
individual mods.
Title: Re: Custom Form Mod
Post by: DanCarroll on October 28, 2011, 06:22:08 PM
Hey frytec, I have your answer. Are you ready?

Edit CustomForm.php in Sources. Go to the bottom of the file and look for the following:

// Set the page title, just for lolz! :D
$context['page_title'] = (isset($modSettings['CustomForm_view_title']) &&
    ($modSettings['CustomForm_view_title'] != '')) ? $modSettings['CustomForm_view_title'] :
    $txt['CustomForm_tabheader'];

**Did you find it? Insert this line:
$context['page_title'] = $form_title;
And comment out the last line. You only need 1 page_title. Of course, if you put the new line for the page title under the old one it take precedence.
Have fun! And in case these instructions don't make sense, here is what the last few lines of my CustomForm.php file looks like.

// Set the page title, just for lolz! :D
$context['page_title'] = $form_title;
//$context['page_title'] = (isset($modSettings['CustomForm_view_title']) && ($modSettings['CustomForm_view_title'] != '')) ? $modSettings['CustomForm_view_title'] : $txt['CustomForm_tabheader'];
}
?>
Title: Re: Custom Form Mod
Post by: DanCarroll on October 28, 2011, 07:24:02 PM
How about a correct link tree AND page title?

Edit the CustomForm.php and replace

// Set the page title, just for lolz! :D
$context['page_title'] = (isset($modSettings['CustomForm_view_title']) &&
                ($modSettings['CustomForm_view_title'] != '')) ? $modSettings['CustomForm_view_title'] : $txt['CustomForm_tabheader'];


with

// Set the page title, just for lolz! :D
$context['page_title'] = (isset($modSettings['CustomForm_view_title']) &&
                ($modSettings['CustomForm_view_title'] != '')) ? $modSettings['CustomForm_view_title'] : $txt['CustomForm_tabheader'];

// setup the link tree to follow the form
$context['linktree'][] = array(
'url' => $scripturl. '?action=form',
'name' => $modSettings['CustomForm_view_title'],);

if ($form_title != "")
{
$context['page_title'] = $form_title;
$context['linktree'][] = array(
'url' => $scripturl. '?action=form;sa=n=1',
'name' => $form_title,);
}


Title: Re: Custom Form Mod
Post by: DanCarroll on October 30, 2011, 10:53:36 AM
Modifying the Custom Form mod was fun and educational. Now I would like to be able to have a form open in the same browser tab. Does anyone have a fix for this?
Title: Re: Custom Form Mod
Post by: frytec on November 16, 2011, 10:51:21 AM
DanCarroll, thank you dude.. It works 100%! Nice job with the title and linktree.
Only one more question, how can i add a linktree before the form name?
MySite > MyForm1


About your question, what do you mean by "open in the same browser tab"? Here all my forms opens in same tab.

Title: Re: Custom Form Mod
Post by: Saiyan1337 on November 16, 2011, 10:12:17 PM
Can we get this updated for 2.0.1 ??? i also have uninstall some mods so i dont get errors... thats not right
Title: Re: Custom Form Mod
Post by: Saiyan1337 on November 26, 2011, 12:19:47 PM
Bump. If I seem impatient its because my clan is in dire need of this working again. So I'm sorry if I do seem impatient.
Title: Re: Custom Form Mod
Post by: drguild on December 03, 2011, 06:04:21 AM
Looking at the form seems cool one thing letting me down on my requirements.

Image upload.

We run a minecraft game server and want to use this form mod to take place of user registrations as new members keep not posting there requests properly as we have a set of questions linked about 4 times around the place and there still like posts the crappy threads of 'can I be member'

Our server requires that all potential players can prove they can build before we even consider there application and is done on a screenshot.

Sure we can have players link to external sites like imgshack etc but we have been using the inbuilt smf system to upload images and if theirs a way to integrate that into this form id like to know thanks.
Title: Re: Custom Form Mod
Post by: r2d2-trader on December 03, 2011, 11:47:26 AM
i would also appreciate if there is a possibility for uploading/inserting images similar like using the 'inline attachments mod' mod for attachments in topics. So a special upload 'box' would be great.

some ideas?

8) Rob
Title: Re: Custom Form Mod
Post by: mabley on December 04, 2011, 11:20:58 PM
How do I change the content of the 'thankyou' redirect page?
Title: Re: Custom Form Mod
Post by: DanCarroll on December 06, 2011, 06:25:51 AM
Request: How about option to send (email) notifications to a group when form is submitted? This would be great in tracking requests for help.
Title: Re: Custom Form Mod
Post by: Nameless? on December 09, 2011, 11:35:37 AM
Hi, how may i include this mod on a php page outside SMF with SSI?
Im looking for a way to let my visitors make a bug report of whatever the error is on the site on a different page that is more SEO friendly, e.g "www.domain.com/report-site-errors" and not the default page located at "www.domain.com/forums/index.php?action=form;n=X".

Let me know, Thanks.
Title: Re: Custom Form Mod
Post by: Saiyan1337 on December 09, 2011, 07:39:28 PM
Would it be possible to get the forms posted to a board on another site? because the site im using now is a sub domain and im trying to get it posted to the main domain site. Thanks
Title: Re: Custom Form Mod
Post by: Biology Forums on December 29, 2011, 12:59:31 AM
Quote from: r2d2-trader on December 03, 2011, 11:47:26 AM
i would also appreciate if there is a possibility for uploading/inserting images similar like using the 'inline attachments mod' mod for attachments in topics. So a special upload 'box' would be great.

some ideas?

8) Rob

I really like this idea, has anyone worked on it yet?
Title: Re: Custom Form Mod
Post by: Lord991 on January 05, 2012, 07:35:31 PM
When I try to install this mod for 1.1.16 SMF the error shows up...

Database Error
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=MyISAM' at line 12
File: C:\wamp\www\test\Packages\temp\install.php
Line: 18

Any help please? :(
Title: Re: Custom Form Mod
Post by: kasparh on January 16, 2012, 01:34:16 PM
Quote from: donquixote1 on September 28, 2011, 03:22:14 PM
Okay I have investigated more I see Guest, Regular Members and Global Moderator are permission groups, and the groups I mentioned above are member groups.

I have over 60 membergroups.  I want each to use a form, the same form, but post in their own board.  I see I can do this by making a separate form for each one.  I don't want to have to do this.  Is there a way to have one form available for all to post in separate  blogs?

Again any help would be appreciated.
Thanks
I have the same problem of donquixote, any suggestion ? More than 50 boards and 2 main group, but seems i need to prepare 50 different templates (even if is the same tamplate, but posted on different board) to be able to use it.
Any suggestions?
Help very much appreciated
kasparh
Title: Re: Custom Form Mod
Post by: Biology Forums on January 16, 2012, 05:39:55 PM
Quote from: Lord991 on January 05, 2012, 07:35:31 PM
When I try to install this mod for 1.1.16 SMF the error shows up...

Database Error
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=MyISAM' at line 12
File: C:\wamp\www\test\Packages\temp\install.php
Line: 18

Any help please? :(

I'm using 1.1.16 and it works, must be something wrong with another mod you've installed previously.
Title: Re: Custom Form Mod
Post by: DBan on January 22, 2012, 06:30:48 PM
Is there any way to put a "minimum" amount of words allowed in a text box. Like let's say I want a minumum of 100 words in a question, and if there isn't, it'll tell the user to fix it.

Any way to do this?
Title: Re: Custom Form Mod
Post by: Biology Forums on January 22, 2012, 08:05:29 PM
Quote from: DBan on January 22, 2012, 06:30:48 PM
Is there any way to put a "minimum" amount of words allowed in a text box. Like let's say I want a minumum of 100 words in a question, and if there isn't, it'll tell the user to fix it.

Any way to do this?

maxlength="60"
Title: Re: Custom Form Mod
Post by: Arantor on January 22, 2012, 08:23:52 PM
That limits the size of a regular textbox to the maximum of 60 characters. What's being asked for here is the minimum number of characters in a textarea (which doesn't use maxlength anyway) and even if it did, we're not interested in it being too long but too short.

There are ways but they're all quite long and complicated to get right and are often unreliable (speaking from experience of writing mods that handle min/max word counts)
Title: Re: Custom Form Mod
Post by: bigjoe11a on January 31, 2012, 09:29:04 AM
Do I have to uninstall this mod in order to update my forum. and Then I have to reinstall the mod.
Title: Re: Custom Form Mod
Post by: Eclipse16V on February 05, 2012, 12:13:34 PM
Hello,
how can I make it that in a DopDown the first option is an empty field.
Title: Re: Custom Form Mod
Post by: Eclipse16V on February 10, 2012, 08:07:10 AM
Why are not actually counted the posts if you fill out a form?
Title: Re: Custom Form Mod
Post by: FragaCampos on February 12, 2012, 12:22:01 PM
Quote from: Eclipse16V on February 10, 2012, 08:07:10 AM
Why are not actually counted the posts if you fill out a form?

You have the answer and fix for that somewhere in this thread. You have to look for it.
Title: Re: Custom Form Mod
Post by: xiCanadian on February 14, 2012, 12:48:45 AM
Upgrade to 2.0.2 please..
Title: Re: Custom Form Mod
Post by: Paybacks on February 19, 2012, 01:37:11 AM
I just installed this mod and have it set up like an application that can be submitted to an Applications board within its own Apply category. The Applications board is setup such that it is visible for a certain rank or higher. I would like to know if it is possible to have a setup where a newly registered member who just submitted this application(which obviously gets sent to the Applications board) could see their application thread inside this board, but only that thread(since they are newly registered they do not have the required rank to see the board/category in general). Basically, if you are not an officer rank or higher, you can only view the Applications board if you have a thread that you created inside it - and that would be the only thread within the board you could view.

I am not sure if this could be accomplished through settings with this mod or just general SMF settings(or at all), but any help would be appreciated!

Liking the mod a lot,
Thank you!
Title: Re: Custom Form Mod
Post by: phebos on February 21, 2012, 08:43:22 PM
Quote from: Saiyan1337 on October 21, 2011, 07:10:20 PM
Im not sure why Im getting this error. The site was installed last night and is running 2.0.1. The theme is 2.0.1 as well.



having same error is there any fix, running smf 2.0.2
Title: Re: Custom Form Mod
Post by: MC73 on February 21, 2012, 08:48:37 PM
Just manually parse the file and it would then work
Title: Re: Custom Form Mod
Post by: Jerri Blank on March 05, 2012, 12:42:44 AM
I want to use this form to allow guests to apply for membership, with the submissions going to a board that only administrators can see.  Is this even possible?  I'm guessing that if I make that board "postable" by guests, it will also be visible to guests, which would not be good.  Any suggestions?
Title: Re: Custom Form Mod
Post by: Eclipse16V on March 05, 2012, 07:06:49 AM
Quote from: Eclipse16V on February 05, 2012, 12:13:34 PM
Hello,
how can I make it that in a DropDown the first option is an empty field.
Can any one help me?
Title: Re: Custom Form Mod
Post by: fedxrx on March 06, 2012, 12:14:49 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: King Death II on March 15, 2012, 12:34:28 PM
Does this work for the newest version of SMF?
Title: Re: Custom Form Mod
Post by: King Death II on March 17, 2012, 01:01:15 PM
So.. does anyone know?
Title: Re: Custom Form Mod
Post by: Eclipse16V on March 22, 2012, 01:10:56 AM
Yes it´s working with 2.0.2
Title: Re: Custom Form Mod
Post by: teos55 on April 12, 2012, 04:21:02 PM
SMF 2.0.2 Simple portal 2.3.5  default theme

installed the mod.  Modified modification.mylanguage-utf8.php  for local language

created the fields to be used in the form.

When I press submit/save button, nothing created in the specified category.

error log :

"http: // mysite . org/index.php?action=admin;area=modsettings;sa=customform;form_id=1;8: Undefined variable: board
file: /home/user/public_html/Sources/ManageSettings.php
Satır: 2513"


lines around 2513 are :

$context['categories'][$row['id_cat']]['boards'][] = array(
            'id' => $row['id_board'],
            'name' => strip_tags($row['name']),
            'category' => strip_tags($row['cat_name']),
            'child_level' => $row['child_level'],
            'selected' => !empty($_SESSION['move_to_topic']) && $_SESSION['move_to_topic'] == $row['id_board'] && $row['id_board'] != $board,
         );


Any guidance will be highly appreciated.


nb.
When I execute  www. mysite . com/index.php?action=form;n=1

I see the form and can fill in .  when I press save, the topic is created.  The format of the output is not user friendly tough.
I mean all inputs stacked line by line .

Still the "undefined variable: board" seems an issue

OK I got it...  How it works is well explaned in http://smf.balancegames.org/mods/forms/tutorial/create.

A really lazy reader of such manuals .. Shame

Undefined variable borad is still an issue .....
Title: Re: Custom Form Mod
Post by: TelInf on May 08, 2012, 11:55:26 AM
Thx for the mod  ;D

I'ts possible to let the member create the title of the topic?
Title: Re: Custom Form Mod
Post by: Xarkurai on May 13, 2012, 03:50:34 PM
For some weird reason the permission is automatically changing at unknown times.
Meaning, people who want to fill it in can't do it since their permission for it have been changed.

How can this be fixed?
Thanks in advance!
Title: Re: Custom Form Mod
Post by: Alb0 on May 13, 2012, 04:41:57 PM
Quote from: Xarwin on May 13, 2012, 03:50:34 PM
For some weird reason the permission is automatically changing at unknown times.
Meaning, people who want to fill it in can't do it since their permission for it have been changed.

How can this be fixed?
Thanks in advance!

I'm getting this same error at unknown times. The settings are being changed randomly, not allowing some groups to view the forms.
Title: Re: Custom Form Mod
Post by: Biology Forums on May 13, 2012, 10:56:18 PM
Quote from: Alb0 on May 13, 2012, 04:41:57 PM
Quote from: Xarwin on May 13, 2012, 03:50:34 PM
For some weird reason the permission is automatically changing at unknown times.
Meaning, people who want to fill it in can't do it since their permission for it have been changed.

How can this be fixed?
Thanks in advance!

I'm getting this same error at unknown times. The settings are being changed randomly, not allowing some groups to view the forms.

That's because as soon as you change a membergroup permission, it removes the permission you assigned for the form. It's one of those things that the mod author never got to fixing. I know it's very restrictive and it's one thing I really don't like about it.
Title: Re: Custom Form Mod
Post by: Taglar Dreskk on June 20, 2012, 10:39:10 AM
Has anyone looked into replacing the built-in captcha (image verification) for guest posting?  I tried to fill out a form as a guest on my own site and it took me like 8 tries on the captcha because most images are just so unreadable.  I realize this is to keep bots from reading the letters...but damn!  I'm only 30 years old and felt like I needed reading glasses!

Also, I am also in favor of seeing an option to allow the upload of images through the form.  We run a site that uses a membership form that collects data and images of a costume made by the person for approval.  We're currently doing it through a form that emails the data...but if it could be posted straight to the forum with this mod it would be AMAZING.
Title: Re: Custom Form Mod
Post by: DBAllTerrain on June 24, 2012, 12:36:28 PM
I'd like all topics posted using my custom forms to automatically have the 'notify' option set so the poster receives an email on replies. Is this possible?
Title: Re: Custom Form Mod
Post by: DBAllTerrain on June 25, 2012, 03:20:08 PM
Solved my own problem. For others...

In the CustomForm.php file, after the following line:

createPost($msgOptions, $topicOptions, $posterOptions);

I added this:

if (isset($topicOptions['id'])) {
$topic = $topicOptions['id'];
$smcFunc['db_insert']('ignore',
'{db_prefix}log_notify',
array('id_member' => 'int', 'id_topic' => 'int', 'id_board' => 'int'),
array($user_info['id'], $topic, 0),
array('id_member', 'id_topic', 'id_board')
);
}


Seems to work.
Title: Re: Custom Form Mod
Post by: FragaCampos on June 28, 2012, 09:54:33 PM
Thanks for sharing, DBAllTerrain.
Title: Re: Custom Form Mod
Post by: PsYc0TiC on July 29, 2012, 04:29:48 PM
any way to make this be able to upload attachments as well? I want this for submitting cheaters on my game servers

Thanks in advance
Title: Re: Custom Form Mod
Post by: Arantor on July 29, 2012, 04:31:54 PM
Not without a lot of work, attachments is a very, very complicated business to get right.
Title: Re: Custom Form Mod
Post by: PsYc0TiC on July 29, 2012, 05:13:34 PM
sigh then this is useless to me
Title: Re: Custom Form Mod
Post by: Arantor on July 29, 2012, 05:17:05 PM
I'm sorry that something someone made in their free time and generously donated to others for their use doesn't mean your exact, specific, complicated needs.
Title: Re: Custom Form Mod
Post by: PsYc0TiC on July 29, 2012, 05:56:20 PM
I understand that... why the attitude?
Title: Re: Custom Form Mod
Post by: umiya on August 04, 2012, 03:05:47 PM
Is it possible to have multiple answers with maybe a check box, radio box? I have only been able to get it setup where you can only chose one answer.
Title: Re: Custom Form Mod
Post by: thechronic2001 on August 12, 2012, 12:18:16 PM
Hello
I've ran into some problems, yesterday I installed this mod, everything was working fine in regards to the mod working correctly.

Later on I decided to update the smiley set and added a new pack, for some reason now when i go to Admin CP/Features and Options then to custom forms section I get this error

You 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: C:\Inetpub\vhosts\{domain}\httpdocs\{forum_path}\Sources\ModSettings.php
Line: 628


Line 628 of ModSettings.php is as follows

WHERE ID_BOARD IN (0, $board)", __FILE__, __LINE__);


Here is the start of that section down to the first "else"

// Array for all icons that need to revert to the default theme!
$context['javascript_icons'] = array();

if (($temp = cache_get_data('posting_icons-' . $board, 480)) == null)
{
$request = db_query("
SELECT title, filename
FROM {$db_prefix}message_icons
WHERE ID_BOARD IN (0, $board)", __FILE__, __LINE__);
$icon_data = array();
while ($row = mysql_fetch_assoc($request))
$icon_data[] = $row;
mysql_free_result($request);

cache_put_data('posting_icons-' . $board, $icon_data, 480);
}
else


Does anyone have any ideas on how to fix this error?

i installed the mod on my test forum and it worked fine, fully functional, when i installed it on my real forum it installed and worked for a while then all of a sudden it stopped  I've removed and reinstalled the mod but it makes no difference.


My forum Version is as follows:
SMF File                                 Your Version   Current Version
SMF Package                          SMF 1.1.16   SMF 1.1.16
Sources                                         1.1.16   1.1.16
Default Templates                         1.1.12   1.1.12
Language Files                               1.1.15   1.1.15
Current Templates                           1.1.5   1.1

Database server type          MySQL
Database server version          5.0.45


Any help would be greatly appreciated  ;)
Title: Re: Custom Form Mod
Post by: thechronic2001 on August 12, 2012, 08:13:43 PM
I finally got this problem sorted after 2 days looking at random files, basically the above error occurs when you have "Enable customized message icons" in
Admin / Forum / Smileys and Message Icons  / Settings
If the "Enable customized message icons" Checkbox is Checked it Throws this sql error

You 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: C:\inetpub\vhosts\{domain}\httpdocs\{forum_directory}\Sources\ModSettings.php


Just a FYI in case anyone else gets caught out with this problem and spends a few days pulling out the last few stands of hair they have left
Title: Re: Custom Form Mod
Post by: Taglar Dreskk on August 22, 2012, 08:42:23 AM
Quote from: umiya on August 04, 2012, 03:05:47 PM
Is it possible to have multiple answers with maybe a check box, radio box? I have only been able to get it setup where you can only chose one answer.

I'd be interested in this feature as well...
Title: Re: Custom Form Mod
Post by: maddoghalo on August 31, 2012, 04:47:44 PM
When somebody posts the forums, how do I get the thread title to include their forum username?

I use to be able to do it but forgot how. When they click submit it makes a new thread and is says for example: Maddoghalo's Application.
Title: Re: Custom Form Mod
Post by: FrizzleFried on August 31, 2012, 05:33:44 PM
Quote from: PsYc0TiC on July 29, 2012, 05:56:20 PM
I understand that... why the attitude?
Might have something to do with your sense of entitlement?  Hmmm.... could be.

Title: Re: Custom Form Mod
Post by: stylusss on September 07, 2012, 12:09:03 AM
Quote from: DBAllTerrain on June 25, 2012, 03:20:08 PM
Solved my own problem. For others...

In the CustomForm.php file, after the following line:

createPost($msgOptions, $topicOptions, $posterOptions);

I added this:

if (isset($topicOptions['id'])) {
$topic = $topicOptions['id'];
$smcFunc['db_insert']('ignore',
'{db_prefix}log_notify',
array('id_member' => 'int', 'id_topic' => 'int', 'id_board' => 'int'),
array($user_info['id'], $topic, 0),
array('id_member', 'id_topic', 'id_board')
);
}


Seems to work.

Is this for 1.x or 2.x?
Title: Re: Custom Form Mod
Post by: frytec on September 11, 2012, 12:31:20 PM
Please, i need to send an email to admin@mysite each time a form is submitteed and a post is created.

- The reciepient email is always the same.
- The email subject is always the post title.
- The email body is always the post body.

Can someone tell me the easiest way to do that?

Thank you.

Title: Re: Custom Form Mod
Post by: miguel on September 16, 2012, 08:20:44 AM
how mani I put Icons for imput images and other thing whith the normal post in the Large (Multiline) Text Box?
Title: Re: Custom Form Mod
Post by: Xehara on September 24, 2012, 11:33:01 AM
I've made two forms and they work perfectly, however the third doesn't seem to be as charming...

All puns aside, though, I'm using the following plugins on the forums:

Below are screenshots of how I have it set up. I've tried with regular members checked and unchecked, neither work.





It shows up in the list of forms, however when I fill it out it does not submit to the form specified in the settings.
Title: Re: Custom Form Mod
Post by: .Vapor on October 01, 2012, 09:05:33 AM
Quote from: phebos on February 21, 2012, 08:43:22 PM
Quote from: Saiyan1337 on October 21, 2011, 07:10:20 PM
Im not sure why Im getting this error. The site was installed last night and is running 2.0.1. The theme is 2.0.1 as well.



having same error is there any fix, running smf 2.0.2

Open: Sources/Admin.php

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


Add after:    
loadLanguage('Modifications');
Title: Re: Custom Form Mod
Post by: PtCLAN on November 25, 2012, 12:56:23 AM
Does anyone use this for a clan application? If so could you please show me some screen shots or a copy so I can maybe use it? I have no idea how to make it work on our website. All I really want to do is create an application for new members.
Title: Re: Custom Form Mod
Post by: jafonseca on November 27, 2012, 05:29:32 AM
It will be good that it have a preview button
Title: Re: Custom Form Mod
Post by: xTyler on November 27, 2012, 01:21:32 PM
I also have created two form's that work perfectly and the third doesn't post at all.

Any idea's why the mod only allows 2 forms?


Thanks.
Title: Re: Custom Form Mod
Post by: jstop on December 15, 2012, 02:04:24 PM
How do you redirect the form on submit. The topic submits to a page not accessible to everyone so they get an error, how do I redirect the page so they don't get an error but it still post to the correct topic.
Title: Re: Custom Form Mod
Post by: Jeremy M. on December 15, 2012, 05:56:55 PM
I installed this, but had no idea it was gonna be this difficult.

I'm wanting to create a Staff Application for my forum, but have no idea how. Can someone cook me up one?
Title: Re: Custom Form Mod
Post by: ThePr0fess0r on December 17, 2012, 01:10:26 PM
OK, I have created a custom form. Easy enough, but I cannot figure out for the life of me how to direct someone to that form to fill out! Any help would be appreciated.
Title: Re: Custom Form Mod
Post by: Zagdul on December 24, 2012, 05:52:33 PM
Quote from: ThePr0fess0r on December 17, 2012, 01:10:26 PM
OK, I have created a custom form. Easy enough, but I cannot figure out for the life of me how to direct someone to that form to fill out! Any help would be appreciated.

You have to give them a link or add in your Subs.php an additional link to the top of your site (or wherever you want it really).

I've made custom forms where I had a big shiny button I would add into a simple portal block as a simple <a> tag.
Title: Re: Custom Form Mod
Post by: FireDitto on December 25, 2012, 06:26:29 AM
Quote from: frytec on September 11, 2012, 12:31:20 PM
Please, i need to send an email to admin@mysite each time a form is submitteed and a post is created.

- The reciepient email is always the same.
- The email subject is always the post title.
- The email body is always the post body.

Can someone tell me the easiest way to do that?

Thank you.

Set your account to watch the board on which the topic posts. That way you will get an email any time a new form is posted or a reply is posted to that topic. That would be the quickest and easiest way I think.
Title: Re: Custom Form Mod
Post by: Hoodie on December 29, 2012, 03:58:35 PM
I'm getting the following errors:

8: Undefined index: 8
File: /home/****EDITED****/public_html/cocforumz/Sources/ManageSettings.php
Line: 2707

8: Undefined index: 7
File: /home/****EDITED****/public_html/cocforumz/Sources/ManageSettings.php
Line: 2707

8: Undefined index: 6
File: /home/****EDITED****/public_html/cocforumz/Sources/ManageSettings.php
Line: 2707

8: Undefined index: 5
File: /home/****EDITED****/public_html/cocforumz/Sources/ManageSettings.php
Line: 2707

8: Undefined index: 4
File: /home/****EDITED****/public_html/cocforumz/Sources/ManageSettings.php
Line: 2707



Here are the few lines around and including line 2707 of ManageSettings.php:



2704 $permissions_string = $txt['admin'];
2705 if(isset($permissions['custom_forms_'.$row['id_form']]))
2706 foreach($permissions['custom_forms_'.$row['id_form']] as $membergroup_id)
2707 $permissions_string .= ', '.$membergroups[$membergroup_id];
2708
2709 // Try to find the name of the board.
2710 $board_name = 'Invalid Board';
2711
2712 $board_request = $smcFunc['db_query']('','



I've attached the Custom Forms Mod Settings page showing the reason these errors are popping up.  When the Regular Members group is selected, it should show the post count groups (Newbie, Jr Member, Full Member, Sr Member, Hero Member) but they aren't showing up.  If you uncheck regular members in settings for this form, the errors go away.
Title: Re: Custom Form Mod
Post by: DBAllTerrain on December 31, 2012, 03:23:31 PM
Quote from: stylusss on September 07, 2012, 12:09:03 AM
Quote from: DBAllTerrain on June 25, 2012, 03:20:08 PM
Solved my own problem. For others...

In the CustomForm.php file, after the following line:

createPost($msgOptions, $topicOptions, $posterOptions);

I added this:

if (isset($topicOptions['id'])) {
$topic = $topicOptions['id'];
$smcFunc['db_insert']('ignore',
'{db_prefix}log_notify',
array('id_member' => 'int', 'id_topic' => 'int', 'id_board' => 'int'),
array($user_info['id'], $topic, 0),
array('id_member', 'id_topic', 'id_board')
);
}


Seems to work.

Is this for 1.x or 2.x?
This is for 2.x, specifically 2.0.2 or 2.0.3.
Title: Re: Custom Form Mod
Post by: DBAllTerrain on December 31, 2012, 03:39:25 PM
Quote from: teos55 on April 12, 2012, 04:21:02 PM
SMF 2.0.2 Simple portal 2.3.5  default theme

installed the mod.  Modified modification.mylanguage-utf8.php  for local language

created the fields to be used in the form.

When I press submit/save button, nothing created in the specified category.

error log :

"http: // mysite . org/index.php?action=admin;area=modsettings;sa=customform;form_id=1;8: Undefined variable: board
file: /home/user/public_html/Sources/ManageSettings.php
Satır: 2513"


lines around 2513 are :

$context['categories'][$row['id_cat']]['boards'][] = array(
            'id' => $row['id_board'],
            'name' => strip_tags($row['name']),
            'category' => strip_tags($row['cat_name']),
            'child_level' => $row['child_level'],
            'selected' => !empty($_SESSION['move_to_topic']) && $_SESSION['move_to_topic'] == $row['id_board'] && $row['id_board'] != $board,
         );


Any guidance will be highly appreciated.


nb.
When I execute  www. mysite . com/index.php?action=form;n=1

I see the form and can fill in .  when I press save, the topic is created.  The format of the output is not user friendly tough.
I mean all inputs stacked line by line .

Still the "undefined variable: board" seems an issue

OK I got it...  How it works is well explaned in http://smf.balancegames.org/mods/forms/tutorial/create.

A really lazy reader of such manuals .. Shame

Undefined variable borad is still an issue .....
I just now noticed this same error about the 'board' variable getting logged whenever I went to the custom forms setup page. Took a look through the ManageSettings.php and CustomForm.template.php files and can't see that the ['categories']['id_cat']['boards']['selected'] variable is even being used anywhere. CustomForm.template.php uses another check to see if that particular board should be the selected one in the dropdown. So I removed the following line (which was 2398 for me; looks to be different in your file) in ManageSettings.php, which was:

'selected' => !empty($_SESSION['move_to_topic']) && $_SESSION['move_to_topic'] == $row['id_board'] && $row['id_board'] != $board,

Also removed the comma at the end of line above it. The forms still work just fine in SMF 2.0.3. Give it a try.
Title: Re: Custom Form Mod
Post by: gatorfan59 on January 05, 2013, 02:01:23 PM
Is there a way to modify the page I attached to this post? I want to change the black borders around the table and possibly the font color of the headings of the table. Any help would be great! Thank you.
Title: Re: Custom Form Mod
Post by: DBAllTerrain on January 05, 2013, 02:58:28 PM
Quote from: gatorfan59 on January 05, 2013, 02:01:23 PM
Is there a way to modify the page I attached to this post? I want to change the black borders around the table and possibly the font color of the headings of the table. Any help would be great! Thank you.

Font color of titles relies on titlebg class in <theme>/css/index.css. Probably don't want to change it there. To change the color of "Title", "Board" and "View", look at your <theme>/CustomForm.template.php file. Add to the style= tags on lines 195, 196 and 197 the color: #f00, or whatever color you want them. The default style tag on line 195 looks like:

<td style="width:45%;" >' , $txt['title'] , '</td>

To make the word Title red, change it to:

<td style="width:45%; color: #f00;" >' , $txt['title'] , '</td>

Do the same for lines 196 and 197.

The black borders are actually caused by the table having a black background and the cell/row borders not having attributes set. To change the black border to another color, look at line 193 of CustomForm.template.php. Change the background-color: #000000 to another color, ie for red edging, change it to background-color: #f00. To get rid of the black edging altogether, tell the table to collapse the borders to nothing. This would mean changing line 193 from:

<table style="width:100%;background-color:#000000;" align="center">

to

<table style="width:100%;background-color:#000000;border-collapse: collapse;" align="center">

Good luck!
Title: Re: Custom Form Mod
Post by: gatorfan59 on January 05, 2013, 04:14:00 PM
Quote from: DBAllTerrain on January 05, 2013, 02:58:28 PM
Quote from: gatorfan59 on January 05, 2013, 02:01:23 PM
Is there a way to modify the page I attached to this post? I want to change the black borders around the table and possibly the font color of the headings of the table. Any help would be great! Thank you.

Font color of titles relies on titlebg class in <theme>/css/index.css. Probably don't want to change it there. To change the color of "Title", "Board" and "View", look at your <theme>/CustomForm.template.php file. Add to the style= tags on lines 195, 196 and 197 the color: #f00, or whatever color you want them. The default style tag on line 195 looks like:

<td style="width:45%;" >' , $txt['title'] , '</td>

To make the word Title red, change it to:

<td style="width:45%; color: #f00;" >' , $txt['title'] , '</td>

Do the same for lines 196 and 197.

The black borders are actually caused by the table having a black background and the cell/row borders not having attributes set. To change the black border to another color, look at line 193 of CustomForm.template.php. Change the background-color: #000000 to another color, ie for red edging, change it to background-color: #f00. To get rid of the black edging altogether, tell the table to collapse the borders to nothing. This would mean changing line 193 from:

<table style="width:100%;background-color:#000000;" align="center">

to

<table style="width:100%;background-color:#000000;border-collapse: collapse;" align="center">

Good luck!

This worked PERFECTLY! Thank you so much!
Title: Re: Custom Form Mod
Post by: Raths Rants on January 15, 2013, 05:21:50 AM
Quote from: StormChaser83 on December 15, 2012, 05:56:55 PM
I installed this, but had no idea it was gonna be this difficult.

I'm wanting to create a Staff Application for my forum, but have no idea how. Can someone cook me up one?

Did you figure this one out ? If not I can help with it.

Thanks Raths Rants
Title: Re: Custom Form Mod
Post by: Lucutious on January 15, 2013, 03:10:26 PM
Has anyone figured out how to have the form automatically link to the calendar as well?  There's 76 pages, I've searched and didn't find anything but I may have missed something.

Thanks in advance.
Title: Re: Custom Form Mod
Post by: R[wc]BADFISH on January 15, 2013, 09:12:35 PM
anyway to right align text on the displayed form?
Title: Re: Custom Form Mod
Post by: Raths Rants on January 16, 2013, 08:29:23 AM
Quote from: Lucutious on January 15, 2013, 03:10:26 PM
Has anyone figured out how to have the form automatically link to the calendar as well?  There's 76 pages, I've searched and didn't find anything but I may have missed something.

Thanks in advance.

I have always done this manually. When I was playing WoW we would post the weekly raid event via a form and then manually link it to the calender. Did this with guild member events once they were approved. As for an automatic way I have not see a way to do it but I am sure it can be done.
Title: Re: Custom Form Mod
Post by: jstop on January 16, 2013, 10:42:08 AM
How do you redirect the form on submit. The form submits to a topic not accessible to everyone so they get an error, how do I redirect the form to another page (like a thank you page) so they don't get an error but it still post to the correct topic.

Can anyone help with this... I have done it before I just forgot how I did it.
Title: Re: Custom Form Mod
Post by: Raths Rants on January 17, 2013, 04:11:19 PM
Quote from: jstop on January 16, 2013, 10:42:08 AM
How do you redirect the form on submit. The form submits to a topic not accessible to everyone so they get an error, how do I redirect the form to another page (like a thank you page) so they don't get an error but it still post to the correct topic.

Can anyone help with this... I have done it before I just forgot how I did it.

Under your form there is an option for "Submit Redirect". I normally put "forum" in this area. Once the form is submitted it will simply take them back to the top level of your forum.

QuoteThis setting allows you to select where the user is sent after the form is successfully completed.

You can enter the following options...

board: will redirect the user to the board where the form is posted (this is also the default if the field is left empty).
forum: will redirect the user to the Forum Index page.
form: will redirect the user to the list of forms available form them to fill out, if they have permission to view it.
thanks: will redirect the user to a simple page letting them know that form has been completed correctly and thanking them for completing the form.

forum, form, and thanks, are useful if the form posts to a board the user does not have access to view.

Alternatively you can also enter a URL like http://www.simplemachines.org and the user will be directed to that URL. This can be useful to redirect users to a custom thank you page, another specific form, a specific forum post, or anyplace else on the internet.
Title: Re: Custom Form Mod
Post by: R[wc]BADFISH on January 17, 2013, 07:25:13 PM
Anyway to display a form field in subject of post from this mod? Were using this mod as a application form and would love to disgusting between multiple applications. I currently have the title set to "Application" but would love to add the person's name!
Title: Re: Custom Form Mod
Post by: Hoodie on January 18, 2013, 05:11:17 AM
You can set one of the fields to display just as you do in the topic. It won't pull anything from the member automatically. What I do is have them put their in-game/character name into a field labeled "gamename". For the title of the thread I put "Application: {gamename}".
Title: Re: Custom Form Mod
Post by: R[wc]BADFISH on January 20, 2013, 09:04:11 AM
Thanks hoodie... I was using the wrong field!
Title: Re: Custom Form Mod
Post by: Tavsih on January 25, 2013, 03:37:32 AM
I am using Custom form for applications,apply for clan membership.I am using Auto respond mod too ,when someone posts application his post doesnt increase.And thats why Auto respond doesnt work .Where i can set that when someone save the form his post should be increased.
Title: Re: Custom Form Mod
Post by: FragaCampos on January 25, 2013, 05:52:43 PM
This works for smf 1.1.x

Search in /Sources/CustomForm.php
$posterOptions = array(
               'id' => $user_info['id'],


substitute with
$posterOptions = array(
               'id' => $user_info['id'],
'update_post_count' => !$user_info['is_guest']


Title: Re: Custom Form Mod
Post by: Tavsih on January 27, 2013, 03:42:22 AM
Quote from: FragaCampos on January 25, 2013, 05:52:43 PM
This works for smf 1.1.x

Search in /Sources/CustomForm.php
$posterOptions = array(
               'id' => $user_info['id'],


substitute with
$posterOptions = array(
               'id' => $user_info['id'],
'update_post_count' => !$user_info['is_guest']



This will work on smf 2.0.3?
Title: Re: Custom Form Mod
Post by: FragaCampos on January 27, 2013, 12:39:15 PM
I didn't try yet. But I will very soon.
Title: Re: Custom Form Mod
Post by: Tavsih on February 01, 2013, 04:02:28 AM
Tried it but not working  :-[
Title: Re: Custom Form Mod
Post by: nick17 on February 05, 2013, 05:08:55 PM
Can someone help me? I get this when I try to add a new form...


Database Error
constraint failed

File: /home/a9947902/public_html/Sources/ManageSettings.php
Line: 2583
Title: Re: Custom Form Mod
Post by: FragaCampos on February 23, 2013, 04:25:33 PM
Well, I just tested it and it's working fine.

Quote from: Nadeem_ on February 01, 2013, 04:02:28 AM
Tried it but not working  :-[
Title: Re: Custom Form Mod
Post by: xxxTristamxxx on March 08, 2013, 01:42:50 PM
(1) Under the "Submit Redirect" option  I added my link to redirect the applicants after they sumbit but it keeps going to the forum instead.  I added  http://www.simplemachines.org for example  to test and no redirect...just to the boards. (Solved)

(2) How do you do multiple-selection box if they want check more than 1 item? (Still waiting)

Thanks
Title: Re: Custom Form Mod
Post by: deb8 on March 11, 2013, 07:47:02 AM
Hi,

If for verification a Q/A is used instead of the standard image verification code,

then when someone fills only the correct answer in the verification question but does not complete the required fields,

the form is redisplayed with the Q/A displayed twice and filled.
Title: Re: Custom Form Mod
Post by: rChesley on March 17, 2013, 07:58:22 PM
I just installed version 1.7 on SMF 2.0.4 -- I setup forms and it is a very nice solution -- well worth the time and effort to setup.

The main issue I have trouble with is CAPTCHA verification and the additional security questions I have setup that effectively stop spammers from automated registration. When I turn off these features, I get automated registrations and spammers. But with those features turned off, the Custom Form Mod works perfectly.

Here is what I think is happening:

1. When there is an entry error for the CAPTHA code, the user is presented with the verification errors on a separate page. They have the ability to go back to the form and re-enter... but when they go back, the CAPTCHA code displayed has not updated... and it is definitely the wrong displayed code. I verified this by "listening to the letters".

2. I have also added several questions that need to be answered... and I have no way to "listen to the questions", but I did set the requirements to a single question and then tried the answers for all questions until it eventually worked. The displayed question for verification is also not updating properly -- so if there is any error on the CAPTCHA or question, when we go back to fix it, the code or question has changed, but the form data appears just as it was originally -- so we are responding to the wrong code or question.

I would consider any fixes to this mod -- I need to permit guests (non-members) to fill in the form.

I'll wait for those who know what could be done.
Title: Re: Custom Form Mod
Post by: JaVeD on March 18, 2013, 12:59:12 AM
BRO WHERE IS THE NEW Version ot this mod for 2.0.4 please i want it update it
Title: Re: Custom Form Mod
Post by: xxxTristamxxx on March 18, 2013, 07:54:34 AM
@Chesley

"I would consider any fixes to this mod -- I need to permit guests (non-members) to fill in the form."

This is under your admin - Features & Options - Allow guests to browse the forum.  This way your guests can view and fill out the forum.

Title: Re: Custom Form Mod
Post by: Kindred on March 18, 2013, 10:55:50 AM
rChesley,

I actually have it set up exactly that way right now...   I have a contact us form which users or guests can enter, and it then gets posted in the staff board for someone to handle.

(BTW: Captcha is useless)

JaVeD,
this mod works just fine on 2.0.4
Title: Re: Custom Form Mod
Post by: JaVeD on March 18, 2013, 11:26:19 AM
yes bro i am using 2.0.4 but when i make all things all fields and and click on save it say me error site is forbidden or any thing like that
Title: Re: Custom Form Mod
Post by: Kindred on March 18, 2013, 12:30:58 PM
JaVeD...

You need to stop making cryptic and useless statements and queries and START making your questions clear, concise and TO THE POINT.
Your first question was "WHERE IS THE NEW Version ot this mod for 2.0.4"
I answered...   the existing version works just fine on 2.0.4

Your next comment shows that you apparently installed it, but that you are getting an error when you try to submit.
Rather than forcing us to try and chase you down for actual, valid information, why don't you try actually giving information in the first place?

Now... "forbidden" or something like that" is not the actual error.
Please give us the ACTUAL error.

if it's a 500 error, then that probably means that there is some permissions problem with the way your server is set up.
You need to check with your host on the proper CHMOD settings for files.
I suspect that 666 or higher is probably not allowed on your server...  you may need to manually chmod files to 644.

(also, I am not your "bro")

Title: Re: Custom Form Mod
Post by: JaVeD on March 18, 2013, 11:20:32 PM
ok sorry for posting !  :-X
Title: Re: Custom Form Mod
Post by: Bixby on March 25, 2013, 02:24:35 PM
I too was waiting for this Mod to be 2.0.4 approved and see now that it is compatible with the current version. It would be helpful if it could be flagged as being stable on 2.0.4. Quite often I only look at the description of the mod to see what the version compatibility is without going to the support discussion thread for additional details.

I used to run this on the SMF 1.x version of my site and our member base really enjoyed the functionality. Thanks for this mod!!!

Is there any likelihood that this can be enhanced to include the ability to link to the Calendar from the form? Almost all of our forms are used for members to submit events and linking to the Calendar is an important aspect of that.

Thanks again.
Matt (Bixby)
Title: Re: Custom Form Mod
Post by: Kindred on March 25, 2013, 02:49:21 PM
this mod has not been updated in ages... so, it is unlikely that the author will expand it to include the calendar. (that would require a whole new set of coding anyway)


As for versioing...   any mod that works with 2.0.x will likely work with any other version of 2.0.x.
As a matter of fact, most mods, all the way back to 2.0RC3 will work correctly with 2.0.4
Title: Re: Custom Form Mod
Post by: Bixby on March 25, 2013, 07:11:37 PM
Thanks for your quick response. It is good to know it is good to go for SMF 2.0.4. It is troubling to learn that it is not actively supported though. I may avoid using it as I do not want to become dependent on a mod that may not keep up with SMF releases.

Title: Re: Custom Form Mod
Post by: Arantor on March 25, 2013, 07:41:05 PM
Then you should probably stop using almost any mod because most mods have that exact problem.
Title: Re: Custom Form Mod
Post by: Bixby on March 25, 2013, 08:14:01 PM
Quote from: Arantor on March 25, 2013, 07:41:05 PM
Then you should probably stop using almost any mod because most mods have that exact problem.

I did not mean to come off in a negative harsh manner. My apologies if I did. I got stung using this mod when I upgraded to SMF 2 but it was the only one. I guess I use mostly mainstream mods on my forums. Gallery, Downloads, SimplePortal, Stop Spammer. They are all very current and quick to upgrade with SMF Versions.

I am grateful for any mods and appreciate the care that goes into the creation and maintenance. It is important to me that they are sustainable for the forums we run though.

Cheers,
Matt (Bixby)
Title: Re: Custom Form Mod
Post by: Arantor on March 25, 2013, 08:28:53 PM
Some interesting examples. For example, SimplePortal's last release was almost a year ago - predating at least 2 patches of SMF 2.0. They didn't upgrade anything, they didn't have to. Same goes for your other mods for the most part.

As Kindred said, virtually any mod for 2.0 RC3 and up will work on 2.0.4 - despite the 3 years between those two versions.
Title: Re: Custom Form Mod
Post by: Bixby on March 26, 2013, 01:16:36 AM
Thanks for the info. That is very helpful.
Title: Re: Custom Form Mod
Post by: Raths Rants on April 04, 2013, 07:24:44 AM
I have been using this mod for a very long and I have not even come close to finding a replacement for it paid or unpaid. So far it continues to work.

My question is there another viable option that is still being updated? It seems the author of this mod dropped off the face of the earth. I run a small very uninteresting website but this has been an extreme boon. I have created all sorts of forms over the years for my various little projects.

By far the best SMF form builder I have ever used. I am afraid SMF will update one day and this will completely stop working  :(

Great MOD. Wish they had something this simple for my Word Press site  :-\
Title: Re: Custom Form Mod
Post by: steveb72 on April 24, 2013, 03:22:42 PM
I am unable to enter a zero "0" into a text box on my forms.  Does anyone know how I can perhaps modify the code to allow it to accept a zero in a text box?

I tried changing the type of text box to 'integer' but that didn't work.
Title: Who can make custom forms?
Post by: Kevin_Hamm on April 24, 2013, 11:48:28 PM
I am trying to make a new usergroup called "Custom Form Guy." I want this usergroup to be able to make custom forms, how do I do this? Thanks!
Title: Re: Who can make custom forms?
Post by: Raths Rants on April 25, 2013, 01:51:57 AM
Quote from: Kevin_Hamm on April 24, 2013, 11:48:28 PM
I am trying to make a new usergroup called "Custom Form Guy." I want this usergroup to be able to make custom forms, how do I do this? Thanks!

You have to setup the permissions for it. The catch is you have to make a new user group that has access to the mod. If you do not want them to have admin panel access you will have to setup a direct link the mod itself.

Then you have to make sure the permissions are set correctly with in the mod itself. I would setup the user group and a dummy account to test it out. Little bit of trial and error. Custom Form mod has an issue also the permissions will get goofed up with SMF updates. This means you will have to go back and re-assign the permissions again from time to time.

If you would like any further help just PM me.
Title: Re: Custom Form Mod
Post by: Raths Rants on April 25, 2013, 02:15:17 AM
Quote from: steveb72 on April 24, 2013, 03:22:42 PM
I am unable to enter a zero "0" into a text box on my forms.  Does anyone know how I can perhaps modify the code to allow it to accept a zero in a text box?

I tried changing the type of text box to 'integer' but that didn't work.

Could you gives an example of what you are trying to do?
Title: Re: Custom Form Mod
Post by: Raths Rants on April 26, 2013, 02:59:18 AM
Quote from: steveb72 on April 24, 2013, 03:22:42 PM
I am unable to enter a zero "0" into a text box on my forms.  Does anyone know how I can perhaps modify the code to allow it to accept a zero in a text box?

I tried changing the type of text box to 'integer' but that didn't work.

I setup a new field on one of my existing forms for text. Then entered 0 in the field and the output was fine. Not sure what you are trying to do.

Is 0 supposed to be a selection you can make?
Title: Re: Custom Form Mod
Post by: proking on May 07, 2013, 08:17:50 AM
Whenever user submit Post count not increase.
Is it possible to increase Post Count?
Title: Re: Custom Form Mod
Post by: Kindred on May 07, 2013, 08:22:08 AM
no
Title: Re: Custom Form Mod
Post by: Tavsih on May 07, 2013, 01:27:16 PM
Quote from: proking on May 07, 2013, 08:17:50 AM
Whenever user submit Post count not increase.
Is it possible to increase Post Count?
Unfortunately not .I want to increase post count too  :-[
Title: Re: Custom Form Mod
Post by: Raths Rants on May 08, 2013, 09:03:40 AM
There is a mod you can install and run that corrects the post counts for people. This is a work around. I run it about once a week with my forum maintenance.

It is called Recount Member Posts (http://custom.simplemachines.org/mods/index.php?mod=2324) by SFMHacks.com Team. Very useful.
Title: Re: Custom Form Mod
Post by: FragaCampos on May 20, 2013, 07:56:45 PM
This (http://www.simplemachines.org/community/index.php?topic=248871.msg3477296#msg3477296)works for me.

Quote from: Kindred on May 07, 2013, 08:22:08 AM
no
Title: Re: Custom Form Mod
Post by: wwwserfer on May 28, 2013, 08:31:33 AM
Quote from: proking on May 07, 2013, 08:17:50 AM
Whenever user submit Post count not increase.
Is it possible to increase Post Count?

Quote from: terrible on May 07, 2013, 01:27:16 PM
Unfortunately not .I want to increase post count too  :-[

I modify some code of Sources/CustomForm.php

find:
$posterOptions = array(
'id' => $ID_MEMBER,
);


add after:
{
if ($ID_MEMBER == $posterOptions['id'])
$user_info['posts']++;
updateMemberData($posterOptions['id'], array('posts' => '+'));
}


it's right or not - I don't know, but it's works 4 me.. (SMF 1.1.x)

P.S. In my case (form settings) guests can't use forms.
P.P.S. Sorry 4 my bad english! :-[
Title: Re: Custom Form Mod
Post by: langel on June 09, 2013, 01:24:13 PM
Does not work in either of two ways  :(

There will be no way to count the messages in smf 2.04  :-\

I hope someone can help us.

Regards!!
Title: Re: Custom Form Mod
Post by: wwwserfer on June 11, 2013, 09:30:35 AM
Quote from: langel on June 09, 2013, 01:24:13 PM
Does not work in either of two ways  :(

There will be no way to count the messages in smf 2.04  :-\

I hope someone can help us.

Regards!!

In your case - I think that it should be:

find in Sources/CustomForm.php:

$posterOptions = array(
'id' => $user_info['id'],
);


add after:
{
if ($user_info['id'] == $posterOptions['id'])
$user_info['posts']++;
updateMemberData($posterOptions['id'], array('posts' => '+'));
}
Title: Re: Custom Form Mod
Post by: mav2537 on June 12, 2013, 04:05:43 AM
Hi ppl

I have been using the custom form mod for a while now working perfect, all of a sudden yesterday I get a permission 404 error, when doing anything to do with custom forms, I have been testing it all day and I got a message from my provider saying i had been blocked for using an incorrect ip address.

Is there a way to fix this issue, I have read it may be due to the apache mod _security?
Title: Re: Custom Form Mod
Post by: Kindred on June 12, 2013, 10:03:44 AM
mod_security is trash.  Tell your host to turn it off
Title: Re: Custom Form Mod
Post by: Nvb on June 13, 2013, 10:30:27 AM
Quote from: Liam_michael on December 29, 2011, 12:59:31 AM
Quote from: r2d2-trader on December 03, 2011, 11:47:26 AM
i would also appreciate if there is a possibility for uploading/inserting images similar like using the 'inline attachments mod' mod for attachments in topics. So a special upload 'box' would be great.

some ideas?

8) Rob

I really like this idea, has anyone worked on it yet?

+1 here, is there a solution??
Title: Re: Custom Form Mod
Post by: Kindred on June 13, 2013, 10:33:27 AM
it's been a year and a half since that comment, without an update ---   so, I believe that the answer is - no.
Title: Re: Custom Form Mod
Post by: Nvb on June 18, 2013, 08:50:38 PM
The link (http://custom.simplemachines.org/mods/index.php?mod=1279) in the mod page to the manual gives a server error:
"Tutorial:

Balance Games has provided a step by step tutorial on how to use the Custom Form Mod.
http://smf.balancegames.org/mods/forms/tutorial"



Any backup?
Title: Re: Custom Form Mod
Post by: Nvb on June 18, 2013, 08:52:10 PM
Quote from: Nvb on June 18, 2013, 08:50:38 PM
The link (http://custom.simplemachines.org/mods/index.php?mod=1279) in the mod page to the manual gives a server error:
"Tutorial:

Balance Games has provided a step by step tutorial on how to use the Custom Form Mod.
http://smf.balancegames.org/mods/forms/tutorial"



Any backup?
I'm sorry, i found it: https://sites.google.com/a/balancegames.org/smf/mods/forms/tutorial


I was looking for some more information about the Extra Type Parameters for Text Box (Float)
Seems there is very little information around.
How to use this kind of float integer?
I would like to use it for a fix digital number up to 6 digits after the point (ex 12.123456)
But i can not use the size= parameter because the values before the point can vary a lot.
It can be -1.456789 of 152.123456  ...
In other words i would like the exponent to be set on -6 (- after the point, 6 digits)

Is there a round command to insert as extra parameter?
It can be used in php:

How to Round

Rounding can be done with the number_format() function:

     $number = 4.123456;
   echo number_format($number, 2); // prints 4.12

     $number = 4.123456;
   echo number_format($number, 6); // prints 4.123456


Any thoughts?
Title: Re: Custom Form Mod
Post by: tim2000s on July 04, 2013, 06:42:55 AM
I'm running SMF 2.0.4 and get the following issue when trying to install the mod. Can anyone help?

Title: Re: Custom Form Mod
Post by: Spritx on July 30, 2013, 02:37:59 PM
Quick question, is there possible to make it so the form will be posted as one specific user?

Say I'm logged in as Spritx, I fill out the form and click submit, but the submition will be posted as «Hal9000» or something in that direction.
I'm no master in php, but I tried to alter the 'id' => $user_info['id'] to 'id' => $user_info['Hal9000'] and that turned out to post as «Guest»

Anyone know a solution?
Title: Re: Custom Form Mod
Post by: Kindred on July 30, 2013, 02:48:01 PM
$user_info['id'] must be a number, not a name
Title: Re: Custom Form Mod
Post by: Spritx on July 30, 2013, 03:45:49 PM
Quote from: Kindred on July 30, 2013, 02:48:01 PM
$user_info['id'] must be a number, not a name

Ok, so if the id_member of Hal9000 is 11, it would be:

$posterOptions = array(

               'id' => $user_info['11'],

            );


Still post as Guest
Title: Re: Custom Form Mod
Post by: Kindred on July 30, 2013, 04:26:09 PM
no... I am not looking at the code right now, but I think it would actually be

'id' => '11',
Title: Re: Custom Form Mod
Post by: Spritx on July 30, 2013, 04:37:15 PM
Quote from: Kindred on July 30, 2013, 04:26:09 PM
no... I am not looking at the code right now, but I think it would actually be

'id' => '11',

Ah, you are a God! Thanks alot! It worked!
Title: Re: Custom Form Mod
Post by: demonoid1337 on August 03, 2013, 03:27:05 PM
I am SMF 2.0.4 and I have used this mod on an older version of SMF but now i am having some problems getting my created forms to post.

I have made the form, and directed it where to post and all that is setup properly, now i just need to get my actual form to show up on the custom form page

index.php?action=form

This list is currently empty.

I had to modify my admin.php to get the mod to install correctly, but everything else said it tested successful, please someone help!
Title: Re: Custom Form Mod
Post by: Raths Rants on August 14, 2013, 06:30:41 AM
Quote from: demonoid1337 on August 03, 2013, 03:27:05 PM
I am SMF 2.0.4 and I have used this mod on an older version of SMF but now i am having some problems getting my created forms to post.

I have made the form, and directed it where to post and all that is setup properly, now i just need to get my actual form to show up on the custom form page

index.php?action=form

This list is currently empty.

I had to modify my admin.php to get the mod to install correctly, but everything else said it tested successful, please someone help!

Double check your permissions.

website forum address/index.php?action=form;

Under the admin section make sure your form is showing in the list. Make sure the permissions are set on the form also.

Note your form id number.

website forum address/index.php?action=form;n=7
Title: Re: Custom Form Mod
Post by: langel on August 27, 2013, 12:09:02 PM
There are way than can use HTML in a form?

I made a form in part with html and I fill in the fields and submitted it, but it distorts the whole post already created.

Especially with line breaks <br>. Could you please help me.
Title: Re: Custom Form Mod
Post by: Kindred on August 27, 2013, 09:55:53 PM
no....   html can not be used in posts, and therefore can not be used in a form which will be posted
Title: Re: Custom Form Mod
Post by: langel on August 28, 2013, 08:59:18 PM
Quote from: Kindred on August 27, 2013, 09:55:53 PM
no....   html can not be used in posts, and therefore can not be used in a form which will be posted

so sad: (

I had created the perfect post with html, and with bbc not exist way to leave it so.

Thank for responding.
Title: Re: Custom Form Mod
Post by: Arantor on August 28, 2013, 09:02:07 PM
On the other hand, you're infinitely more secure for it.

Allowing raw HTML in forms is *extremely* dangerous.
Title: Re: Custom Form Mod
Post by: langel on August 29, 2013, 01:31:07 AM
Oh! I did not know that.

Then, there will be way to use bbc with css classes?

PD: This "prohibited" definitely use html?
Title: Re: Custom Form Mod
Post by: Kindred on August 29, 2013, 07:39:42 AM
no...   bbc does not accept css
Title: Re: Custom Form Mod
Post by: NO CARRIER on September 23, 2013, 02:53:49 AM
Hi,

Thanks for the great work! Could you update this module to be installed automaticaly on 2.0.5 version?

(http://postimg.org/image/a5cx2f365/)
Title: Re: Custom Form Mod
Post by: Kindred on September 23, 2013, 07:24:30 AM
it worked just fine in 2.0.5 for me...

However, http://wiki.simplemachines.org/smf/Error_in_mod_installation

Title: Re: Custom Form Mod
Post by: NO CARRIER on September 23, 2013, 07:30:19 AM
Yes, it works. :) But if you make a new install on v 2.0.5 it complains about two thigns. I installed the mod manualy and works.
Title: Re: Custom Form Mod
Post by: Kindred on September 23, 2013, 07:40:28 AM
Seeing as how the mod has not been updated in 2+years and the last version check was RC5, it is unlikely that the mod will be changed in any realistic timeframe.
Title: Re: Custom Form Mod
Post by: Tavsih on September 24, 2013, 05:13:41 AM
This problem is coming when i add a new form.

Quoteconstraint failed

File: /home/ues/public_html//Sources/ManageSettings.php
Line: 2518

Title: Re: Custom Form Mod
Post by: asyaavrupa on September 24, 2013, 09:55:16 AM
Hi I wonder if I use the message in these fields?
fields textbox vs,
input fields usage post?
Title: Re: Custom Form Mod
Post by: Coach Emerson on September 29, 2013, 01:02:03 PM
Hi,

Whenever I go to /action=form it says that I have no custom forms made... while I made one just today and I can edit it via the mod settings.

So what's the problem? I can't see any form that I have made, nor access it! Help me this is so frustrating :(
Title: Re: Custom Form Mod
Post by: NO CARRIER on September 29, 2013, 03:03:47 PM
Hi,

It's me again. If in the text field enter a quote, when you try to edit it, the text becomes broken.







Title: Re: Custom Form Mod
Post by: feidry on October 12, 2013, 03:02:52 AM
When attempting to install, I get the error seen in the attachment. Help?
Title: Re: Custom Form Mod
Post by: Kindred on October 12, 2013, 08:13:46 AM
http://wiki.simplemachines.org/smf/Error_in_mod_installation
Title: Re: Custom Form Mod
Post by: SgtMartin on October 15, 2013, 06:24:17 PM
So for a while I was content with the "thanks" submit redirect, but recently I decided to make my own webpage that it would redirect to. I tried entering it into the text box several times, but each time I clicked save I would be sent to a "This page can't be displayed", like it just didn't like what I was giving it. I would then try again and it would be back to the "thanks" option.

Any ideas?

EDIT:
This is strange. I got it to work with a URL by deleting what was in the Subject text box. I had
Quote{Forum}'s Forum Moderator Application
, but until I deleted the {Forum} part of the Subject, it wouldn't work.

Does anyone know how I can get the input (like {Forum}) to work in the subject line?
Title: Re: Custom Form Mod
Post by: mattd24 on November 12, 2013, 01:23:07 PM
The forms do not show on 2.0.6 with Pretty URLS is this due to that Mod also the menu item doesnt appear either to be able to choose the forms in the main menu
Title: Re: Custom Form Mod
Post by: Kindred on November 12, 2013, 01:26:02 PM
probably is due to the mod... pretty urls is much more trouble than benefit, IMO... it certainly provides NO SEO benefit...
Title: Re: Custom Form Mod
Post by: mattd24 on November 12, 2013, 01:36:48 PM
Quote from: Kindred on November 12, 2013, 01:26:02 PM
probably is due to the mod... pretty urls is much more trouble than benefit, IMO... it certainly provides NO SEO benefit...

Okay I have removed that and it still doesnt show the menu button over at http://geckogenetics.com/index.php

Also there is no forms in the list even though one has been defined when i goto index.php?action=form
Title: Re: Custom Form Mod
Post by: Arantor on November 12, 2013, 01:38:57 PM
I don't recall this mod ever actually adding menu items...
Title: Re: Custom Form Mod
Post by: Kindred on November 12, 2013, 01:46:35 PM
that is correct. This mod doe snot create any menu items to begin with...

and what do you mean no forms in the list... that action=forms IS the list....
Title: Re: Custom Form Mod
Post by: mattd24 on November 12, 2013, 01:49:37 PM
I created a form as per the form setup pages all fields are filled but in the forms URL it doesnt show ?
Title: Re: Custom Form Mod
Post by: Kindred on November 12, 2013, 01:53:28 PM
is the form active?  permissions?
Title: Re: Custom Form Mod
Post by: mattd24 on November 12, 2013, 01:56:54 PM
Quote from: Kindred on November 12, 2013, 01:53:28 PM
is the form active?  permissions?

This is what I see, the form fields have been added etc too

Guest, Global Mod and Registered are set to view
Title: Re: Custom Form Mod
Post by: Kindred on November 12, 2013, 02:10:36 PM
I dunno then...  it seems to work properly for me...
http://www.40konline.com/index.php?action=form

Can you access the form directly?
http://geckogenetics.com/index.php?action=form;n=1
Title: Re: Custom Form Mod
Post by: mattd24 on November 12, 2013, 02:18:28 PM
Quote from: Kindred on November 12, 2013, 02:10:36 PM
I dunno then...  it seems to work properly for me...
http://www.40konline.com/index.php?action=form

Can you access the form directly?
http://geckogenetics.com/index.php?action=form;n=1

Yup now it seems to show however if you are not an admin and select the forms button on the menu it redirects back to the main page you can see it loading the URL then it doesnt :/
Title: Re: Custom Form Mod
Post by: phiberoptik on November 16, 2013, 06:50:14 PM
I'm attempting to use your mod to create a World of Warcraft Guild Application form and have successfully done so. How ever I want to protect players applying to my guild from praying eyes who may or may not react badly to the thought of their player leaving their guild.

I'd like to setup some privacy so that only current guild members and the thread creator can see the thread, and reply to it to give a little back and forth before applying or declining the application.

Any ideas?
Title: Re: Custom Form Mod
Post by: Kindred on November 16, 2013, 09:18:18 PM
So, have the thread posted to a board which is limited access to only existing members
Title: Re: Custom Form Mod
Post by: phiberoptik on November 17, 2013, 12:33:26 PM
Quote from: Kindred on November 16, 2013, 09:18:18 PM
So, have the thread posted to a board which is limited access to only existing members

How would the applicant reply to comments on his applications if he wasn't an existing member to see the board he posted in?
Title: Re: Custom Form Mod
Post by: Kindred on November 17, 2013, 12:57:58 PM
ah.... that is more complicated -- and there is no good way to do that at all.

What you are looking for is not the custom form mod, but the SimpleDesk mod...   
Title: Re: Custom Form Mod
Post by: phiberoptik on November 17, 2013, 01:26:13 PM
Quote from: Kindred on November 17, 2013, 12:57:58 PM
ah.... that is more complicated -- and there is no good way to do that at all.

What you are looking for is not the custom form mod, but the SimpleDesk mod...

bleh... I'll check something else...
Title: Re: Custom Form Mod
Post by: Arantor on November 17, 2013, 01:30:10 PM
Except that it's designed to handle such cases and has all kinds of custom field options.

/me feels bad at the hundreds of hours spent on SimpleDesk when no-one wants to use it
Title: Re: Custom Form Mod
Post by: phiberoptik on November 17, 2013, 01:43:04 PM
Quote from: Arantor on November 17, 2013, 01:30:10 PM
Except that it's designed to handle such cases and has all kinds of custom field options.

/me feels bad at the hundreds of hours spent on SimpleDesk when no-one wants to use it

awww, i'm sorry bud, i just don't need the sports package when i'm just strolling down the road. Know what I mean?
Title: Re: Custom Form Mod
Post by: Kindred on November 17, 2013, 01:47:00 PM
Actually, I don't know what you mean.


What you described is SPECIFICALLY the sort of thing that SimpleDesk was designed to do.
Title: Re: Custom Form Mod
Post by: phiberoptik on November 17, 2013, 07:36:10 PM
Quote from: Kindred on November 17, 2013, 01:47:00 PM
Actually, I don't know what you mean.


What you described is SPECIFICALLY the sort of thing that SimpleDesk was designed to do.

SimpleDesk lets me create an application form with various questions the user needs to answer, and then turns that form into a post that only the thread creator and specific user groups can see and comment on?
Title: Re: Custom Form Mod
Post by: Arantor on November 17, 2013, 07:40:36 PM
Well, it lets you create a system of a helpdesk where people can submit tickets that only they and the staff can see.

It also allows you to create all kinds of extra fields of various types to fill in.

It isn't *exactly* what you asked for but is a whole lot closer than you have right now.
Title: Re: Custom Form Mod
Post by: phiberoptik on November 17, 2013, 07:45:40 PM
Quote from: Arantor on November 17, 2013, 07:40:36 PM
Well, it lets you create a system of a helpdesk where people can submit tickets that only they and the staff can see.

It also allows you to create all kinds of extra fields of various types to fill in.

It isn't *exactly* what you asked for but is a whole lot closer than you have right now.

I did this once before, but it was so long ago I forgot what steps I needed to take. After googling for quite a bit there's tons of people who want this type of thing that I am asking for.

If I set a forum board to be moderated; ie: all threads must be approved before being posted, that would do what I need to do. If Custom Form Mod could just simply post the thread as "Waiting to be approved" rather than straight approved, it would fix this completely. I can then just mark the "guild member" usergroup as a moderator of that specific board, and they could view all the pending threads (thus Applications) but non guild members couldn't as they wouldn't be moderators.
Title: Re: Custom Form Mod
Post by: phiberoptik on November 17, 2013, 08:17:20 PM
I have completed 90% of what I'm attempting to do here by setting up a forum board to be Moderated and have all new threads being needed to be approved. Is there any way to setup CFM to not post the thread pre-approved, and instead just make it adhere to the Moderation rules of the board?
Title: Re: Custom Form Mod
Post by: Kindred on November 17, 2013, 08:59:33 PM
I don't think so...
Title: Re: Custom Form Mod
Post by: phiberoptik on November 17, 2013, 09:11:12 PM
Quote from: Kindred on November 17, 2013, 08:59:33 PM
I don't think so...

Any thoughts? I understand why, since it's the system posting the thread and not the person. Maybe un-approve it's moderation once posted? idk.
Title: Re: Custom Form Mod
Post by: Arantor on November 17, 2013, 09:13:59 PM
Because there's a magnitude of difference. This system was designed intentionally to *ignore* permissions.
Title: Re: Custom Form Mod
Post by: phiberoptik on November 17, 2013, 09:30:08 PM
Ah well, shoot, that stinks. Ok, I'll try and figure out something else. Thanks guys!
Title: Re: Custom Form Mod
Post by: Grindabit on December 07, 2013, 06:30:50 PM
Hello,

I am getting the following error after installing this mod when I try to go to the index.php?action=admin;area=modsettings;sa=customform:


QuoteFatal error: Cannot redeclare CustomFormSettings() (previously declared in /home/gab/public_html/Sources/ManageSettings.php:2060) in /home/gab/public_html/Sources/ManageSettings.php on line 3370



* I am using forum version 2.0.6
* I attached my ManageSettings.php file.

Can somone show me what I need to fix?
Title: Re: Custom Form Mod
Post by: margarett on December 07, 2013, 06:48:34 PM
You are installing it for the second time, failing a correct uninstall for the first one.

Go to the mentioned file, you should find 2 or more equal functions. The line numbers should help you. Delete all but one.
Title: Re: Custom Form Mod
Post by: Grindabit on December 07, 2013, 07:15:36 PM
HA! Thanks! All fixed :D
Title: Re: Custom Form Mod
Post by: Grindabit on December 08, 2013, 06:10:56 AM
Can you calculate values as output? for example, a user inputs a price that they are selling a stock. and you want to output the value of {price}/{shares} = [output]

if possible what wold be the syntax?
Title: Re: Custom Form Mod
Post by: Kindred on December 08, 2013, 11:20:37 AM
I do not htink that there is any way to perform formulas on the input or the output
Title: Re: Custom Form Mod
Post by: BuffCareBear on January 24, 2014, 08:50:57 PM
After updating my forum to 2.0.7 when trying to submit a from the error "Numeric request keys are invalid." keeps being thrown. Are there any resolutions or is this a conflict with the update and mod?
Title: Re: Custom Form Mod
Post by: Arantor on January 24, 2014, 08:59:30 PM
Eh, the numeric request keys code has been in SMF for years.
Title: Re: Custom Form Mod
Post by: richconner on January 30, 2014, 12:24:47 PM
I apologize if this has been covered, but I am trying to find instructions for how to implement a custom forum into the header of a specific forum/page of my SMF forum.  Basically, how would I go about doing so?
Title: Re: Custom Form Mod
Post by: Kindred on January 30, 2014, 08:24:57 PM
That is not the way this mod works.
Title: Re: Custom Form Mod
Post by: bros on January 31, 2014, 01:36:03 AM
Quote from: BuffCareBear on January 24, 2014, 08:50:57 PM
After updating my forum to 2.0.7 when trying to submit a from the error "Numeric request keys are invalid." keeps being thrown. Are there any resolutions or is this a conflict with the update and mod?

I had to uninstall and reinstall the mod when I upgraded to 2.0.7. Make sure the uninstall takes
Title: Re: Custom Form Mod
Post by: bros on February 01, 2014, 12:29:01 PM
Question: Is there a way to make it post as a specific user for a specific custom form?
Title: Re: Custom Form Mod
Post by: live627 on February 01, 2014, 10:32:36 PM
Find in ./Sources/CustomForm.php:310

'id' => $user_info['id']

Replace with

'id' => 1
Title: Re: Custom Form Mod
Post by: tcbo1dinges on February 04, 2014, 06:18:56 PM
hello
I am getting a error, The error is,
The database value you're trying to insert does not exist: subject

How can I fix this?

Title: Re: Custom Form Mod
Post by: king kratos on February 08, 2014, 02:37:51 PM
I haven't created a new form in a long time and just tried to do so last night. However, the Body portion of the output is posting nothing, as in empty, to the database.

I went directly to the database table and entered the output format I wanted and it worked just fine, but if I click the save button on the form edit section, it will overwrite the database with nothing (ie remove everything I had put in the database table).

I cannot seem to find the file that is saving this to the database to see if the code got messed up somehow. Any ideas?

Kratos
Title: Re: Custom Form Mod
Post by: Raths Rants on February 08, 2014, 11:26:17 PM
Am sure you tried this already. Have you tried to reinstall the mod ?
Title: Re: Custom Form Mod
Post by: bretttina on February 10, 2014, 12:05:27 PM
Hi

OK I have installed the mod on a test forum and have set up the configuration settings as this :

settings i have set as follows :

permissions : set to regular and global

title and text : i have left these blank

Form is set up as follows :

title : description

board : general discussion

message icon : cheesy

function : left

permissions : regular/global

subject : about me

redirect : board

forum output is listed like this :

{name} :

{age} :

{where i am} :

{about me} :

Now when i go to the category i want ie general discussion and hit the "new topic" button nothing is shown in the type in box???

what have i done wrong please?

Thanks

Brett
Title: Re: Custom Form Mod
Post by: Raths Rants on February 10, 2014, 12:54:10 PM
The forms area has two levels of permissions. The first menu under the admin window and the permission under the form itself.

Below is the example of my feedback form. Only Registered Members can see the form.

Feedback Type: {feedback_type}

Feedback Reason: {feedback_reason}

Message Body: {feedback_body}

Reply: {feedback_reply}

Feedback: {feedback_temp}


Also are you setting up your questions right ? This was one of the first things I goofed up on. I included a few screenshots. If it is a permission issue this should fix it.

Your can access the Forms Area using this link setup. All your forms will be listed there.
http://yoursite/forumdirectory/forum/index.php?action=form;
Title: Re: Custom Form Mod
Post by: bretttina on February 10, 2014, 02:36:32 PM
Thanks Raths Rants,

I have done this (please see attachments)

Also when i type in http://yoursite.com/forumdirectory/forum/index.php?action=form; i get nothing?????

so where have i gone wrong?
Title: Re: Custom Form Mod
Post by: Raths Rants on February 10, 2014, 03:22:44 PM
You have to type in your site address.

I am guessing it should be this:
http://j0intventure.com/index.php?action=form;

I do not see your questions below. I know that if no questions are associated it will not submit an output.
Title: Re: Custom Form Mod
Post by: bretttina on February 10, 2014, 03:29:11 PM
Yep did that but it's not on that forum it is on my test forum

is there anything wrong with what i have put in the screenshots?
Title: Re: Custom Form Mod
Post by: Raths Rants on February 10, 2014, 03:31:33 PM
Sent you a PM.
Title: Re: Custom Form Mod
Post by: Raths Rants on February 10, 2014, 03:33:30 PM
All looks good except for the missing questions to associate with the output.
Title: Re: Custom Form Mod
Post by: king kratos on February 16, 2014, 08:52:50 PM
Quote from: Raths Rants on February 08, 2014, 11:26:17 PM
Am sure you tried this already. Have you tried to reinstall the mod ?

I did reinstall the mod and it still isn't working correctly.

Kratos
Title: Re: Custom Form Mod
Post by: bretttina on February 17, 2014, 08:48:58 AM
Hi all,

On the redirect board it states "View" as the option to click to take you to the form its self,

My question is : How do i change this to say "Post your advert" instead of "View"

Have a look at the screen shot

Thanks
Title: Re: Custom Form Mod
Post by: Kindred on February 17, 2014, 09:49:20 AM
Well, for one, it would change every instance of the word... But I assume it would be in either the custom forms English file or the modifications.english.php file
Title: Re: Custom Form Mod
Post by: s4ph1r3 on February 19, 2014, 09:23:07 AM
Hi, I tried to install this mod on SMF2.0.6 but I get this error:
3. Execute Modification    ./Sources/Admin.php    Test failed
   1.    Add After    ./Sources/Admin.php    Test failed
   2.    Add After    ./Sources/Admin.php    Test successful
If I click on 1. it shows this:
Code: (Find)
// Mod Authors for a "ADD AFTER" on this line. Ensure you end your change with a comma. For example:

Code: (Add After)
//   Place the Custom Form Mod Link.
'customform' => array($txt['CustomForm_tabheader']),

I searched through the Admin.php file but was not able to find the line "Mod Authors for a...". Should I add the line manually and then add the code after it?
Title: Re: Custom Form Mod
Post by: Kindred on February 19, 2014, 05:54:12 PM
If you can not find that line, then you have some major issues -- because that comment line is in every distributed copy of Admin.php and nothing should ever remove it.
Title: Re: Custom Form Mod
Post by: s4ph1r3 on February 20, 2014, 03:39:23 AM
Ty for your reply Kindred, I searched through the entire Admin.php again and managed to find that line, it was behind a piece of code. I compared the file with mine (wich has only 4 or 5 mods installed) and moved the line directly below
'general' => array($txt['mods_cat_modifications_misc']),
in the 'modsettings' => array
The CustomForm mod installed without a problem so I hope that the line is in the right place now.
Title: Re: Custom Form Mod
Post by: hazy261 on May 25, 2014, 07:41:39 AM
hey

want to allow guests to submit a form, at the moment i have allowed them to view the forum but when i click the link to form page it just redirects me to the index page.
i have allowed guest access in the mod config page also

thanks in advance

hazy
Title: Re: Custom Form Mod
Post by: suresh1983 on June 01, 2014, 02:05:32 AM
Hi,

I have created a form using this mod, but the issue that I am facing is the topic is remaining blank.

I have created a form for self introduction with the below options

Name:
Organization:
Number of years of experience:
Description:

when the user posts details using the form, I want the topic in the forum (board) to show Name & Total years of experience.

Currently the topic after the form is posted is showing as blank.

Please suggest and help me on how to accomplish this.
Title: Re: Custom Form Mod - New Topic Button re-directing to form
Post by: Grindabit on July 29, 2014, 05:34:37 PM
Hello everyone,

I searched everywhere for a post that explains how to make the 'New Topic' Button re-direct to the form you wish the user to use for posting in that forum. I found an old post here https://sites.google.com/a/balancegames.org/smf/mods/forms/new_topic that was originally written by  margarett in the Portuguese board over at SMF balance forums and translated to English by FragaCampos.

This solution did not work for me because I am using 2.0.6 version of SMF and that trick was for a different version. So, I modified the trick to work with my version and thought I would share how it is done and the code replacements for ver 2.0.6

Make sure to save a copy of your current messagesIndex.template.php file, so you can restore it if u mess up.

Go to the MessageIndex.template.php of your theme and find...
// Create the button set...
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). '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'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
);
           }


Replace with:
// Create the button set...
        if ($context['current_board'] != 58)
        {
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). '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'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
);
         }
   else
   {
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=form;n=4;submit;'. '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). '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'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
        );
          }


Next, you will need to specify which board you want the 'New Topic' Button to re-direct from to the new form. To do this, find the following in the new code you just replaced:
// Create the button set...
        if ($context['current_board'] != 58)

Replace the 58 with the board number you want to re-direct from.

Now we will need to tell it what form to re-direct to for creating a new post in that forum. Once again, in the newly pasted code, find the following:
action=form;n=4;submit;
replace the 4 with the number of the form you wish to display.

Try it out! It should work, If it doesn't work, then you are using a different version than me.


See below how to modify any version.
(please excuse my lack of coding lingo, I am self taught and not very experienced yet)

All we are doing here is adding an if else statement and changing one action in the else section to call the action to the form instead of new topic.

In your  MessageIndex.template.php file under the theme you are using...
Find the function listed under the following heading:
//Create the button set...

Mine looked like this:
// Create the button set...
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). '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'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
);
           }


Now add this statement before the array:
if ($context['current_board'] != 58)
Replacing the 58 with the board number you wish to re-direct from

It should look like this:
if ($context['current_board'] != 58)
        {
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). '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'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
);


Next, add the following directly below what is in the code box above :
}
   else
   {


Now, copy and paste the original array again directly below the above pasted code:
to get  this:
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). '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'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
);
           }
}
   else
   {
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). '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'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
);

Now find the 'New Topic' array in section below the 'else' statement:
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0', 'active' => true),
This is where we will change the action from, replace the action that looks like this post;board=' . $context['current_board'] with this form;n=4;submit;(replace the 4 with the form number u wish to re-direct to)

the finished product should look like this:
if ($context['current_board'] != 58)
        {
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). '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'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
);
         }
   else
   {
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=form;n=4;submit;'. '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). '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'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
        );
          }


I hope this helps! If it's not working for you, make sure to check for any missing } or ; , it's usually something that simple.

Also, If you want to use multiple forms for multiple boards, just copy and paste the entire script directly below the first one, then just change the board # and form #

*edited for correct spelling of margarett :D

Title: Re: Custom Form Mod
Post by: margarett on July 29, 2014, 08:45:42 PM
/me finds his username misspelled :P

The original post by FragaCampos can be found in this topic, some pages behind ;) But yes, it was in long gone times of 1.1.something :) Nice update, thanks ;)
Title: Re: Custom Form Mod
Post by: Grindabit on July 30, 2014, 10:20:06 PM
SO i am trying to make forms for each board and was able to get two of them to work by just pasting the same code beneath the previous, but after the second one, things do not work. SO I tried this instead, But cannot make this work either. Can somone help point me in the right direction?

if ($context['current_board'] != 58)       
  {
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=form;n=4;submit;'. '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). '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'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
        );
          }
elseif ($context['current_board'] !=56)
  {
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=form;n=5;submit;'. '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). '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'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
        );
          }
elsif ($context['current_board'] !=25)
  {
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=form;n=6;submit;'. '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). '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'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
        );
          }
else
{
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). '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'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
);
         }
Title: Re: Custom Form Mod
Post by: Kindred on July 30, 2014, 10:58:22 PM
That is not the proper code... use logical or staements, not elseif
Title: Re: Custom Form Mod
Post by: Grindabit on July 31, 2014, 12:11:06 AM
Quote from: Kindred on July 30, 2014, 10:58:22 PM
That is not the proper code... use logical or staements, not elseif

Would you please elaborate?
Title: Re: Custom Form Mod
Post by: Kindred on July 31, 2014, 12:42:55 AM
if ($context['current_board'] != 58 || $context['current_board'] != 56 || $context['current_board'] !=25)
Title: Re: Custom Form Mod
Post by: Grindabit on July 31, 2014, 01:31:12 AM
Quote from: Kindred on July 31, 2014, 12:42:55 AM
if ($context['current_board'] != 58 || $context['current_board'] != 56 || $context['current_board'] !=25)

So, for example, I want board 58 to re-direct to form 4 and board 56 to re-direct to form 5 and board 25 to re-direct to form 6....would I put that statement above like this?
if ($context['current_board'] != 58 || $context['current_board'] != 56 || $context['current_board'] !=25)       
  {
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=form;n=4;submit;'. '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). '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'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
        );
          }

  {
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=form;n=5;submit;'. '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). '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'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
        );
          }

  {
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=form;n=6;submit;'. '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). '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'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
        );
          }
else
{
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). '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'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
);
         }
Title: Re: Custom Form Mod
Post by: margarett on July 31, 2014, 05:33:12 AM
No, your previous code makes more sense. Why it doesn't work, what issues do you get?

edit: ah, I see. You have to revert the logics.
You need to compare by equal == and use for each case the specific form ID.

The final "else" will have the "normal" new topic, each if/elseif will correspond to the board --> form combination.
Title: Re: Custom Form Mod
Post by: Grindabit on July 31, 2014, 06:04:21 AM
Is this how you mean?

if ($context['current_board'] !== 58)
   {
       $normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=form;n=4;submit;'. '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). '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'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
        );
          }
   elseif ($context['current_board'] !== 56)
   {
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=form;n=5;submit;'. '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). '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'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
        );
          }
elsif ($context['current_board'] !== 25)
{
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=form;n=6;submit;'. '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). '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'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
        );
          }
else
{
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). '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'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
);
         }
Title: Re: Custom Form Mod
Post by: margarett on July 31, 2014, 06:22:24 AM
Kinda but not the same:
if ($context['current_board'] == 58)
And so on.
Title: Re: Custom Form Mod
Post by: Kindred on July 31, 2014, 07:16:52 AM
margarett...

why would that giant ifelse be better than
if ($context['current_board'] == 58 || $context['current_board'] == 56 || $context['current_board'] ==25)


I didn't check his logic for != versus ==... but the logical or is certainly a better use than repeating the same code in multiple if statements
Title: Re: Custom Form Mod
Post by: margarett on July 31, 2014, 07:27:39 AM
Because for each board ID there is a different form to be opened when you press the "New topic" button ;)
Title: Re: Custom Form Mod
Post by: Kindred on July 31, 2014, 07:31:43 AM
ah. I missed that. 

In that case, I'd suggest building an array with the baordID and the formID and then still doing one IF/Else instead of the waterfall....
Title: Re: Custom Form Mod
Post by: Grindabit on July 31, 2014, 05:08:35 PM
I cannot figure this out...

What would I google to find out how to do this?

I can see how to make a simple array but I need this array to populate based on the current board. I am not sure how to make it store a variable based on that.

Would it be like this?

$form=array(if ($context['current_board'] == 58) $form=4, if ($context['current_board'] == 56) $form=5, if ($context['current_board'] == 25) $form=6)

then something like this:

'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=form;n='. $form . ;submit;'. '.0', 'active' => true),

Im so lost and all i want to do is get this over with and move on....Been trying to make this work for 2 days now....Would one of you be so kind as to show me how this should be done?
Title: Re: Custom Form Mod
Post by: margarett on July 31, 2014, 05:20:18 PM
Did you try the code as I pointed you?
Quote from: margarett on July 31, 2014, 06:22:24 AM
Kinda but not the same:
if ($context['current_board'] == 58)
And so on.

It's longer but it works :P
The array would become not-do-direct to handle. If you don't have experience, keep it long and clear might work out better for you ;)
Title: Re: Custom Form Mod
Post by: Grindabit on July 31, 2014, 07:10:00 PM
OK, I tried it like this :

if ($context['current_board'] == 58)
   {
       $normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=form;n=4;submit;'. '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). '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'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
        );
          }
if ($context['current_board'] == 56)
   {
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=form;n=5;submit;'. '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). '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'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
        );
          }
if ($context['current_board'] == 25)
{
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=form;n=6;submit;'. '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). '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'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
        );
          }
else
{
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). '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'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
);
         }


Result is:

Board 25 re-directs to form 6
board 58 does not re-direct
board 56 does not re-direct

So it seems to be skipping to the last action.

Did I do it the way you described?
Title: Re: Custom Form Mod
Post by: margarett on July 31, 2014, 07:41:45 PM
Your first if is ok, all other ifs should be elseif
Title: Re: Custom Form Mod - New Topic Button re-directing to form
Post by: Grindabit on July 31, 2014, 08:39:32 PM
Quote from: margarett on July 31, 2014, 07:41:45 PM
Your first if is ok, all other ifs should be elseif

Thank you margarett and Kindred :) It now works!

Here is the code in case anyone else needs it
if ($context['current_board'] == 58)
   {
       $normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=form;n=4;submit;'. '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). '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'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
        );
          }
elseif ($context['current_board'] == 56)
   {
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=form;n=5;submit;'. '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). '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'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
        );
          }
elseif ($context['current_board'] == 25)
{
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=form;n=6;submit;'. '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). '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'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
        );
          }
else
{
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0', 'active' => true),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). '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'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
);
         }
Title: Re: Custom Form Mod
Post by: ColdXX on September 10, 2014, 06:08:09 PM
I've recently downloaded this mod and I was wondering if somehow it could insert the player's name into the title and make it look something like :MrCold's Unban Appeal


http://gyazo.com/a75bcf85093a5c06b8b8e4f1a1562a8b

So here is a picture of one of my forms. You see there is a box where you have to insert your name. So what i'd like to do is,get the name that the user put in the box and place it into the topic he created title.

Can someone help out? I do not know much about SMF coding.
Title: Re: Custom Form Mod
Post by: cann0nf0der on November 05, 2014, 04:08:10 PM
I have followed all the readme directions and searched this topic but cannot find an answer to the following issue.

When I click on add new form I get this error


Database Error
Field 'title' doesn't have a default value
File: D:\WWW\classforum\Sources\ManageSettings.php
Line: 2523

Any one have any solution to this?

Regards

Title: Re: Custom Form Mod
Post by: Pipke on November 06, 2014, 12:48:54 PM
Quote from: ColdXX on September 10, 2014, 06:08:09 PM
I've recently downloaded this mod and I was wondering if somehow it could insert the player's name into the title and make it look something like :MrCold's Unban Appeal


http://gyazo.com/a75bcf85093a5c06b8b8e4f1a1562a8b (http://gyazo.com/a75bcf85093a5c06b8b8e4f1a1562a8b)

So here is a picture of one of my forms. You see there is a box where you have to insert your name. So what i'd like to do is,get the name that the user put in the box and place it into the topic he created title.

Can someone help out? I do not know much about SMF coding.


Place in subject line when you setup the form field lines => This is the subject/title of the post created by the form, like the Form Output area, it can contain values from the form itself.[/size]Example:Form name: {field_name}

{trigger_name} Unban Appeal
Title: Re: Custom Form Mod
Post by: neon22 on November 18, 2014, 05:31:34 AM
The form created by the Custom Form Mod can post only to the one specific chosen board in the mod settings.
Is there any way that user can themself choose the board where they want to post the form from drop down menu,(as a field in their form itself)?
I am making a complaint/ticket forum and what that from one form itself user can post their complaint to the respective category of boards that i have created.

other alternative i see to this problem is to create a form for each board and then ask the user to select the board they want to post their complaint and the form for that board is presented to them 
Title: Re: Custom Form Mod
Post by: Kindred on November 18, 2014, 08:56:33 AM
no. there is no easy way to do what you are asking.

However - for a ticketing system, you are using the wrong mod. You should be using the fully functional "SimpleDesk"
Title: Re: Custom Form Mod
Post by: Arantor on November 18, 2014, 09:06:21 AM
Which also has all kinds of options around custom fields for capturing whatever organisation you want it to have ;)
Title: Re: Custom Form Mod
Post by: Shambles on December 07, 2014, 03:22:39 PM
Might be worth removing this section from the mod description, as the website quoted no longer seems to exist.


Quote
Tutorial:

Balance Games has provided a step by step tutorial on how to use the Custom Form Mod.
http://smf.balancegames.org/mods/forms/tutorial
Title: Re: Custom Form Mod
Post by: langel on December 14, 2014, 01:22:52 AM
As I do to that increase the user post count with CFM? When you publish a post with custom mod form, does not increase the count :(

I have the latest version of the mod.

Thanks!
Title: Re: Custom Form Mod
Post by: residualfuture on February 07, 2015, 01:05:46 AM
I have been trying to install this mod but I get nothing but errors:

1.    Adapt Database    install.php    
*    2.    Execute Modification    ./index.php    Test successful
*    3.    Execute Modification    ./Sources/Admin.php    Test failed
      1.    Add After    ./Sources/Admin.php    Test failed
      2.    Add After    ./Sources/Admin.php    Test failed
*    4.    Execute Modification    ./Sources/ManageSettings.php    Test failed
      1.    Add After    ./Sources/ManageSettings.php    Test failed
      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
*    8.    Execute Modification    ./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 am running smf 2.0.9 any help would be greatly appreciated.
Title: Re: Custom Form Mod
Post by: live627 on February 07, 2015, 05:35:32 AM
Which mods do you have installed?
Title: Re: Custom Form Mod
Post by: Kindred on February 07, 2015, 08:29:04 AM
http://wiki.simplemachines.org/smf/Error_in_mod_installation
Title: Re: Custom Form Mod
Post by: Empire KickAss on February 20, 2015, 08:39:06 PM
I can't get this to work, it's not showing up at all.

It meant to be for Members_Introduce, but it does not show up. It's blank. I have been thought my settings and I can't found whats wrong with it after I read thought this topic thread still no luck
Title: Re: Custom Form Mod
Post by: #Mayhem on February 27, 2015, 11:21:26 PM
When members submit an application through Custom forms, the page is completely blank in the forum it's been sent to. I'm running 2.0.9. I made sure everything is correct, but the forum post that's being submitted is completely blank. However, when an admin submits the application, it appears in the form. This only happens with members who aren't admins.
Title: Re: Custom Form Mod
Post by: Empire KickAss on February 27, 2015, 11:24:18 PM
Quote from: #Mayhem on February 27, 2015, 11:21:26 PM
When members submit an application through Custom forms, the page is completely blank in the forum it's been sent to. I'm running 2.0.9. I made sure everything is correct, but the forum post that's being submitted is completely blank. However, when an admin submits the application, it appears in the form. This only happens with members who aren't admins.
I have an problem where it is not showing up on the selection where I have the application to, witch is for the Members Introduce
Title: Re: Custom Form Mod
Post by: #Mayhem on February 28, 2015, 05:24:42 PM
Quote from: Empire KickAss on February 27, 2015, 11:24:18 PM
Quote from: #Mayhem on February 27, 2015, 11:21:26 PM
When members submit an application through Custom forms, the page is completely blank in the forum it's been sent to. I'm running 2.0.9. I made sure everything is correct, but the forum post that's being submitted is completely blank. However, when an admin submits the application, it appears in the form. This only happens with members who aren't admins.
I have an problem where it is not showing up on the selection where I have the application to, witch is for the Members Introduce

My problem is when someone submits the application itself, it's not showing up on the board/forums. It just comes up as a blank page.
Title: Re: Custom Form Mod
Post by: Empire KickAss on February 28, 2015, 06:21:39 PM
Quote from: #Mayhem on February 28, 2015, 05:24:42 PM
Quote from: Empire KickAss on February 27, 2015, 11:24:18 PM
Quote from: #Mayhem on February 27, 2015, 11:21:26 PM
When members submit an application through Custom forms, the page is completely blank in the forum it's been sent to. I'm running 2.0.9. I made sure everything is correct, but the forum post that's being submitted is completely blank. However, when an admin submits the application, it appears in the form. This only happens with members who aren't admins.
I have an problem where it is not showing up on the selection where I have the application to, witch is for the Members Introduce

My problem is when someone submits the application itself, it's not showing up on the board/forums. It just comes up as a blank page.
the problem is gotta wait for an reply to the author or someone that knows an fix
Title: Editing Text Box length
Post by: #Mayhem on March 02, 2015, 11:33:33 AM
Hello everyone,

I'm trying to figure out where I can edit the text box length on my Custom form. I'll add a screenshot of one of the custom forms applications and hopefully someone can tell me where I can edit the text box. I've been looking through the CSS and templates for the last couple hours, even FTP, and can't find where to edit them.

Title: Re: Custom Form Mod
Post by: Empire KickAss on March 22, 2015, 02:09:25 AM
Any news on this yet? we have problems and waiting on answer from the post above
Title: Re: Custom Form Mod
Post by: Smythe on March 25, 2015, 11:21:24 PM
Getting error message....


The database value you're trying to insert does not exist: subject

I wasnt getting the message previously, but after I created a new form ... this is all I get...
Tells me the error lies at line 1817 of the code from Sub-Post.php

Error from Admin logs:


Apply Filter: Only show the error messages of this URL
http://mywebsite.com/index.php?action=form;n=1;submit;
Apply Filter: Only show the errors with the same message
The database value you're trying to insert does not exist: subject
Function: createPost
Apply Filter: Only show the errors from this file
File: C:///Sources/Subs-Post.php
Line: 1817


1803   // Insert the post.
1804 $smcFunc['db_insert']('',
1805 '{db_prefix}messages',
1806 array(
1807 'id_board' => 'int', 'id_topic' => 'int', 'id_member' => 'int', 'subject' => 'string-255', 'body' => (!empty($modSettings['max_messageLength']) && $modSettings['max_messageLength'] > 65534 ? 'string-' . $modSettings['max_messageLength'] : 'string-65534'),
1808 'poster_name' => 'string-255', 'poster_email' => 'string-255', 'poster_time' => 'int', 'poster_ip' => 'string-255',
1809 'smileys_enabled' => 'int', 'modified_name' => 'string', 'icon' => 'string-16', 'approved' => 'int',
1810 ),
1811 array(
1812 $topicOptions['board'], $topicOptions['id'], $posterOptions['id'], $msgOptions['subject'], $msgOptions['body'],
1813 $posterOptions['name'], $posterOptions['email'], time(), $posterOptions['ip'],
1814 $msgOptions['smileys_enabled'] ? 1 : 0, '', $msgOptions['icon'], $msgOptions['approved'],
1815 ),
1816 array('id_msg')
1817 );
1818 $msgOptions['id'] = $smcFunc['db_insert_id']('{db_prefix}messages', 'id_msg');
1819
1820 // Something went wrong creating the message...
1821 if (empty($msgOptions['id']))
1822 return false;


any help is greatly appreciated....


after looking I also see the following error message in the logs of the admin section

http://mywebsite.com/index.php?action=form;n=1;submit;
Apply Filter: Only show the errors with the same message
2: preg_replace_callback(): Unknown modifier 'T'
Apply Filter: Only show the errors from this file
File: C:///Sources/CustomForm.php
Line: 287
Line: 288
Line: 291
Line: 292


277                    // Do we have completly valid field data?
278 if(!$fail_submit)
279 {
280 require_once($sourcedir.'/Subs-Post.php');
281
282                //    {{ }} Syntax: Strip out everything in {{ }} if value is blank
283                $output = preg_replace($vars_blank, '', $output);
284                $subject = preg_replace($vars_blank, '', $subject);
285
286                //    {{ }} Syntax: Remove outside brackets if value is not blank
287                $output = preg_replace_callback($vars_non_blank, create_function('$matches','return substr($matches[0],1,-1);'), $output);
288                $subject = preg_replace_callback($vars_non_blank, create_function('$matches','return substr($matches[0],1,-1);'), $subject);
289
290 // Replace all vars with their correct value, for both the message and the subject.
291 $output = preg_replace($vars, $replace, $output);
292 $subject = preg_replace($vars, $replace, $subject);
Title: Re: Custom Form Mod
Post by: dakey on March 26, 2015, 03:16:32 PM
Great mod  8) ..

but,
I have a board (let's say: board_id=10) and a certain usergroup is normally allowed to post only after approval by an administrator (Standard feature in SMF 2.x.x).
This works.

The same usergroup have access to my custom form and is able to send the form, but after sending, the topic is posted direct in board_id 10 without any approval by an administrator..
Any ideas to get this fixed?
Title: Re: Custom Form Mod
Post by: Kindred on March 26, 2015, 04:51:30 PM
nothing to get fixed... the system is working exactly as expected.

The form submit does not relate to any standard posting permissions.
Title: Re: Custom Form Mod
Post by: dakey on March 26, 2015, 05:24:04 PM
Are you sure?
I've an image attached:

1. is a new topic in board_id 10 after I post with user x from the custom form (status: published)
2. is a new topic in board_id 10 after I post with the same user x on a regular way (Wachtend op goedkeuring) is dutch for (status: awaiting for moderation)
Title: Re: Custom Form Mod
Post by: Kindred on March 27, 2015, 12:38:57 AM
Right. That illustrates what I just said.

The user in the membergroup can list to that board, but requires approval of the post.
Correct. This is standard smf behavior.

The same user can use the form to submit a post to the board. This post will NOT require approval.
Correct. This is the standard behavior of the form mod.
Title: Re: Custom Form Mod
Post by: 420SA on March 27, 2015, 04:16:57 AM
Quote from: residualfuture on February 07, 2015, 01:05:46 AM
I have been trying to install this mod but I get nothing but errors:

1.    Adapt Database    install.php    
*    2.    Execute Modification    ./index.php    Test successful
*    3.    Execute Modification    ./Sources/Admin.php    Test failed
      1.    Add After    ./Sources/Admin.php    Test failed
      2.    Add After    ./Sources/Admin.php    Test failed
*    4.    Execute Modification    ./Sources/ManageSettings.php    Test failed
      1.    Add After    ./Sources/ManageSettings.php    Test failed
      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
*    8.    Execute Modification    ./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 am running smf 2.0.9 any help would be greatly appreciated.

I get the same errors on the same version of SMF. Could SCEditor cause this?
Title: Re: Custom Form Mod
Post by: dakey on March 27, 2015, 06:17:00 AM
Quote from: Kindred on March 27, 2015, 12:38:57 AM
Right. That illustrates what I just said.

The user in the membergroup can list to that board, but requires approval of the post.
Correct. This is standard smf behavior.

The same user can use the form to submit a post to the board. This post will NOT require approval.
Correct. This is the standard behavior of the form mod.

I understand, and that's why I asked for a custom solution for a moderation possibility.
In the meantime i found a solution which work for my board, because I use only 1 form:

find in CustomForm.php:

$msgOptions = array(
'id' =>  0,
'subject' => $subject,
'icon' => $icon,
'body' => $output,
'smileys_enabled' => true,


Add after:

'approved' => 0,
Title: Re: Custom Form Mod
Post by: Kindred on March 27, 2015, 06:27:54 AM
seano436, same answer as the original...

Quote from: Kindred on February 07, 2015, 08:29:04 AM
http://wiki.simplemachines.org/smf/Error_in_mod_installation
Title: Re: Custom Form Mod
Post by: Smythe on March 31, 2015, 09:06:52 AM
Quote from: Smythe on March 25, 2015, 11:21:24 PM
Getting error message....


The database value you're trying to insert does not exist: subject

I wasnt getting the message previously, but after I created a new form ... this is all I get...
Tells me the error lies at line 1817 of the code from Sub-Post.php

Error from Admin logs:


Apply Filter: Only show the error messages of this URL
http://mywebsite.com/index.php?action=form;n=1;submit;
Apply Filter: Only show the errors with the same message
The database value you're trying to insert does not exist: subject
Function: createPost
Apply Filter: Only show the errors from this file
File: C:///Sources/Subs-Post.php
Line: 1817


1803   // Insert the post.
1804 $smcFunc['db_insert']('',
1805 '{db_prefix}messages',
1806 array(
1807 'id_board' => 'int', 'id_topic' => 'int', 'id_member' => 'int', 'subject' => 'string-255', 'body' => (!empty($modSettings['max_messageLength']) && $modSettings['max_messageLength'] > 65534 ? 'string-' . $modSettings['max_messageLength'] : 'string-65534'),
1808 'poster_name' => 'string-255', 'poster_email' => 'string-255', 'poster_time' => 'int', 'poster_ip' => 'string-255',
1809 'smileys_enabled' => 'int', 'modified_name' => 'string', 'icon' => 'string-16', 'approved' => 'int',
1810 ),
1811 array(
1812 $topicOptions['board'], $topicOptions['id'], $posterOptions['id'], $msgOptions['subject'], $msgOptions['body'],
1813 $posterOptions['name'], $posterOptions['email'], time(), $posterOptions['ip'],
1814 $msgOptions['smileys_enabled'] ? 1 : 0, '', $msgOptions['icon'], $msgOptions['approved'],
1815 ),
1816 array('id_msg')
1817 );
1818 $msgOptions['id'] = $smcFunc['db_insert_id']('{db_prefix}messages', 'id_msg');
1819
1820 // Something went wrong creating the message...
1821 if (empty($msgOptions['id']))
1822 return false;


any help is greatly appreciated....


after looking I also see the following error message in the logs of the admin section

http://mywebsite.com/index.php?action=form;n=1;submit;
Apply Filter: Only show the errors with the same message
2: preg_replace_callback(): Unknown modifier 'T'
Apply Filter: Only show the errors from this file
File: C:///Sources/CustomForm.php
Line: 287
Line: 288
Line: 291
Line: 292


277                    // Do we have completly valid field data?
278 if(!$fail_submit)
279 {
280 require_once($sourcedir.'/Subs-Post.php');
281
282                //    {{ }} Syntax: Strip out everything in {{ }} if value is blank
283                $output = preg_replace($vars_blank, '', $output);
284                $subject = preg_replace($vars_blank, '', $subject);
285
286                //    {{ }} Syntax: Remove outside brackets if value is not blank
287                $output = preg_replace_callback($vars_non_blank, create_function('$matches','return substr($matches[0],1,-1);'), $output);
288                $subject = preg_replace_callback($vars_non_blank, create_function('$matches','return substr($matches[0],1,-1);'), $subject);
289
290 // Replace all vars with their correct value, for both the message and the subject.
291 $output = preg_replace($vars, $replace, $output);
292 $subject = preg_replace($vars, $replace, $subject);


Any suggestions regarding this post ???
Title: Re: Custom Form Mod
Post by: maloneya121 on April 13, 2015, 11:31:31 PM
Amazing mod... jus have a huge problem. I cant view the forms at all. I can goto the lists, but when i click view nothing happens. Also when i goto index.php?action=form;n=1 (the id is right) it just redirects back to the view page......

BTW im new to smf so any trubble shooting advise would be appreciated if it was in like the simplest terms
Title: Re: Custom Form Mod
Post by: Kindred on April 14, 2015, 12:10:51 AM
Are you using prettyurls? or any sort of htaccess redirects/rewrites?


does your host have mod_security active?
Title: Re: Custom Form Mod
Post by: maloneya121 on April 14, 2015, 11:19:18 AM
Not seeing any mod_security and no i dont have any of that installed
Title: Re: Custom Form Mod
Post by: residualfuture on May 09, 2015, 02:06:50 PM
Quote from: maddoghalo on August 31, 2012, 04:47:44 PM
When somebody posts the forums, how do I get the thread title to include their forum username?

I use to be able to do it but forgot how. When they click submit it makes a new thread and is says for example: Maddoghalo's Application.

Has anyone ever figured this out? I myself used to have it display the {username} in the subject prior to my webhost having a major hard drive failure.

Now that I am rebuilding I cannot figure out how to get the {username} to show in the subject anymore.
Title: Re: Custom Form Mod
Post by: Biology Forums on May 27, 2015, 01:49:16 AM
Anyone else notice that when using characters like ' (apostrophe) in gives out a major error and tries to escape them with \ ???
Title: Re: Custom Form Mod
Post by: neenx on June 19, 2015, 01:00:00 AM
Hey, love this mod. Been using it for years as a guild application tool for new recruits.

Quick question though. Is there a way to make the form reply to a specific thread instead of making a brand new thread?

Like if I had a thread stickied and every time someone hit submit on the form, a reply would post to that thread with the same formatting.

Also if this mod isn't capable of doing that; can someone point me to a mod that can?

Thanks

-Neenx
Title: Re: Custom Form Mod
Post by: margarett on June 19, 2015, 06:58:06 AM
That should be doable, yes, and it should be more or less easy on the back-end.
The problem is to redesign the front-end so that it accommodates both board and topic IDs.

Do you have just ONE custom form?
If so, you can try this (backup because I didn't test it :P )
Find (CustomForm.php)
$topicOptions = array(
'id' => 0,
'board' => $board,
'mark_as_read' => true,
);

see that 'id' => 0, ?
Just replace that "0" with your desired topic ID
Title: Re: Custom Form Mod
Post by: neenx on June 20, 2015, 09:07:30 PM
What if I have more than one custom form? Like my first form I want to create a new thread on a board, and my second form I want to reply to a specific thread.
Title: Re: Custom Form Mod
Post by: Kindred on June 20, 2015, 09:09:36 PM
Then it becomes much mor complicated...
Title: Re: Custom Form Mod
Post by: Jailer on June 21, 2015, 09:47:08 PM
Quote from: cann0nf0der on November 05, 2014, 04:08:10 PM
I have followed all the readme directions and searched this topic but cannot find an answer to the following issue.

When I click on add new form I get this error


Database Error
Field 'title' doesn't have a default value
File: D:\WWW\classforum\Sources\ManageSettings.php
Line: 2523

Any one have any solution to this?

Regards

I'm getting this same error and can't create a new form.
Title: Re: Custom Form Mod
Post by: Proderf on June 24, 2015, 12:39:39 PM
I believe I have installed he mod correctly (long story), but when i go to index.php?action=forms, It brings me to the home screen. Can anyone help?



Edit: The mod doesn't show up in the package manager (browse packages), but it shows up in Installed Packages.
Title: Re: Custom Form Mod
Post by: Kindred on June 24, 2015, 12:43:31 PM
either a- you have not installed the mod correctly, b- you have some sort of htaccess redirect going on (like prettyurls?) or c- your host has mod_security installed and misconfigured.
Title: Re: Custom Form Mod
Post by: Proderf on June 24, 2015, 12:50:34 PM
I have access to make forms and shniz like that, But ya.


Pretty much my friend tried to uninstall the mod by deleting the packages (not editing the file modifications), and that lead to the mod not being able to be uninstalled through the forms, but me manually going to each file and taking out the code.
Title: Re: Custom Form Mod
Post by: Kindred on June 24, 2015, 12:57:41 PM
http://wiki.simplemachines.org/smf/How_to_upload_a_fresh_set_of_files
Title: Re: Custom Form Mod
Post by: Proderf on June 24, 2015, 01:13:35 PM
Ok, i got it to show up in the package manager now, and everything seems to be working, be the index.php?action=form is still bringing me home.


PS: I uninstalled the mod from the installed mods tab, and then reinstalled it though the package server. I still had my "View Form Title" and "View Form Text" as i set it before the uninstall, but don't have the 1 form I made.
Title: Re: Custom Form Mod
Post by: Proderf on June 24, 2015, 01:19:17 PM
IT WORKS NOW
Title: Re: Custom Form Mod
Post by: margarett on June 24, 2015, 01:42:03 PM
Quote from: neenx on June 20, 2015, 09:07:30 PM
What if I have more than one custom form? Like my first form I want to create a new thread on a board, and my second form I want to reply to a specific thread.
A conditional in the 'id' line should do the trick. Eg, if current form is "xx" then id 0 --> new topic. else id = topic_id
Not exactly sure about the code to do it because I'm not that familiar with this MOD but I can look into it if required ;)

@Jailer: http://www.simplemachines.org/community/index.php?topic=248871.msg2782810#msg2782810
Does this help?
Title: Re: Custom Form Mod
Post by: Proderf on June 25, 2015, 10:51:29 AM
OK, so now everything is working just fine, except now when I create a form, it doesn't show up at ?action=form, though the Form Title and Text both do.
Title: Re: Custom Form Mod
Post by: Proderf on June 28, 2015, 09:58:56 PM
^^^^^^^^^
Title: Re: Custom Form Mod
Post by: Empire KickAss on June 28, 2015, 10:14:24 PM
Quote from: Proderf on June 28, 2015, 09:58:56 PM
^^^^^^^^^
Please don't bump posts, they will answer. just takes time  ;)
Title: Re: Custom Form Mod
Post by: Will Scarlet on June 28, 2015, 10:40:32 PM
Hello, is there any way to increase the allowed characters in an info box?
Title: Re: Custom Form Mod
Post by: Proderf on June 28, 2015, 11:00:28 PM
NVM I GOT IT TO WORK :D thank y'all for the help :D
Title: Re: Custom Form Mod
Post by: Shambles on June 29, 2015, 03:24:01 AM
Quote from: Empire KickAss on June 28, 2015, 10:14:24 PM
Quote from: Proderf on June 28, 2015, 09:58:56 PM
^^^^^^^^^
Please don't bump posts, they will answer. just takes time  ;)

There's absolutely no harm in bumping a post after a few days.
Title: Re: Custom Form Mod
Post by: 420Connect.co.uk on July 16, 2015, 02:22:23 PM
Quote from: Proderf on June 25, 2015, 10:51:29 AM
OK, so now everything is working just fine, except now when I create a form, it doesn't show up at ?action=form, though the Form Title and Text both do.

Hmm.. I too am finding this..

Am I missing something obvious?
Title: Re: Custom Form Mod
Post by: tectonny on July 16, 2015, 03:18:53 PM
Adapted for use in smf 2.1 beta 2, the layout was bad, I moved to the new class and stayed cool.

But if you can upgrade.
http://www.tectonny.com.br/
Title: Re: Custom Form Mod
Post by: 420Connect.co.uk on July 21, 2015, 08:45:45 AM
..Still finding my created forms aren't appearing when I visit "/index.php?action=form"

I'm told:
This list is currently empty.

The only test that failed during installing was the part to add:

// Place the Custom Form Mod Link.
'customform' => array($txt['CustomForm_tabheader']),


which I've now done manually..

I've made a new form, filled in all the relevant boxes / permissions etc. I can find but still they won't appear under ?action=form ..  :o  ???

.. appreciated if anyone can confirm if this works for you or knows how to fix the issue?!

Cheers
Title: Re: Custom Form Mod
Post by: margarett on July 21, 2015, 09:26:36 AM
I seem to remember having this issue too and I'm sure it is documented in one of the previous 85 pages :P

If you have text boxes, you need to have something in "Text". Or else the form will not work (or just not show, don't remember anymore...)
Title: Re: Custom Form Mod
Post by: 420Connect.co.uk on July 21, 2015, 09:55:51 AM
Quote from: margarett on July 21, 2015, 09:26:36 AM
I seem to remember having this issue too and I'm sure it is documented in one of the previous 85 pages :P

If you have text boxes, you need to have something in "Text". Or else the form will not work (or just not show, don't remember anymore...)

Many thanks Bruno!

I had began reading the old pages but couldn't find the answer (or had skimmed over it) :P

That was just it; having nothing entered in the 'Text' box caused the form not to show at all!

.. Now to begin playing! :P
Title: Re: Custom Form Mod
Post by: Jailer on August 08, 2015, 07:24:25 AM
Quote from: margarett on June 24, 2015, 01:42:03 PM
@Jailer: http://www.simplemachines.org/community/index.php?topic=248871.msg2782810#msg2782810
Does this help?

I guess if I could figure out how to view the tables it might.   :(
Title: Re: Custom Form Mod
Post by: rlin on September 16, 2015, 08:53:00 PM
Hi,
Is there any way for people to submit in this custom form mod, but have the admin review what they submitted and post the topic?
Thanks for helping!
Title: Re: Custom Form Mod
Post by: rlin on September 17, 2015, 03:54:35 PM
Hi,

Can everyone please help with  my problem as stated above? Thank you!
Title: Re: Custom Form Mod
Post by: Kindred on September 17, 2015, 04:14:20 PM
I don't think there is an easy way to do that... and any way of doing it would involve code changes and conditionals
Title: Re: Custom Form Mod
Post by: rlin on September 17, 2015, 07:17:40 PM
Are there any other mods/ other forum software that has a custom form and also admin moderation? Thanks for helping
Title: Re: Custom Form Mod
Post by: Shambles on September 18, 2015, 03:26:53 AM
Quote from: rlin
Are there any other mods/ other forum software that has a custom form and also admin moderation?

Already answered in your other topic ;)
Title: Re: Custom Form Mod
Post by: zurgenaboy on October 11, 2015, 05:03:56 AM
Hi
I keep getting this error coming up whenever I do anything in my ACP after I
uninstalled the Custom form mod.

smf/index.php?action=admin;area=logs;sa=adminlog;e671060b35=8d26f1e37a7fc72b76f04282d4a8: Undefined index: CustomForm_tabheaderApply Filter:
File: /smf/Sources/Admin.php
Line: 232

'modsettings' => array(
'label' => $txt['admin_modifications'],
'file' => 'ManageSettings.php',
'function' => 'ModifyModSettings',
'icon' => 'modifications.gif',
'subsections' => array(
'general' => array($txt['mods_cat_modifications_misc']),
// Mod Authors for a "ADD AFTER" on this line. Ensure you end your change with a comma. For example:
'rules' => array($txt['mods_cat_rules']),
// Place the Custom Form Mod Link.
line 232 'customform' => array($txt['CustomForm_tabheader']),
// 'shout' => array($txt['shout']),
// Note the comma!! The setting with automatically appear with the first mod to be added.
'smi' => array($txt['smi']),
),


Can someone please advise me what needs to be deleted. (I dont do coding)
Title: Re: Custom Form Mod
Post by: br360 on October 11, 2015, 04:58:07 PM
In your ./Sources/Admin.php

Find and Remove:
// Place the Custom Form Mod Link.
'customform' => array($txt['CustomForm_tabheader']),


That part of the mod's code did not get removed when you uninstalled. Not sure if you had any other errors when uninstalling this, so there might be more code that needs to be removed from this and other files that the mod edited.
Title: Re: Custom Form Mod
Post by: zurgenaboy on October 11, 2015, 05:03:59 PM
Thank you so much for your helpful reply.
I had this mod on 2 different sites, and one only had the error code.
All now fixed OK  8)
Title: Re: Custom Form Mod
Post by: FragaCampos on October 31, 2015, 05:12:20 PM
I don't know if this was already mentioned, but I would like to know if it's possible to increase the number of characters allowed in the infobox type description.

Regards.
Title: Re: Custom Form Mod
Post by: Proderf on December 23, 2015, 04:55:47 PM
I wold also like to know if there is a way to increase the character limit in Info Boxes.
Title: Re: Custom Form Mod
Post by: PANIC12 on January 15, 2016, 04:06:21 PM
Keep getting a 403 error when I go to add a new form. Any suggestions on how to fix this?
Title: Re: Custom Form Mod
Post by: Kindred on January 15, 2016, 05:48:49 PM
Check with your host... 403 is forbidden...

It's either a configuration issue with the file system or you have something like wordpress running
Title: Re: Custom Form Mod
Post by: luuuciano on January 16, 2016, 12:59:43 PM
Check the server error log at cpanel and/or errorlog file via ftp... will give you more information
Title: Re: Custom Form Mod
Post by: Proderf on January 23, 2016, 01:42:20 PM
What would cause one of my forms to say "The database value you're trying to insert does not exist: subject" on submit?
Title: Re: Custom Form Mod
Post by: Proderf on January 23, 2016, 01:52:41 PM
^^^ The problem above was having "/" in some field names
Title: Re: Custom Form Mod
Post by: Circa on January 25, 2016, 04:04:09 PM
Is there any way I can set an error page if the user doesn't have permission to view the form? Right now it just redirects to the index. I'd like to have a page that says "Please register to complete this form." or something similar. Is that possible?
Title: Re: Custom Form Mod
Post by: TNSeaBee on April 14, 2016, 05:48:52 PM
question....does just the SMF2x.zip work by itself to have the form? Do I need anything else to make the form work? I am new and I have been digging all day trying to figure out why my form is not showing up. I am missing something in the steps and I can't figure it out.
Title: Re: Custom Form Mod
Post by: RizwaN on June 01, 2016, 06:56:33 AM
i have installed this but when i fill and click save button it show empty thread. and i want the thread title with name  " Example - Thread_Starter " but i tried all " username " {username} but not works which is correct syntax for this.

Screenshots of Empty Thread




My Setting of this




.
.
Title: Re: Custom Form Mod
Post by: SychO on June 01, 2016, 07:04:34 AM
You didn't fill the topic content, this is what it would look like, like in my forum :

Title: Re: Custom Form Mod
Post by: Jailer on June 01, 2016, 06:50:56 PM
I was wondering if someone could help me with one thing. I'm following the post here (http://www.simplemachines.org/community/index.php?topic=248871.msg3726297#msg3726297) on how to make the new topic button open a specified form. I want to set my forum up so that the new topic button opens one form and the reply button opens another. Just two forms for all posts.

Is there a way to make the reply button open a form and place a reply in that topic with the form contents?
Title: Re: Custom Form Mod
Post by: RizwaN on June 04, 2016, 04:49:08 AM
How to add images in custom form mod and multiple check box with The Question and a sub text and horizontal rule and bold text.
Title: Re: Custom Form Mod
Post by: Kindred on June 05, 2016, 09:45:28 AM
RizwaN,

Stop repeating the same question. It will continue to get deleted.
Honestly,mi don't think your can do what you are asking with this mod without modifying the code.
Title: Re: Custom Form Mod
Post by: Mbd on June 18, 2016, 06:07:59 PM
Apologies if these questions have been asked before, but -

1 - I have one of my custom forms set so that guests cannot view it, however when they click the form it simply does nothing as they do not have access. Is it possible for me to set it so it gives them a message saying they need an account to create a form.

2 - Is it possible for me to edit the "Thanks" form to display a custom message when they submit a form.

Thanks!
Title: Re: Custom Form Mod
Post by: BFS010 on July 05, 2016, 07:37:11 AM
My Custom Forms take maybe 1 minute to submit (before the user is given the redirection screen).  Any ideas what is causing this or where I could check to see what is happening?
Title: Re: Custom Form Mod
Post by: BFS010 on July 05, 2016, 10:33:39 AM
Quote
My Custom Forms take maybe 1 minute to submit (before the user is given the redirection screen).  Any ideas what is causing this or where I could check to see what is happening?

It is a conflict with Akismat Spam Blocker.  Does anyone know settings that will not cause a conflict or suggest another spam blocker?
Title: Re: Custom Form Mod
Post by: Kindred on July 06, 2016, 10:32:34 AM
http://wiki.simplemachines.org/smf/Spam_-_my_forum_is_flooded_with_spam,_what_can_I_do
Title: Re: Custom Form Mod
Post by: Retro7 on July 15, 2016, 06:04:16 AM
Quote from: Retro7 on July 15, 2016, 05:56:37 AM
I'm using the Custom Form Mod but I want to do something that's not currently available in it's features.
Let me explain with an example:

I create Form1 that posts a Topic "Report" on board "Reports".
This newly created Topic will have a link to Form2.

When I fill up Form2 and post it, it should not post a new thread/topic, but it should reply to Topic "Report" from where I clicked the link.

The Reply part is where I'm stuck on.


So if for example, User1 makes Topic1 with Form1, he will click the link given in the topic and it will reply to Topic1.
Similarly, if User2 makes Topic2 with Form1, he will click the link given in his topic and it will reply to Topic2.


To summarize, Form2 should reply to the Topic based on which Topic the link came from. That's what I want. It needs to be automated.
Title: Re: Custom Form Mod
Post by: Irisado on July 15, 2016, 08:21:53 AM
Please refrain from posting multiple topics on the same issue.  Your other two topics have been removed for this reason.
Title: Re: Custom Form Mod
Post by: Retro7 on July 15, 2016, 11:43:04 AM
Quote from: Irisado on July 15, 2016, 08:21:53 AM
Please refrain from posting multiple topics on the same issue.  Your other two topics have been removed for this reason.

I needed immediate help..
Title: Re: Custom Form Mod
Post by: SychO on July 30, 2016, 01:04:15 PM
can someone post the possible settings in a field ? I know there is required and there is the options for a select box, but what else ? thank you
Title: Re: Custom Form Mod
Post by: Big Game on August 19, 2016, 04:56:23 AM
My site hosts competitions between members.
Therefore My custom form is set to add Member1 vs Member2 in the subject field.

Is there anyway to have the mention members (http://custom.simplemachines.org/mods/index.php?mod=3860) mod work with this one.
It would be great if my members could just start typing a name in the subject field of the custom form and the mention box pops up!
Title: Re: Custom Form Mod
Post by: Big Game on August 19, 2016, 09:56:54 PM
@Live627 Also, is there a way to make this work with child boards?
It displays and posts when I click "Subject" from the child board, but it actually posts to the parent board instead of the child board.
Title: Re: Custom Form Mod
Post by: Kindred on August 21, 2016, 09:28:02 AM
then you have configured it incorrectly.

my form posts to a child board just fine...
Title: Re: Custom Form Mod
Post by: Big Game on August 21, 2016, 01:08:20 PM
Quote from: Kindred on August 21, 2016, 09:28:02 AM
then you have configured it incorrectly.

my form posts to a child board just fine...

Oh okay. Thanks for replying. In that case, I will try to find what I did wrong.

What about my first question about the mention members working in the subject area?
Title: Re: Custom Form Mod
Post by: Kindred on August 21, 2016, 02:26:06 PM
Probably not, since this mod has no received any updates in a while and it would take some code merging to add another mod to this one
Title: Re: Custom Form Mod
Post by: Big Game on August 21, 2016, 02:38:43 PM
Quote from: Kindred on August 21, 2016, 02:26:06 PM
Probably not, since this mod has no received any updates in a while and it would take some code merging to add another mod to this one

Alrighty, thanks again for the fast reply.
Title: Re: Custom Form Mod
Post by: Big Game on August 21, 2016, 09:11:05 PM
Quote from: Kindred on August 21, 2016, 02:26:06 PM
Probably not, since this mod has no received any updates in a while and it would take some code merging to add another mod to this one

back again ...

I have uninstalled and deleted the mod with plans to reinstall and start over.
But when i reinstall I get this error ..



Anyway you can decipher this for me?
Title: Re: Custom Form Mod
Post by: Kindred on August 21, 2016, 10:16:47 PM
http://wiki.simplemachines.org/smf/Error_in_mod_installation
Title: Re: Custom Form Mod
Post by: Big Game on August 22, 2016, 02:39:37 AM
Quote from: Kindred on August 21, 2016, 10:16:47 PM
http://wiki.simplemachines.org/smf/Error_in_mod_installation

Wow! I actually fixed it  8) Thanks a lot buddy. That wasn't too hard after all.
Title: Re: Custom Form Mod
Post by: Biology Forums on August 23, 2016, 09:23:54 PM
Here's how to fix the erasing of permissions.

Find (at around line 880 to 890):

AND permission NOT IN ('" . implode("', '", $context['illegal_permissions']) . "')"), __FILE__, __LINE__);
Where you see the "WHERE" mysql statement, add:

permission NOT LIKE 'custom_forms%' AND

No more erasing of permissions.
Title: Re: Custom Form Mod
Post by: SychO on August 27, 2016, 01:42:59 PM
Quote from: Stylus on August 23, 2016, 09:23:54 PM
Here's how to fix the erasing of permissions.

Find (at around line 880 to 890):

AND permission NOT IN ('" . implode("', '", $context['illegal_permissions']) . "')"), __FILE__, __LINE__);
Where you see the "WHERE" mysql statement, add:

permission NOT LIKE 'custom_forms%' AND

No more erasing of permissions.

this ?

if ($_GET['group'] != 3 && empty($_GET['pid']))
{
$smcFunc['db_query']('', '
DELETE FROM {db_prefix}permissions
WHERE id_group = {int:current_group}
' . (empty($context['illegal_permissions']) ? '' : ' AND permission NOT IN ({array_string:illegal_permissions})'),
array(
'current_group' => $_GET['group'],
'illegal_permissions' => !empty($context['illegal_permissions']) ? $context['illegal_permissions'] : array(),
)
);


if yes could you be more precise of where to paste the line please
Title: Re: Custom Form Mod
Post by: SychO on August 30, 2016, 02:44:36 PM
this is much better

in ManageSettings.php

find

                $smcFunc['db_query']('', '
DELETE FROM {db_prefix}permissions
WHERE id_group = {int:current_group}
' . (empty($context['illegal_permissions']) ? '' : ' AND permission NOT IN ({array_string:illegal_permissions})'),
array(
'current_group' => $_GET['group'],
'illegal_permissions' => !empty($context['illegal_permissions']) ? $context['illegal_permissions'] : array(),
)
);


replace WHERE with:

WHERE permission NOT LIKE "custom_forms%" AND permission NOT LIKE "CustomForm_view_perms" AND
Title: Re: Custom Form Mod
Post by: JerzyLS on September 01, 2016, 10:32:49 AM
I can't understand. Where I would replace the query?
Title: Re: Custom Form Mod
Post by: Kindred on September 01, 2016, 10:39:42 AM
actually, I understand SQL and I am not certain what he is trying to replace within the query and why....
Title: Re: Custom Form Mod
Post by: SychO on September 02, 2016, 06:32:57 PM
Quote from: Kindred on September 01, 2016, 10:39:42 AM
actually, I understand SQL and I am not certain what he is trying to replace within the query and why....

@Stylus showed a way to fix the bug where every time you change the permissions for a group, you get back to the form mod and find that that group's permission in viewing a form is now removed, I just corrected what his answer.
Title: Re: Custom Form Mod
Post by: Kindred on September 02, 2016, 11:13:40 PM
Except your SQL statement seems incorrect to me and it is distinctly unclear which section you intend to be replaced
Title: Re: Custom Form Mod
Post by: SychO on September 03, 2016, 07:41:35 AM
Quote from: Kindred on September 02, 2016, 11:13:40 PM
Except your SQL statement seems incorrect to me and it is distinctly unclear which section you intend to be replaced

I tried it and I currently have it like that, It works just fine, I no longer have that bug where every time I make a permission change for a group the custom forms permissions set back to default for that group.

$smcFunc['db_query']('', '
DELETE FROM {db_prefix}permissions
WHERE permission NOT LIKE "custom_forms%" AND permission NOT LIKE "CustomForm_view_perms" AND id_group = {int:current_group}
' . (empty($context['illegal_permissions']) ? '' : ' AND permission NOT IN ({array_string:illegal_permissions})'),
array(
'current_group' => $_GET['group'],
'illegal_permissions' => !empty($context['illegal_permissions']) ? $context['illegal_permissions'] : array(),
)
);

Title: Re: Custom Form Mod
Post by: JerzyLS on September 03, 2016, 03:57:01 PM
In Source/ManageSettings.php

I have only this:

// Delete any permissions that belong to the form.
$smcFunc['db_query']('', '
DELETE
FROM {db_prefix}permissions
WHERE permission = {string:permission}',
array(
'permission' => 'custom_forms_'.$form_id,
)
);


But this:

// Delete the previous permissions...
$smcFunc['db_query']('', '
DELETE FROM {db_prefix}permissions
WHERE id_group IN ({array_int:group_list})
' . (empty($context['illegal_permissions']) ? '' : ' AND permission NOT IN ({array_string:illegal_permissions})'),
array(
'group_list' => $_POST['group'],
'illegal_permissions' => !empty($context['illegal_permissions']) ? $context['illegal_permissions'] : array(),
)
);


...is in Source/ManagePermissions.php

And there is other array {}.

I'm going to replace WHERE query only.
Title: Re: Custom Form Mod
Post by: JerzyLS on September 03, 2016, 04:02:13 PM
And I just checked it.
Not working for me. It's still erasing permissions of custom forms. :(
Title: Re: Custom Form Mod
Post by: SychO on September 04, 2016, 03:53:39 PM
Quote from: SychO on August 30, 2016, 02:44:36 PM
this is much better

in ManageSettings.php

find

                $smcFunc['db_query']('', '
DELETE FROM {db_prefix}permissions
WHERE id_group = {int:current_group}
' . (empty($context['illegal_permissions']) ? '' : ' AND permission NOT IN ({array_string:illegal_permissions})'),
array(
'current_group' => $_GET['group'],
'illegal_permissions' => !empty($context['illegal_permissions']) ? $context['illegal_permissions'] : array(),
)
);


replace WHERE with:

WHERE permission NOT LIKE "custom_forms%" AND permission NOT LIKE "CustomForm_view_perms" AND

Omg i am so sorry i meant ManagePermissions.php but wrote ManageSettings.php
Title: Re: Custom Form Mod
Post by: aegersz on September 06, 2016, 04:15:36 PM
when i try this mod in my dev system, the topic that it generates doesn't include the fields that i filled in.

am i doing it right ?

where does my entered data go ?

EDIT: Sorted now, i forgot to add the "{field}" value into the body
Title: Re: Custom Form Mod
Post by: Snrj on November 16, 2016, 07:56:25 AM
turkish lang download http://www.simplemachines.org/community/index.php?topic=549945.0
and http://smf.konusal.com/index.php?action=downloads;sa=view;down=73
Title: Re: Custom Form Mod
Post by: iViscosity on December 13, 2016, 11:11:35 PM
I need some help, if anyone still can. I used the guide to make the 'new topic' redirect to the form, but when I click 'save' at the end of the form, it just goes back to the empty form and no post is made. How can I fix this?
Title: Re: Custom Form Mod
Post by: thunderchld on March 01, 2017, 04:53:46 PM
I have attempted to go through the posts, but I cannot find it.  Is it possible to have the forum post anonymously? (Paired with another mod is fine).

e.g. we have a form to collect feedback after certain events; but we do not want everyone to know who sent in that feedback.
Title: Re: Custom Form Mod
Post by: VenoM9078 on August 07, 2017, 08:32:27 AM
I'm sorry for bumping this thread. But I don't know where else can I go for help. It's really important for me to solve this..

When I install the Custom Form Mod and redirect to the 'settings' page as it recalls, this error comes up:

QuoteFatal error: Redefinition of parameter $nul in /storage/ssd1/304/2487304/public_html/Sources/ManageSettings.php on line 2693

Where 2693 line is:


// Fucntion to produce a list of custom form fields.
function list_CustomForm_fields($nul, $nul, $nul, $id)
{
global $txt, $scripturl, $smcFunc;

// Get the data from the cf_fields table.
$request = $smcFunc['db_query']('','
SELECT id_field, title, type, text
FROM {db_prefix}cf_fields
WHERE id_form = {int:id_form}
ORDER BY id_field',
array(
'id_form' => $id,
)
);

$data = array();

while($row = $smcFunc['db_fetch_assoc']($request))
$data[] = $row;

$list = array();
$i = 1;
$end = count($data);


I don't know how to resolve this error. Was hoping someone can help? I only have 2 other packages installed including "mentioning @members" and a smiley pack.
Title: Re: Custom Form Mod
Post by: Atomixx on August 09, 2017, 03:33:08 PM
Anyone know a way that I can make one of the Text Boxes be automatically filled with the users username and cannot be changed?
Title: Re: Custom Form Mod
Post by: Eiyuu on August 17, 2017, 07:52:42 PM
Hi everyone,

I am trying to make the custom form to also work on replies.

I have managed to get do Display.template.php and modify it to go to a custom form, but it always does a new topic instead of replying to the current topic.

My objective was to even use the same form, on the same board. If the same form doesn't work i will just duplicate the form and use that for a reply (which is what i have been trying to do without success...)

Can someone give me a few pointers in how i can make it work for replies as well?

Thanks
Title: Re: Custom Form Mod
Post by: wwwserfer on October 05, 2017, 07:48:41 AM
Quote from: SychO on September 04, 2016, 03:53:39 PM
Quote from: SychO on August 30, 2016, 02:44:36 PM
this is much better

in ManageSettings.php

find

                $smcFunc['db_query']('', '
DELETE FROM {db_prefix}permissions
WHERE id_group = {int:current_group}
' . (empty($context['illegal_permissions']) ? '' : ' AND permission NOT IN ({array_string:illegal_permissions})'),
array(
'current_group' => $_GET['group'],
'illegal_permissions' => !empty($context['illegal_permissions']) ? $context['illegal_permissions'] : array(),
)
);


replace WHERE with:

WHERE permission NOT LIKE "custom_forms%" AND permission NOT LIKE "CustomForm_view_perms" AND

Omg i am so sorry i meant ManagePermissions.php but wrote ManageSettings.php

4 SMF 1.1.x

In ManagePermissions.php

Find:

// Insert the general permissions.
if ($_GET['group'] != 3 && empty($_GET['boardid']))
{
db_query("
DELETE FROM {$db_prefix}permissions
WHERE permission NOT LIKE 'custom_forms%' AND permission NOT LIKE 'CustomForm_view_perms' AND ID_GROUP = $_GET[group]" . (empty($context['illegal_permissions']) ? '' : "
AND permission NOT IN ('" . implode("', '", $context['illegal_permissions']) . "')"), __FILE__, __LINE__);


replace WHERE with:

WHERE permission NOT LIKE 'custom_forms%' AND permission NOT LIKE 'CustomForm_view_perms' AND

It will be right?

(At least it helped me) ;)
Title: Re: Custom Form Mod
Post by: ryry46d9 on October 09, 2017, 11:58:31 AM
Any chance for live627 to come out of retirement ...

Forum version: SMF 2.0.14
I did a local install to track that broke my forums and so far it looks like Custom Form Mod 1.7 is the culprit (only mod installed)

For some reason when CFM is installed I have no access to:
Core Features
Features and Options
Security and Moderation
Modification Settings
Error Log
Administration Log
Moderation Log
Ban Log
Spider Log
Task Log
Log Pruning
When I try to access the pages I get a error 500 with chrome and a blank page with firefox

Also found this gem sitting in the Error Log :
http://192.168.1.100/public/index.php?action=admin;area=packages;sa=install;package=CustomFormMod_v1.7_SMF2x.zip
8: Undefined index: package_readme
File: /var/www/html/public/Sources/Packages.php
Line: 356
Title: Re: Custom Form Mod
Post by: Proderf on October 10, 2017, 09:59:06 PM
From what I notice, this mod doesn't bode well with 2.0.14

I have an error where I can access and use the template, but if i go to edit them, it error screens in the forums saying "The database value you're trying to insert does not exist: id_form"

EDIT: Ive done some of my own tweaking, and the problem comes from ~line 2700 and its previous similar lines with "function list************($nul, $nul, $nul, $id)"

This give an overall fatal error "redefined parameter $nul"

Fix 1: change "function list************($nul, $nul, $nul, $id)" to "function list************()"
-This give the id error stated above

Fix 2:  change "function list************($nul, $nul, $nul, $id)" to "function list************($id)"
-This lets you see the edit page of the forums, but does not show the fields used; its as though there are no feeds on the form, HOWEVER, hone you use the form the fields are still there.

My hypothesis is that 2.0.14 has a bug with mods and databases, where the coding of the mod is not properly pulling from the database the mod data is stored in


Here is my current code (I'm mostly concerned with the second half of it)

// Fucntion to produce a list of custom forms.
function list_CustomForms($id)
{
global $txt, $scripturl, $smcFunc;

// Get the data from the cf_forms table.
$request = $smcFunc['db_query']('','
SELECT id_form, title, id_board
FROM {db_prefix}cf_forms'
);

// Get some general permissions info.
$permissions = get_CustomForm_permissions();
$membergroups = get_CustomForm_membergroups();
$list = array();

// Go through every form.
While($row = $smcFunc['db_fetch_assoc']($request))
{
// Create a list of the groups which can use this form.
$permissions_string = $txt['admin'];
if(isset($permissions['custom_forms_'.$row['id_form']]))
foreach($permissions['custom_forms_'.$row['id_form']] as $membergroup_id)
$permissions_string .= ', '.$membergroups[$membergroup_id];

// Try to find the name of the board.
$board_name = 'Invalid Board';

$board_request = $smcFunc['db_query']('','
SELECT name
FROM {db_prefix}boards
WHERE id_board = {int:id_board}
AND redirect = \'\'',
array(
'id_board' => $row['id_board'],
)
);

// Try to get the name from the returned row.
if($board = $smcFunc['db_fetch_assoc']($board_request))
$board_name = $board['name'];
$smcFunc['db_free_result']($board_request);

// Add the current entry into the list.
$list[] = array(
'title' => $row['title'],
'board' => $row['id_board'].' ("'.$board_name.'")',
'permissions' => $permissions_string,
'modify' => '
<table width="100%">
<tr>
<td width="50%" style="text-align:center;">
<a href="'.$scripturl.'?action=admin;area=modsettings;sa=customform;form_id='.$row['id_form'].';">
('.$txt['CustomForm_edit'].')
</a>
</td>
<td width="50%" style="text-align:center;">
<a href="'.$scripturl.'?action=admin;area=modsettings;sa=customform;form_id='.$row['id_form'].';delete;" onclick="return confirm(\''.$txt['CustomForm_delete_warning'].'\')" >
('.$txt['delete'].')
</a>
</td>
</tr>
</table>',
);
}
$smcFunc['db_free_result']($request);
return $list;
}

// Fucntion to produce a list of custom form fields.
function list_CustomForm_fields($id)
{
global $txt, $scripturl, $smcFunc;

// Get the data from the cf_fields table.
$request = $smcFunc['db_query']('','
SELECT id_field, title, type, text
FROM {db_prefix}cf_fields
WHERE id_form = {int:id_form}
ORDER BY id_field',
array(
'id_form' => $id,
)
);

$data = array();

while($row = $smcFunc['db_fetch_assoc']($request))
$data[] = $row;

$list = array();
$i = 1;
$end = count($data);

// Go through every field.
foreach($data as $field)
{
// Convert the field type into the proper text strings.
$type = str_replace(
// Search array.
array('largetextbox', 'textbox', 'checkbox', 'selectbox', 'float', 'int', 'radiobox', 'infobox'),
// Replace array.
array( $txt['CustomForm_large_textbox'], $txt['CustomForm_textbox'], $txt['CustomForm_checkbox'], $txt['CustomForm_selectionbox'], $txt['CustomForm_float'], $txt['CustomForm_int'], $txt['CustomForm_radiobox'], $txt['CustomForm_infoboxa']),
$field['type']
);

// Add the current entry into the list.
$list[] = array(
'title' => $field['title'],
'text' => $field['text'],
'type' => $type,
'modify' => '
<table width="100%">
<tr>
<td width="25%" style="text-align:center;">
<a href="'.$scripturl.'?action=admin;area=modsettings;sa=customform;field_id='.$field['id_field'].';moveup;">
'.(($i != 1) ? '('.$txt['CustomForm_moveup'].')' : '').'
</a>
</td>
<td width="25%" style="text-align:center;">
<a href="'.$scripturl.'?action=admin;area=modsettings;sa=customform;field_id='.$field['id_field'].';movedown;" >
'.(($i != $end) ? '('.$txt['CustomForm_movedown'].')' : '').'
</a>
</td>
<td width="50%" style="text-align:center;">
<a href="'.$scripturl.'?action=admin;area=modsettings;sa=customform;field_id='.$field['id_field'].';">
('.$txt['CustomForm_edit'].')
</a>
</td>
<td width="50%" style="text-align:center;">
<a href="'.$scripturl.'?action=admin;area=modsettings;sa=customform;field_id='.$field['id_field'].';delete;" onclick="return confirm(\''.$txt['CustomForm_delete_warning'].'\')" >
('.$txt['delete'].')
</a>
</td>
</tr>
</table>',
);
$i++;
}
$smcFunc['db_free_result']($request);
return $list;
}

Title: Re: Custom Form Mod
Post by: Kindred on October 10, 2017, 11:22:05 PM
Since there are many other mods that store and pull information from the database, with no issues, your hypothesis is pretty certainly Incorrect
Title: Re: Custom Form Mod
Post by: Proderf on October 11, 2017, 06:37:35 PM
Quote from: Kindred on October 10, 2017, 11:22:05 PM
Since there are many other mods that store and pull information from the database, with no issues, your hypothesis is pretty certainly Incorrect


thanks for the help :)

what i meant is that the mod itself is not pulling properly; this only started happening with 2.0.14
Title: Re: Custom Form Mod
Post by: Kindred on October 11, 2017, 10:30:55 PM
2.0.14 did change some things for php7 and supporting https. So, there is a chance that this mod will have to be updated
Title: Re: Custom Form Mod
Post by: Proderf on October 14, 2017, 11:35:36 AM
That's probably accurate. The mod worked before 2.0.14 so it probs just needs a bit of tweaking.
Title: Re: Custom Form Mod
Post by: Aleksi "Lex" Kilpinen on December 23, 2017, 08:54:54 AM
I haven't tried to actually use it ( so try this at your own risk ).

In theory, you should be able to bypass that problem and get all the info to show by simply editing the code like this

Find

function list_CustomForm_fields($nul, $nul, $nul, $id)


Replace with

function list_CustomForm_fields($nul3, $nul2, $nul, $id)


Those are empty parameters anyways. However, I have no idea if the forms will work after this edit....
Title: Re: Custom Form Mod
Post by: thunderchld on January 01, 2018, 05:12:10 PM
I do apologize if this has already been asked in this thread. I looked, but I cannot find it.

Is it possible to have a Custom Form post to a moderated board?  Goal: Person fills out form, it goes to moderated state.  Person can see the post, I can see the post, nobody else can see the post.  This would get me a work around until I can find an event registration mod
Title: Re: Custom Form Mod
Post by: Raths Rants on January 06, 2018, 10:55:03 AM
Quote from: thunderchld on January 01, 2018, 05:12:10 PM
I do apologize if this has already been asked in this thread. I looked, but I cannot find it.

Is it possible to have a Custom Form post to a moderated board?  Goal: Person fills out form, it goes to moderated state.  Person can see the post, I can see the post, nobody else can see the post.  This would get me a work around until I can find an event registration mod

At a base level no. The user must have permission to view where the submission is sent. You can add a completed submission page under "Submit Redirect" that let's the user know it has been successfully completed.

With that said. It doesn't mean it can't be done. It's just not a feature out of the box.
Title: Re: Custom Form Mod
Post by: Proderf on January 11, 2018, 08:48:32 PM
Quote from: Aleksi "Lex" Kilpinen on December 23, 2017, 08:54:54 AM
I haven't tried to actually use it ( so try this at your own risk ).

In theory, you should be able to bypass that problem and get all the info to show by simply editing the code like this

Find

function list_CustomForm_fields($nul, $nul, $nul, $id)


Replace with

function list_CustomForm_fields($nul3, $nul2, $nul, $id)


Those are empty parameters anyways. However, I have no idea if the forms will work after this edit....



TY SO MUCH this worked
Title: Re: Custom Form Mod
Post by: cloudstrife465 on January 11, 2018, 10:19:07 PM
when i try to access the custom mod on 2.0.10 in the modifcation settings its giving me this error code

what do i need to do to fix it

This page isn't working
rrgscommunity.epizy.com is currently unable to handle this request.
HTTP ERROR 500
Title: Re: Custom Form Mod
Post by: Aleksi "Lex" Kilpinen on January 12, 2018, 05:21:41 AM
Quote from: cloudstrife465 on January 11, 2018, 10:19:07 PM
when i try to access the custom mod on 2.0.10 in the modifcation settings its giving me this error code

what do i need to do to fix it

This page isn't working
rrgscommunity.epizy.com is currently unable to handle this request.
HTTP ERROR 500
Check your server's error log. It should contain a more detailed explanation of what went wrong.
Title: Re: Custom Form Mod
Post by: Kindred on January 12, 2018, 03:11:07 PM
Also, you need to upgrade to 2.0.15 ASAP. You are 5 versions behind, including several security patches
Title: Re: Custom Form Mod
Post by: cloudstrife465 on January 13, 2018, 02:36:51 AM
ok yeh figures here ill get the details


http://rrgscommunity.epizy.com/index.php?action=admin;area=packages;sa=install;package=CustomFormMod_v1.7_SMF2x.zip
8: Undefined index: package_readme
File: /home/vol2_1/epizy.com/epiz_21378634/htdocs/Sources/Packages.php
Line: 356
Title: Re: Custom Form Mod
Post by: Aleksi "Lex" Kilpinen on January 13, 2018, 03:59:26 AM
That error would not likely cause a 500, and is not from the server side logs. If you have access to the error logs of the server, look for a 500 error in there.
Title: Re: Custom Form Mod
Post by: cloudstrife465 on January 14, 2018, 06:25:13 PM
Fatal error: Redefinition of parameter $nul in /home/vol2_1/epizy.com/epiz_21378634/htdocs/Sources/ManageSettings.php on line 2692 its giving me this error message
Title: Re: Custom Form Mod
Post by: cloudstrife465 on January 15, 2018, 02:08:29 AM
well first it was the previous one i fixed that now its showing this

Fatal error: Cannot redeclare CustomFormSettings() (previously declared in /home/vol2_1/epizy.com/epiz_21378634/htdocs/Sources/ManageSettings.php:2064) in /home/vol2_1/epizy.com/epiz_21378634/htdocs/Sources/ManageSettings.php on line 3375
Title: Re: Custom Form Mod
Post by: cloudstrife465 on January 15, 2018, 03:37:30 PM
Quote from: cloudstrife465 on January 15, 2018, 02:08:29 AM
well first it was the previous one i fixed that now its showing this

Fatal error: Cannot redeclare CustomFormSettings() (previously declared in /home/vol2_1/epizy.com/epiz_21378634/htdocs/Sources/ManageSettings.php:2064) in /home/vol2_1/epizy.com/epiz_21378634/htdocs/Sources/ManageSettings.php on line 3375
Title: Re: Custom Form Mod
Post by: Kindred on January 15, 2018, 05:49:44 PM
You have installed the mod twice. You will have to MANUALLY  remove the duplicated code...  probably in several files.   Or restore the backup that you took before doing the install.
Title: Re: Custom Form Mod
Post by: cloudstrife465 on January 15, 2018, 06:59:07 PM
Quote from: Kindred on January 15, 2018, 05:49:44 PM
You have installed the mod twice. You will have to MANUALLY  remove the duplicated code...  probably in several files.   Or restore the backup that you took before doing the install.


thanks man it worked i reinstall the entire forums and redid it this time it worked thanks
Title: Re: Custom Form Mod
Post by: cloudstrife465 on January 15, 2018, 08:00:32 PM
how do i get the application to show to the guests and members though i created one in the general section but nothing shows there
Title: Re: Custom Form Mod
Post by: valion301 on February 19, 2018, 08:52:43 PM
Hi

I'm running SMF 2.0.15, getting the following error when attempting to create a 'New Field' on a form:

QuoteURLhttps://www.-------.com/forums/index.php?action=admin;area=modsettings;sa=customform;form_id=2;8: Undefined variable: settings
File: /----/-----/public_html/blackstarlegion/forums/Sources/ManageSettings.php
Line: 2327

From ManageSettings.php, lines 2311 - 2335.  Not sure what's wrong with line 2327.  I've done no modifications to the code.  Line 2327: "$settings[file_exists($settings['theme_dir']"
- I have changed themes and tried it with no luck.

Quoterequire_once($sourcedir . '/Subs-Editor.php');
      // Message icons - customized icons are off?
      $context['icons'] = getMessageIcons(!empty($context['cf_forms']['id_board']) ? $context['cf_forms']['id_board'] : 0);

      if (!empty($context['icons']))
         $context['icons'][count($context['icons']) - 1]['is_last'] = true;

      $context['icon_url'] = '';
      for ($i = 0, $n = count($context['icons']); $i < $n; $i++)
      {
         $context['icons'][$i]['selected'] = $context['custom_form_settings']['icon'] == $context['icons'][$i]['value'];
         if ($context['icons'][$i]['selected'])
            $context['icon_url'] = $context['icons'][$i]['url'];
      }
      if (empty($context['icon_url']))
      {
         $context['icon_url'] = $settings[file_exists($settings['theme_dir'] . '/images/post/' . $context['icon'] . '.gif') ? 'images_url' : 'default_images_url'] . '/post/' . $context['icon'] . '.gif';
         array_unshift($context['icons'], array(
            'value' => $context['icon'],
            'name' => $txt['current_icon'],
            'url' => $context['icon_url'],
            'is_last' => empty($context['icons']),
            'selected' => true,
         ));
      }

Currently I can create and save a new form, but fields are not saving.  Any help would be appreciated.

Title: Re: Custom Form Mod
Post by: Kindred on February 20, 2018, 10:09:39 AM
that is not a changed line...   and the section of code is not even part of this mod.   so, that suggests that you changed something that should not have been changed, either form this or some other mod.



Specifically, it seems that you removed a variable global definition of teh $settings variable ---  I am surprised that you've only seen one error.
Title: Re: Custom Form Mod
Post by: valion301 on February 21, 2018, 05:28:52 AM
Hello

Thank you for the reply.  I have not touched the code as I'm not a scripter or coder.  I downloaded 2.0.15 and installed it.  And I downloaded the Custom Form Mod from inside SMF forums package manager and installed it.

Trust me, I dont mess with code.  I dont know a thing about it.

So any recommended fixes or leads on how I can fix this so I can save fields?
Title: Re: Custom Form Mod
Post by: Kindred on February 21, 2018, 12:06:27 PM
if this was the only mod, then load a clean set of files.
https://wiki.simplemachines.org/smf/How_to_upload_a_fresh_set_of_files
Title: Re: Custom Form Mod
Post by: thunderchld on March 06, 2018, 09:30:40 AM
Quote from: cloudstrife465 on January 14, 2018, 06:25:13 PM
Fatal error: Redefinition of parameter $nul in /home/vol2_1/epizy.com/epiz_21378634/htdocs/Sources/ManageSettings.php on line 2692 its giving me this error message


For this, I removed the "$nul" entries on the line:

Error:
Fatal error: Redefinition of parameter $nul in /services/Forum/Sources/ManageSettings.php on line 2727

Action:

Changed line ManagedSettings.php Line 2727 from:
function list_CustomForm_fields($nul, $nul, $nul, $id)

to:
function list_CustomForm_fields($id)

Put it in my test site and things seem to be working OK again.
Title: Re: Custom Form Mod
Post by: Kindred on March 06, 2018, 09:39:44 AM
I believe that would be the incorrect way to handle the situation, as you have now removed 3 of the 4 arguments that may be passed to the function.

I think that his was addressed earlier in this thread by using $nul1, $nul2, $nul3 - which is a better option, IMO


Strangely enough, though -- I have never seen this error and I have been using the custom forms for years.
Title: Re: Custom Form Mod
Post by: thunderchld on March 13, 2018, 06:33:27 PM
Quote from: Kindred on March 06, 2018, 09:39:44 AM
I believe that would be the incorrect way to handle the situation, as you have now removed 3 of the 4 arguments that may be passed to the function.

I think that his was addressed earlier in this thread by using $nul1, $nul2, $nul3 - which is a better option, IMO


Strangely enough, though -- I have never seen this error and I have been using the custom forms for years.

I'll go back and try nul1, nul2, and nul3 - I thought I renamed them but it didn't work - though I am not sure if it was specifically with numbers.   It seems to be working OK without those three values.

I never saw this error until the hosting company upgraded PHP to 5.6
Title: Re: Custom Form Mod
Post by: XRealismX on April 02, 2018, 12:50:20 AM
When I download the Custom Form Mod it just makes the "Features and Options" in the admin menu not work. All it does when I click on it it comes up with an error that says "This page isn't working" Website "is currently unable to handle this request." "HTTP ERROR 500". I waited for 1 hour and the same error happens. Once I disable the mod that page starts working again. Is there any solutions to this problem!?!?
Title: Re: Custom Form Mod
Post by: Kindred on April 02, 2018, 08:33:35 AM
sounds like you either a) have problem with your host (likely - a 500 error indicates a server side error) and/or b) had some errors during installation which you ignored...

The mod works perfectly well for me on 2.0.15 (and has worked since 2.0.5 for me)
Title: Re: Custom Form Mod
Post by: XRealismX on April 02, 2018, 01:59:48 PM
It worked before I tried a month ago with the same host. There was no errors in installation that showed up like I said once I uninstalled that mod that part of the admin menu works. I have installed other mods and there is no errors that show up.
Title: Re: Custom Form Mod
Post by: Kindred on April 02, 2018, 02:02:45 PM
the fact that something disappears like that indicates that the mod IS NOT being installed correctly.

Possibly some other mod was installed and changed the targeted code.

Without looking at every file on your system that this mod attempts to modify, I can't comment further.

The 500 error is almost definitely due to some server configuration...  because 500 is a server-side error.   Look in your server errorlog to figure that one out - or ask your host
Title: Re: Custom Form Mod
Post by: XRealismX on April 02, 2018, 02:14:01 PM
I found this in the error log. 8: Undefined index: package_readme
Title: Re: Custom Form Mod
Post by: Kindred on April 02, 2018, 03:44:16 PM
that os the SMF error log... I said check the SERVER errorlog.
Title: Re: Custom Form Mod
Post by: XRealismX on April 02, 2018, 05:09:38 PM
Quote from: Kindred on April 02, 2018, 03:44:16 PM
that os the SMF error log... I said check the SERVER errorlog.

Where would that be located?
Title: Re: Custom Form Mod
Post by: Kindred on April 02, 2018, 07:36:51 PM
on your server.... :P

probably called errorlog. or error.log or some variation
Title: Re: Custom Form Mod
Post by: XRealismX on April 08, 2018, 11:17:22 PM
Quote from: Kindred on April 02, 2018, 07:36:51 PM
on your server.... :P

probably called errorlog. or error.log or some variation

I don't see and error.log or anything related to errors. I reinstalled smf and when I reinstalled custom form mod I saw no errors reported in installation.
Title: Re: Custom Form Mod
Post by: XRealismX on April 09, 2018, 11:29:07 AM
After the reinstallations the custom form mod still does not work.
Title: Re: Custom Form Mod
Post by: XRealismX on April 09, 2018, 04:57:54 PM
Quote from: XRealismX on April 08, 2018, 11:17:22 PM
Quote from: Kindred on April 02, 2018, 07:36:51 PM
on your server.... :P

probably called errorlog. or error.log or some variation

I don't see and error.log or anything related to errors. I reinstalled smf and when I reinstalled custom form mod I saw no errors reported in installation.

I contacted the web host and they noticed my log file area is not setup correctly on their system so they fixed it and then when I reinstalled it I found a error.log
Also here is all of the images when I go through the installation this includes the SMF version and etc. imgur.com/a/7XIyL
Title: Re: Custom Form Mod
Post by: Kindred on April 09, 2018, 08:31:56 PM
Quote from: Kindred on March 06, 2018, 09:39:44 AM
I believe that would be the incorrect way to handle the situation, as you have now removed 3 of the 4 arguments that may be passed to the function.

I think that his was addressed earlier in this thread by using $nul1, $nul2, $nul3 - which is a better option, IMO


Strangely enough, though -- I have never seen this error and I have been using the custom forms for years.
Quote from: thunderchld on March 06, 2018, 09:30:40 AM
Quote from: cloudstrife465 on January 14, 2018, 06:25:13 PM
Fatal error: Redefinition of parameter $nul in /home/vol2_1/epizy.com/epiz_21378634/htdocs/Sources/ManageSettings.php on line 2692 its giving me this error message


For this, I removed the "$nul" entries on the line:

Error:
Fatal error: Redefinition of parameter $nul in /services/Forum/Sources/ManageSettings.php on line 2727

Action:

Changed line ManagedSettings.php Line 2727 from:
function list_CustomForm_fields($nul, $nul, $nul, $id)

to:
function list_CustomForm_fields($id)

Put it in my test site and things seem to be working OK again.
Title: Re: Custom Form Mod
Post by: XRealismX on April 09, 2018, 09:20:05 PM
It works thanks!
Title: Re: Custom Form Mod
Post by: XRealismX on April 10, 2018, 12:24:09 PM
When I create a form and add fields is does not show up on the field list but, when I open the form the fields are there. Here is the screenshots: imgur.com/a/7XIyL
Title: Re: Custom Form Mod
Post by: XRealismX on April 10, 2018, 09:48:59 PM
There is another error log.
Title: Re: Custom Form Mod
Post by: zushiba on April 10, 2018, 09:50:12 PM
This mod doesn't seem to function at all for me. You cannot get to the form area.
Title: Re: Custom Form Mod
Post by: Kindred on April 10, 2018, 10:14:34 PM
of course you can.

https://www.fx-sabers.com/forum/index.php?action=form

works just fine....
Title: Re: Custom Form Mod
Post by: zushiba on April 10, 2018, 10:15:57 PM
It just takes me to the forum index.
Title: Re: Custom Form Mod
Post by: Kindred on April 10, 2018, 11:27:18 PM
Oh, I forgot that you probably have to be logged in as a member, since only members would use that form...   
https://www.fx-sabers.com/forum/index.php?action=form;n=1

Either way...   make sure your permissions are set correctly and then use action=form (for the form list page) or action=form;n=1 (for the first form)
Title: Re: Custom Form Mod
Post by: zushiba on April 11, 2018, 01:09:01 AM
I uninstalled / reinstalled and it does show the page now /w ?action=form, but there's no option anywhere either on that page or the backend (admin area) to add a form. It's 100% the fault of the wonky ass theme my wife put on the forum but I cannot find out why the theme is refusing to render the "Add New" button.

The Default Theme seems to work fine but if I can't get the buttons to work under this theme it won't solve the problem we're attempting to address.
Title: Re: Custom Form Mod
Post by: Steve on April 11, 2018, 08:00:00 AM
As an FYI for everyone, support in the Support section can take 24 - 48 hours since everyone here is a volunteer and may not be available for extended periods.

Support in mod threads often take much longer so you'll need to be patient.
Title: Re: Custom Form Mod
Post by: Kindred on April 11, 2018, 08:50:41 AM
Quote from: zushiba on April 11, 2018, 01:09:01 AM
I uninstalled / reinstalled and it does show the page now /w ?action=form, but there's no option anywhere either on that page or the backend (admin area) to add a form. It's 100% the fault of the wonky ass theme my wife put on the forum but I cannot find out why the theme is refusing to render the "Add New" button.

The Default Theme seems to work fine but if I can't get the buttons to work under this theme it won't solve the problem we're attempting to address.

Not sure what I can do to help you with that...    except maybe suggest a different theme. :D

Some themes do need tweaking.   The one I used on fx-sabers is a significantly customized version of Bloc's Studio-003 theme, but didn't have any issues with the buttons.



XRealismX,
reporting the post to SMF does nothing...   Mod  support is provided by the author(s) of the mod and sometimes by other users (in this case me). However, support for mods is not guaranteed...   It's one of the hazards of installing an add-on (SMF team only officially supports the core product). In your case, I have no idea...   I can not reproduce your issue(s) at all, therefore I can not comment further on how to fix them.
Title: Re: Custom Form Mod
Post by: sera on April 23, 2018, 03:58:33 PM
I'm running into an issue where I can install this mod just fine, but when I go through Admin->Configuration->Modification Settings all I get is a blank, white page.  I saw that late last year someone suggested a tweak that fixed the issue, however, I'm not sure which file I should make the change in. 

We are running 2.0.15, and this is a fresh install as I slowly add in mods.  Thank you for your assistance!
Title: Re: Custom Form Mod
Post by: sera on April 27, 2018, 01:30:10 PM
So doing more research into this, i've found the error

Quote
[removed for privacy]/ashford/index.php?action=admin;area=packages;sa=install;package=CustomFormMod_v1.7_SMF2x.zip
8: Undefined index: package_readme
Apply Filter: Only show the errors from this file
File: [removed for privacy]/ashford/Sources/Packages.php
Line: 356

The code for this reads:

Quote
elseif ($action['type'] == 'readme')
      {
         if (file_exists($boarddir . '/Packages/temp/' . $context['base_path'] . $action['filename']))
            $context['package_readme'] = htmlspecialchars(trim(file_get_contents($boarddir . '/Packages/temp/' . $context['base_path'] . $action['filename']), "\n\r"));
         elseif (file_exists($action['filename']))
            $context['package_readme'] = htmlspecialchars(trim(file_get_contents($action['filename']), "\n\r"));

         if (!empty($action['parse_bbc']))
         {
            require_once($sourcedir . '/Subs-Post.php');
            $context['package_readme'] = preg_replace('~\[[/]?html\]~i', '', $context['package_readme']);
            preparsecode($context['package_readme']);
            $context['package_readme'] = parse_bbc($context['package_readme']);
         }
         else
            $context['package_readme'] = nl2br($context['package_readme']);

         continue;
      }

Any insight into this would be incredibly appreciated! 
Title: Re: Custom Form Mod
Post by: Kindred on April 27, 2018, 03:35:00 PM
that is not causing your error.

an undefined index will not cause a WSOD.

The WSOD is a server side error that is caused by a significant enough code issue that php crashes. when it tries to render it.
Check your SERVER error log, not the SMF log.
Title: Re: Custom Form Mod
Post by: sera on April 28, 2018, 07:22:23 PM
Thank you so much for the feedback, Kindred!  I dug through the server logs and came up with this error:

[Sat Apr 28 15:51:41 2018] [warn] [client [...]] mod_fcgid: stderr: PHP Fatal error:  Redefinition of parameter $nul in [...]/ashford/Sources/ManageSettings.php on line 2699, referer: http://[...]/ashford/index.php?action=admin;area=packages;sa=install2;package=CustomFormMod_v1.7_SMF2x.zip;pid=0

That brought up this line:

function list_CustomForm_fields($nul, $nul, $nul, $id)


So i dug back through for this old post, and it worked! 

Quote from: Aleksi "Lex" Kilpinen on December 23, 2017, 08:54:54 AM
I haven't tried to actually use it ( so try this at your own risk ).

In theory, you should be able to bypass that problem and get all the info to show by simply editing the code like this

Find

function list_CustomForm_fields($nul, $nul, $nul, $id)


Replace with

function list_CustomForm_fields($nul3, $nul2, $nul, $id)


Those are empty parameters anyways. However, I have no idea if the forms will work after this edit....

So, at least if anyone else runs into the error, this is a workaround.  =)  Thank you, all!
Title: Re: Custom Form Mod
Post by: Prids on May 10, 2018, 04:26:39 PM
I was quite dismayed when I could not load this mod in a new install of SMF 2.0.15 (straight, or by version emulation) without encountering post install errors (although it reported to have loaded cleanly).

However, this fix did the trick.  Thank you sera and all others who contributed to this issue!

Great mod indeed, had it for ages on another install.

Regards

Paul
Title: Re: Custom Form Mod
Post by: Plus on August 04, 2018, 12:39:02 PM
i update my smf version i lost my users posted link in topic.
how can i recover ?
Title: Re: Custom Form Mod
Post by: Kindred on August 04, 2018, 03:35:56 PM
you updated from what to what? How did you update?
Title: Re: Custom Form Mod
Post by: Plus on August 09, 2018, 05:13:54 AM
Quote from: Kindred on August 04, 2018, 03:35:56 PM
you updated from what to what? How did you update?
2.0.14 to 2.0.15 clean update.
but my users form data text, photos okey but hotlinks lost in topic
Title: Re: Custom Form Mod
Post by: Kindred on August 09, 2018, 10:20:53 AM
clean update?  Meaning that you used the full upgrade archive and overwrote all your 2.0.14 files?
(not the best way to do things unless you intended to wipe out all mods and other customization)


I'm not sure what you mean by "hotlinks lost in topic"
url demonstrating the issue?
Title: Re: Custom Form Mod
Post by: Prids on August 15, 2018, 06:47:43 PM
If you are having issues with formatting your output with this mod, read-on.

The detailed user guide says that if you format your output using the WYSIWYG editor, change the view to BBCode before saving.
On this new install, even so I kept losing formatting and in the end wrote the whole thing in BBCode in the BBCode view.  Fine.
Then I discovered, by accident, that if I changed from using Chrome as my browser to Firefox, it all worked fine, including the WYSIWYG.
Still change view before saving though.

Thought that might help someone who is tearing their hair out :)

Title: Re: Custom Form Mod
Post by: MisterVertigo on August 23, 2018, 10:32:16 PM
I just want to say THANK YOU! I've been testing SMF for a while to see if it will work for our group and I came across this mod today. THIS IS A GAME CHANGER. This is hands-down the best mod I've ever installed for any forum software package. I can't wait to re-launch our site and show this off to everyone. Minds are going to be BLOWN! Thank you again!
Title: Re: Custom Form Mod
Post by: Blade73 on November 27, 2018, 04:14:27 AM
Had this on my forum but after clean install i get this error

3.    Execute Modification    ./Sources/Admin.php    Test failed
2.    Add After    ./Sources/Admin.php    Test failed
Code: (Find) [Select]
Quote
   // Load the language and templates....
   loadLanguage('Admin');
   loadTemplate('Admin', 'admin');
Code: (Add After) [Select]

   
QuoteloadLanguage('Modifications');

but in my admin.php it says
Quote// Load the language and templates....
   loadLanguage('Admin');   
      loadLanguage('Treasury');
   loadTemplate('Admin', 'admin');

so i manuallly put that line in after but no go and also after loadLanguage('Treasury');
still a nogo
after installing the pages get white  and i have to go backwards to uninnstall and its all good again

the only error in log on forum is
Undefined index: package_readme
Line: 356 ==>356:    $context['package_readme'] = preg_replace('~\[[/]?html\]~i', '', $context['package_readme']);

Any ideas?

Title: Re: Custom Form Mod
Post by: Kindred on November 27, 2018, 07:43:24 AM

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


it should read like that.

(also, use code tags, not quote tags, please...)
Title: Re: Custom Form Mod
Post by: Arantor on November 27, 2018, 08:02:38 AM
Not sure why Modifications needs to be loaded, this hasn't been required since late betas of 2.0...
Title: Re: Custom Form Mod
Post by: Blade73 on November 29, 2018, 06:48:25 AM
Quote from: Kindred on November 27, 2018, 07:43:24 AM

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


it should read like that.

(also, use code tags, not quote tags, please...)

I did that but when it loads up after installing it says moving you to the modificatons page and all gets white will try to not add it and reply

edit well not putting in that line got the same white page it wont redirect you to the page for the forms and all pages get white
Title: Re: Custom Form Mod
Post by: Blade73 on December 23, 2018, 07:57:20 PM
is there a simulare mod out there like this since this aint working at all at my forum now
been trought all manually to check but still end ups with white pages ?
Title: Re: Custom Form Mod
Post by: Kindred on December 24, 2018, 02:34:06 AM
No, this is the only mod of this sort.

However, a white page is indicative of a php level error. Find the actual error in the server error log file...   the. We might have some idea what is actually happening.  I have used this. Or of 5 different sites, on 4 different servers without encountering the issue that you report.
Title: Re: Custom Form Mod
Post by: Jeremy M. on February 10, 2019, 06:55:09 AM
I installed this mod on my forum (2.0.15). . I get the following:

Fatal error: Redefinition of parameter $nul in /storage/ssd4/929/1691929/public_html/Sources/ManageSettings.php on line 2705


Also get

Field 'title' doesn't have a default value
File: /storage/ssd4/929/1691929/public_html/Sources/ManageSettings.php
Line: 2533
Title: Re: Custom Form Mod
Post by: Shambles on February 10, 2019, 07:03:50 AM
Quote from: Alexa Lynne
I installed this mod on my forum (2.0.15). . I get the following:

Fatal error: Redefinition of parameter $nul in /storage/ssd4/929/1691929/public_html/Sources/ManageSettings.php on line 2705

Read the earlier posts - it's been reported & fixed several times.

Eg, https://www.simplemachines.org/community/index.php?topic=248871.msg3970510;topicseen#msg3970510
Title: Re: Custom Form Mod
Post by: Jeremy M. on February 13, 2019, 06:55:02 PM
Quote from: Shambles on February 10, 2019, 07:03:50 AM
Quote from: Alexa Lynne
I installed this mod on my forum (2.0.15). . I get the following:

Fatal error: Redefinition of parameter $nul in /storage/ssd4/929/1691929/public_html/Sources/ManageSettings.php on line 2705

Read the earlier posts - it's been reported & fixed several times.

Eg, https://www.simplemachines.org/community/index.php?topic=248871.msg3970510;topicseen#msg3970510


The fix above does not work.
Title: Re: Custom Form Mod
Post by: Aleksi "Lex" Kilpinen on February 13, 2019, 11:37:23 PM
How does it not work? It's worked for others.

EDIT: fixed typo.
Title: Re: Custom Form Mod
Post by: Arantor on February 14, 2019, 02:32:06 AM
Also define "doesn't work".
Title: Re: Custom Form Mod
Post by: Jeremy M. on February 24, 2019, 07:25:03 PM
Quote from: Arantor on February 14, 2019, 02:32:06 AM
Also define "doesn't work".


Field 'title' doesn't have a default value
File: /storage/ssd4/929/1691929/public_html/Sources/ManageSettings.php
Line: 2533

array('id_form')
Title: Re: Custom Form Mod
Post by: Kindred on February 25, 2019, 07:00:32 AM
Change the column to allow null:
ALTER TABLE `x` CHANGE `title` `title` TEXT NULL

or, give it a default value as empty string:
ALTER TABLE `x` CHANGE `title` `title` TEXT NOT NULL DEFAULT ''

(where table `x` is the table that contains the title column....   not sure which one, off the top of my head)
Title: Re: Custom Form Mod
Post by: Jeremy M. on February 28, 2019, 12:48:29 PM
Quote from: Kindred on February 25, 2019, 07:00:32 AM
Change the column to allow null:
ALTER TABLE `x` CHANGE `title` `title` TEXT NULL

or, give it a default value as empty string:
ALTER TABLE `x` CHANGE `title` `title` TEXT NOT NULL DEFAULT ''

(where table `x` is the table that contains the title column....   not sure which one, off the top of my head)

Is this in ManageSettings.php? If so, I can't find the code or I don't know where to put it.
Title: Re: Custom Form Mod
Post by: Aleksi "Lex" Kilpinen on February 28, 2019, 01:03:43 PM
No, that would be something you would have to do to your database, for example through phpMyAdmin.
Title: Re: Custom Form Mod
Post by: Jeremy M. on March 04, 2019, 06:09:43 PM
Quote from: Kindred on February 25, 2019, 07:00:32 AM
Change the column to allow null:
ALTER TABLE `x` CHANGE `title` `title` TEXT NULL

or, give it a default value as empty string:
ALTER TABLE `x` CHANGE `title` `title` TEXT NOT NULL DEFAULT ''

(where table `x` is the table that contains the title column....   not sure which one, off the top of my head)

I'm about to give up, honestly.  I can't find it anywhere in my database and my hosting provider isn't any help.
Title: Re: Custom Form Mod
Post by: dorukum123 on April 20, 2019, 04:01:20 PM
Hey everyone,

I am trying to install this mod to my smf 2.0.15. I was able to install it and I can see index.php?action=form which is empty, however when it comes to access index.php?action=admin;area=modsettings;ff81d36=f2f5d08913f7e09f56d2a68b445a7b72 to create  forms, I see a blank page.

I already reinstalled twice however it is not working. Can you please help?
Title: Re: Custom Form Mod
Post by: Kindred on April 21, 2019, 10:01:12 AM
well, additional problem now -- if you have installed twice, you probably have duplicated code.

original problem -- did you receive any errors on registration?
Title: Re: Custom Form Mod
Post by: dorukum123 on April 21, 2019, 10:44:48 AM
I haven't received any error but removed / reinstalled the pack. Still seeing blank page :(

IS there any other custom form I can use?
Title: Re: Custom Form Mod
Post by: Biology Forums on April 21, 2019, 12:51:35 PM
Quote from: dorukum123 on April 21, 2019, 10:44:48 AM
I haven't received any error but removed / reinstalled the pack. Still seeing blank page :(

IS there any other custom form I can use?

What form would you like to make? You could always create one on your own without all the bloat and limitations of a mod
Title: Re: Custom Form Mod
Post by: dorukum123 on April 21, 2019, 02:40:18 PM
Quote from: Study Force on April 21, 2019, 12:51:35 PM
Quote from: dorukum123 on April 21, 2019, 10:44:48 AM
I haven't received any error but removed / reinstalled the pack. Still seeing blank page :(

IS there any other custom form I can use?

What form would you like to make? You could always create one on your own without all the bloat and limitations of a mod


Hey, I want to create a custom form where the user will answer the questions and it will automatically create a thread on specific category. It is weird that I can't install it :(

fyi; I am new to SMF
Title: Re: Custom Form Mod
Post by: Kindred on April 21, 2019, 07:44:14 PM
in which case, this mod IS the best option....

Ok...  When you say "removed" - do you mean "uninstalled" or "deleted"? (They are two very different things)

Are you using the default theme? If not, did you select the checkbox to install the mod into your custom theme(s)?
Title: Re: Custom Form Mod
Post by: dorukum123 on April 23, 2019, 11:13:59 AM
Attaching a screenshot. So I only delete / install packages from the package manager.

When I checked now, I can see that the setup goes to my default theme instead of my custom one. But I can't edit the path.

What should I do to apply this to my current theme?

I also go back to old theme however it is still now allowing me to use the mod anyway.

I also added what exactly I see when I try to use the mod.

Thanks.
Title: Re: Custom Form Mod
Post by: Kindred on April 23, 2019, 01:26:04 PM
if you DELETE from the package manager, then you remove any capability of actually uninstalling the mod automatically.
If you delete a version of the mod and then install another version, then you have duplicated the install.

you must uninstall, then delete or install

so, to get it into your custom theme -- uninstall the mod.
reinstall the mod, this time, check your theme during the installation process.
Title: Re: Custom Form Mod
Post by: dorukum123 on April 23, 2019, 01:28:58 PM
Quote from: Kindred on April 23, 2019, 01:26:04 PM
if you DELETE from the package manager, then you remove any capability of actually uninstalling the mod automatically.
If you delete a version of the mod and then install another version, then you have duplicated the install.

you must uninstall, then delete or install

so, to get it into your custom theme -- uninstall the mod.
reinstall the mod, this time, check your theme during the installation process.

I understand what you are saying.

Did you check the screenshots? I already uninstalled and then even deleted afterwards.

I am able to remove the mod and install it from scratch. And during the installation, it doesnt ask me to choose the theme. I also tried with the default theme as it is choosing that one.

Do you mind sharing a discord/ts or something for contacting you in private for this?

Please help.. need this one desperately.
Title: Re: Custom Form Mod
Post by: Atomixx on May 01, 2019, 10:27:25 PM
Quote from: Alexa Lynne on March 04, 2019, 06:09:43 PM
Quote from: Kindred on February 25, 2019, 07:00:32 AM
Change the column to allow null:
ALTER TABLE `x` CHANGE `title` `title` TEXT NULL

or, give it a default value as empty string:
ALTER TABLE `x` CHANGE `title` `title` TEXT NOT NULL DEFAULT ''

(where table `x` is the table that contains the title column....   not sure which one, off the top of my head)

I'm about to give up, honestly.  I can't find it anywhere in my database and my hosting provider isn't any help.

I had the same exact problem. Off the top of my head I cant remember, but if you send me your error message I'll be able to help you fix it. You can fix it through phpmyadmin.
Title: Re: Custom Form Mod
Post by: Deathinflames on June 07, 2019, 06:27:32 PM
This is a great mod, we've been using it for quite some time and the reason i am making this post is to receive clarification on how to deal with people that attempt to the view the forms while not logged in. Currently it just displays a blank page leaving the user confused. How might i go about adding some simple text informing the user that they need to login to see the form?
Title: Re: Custom Form Mod
Post by: GigaWatt on June 08, 2019, 03:54:44 AM
Did you set the permissions properly (guests can see the forms)?
Title: Re: Custom Form Mod
Post by: shadav on September 12, 2019, 03:49:56 PM
i'm not sure what happened
I tried to install this and after install, it redirects me to a blank page.... if i click back button and click on any admin links i get a blank page...i was able to use my back button to get back to the package list and unistall this
i'm assuming it's not playing nicely with another mod
Title: Re: Custom Form Mod
Post by: Kindred on September 12, 2019, 03:55:45 PM
look in your server error log....   when you get a blank page, it's a php core error....    and you need to look at the server log to figure out what.
Title: Re: Custom Form Mod
Post by: shadav on September 12, 2019, 04:15:30 PM
Quote from: Kindred on September 12, 2019, 03:55:45 PM
look in your server error log....   when you get a blank page, it's a php core error....    and you need to look at the server log to figure out what.
unfortunately there is nothing in my error logs, but thank you
Title: Re: Custom Form Mod
Post by: Kindred on September 12, 2019, 04:42:23 PM
not your SMF error log... the SERVER error log.

If you got a blank screen, several times, without the error being recorded, then you have issues with your SERVER configuration - talk to your host
Title: Re: Custom Form Mod
Post by: sirfpsycho on September 24, 2019, 01:40:50 AM
how does it work? I installed it but opening https://example.com/index.php?action=form
it gives: Screenshot_1.png

I added these setting in admin panel:

Screenshot_2.png
Screenshot_3.png
Title: Re: Custom Form Mod
Post by: ladyquack on November 12, 2019, 02:10:55 PM
I just tried installing this modification on a clean copy of 2.0.15 and it was also throwing HTTP ERROR 500. When I checked my error log, it shows PHP Fatal error: Redefinition of parameter $nul in /home/xcxcx/public_html/Sources/ManageSettings.php on line 3310. The string of coding on that line is "function list_CustomForm_fields($nul, $nul, $nul, $id)". I'm not exactly sure with how to proceed fixing this issue.
Title: Re: Custom Form Mod
Post by: Arantor on November 12, 2019, 02:21:53 PM
Change the second $nul to $nul2 and the third to $nul3 but leave the first alone.
Title: Re: Custom Form Mod
Post by: ladyquack on November 12, 2019, 02:32:50 PM
Quote from: Arantor on November 12, 2019, 02:21:53 PM
Change the second $nul to $nul2 and the third to $nul3 but leave the first alone.

That seemed to do the trick. Thank you so much!
Title: Re: Custom Form Mod
Post by: Atomixx on November 16, 2019, 08:03:09 PM
Anyway, for the dropdown box be able to list all the members of a member group for example?
Title: Re: Custom Form Mod
Post by: petewadey on February 09, 2020, 08:24:13 AM
I'm running 2.0.17. When updating to php 7.2, I lost a lot of admin functionality on my site. It was suggested that a mod might be the cause, so one by one I uninstalled my mods and retested php 7.2. When I deleted this mod, all was fixed. Any ideas? as I would really like to keep this mod. Thanks
Title: Re: Custom Form Mod
Post by: Diego Andrés on February 09, 2020, 06:36:31 PM
What kind of problems did you get while using the mod?
Can you describe what functionalities did you lose and did you get any errors in the log that might help identify the issue?
Title: Re: Custom Form Mod
Post by: petewadey on February 10, 2020, 04:54:14 AM
I didn't have any user problems, only Admin. ie Admin>Configuration>Security and Moderation would get a white page with "This page isn't working" message. Same thing on some other Admin pages. No error messages. Thanks
Title: Re: Custom Form Mod
Post by: Plus on May 13, 2020, 03:05:19 AM
Quote from: petewadey on February 09, 2020, 08:24:13 AM
I'm running 2.0.17. When updating to php 7.2, I lost a lot of admin functionality on my site. It was suggested that a mod might be the cause, so one by one I uninstalled my mods and retested php 7.2. When I deleted this mod, all was fixed. Any ideas? as I would really like to keep this mod. Thanks

follow this : managesettings.php Change the second $nul to $nul2 and the third to $nul3 but leave the first alone.
Title: Re: Custom Form Mod
Post by: Sectomy on July 14, 2020, 05:38:29 AM
Hi,

so theres actually no way for attachments or ?
cause this would be an awsome mods for Reviews or Announcements, so a User can fill the fields , upload attachments (images) to the Post.

greets
andi
Title: Re: Custom Form Mod
Post by: Taelt on July 21, 2020, 09:17:51 PM
Hi All,

The mod seems to be working fine with the changes done through the topic (Thanks everyone!)

But... i am having an odd "bug" Only the first Custom is showing up.

Even if i try accessing the new ones i created, i cant access them (although i am Admin...) I have even tried duplicating the first entry in the database (and changing its number obviously) and still not working. Only the first custom form shows up when accessing "action=form;" It should show all custom forms here...

Can anyone give me a little hand with this? I have tried searching in Managesettings.php and CustomForm.php but cant find anything that helps regarding the forms access :(

Thanks in advance!
Title: Re: Custom Form Mod
Post by: Sectomy on July 25, 2020, 08:30:16 AM
so, no image attachment option or ?
sorry, havent found others then requests after an image option ....
Title: Re: Custom Form Mod
Post by: FragaCampos on July 26, 2020, 12:08:56 AM
This is a feature already requested and discussed in this topic sometimes, but, unfortunately, no one was able to do it.



Quote from: Sectomy on July 25, 2020, 08:30:16 AM
so, no image attachment option or ?
sorry, havent found others then requests after an image option ....

Title: Re: Custom Form Mod
Post by: Sectomy on August 02, 2020, 06:50:01 AM
what a shame, that would be the perfect mod , if there would be some sort of image attachment /upload .....
Title: Re: Custom Form Mod
Post by: Sectomy on August 16, 2020, 03:54:29 AM
hi,

is it possible to "copy" a Form to another "Subforum" ?
we have many Subforums and i wanna add the same formular to all the Subforums...

so to specify:
I have a Forum Category: Announcements
with Subforums of Brands (i.e. 20 Brands)
if a user wanna Post in one Subforum, they got the Same Custom Form to fill out, but it will be posted to the correct Forum.
So i dont need to add all fields to a new Form except the Board it will be posted....
i hope you understand what i wanna to say :)
Title: Re: Custom Form Mod
Post by: FragaCampos on August 16, 2020, 06:09:12 PM
This mod creates two tables in the database: cf_fields and cf_forms.
I believe you only need to copy those two tables and add them to the database. Just try it.
Title: Re: Custom Form Mod
Post by: Sectomy on August 21, 2020, 03:02:33 AM
yeah, ive done that, and it works :) thanx !
but now i got 2 Errors in my Error Log:

8: Undefined index: CustomForm_tabheader
Filter hinzufügen: Nur Fehler von dieser Datei zeigen
Datei: /Admin.php
Zeile: 226

in this Line:

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


and this one if someone submits a form:

2: Invalid argument supplied for foreach()
Filter hinzufügen: Nur Fehler von dieser Datei zeigen
Datei: Subs-Post.php
Zeile: 3091


this is in the line:


3089: // Ignore any parents on the top child level.
3090: //!!! Why?
==>3091: foreach ($parents as $id => $parent)
3092: {
3093: if ($parent['level'] != 0)


any Ideas ?

greets
andy
Title: Re: Custom Form Mod
Post by: Sectomy on August 21, 2020, 06:59:27 AM
Quote from: Sectomy on August 21, 2020, 03:02:33 AM


8: Undefined index: CustomForm_tabheader
Filter hinzufügen: Nur Fehler von dieser Datei zeigen
Datei: /Admin.php
Zeile: 226

in this Line:

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



Fixed: This line: "$txt['CustomForm_tabheader'] = 'Custom Forms';" is missing from Modifications.english.php' file.
Title: Re: Custom Form Mod
Post by: wperock on August 25, 2020, 11:47:37 PM
Does this still work ? I can't see to get it on my website

Title: Re: Custom Form Mod
Post by: wperock on August 26, 2020, 10:16:43 AM
After installing it takes me to : /index.php?action=admin;area=modsettings;sa=customform

And I get This page isn't workingwww.warriorpointe.org is currently unable to handle this request.
HTTP ERROR 500
Title: Re: Custom Form Mod
Post by: Kindred on August 26, 2020, 10:26:27 AM
look in your server log as to what is triggering the 500 error.
(not the smf error log, but the server-side error.log errorlog. or similar file.)
Title: Re: Custom Form Mod
Post by: live627 on August 26, 2020, 08:04:42 PM
Probably the duplicate parameters issue
Title: Re: Custom Form Mod
Post by: njtweb on September 04, 2020, 07:24:06 AM
Hello, thank you for the mod, I would like to leverage this for my forum to survey guests.

However when I install on 2.0.17 it redirects to 500 error page. I go back to admin>Modification Settings>Custom Form and get 500 error page.

Any chance somebody knows why this is happening and how to fix so it's able to be used?

Thank you to all in advance.
Title: Re: Custom Form Mod
Post by: Arantor on September 04, 2020, 07:35:43 AM
Quote from: ladyquack on November 12, 2019, 02:10:55 PM
I just tried installing this modification on a clean copy of 2.0.15 and it was also throwing HTTP ERROR 500. When I checked my error log, it shows PHP Fatal error: Redefinition of parameter $nul in /home/xcxcx/public_html/Sources/ManageSettings.php on line 3310. The string of coding on that line is "function list_CustomForm_fields($nul, $nul, $nul, $id)". I'm not exactly sure with how to proceed fixing this issue.
Quote from: Arantor on November 12, 2019, 02:21:53 PM
Change the second $nul to $nul2 and the third to $nul3 but leave the first alone.
Title: Re: Custom Form Mod
Post by: njtweb on September 04, 2020, 07:44:28 AM
Thank you as always @Arantor. very much appreciated!
Title: Re: Custom Form Mod
Post by: njtweb on September 04, 2020, 08:37:33 AM
I scanned through this topics comments and see there is a hack to have the new topic button re-direct to the form for a board.

I'm not looking to do that but I would rather the submitted output from the form be directed to a specific topic within a board. Rather than a new topic being generated on a board for each submission.

Is it possible to change from the board ID to a topic ID so all output goes to the topic as a new comment?

Thank you in advance.
Title: Re: Custom Form Mod
Post by: Sectomy on September 04, 2020, 11:12:21 AM
Quote from: Sectomy on August 21, 2020, 03:02:33 AM
yeah, ive done that, and it works :) thanx !
but now i got 2 Errors in my Error Log:

this one if someone submits a form:

2: Invalid argument supplied for foreach()
Filter hinzufügen: Nur Fehler von dieser Datei zeigen
Datei: Subs-Post.php
Zeile: 3091


this is in the line:


3089: // Ignore any parents on the top child level.
3090: //!!! Why?
==>3091: foreach ($parents as $id => $parent)
3092: {
3093: if ($parent['level'] != 0)


any Ideas ?

greets
andy

anyone ? :)
Title: Re: Custom Form Mod
Post by: njtweb on September 13, 2020, 07:39:21 PM
Anybody know if this developer is still around? I'd like to see if this can be modified to send form responses to a topic as new replies instead of to a forum to start new topics on each response.
Title: Re: Custom Form Mod
Post by: Shades. on October 03, 2020, 02:00:13 AM
Would love to see this updated for 2.0.17! Any solutions? Im willing to donate a little $ for it! :)
Title: Re: Custom Form Mod
Post by: Kindred on October 03, 2020, 07:51:27 AM
I am using it on 2.0.17
Title: Re: Custom Form Mod
Post by: Shades. on October 03, 2020, 09:57:53 AM
Quote from: Kindred on October 03, 2020, 07:51:27 AM
I am using it on 2.0.17
Doesn't work for me and I tried it on a fresh install! When I go to https://mysite.com/xxxx/index.php?action=admin;area=modsettings;sa=customform i get This page isn't working mysite.com is currently unable to handle this request.
HTTP ERROR 500
Title: Re: Custom Form Mod
Post by: Doug Heffernan on October 03, 2020, 11:06:14 AM
Quote from: Shades. on October 03, 2020, 09:57:53 AM
Quote from: Kindred on October 03, 2020, 07:51:27 AM
I am using it on 2.0.17
Doesn't work for me and I tried it on a fresh install! When I go to https://mysite.com/xxxx/index.php?action=admin;area=modsettings;sa=customform i get This page isn't working mysite.com is currently unable to handle this request.
HTTP ERROR 500

This looks to be a server related issue.
Title: Re: Custom Form Mod
Post by: Shades. on October 03, 2020, 11:48:41 AM
I wonder if its because Im running php 7.3?
Title: Re: Custom Form Mod
Post by: Gavin Chatt on October 06, 2020, 11:57:50 PM
Hi Guys and a huge cheers for this mod, I'm sort of getting it but now having difficulties in the form design and ask if anyone could assist. I'll add attachments to try and help visually where things are right now.

The install process provided a blank page / error however I feel I have sorted that side. Reading the information Custom Form Mod Version 1.7 (https://custom.simplemachines.org/mods/index.php?mod=1279) I'm understanding most part however struggle between the fields.

The list can be seen and looks fine


Custom Form Mod Settings - From what I can see and understand I need to setup a new form


Once setup the next step would be to enter the for data we would be hoping to have supplied. I'm unable to force an entry as note knowing how as yet. Once this has been completed I don't see the new form in the list however noticed that unless I have a form field setup the form name will not show in the list.


Once I have added a Form Field the form name will show and allow selection from the list, however will only show the Form Field and not the posted needs.


Title: Re: Custom Form Mod
Post by: Gavin Chatt on October 08, 2020, 04:31:53 AM
Sorry All, but is anyone able to assist the above with this and point out where I'm going wrong?

Thanks in advance.
Title: Re: Custom Form Mod
Post by: Gavin Chatt on October 08, 2020, 10:22:38 AM
Quote from: Gavin Chatt on October 08, 2020, 04:31:53 AM
Sorry All, but is anyone able to assist the above with this and point out where I'm going wrong?

Thanks in advance.

Well it has takes a few days and some additional hours but I now feel I had this sorted.

Cheers all :)
Title: Re: Custom Form Mod
Post by: Shades. on November 18, 2020, 03:14:36 PM
Quote from: Arantor on September 04, 2020, 07:35:43 AM
Quote from: ladyquack on November 12, 2019, 02:10:55 PM
I just tried installing this modification on a clean copy of 2.0.15 and it was also throwing HTTP ERROR 500. When I checked my error log, it shows PHP Fatal error: Redefinition of parameter $nul in /home/xcxcx/public_html/Sources/ManageSettings.php on line 3310. The string of coding on that line is "function list_CustomForm_fields($nul, $nul, $nul, $id)". I'm not exactly sure with how to proceed fixing this issue.
Quote from: Arantor on November 12, 2019, 02:21:53 PM
Change the second $nul to $nul2 and the third to $nul3 but leave the first alone.
That worked for me as well...thanks!
Title: Re: Custom Form Mod
Post by: Shades. on November 18, 2020, 03:32:06 PM
Is there a way to had "Attachments" to the forms?
Title: Re: Custom Form Mod
Post by: njtweb on December 31, 2020, 12:45:40 PM
I'll take a shot here, hoping somebody can help. I configured everything on the back end. I tested output on the front end and I have a problem. Everythings great and seems to work. But when the form is submitted to the forum I selected. It creates a new topic, but there's no output. It's the layout of my form design that shows up in the body of the topic, like below. Hopefully, it's something easy to modify.

New topic output after posting:
Which Teams Played On What Date?: - {Game Date And Matchup}
Article Headline: - {Article Title}
Game Summary: - {Game Summary}

Any help is greatly appreciated.
Title: Re: Custom Form Mod
Post by: Luftwolfe on January 01, 2021, 05:03:12 PM
I'm getting the following issue -- I've done a fresh install of the forum and completely nuked all my databases. I've already attempted to edit the dbs and make sure the default for title == null. I'm at a loss. Any assistance would be amazing.

Error in question:
QuoteField 'title' doesn't have a default value
File: /home/smuus/public_html/forums/Sources/ManageSettings.php
Line: 2560
Title: Re: Custom Form Mod
Post by: Kindred on January 02, 2021, 08:16:37 AM
Give the column a default of NULL in the SQL database, using phpmyadmin
Title: Re: Custom Form Mod
Post by: njtweb on January 03, 2021, 10:29:49 AM
Hi Kindred, I see you use this mod too. Is there something I did wrong with my configuration which is not putting the output of what the person enters into the fields into the new topic post? All I get is the field config when they submit.
Title: Re: Custom Form Mod
Post by: Luftwolfe on January 04, 2021, 11:20:22 AM
Quote from: Kindred on January 02, 2021, 08:16:37 AM
Give the column a default of NULL in the SQL database, using phpmyadmin

Hi Kindred,

Thanks for this suggestion, but I've done that already. No changes seem to take place when making this change in the DB. I'm at a loss here
Title: Re: Custom Form Mod
Post by: Kindred on January 04, 2021, 03:28:25 PM
Luftwolfe --- that can not be true.

If you are getting that error, it is because you have the column set to use no default -- setting the column to default=NULL fixes that error 100% of the time.



njtweb -- I'm not sure what you are doing wrong...  this is my code and it works fine...

For Sale: [size=4]{item}[/size]
[color=red][size=5]${price}[/size][/color]

Description:
{item_descr}




oh, wait...   looking at your code --- you are using the FIELD TEXT not, the FIELD TITLE (which can not have spaces)
Title: Re: Custom Form Mod
Post by: njtweb on January 04, 2021, 04:16:36 PM
Thank you sir. All good now.
Title: Re: Custom Form Mod
Post by: PANIC12 on February 08, 2021, 09:47:25 PM
Hi, I am getting this error. Any reason why?
Title: Re: Custom Form Mod
Post by: Kindred on February 08, 2021, 09:48:42 PM
Look like you edited some code incorrectly
Title: Re: Custom Form Mod
Post by: PANIC12 on February 09, 2021, 02:07:13 AM
Quote from: Kindred on February 08, 2021, 09:48:42 PM
Look like you edited some code incorrectly

Thank you, I had to restore my backup.

I was trying to install the Custom Form Mod, but one of the tests failed (attached below), so I tried to install it manually. When I try to install it through the package manager, the mod installs and works, but I cannot edit any of the settings (I get a blank white page). I also get the same error when I go to Features and Options. Is there another way to install it? Am I doing something wrong?

Title: Re: Custom Form Mod
Post by: Kindred on February 09, 2021, 09:11:46 AM
you'll have to manually edit the section that failed ---  but as you noticed with the error, it's not just a simple cut/paste --   the auto-parser doesn't work because something has already changed the target code...    so you have to figure out where and how to apply these changes in the ALTERED code.
Title: Re: Custom Form Mod
Post by: PANIC12 on February 09, 2021, 08:55:15 PM
This is my Admin.php without the Custom Form mod edits. Where would I place the code? Any help would be greatly appriecated!

<?php

/**
 * Simple Machines Forum (SMF)
 *
 * @package SMF
 * @author Simple Machines
 *
 * @copyright 2011 Simple Machines
 * @license http://www.simplemachines.org/about/smf/license.php BSD
 *
 * @version 2.0.16
 */

if (!defined('SMF'))
die('Hacking attempt...');

/* This file, unpredictable as this might be, handles basic administration.

void AdminMain()
- initialises all the basic context required for the admin center.
- passes execution onto the relevant admin section.
- if the passed section is not found it shows the admin home page.

void AdminHome()
- prepares all the data necessary for the administration front page.
- uses the Admin template along with the admin sub template.
- requires the moderate_forum, manage_membergroups, manage_bans,
  admin_forum, manage_permissions, manage_attachments, manage_smileys,
  manage_boards, edit_news, or send_mail permission.
- uses the index administrative area.
- can be found by going to ?action=admin.

void AdminSearch()
- allocates out all the search stuff.

void AdminSearchInternal()
- a complicated but relatively quick internal search.

void AdminSearchMember()
- pass through to manage members.

void DisplayAdminFile()
- get one of the admin information files from Simple Machines.

*/

// The main admin handling function.
function AdminMain()
{
global $txt$context$scripturl$sc$modSettings$user_info$settings$sourcedir$options$smcFunc$boarddir;

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

// No indexing evil stuff.
$context['robot_no_index'] = true;

require_once($sourcedir '/Subs-Menu.php');

// Some preferences.
$context['admin_preferences'] = !empty($options['admin_preferences']) ? safe_unserialize($options['admin_preferences']) : array();

// Define all the menu structure - see Subs-Menu.php for details!
$admin_areas = array(
'forum' => array(
'title' => $txt['admin_main'],
'permission' => array('admin_forum''manage_permissions''moderate_forum''manage_membergroups''manage_bans''send_mail''edit_news''manage_boards''manage_smileys''manage_attachments'),
'areas' => array(
'index' => array(
'label' => $txt['admin_center'],
'function' => 'AdminHome',
'icon' => 'administration.gif',
),
'credits' => array(
'label' => $txt['support_credits_title'],
'function' => 'AdminHome',
'icon' => 'support.gif',
),
'news' => array(
'label' => $txt['news_title'],
'file' => 'ManageNews.php',
'function' => 'ManageNews',
'icon' => 'news.gif',
'permission' => array('edit_news''send_mail''admin_forum'),
'subsections' => array(
'editnews' => array($txt['admin_edit_news'], 'edit_news'),
'mailingmembers' => array($txt['admin_newsletters'], 'send_mail'),
'settings' => array($txt['settings'], 'admin_forum'),
),
),
'packages' => array(
'label' => $txt['package'],
'file' => 'Packages.php',
'function' => 'Packages',
'permission' => array('admin_forum'),
'icon' => 'packages.gif',
'subsections' => array(
'browse' => array($txt['browse_packages']),
'packageget' => array($txt['download_packages'], 'url' => $scripturl '?action=admin;area=packages;sa=packageget;get'),
'installed' => array($txt['installed_packages']),
'perms' => array($txt['package_file_perms']),
'options' => array($txt['package_settings']),
),
),
'search' => array(
'function' => 'AdminSearch',
'permission' => array('admin_forum'),
'select' => 'index'
),
),
),
'config' => array(
'title' => $txt['admin_config'],
'permission' => array('admin_forum'),
'areas' => array(
'corefeatures' => array(
'label' => $txt['core_settings_title'],
'file' => 'ManageSettings.php',
'function' => 'ModifyCoreFeatures',
'icon' => 'corefeatures.gif',
),
'featuresettings' => array(
'label' => $txt['modSettings_title'],
'file' => 'ManageSettings.php',
'function' => 'ModifyFeatureSettings',
'icon' => 'features.gif',
'subsections' => array(
'basic' => array($txt['mods_cat_features']),
'layout' => array($txt['mods_cat_layout']),
'karma' => array($txt['karma'], 'enabled' => in_array('k'$context['admin_features'])),
'sig' => array($txt['signature_settings_short']),
'action' => array($txt['custom_action_shorttitle'], 'admin_forum'),
'profile' => array($txt['custom_profile_shorttitle'], 'enabled' => in_array('cp'$context['admin_features'])),
),
),
'securitysettings' => array(
'label' => $txt['admin_security_moderation'],
'file' => 'ManageSettings.php',
'function' => 'ModifySecuritySettings',
'icon' => 'security.gif',
'subsections' => array(
'general' => array($txt['mods_cat_security_general']),
'spam' => array($txt['antispam_title']),
'moderation' => array($txt['moderation_settings_short'], 'enabled' => substr($modSettings['warning_settings'], 01) == 1),
),
),
'languages' => array(
'label' => $txt['language_configuration'],
'file' => 'ManageServer.php',
'function' => 'ManageLanguages',
'icon' => 'languages.gif',
'subsections' => array(
'edit' => array($txt['language_edit']),
'add' => array($txt['language_add']),
'settings' => array($txt['language_settings']),
),
),
'serversettings' => array(
'label' => $txt['admin_server_settings'],
'file' => 'ManageServer.php',
'function' => 'ModifySettings',
'icon' => 'server.gif',
'subsections' => array(
'general' => array($txt['general_settings']),
'database' => array($txt['database_paths_settings']),
'cookie' => array($txt['cookies_sessions_settings']),
'cache' => array($txt['caching_settings']),
'loads' => array($txt['load_balancing_settings']),
),
),
'current_theme' => array(
'label' => $txt['theme_current_settings'],
'file' => 'Themes.php',
'function' => 'ThemesMain',
'custom_url' => $scripturl '?action=admin;area=theme;sa=settings;th=' $settings['theme_id'],
'icon' => 'current_theme.gif',
),
'theme' => array(
'label' => $txt['theme_admin'],
'file' => 'Themes.php',
'function' => 'ThemesMain',
'custom_url' => $scripturl '?action=admin;area=theme;sa=admin',
'icon' => 'themes.gif',
'subsections' => array(
'admin' => array($txt['themeadmin_admin_title']),
'list' => array($txt['themeadmin_list_title']),
'reset' => array($txt['themeadmin_reset_title']),
'edit' => array($txt['themeadmin_edit_title']),
),
),
'treasury' => array(
'label' => $txt['treasury_admin'],
'file' => 'TreasuryAdmin.php',
'function' => 'treasuryAdmin',
'permission' => 'admin_treasury',
'icon' => 'treasury.gif',
'subsections' => array(
'readme' => array($txt['treas_read_me']),
'registry' => array($txt['treas_fin_register']),
'donations' => array($txt['treas_donations']),
'donortotals' => array($txt['treas_donor_totals']),
'config' => array($txt['treas_main_config']),
'configpaypal' => array($txt['treas_paypal_config']),
'configblock' => array($txt['treas_block_config']),
'configevents' => array($txt['treas_events']),
'translog' => array($txt['treas_transaction_log']),
),
), 'modsettings' => array(
'label' => $txt['admin_modifications'],
'file' => 'ManageSettings.php',
'function' => 'ModifyModSettings',
'icon' => 'modifications.gif',
'subsections' => array(
'general' => array($txt['mods_cat_modifications_misc']),
'mentions' => array($txt['mentions']),
// 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.
),
),
),
),

'downloads' => array(
'title' => $txt['downloads_admin'],
'permission' => array('downloads_manage'),
'areas' => array(
'downloads' => array(
'label' => $txt['downloads_admin'],
'file' => 'Downloads2.php',
'function' => 'DownloadsMain',
'custom_url' => $scripturl '?action=admin;area=downloads;sa=adminset;sesc=' $sc,
'icon' => 'server.gif',
'subsections' => array(
'adminset' => array($txt['downloads_text_settings']),
'approvelist' => array($txt['downloads_form_approvedownloads']),
'reportlist' => array($txt['downloads_form_reportdownloads']),
'commentlist' => array($txt['downloads_form_approvecomments']),
'filespace' => array($txt['downloads_filespace']),
'catpermlist' => array($txt['downloads_text_catpermlist2']),
'import' => array($txt['downloads_txt_import']),
),
),),
),


'badgeawards' => array(
'title' => $txt['badge_admin'],
'permission' => array('admin_forum'),
'areas' => array(
'badgeawards' => array(
'label' => $txt['badge_admin'],
'file' => 'badgeawards2.php',
'function' => 'BadgeAwardsMain',
'custom_url' => $scripturl '?action=admin;area=badgeawards;sa=settings;sesc=' $sc,
'icon' => 'server.gif',
'permission' => array('admin_forum'),
'subsections' => array(
'settings' => array($txt['badge_settings']),
'badgelist' => array($txt['badge_badgelist']),
'givebadge' => array($txt['badge_givebadge']),
'badgehistory' => array($txt['badge_memberbadgehistory']),
'rebuildhistory' => array($txt['badge_rebagemembers']),


),
),

),
),

'layout' => array(
'title' => $txt['layout_controls'],



'permission' => array('manage_boards''admin_forum''manage_smileys''manage_attachments''moderate_forum'),
'areas' => array(
'manageboards' => array(
'label' => $txt['admin_boards'],
'file' => 'ManageBoards.php',
'function' => 'ManageBoards',
'icon' => 'boards.gif',
'permission' => array('manage_boards'),
'subsections' => array(
'main' => array($txt['boardsEdit']),
'newcat' => array($txt['mboards_new_cat']),
'settings' => array($txt['settings'], 'admin_forum'),
),
),
'postsettings' => array(
'label' => $txt['manageposts'],
'file' => 'ManagePosts.php',
'function' => 'ManagePostSettings',
'permission' => array('admin_forum'),
'icon' => 'posts.gif',
'subsections' => array(
'posts' => array($txt['manageposts_settings']),
'bbc' => array($txt['manageposts_bbc_settings']),
'censor' => array($txt['admin_censored_words']),
'topics' => array($txt['manageposts_topic_settings']),
),
),
'managecalendar' => array(
'label' => $txt['manage_calendar'],
'file' => 'ManageCalendar.php',
'function' => 'ManageCalendar',
'icon' => 'calendar.gif',
'permission' => array('admin_forum'),
'enabled' => in_array('cd'$context['admin_features']),
'subsections' => array(
'holidays' => array($txt['manage_holidays'], 'admin_forum''enabled' => !empty($modSettings['cal_enabled'])),
'settings' => array($txt['calendar_settings'], 'admin_forum'),
),
),
'managesearch' => array(
'label' => $txt['manage_search'],
'file' => 'ManageSearch.php',
'function' => 'ManageSearch',
'icon' => 'search.gif',
'permission' => array('admin_forum'),
'subsections' => array(
'weights' => array($txt['search_weights']),
'method' => array($txt['search_method']),
'settings' => array($txt['settings']),
),
),
'smileys' => array(
'label' => $txt['smileys_manage'],
'file' => 'ManageSmileys.php',
'function' => 'ManageSmileys',
'icon' => 'smiley.gif',
'permission' => array('manage_smileys'),
'subsections' => array(
'editsets' => array($txt['smiley_sets']),
'addsmiley' => array($txt['smileys_add'], 'enabled' => !empty($modSettings['smiley_enable'])),
'editsmileys' => array($txt['smileys_edit'], 'enabled' => !empty($modSettings['smiley_enable'])),
'setorder' => array($txt['smileys_set_order'], 'enabled' => !empty($modSettings['smiley_enable'])),
'editicons' => array($txt['icons_edit_message_icons'], 'enabled' => !empty($modSettings['messageIcons_enable'])),
'settings' => array($txt['settings']),
),
),
'manageattachments' => array(
'label' => $txt['attachments_avatars'],
'file' => 'ManageAttachments.php',
'function' => 'ManageAttachments',
'icon' => 'attachment.gif',
'permission' => array('manage_attachments'),
'subsections' => array(
'browse' => array($txt['attachment_manager_browse']),
'attachments' => array($txt['attachment_manager_settings']),
'avatars' => array($txt['attachment_manager_avatar_settings']),
'maintenance' => array($txt['attachment_manager_maintenance']),
),
),
),
),
'members' => array(
'title' => $txt['admin_manage_members'],
'permission' => array('moderate_forum''manage_membergroups''manage_bans''manage_permissions''admin_forum'),
'areas' => array(
'viewmembers' => array(
'label' => $txt['admin_users'],
'file' => 'ManageMembers.php',
'function' => 'ViewMembers',
'icon' => 'members.gif',
'permission' => array('moderate_forum'),
'subsections' => array(
'all' => array($txt['view_all_members']),
'search' => array($txt['mlist_search']),
),
),
'membergroups' => array(
'label' => $txt['admin_groups'],
'file' => 'ManageMembergroups.php',
'function' => 'ModifyMembergroups',
'icon' => 'membergroups.gif',
'permission' => array('manage_membergroups'),
'subsections' => array(
'index' => array($txt['membergroups_edit_groups'], 'manage_membergroups'),
'add' => array($txt['membergroups_new_group'], 'manage_membergroups'),
'settings' => array($txt['settings'], 'admin_forum'),
),
),
'permissions' => array(
'label' => $txt['edit_permissions'],
'file' => 'ManagePermissions.php',
'function' => 'ModifyPermissions',
'icon' => 'permissions.gif',
'permission' => array('manage_permissions'),
'subsections' => array(
'index' => array($txt['permissions_groups'], 'manage_permissions'),
'board' => array($txt['permissions_boards'], 'manage_permissions'),
'profiles' => array($txt['permissions_profiles'], 'manage_permissions'),
'postmod' => array($txt['permissions_post_moderation'], 'manage_permissions''enabled' => $modSettings['postmod_active']),
'settings' => array($txt['settings'], 'admin_forum'),
),
),
'regcenter' => array(
'label' => $txt['registration_center'],
'file' => 'ManageRegistration.php',
'function' => 'RegCenter',
'icon' => 'regcenter.gif',
'permission' => array('admin_forum''moderate_forum'),
'subsections' => array(
'register' => array($txt['admin_browse_register_new'], 'moderate_forum'),
'agreement' => array($txt['registration_agreement'], 'admin_forum'),
'policy' => array($txt['privacy_policy'], 'admin_forum'),
'reservednames' => array($txt['admin_reserved_set'], 'admin_forum'),
'settings' => array($txt['settings'], 'admin_forum'),
),
),
'ban' => array(
'label' => $txt['ban_title'],
'file' => 'ManageBans.php',
'function' => 'Ban',
'icon' => 'ban.gif',
'permission' => 'manage_bans',
'subsections' => array(
'list' => array($txt['ban_edit_list']),
'add' => array($txt['ban_add_new']),
'browse' => array($txt['ban_trigger_browse']),
'log' => array($txt['ban_log']),
),
),
'paidsubscribe' => array(
'label' => $txt['paid_subscriptions'],
'enabled' => in_array('ps'$context['admin_features']),
'file' => 'ManagePaid.php',
'icon' => 'paid.gif',
'function' => 'ManagePaidSubscriptions',
'permission' => 'admin_forum',
'subsections' => array(
'view' => array($txt['paid_subs_view']),
'settings' => array($txt['settings']),
),
),
'sengines' => array(
'label' => $txt['search_engines'],
'enabled' => in_array('sp'$context['admin_features']),
'file' => 'ManageSearchEngines.php',
'icon' => 'engines.gif',
'function' => 'SearchEngines',
'permission' => 'admin_forum',
'subsections' => array(
'stats' => array($txt['spider_stats']),
'logs' => array($txt['spider_logs']),
'spiders' => array($txt['spiders']),
'settings' => array($txt['settings']),
),
),
),
),
'maintenance' => array(
'title' => $txt['admin_maintenance'],
'permission' => array('admin_forum'),
'areas' => array(
'maintain' => array(
'label' => $txt['maintain_title'],
'file' => 'ManageMaintenance.php',
'icon' => 'maintain.gif',
'function' => 'ManageMaintenance',
'subsections' => array(
'routine' => array($txt['maintain_sub_routine'], 'admin_forum'),
'database' => array($txt['maintain_sub_database'], 'admin_forum'),
'members' => array($txt['maintain_sub_members'], 'admin_forum'),
'topics' => array($txt['maintain_sub_topics'], 'admin_forum'),
),
),
'scheduledtasks' => array(
'label' => $txt['maintain_tasks'],
'file' => 'ManageScheduledTasks.php',
'icon' => 'scheduled.gif',
'function' => 'ManageScheduledTasks',
'subsections' => array(
'tasks' => array($txt['maintain_tasks'], 'admin_forum'),
'tasklog' => array($txt['scheduled_log'], 'admin_forum'),
),
),
'mailqueue' => array(
'label' => $txt['mailqueue_title'],
'file' => 'ManageMail.php',
'function' => 'ManageMail',
'icon' => 'mail.gif',
'subsections' => array(
'browse' => array($txt['mailqueue_browse'], 'admin_forum'),
'settings' => array($txt['mailqueue_settings'], 'admin_forum'),
),
),
'reports' => array(
'enabled' => in_array('rg'$context['admin_features']),
'label' => $txt['generate_reports'],
'file' => 'Reports.php',
'function' => 'ReportsMain',
'icon' => 'reports.gif',
),
'logs' => array(
'label' => $txt['logs'],
'function' => 'AdminLogs',
'icon' => 'logs.gif',
'subsections' => array(
'errorlog' => array($txt['errlog'], 'admin_forum''enabled' => !empty($modSettings['enableErrorLogging']), 'url' => $scripturl '?action=admin;area=logs;sa=errorlog;desc'),
'adminlog' => array($txt['admin_log'], 'admin_forum''enabled' => in_array('ml'$context['admin_features'])),
'modlog' => array($txt['moderation_log'], 'admin_forum''enabled' => in_array('ml'$context['admin_features'])),
'banlog' => array($txt['ban_log'], 'manage_bans'),
'spiderlog' => array($txt['spider_logs'], 'admin_forum''enabled' => in_array('sp'$context['admin_features'])),
'tasklog' => array($txt['scheduled_log'], 'admin_forum'),
'pruning' => array($txt['pruning_title'], 'admin_forum'),
'karma' => array($txt['karma_log'], 'admin_forum'),
),
),
'repairboards' => array(
'label' => $txt['admin_repair'],
'file' => 'RepairBoards.php',
'function' => 'RepairBoards',
'select' => 'maintain',
'hidden' => true,
),
),
),
);

// Any files to include for administration?
if (!empty($modSettings['integrate_admin_include']))
{
$admin_includes explode(','$modSettings['integrate_admin_include']);
foreach ($admin_includes as $include)
{
$include strtr(trim($include), array('$boarddir' => $boarddir'$sourcedir' => $sourcedir'$themedir' => $settings['theme_dir']));
if (file_exists($include))
require_once($include);
}
}

// Let them modify admin areas easily.
call_integration_hook('integrate_admin_areas', array(&$admin_areas));

// Make sure the administrator has a valid session...
validateSession();

// Actually create the menu!
$admin_include_data createMenu($admin_areas);
unset($admin_areas);

// Nothing valid?
if ($admin_include_data == false)
fatal_lang_error('no_access'false);

// Build the link tree.
$context['linktree'][] = array(
'url' => $scripturl '?action=admin',
'name' => $txt['admin_center'],
);
if (isset($admin_include_data['current_area']) && $admin_include_data['current_area'] != 'index')
$context['linktree'][] = array(
'url' => $scripturl '?action=admin;area=' $admin_include_data['current_area'] . ';' $context['session_var'] . '=' $context['session_id'],
'name' => $admin_include_data['label'],
);
if (!empty($admin_include_data['current_subsection']) && $admin_include_data['subsections'][$admin_include_data['current_subsection']][0] != $admin_include_data['label'])
$context['linktree'][] = array(
'url' => $scripturl '?action=admin;area=' $admin_include_data['current_area'] . ';sa=' $admin_include_data['current_subsection'] . ';' $context['session_var'] . '=' $context['session_id'],
'name' => $admin_include_data['subsections'][$admin_include_data['current_subsection']][0],
);

// Make a note of the Unique ID for this menu.
$context['admin_menu_id'] = $context['max_menu_id'];
$context['admin_menu_name'] = 'menu_data_' $context['admin_menu_id'];

// Why on the admin are we?
$context['admin_area'] = $admin_include_data['current_area'];

// Now - finally - call the right place!
if (isset($admin_include_data['file']))
require_once($sourcedir '/' $admin_include_data['file']);

$admin_include_data['function']();
}

// The main administration section.
function AdminHome()
{
global $sourcedir$forum_version$txt$scripturl$context$user_info$boardurl$modSettings$smcFunc;

// You have to be able to do at least one of the below to see this page.
isAllowedTo(array('admin_forum''manage_permissions''moderate_forum''manage_membergroups''manage_bans''send_mail''edit_news''manage_boards''manage_smileys''manage_attachments'));

// Find all of this forum's administrators...
require_once($sourcedir '/Subs-Membergroups.php');
if (listMembergroupMembers_Href($context['administrators'], 132) && allowedTo('manage_membergroups'))
{
// Add a 'more'-link if there are more than 32.
$context['more_admins_link'] = '<a href="' $scripturl '?action=moderate;area=viewgroups;sa=members;group=1">' $txt['more'] . '</a>';
}

// Load the credits stuff.
require_once($sourcedir '/Who.php');
Credits(true);

// This makes it easier to get the latest news with your time format.
$context['time_format'] = urlencode($user_info['time_format']);

$context['current_versions'] = array(
'php' => array('title' => $txt['support_versions_php'], 'version' => PHP_VERSION),
'db' => array('title' => sprintf($txt['support_versions_db'], $smcFunc['db_title']), 'version' => ''),
'server' => array('title' => $txt['support_versions_server'], 'version' => $_SERVER['SERVER_SOFTWARE']),
);
$context['forum_version'] = $forum_version;

// Get a list of current server versions.
require_once($sourcedir '/Subs-Admin.php');
$checkFor = array(
'gd',
'db_server',
'mmcache',
'eaccelerator',
'phpa',
'apc',
'memcache',
'xcache',
'php',
'server',
);
$context['current_versions'] = getServerVersions($checkFor);

$context['can_admin'] = allowedTo('admin_forum');

$context['sub_template'] = $context['admin_area'] == 'credits' 'credits' 'admin';
$context['page_title'] = $context['admin_area'] == 'credits' $txt['support_credits_title'] : $txt['admin_center'];

// The format of this array is: permission, action, title, description, icon.
$quick_admin_tasks = array(
array('''credits''support_credits_title''support_credits_info''support_and_credits.png'),
array('admin_forum''featuresettings''modSettings_title''modSettings_info''features_and_options.png'),
array('admin_forum''maintain''maintain_title''maintain_info''forum_maintenance.png'),
array('manage_permissions''permissions''edit_permissions''edit_permissions_info''permissions.png'),
array('admin_forum''theme;sa=admin;' $context['session_var'] . '=' $context['session_id'], 'theme_admin''theme_admin_info''themes_and_layout.png'),
array('admin_forum''packages''package''package_info''packages.png'),
array('manage_smileys''smileys''smileys_manage''smileys_manage_info''smilies_and_messageicons.png'),
array('moderate_forum''viewmembers''admin_users''member_center_info''members.png'),
);

$context['quick_admin_tasks'] = array();
foreach ($quick_admin_tasks as $task)
{
if (!empty($task[0]) && !allowedTo($task[0]))
continue;

$context['quick_admin_tasks'][] = array(
'href' => $scripturl '?action=admin;area=' $task[1],
'link' => '<a href="' $scripturl '?action=admin;area=' $task[1] . '">' $txt[$task[2]] . '</a>',
'title' => $txt[$task[2]],
'description' => $txt[$task[3]],
'icon' => $task[4],
'is_last' => false
);
}

if (count($context['quick_admin_tasks']) % == 1)
{
$context['quick_admin_tasks'][] = array(
'href' => '',
'link' => '',
'title' => '',
'description' => '',
'is_last' => true
);
$context['quick_admin_tasks'][count($context['quick_admin_tasks']) - 2]['is_last'] = true;
}
elseif (count($context['quick_admin_tasks']) != 0)
{
$context['quick_admin_tasks'][count($context['quick_admin_tasks']) - 1]['is_last'] = true;
$context['quick_admin_tasks'][count($context['quick_admin_tasks']) - 2]['is_last'] = true;
}

// Lastly, fill in the blanks in the support resources paragraphs.
$txt['support_resources_p1'] = sprintf($txt['support_resources_p1'],
'https://wiki.simplemachines.org/',
'https://wiki.simplemachines.org/smf/features2',
'https://wiki.simplemachines.org/smf/options2',
'https://wiki.simplemachines.org/smf/themes2',
'https://wiki.simplemachines.org/smf/packages2'
);
$txt['support_resources_p2'] = sprintf($txt['support_resources_p2'],
'https://www.simplemachines.org/community/',
'https://www.simplemachines.org/redirect/english_support',
'https://www.simplemachines.org/redirect/international_support_boards',
'https://www.simplemachines.org/redirect/smf_support',
'https://www.simplemachines.org/redirect/customize_support'
);
}

// Get one of the admin information files from Simple Machines.
function DisplayAdminFile()
{
global $context$modSettings$smcFunc;

@ini_set('memory_limit''32M');

if (empty($_REQUEST['filename']) || !is_string($_REQUEST['filename']))
fatal_lang_error('no_access'false);

$request $smcFunc['db_query']('''
SELECT data, filetype
FROM {db_prefix}admin_info_files
WHERE filename = {string:current_filename}
LIMIT 1'
,
array(
'current_filename' => $_REQUEST['filename'],
)
);

if ($smcFunc['db_num_rows']($request) == 0)
fatal_lang_error('admin_file_not_found'true, array($_REQUEST['filename']));

list ($file_data$filetype) = $smcFunc['db_fetch_row']($request);
$smcFunc['db_free_result']($request);

// !!! Temp.
// Figure out if sesc is still being used.
if (strpos($file_data';sesc=') !== false)
$file_data '
if (!(\'smfForum_sessionvar\' in window))
window.smfForum_sessionvar = \'sesc\';
strtr($file_data, array(';sesc=' => ';\' + window.smfForum_sessionvar + \'='));

$context['template_layers'] = array();
// Lets make sure we aren't going to output anything nasty.
@ob_end_clean();
if (!empty($modSettings['enableCompressedOutput']))
@ob_start('ob_gzhandler');
else
@ob_start();

// Make sure they know what type of file we are.
header('Content-Type: ' $filetype);
echo $file_data;
obExit(false);
}

// This allocates out all the search stuff.
function AdminSearch()
{
global $txt$context$smcFunc$sourcedir;

isAllowedTo('admin_forum');

// What can we search for?
$subactions = array(
'internal' => 'AdminSearchInternal',
'online' => 'AdminSearchOM',
'member' => 'AdminSearchMember',
);

$context['search_type'] = !isset($_REQUEST['search_type']) || !isset($subactions[$_REQUEST['search_type']]) ? 'internal' $_REQUEST['search_type'];
$context['search_term'] = isset($_REQUEST['search_term']) ? $smcFunc['htmlspecialchars']($_REQUEST['search_term'], ENT_QUOTES) : '';

$context['sub_template'] = 'admin_search_results';
$context['page_title'] = $txt['admin_search_results'];

// Keep track of what the admin wants.
if (empty($context['admin_preferences']['sb']) || $context['admin_preferences']['sb'] != $context['search_type'])
{
$context['admin_preferences']['sb'] = $context['search_type'];

// Update the preferences.
require_once($sourcedir '/Subs-Admin.php');
updateAdminPreferences();
}

if (trim($context['search_term']) == '')
$context['search_results'] = array();
else
$subactions[$context['search_type']]();
}

// A complicated but relatively quick internal search.
function AdminSearchInternal()
{
global $context$txt$helptxt$scripturl$sourcedir;

// Try to get some more memory.
@ini_set('memory_limit''128M');

// Load a lot of language files.
$language_files = array(
'ArcadeAdmin'
'Help''ManageMail''ManageSettings''ManageCalendar''ManageBoards''ManagePaid''ManagePermissions''Search',
'Login''ManageSmileys''Install',
);
loadLanguage(implode('+'$language_files));

// All the files we need to include.
$include_files = array(
'ArcadeAdmin'
'ManageSettings''ManageBoards''ManageNews''ManageAttachments''ManageCalendar''ManageMail''ManagePaid''ManagePermissions',
'ManagePosts''ManageRegistration''ManageSearch''ManageSearchEngines''ManageServer''ManageSmileys',
);
foreach ($include_files as $file)
require_once($sourcedir '/' $file '.php');

/* This is the huge array that defines everything... it's a huge array of items formatted as follows:
0 = Language index (Can be array of indexes) to search through for this setting.
1 = URL for this indexes page.
2 = Help index for help associated with this item (If different from 0)
*/

$search_data = array(
// All the major sections of the forum.
'sections' => array(
),
'settings' => array(
array('COPPA''area=regcenter;sa=settings'),
array('CAPTCHA''area=securitysettings;sa=spam'),
),
);

// Go through the admin menu structure trying to find suitably named areas!
foreach ($context[$context['admin_menu_name']]['sections'] as $section)
{
foreach ($section['areas'] as $menu_key => $menu_item)
{
$search_data['sections'][] = array($menu_item['label'], 'area=' $menu_key);
if (!empty($menu_item['subsections']))
foreach ($menu_item['subsections'] as $key => $sublabel)
{
if (isset($sublabel['label']))
$search_data['sections'][] = array($sublabel['label'], 'area=' $menu_key ';sa=' $key);
}
}
}

// This is a special array of functions that contain setting data - we query all these to simply pull all setting bits!
$settings_search = array(
array('ModifyCoreFeatures''area=corefeatures'),
array('ModifyBasicSettings''area=featuresettings;sa=basic'),
array('ModifyLayoutSettings''area=featuresettings;sa=layout'),
array('ModifyKarmaSettings''area=featuresettings;sa=karma'),
array('ModifySignatureSettings''area=featuresettings;sa=sig'),
array('ModifyGeneralSecuritySettings''area=securitysettings;sa=general'),
array('ModifySpamSettings''area=securitysettings;sa=spam'),
array('ModifyModerationSettings''area=securitysettings;sa=moderation'),
array('ModifyGeneralModSettings''area=modsettings;sa=general'),
// Mod authors if you want to be "real freaking good" then add any setting pages for your mod BELOW this line!
array('ManageAttachmentSettings''area=manageattachments;sa=attachments'),
array('ManageAvatarSettings''area=manageattachments;sa=avatars'),
array('ModifyCalendarSettings''area=managecalendar;sa=settings'),
array('EditBoardSettings''area=manageboards;sa=settings'),
array('ModifyMailSettings''area=mailqueue;sa=settings'),
array('ModifyNewsSettings''area=news;sa=settings'),
array('GeneralPermissionSettings''area=permissions;sa=settings'),
array('ModifyPostSettings''area=postsettings;sa=posts'),
array('ModifyBBCSettings''area=postsettings;sa=bbc'),
array('ModifyTopicSettings''area=postsettings;sa=topics'),
array('EditSearchSettings''area=managesearch;sa=settings'),
array('EditSmileySettings''area=smileys;sa=settings'),
array('ModifyGeneralSettings''area=serversettings;sa=general'),
array('ModifyDatabaseSettings''area=serversettings;sa=database'),
array('ModifyCookieSettings''area=serversettings;sa=cookie'),
array('ModifyCacheSettings''area=serversettings;sa=cache'), array('ArcadeAdminSettings''area=arcade;sa=settings'),
array('ArcadeAdminPermission''area=arcade;sa=permission'),
array('ModifyLanguageSettings''area=languages;sa=settings'),
array('ModifyRegistrationSettings''area=regcenter;sa=settings'),
array('ManageSearchEngineSettings''area=sengines;sa=settings'),
array('ModifySubscriptionSettings''area=paidsubscribe;sa=settings'),
array('ModifyPruningSettings''area=logs;sa=pruning'),
);

foreach ($settings_search as $setting_area)
{
// Get a list of their variables.
$config_vars $setting_area[0](true);

foreach ($config_vars as $var)
if (!empty($var[1]) && !in_array($var[0], array('permissions''switch')))
$search_data['settings'][] = array($var[(isset($var[2]) && in_array($var[2], array('file''db'))) ? 1], $setting_area[1], 'alttxt' => (isset($var[2]) && in_array($var[2], array('file''db'))) || isset($var[3]) ? (in_array($var[2], array('file''db')) ? $var[1] : $var[3]) : '');
}

$context['page_title'] = $txt['admin_search_results'];
$context['search_results'] = array();

$search_term strtolower($context['search_term']);
// Go through all the search data trying to find this text!
foreach ($search_data as $section => $data)
{
foreach ($data as $item)
{
$found false;
if (!is_array($item[0]))
$item[0] = array($item[0]);
foreach ($item[0] as $term)
{
$lc_term strtolower($term);
if (strpos($lc_term$search_term) !== false || (isset($txt[$term]) && strpos(strtolower($txt[$term]), $search_term) !== false) || (isset($txt['setting_' $term]) && strpos(strtolower($txt['setting_' $term]), $search_term) !== false))
{
$found $term;
break;
}
}

if ($found)
{
// Format the name - and remove any descriptions the entry may have.
$name = isset($txt[$found]) ? $txt[$found] : (isset($txt['setting_' $found]) ? $txt['setting_' $found] : (!empty($item['alttxt']) ? $item['alttxt'] : $found));
$name preg_replace('~<(?:div|span)\sclass="smalltext">.+?</(?:div|span)>~'''$name);

$context['search_results'][] = array(
'url' => (substr($item[1], 04) == 'area' $scripturl '?action=admin;' $item[1] : $item[1]) . ';' $context['session_var'] . '=' $context['session_id'] . ((substr($item[1], 04) == 'area' && $section == 'settings' '#' $item[0][0] : '')),
'name' => $name,
'type' => $section,
'help' => shorten_subject(isset($item[2]) ? strip_tags($helptxt[$item[2]]) : (isset($helptxt[$found]) ? strip_tags($helptxt[$found]) : ''), 255),
);
}
}
}
}

// All this does is pass through to manage members.
function AdminSearchMember()
{
global $context$sourcedir;

require_once($sourcedir '/ManageMembers.php');
$_REQUEST['sa'] = 'query';

$_POST['membername'] = $context['search_term'];

ViewMembers();
}

// This file allows the user to search the SM online manual for a little of help.
function AdminSearchOM()
{
global $context$sourcedir;

$docsURL 'docs.simplemachines.org';
$context['doc_scripturl'] = 'http://docs.simplemachines.org/index.php';

// Set all the parameters search might expect.
$postVars = array(
'search' => $context['search_term'],
);

// Encode the search data.
foreach ($postVars as $k => $v)
$postVars[$k] = urlencode($k) . '=' urlencode($v);

// This is what we will send.
$postVars implode('&'$postVars);

// Get the results from the doc site.
require_once($sourcedir '/Subs-Package.php');
$search_results fetch_web_data($context['doc_scripturl'] . '?action=search2&xml'$postVars);

// If we didn't get any xml back we are in trouble - perhaps the doc site is overloaded?
if (!$search_results || preg_match('~<' '\?xml\sversion="\d+\.\d+"\sencoding=".+?"\?' '>\s*(<smf>.+?</smf>)~is'$search_results$matches) != true)
fatal_lang_error('cannot_connect_doc_site');

$search_results $matches[1];

// Otherwise we simply walk through the XML and stick it in context for display.
$context['search_results'] = array();
loadClassFile('Class-Package.php');

// Get the results loaded into an array for processing!
$results = new xmlArray($search_resultsfalse);

// Move through the smf layer.
if (!$results->exists('smf'))
fatal_lang_error('cannot_connect_doc_site');
$results $results->path('smf[0]');

// Are there actually some results?
if (!$results->exists('noresults') && !$results->exists('results'))
fatal_lang_error('cannot_connect_doc_site');
elseif ($results->exists('results'))
{
foreach ($results->set('results/result') as $result)
{
if (!$result->exists('messages'))
continue;

$context['search_results'][$result->fetch('id')] = array(
'topic_id' => $result->fetch('id'),
'relevance' => $result->fetch('relevance'),
'board' => array(
'id' => $result->fetch('board/id'),
'name' => $result->fetch('board/name'),
'href' => $result->fetch('board/href'),
),
'category' => array(
'id' => $result->fetch('category/id'),
'name' => $result->fetch('category/name'),
'href' => $result->fetch('category/href'),
),
'messages' => array(),
);

// Add the messages.
foreach ($result->set('messages/message') as $message)
$context['search_results'][$result->fetch('id')]['messages'][] = array(
'id' => $message->fetch('id'),
'subject' => $message->fetch('subject'),
'body' => $message->fetch('body'),
'time' => $message->fetch('time'),
'timestamp' => $message->fetch('timestamp'),
'start' => $message->fetch('start'),
'author' => array(
'id' => $message->fetch('author/id'),
'name' => $message->fetch('author/name'),
'href' => $message->fetch('author/href'),
),
);
}
}
}

// This function decides which log to load.
function AdminLogs()
{
global $sourcedir$context$txt$scripturl;

// These are the logs they can load.
$log_functions = array(
'errorlog' => array('ManageErrors.php''ViewErrorLog'),
'adminlog' => array('Modlog.php''ViewModlog'),
'modlog' => array('Modlog.php''ViewModlog'),
'banlog' => array('ManageBans.php''BanLog'),
'spiderlog' => array('ManageSearchEngines.php''SpiderLogs'),
'tasklog' => array('ManageScheduledTasks.php''TaskLog'),
'pruning' => array('ManageSettings.php''ModifyPruningSettings'),
'karma' => array('Karma.php''LogKarmaActs'),
);

$sub_action = isset($_REQUEST['sa']) && isset($log_functions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'errorlog';
// If it's not got a sa set it must have come here for first time, pretend error log should be reversed.
if (!isset($_REQUEST['sa']))
$_REQUEST['desc'] = true;

// Setup some tab stuff.
$context[$context['admin_menu_name']]['tab_data'] = array(
'title' => $txt['logs'],
'help' => '',
'description' => $txt['maintain_info'],
'tabs' => array(
'errorlog' => array(
'url' => $scripturl '?action=admin;area=logs;sa=errorlog;desc',
'description' => sprintf($txt['errlog_desc'], $txt['remove']),
),
'adminlog' => array(
'description' => $txt['admin_log_desc'],
),
'modlog' => array(
'description' => $txt['moderation_log_desc'],
),
'banlog' => array(
'description' => $txt['ban_log_description'],
),
'spiderlog' => array(
'description' => $txt['spider_log_desc'],
),
'tasklog' => array(
'description' => $txt['scheduled_log_desc'],
),
'pruning' => array(
'description' => $txt['pruning_log_desc'],
),
'karma' => array(
'description' => $txt['karma_log_desc'],
),
),
);

require_once($sourcedir '/' $log_functions[$sub_action][0]);
$log_functions[$sub_action][1]();
}

?>
Title: Re: Custom Form Mod
Post by: live627 on March 13, 2021, 01:34:06 AM
A gift from the robots: a new version of this mod (v1.8.0 (https://github.com/live627/smf-custom-forms/releases/tag/v1.8.0))

Features Bug Fixes Download it from the mod site (https://custom.simplemachines.org/mods/index.php?action=download;mod=1279;id=272959)
Title: Re: Custom Form Mod
Post by: Aleksi "Lex" Kilpinen on March 13, 2021, 03:51:38 AM
Noice, thank the robots for me will ya ;)
Title: Re: Custom Form Mod
Post by: live627 on March 13, 2021, 03:57:24 AM
🤖 —I think they only understand Emoji
Title: Re: Custom Form Mod
Post by: Shades. on March 13, 2021, 09:30:52 AM
Installed the  new version on fresh SMF 2.0.18 with no mods and get this error when uploading thru package manager:
QuotePackage upload failed due to the following error:
"Although the package was downloaded to the server it appears to be empty. Please check the Packages directory, and the "temp" sub-directory are both writable. If you continue to experience this problem you should try extracting the package on your PC and uploading the extracted files into a subdirectory in your Packages directory and try again. For example, if the package was called shout.tar.gz you should:
1) Download the package to your local PC and extract it into files.
2) Using an FTP client create a new directory in your "Packages" folder, in this example you may call it "shout".
3) Upload all the files from the extracted package to this directory.
4) Go back to the package manager browse page and the package will be automatically found by SMF."
Title: Re: Custom Form Mod
Post by: Shades. on March 13, 2021, 06:10:16 PM
Nevermind guess I was half asleep when reading those directions lol! :o
Title: Re: Custom Form Mod
Post by: wylo on March 23, 2021, 03:57:19 AM
Hello, I installed the custom form modification in the forum, but when creating the form, the type part looks blank. How can I fix?

Title: Re: Custom Form Mod
Post by: njtweb on March 24, 2021, 06:24:40 PM
Quote from: live627 on March 13, 2021, 01:34:06 AM
A gift from the robots: a new version of this mod (v1.8.0 (https://github.com/live627/smf-custom-forms/releases/tag/v1.8.0))

Features

       
  • Finally uses integration functions instead of file edits (b76ed2f (https://www.github.com/live627/smf-custom-forms/commit/b76ed2f64c5b387a121fc1ac1c384cf09ce92201))
Bug Fixes

       
  • End usage of the deprecated function create_function() (a764537 (https://www.github.com/live627/smf-custom-forms/commit/a764537daea4e4d254931c2e6f12ce2f337bb57c))
  • Solved PHP fatal error (Redefinition of parameter $nul (5a48748 (https://www.github.com/live627/smf-custom-forms/commit/5a48748746e704a73ed7d974b26f55ab74e86d87))
  • Textual database fields now default to null (183eb35 (https://www.github.com/live627/smf-custom-forms/commit/183eb351bbc8ca33810185afad59755abff3be64))
Download it from the mod site (https://custom.simplemachines.org/mods/index.php?action=download;mod=1279;id=272959)

Is there anything different feature-wise from the original?
Title: Re: Custom Form Mod
Post by: live627 on March 25, 2021, 07:56:06 AM
I was going to say no, but then I noticed that I changed the names of all the field types (some were even missing). This  breaks all old forms. I'm currently working on a fix for this since I'm pretty sure it's a big problem.
Title: Re: Custom Form Mod
Post by: live627 on March 25, 2021, 02:55:31 PM
2.0.0 (https://www.github.com/live627/smf-custom-forms/compare/v1.8.0...v2.0.0) (2021-03-25)

⚠ BREAKING CHANGES Features Bug Fixes Download it from the mod site (https://custom.simplemachines.org/mods/index.php?action=download;mod=1279;id=272959)
Title: Re: Custom Form Mod
Post by: wylo on March 25, 2021, 04:27:24 PM
It does not transfer the entered information to the post. . It gives it as [nobbc][/ nobbc].
Title: Re: Custom Form Mod
Post by: Shades. on April 16, 2021, 07:29:02 PM
Quote from: wylo on March 25, 2021, 04:27:24 PM
It does not transfer the entered information to the post. . It gives it as [nobbc][/ nobbc].

Has anybody checked or verified this? I'm still using the 1.7 version on smf 2.0.18.
Also should I be using 1.8 or 2.0 on smf 2.0.18? I uploaded 2.0.0 but in package manager it still says 1.8.

I'll check it later too when I get time, just curious thanks!
Title: Re: Custom Form Mod
Post by: outragedmetro on June 05, 2021, 11:05:15 PM
Members are trying to fill out application. I have made a test user for a form and I am not able to submit it. I get the following error on any text that has been imputed.
Oops, there were errors!

    The value you chose for Your first & Last name: is invalid.
    The value you chose for Have you ever worked as a moderator of a forum or web based community? if yes please explain below! if not please write N/A. is invalid.
    The value you chose for How often are you on the forums per day? is invalid.


This is on the latest SMF is there a way to fix this? turns out it is caused by making the fields required.
Title: Re: Custom Form Mod PHP version error on install
Post by: BigAlGeorge on June 07, 2021, 11:08:44 PM
This mod requires a minimum of PHP %s in order to function. (You are currently running PHP %s)

SMF 2.0 and PHP version 7.4; tried switching to 7.3 still no different.

BTW mod version 2.0 still shows version 1.8 which was a tad confusing for a newbie like me.

Appreciate any advise re this error.
Title: Re: Custom Form Mod
Post by: BigAlGeorge on June 08, 2021, 08:38:44 PM
What I tried was modifying .htaccess thus:

<FilesMatch "\.(php4|php5|php7|php3|php2|php|phtml)$">
SetHandler application/x-lsphp70
</FilesMatch>


Made no difference the Forms mod still throws up same php error - definitely Im using Version 7.4
Title: Re: Custom Form Mod
Post by: live627 on June 09, 2021, 08:09:48 PM
My error reporting has errors 😂
Title: Re: Custom Form Mod
Post by: live627 on June 09, 2021, 11:15:44 PM
2.0.1 (https://www.github.com/live627/smf-custom-forms/compare/v2.0.0...v2.0.1) (2021-06-10)

Bug Fixes Download it from the mod site (https://custom.simplemachines.org/mods/index.php?action=download;mod=1279;id=273623)
Title: Re: Custom Form Mod
Post by: Sir Osis of Liver on June 09, 2021, 11:23:45 PM
Mod installs without errors on 2.0.18 test forum in php 7.4.  Any idea why BigAlGeorge is having problems?
Title: Re: Custom Form Mod
Post by: BigAlGeorge on June 10, 2021, 12:25:43 AM
Quote from: Sir Osis of Liver on June 09, 2021, 11:23:45 PM
Mod installs without errors on 2.0.18 test forum in php 7.4.  Any idea why BigAlGeorge is having problems?

I think author has sorted it out as I removed the .htaccess code:
<FilesMatch "\.(php4|php5|php7|php3|php2|php|phtml)$">
SetHandler application/x-lsphp70
</FilesMatch>


Which was now causing an issue, and once removed, I could install the forms mod.
Title: Re: Custom Form Mod
Post by: Plus on June 13, 2021, 05:16:29 PM
could you add 2.1 support ?
Title: Re: Custom Form Mod - Help not showing
Post by: BigAlGeorge on June 23, 2021, 02:52:35 AM
SMF 2.0.18

(?) https://alsbrew.com/alsbrew_forum/index.php?action=helpadmin;help=customform_output

See image when (?) clicked its not parsing help text any ideas? Thanks, Al.
Title: Re: Custom Form Mod
Post by: live627 on June 23, 2021, 05:27:33 AM
Thanks for reporting. I'll fix that soon.
Title: Re: Custom Form Mod
Post by: BigAlGeorge on June 23, 2021, 03:50:33 PM
Quote from: live627 on June 23, 2021, 05:27:33 AM
Thanks for reporting. I'll fix that soon.
Anything I can do to help, lets know I checked and some of maybe old lines are missing after install eg
$txt['CustomForm_tabheader'] = 'Custom Forms';

Tried uninstall and reinstall and both appeared to go perfectly well.
Title: Re: Custom Form Mod
Post by: heroclass on July 22, 2021, 08:29:11 PM
To whom it may concern,

I have recently installed the custom forms mod and i am receiving this error



i am using
php 7.4,
2.0.18
2.0.1 custom forms mod



any help would be appreciated
Title: Re: Custom Form Mod
Post by: live627 on July 22, 2021, 09:20:33 PM
Did you fill in the fields?
Title: Re: Custom Form Mod
Post by: heroclass on July 22, 2021, 09:41:51 PM


Yes the fields were filled in - the radio buttons were selected
Title: Re: Custom Form Mod
Post by: heroclass on July 25, 2021, 08:36:50 PM
Just following up
Title: Re: Custom Form Mod
Post by: heroclass on August 03, 2021, 08:07:13 PM
Does anyone know if any update to this has been completed?
Title: Re: Custom Form Mod
Post by: Aleksi "Lex" Kilpinen on August 03, 2021, 11:24:48 PM
Probably doesn't matter, but does that still happen if you switch to the default theme?
Title: Re: Custom Form Mod
Post by: heroclass on August 12, 2021, 10:37:18 PM
Thank you for the reply.

Yes it still happens if we change the theme.

Any thoughts on the matter would be nice.
Title: Re: Custom Form Mod
Post by: Kindred on August 26, 2021, 12:27:31 PM
ok....  just reinstalled the new version on a site.


1- the download from the mod site appears to have the ZIP file problem (my package managers sees the zip as empty. rezipping the contents from Windows makes it work)

2- The instructions indicate: use the "form_template_example()" function within the 'CustomForm.template.php' file,
but there is no such function in any of the files included with the mod.

3- This mod still uses tables.  Can we have it use DIVs and other actual CSS? :)

4- The form, when displayed uses "Custom Form: <form name>" for the heading and "Custom Form" for the page title.
IMO, it should use the Form Name for both....
Title: Re: Custom Form Mod
Post by: Shades. on September 04, 2021, 11:44:31 PM
Getting "403 Forbidden" when I click to download this mod! ???
Title: Re: Custom Form Mod
Post by: Diego Andrés on September 05, 2021, 02:01:14 PM
Try downloading version 2.0.1, instead of 2.0
Title: Re: Custom Form Mod
Post by: Shades. on September 05, 2021, 05:01:40 PM
Ok that worked...Ha I was just clicking on download instead of choosing a package lol! :laugh:
Title: Re: Custom Form Mod
Post by: Diego Andrés on September 05, 2021, 07:04:50 PM
Yes although it works but this specific mod is having that issue, is already reported/logged.
Title: Re: Custom Form Mod
Post by: Anish87 on October 14, 2021, 10:32:53 AM
When I use Large Text in a form, and try to read it in Form Output, it just returns blank.
I'm using v2.0.1, SMF Version: 2.0.18, here's how it is:
Here's the screenshots:




And another problem I'm facing is this:
When I use a field in Subject part of the forms mod, it posts the topic with a [nobbc][/nobbc] tag.
Here's the screenshots:



Please help me out :)
Title: Re: Custom Form Mod
Post by: fundamenteel on October 15, 2021, 09:06:30 AM
Quote from: Anish87 on October 14, 2021, 10:32:53 AMWhen I use Large Text in a form, and try to read it in Form Output, it just returns blank.
I'm using v2.0.1, SMF Version: 2.0.18, here's how it is:

And another problem I'm facing is this:
When I use a field in Subject part of the forms mod, it posts the topic with a
[nobbc][/nobbc] tag.

Please help me out :)

Yes i'm getting blanks too in large text fields

For your nobbc question you have to use "parse_bbc" see screenshot



Title: Re: Custom Form Mod
Post by: fundamenteel on October 15, 2021, 09:19:34 AM
Aditional info:

smf  2.0.18 Fresh install
Custom form mod 2.0.1
Theme redsy

Title: Re: Custom Form Mod
Post by: live627 on October 16, 2021, 02:14:22 AM
To fix the large text problem, find in ./Sources/Class-CustomForm.php (https://github.com/live627/smf-custom-forms/blob/1a056571033d1395dbac3d8f508eca1e0bb15e16/src/Class-CustomForm.php#L281)
$this->input_html = '<textarea name="%s[%d]" ' . (!empty($rows) ? 'rows="' . $rows . '"' : '') . ' ' . (!empty($cols) ? 'cols="' . $cols . '"' : '') . '>' . $this->value . '</textarea>';
Replace with
$this->input_html = sprintf(
'<textarea name="%s[%d]" %s%s>%s</textarea>',
'CustomFormField',
$this->field['id_field'],
!empty($rows) ? 'rows="' . $rows . '"' : '',
!empty($cols) ? 'cols="' . $cols . '"' : '',
$this->value
);
Title: Re: Custom Form Mod
Post by: fundamenteel on October 18, 2021, 02:01:56 AM
Thnx! That solved it!!  :)
Title: Re: Custom Form Mod
Post by: fundamenteel on October 18, 2021, 07:53:10 AM
Nevertheless the errors still apear in my errorlog
Title: Re: Custom Form Mod
Post by: Anish87 on October 18, 2021, 02:36:26 PM
Quote from: live627 on October 16, 2021, 02:14:22 AMTo fix the large text problem, find in ./Sources/Class-CustomForm.php (https://github.com/live627/smf-custom-forms/blob/1a056571033d1395dbac3d8f508eca1e0bb15e16/src/Class-CustomForm.php#L281)
$this->input_html = '<textarea name="%s[%d]" ' . (!empty($rows) ? 'rows="' . $rows . '"' : '') . ' ' . (!empty($cols) ? 'cols="' . $cols . '"' : '') . '>' . $this->value . '</textarea>';
Replace with
$this->input_html = sprintf(
'<textarea name="%s[%d]" %s%s>%s</textarea>',
'CustomFormField',
$this->field['id_field'],
!empty($rows) ? 'rows="' . $rows . '"' : '',
!empty($cols) ? 'cols="' . $cols . '"' : '',
$this->value
);
Did what you suggested, but now I see "Oops there were errors" and nothing after that...
Title: Re: Custom Form Mod
Post by: MisterVertigo on November 19, 2021, 08:58:44 PM
Greetings! I recently upgraded my SMF forums from version 2.0.15 to the latest, 2.0.18. I have the 1.7 version of this mod installed, and it's causing me some trouble. Specifically, there are pages in the admin center that will not load. I have tried removing it (keeping the database) and installing the 2.0.3 version. That fixed my issues with the admin center, but my old forms did not work. My guess is that some changes happened to the database between versions.

So, I'm wondering if there id a way to update the mod from version 1.7 to 2.0.3? Even if I have to do it incrementally that is OK, I just don't want to have to rebuild all my forms.

Thank you!
Title: Re: Custom Form Mod
Post by: Shades. on November 19, 2021, 09:12:15 PM
Quote from: MisterVertigo on November 19, 2021, 08:58:44 PMGreetings! I recently upgraded my SMF forums from version 2.0.15 to the latest, 2.0.18. I have the 1.7 version of this mod installed, and it's causing me some trouble. Specifically, there are pages in the admin center that will not load. I have tried removing it (keeping the database) and installing the 2.0.3 version. That fixed my issues with the admin center, but my old forms did not work. My guess is that some changes happened to the database between versions.

So, I'm wondering if there id a way to update the mod from version 1.7 to 2.0.3? Even if I have to do it incrementally that is OK, I just don't want to have to rebuild all my forms.

Thank you!
I am using 1.7 on 2.0.18 as well and here is the fix I used found on another page of this topic...

https://www.simplemachines.org/community/index.php?topic=248871.msg4073887#msg4073887

Back Up your files and database first!

Open Sources>ManageSettings.php

Find:
($nul, $nul, $nul, $id)
Replace with:
($nul, $nul2, $nul3, $id)
Title: Re: Custom Form Mod
Post by: Kindred on November 19, 2021, 10:23:02 PM
It even works in 2.1, with a few tweaks
Title: Re: Custom Form Mod
Post by: Shades. on November 20, 2021, 09:56:34 AM
Quote from: Kindred on November 19, 2021, 10:23:02 PMIt even works in 2.1, with a few tweaks
I haven't been able to get it to work on 2.1 sadly! :'(
(But I'm no coder either lol)
Title: Re: Custom Form Mod
Post by: MisterVertigo on November 20, 2021, 12:57:58 PM
Thank you! I'll give that a shot. After making that modification the 1.7 version will work in 2.1.18? Once working, will it work to then update to the mod version 2.0.3?
Title: Re: Custom Form Mod
Post by: Shades. on November 21, 2021, 02:01:29 PM
Quote from: MisterVertigo on November 20, 2021, 12:57:58 PMThank you! I'll give that a shot. After making that modification the 1.7 version will work in 2.1.18? Once working, will it work to then update to the mod version 2.0.3?
It will work on 2.0.18 but I'm not sure about 2.0.3 version cause I still use 1.7 which works best for me! ;)
Title: Re: Custom Form Mod
Post by: petewadey on January 03, 2022, 11:46:01 AM
I can't get this mod to work after updating to 2.0.19 Has it been tested yet on this version?
Title: Re: Custom Form Mod
Post by: Shades. on January 03, 2022, 03:54:25 PM
Yes I have it working on 2.0.19 also. 8)

https://www.simplemachines.org/community/index.php?topic=248871.msg4103036#msg4103036
Title: Re: Custom Form Mod
Post by: petewadey on January 04, 2022, 11:28:14 AM
On my site which is smf 2.0.18, my custom form works perfectly. When I updated my mirrored test site to 2.0.19, the board that links to my custom form just refreshes the home page, and doesn't go to the form. Any ideas why?
Title: Re: Custom Form Mod
Post by: Kindred on January 04, 2022, 12:40:48 PM
how did you update to 2.0.19?
Title: Re: Custom Form Mod
Post by: petewadey on January 04, 2022, 01:38:42 PM
Through Package Manager. I just clicked the link to install the patch
Title: Re: Custom Form Mod
Post by: Kindred on January 04, 2022, 02:01:45 PM
were there any errors in the patch?   because what you describe suggests that something got incorrectly overwriten  (check form settings and permissions, as well)
Title: Re: Custom Form Mod
Post by: petewadey on January 04, 2022, 02:09:25 PM
There were errors in Profile-Modify php. I did replace this file manually with the 2.0.19 version. I kept the old one to revert to, but not tied doing so.
Title: Re: Custom Form Mod
Post by: live627 on January 04, 2022, 07:08:28 PM
can you give a link please?
Title: Re: Custom Form Mod
Post by: petewadey on January 05, 2022, 04:58:17 AM
I could, but the test site is password protected and the form isn't open to guests. I'll change the setting later today and get back to you with the links for both live site that works, and test site that doesn't
Title: Re: Custom Form Mod
Post by: petewadey on January 05, 2022, 05:58:27 AM
Update.
I restored my test site to before I changed the Profile-Modify php, and updated to 2.0.19, and the form works perfectly. I then tried updating to 2.0.19, ignoring the warnings re Profile-Modify php, and the form no longer works. Does this give any clues as to what might be the problem?You cannot view this attachment.
Title: Re: Custom Form Mod
Post by: petewadey on January 07, 2022, 05:56:51 AM
I'm running version 1.7 on php 5.6. I've tried removing 1.7, update to php 7.4, and installing 2.3 of this mod. This still doesn't work? It seems that version 1.7 doesn't fully uninstall, so I can't even try a fresh start? Any help please to fully uninstall 1.7.
Title: Re: Custom Form Mod
Post by: live627 on January 11, 2022, 01:19:49 AM
Quote from: petewadey on January 04, 2022, 11:28:14 AM. When I updated my mirrored test site to 2.0.19, the board that links to my custom form just refreshes the home page, and doesn't go to the form
First, let's try to figure this one out because updating the mod might not fix the redirection problem. Are you willing to send me a link to your test site via a personal message?
Title: Re: Custom Form Mod
Post by: live627 on February 25, 2022, 09:34:05 AM
v2.1.0

Features
Title: Re: Custom Form Mod
Post by: Shades. on February 25, 2022, 01:52:33 PM
Quote from: live627 on February 25, 2022, 09:34:05 AMv2.1.0

Features
  • Add support for SMF 2.1

Thank you Thank you Thank you! ;D  8)

Edit: FYI your link to mod on first page is messed up! ;)
[url=https://custom.simplemachines.org/index.php?mod=1279]Link to the mod[/url]
Title: Re: Custom Form Mod
Post by: Shades. on February 25, 2022, 02:37:49 PM
Tried to install on fresh 2.1.1 no other mods.

QuoteDatabase Error
BLOB/TEXT column 'output' can't have a default value
File: /home2/*****/public_html/*****/Packages/temp/install.php
Line: 73

QuoteError
Type of error
General
Error message
Hook call: function "customform_menu_buttons" in file /home2/*****/public_html/********** could not be called.
URL of page causing the error
https:/*****.*****.com/index.php?action=profile;area=alerts_popup;counter=0;u=1

Backtrace information
#0: call_integration_hook()
Called from /home2/*****/public_html/**********/Sources/Subs.php on line 5556
#1: setupMenuContext()
Called from /home2/*****/public_html/**********/Sources/Subs.php on line 4342
#2: setupThemeContext()
Called from /home2/*****/public_html/**********/Sources/Subs.php on line 4499
#3: template_header()
Called from /home2/*****/public_html/**********/Sources/Subs.php on line 4142
#4: obExit()
Called from /home2/*****/public_html/**********/index.php on line 190

QuoteError
Type of error
General
Error message
The callable customform_menu_buttons could not be called.
URL of page causing the error
https:/*****.*****.com/index.php?action=profile;area=alerts_popup;counter=0;u=1

Backtrace information
#0: call_helper()
Called from /home2/*****/public_html/**********/Sources/Subs.php on line 5747
#1: call_integration_hook()
Called from /home2/*****/public_html/**********/Sources/Subs.php on line 5556
#2: setupMenuContext()
Called from /home2/*****/public_html/**********/Sources/Subs.php on line 4342
#3: setupThemeContext()
Called from /home2/*****/public_html/**********/Sources/Subs.php on line 4499
#4: template_header()
Called from /home2/*****/public_html/**********/Sources/Subs.php on line 4142
#5: obExit()
Called from /home2/*****/public_html/**********/index.php on line 190

Also I can't uninstall it. It shows it's not installed but it installed a "Custom Forms" link in admin. (See attachments)
Title: Re: Custom Form Mod
Post by: Shades. on February 25, 2022, 06:54:06 PM
Quote from: Shades. on February 25, 2022, 02:37:49 PMAlso I can't uninstall it. It shows it's not installed but it installed a "Custom Forms" link in admin.
I was able to uninstall the link in admin by running fix_packages.php and removing all hooks. I will wait for further instructions or an update. ;)

Thanks 8)
Title: Re: Custom Form Mod
Post by: live627 on February 26, 2022, 03:26:11 AM
v2.1.1

Bug Fixes
Title: Re: Custom Form Mod
Post by: Shades. on February 26, 2022, 05:29:41 AM
I think it just don't like me! :o  :P

QuoteDatabase Error
Data too long for column 'text' at row 19
File: /home2/*****/public_html/*****/Packages/temp/install.php
Line: 128

QuoteError
Type of error
Database
Error message
Database Error: Data too long for column 'text' at row 19
File
/home2/*****/public_html/*****/Packages/temp/install.php
Line
128
URL of page causing the error
https://*****.com/index.php?action=admin;area=packages;sa=install2;package=custom-forms_2-1-1.tgz;pid=0

Backtrace information
#0: smf_db_error()
Called from /home2/*****/public_html/*****/Sources/Subs-Db-mysql.php on line 494
#1: smf_db_query()
Called from /home2/*****/public_html/*****/Sources/DbPackages-mysql.php on line 432
#2: smf_db_change_column()
Called from /home2/*****/public_html/*****/Packages/temp/install.php on line 128
#3: require()
Called from /home2/*****/public_html/*****/Sources/Packages.php on line 1064
#4: PackageInstall()
Called from /home2/*****/public_html/*****/Sources/Subs.php on line 6001
#5: call_helper()
Called from /home2/*****/public_html/*****/Sources/Packages.php on line 91
#6: Packages()
Called from /home2/*****/public_html/*****/Sources/Admin.php on line 499
#7: AdminMain()
Called from /home2/*****/public_html/*****/index.php on line 187
Title: Re: Custom Form Mod
Post by: live627 on February 26, 2022, 06:11:21 AM
Getting closer!

what is the result of this query?
select max(length(text)) from smf_cf_fieldsalso what is the type of the text column?
Title: Re: Custom Form Mod
Post by: Shades. on February 26, 2022, 06:33:20 AM
Actually here is what is still in the database from previous version. (see attachments)

Edit: Also I was able to install it on a clean SMF 2.1.1 but when going to /index.php?action=admin;area=modsettings;sa=customform it goes to a blank page. (no error log)

Quote from: live627 on February 26, 2022, 06:11:21 AMselect max(length(text)) from smf_cf_fields

max(length(text))
192
Title: Re: Custom Form Mod
Post by: live627 on February 26, 2022, 07:45:34 AM
looks like you were running v1.7

so either phone or rule2 are too long for the new code. The new size is 150 whereas you have 192. They need trimmed.

Or you can modify the code to accept more data.

install.php
array(
'name' => 'type',
'type' => 'varchar',
'size' => 150,
'null' => true,
),
change size to 255 array(
'name' => 'type',
'type' => 'varchar',
'size' => 255,
'null' => true,
),
Title: Re: Custom Form Mod
Post by: Shades. on February 26, 2022, 08:04:27 AM
Quote from: live627 on February 26, 2022, 07:45:34 AMlooks like you were running v1.7

so either phone or rule2 are too long for the new code. The new size is 150 whereas you have 192. They need trimmed.

Or you can modify the code to accept more data.

install.php
array(
'name' => 'type',
'type' => 'varchar',
'size' => 150,
'null' => true,
),
change size to 255 array(
'name' => 'type',
'type' => 'varchar',
'size' => 255,
'null' => true,
),

Ok it insalled but still getting error 500 page at index.php?action=admin;area=modsettings;sa=customform
Title: Re: Custom Form Mod
Post by: live627 on February 26, 2022, 08:20:47 AM
oh a parse error I didn't catch

in .\Themes\default\CustomForm.template.php on line 252', isset($modSettings['customform_view_title']) && ($modSettings['customform_view_title'] != '')) ? $modSettings['customform_view_title'] : $txt['customform_tabheader'], '

replace with', isset($modSettings['customform_view_title']) && $modSettings['customform_view_title'] != '' ? $modSettings['customform_view_title'] : $txt['customform_tabheader'], '
Title: Re: Custom Form Mod
Post by: Shades. on February 26, 2022, 08:41:00 AM
That worked! ;)

Another issue when I go to my form at /index.php?action=form;n=1 I get an error log:

QuoteError
Type of error
Undefined_vars
Error message
8: Undefined variable: true
File
/home2/*****/public_html/*****/Sources/Class-CustomForm.php
Line
188
URL of page causing the error
https://*****.com/index.php?action=form;n=1

Backtrace information
#0: smf_error_handler()
Called from /home2/*****/public_html/*****/Sources/Class-CustomForm.php on line 188
#1: setHtml()
Called from /home2/*****/public_html/*****/Sources/CustomForm.php on line 197
#2: CustomForm()
Called from /home2/*****/public_html/*****/index.php on line 187

And then also when I try to edit my form it won't save the board to post in. I can select a board but it always come back empty after saving. (see attachment)

Edit: Although it does show on the main custom form list page. (2nd attachment)
Title: Re: Custom Form Mod
Post by: Shades. on February 26, 2022, 09:00:29 AM
Also just tried to create another form and same thing, no board in the edit but shows on the main list.
But after creating the 2nd form another one or a "dummy" form popped up in between. It just says:

Quote0 ("Invalid Board")   Admin   (Edit)   (Delete)
Title: Re: Custom Form Mod
Post by: live627 on February 26, 2022, 09:17:39 AM
I'll create a new release with these fixes. :)

Does it find all of your old fields and assign the right type to them?
Quote from: Shades. on February 26, 2022, 09:00:29 AMBut after creating the 2nd form another one or a "dummy" form popped up in between. It just says:
Curious. I'll see ifs I can reproduce.
Title: Re: Custom Form Mod
Post by: Shades. on February 26, 2022, 10:49:35 AM
Quote from: live627 on February 26, 2022, 09:17:39 AMDoes it find all of your old fields and assign the right type to them?
As far as I can tell.

I used the form I created and it actually posted to the correct board but sent me to an empty "thank you" page after sending the form.
Title: Re: Custom Form Mod
Post by: live627 on February 26, 2022, 12:45:27 PM
Quote from: Shades. on February 26, 2022, 10:49:35 AM
QuoteDoes it find all of your old fields and assign the right type to them?
As far as I can tell.
That's good! Means the compatibility code is working.
Title: Re: Custom Form Mod
Post by: Shades. on February 26, 2022, 02:38:10 PM
Yes it's working! ;)

But still having these errors (https://www.simplemachines.org/community/index.php?topic=248871.msg4113589#msg4113589) and no thank you page after submitting a form.
Title: Re: Custom Form Mod
Post by: Shades. on February 26, 2022, 11:51:15 PM
This is on a fresh install of SMF 2.1.1 and no mods and first time installing custom form v2.1.1 on this database:

QuoteError
Type of error
Undefined_vars
Error message
8: Undefined index: parent_boards
File
/home2/*****/public_html/*****/Sources/Subs-Post.php
Line
2758
URL of page causing the error
https://*****.com/index.php?action=form

Backtrace information
#0: smf_error_handler()
Called from /home2/*****/public_html/*****/Sources/Subs-Post.php on line 2758
#1: updateLastMessages()
Called from /home2/*****/public_html/*****/Sources/Subs-Post.php on line 2158
#2: createPost()
Called from /home2/*****/public_html/*****/Sources/CustomForm.php on line 167
#3: CustomForm()
Called from /home2/*****/public_html/*****/index.php on line 187

QuoteError
Type of error
General
Error message
2: Invalid argument supplied for foreach()
File
/home2/*****/public_html/*****/Sources/Subs-Post.php
Line
2764
URL of page causing the error
https://*****.com/index.php?action=form

Backtrace information
#0: smf_error_handler()
Called from /home2/*****/public_html/*****/Sources/Subs-Post.php on line 2764
#1: updateLastMessages()
Called from /home2/*****/public_html/*****/Sources/Subs-Post.php on line 2158
#2: createPost()
Called from /home2/*****/public_html/*****/Sources/CustomForm.php on line 167
#3: CustomForm()
Called from /home2/*****/public_html/*****/index.php on line 187

QuoteError
Type of error
Undefined_vars
Error message
8: Undefined index: customform_thankyou
File
/home2/*****/public_html/*****/Themes/default/CustomForm.template.php
Line
260
URL of page causing the error
https://*****.com/index.php?action=form;thankyou

Backtrace information
#0: smf_error_handler()
Called from /home2/*****/public_html/*****/Themes/default/CustomForm.template.php on line 260
#1: template_ThankYou()
Called from /home2/*****/public_html/*****/Sources/Load.php on line 2744
#2: loadSubTemplate()
Called from /home2/*****/public_html/*****/Sources/Subs.php on line 4147
#3: obExit()
Called from /home2/*****/public_html/*****/index.php on line 190

QuoteError
Type of error
Undefined_vars
Error message
8: Undefined index: customform_forum
File
/home2/*****/public_html/*****/Themes/default/CustomForm.template.php
Line
266
URL of page causing the error
https://*****.com/index.php?action=form;thankyou

Backtrace information
#0: smf_error_handler()
Called from /home2/*****/public_html/*****/Themes/default/CustomForm.template.php on line 266
#1: template_ThankYou()
Called from /home2/*****/public_html/*****/Sources/Load.php on line 2744
#2: loadSubTemplate()
Called from /home2/*****/public_html/*****/Sources/Subs.php on line 4147
#3: obExit()
Called from /home2/*****/public_html/*****/index.php on line 190

QuoteError
Type of error
Undefined_vars
Error message
8: Undefined index: customform_list
File
/home2/*****/public_html/*****/Themes/default/CustomForm.template.php
Line
269
URL of page causing the error
https://*****.com/index.php?action=form;thankyou

Backtrace information
#0: smf_error_handler()
Called from /home2/*****/public_html/*****/Themes/default/CustomForm.template.php on line 269
#1: template_ThankYou()
Called from /home2/*****/public_html/*****/Sources/Load.php on line 2744
#2: loadSubTemplate()
Called from /home2/*****/public_html/*****/Sources/Subs.php on line 4147
#3: obExit()
Called from /home2/*****/public_html/*****/index.php on line 190

It does post to the correct board though (see attachment-form is not complete but it posted what I wanted so you could see it).
Title: Re: Custom Form Mod
Post by: live627 on February 27, 2022, 01:28:42 AM
v2.2.0

Features
Bug Fixes
Title: Re: Custom Form Mod
Post by: Shades. on February 27, 2022, 07:03:35 AM
Quote from: live627 on February 27, 2022, 01:28:42 AMv2.2.0

Features
  • Make the input box for the field text a textarea
  • Show form activity in the who's online page
Bug Fixes
  • Actually show help text when clicking on icon
  • Don't write the global $board because it confuses SMF into looking up undefined variables (parent_boards)
  • Parse error
  • Select correct board value for dropdown
  • Thankyou page was blank and generated errors
  • Undefined variable $true

It still shows Last Updated Yesterday at 02:28:32 AM & version 2.1.1 ;D
Title: Re: Custom Form Mod
Post by: Mooby The Golden Sock on February 27, 2022, 11:44:25 AM
I'm using the latest v2.2.0 from Github on 2.1.1 (upgraded from 2.0.19).

"Add New Form" gives me an error 500 on [boardurl]/index.php?action=admin;area=modsettings;sa=customform;form_id=5;

After this, I hit back button and refresh the page, and get:
Quote0 ("Invalid Board")   Admin   (Edit)   (Delete)

Clicking "Edit" gives another error 500 on [boardurl]/index.php?action=admin;area=modsettings;sa=customform;form_id=5;
Title: Re: Custom Form Mod
Post by: Shades. on February 27, 2022, 10:51:08 PM
Just downloaded v2.2.1 and installed it. Went into admin and everything is in order and in place where it should be. Got no errors so I went to my old form that I created from way back and entered the information, hit submit and my heart skipped a beat from excitement that it works perfectly! :laugh:

Thanks you sooo much @live627! This mod makes my life easier and quite frankly is one of the best mods out there and should be a premium mod IMHO! ;)  8)
Title: Re: Custom Form Mod
Post by: live627 on February 28, 2022, 01:08:36 AM
Quote from: Shades. on February 27, 2022, 10:51:08 PMquite frankly is one of the best mods out there and should be a premium mod IMHO! ;)  8)
I though so too but this was already here and its author was kind enough to give it to me; therefore I will keep it free.

I've seen several very useful mods get disappeared because their authors pulled them, some of which I use. I get frustrated to see them gone. I will not be contributing to such loss.

I DO, however, accept PayPal donations via the link/button on the mod page (or this ==> (https://www.paypal.me/JohnRayes))
Title: Re: Custom Form Mod
Post by: Shades. on February 28, 2022, 08:17:46 AM
Quote from: live627 on February 28, 2022, 01:08:36 AMI DO, however, accept PayPal donations via the link/button on the mod page (or this ==> (https://www.paypal.me/JohnRayes))
And done! ;)

I just found this issue this morning when trying to visit the users online: (Sends me to a blank 500 error page)

QuoteError
Type of error
Undefined_vars
Error message
8: Undefined variable: result
File
/home2/*****/public_html/*****/Sources/Subs-CustomForm.php
Line
38
URL of page causing the error
https://*****.com/index.php?action=who

Backtrace information
#0: smf_error_handler()
Called from /home2/*****/public_html/*****/Sources/Subs-CustomForm.php on line 38
#1: customform_load_theme()
Called from /home2/*****/public_html/*****/Sources/Subs.php on line 5810
#2: call_integration_hook()
Called from /home2/*****/public_html/*****/Sources/Load.php on line 2668
#3: loadTheme()
Called from /home2/*****/public_html/*****/index.php on line 230
#4: smf_main()
Called from /home2/*****/public_html/*****/index.php on line 187
Title: Re: Custom Form Mod
Post by: Shades. on March 01, 2022, 02:33:08 PM
My temporary fix (working with no errors but just a temporary fix): ;)

in Subs-CustomForm removed:
function customform_load_theme()
{
global $context, $scripturl, $smcFunc, $txt;

if ($context['current_action'] == 'who')
{
$request = $smcFunc['db_query']('', 'SELECT id_form, title FROM {db_prefix}cf_forms');
while ([$id_form, $title] = $smcFunc['db_fetch_row']($result))
if (allowedTo('custom_forms_' . $form_id))
$txt['customform_whoallow_' . $id_form] = sprintf(
$txt['customform_who'],
$scripturl,
$id_form,
$title,
);
$smcFunc['db_free_result']($result);
}

if ($context['current_action'] == 'helpadmin')
loadLanguage('CustomForm');
}

and disabled these Integration hooks:

1. customform_load_theme
2. customform_whos_online
Title: Re: Custom Form Mod
Post by: Shades. on March 11, 2022, 04:00:31 PM
Is there any way when a guest tries to access ?action=form;n=1 that it sends them to the registration page instead of the front page?
Title: Re: Custom Form Mod
Post by: Kindred on March 11, 2022, 08:08:11 PM
That's not default smf behavior.   
Title: Re: Custom Form Mod
Post by: Diego Andrés on March 11, 2022, 08:24:27 PM
Quote from: Shades. on March 11, 2022, 04:00:31 PMIs there any way when a guest tries to access ?action=form;n=1 that it sends them to the registration page instead of the front page?

Yes

Change this in CustomForm.php
if (!allowedTo('customform_view_perms'))
        redirectExit();
to
if (!allowedTo('customform_view_perms'))
        redirectExit('action=signup');

Or you could do what live didn't  :laugh:
Replace
if (!allowedTo('customform_view_perms'))
redirectExit();

loadLanguage('CustomForm');
with
loadLanguage('CustomForm');
isAllowedTo('customform_view_perms');
Then add the error txt string to the file (CustomForm.english.php)
$txt['cannot_customform_view_perms'] = 'You do not have permission to view the Custom Forms page.';
Title: Re: Custom Form Mod
Post by: Shades. on March 11, 2022, 09:17:23 PM
Quote from: Kindred on March 11, 2022, 08:08:11 PMThat's not default smf behavior. 
:P  ;D

Quote from: Diego Andrés on March 11, 2022, 08:24:27 PM
Quote from: Shades. on March 11, 2022, 04:00:31 PMIs there any way when a guest tries to access ?action=form;n=1 that it sends them to the registration page instead of the front page?


Yes

Change this in CustomForm.php
if (!allowedTo('customform_view_perms'))
        redirectExit();
to
if (!allowedTo('customform_view_perms'))
        redirectExit('action=signup');

Or you could do what live didn't  :laugh:
Replace
if (!allowedTo('customform_view_perms'))
redirectExit();

loadLanguage('CustomForm');
with
loadLanguage('CustomForm');
isAllowedTo('customform_view_perms');
Then add the error txt string to the file (CustomForm.english.php)
$txt['cannot_customform_view_perms'] = 'You do not have permission to view the Custom Forms page.';

I like the second option better, thanks a million! 8)
Title: Re: Custom Form Mod
Post by: Plus on March 13, 2022, 03:06:39 PM
8: Undefined index: n

how can i fix ?
Title: Re: Custom Form Mod
Post by: alex_cipher on March 17, 2022, 06:54:08 PM
Hi!

I've just installed the mod and asked myself if there shouldn't be a new "button" to access the forms (or maybe somewhere in a submenu)?

Or do I need to create one on my own?
Title: Re: Custom Form Mod
Post by: Shades. on March 19, 2022, 12:53:54 PM
Quote from: alex_cipher on March 17, 2022, 06:54:08 PMHi!

I've just installed the mod and asked myself if there shouldn't be a new "button" to access the forms (or maybe somewhere in a submenu)?

Or do I need to create one on my own?
You have to create your own, try using this mod (https://custom.simplemachines.org/index.php?mod=3674). ;)
Title: Re: Custom Form Mod
Post by: Shades. on March 19, 2022, 01:11:39 PM
@live627 I see you update the mod to v2.2.2.

So I installed on a clean SMF 2.1.1 and when a user is using the forms and I check who's online I'm still getting these errors:

QuoteError
Type of error
Undefined_vars
Error message
8: Undefined variable: form_id
File
/home2/*****/public_html/*****/Sources/Subs-CustomForm.php
Line
39
URL of page causing the error
https://beta.bikerhound.com/index.php?action=who

Backtrace information
#0: smf_error_handler()
Called from /home2/*****/public_html/*****/Sources/Subs-CustomForm.php on line 39
#1: customform_load_theme()
Called from /home2/*****/public_html/*****/Sources/Subs.php on line 5751
#2: call_integration_hook()
Called from /home2/*****/public_html/*****/Sources/Load.php on line 2664
#3: loadTheme()
Called from /home2/*****/public_html/*****/index.php on line 230
#4: smf_main()
Called from /home2/*****/public_html/*****/index.php on line 187

QuoteError
Type of error
Undefined_vars
Error message
8: Undefined index: customform_who
File
/home2/*****/public_html/*****/Sources/Subs-CustomForm.php
Line
41
URL of page causing the error
https://beta.bikerhound.com/index.php?action=who

Backtrace information
#0: smf_error_handler()
Called from /home2/*****/public_html/*****/Sources/Subs-CustomForm.php on line 41
#1: customform_load_theme()
Called from /home2/*****/public_html/*****/Sources/Subs.php on line 5751
#2: call_integration_hook()
Called from /home2/*****/public_html/*****/Sources/Load.php on line 2664
#3: loadTheme()
Called from /home2/*****/public_html/*****/index.php on line 230
#4: smf_main()
Called from /home2/*****/public_html/*****/index.php on line 187

QuoteError
Type of error
Undefined_vars
Error message
8: Undefined index: n
File
/home2/*****/public_html/*****/Sources/Subs-CustomForm.php
Line
57
URL of page causing the error
https://beta.bikerhound.com/index.php?action=who

Backtrace information
#0: smf_error_handler()
Called from /home2/*****/public_html/*****/Sources/Subs-CustomForm.php on line 57
#1: customform_whos_online()
Called from /home2/*****/public_html/*****/Sources/Subs.php on line 5751
#2: call_integration_hook()
Called from /home2/*****/public_html/*****/Sources/Who.php on line 468
#3: determineActions()
Called from /home2/*****/public_html/*****/Sources/Who.php on line 213
#4: Who()
Called from /home2/*****/public_html/*****/index.php on line 187
Title: Re: Custom Form Mod
Post by: alex_cipher on March 19, 2022, 01:18:41 PM
Quote from: Shades. on March 19, 2022, 12:53:54 PMYou have to create your own, try using this mod (https://custom.simplemachines.org/index.php?mod=3674). ;)

I would use it if it would work for me.
https://www.simplemachines.org/community/index.php?topic=528574.msg4116824#msg4116824
Title: Re: Custom Form Mod
Post by: alex_cipher on March 20, 2022, 04:53:21 AM
There's a small typo in the description for the internal link.
QuoteThis setting allows you to chose the title for the action/page that shows the list of forms to a user (at "index.php?action=forms"). By default 'Custom Forms' will be the title.
Here you wrote action=forms but it should be action=form

Just to inform you.
Title: Re: Custom Form Mod
Post by: live627 on March 20, 2022, 05:54:36 AM
2.2.3

Bug Fixes
Title: Re: Custom Form Mod
Post by: alex_cipher on March 20, 2022, 05:56:53 AM
Hey @live627 

Sorry for the double post, and sorry for not reading all 100 pages, but is it possible to force users to use the form for a specific board.
For example I have a support board.
A user want to open a support topic and click on "New Topic", now the form should open.
Is this possible?
Title: Re: Custom Form Mod
Post by: Kindred on March 20, 2022, 09:43:11 AM
That would require some custom coding, well outside the design of this mod....
Title: Re: Custom Form Mod
Post by: Aleksi "Lex" Kilpinen on March 20, 2022, 09:50:05 AM
Not much though, if it still works like it used to - You could just remove the permission to open a topic in that board, direct people to use the form instead, and voila. (I used to use this to have people post stuff in boards they couldn't even access.)
Title: Re: Custom Form Mod
Post by: Shades. on March 20, 2022, 11:19:04 AM
Quote from: Aleksi "Lex" Kilpinen on March 20, 2022, 09:50:05 AMNot much though, if it still works like it used to - You could just remove the permission to open a topic in that board, direct people to use the form instead, and voila. (I used to use this to have people post stuff in boards they couldn't even access.)
This I what I do too! Users submit an event with the form link I provide and the post goes to a board that only I can see and approve and then move it to the appropriate board. ;)
Title: Re: Custom Form Mod
Post by: Shades. on March 20, 2022, 01:01:58 PM
SMF 2.1.1
Custom Forms v2.2.3

The forms work great so no problems with that part and no error messages but the Integration Hook "customform_whos_online" is not working properly. I had to disable it because it was interfering with the rest of the forums "Who's Online" page.

You cannot view this attachment.

Once disabled they work again.

You cannot view this attachment.
Title: Re: Custom Form Mod
Post by: alex_cipher on March 20, 2022, 01:19:50 PM
Quote from: Aleksi on March 20, 2022, 09:50:05 AMNot much though, if it still works like it used to - You could just remove the permission to open a topic in that board, direct people to use the form instead, and voila. (I used to use this to have people post stuff in boards they couldn't even access.)
Isn't that paradox that the users can't open a topic but with the custom form mod they can? How is this possible?
I haven't looked at the board settings atm but can I deny users to start a topic but to answer in this topic?
Title: Re: Custom Form Mod
Post by: Aleksi "Lex" Kilpinen on March 20, 2022, 01:52:02 PM
Yes you can use permissions to allow or limit posting of new topics and replies separately.
It may sound contradictory, but the permissions limit what the user can do - the form though is not a user, it has no user permissions, it has a different set of settings the admin can use how they want to.
Title: Re: Custom Form Mod
Post by: alex_cipher on March 20, 2022, 01:55:17 PM
I looked into the board settings and saw that I can set it to "only answer" and I think this is what you meant.
So the form isn't the user and that's the reason it can post into the board. I understand.
Thank you!
Title: Re: Custom Form Mod
Post by: Aleksi "Lex" Kilpinen on March 20, 2022, 02:26:44 PM
No worries, but do remember to test that it actually works like you want it to - I haven't done that in a while, and I'm not sure if the mod still functions exactly the same :)
Title: Re: Custom Form Mod
Post by: live627 on March 21, 2022, 12:28:29 AM
Quote from: Shades. on March 20, 2022, 01:01:58 PMthe Integration Hook "customform_whos_online" is not working properly. I had to disable it because it was interfering with the rest of the forums "Who's Online" page
oh oops it's because of this line return $txt['who_hidden'];https://github.com/live627/smf-custom-forms/blob/d23f0984398c86e087dfdb335489c6aaec78635c/src/Subs-CustomForm.php#L61 (It can be removed)
Title: Re: Custom Form Mod
Post by: Shades. on March 21, 2022, 01:47:29 PM
Quote from: live627 on March 21, 2022, 12:28:29 AM
Quote from: Shades. on March 20, 2022, 01:01:58 PMthe Integration Hook "customform_whos_online" is not working properly. I had to disable it because it was interfering with the rest of the forums "Who's Online" page
oh oops it's because of this line return $txt['who_hidden'];https://github.com/live627/smf-custom-forms/blob/d23f0984398c86e087dfdb335489c6aaec78635c/src/Subs-CustomForm.php#L61 (It can be removed)
That fixed it thank you! 8)
Title: Re: Custom Form Mod
Post by: Shades. on April 10, 2022, 02:18:01 AM
Installed this today on a fresh/clean SMF 2.1.1 and when creating a form (before creating any new fields and non existing) I get this error in logs:

QuoteError
Type of error
General
Error message
2: assert(): assert(isset($editorOptions['value'])) failed
File
/home/*****/public_html/*****/Sources/Subs-Editor.php
Line
1514
URL of page causing the error
https://*****.com/index.php?action=admin;area=modsettings;sa=customform;form_id=1;

Backtrace information
#0: smf_error_handler()
Called from unknown on line -1
#1: assert()
Called from /home/*****/public_html/*****/Sources/Subs-Editor.php on line 1514
#2: create_control_richedit()
Called from /home/*****/public_html/*****/Sources/ManageCustomForm.php on line 170
#3: ModifyCustomFormSettings()
Called from /home/*****/public_html/*****/Sources/Subs.php on line 6001
#4: call_helper()
Called from /home/*****/public_html/*****/Sources/ManageSettings.php on line 142
#5: ModifyModSettings()
Called from /home/*****/public_html/*****/Sources/Admin.php on line 499
#6: AdminMain()
Called from /home/*****/public_html/*****/index.php on line 187
Title: Re: Custom Form Mod
Post by: Shades. on April 10, 2022, 06:21:29 AM
Also having problems with verification questions on the form. If a user enters the wrong answer it sends them back to correct the answers but duplicates the answers for some reason. If you can help I also have a topic on my issues here (https://www.simplemachines.org/community/index.php?topic=581794.msg4119539#msg4119539)!

Thanks! 8)
Title: Re: Custom Form Mod
Post by: Shades. on April 11, 2022, 11:24:09 PM
Tried to create a new field on a form for the first time in a while lol but it gave me this error. My form still works as it was but can't add new fields to it or to any other new forms.

QuoteField 'type_vars' doesn't have a default value
File: /home/*****/public_html/*****/Sources/ManageCustomForm.php
Line: 141

QuoteError
Type of error
Database
Error message
Database Error: Field 'type_vars' doesn't have a default value
File
/home/*****/public_html/*****/Sources/ManageCustomForm.php
Line
141
URL of page causing the error
https://*****.com/?action=admin;area=modsettings;sa=customform;form_id=1;add_field;

Backtrace information
#0: smf_db_error()
Called from /home/*****/public_html/*****/Sources/Subs-Db-mysql.php on line 494
#1: smf_db_query()
Called from /home/*****/public_html/*****/Sources/Subs-Db-mysql.php on line 802
#2: smf_db_insert()
Called from /home/*****/public_html/*****/Sources/ManageCustomForm.php on line 141
#3: ModifyCustomFormSettings()
Called from /home/*****/public_html/*****/Sources/Subs.php on line 6064
#4: call_helper()
Called from /home/*****/public_html/*****/Sources/ManageSettings.php on line 145
#5: ModifyModSettings()
Called from /home/*****/public_html/*****/Sources/Admin.php on line 510
#6: AdminMain()
Called from /home/*****/public_html/*****/index.php on line 190

Edit: I was able to correct it in the database by changing Field 'type_vars' to NULL. ;)
Title: Re: Custom Form Mod
Post by: nishuFun on April 29, 2022, 05:03:49 AM
on a very freshly installed 2.1.1

on creating "add new form" got this php error:
QuoteFatal error: Uncaught AssertionError: assert(isset($editorOptions['value'])) in C:\xampp\htdocs\smf\Sources\Subs-Editor.php:1514 Stack trace: #0 C:\xampp\htdocs\smf\Sources\Subs-Editor.php(1514): assert(false, 'assert(isset($e...') #1 C:\xampp\htdocs\smf\Sources\ManageCustomForm.php(170): create_control_richedit(Array) #2 C:\xampp\htdocs\smf\Sources\Subs.php(6001): ModifyCustomFormSettings() #3 C:\xampp\htdocs\smf\Sources\ManageSettings.php(142): call_helper('ModifyCustomFor...') #4 C:\xampp\htdocs\smf\Sources\Admin.php(499): ModifyModSettings() #5 C:\xampp\htdocs\smf\index.php(187): AdminMain() #6 {main} thrown in C:\xampp\htdocs\smf\Sources\Subs-Editor.php on line 1514

and on refreshing mod settings:

QuoteTitle    Board    Permissions    Modify
   0 ("Invalid Board")    Admin    
(Edit)    (Delete
Title: Re: Custom Form Mod
Post by: Senkusha on May 22, 2022, 03:57:09 PM
I just noticed a bug.  When viewing my Who's online list.  Everybody is:

QuoteNothing, or nothing you can see...

I had to remove the mod.
Title: Re: Custom Form Mod
Post by: live627 on May 24, 2022, 04:14:13 PM
 I have released v2.2.4 which fixes the issue in the Who's Online page
Title: Re: Custom Form Mod
Post by: Shades. on May 26, 2022, 07:44:03 PM
SMF 2.1.2
Custom Form Mod 2.2.4

I've been noticing this for a while now but been reluctant to say anything about it because I thought I was going crazy :o  but my permissions for this mod only are being reset somehow on a daily basis to "Admin" and I have to go in and change them back to "Admin, Users, Global Moderator, Forum Leader, Assistant Admin".

No errors in logs! Any ideas what's causing this? ???

Title: Re: Custom Form Mod
Post by: live627 on June 09, 2022, 10:14:11 PM
I have no idea. The permissions piggyback off off the standard SMF permissions system and are stored in smf_permissions with names such as custom_forms_{FORM_ID}
Title: Re: Custom Form Mod
Post by: Shades. on June 10, 2022, 03:23:41 AM
Quote from: live627 on June 09, 2022, 10:14:11 PMI have no idea. The permissions piggyback off off the standard SMF permissions system and are stored in smf_permissions with names such as custom_forms_{FORM_ID}
Would you be interested in looking into my system if I gave you access via PM?
Title: Re: Custom Form Mod
Post by: Avid Gamer on July 04, 2022, 09:14:21 AM
Hi, I have recently upgraded to 2.0.18 to 2.0.19 (large upgrade) I was using v2.0.3 Custom forms and downloaded the 2.2.4, I am running PHP 7.4. I was getting error "Call to undefined function sortBoards()" when I tried to edit or create a new form (currently have 3) so I uninstalled and downloaded 2.2.3 from the github and got same message, I get no errors when using the 2.0.3 and ideas?

Great mod BTW.
Title: Re: Custom Form Mod
Post by: live627 on July 04, 2022, 07:03:01 PM
Yeah, that's a function introduced in SMF 2.1. Gotta remove that call on line 328 in ManageCustomForm.php

sortBoards($boards);
replace with


// sortBoards($boards);
Title: Re: Custom Form Mod
Post by: Avid Gamer on July 04, 2022, 09:17:22 PM
Quote from: live627 on July 04, 2022, 07:03:01 PMYeah, that's a function introduced in SMF 2.1. Gotta remove that call on line 328 in ManageCustomForm.php

        sortBoards($boards);
replace with


        // sortBoards($boards);

Thank you, love the mod.
Title: Re: Custom Form Mod
Post by: kwaka on September 17, 2022, 08:55:20 AM
I've been struggling with this mod for a few days now.
The form submits and displays fine but, as soon as a New Field is added, no go.

Using the Radio buttons causes an endless loop on Submit where the error states there are required fields when the isn't any required fields.

Using the Select box, the New Fields are there and works on Submit but the New Fields do not appear on the submitted form.

Yes I've completely uninstalled/deleted/removed the mod and reinstalled. Issue remains.

Tried as per above post, placing // in the code sortBoards($boards); in ManageCustomForm.php this has not fixed anything.

Any tips on how to fix/make the added New Fields display correctly?
Thanks.

Title: Re: Custom Form Mod
Post by: kwaka on September 18, 2022, 04:40:47 AM
Please disregard my previous post. All fixed, form/s working as expected now.
Main issue was that I'd forgot about the lower case and other requirements in the Form Fields.

Sorry to trouble you, terrific mod, carry on.  8)
Title: Re: Custom Form Mod
Post by: Shades. on October 01, 2022, 02:40:21 PM
How can I make the "Large Text" box default bigger to match the length of the other boxes? (see attachment)

You cannot view this attachment.
Title: Re: Custom Form Mod
Post by: live627 on October 03, 2022, 04:49:53 PM
https://github.com/live627/smf-custom-forms/blob/dbf39089dbbe06203cd57361461275d8af29d118/src/Class-CustomForm.php#L282

In ./Sources/Class-CustomForm.php, find

'<textarea name="%s[%d]" %s%s>%s</textarea>',
Replace with


'<textarea name="%s[%d]" style="width: 90%%;" %s%s>%s</textarea>',
Title: Re: Custom Form Mod
Post by: Shades. on October 03, 2022, 08:19:47 PM
Awesome...Thank You! 8)
Title: Re: Custom Form Mod
Post by: kwaka on October 06, 2022, 12:52:31 PM
G'day all,

I keep having this "required" Extra Type Parameters issue with both the Radio and Check Box options in a form.

New install of SMF as per:
SMF version: SMF ver. 2.1.2
Default Forum Language: English British en_UK
Theme name and version: SMF Default Theme - Curve2
Mods installed: Mods list 16 as per attached screenshot. Not all are installed though.

Whether using one or both Radio and Check Box and these are ticked/checked, after clicking the Submit Form button the Fields marked with an asterisk (*) are required keeps appearing, and yes in red text and yes too, the form is not submitted.

The Radio Buttons even if required is omitted in the Extra Type Parameters, will not submit and keeps asking for the required parameters. See attached.

Also, the Check Box does work without the required parameter, but with or without checking the box, the reply/answer is always no.

As the Radio and Check Box options have those issues, the current work around is using required in the Select Box, this works fine.

NOTE: The issue remains even if the Custom Form Mod is the only mod installed, nor does in matter which browser is used.

Nothing in the logs either.

Any ideas/suggestions on how to fix both these Radio and Check Box issues?

Thanks.

Radio Buttons
You cannot view this attachment.
You cannot view this attachment. 
You cannot view this attachment.
You cannot view this attachment.
You cannot view this attachment.

Mods
You cannot view this attachment.
Title: Re: Custom Form Mod
Post by: Shades. on October 28, 2022, 05:08:50 PM
SMF 2.1.2
Custom Form Mod   2.2.4

Installed this on a new site and when editing or adding new form fields I get this error:

QuoteError
Type of error
Undefined_vars
Error message
8: Undefined variable: board
File
/home/******/public_html/******/Sources/ManageCustomForm.php
Line
270
URL of page causing the error
https://******.com/?action=admin;area=modsettings;sa=customform;form_id=2;

Backtrace information
#0: smf_error_handler()
Called from /home/******/public_html/******/Sources/ManageCustomForm.php on line 270
#1: ModifyCustomFormSettings()
Called from /home/******/public_html/******/Sources/Subs.php on line 6118
#2: call_helper()
Called from /home/******/public_html/******/Sources/ManageSettings.php on line 144
#3: ModifyModSettings()
Called from /home/******/public_html/******/Sources/Admin.php on line 509
#4: AdminMain()
Called from /home/******/public_html/******/index.php on line 192
Title: Re: Custom Form Mod
Post by: live627 on November 01, 2022, 12:15:25 AM
Quote from: kwaka on October 06, 2022, 12:52:31 PMG'day all,

I keep having this "required" Extra Type Parameters issue with both the Radio and Check Box options in a form.

[...]

Any ideas/suggestions on how to fix both these Radio and Check Box issues?

Thanks
Thanks for the detailed bug report. I'm working on a new version of this mod that will fix those problems.
Title: Re: Custom Form Mod
Post by: live627 on November 02, 2022, 04:47:29 PM
The liberal overuse of help texts (the verbose text in the popups triggered by the question mark icons) somewhat annoys me. Most can either be removed or condensed into brief descriptions/subtexts that are on the setting pages.
Title: Re: Custom Form Mod
Post by: live627 on November 02, 2022, 07:21:59 PM
3.0.0 (2022-11-02)
⚠ BREAKING CHANGES
Features
Bug Fixes
Title: Re: Custom Form Mod
Post by: live627 on November 05, 2022, 05:43:32 AM
Now on Crowdin!

https://crowdin.com/project/custom-form
Title: Re: Custom Form Mod
Post by: kwaka on November 20, 2022, 10:35:50 PM
Quote from: live627 on November 01, 2022, 12:15:25 AMThanks for the detailed bug report. I'm working on a new version of this mod that will fix those problems.

Cheers, glad to help out in some small way.
Thanks also for updating the mod, I'll install the update soon.
Look forward to the modifications to the mod.  8)  :)
Title: Re: Custom Form Mod
Post by: kwaka on November 20, 2022, 11:11:48 PM
BTW, what is the best/preferred way to update/upgrade the mod?

Also the mod main page:
Tutorial - View more tutorials (https://github.com/live627/smf-custom-forms/tree/main/docs)

...goes to a 404 page
Title: Re: Custom Form Mod
Post by: live627 on November 21, 2022, 03:49:51 AM
Uninstall old/install new

Title: Re: Custom Form Mod
Post by: live627 on November 21, 2022, 05:59:39 AM
I added a new version which allows a direct upgrade via the package manager.

You cannot view this attachment.
Title: Re: Custom Form Mod
Post by: samozin on November 26, 2022, 04:49:57 AM
so i tried this mod ...i dont know ..how to get entered data (from the form )  in a datatable like this https://datatables.net
is it possible..?
any one has a video tut for this..? i think its easy but i feel iam missing something..
Title: Re: Custom Form Mod
Post by: live627 on November 26, 2022, 07:43:15 AM
This mod only outputs data to a forum post as a new topic.
Title: Re: Custom Form Mod
Post by: Rick53 on December 04, 2022, 06:43:32 AM
Quote from: Nathaniel on August 05, 2008, 07:19:34 PMIs 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.


I apologize if my problem has already been solved elsewhere. But couldn't find anything.

My form should be designed in such a way that the content of a field is also displayed in the board with this individual subject.

As described in the quote above, the designation "Subject" doesn't work for me. Only the standard form subject is entered in the board.

The field type is "Text", but I have already tested with "Information".

Anyone know a solution?
(SMF 2.1.3 )
Title: Re: Custom Form Mod
Post by: live627 on December 05, 2022, 07:03:45 AM
This mod has gone through two major revisions since that post was made 14 years ago. Is the field's identifier that name? It still works, but is a little bit different now.
Title: Re: Custom Form Mod
Post by: Rick53 on December 06, 2022, 01:40:25 PM
I'm not very well concerned with programming with PHP/HTML. What is meant by "field's identifier"?
Actually it works fine for me. However, I only work with text fields.

The content is also correctly transferred to a new post. I just don't know how to get the subject/title of the post from the form as well. Automatically.
Title: Re: Custom Form Mod
Post by: live627 on December 08, 2022, 06:56:03 AM
4.0.0 (https://github.com/live627/smf-custom-forms/compare/v3.1.0...v4.0.0) (2022-12-08)

⚠ BREAKING CHANGES

Features

Bug Fixes

Code Refactoring
Title: Re: Custom Form Mod
Post by: 8vanima88 on December 08, 2022, 10:08:00 AM
Quote from: live627 on December 08, 2022, 06:56:03 AM4.0.0 (https://github.com/live627/smf-custom-forms/compare/v3.1.0...v4.0.0) (2022-12-08)

⚠ BREAKING CHANGES
  • Field descriptions no longer accept raw HTML as part of the security fix (BBC accepted instead)
  • Requires PHP 8 or newer

Features
  • Add update notice for admins (8d88ff6 (https://github.com/live627/smf-custom-forms/commit/8d88ff6dc3c107e053dd98eca7a81df6cc516f46))
  • Form edit box now includes a button to add field macros (445473d (https://github.com/live627/smf-custom-forms/commit/445473de818f7fd55aac44e67965e3d26c8c6dc5))
  • integrate_customform_classlist (bd054cb (https://github.com/live627/smf-custom-forms/commit/bd054cbc81ae69d8e0b697c33e54a08eeb854f73))

Bug Fixes
  • Tighten security by encoding HTML special characters (430f1f7 (https://github.com/live627/smf-custom-forms/commit/430f1f7b35583d35a0ba02ccd275ca24781f70c4))

Code Refactoring
  • move to namespace classes (3289cd8 (https://github.com/live627/smf-custom-forms/commit/3289cd80e925a338b33fb3313d141a672a6b0f59))


Installing this results in:

2: Undefined array key "db_add_column"

In the error log

The previous version was fine with installation. Since my update package mod doesn't work, I had to reinstall/install to update the version. I'm facing this error when trying to install 4.0.0 now.
Title: Re: Custom Form Mod
Post by: live627 on December 08, 2022, 07:18:57 PM
I have pushed a new release, 4.0.1, which addresses this issue. Thanks for reporting!
Title: Re: Custom Form Mod
Post by: Shades. on December 09, 2022, 08:23:51 AM
SMF 2.1.3 (Fresh Install)
Custom Form Mod   4.0.1
PHP 8.0

Uploaded through package manager, clicked on install and I'm getting this error:

QuoteError
Type of error
Database
Error message
Database Error: Table '******_******.***_cf_forms' doesn't exist
File
/home/******/public_html/******/Packages/temp/upgrade.php
Line
23
URL of page causing the error
https://******.com/index.php?action=admin;area=packages;sa=install2;package=custom-forms_4-0-1.tgz;pid=0

Backtrace information
#0: smf_db_error()
Called from /home/******/public_html/******/Sources/Subs-Db-mysql.php on line 494
#1: smf_db_query()
Called from /home/******/public_html/******/Sources/DbPackages-mysql.php on line 361
#2: smf_db_add_column()
Called from /home/******/public_html/******/Packages/temp/upgrade.php on line 23
#3: require()
Called from /home/******/public_html/******/Sources/Packages.php on line 1028
#4: PackageInstall()
Called from /home/******/public_html/******/Sources/Subs.php on line 6016
#5: call_helper()
Called from /home/******/public_html/******/Sources/Packages.php on line 91
#6: Packages()
Called from /home/******/public_html/******/Sources/Admin.php on line 499
#7: AdminMain()
Called from /home/******/public_html/******/index.php on line 191
Title: Re: Custom Form Mod
Post by: live627 on December 10, 2022, 12:35:16 AM
damn, I  didn't test a fresh install, only upgrades.
Title: Re: Custom Form Mod
Post by: 8vanima88 on December 11, 2022, 12:04:27 PM
Type of error: General
The callable CustomForm\Integration::autoload could not be called.

Error log is being spammed this at 1-10k entries per few seconds. The forum is nearly unloadable. I've already uninstalled the package however it's still going nuts. Do you know how I can stop SMF from trying to call this mod since it's uninstalled?

Fixed:
Maintenance > Integration Hooks > Filter: autoload > Remove customForm hook.

live - Even on upgrade, it's still broken.
Title: Re: Custom Form Mod
Post by: kwaka on January 11, 2023, 10:53:13 AM
Hello,

After patching SMF to 2.1.3 I tried to upgrade Custom Mod Form from 2.2.4 to 4.0.1. The Package Manager reports the following as per screen print:

You cannot view this attachment.

I don't wont to lose the existing forms so can you advise if I should uninstall the previous version before attempting to Install 4.0.1?

Thanks.
 
Title: Re: Custom Form Mod
Post by: Steve on January 11, 2023, 03:38:05 PM
First, backup everything up. Then yes, select uninstall but make sure it has the option to remove data associated with this mod unchecked. If it doesn't have that option, back out and someone will help you.
Title: Re: Custom Form Mod
Post by: Shades. on January 12, 2023, 06:52:18 PM
SMF 2.1.3
Custom Forum v4.0.2

When creating or editing a field Type "Information", I am getting this error:

QuoteThe database value you're trying to insert does not exist: text

QuoteError
Type of error
Undefined_vars
Error message
2: Undefined array key "field_text"
File
/home/******/public_html/******/Sources/CustomForm/ManageCustomForm.php
Line
963
URL of page causing the error
https://******.com/?action=admin;area=modsettings;sa=customform;field_id=1;act=savefield

Backtrace information
#0: smf_error_handler()
Called from /home/******/public_html/******/Sources/CustomForm/ManageCustomForm.php on line 963
#1: SaveField()
Called from unknown on line -1
#2: call_user_func()
Called from /home/******/public_html/******/Sources/CustomForm/ManageCustomForm.php on line 66
#3: __construct()
Called from /home/******/public_html/******/Sources/CustomForm/ManageCustomForm.php on line 74
#4: create()
Called from /home/******/public_html/******/Sources/Subs.php on line 6076
#5: call_helper()
Called from /home/******/public_html/******/Sources/ManageSettings.php on line 144
#6: ModifyModSettings()
Called from /home/******/public_html/******/Sources/Admin.php on line 509
#7: AdminMain()
Called from /home/******/public_html/******/index.php on line 192

QuoteError
Type of error
Critical
Error message
The database value you're trying to insert does not exist: text
Function: SaveField
File
/home/******/public_html/******/Sources/CustomForm/ManageCustomForm.php
Line
965
URL of page causing the error
https://******.com/?action=admin;area=modsettings;sa=customform;field_id=1;act=savefield

Backtrace information
#0: smf_db_error_backtrace()
Called from /home/******/public_html/******/Sources/Subs-Db-mysql.php on line 201
#1: smf_db_replacement__callback()
Called from unknown on line -1
#2: preg_replace_callback()
Called from /home/******/public_html/******/Sources/Subs-Db-mysql.php on line 409
#3: smf_db_query()
Called from /home/******/public_html/******/Sources/CustomForm/ManageCustomForm.php on line 965
#4: SaveField()
Called from unknown on line -1
#5: call_user_func()
Called from /home/******/public_html/******/Sources/CustomForm/ManageCustomForm.php on line 66
#6: __construct()
Called from /home/******/public_html/******/Sources/CustomForm/ManageCustomForm.php on line 74
#7: create()
Called from /home/******/public_html/******/Sources/Subs.php on line 6076
#8: call_helper()
Called from /home/******/public_html/******/Sources/ManageSettings.php on line 144
#9: ModifyModSettings()
Called from /home/******/public_html/******/Sources/Admin.php on line 509
#10: AdminMain()
Called from /home/******/public_html/******/index.php on line 192
Title: Re: Custom Form Mod
Post by: PANIC12 on March 07, 2023, 10:06:19 PM
SMF Version 2.1.3
Custom Forms 4.0.2

Hi- I had custom forms installed before upgrading to 2.1.3, so I deleted my old packaged, along with the database info so I could have a fresh start. Everything installs successfully, but when I go to create a form, I get a white screen when I try to add a field. I get 400+ error messages, with this being the only critical message:

The database value you're trying to insert does not exist: text
Function: SaveField
Title: Re: Custom Form Mod
Post by: Kindred on March 08, 2023, 09:02:19 AM
looks to me as if the mod was not fully installed
Title: Re: Custom Form Mod
Post by: PANIC12 on March 08, 2023, 11:36:03 AM
Quote from: Kindred on March 08, 2023, 09:02:19 AMlooks to me as if the mod was not fully installed

I resinstalled everything, and now that error is not showing in the log, but I still get the blank white page with a ton of other errors.

The callable CustomForm\Integration::autoload could not be called.
Title: Re: Custom Form Mod
Post by: Kindred on March 08, 2023, 12:19:31 PM
Still not fully installed.  It would seem to be missing files
Title: Re: Custom Form Mod
Post by: Mareid on March 08, 2023, 10:33:35 PM
I installed this mod (4.02) using the package manager about a month ago.  I started having (most likely unrelated) problems about a week ago, and one suggestion was it may have been mods. 

I uninstalled, all mods, using the package manager. Then I started getting 30 errors every single time I touched anything in the admin section.
I chased the errors down to this one mod, so I reinstalled it, hoping that would fix the problem. It did not.  While I'm no longer getting 30 errors, I am getting 2 errors every time I touch anything in the admin section. The errors are related to this mod only.

Just to be sure I uninstalled a second time, deleted the package, re downloaded the package, re-uploaded and reinstalled. Same...30 errors on uninstall, 2 errors after re-installing.

I am willing to uninstall it manually if I have to but I'm really frustrated.  I believe I did everything correctly; the mod was on the official site, says it's compatible with 2.1 (I'm running 2.13)

I've attached a screen shot of the errors I'm now getting. The shot is taken immediately after clearing the log completely.
Title: Re: Custom Form Mod
Post by: PANIC12 on March 08, 2023, 11:40:52 PM
I have the same error as well with every page refresh.

You cannot view this attachment.
Title: Re: Custom Form Mod
Post by: Kindred on March 09, 2023, 09:17:09 AM
go to phpmyadmin
go to smf_settings (smf_ prefix = your prefix)
run this
SELECT * FROM `smf_settings` WHERE `variable` LIKE '%inte%'
Title: Re: Custom Form Mod
Post by: Mareid on March 09, 2023, 10:15:32 AM
Nothing comes back. Assuming I am doing it correctly.  I also found the link to smf (my prefix)_settings, and looked through the list of settings line by line and nothing has "inte" in it as far as I can tell. 

I tried deleting it again with the package manager then searched for any files with the same file name as the mod files.  All seemed to be gone. Looks like there's something the mod changed in the default package.
Title: Re: Custom Form Mod
Post by: Mareid on March 09, 2023, 11:09:48 AM
Found the problem.  Maintenance>Forum Manitenance>Integration Hooks
Thank you Aleksi!!
Title: Re: Custom Form Mod
Post by: Aleksi "Lex" Kilpinen on March 09, 2023, 11:11:34 AM
You're welcome :)
Title: Re: Custom Form Mod
Post by: PANIC12 on March 09, 2023, 03:18:38 PM
Quote from: Kindred on March 09, 2023, 09:17:09 AMgo to phpmyadmin
go to smf_settings (smf_ prefix = your prefix)
run this
SELECT * FROM `smf_settings` WHERE `variable` LIKE '%inte%'




like this?

Title: Re: Custom Form Mod
Post by: PANIC12 on March 13, 2023, 12:29:53 PM
Sorry for the double reply. I was able to stop the hook error message. But I am still getting an error when I go to create a field for a form. What file might be the cause of this error?
Title: Re: Custom Form Mod
Post by: PANIC12 on April 02, 2023, 12:26:10 PM
Hi, I reinstalled all the files and ensured everything was uploaded. I don't think any files were missed. I am still getting a blank white screen when i try to access this path:

/index.php?action=admin;area=modsettings;sa=customform;act=editfield;field_id=1
What file do I need to look at that might be causing this issue?
Title: Re: Custom Form Mod
Post by: live627 on April 02, 2023, 08:09:13 PM
blank screen... you running php 8?Any errors in the error log file?
Title: Re: Custom Form Mod
Post by: PANIC12 on April 03, 2023, 12:56:34 AM
Quote from: live627 on April 02, 2023, 08:09:13 PMblank screen... you running php 8?Any errors in the error log file?

Yes, version 8.0.28. And no, nothing shows in the error log.
Title: Re: Custom Form Mod
Post by: live627 on April 03, 2023, 02:12:53 AM
PHP logs its errors to a separate file
Title: Re: Custom Form Mod
Post by: PANIC12 on April 03, 2023, 06:25:28 PM
Ah okay. I enabled the php error display and got this message when trying to add a field:

Fatal error: Uncaught TypeError: preg_match(): Argument #2 ($subject) must be of type string, null given in /home2/tfcclanc/domains/tfc-clan.com/public_html/Sources/CustomForm/ManageCustomForm.php:520 Stack trace: #0 /home2/tfcclanc/domains/tfc-clan.com/public_html/Sources/CustomForm/ManageCustomForm.php(520): preg_match() #1 [internal function]: CustomForm\ManageCustomForm->editField() #2 /home2/tfcclanc/domains/tfc-clan.com/public_html/Sources/CustomForm/ManageCustomForm.php(66): call_user_func() #3 /home2/tfcclanc/domains/tfc-clan.com/public_html/Sources/CustomForm/ManageCustomForm.php(74): CustomForm\ManageCustomForm->__construct() #4 /home2/tfcclanc/domains/tfc-clan.com/public_html/Sources/Subs.php(6028): CustomForm\ManageCustomForm::create() #5 /home2/tfcclanc/domains/tfc-clan.com/public_html/Sources/ManageSettings.php(145): call_helper() #6 /home2/tfcclanc/domains/tfc-clan.com/public_html/Sources/Admin.php(500): ModifyModSettings() #7 /home2/tfcclanc/domains/tfc-clan.com/public_html/index.php(191): AdminMain() #8 {main} thrown in /home2/tfcclanc/domains/tfc-clan.com/public_html/Sources/CustomForm/ManageCustomForm.php on line 520
Title: Re: Custom Form Mod
Post by: live627 on April 03, 2023, 07:46:05 PM
That's a fatal error? Odd... I thought that it was supposed to only be a harmless deprecation notice. Anyway, the fix is simple

$invalid = preg_match('/[^a-zA-Z0-9\-_.]/', $data['title']);

Replace with

$invalid = preg_match('/[^a-zA-Z0-9\-_.]/', $data['title'] ?? '');
Title: Re: Custom Form Mod
Post by: PANIC12 on April 03, 2023, 08:21:14 PM
Done, now this is the error i get.

Fatal error: Uncaught TypeError: strtr(): Argument #1 ($string) must be of type string, null given in /home2/tfcclanc/domains/tfc-clan.com/public_html/Sources/CustomForm/ManageCustomForm.php:831 Stack trace: #0 /home2/tfcclanc/domains/tfc-clan.com/public_html/Sources/CustomForm/ManageCustomForm.php(831): strtr() #1 /home2/tfcclanc/domains/tfc-clan.com/public_html/Sources/Subs-List.php(132): CustomForm\ManageCustomForm->list_customform_fields() #2 /home2/tfcclanc/domains/tfc-clan.com/public_html/Sources/CustomForm/ManageCustomForm.php(309): createList() #3 [internal function]: CustomForm\ManageCustomForm->EditForm() #4 /home2/tfcclanc/domains/tfc-clan.com/public_html/Sources/CustomForm/ManageCustomForm.php(66): call_user_func() #5 /home2/tfcclanc/domains/tfc-clan.com/public_html/Sources/CustomForm/ManageCustomForm.php(74): CustomForm\ManageCustomForm->__construct() #6 /home2/tfcclanc/domains/tfc-clan.com/public_html/Sources/Subs.php(6028): CustomForm\ManageCustomForm::create() #7 /home2/tfcclanc/domains/tfc-clan.com/public_html/Sources/ManageSettings.php(145): call_helper() #8 /home2/tfcclanc/domains/tfc-clan.com/public_html/Sources/Admin.php(500): ModifyModSettings() #9 /home2/tfcclanc/domains/tfc-clan.com/public_html/index.php(191): AdminMain() #10 {main} thrown in /home2/tfcclanc/domains/tfc-clan.com/public_html/Sources/CustomForm/ManageCustomForm.php on line 831
Title: Re: Custom Form Mod
Post by: live627 on April 04, 2023, 03:30:03 AM
I looked into this a bit more and realized that fixing this would require database changes rather than playing whack-a-mole, chasing random bugs. I've released v4.0.3 to fix this.

Once the scheduled task to fetch admin info/simple machines files runs, a prompt will appear telling that a new version is available.


You cannot view this attachment.

You cannot view this attachment.

Updates can be applied without removing the existing version.
Title: Re: Custom Form Mod
Post by: PANIC12 on April 04, 2023, 08:03:19 PM
thank you @live627! Unfortunately I'm still getting an error. The page loads when I go to add a field, but I get this error when trying to save:

2: Undefined array key "field_text"
The database value you're trying to insert does not exist: text
Function: SaveField
Title: Re: Custom Form Mod
Post by: sardonick007 on May 01, 2023, 05:10:13 PM
I am getting The database value you're trying to insert does not exist: board_id after installing custom form mod 4x on smf 2.1.3 using php 8
I am completely lost and could use a hand...
Title: Re: Custom Form Mod
Post by: sardonick007 on May 02, 2023, 12:58:28 AM
I just installed on smf 2.1.3 and every time I click "Add New Field" I get the error Field 'text' doesn't have a default value
File: public_html/comm/Sources/CustomForm/ManageCustomForm.php
Line: 924

In phpmyadmin I found the fields and entered default values, but they are not allowed to have default values, so that doesn't help anything.

I cannot see an "update" to 4.03 or 4.04 (or any version) in the mod page in the forum.
Title: Re: Custom Form Mod
Post by: AniTr on November 04, 2023, 12:43:58 PM
Can we add SCEditor to textarea contents? To enter more attractive content in forms?
Title: Re: Custom Form Mod
Post by: AniTr on November 04, 2023, 01:58:44 PM

I did. ^.^
Title: Re: Custom Form Mod
Post by: erich199 on November 23, 2023, 10:09:55 PM
Love this, great job.

Curious if it's possible in the future to be able to restrict each form based on usergroups?

As I understand now, if you allow guest access they have access to all forms.
Title: Re: Custom Form Mod
Post by: live627 on November 25, 2023, 03:05:14 AM
Each form has its own permissions.
Title: Re: Custom Form Mod
Post by: erich199 on November 26, 2023, 12:10:16 AM
Quote from: live627 on November 25, 2023, 03:05:14 AMEach form has its own permissions.

I realized my own stupidity after I made that post. Sorry about that!
Title: Re: Custom Form Mod
Post by: durangod on December 12, 2023, 01:02:18 PM
Hi,  so this can be used as a "show your rig" form to allow users to input their computer specs to share with others. Or a "show your environment" form to allow users to share their hosting specs like php version, apache version, mysql version and so on.... ?

If so, i assume it works off of custom fields that i create in the native SMF admin or does it allow me to create the fields on the form itself?

Can it show on their profile or is it just as a post topic?
Title: Re: Custom Form Mod
Post by: Diego Andrés on December 12, 2023, 01:43:00 PM
It does have its own custom fields afaik.
This doesn't add anything to profiles, just posts topics.
Title: Re: Custom Form Mod
Post by: Kindred on December 12, 2023, 02:18:34 PM
Quote from: durangod on December 12, 2023, 01:02:18 PMHi,  so this can be used as a "show your rig" form to allow users to input their computer specs to share with others. Or a "show your environment" form to allow users to share their hosting specs like php version, apache version, mysql version and so on.... ?

If so, i assume it works off of custom fields that i create in the native SMF admin or does it allow me to create the fields on the form itself?

Can it show on their profile or is it just as a post topic?


Custom Profile fields have been part of SMF since 2.0.0 - no mod needed.
Title: Re: Custom Form Mod
Post by: live627 on December 12, 2023, 03:26:38 PM
Only as a new topic
Title: Re: Custom Form Mod
Post by: StarredSkies on December 12, 2023, 03:42:39 PM
Hello! Diego sent me here from this request (https://www.simplemachines.org/community/index.php?topic=587693.0). I am looking for a replacement mod for Post Templates (https://www.smfsimple.com/index.php?topic=10874.0) by SMFSimple. With your custom template function, would it function similarly?
Title: Re: Custom Form Mod
Post by: live627 on December 12, 2023, 09:31:59 PM
This does seem to be similar to [[mod:Post Templates]] in that it allows to make structured posts, but only admin can make templates and it does not integrate into the posting page. The custom template function exists for rearranging the input boxes in action=form;n=<ID>
Title: Re: Custom Form Mod
Post by: StarredSkies on December 12, 2023, 09:37:13 PM
Gotcha. I wasn't sure. Thank you for clarifying!

If you ever add the ability to do either of those, that'd be an awesome idea to include.

I'll keep this in mind.
Title: Re: Custom Form Mod
Post by: Kindred on December 13, 2023, 06:09:02 AM
Doesn't this mod also let the admin configure the post output of the form entries?
Title: Re: Custom Form Mod
Post by: live627 on December 13, 2023, 05:38:52 PM
Yes–but is diffderent than specifying a custom template function.
Title: Re: Custom Form Mod
Post by: Mzr on January 25, 2024, 04:22:42 AM
Hi all,

Is it possible to activate the form for the topic reply ?
Title: Re: Custom Form Mod
Post by: Kindred on January 25, 2024, 08:43:31 AM
No... the form is a completely separate URL. It's not part of the post/response flow.