News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Custom Form Mod

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

Previous topic - Next topic

Gamez

#240
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...  :-\

Nathaniel

@Gamez,
Which page do you get the 'Hacking Attempt' message on?
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.

Gamez

#242
LHVWB, I get the message upon submitting a form( obviously, with no required fields).
more specifically "/index.php?action=form;id=2;submit;"

bbates7995

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?

Nathaniel

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

MrGoodbar

@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

Nathaniel

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

MrGoodbar

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. 

neich

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.

Nathaniel

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

neich

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.

Nathaniel

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

Axodious

I feel like a cat who is having a catnip covered toy dangled just out of my reach.  :(
"You make my heart pound; my mouth water. Yeah, there's nothing like a chili dog." Sonic the Hedgehog

Nathaniel

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

tk2012

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?

Nathaniel

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

tk2012

Thanks... that slipped by me there.  I noticed the words custom form and not cat rules... sorry and thanks!


Nathaniel

@NIBOGO,
You have to add them as a list separated by ',' commas, to the 'Extra Type Parameters' setting for that field.
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.


Advertisement: