Custom Form Mod

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

Previous topic - Next topic

Paracelsus

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?

Nathaniel

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

SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

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

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

Paracelsus

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

Nathaniel

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

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. ;)
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

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

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

Lady Night Owl

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
Running SMF 2.0.1

nopity4u

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

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

Gryphoune

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


Gryphoune

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.


Nathaniel

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.
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

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

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

Gryphoune

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?

Nathaniel

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.
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

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

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

Gryphoune

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.

tlknowles

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  [ emptyBecause 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

Current Installation
SMF 1.1.4 >> SMF 1.1.5 ( Default Theme )

tlknowles

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
Current Installation
SMF 1.1.4 >> SMF 1.1.5 ( Default Theme )

Nathaniel

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. :)
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

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

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

Marduke

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.

4b11l

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

Marduke

Ah! HTML works!

And yes, I agree.  Would be cool to just put text in.

Nathaniel

@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?
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

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

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

4b11l

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.

Advertisement: