If you need to use different values for the KTML global options throughout your site, and not replace any of the code added on the page by the extension, in order to make sure the Server Behavior remains editable, here's the steps you have to take:
In the includes.ktm/ktml4.xxx file, locate the line of code that calls for the ktml4.config.xxx file.
Note: replace xxx with the actual file extension required by your particular server model: php, cfm, asp
The code line to locate is different based on the server model, looking similar to:
For PHP:
$KTML_CMN_uploadFileList = array(
'ktml4.config.php',
For ASP:
KT_LoadASPFiles Array("includes/common/lib/shell/KT_Shell.asp" ,
"includes/common/lib/folder/KT_Folder.asp" ,
"includes/common/lib/file/KT_File.asp" ,
"includes/common/lib/file_upload/KT_FileUpload.asp" ,
"includes/common/lib/image/KT_Image.asp" ,
"includes/ktm/ktml4.config.asp",
For ColdFusion:
<cfset ArrayAppend(KTML_CMN_uploadFileList, "ktml4.config.cfm")>
Replace the string that is added into the array by these lines with a variable name - myconfigfile. The new code bits should look like the following:
For PHP:
$KTML_CMN_uploadFileList = array(
$myconfigfile,
For ASPVBScript:
KT_LoadASPFiles Array("includes/common/lib/shell/KT_Shell.asp" ,
"includes/common/lib/folder/KT_Folder.asp" ,
"includes/common/lib/file/KT_File.asp" ,
"includes/common/lib/file_upload/KT_FileUpload.asp" ,
"includes/common/lib/image/KT_Image.asp" ,
myconfigfile,
For ColdFusion:
<cfset ArrayAppend(KTML_CMN_uploadFileList, myconfigfile)>
The last thing you have to do is define what value will this variable have. To do so, you will have to add a code block that checks for an existing configuration value and sets the variable accordingly. If a value does not exist, the default file will be laoded. Add the following code on top of the ktml4.xx file:
For PHP:
if(isset($configFile) && $configFile != "") {
$myconfigfile = $configFile;
} else {
$myconfigfile = "ktml4.config.php"
}
For ASPVBScript:
if (configFile != "" ) Then
myconfigfile = configFile
Else
myconfigfile = "ktml4.config.asp"
End if
For ColdFusion:
<cfif isDefined("configFile") AND configFile NEQ "">
<cfset myconfigfile = configFile>
<cfelse>
<cfset myconfigfile = "ktml4.config.cfm">
</cfif>
Note that this approach assumes that you will create the custom configuration files in the same folder as the original ktml4.config.xxx file. Save the ktml4.xx file that you modified.
On the page that you want to have a different set of configuration settings for KTML, add this line on top of the page, before the code that includes the ktml4.xxx file:
For PHP:
<?php
$configFile = "name_of_the_config_file";
?>
For ASPVBScript:
<%
configFile = "name_of_the_config_file"
%>
For ColdFusion
<cfset configFile = "name_of_the_config_file">
Note: Replace name_of_the_config_file with the actual name of the file with settings that you wish to load. Keep the quotes.
Save the file and upload it in the browser. The particular settings will be loaded from the desired file.
You do not need to change anything else in order for the different configurations to work.