News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Custom Form Mod

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

Previous topic - Next topic

allisondk

Garou> that would be awesome. Or at least if i could edit the text myself somewhere.... not that skilled in php though

Garou

This is a quick and dirty fix for people that have forms posting to boards that the user can not access. When a user completes a form this will redirect them to the forum rather then the post that is made.

./Sources/CustomForm.php
Find...
// Redirect this user as well.
redirectexit('board=' . $board . '.0');


Replace With...
// Redirect this user as well.
redirectexit();


Note that this will effect all forms, hopefully in an upcoming version you will be able to chose where a particular form redirects.

mattchewone, most likely you have other mods installed that already changed the code that this mod is looking for. This happens a lot when installing multiple mods. Refer to the package parser on the download page for this mod to install the mod manually.  You might also want to check out the link in my sig referring to Manual installation of mods.

suicidehamster, I have been able to confirm this bug but I haven't found a fix for it yet. Soon as I figure it out Ill post here. In the meantime I suggest that you don't use the required parameter for multiline text boxes. Sorry I dont have a better answer yet.

willerby

Thanks Garou.

What is the redirectexit() to forward to a custom page where the full url is http://www.xxxxx/forum/index.php?action=page;sa=xxx ?

Thanks

W
What type of washing machine is September?

An autumnatic. :)

mattchewone

I installed it fine on my main site but i couldn't seem to get it to work, well not how i thought it was going to work.

I thought that you would create a form template for a specific board. The user clicks on the board and clicks new topic and then in order to post they need to use the form. That is how  i thought or would like it to work.

I have a review section and i would like all posts to be structured and in order to that a form would be fantastic. But it would need to be done in the way that when the user clicks create a topic it gives them the form to fill out. It then posts it as structured into that board. Users can still leave replies as usual.

allisondk

Thx Garou...
SUPER  ;D works like a charm.

Anyway i can get the "Large (Multiline) Text Box" to have scroll, or make it even bigger?

willerby

Quote from: willerby on May 07, 2009, 10:00:31 AM
Thanks Garou.

What is the redirectexit() to forward to a custom page where the full url is http://www.xxxxx/forum/index.php?action=page;sa=xxx ?

Thanks

W

Found it in the SMF help files...

To redirect to a specific custom page from the Custom Pages mod you can use

redirectexit('action=page;sa=xxx');

W
What type of washing machine is September?

An autumnatic. :)

tfs

I get one error on ./Sources/Admin.php

Find:
// Load the language and templates....
loadLanguage('Admin');
loadTemplate('Admin', 'admin');

Put After:
loadLanguage('Modifications');


Here's what's actually in Admin.php

   // Load the language and templates....
   loadLanguage('Admin');
   loadLanguage('SPortalAdmin', sp_languageSelect('SPortalAdmin'));
   loadTemplate('Admin', 'admin');


As you can see, it's broken by Simple Portal, but more importantly, when I try to install anyway I get the message...


Table 'db280860672.cf_forms' doesn't exist
File: /path/path/path/path/path/forum/Packages/temp/install.php
Line: 45


The install doesn't happen, and the package still shows as uninstalled in the package manager.
A good tree cannot bring forth evil fruit, neither can an evil tree bring forth good fruit.

Garou

mattchewone the closest thing I know of that comes to that is Thurnok's Pre-filled posts hack that's somewhere on Tiny Portal. You can get it to work without TP but it takes a little bit of work. Its what I was using before I found this mod.

What it essentially does is when a use creates a new topic in a certain board it opens up just like a regular post except that there is a bunch of information already written in the post box that the user can add to or modify. Its not a nice as the forms mod but it might suit your purposes.

allisondk and willerby, I'm glad the tip helped you out.  :)

allisondk, as far as the large text box goes, since I'm not the original author, I'm still learning all the ins and outs of this mod and PHP, so I'm not sure off hand. Ill add that to my very long to do list for the mod. :)

tfs, It looks like youve got two seperate problems the first is a bug in SMF 2.0 RC1, I'm guessing you had the mod installed at some point in the past and removed it. You have to manually drop the cf_forms and and cf_fields databases to re-install. If you were actively using the mod and were upgrading then you may want to back them up before deleting, reinstall the mod, then add the DBs back in. That way you wont lose any forms you have set up. Unfortunately there is no other way around it at this time and hopefully SMF will fix that in their next update.

As for the conflict with SP, the simple fix for now is to just to manually insert "loadLanguage('Modifications');" after "loadTemplate('Admin', 'admin');". Its a common problem when installing multiple mods in SMF that some mods cause conflicts with others and you occasionally have to manually install some or all of a mod that also use the same blocks of code to build on.

tfs

Quote from: Garou on May 07, 2009, 03:22:57 PMtfs, It looks like youve got two seperate problems the first is a bug in SMF 2.0 RC1, I'm guessing you had the mod installed at some point in the past and removed it. You have to manually drop the cf_forms and and cf_fields databases to re-install. If you were actively using the mod and were upgrading then you may want to back them up before deleting, reinstall the mod, then add the DBs back in. That way you wont lose any forms you have set up. Unfortunately there is no other way around it at this time and hopefully SMF will fix that in their next update.

As for the conflict with SP, the simple fix for now is to just to manually insert "loadLanguage('Modifications');" after "loadTemplate('Admin', 'admin');". Its a common problem when installing multiple mods in SMF that some mods cause conflicts with others and you occasionally have to manually install some or all of a mod that also use the same blocks of code to build on.

Thanks for the feedback.  I figured out that it was the two tables that already existed from when I tried to install this yesterday and couldn't get it to work.  So I dropped the two tables and tried again, but unfortunately I ran into the same problem I had yesterday.  Let me describe what happens.

I install the mod and it says that there's...

2.    Add After    ./Sources/Admin.php    Test failed

No big deal.  The Find and Add After values are listed in my previous post.  So I go through with the install and then make the edit to Admin.php, but then when I go to Admin/Modifications I get a screen full of PHP junk.  Basically it looks like an entire screen of unformatted PHP coding.  I went through the exact same steps today as I did yesterday, and each time I've had the same result.  I've tried "Empty the file cache" but it had no effect.

Now I'm wondering if your loadlanguage() call needs to go before the one that SimplePortal is making?  I can't think of anything else.
A good tree cannot bring forth evil fruit, neither can an evil tree bring forth good fruit.

Garou

That shouldn't be a problem Ive got it installed on two other sites the exact same way.  :-\

Just out of curiosity how does the page start out? It sounds like some bit of code is missing a close statement, probably just before where that code starts. The same thing will also happen if something is placed after a close php statement ?>.

tfs

Quote from: Garou on May 07, 2009, 06:14:00 PMJust out of curiosity how does the page start out? It sounds like some bit of code is missing a close statement, probably just before where that code starts. The same thing will also happen if something is placed after a close php statement ?>.

// Fucntion to handle the settings for the Custom Form Mod. function CustomFormSettings($return_config = false) { global $modSettings, $sourcedir, $txt, $scripturl, $context, $smcFunc; $config_vars = array(); // Get the id of the current element and sanitize it. if(isset($_GET['form_id'])) $form_id = (int) $_GET['form_id']; // Get the
A good tree cannot bring forth evil fruit, neither can an evil tree bring forth good fruit.

Enders

Is there a way to make forms posted into just 1 topic instead of making multiple topics.

Garou


amlucent

Quote from: Garou on December 31, 2008, 02:09:09 PM
Propaganistas I know nothing about gwBBCode and after a peek at it, the problem could easily be that it was never properly ported over for SMF. Someone just kinda hacked at it till they got most of what they wanted from it and then left it at that. I found a post on here about it asking for someone to make a real SMF mod out of it but it looks like no one ever did.

Essentially what your working with is a hack and not a mod, sometimes they work and sometimes they don't. 

I looked at your Subs-Post.php file and I cant find the error. Line 1542 doesn't look like its causing the problem and the code listed in the error isn't even in the file at all.

I think you might be better off taking the problem to someone more familiar with SMF and gwBBCode. They will most likely be able to spot something in the hack that I can not. Maybe someone else here might have more luck with it but I'm at a loss.

I am attempting to port gwbbcode to SMF.  Currently it is in the process of being approved.  I have a working package but I would appreciate any continued efforts helping me ensure that gwbbcode does not interfere with this mod (or any mod for that matter).  I ask because I am a novice coder... and I am going to get to work trying to solve this issue.

candidosa2

nice work
good mod when update dont forget portuguese and brazilian

Garou

amlucent, if it still has the issue with this mod after SMF approves it let me know.

candidosa2, thanks for the translations, we will get them in there. I always prefer human translations myself, Babelfish and Google aren't always correct.  :)

Enders

Instead of having forms making topics the whole time, maybe have its own page where you can approve it and view it in a category than the boards.

Garou

Enders, I doubt that will ever happen, the whole point of this mod is to create a pre-formated post with the data the user supplies.

If you don't want a post seen by the general public then have it posted to an admin only board, if you approve of it then move the post to a different board.  :)

yol

Quote from: Enders on May 08, 2009, 01:24:12 AM
Is there a way to make forms posted into just 1 topic instead of making multiple topics.

I need too this...

Thanks for this great work!
Istanbul is Istanbul ;-)

Garou

It is on the to do list but no promises on if or when it will  actually make it in a release. I doubt we will see anything soon though.

The original author is planning a complete rewrite of the mod and the rumor mill has it that the next major release of SMF is going to be making some significant changes to their code. Add to that my limited amount of time... I'm not really rushing to add a lot of new things to this right now.

Advertisement: