News:

Wondering if this will always be free?  See why free is better.

Main Menu

Custom Form Mod

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

Previous topic - Next topic

Flammifer

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

Garou

Attachments are on the list and I hope to get to it within the next couple updates.

bros

Yay. This works on SMF 2 RC2 almost perfectly (errors on Help.Template, I believe)

king kratos

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

C4G-TK

#924
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'],

-img removed-

Garou

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

king kratos

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

C4G-TK

Ok, will do that.

I didn't perform an upgrade though.  I installed a RC2 test site from the download site.

-img removed-

MarcusJ

I just installed this mod today.  It worked the first try, is easy to use and very robust.  Thank you to the authors!

zushiba

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

Garou

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

zushiba


Garou

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.

zushiba

I removed the extra code but I'm still getting the same error.

Garou

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.

zushiba

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*

Garou

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.

zushiba

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.

Garou

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

Illori

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.

Advertisement: