Custom Form Mod

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

Previous topic - Next topic

DBAllTerrain

Quote from: teos55 on April 12, 2012, 04:21:02 PM
SMF 2.0.2 Simple portal 2.3.5  default theme

installed the mod.  Modified modification.mylanguage-utf8.php  for local language

created the fields to be used in the form.

When I press submit/save button, nothing created in the specified category.

error log :

"http: // mysite . org/index.php?action=admin;area=modsettings;sa=customform;form_id=1;8: Undefined variable: board
file: /home/user/public_html/Sources/ManageSettings.php
Satır: 2513"


lines around 2513 are :

$context['categories'][$row['id_cat']]['boards'][] = array(
            'id' => $row['id_board'],
            'name' => strip_tags($row['name']),
            'category' => strip_tags($row['cat_name']),
            'child_level' => $row['child_level'],
            'selected' => !empty($_SESSION['move_to_topic']) && $_SESSION['move_to_topic'] == $row['id_board'] && $row['id_board'] != $board,
         );


Any guidance will be highly appreciated.


nb.
When I execute  www. mysite . com/index.php?action=form;n=1

I see the form and can fill in .  when I press save, the topic is created.  The format of the output is not user friendly tough.
I mean all inputs stacked line by line .

Still the "undefined variable: board" seems an issue

OK I got it...  How it works is well explaned in hxxp:smf.balancegames.org/mods/forms/tutorial/create. [nonactive]

A really lazy reader of such manuals .. Shame

Undefined variable borad is still an issue .....
I just now noticed this same error about the 'board' variable getting logged whenever I went to the custom forms setup page. Took a look through the ManageSettings.php and CustomForm.template.php files and can't see that the ['categories']['id_cat']['boards']['selected'] variable is even being used anywhere. CustomForm.template.php uses another check to see if that particular board should be the selected one in the dropdown. So I removed the following line (which was 2398 for me; looks to be different in your file) in ManageSettings.php, which was:

'selected' => !empty($_SESSION['move_to_topic']) && $_SESSION['move_to_topic'] == $row['id_board'] && $row['id_board'] != $board,

Also removed the comma at the end of line above it. The forms still work just fine in SMF 2.0.3. Give it a try.

gatorfan59

Is there a way to modify the page I attached to this post? I want to change the black borders around the table and possibly the font color of the headings of the table. Any help would be great! Thank you.

DBAllTerrain

Quote from: gatorfan59 on January 05, 2013, 02:01:23 PM
Is there a way to modify the page I attached to this post? I want to change the black borders around the table and possibly the font color of the headings of the table. Any help would be great! Thank you.

Font color of titles relies on titlebg class in <theme>/css/index.css. Probably don't want to change it there. To change the color of "Title", "Board" and "View", look at your <theme>/CustomForm.template.php file. Add to the style= tags on lines 195, 196 and 197 the color: #f00, or whatever color you want them. The default style tag on line 195 looks like:

<td style="width:45%;" >' , $txt['title'] , '</td>

To make the word Title red, change it to:

<td style="width:45%; color: #f00;" >' , $txt['title'] , '</td>

Do the same for lines 196 and 197.

The black borders are actually caused by the table having a black background and the cell/row borders not having attributes set. To change the black border to another color, look at line 193 of CustomForm.template.php. Change the background-color: #000000 to another color, ie for red edging, change it to background-color: #f00. To get rid of the black edging altogether, tell the table to collapse the borders to nothing. This would mean changing line 193 from:

<table style="width:100%;background-color:#000000;" align="center">

to

<table style="width:100%;background-color:#000000;border-collapse: collapse;" align="center">

Good luck!

gatorfan59

Quote from: DBAllTerrain on January 05, 2013, 02:58:28 PM
Quote from: gatorfan59 on January 05, 2013, 02:01:23 PM
Is there a way to modify the page I attached to this post? I want to change the black borders around the table and possibly the font color of the headings of the table. Any help would be great! Thank you.

Font color of titles relies on titlebg class in <theme>/css/index.css. Probably don't want to change it there. To change the color of "Title", "Board" and "View", look at your <theme>/CustomForm.template.php file. Add to the style= tags on lines 195, 196 and 197 the color: #f00, or whatever color you want them. The default style tag on line 195 looks like:

<td style="width:45%;" >' , $txt['title'] , '</td>

To make the word Title red, change it to:

<td style="width:45%; color: #f00;" >' , $txt['title'] , '</td>

Do the same for lines 196 and 197.

The black borders are actually caused by the table having a black background and the cell/row borders not having attributes set. To change the black border to another color, look at line 193 of CustomForm.template.php. Change the background-color: #000000 to another color, ie for red edging, change it to background-color: #f00. To get rid of the black edging altogether, tell the table to collapse the borders to nothing. This would mean changing line 193 from:

<table style="width:100%;background-color:#000000;" align="center">

to

<table style="width:100%;background-color:#000000;border-collapse: collapse;" align="center">

Good luck!

This worked PERFECTLY! Thank you so much!

Raths Rants

Quote from: StormChaser83 on December 15, 2012, 05:56:55 PM
I installed this, but had no idea it was gonna be this difficult.

I'm wanting to create a Staff Application for my forum, but have no idea how. Can someone cook me up one?

Did you figure this one out ? If not I can help with it.

Thanks Raths Rants
The DDC Network
a lot of hard work goes into easy

Lucutious

Has anyone figured out how to have the form automatically link to the calendar as well?  There's 76 pages, I've searched and didn't find anything but I may have missed something.

Thanks in advance.

R[wc]BADFISH

anyway to right align text on the displayed form?

Raths Rants

Quote from: Lucutious on January 15, 2013, 03:10:26 PM
Has anyone figured out how to have the form automatically link to the calendar as well?  There's 76 pages, I've searched and didn't find anything but I may have missed something.

Thanks in advance.

I have always done this manually. When I was playing WoW we would post the weekly raid event via a form and then manually link it to the calender. Did this with guild member events once they were approved. As for an automatic way I have not see a way to do it but I am sure it can be done.
The DDC Network
a lot of hard work goes into easy

jstop

How do you redirect the form on submit. The form submits to a topic not accessible to everyone so they get an error, how do I redirect the form to another page (like a thank you page) so they don't get an error but it still post to the correct topic.

Can anyone help with this... I have done it before I just forgot how I did it.
Website admin for
-------------------------------------------------
http://bridgestonemotorcycleparts.com
http://www.6x6talk.com

Raths Rants

Quote from: jstop on January 16, 2013, 10:42:08 AM
How do you redirect the form on submit. The form submits to a topic not accessible to everyone so they get an error, how do I redirect the form to another page (like a thank you page) so they don't get an error but it still post to the correct topic.

Can anyone help with this... I have done it before I just forgot how I did it.

Under your form there is an option for "Submit Redirect". I normally put "forum" in this area. Once the form is submitted it will simply take them back to the top level of your forum.

QuoteThis setting allows you to select where the user is sent after the form is successfully completed.

You can enter the following options...

board: will redirect the user to the board where the form is posted (this is also the default if the field is left empty).
forum: will redirect the user to the Forum Index page.
form: will redirect the user to the list of forms available form them to fill out, if they have permission to view it.
thanks: will redirect the user to a simple page letting them know that form has been completed correctly and thanking them for completing the form.

forum, form, and thanks, are useful if the form posts to a board the user does not have access to view.

Alternatively you can also enter a URL like http://www.simplemachines.org and the user will be directed to that URL. This can be useful to redirect users to a custom thank you page, another specific form, a specific forum post, or anyplace else on the internet.
The DDC Network
a lot of hard work goes into easy

R[wc]BADFISH

Anyway to display a form field in subject of post from this mod? Were using this mod as a application form and would love to disgusting between multiple applications. I currently have the title set to "Application" but would love to add the person's name!

Hoodie

You can set one of the fields to display just as you do in the topic. It won't pull anything from the member automatically. What I do is have them put their in-game/character name into a field labeled "gamename". For the title of the thread I put "Application: {gamename}".

R[wc]BADFISH

Thanks hoodie... I was using the wrong field!

Tavsih

I am using Custom form for applications,apply for clan membership.I am using Auto respond mod too ,when someone posts application his post doesnt increase.And thats why Auto respond doesnt work .Where i can set that when someone save the form his post should be increased.

FragaCampos

This works for smf 1.1.x

Search in /Sources/CustomForm.php
$posterOptions = array(
               'id' => $user_info['id'],


substitute with
$posterOptions = array(
               'id' => $user_info['id'],
'update_post_count' => !$user_info['is_guest']



Tavsih

Quote from: FragaCampos on January 25, 2013, 05:52:43 PM
This works for smf 1.1.x

Search in /Sources/CustomForm.php
$posterOptions = array(
               'id' => $user_info['id'],


substitute with
$posterOptions = array(
               'id' => $user_info['id'],
'update_post_count' => !$user_info['is_guest']



This will work on smf 2.0.3?

FragaCampos

I didn't try yet. But I will very soon.

Tavsih

Tried it but not working  :-[

nick17

Can someone help me? I get this when I try to add a new form...


Database Error
constraint failed

File: /home/a9947902/public_html/Sources/ManageSettings.php
Line: 2583

FragaCampos

Well, I just tested it and it's working fine.

Quote from: Nadeem_ on February 01, 2013, 04:02:28 AM
Tried it but not working  :-[

Advertisement: