Custom Form Mod

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

Previous topic - Next topic

Garou

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.

king kratos

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

Mario

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

- = Orfeo = -

#903
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?

ɔɔɔɔɔɔuɥoɾ

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.


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

Garou

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.






king kratos

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

Garou

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

- = Orfeo = -

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

wladymeer

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.

king kratos

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

SAFAD

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
Best Regards
Sadaoui "SAFAD" Abderrahim - Lead Developer @ Electron Inc.

Largo_npc

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.

Garou

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.

Schuyler113

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.

king kratos

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

Garou

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.

Garou

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

king kratos

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

Garou

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

Advertisement: