The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 783 errorHandler->error
/showthread.php 26 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 783 errorHandler->error
/showthread.php 26 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/showthread.php 26 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 909 errorHandler->error
/showthread.php 26 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/showthread.php 26 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/showthread.php 26 require_once
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1370 fetch_forum_permissions
/showthread.php 137 forum_permissions
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
Warning [2] Undefined array key "mybb" - Line: 1952 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1952 errorHandler->error
/inc/functions_indicators.php 41 my_set_array_cookie
/showthread.php 629 mark_thread_read
Warning [2] Undefined property: MyLanguage::$ratings_update_error - Line: 5 - File: showthread.php(732) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/showthread.php(732) : eval()'d code 5 errorHandler->error
/showthread.php 732 eval
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions_user.php 844 is_member
/inc/functions_post.php 406 purgespammer_show
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "profilefield" - Line: 6 - File: inc/functions_post.php(474) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(474) : eval()'d code 6 errorHandler->error
/inc/functions_post.php 474 eval
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "canonlyreplyownthreads" - Line: 660 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 660 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "showimages" - Line: 741 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 741 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "showvideos" - Line: 746 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 746 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions_user.php 844 is_member
/inc/functions_post.php 406 purgespammer_show
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "profilefield" - Line: 6 - File: inc/functions_post.php(474) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(474) : eval()'d code 6 errorHandler->error
/inc/functions_post.php 474 eval
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "canonlyreplyownthreads" - Line: 660 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 660 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "showimages" - Line: 741 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 741 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "showvideos" - Line: 746 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 746 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions_user.php 844 is_member
/inc/functions_post.php 406 purgespammer_show
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "profilefield" - Line: 6 - File: inc/functions_post.php(474) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(474) : eval()'d code 6 errorHandler->error
/inc/functions_post.php 474 eval
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "canonlyreplyownthreads" - Line: 660 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 660 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "showimages" - Line: 741 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 741 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "showvideos" - Line: 746 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 746 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions_user.php 844 is_member
/inc/functions_post.php 406 purgespammer_show
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "profilefield" - Line: 6 - File: inc/functions_post.php(474) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(474) : eval()'d code 6 errorHandler->error
/inc/functions_post.php 474 eval
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "canonlyreplyownthreads" - Line: 660 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 660 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "showimages" - Line: 741 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 741 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "showvideos" - Line: 746 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 746 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "invisible" - Line: 1506 - File: showthread.php PHP 8.1.27 (Linux)
File Line Function
/showthread.php 1506 errorHandler->error
Warning [2] Undefined variable $threadnotesbox - Line: 30 - File: showthread.php(1533) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/showthread.php(1533) : eval()'d code 30 errorHandler->error
/showthread.php 1533 eval
Warning [2] Undefined variable $addremovesubscription - Line: 79 - File: showthread.php(1533) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/showthread.php(1533) : eval()'d code 79 errorHandler->error
/showthread.php 1533 eval



FORUMS


The Form Tools forums are no longer active, but the old posts have been archived here. Please see the Help page on how to get help / report issues.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dublicate Form Entry
#1
Hello everyone,
I'm building forms were I have a lot of similar Fields. Basically only the label varies.

I already did some research and test programming. First thing I did was look at the mysql database and tried to figure out a solution here. To copy an entry of a form with all its properties four tables are involved (if I'm correct)

form_fields table has most of the properties of a new form field here we add a new entry:
Code:
INSERT INTO `form_fields` (`field_id`, `form_id`, `field_name`, `field_test_value`, `field_size`, `field_type_id`, `is_system_field`, `data_type`, `field_title`, `col_name`, `list_order`, `is_new_sort_group`, `include_on_redirect`) VALUES
(NULL, NR, new, '1', '1char', 14, 'no', 'string', NAME, new, NULL, 'yes', 'no');

form_NR table consists of all the submissions of a form. I'm not interested in them, but the colums are the same as the col_name row in form_fields. So a new column is added:
Code:
ALTER TABLE form_NR ADD new varchar(1) DEFAULT NULL;

field_settings table holds information for option lists (which I want to use)
Code:
SELECT @id := `field_id` FROM `form_fields` WHERE `col_name` = new;
INSERT INTO `field_settings` (`field_id`, `setting_id`, `setting_value`) VALUES
(@id, 45, '1');

field_validation table: here we do the same as for field_settings, just for the validation settings.

This sql code works but its obviously not very comfortable and doesn't check for any errors that may occur in between. All the values have to be changed by hand.

A better solution would be to use the Smarty commands provided by formtools and hook them in the admin_edit_form_fields_tab. I'm just not very familiar with how to use these (ft_commands).

I think it could be quite easy to retrieve all the needed information in this tab and create a field copy from there.

Could you just tell me the ruff order of commands to build and fill a new field?
Maybe there is a cleverer solution for this?
Reply
#2
Hi leob,

I'm not sure I understand what you 'd like to achieve. Is it that you want to make clones of the same form that you can, then, modify (as much or as little as needed)?

If so, the easiest way to do that may be to install and use the Form Backup extension (http://modules.formtools.org/form_backup/).

BTW, the data of each form are stored in the table ft_form_X, where X is the number of the form (e.g., 1 if you have a single form), in case you may want to quicly erase all the data held in a form prior to modifying it.

I hope that helps!




(Apr 2nd, 2015, 4:35 AM)leob Wrote: Hello everyone,
I'm building forms were I have a lot of similar Fields. Basically only the label varies.

I already did some research and test programming. First thing I did was look at the mysql database and tried to figure out a solution here. To copy an entry of a form with all its properties four tables are involved (if I'm correct)

form_fields table has most of the properties of a new form field here we add a new entry:
Code:
INSERT INTO `form_fields` (`field_id`, `form_id`, `field_name`, `field_test_value`, `field_size`, `field_type_id`, `is_system_field`, `data_type`, `field_title`, `col_name`, `list_order`, `is_new_sort_group`, `include_on_redirect`) VALUES
(NULL, NR, new, '1', '1char', 14, 'no', 'string', NAME, new, NULL, 'yes', 'no');

form_NR table consists of all the submissions of a form. I'm not interested in them, but the colums are the same as the col_name row in form_fields. So a new column is added:
Code:
ALTER TABLE form_NR ADD new varchar(1) DEFAULT NULL;

field_settings table holds information for option lists (which I want to use)
Code:
SELECT @id := `field_id` FROM `form_fields` WHERE `col_name` = new;
INSERT INTO `field_settings` (`field_id`, `setting_id`, `setting_value`) VALUES
(@id, 45, '1');

field_validation table: here we do the same as for field_settings, just for the validation settings.

This sql code works but its obviously not very comfortable and doesn't check for any errors that may occur in between. All the values have to be changed by hand.

A better solution would be to use the Smarty commands provided by formtools and hook them in the admin_edit_form_fields_tab. I'm just not very familiar with how to use these (ft_commands).

I think it could be quite easy to retrieve all the needed information in this tab and create a field copy from there.

Could you just tell me the ruff order of commands to build and fill a new field?
Maybe there is a cleverer solution for this?
Reply
#3
Hey garof,

thank you for your answer. I'm trying to do something different. Me and some friends like to bet/tip on sports. Till now I had an excel document calculating the points everybody gets etc. The tips I had to collect via mail and fill them in manually.

So now I'm building forms to collect the data. These forms consist of dropdown fields that are 'required'. Only the label or name of the field changes. (name of the game, home and away team)

What I'm trying to do is to create a bunch of the same fields in a form, with the mentioned properties already selected.

I know the programming I'm doing here probably cost me a lot more time compared to just building the forms by hand, but I like scripting and finding easy/elegant solutions.
Reply
#4
(Apr 7th, 2015, 12:33 AM)leob Wrote: Hey garof,

thank you for your answer. I'm trying to do something different. Me and some friends like to bet/tip on sports. Till now I had an excel document calculating the points everybody gets etc. The tips I had to collect via mail and fill them in manually.

So now I'm building forms to collect the data. These forms consist of dropdown fields that are 'required'. Only the label or name of the field changes. (name of the game, home and away team)

What I'm trying to do is to create a bunch of the same fields in a form, with the mentioned properties already selected.

I know the programming I'm doing here probably cost me a lot more time compared to just building the forms by hand, but I like scripting and finding easy/elegant solutions.

You can play almost all the games in your running shoes but some of that can't be played in running shoes such as basketball. basketballshoesplus if you want to buy basketball shoes at affordable prices with all of the best qualities.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)