The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 909 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1370 fetch_forum_permissions
/printthread.php 76 forum_permissions
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
Global Pre-Parse? - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1)
+--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5)
+--- Thread: Global Pre-Parse? (/showthread.php?tid=2074)



Global Pre-Parse? - marcat - Aug 3rd, 2012

I have installed and am using the Pre-Parse module and it works well on a per form basis. However, I would like to implement a Pre-Parse script globally so that any form posted to my instance of FT has to pass through a single pre-parse script first and then any other pre-parse script that may be defined for that particular form.
What are my options for doing this?


RE: Global Pre-Parse? - marcat - Aug 7th, 2012

Did a bit of poking around an found the smarty function that builds the select list for which form the pre-parse script is for. That file is /global/smarty/plugins/function.forms_dropdown.php
The add.tpl, edit.tpl and index.tpl functions call this function to build the select list.
In these files the function itself is called with this parameter: is_multiple=true.
However, within the function it appears that this option is tested for true or false, but never implemented? Is there a reason why multiple="multiple" shouldn't be set for this select list in the pre-parser module?
The comment says "// for multiple-select dropdowns" but I can not see where that html attribute ever gets set?


RE: Global Pre-Parse? - fixed - marcat - Aug 8th, 2012

I decided to take matters into my own hands to solve this issue and as it turns out, was fairly simple to accomplish. Because there was already code in /global/smarty/plugins/function.forms_dropdown.php setting a boolean for is_multiple I decided to take the path of least resistance and simply add the missing parameter the select list rendered on the pre-parser page was missing.
Here's the 1 line of code I added to the forms_dropdown function:
if ($is_multiple){ $attribute_str = $attribute_str . " multiple=\"multiple\""; }

This code was added just before this line:
$html = "<select $attribute_str>" . join("\n", $options) . "</select>";

So, I am just using the existing $is_multiple to decide whether the function should add the multiple="multiple" parameter to the select list. I believe this was the intended purpose of that boolean variable in the first place and Ben just probably forgot to add that little bit of code to actually set the parameter?

What ever the case, I can now associate as many forms as I want with a single pre-parse script, which accomplishes my goal of being able to assign a single pre-parse script globally...


RE: Global Pre-Parse? - daz1034 - Aug 14th, 2012

umm interesting will have a go my self

thanks for this mate


RE: Global Pre-Parse? - russellfeeed - Aug 4th, 2014

@marcat:

Thanks! I arrived at the same conclusion and your fix works.