News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Custom Form Mod

Started by live627, July 09, 2008, 10:24:44 PM

Previous topic - Next topic

Garou

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


zushiba

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

Garou

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.

Baldur

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: hxxp:www.knightswhosayniguild.com/index.php?action=form [nonactive]

Any help would be great, thanks!

Garou

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

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



fivewinds

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



Currently Using SMF 1.1.8 & TP 0.9.8

Garou

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.

zushiba

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. 

Garou

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.

uni

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.

C4G-TK

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.

-img removed-

uni

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.

C4G-TK

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. 

-img removed-

n3ith

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 [nofollow]

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... :(

C4G-TK

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.

-img removed-

simpsonetti

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 ?


alfzer0

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

Garou

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.


alfzer0

#518
^ 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!

Wihl

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?

Advertisement: