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

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Smythe

Quote from: Smythe on March 25, 2015, 11:21:24 PM
Getting error message....


The database value you're trying to insert does not exist: subject

I wasnt getting the message previously, but after I created a new form ... this is all I get...
Tells me the error lies at line 1817 of the code from Sub-Post.php

Error from Admin logs:


Apply Filter: Only show the error messages of this URL
http://mywebsite.com/index.php?action=form;n=1;submit;
Apply Filter: Only show the errors with the same message
The database value you're trying to insert does not exist: subject
Function: createPost
Apply Filter: Only show the errors from this file
File: C:///Sources/Subs-Post.php
Line: 1817


1803   // Insert the post.
1804 $smcFunc['db_insert']('',
1805 '{db_prefix}messages',
1806 array(
1807 'id_board' => 'int', 'id_topic' => 'int', 'id_member' => 'int', 'subject' => 'string-255', 'body' => (!empty($modSettings['max_messageLength']) && $modSettings['max_messageLength'] > 65534 ? 'string-' . $modSettings['max_messageLength'] : 'string-65534'),
1808 'poster_name' => 'string-255', 'poster_email' => 'string-255', 'poster_time' => 'int', 'poster_ip' => 'string-255',
1809 'smileys_enabled' => 'int', 'modified_name' => 'string', 'icon' => 'string-16', 'approved' => 'int',
1810 ),
1811 array(
1812 $topicOptions['board'], $topicOptions['id'], $posterOptions['id'], $msgOptions['subject'], $msgOptions['body'],
1813 $posterOptions['name'], $posterOptions['email'], time(), $posterOptions['ip'],
1814 $msgOptions['smileys_enabled'] ? 1 : 0, '', $msgOptions['icon'], $msgOptions['approved'],
1815 ),
1816 array('id_msg')
1817 );
1818 $msgOptions['id'] = $smcFunc['db_insert_id']('{db_prefix}messages', 'id_msg');
1819
1820 // Something went wrong creating the message...
1821 if (empty($msgOptions['id']))
1822 return false;


any help is greatly appreciated....


after looking I also see the following error message in the logs of the admin section

http://mywebsite.com/index.php?action=form;n=1;submit;
Apply Filter: Only show the errors with the same message
2: preg_replace_callback(): Unknown modifier 'T'
Apply Filter: Only show the errors from this file
File: C:///Sources/CustomForm.php
Line: 287
Line: 288
Line: 291
Line: 292


277                    // Do we have completly valid field data?
278 if(!$fail_submit)
279 {
280 require_once($sourcedir.'/Subs-Post.php');
281
282                //    {{ }} Syntax: Strip out everything in {{ }} if value is blank
283                $output = preg_replace($vars_blank, '', $output);
284                $subject = preg_replace($vars_blank, '', $subject);
285
286                //    {{ }} Syntax: Remove outside brackets if value is not blank
287                $output = preg_replace_callback($vars_non_blank, create_function('$matches','return substr($matches[0],1,-1);'), $output);
288                $subject = preg_replace_callback($vars_non_blank, create_function('$matches','return substr($matches[0],1,-1);'), $subject);
289
290 // Replace all vars with their correct value, for both the message and the subject.
291 $output = preg_replace($vars, $replace, $output);
292 $subject = preg_replace($vars, $replace, $subject);


Any suggestions regarding this post ???

maloneya121

Amazing mod... jus have a huge problem. I cant view the forms at all. I can goto the lists, but when i click view nothing happens. Also when i goto index.php?action=form;n=1 (the id is right) it just redirects back to the view page......

BTW im new to smf so any trubble shooting advise would be appreciated if it was in like the simplest terms

Kindred

Are you using prettyurls? or any sort of htaccess redirects/rewrites?


does your host have mod_security active?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

maloneya121

Not seeing any mod_security and no i dont have any of that installed

residualfuture

Quote from: maddoghalo on August 31, 2012, 04:47:44 PM
When somebody posts the forums, how do I get the thread title to include their forum username?

I use to be able to do it but forgot how. When they click submit it makes a new thread and is says for example: Maddoghalo's Application.

Has anyone ever figured this out? I myself used to have it display the {username} in the subject prior to my webhost having a major hard drive failure.

Now that I am rebuilding I cannot figure out how to get the {username} to show in the subject anymore.

Biology Forums

Anyone else notice that when using characters like ' (apostrophe) in gives out a major error and tries to escape them with \ ???

neenx

Hey, love this mod. Been using it for years as a guild application tool for new recruits.

Quick question though. Is there a way to make the form reply to a specific thread instead of making a brand new thread?

Like if I had a thread stickied and every time someone hit submit on the form, a reply would post to that thread with the same formatting.

Also if this mod isn't capable of doing that; can someone point me to a mod that can?

Thanks

-Neenx

margarett

That should be doable, yes, and it should be more or less easy on the back-end.
The problem is to redesign the front-end so that it accommodates both board and topic IDs.

Do you have just ONE custom form?
If so, you can try this (backup because I didn't test it :P )
Find (CustomForm.php)
$topicOptions = array(
'id' => 0,
'board' => $board,
'mark_as_read' => true,
);

see that 'id' => 0, ?
Just replace that "0" with your desired topic ID
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

neenx

What if I have more than one custom form? Like my first form I want to create a new thread on a board, and my second form I want to reply to a specific thread.

Kindred

Then it becomes much mor complicated...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Jailer

Quote from: cann0nf0der on November 05, 2014, 04:08:10 PM
I have followed all the readme directions and searched this topic but cannot find an answer to the following issue.

When I click on add new form I get this error


Database Error
Field 'title' doesn't have a default value
File: D:\WWW\classforum\Sources\ManageSettings.php
Line: 2523

Any one have any solution to this?

Regards

I'm getting this same error and can't create a new form.

Proderf

I believe I have installed he mod correctly (long story), but when i go to index.php?action=forms, It brings me to the home screen. Can anyone help?



Edit: The mod doesn't show up in the package manager (browse packages), but it shows up in Installed Packages.

Kindred

either a- you have not installed the mod correctly, b- you have some sort of htaccess redirect going on (like prettyurls?) or c- your host has mod_security installed and misconfigured.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Proderf

I have access to make forms and shniz like that, But ya.


Pretty much my friend tried to uninstall the mod by deleting the packages (not editing the file modifications), and that lead to the mod not being able to be uninstalled through the forms, but me manually going to each file and taking out the code.

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Proderf

Ok, i got it to show up in the package manager now, and everything seems to be working, be the index.php?action=form is still bringing me home.


PS: I uninstalled the mod from the installed mods tab, and then reinstalled it though the package server. I still had my "View Form Title" and "View Form Text" as i set it before the uninstall, but don't have the 1 form I made.

Proderf


margarett

Quote from: neenx on June 20, 2015, 09:07:30 PM
What if I have more than one custom form? Like my first form I want to create a new thread on a board, and my second form I want to reply to a specific thread.
A conditional in the 'id' line should do the trick. Eg, if current form is "xx" then id 0 --> new topic. else id = topic_id
Not exactly sure about the code to do it because I'm not that familiar with this MOD but I can look into it if required ;)

@Jailer: http://www.simplemachines.org/community/index.php?topic=248871.msg2782810#msg2782810
Does this help?
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Proderf

OK, so now everything is working just fine, except now when I create a form, it doesn't show up at ?action=form, though the Form Title and Text both do.

Advertisement: