Forum Replies Created

Viewing 15 replies - 1 through 15 (of 1,178 total)
  • Plugin Author nickboss

    (@nickboss)

    Go to Settings of the plugin in Dashboard. What is the value of User State Handler?

    In addition, do you have access to the error log of your web server? Maybe there is something recorded there. Some times a security module, called ModSecurity prevents the uploads.

    Nickolas

    Plugin Author nickboss

    (@nickboss)

    Hi, are you using any cache plugin?

    Regards

    Nickolas

    Plugin Author nickboss

    (@nickboss)

    Ok I got it. Edit the pages manually and delete the additional shortcodes.

    If you want to have two or more shortcodes in the same page, they need to have different plugin ID. If the visual editor does not work, you can change them manually. You need to add pluginid=”2″ or pluginid=”3″ (and so on) inside the shortcode.

    Then I suppose that Main page in Dashboard will display the instances correctly. If not, let me know.

    Nickolas

    Plugin Author nickboss

    (@nickboss)

    What are the titulal issues?

    Plugin Author nickboss

    (@nickboss)

    Hi, nothing changed in the plugin, in terms of database tables or format.

    Did you change anything in the website? like theme? do you use any page builder? these usually cause the plugin not to display the upload instances.

    This is probably why when you added an instance and you went to the target page it shows more than one shortcodes.

    Regards

    Nickolas

    Plugin Author nickboss

    (@nickboss)

    Try this one:

    function wfu_before_file_check_handler($changable_data, $additional_data) {
    	$filename = wfu_basename($changable_data['file_path']);
    	$filepath = wfu_basedir($changable_data['file_path']);
    	$fileext = wfu_fileext($changable_data['file_path], true);
    	$changable_data['file_path'] = $filepath.$changable_data['user_data'][0]['value'].'.'.$fileext;
    	return $changable_data;
    }

    Nickolas

    Plugin Author nickboss

    (@nickboss)

    Hi, yes you can do this using wfu_before_file_check filter. Here is an example script which uses the 2nd and 3rd userdata field (their inex is 1 and 2 respectively) to change the filename:

    if (!function_exists('wfu_before_file_check_handler')) {
    	function wfu_before_file_check_handler($changable_data, $additional_data) {
    		$filepath = wfu_basedir($changable_data["file_path"]);
    		$fileext = wfu_fileext($changable_data["file_path"], true);
    		$value1 = sanitize_file_name(trim($changable_data["user_data"][1]["value"]));
    		$value2 = sanitize_file_name(trim($changable_data["user_data"][2]["value"]));
    		if ( $value1 != "" && $value2 != "" )
    			$changable_data["file_path"] = $filepath.$value1."-".$value2."-".time().$fileext;
    		return $changable_data;
    	}
    	add_filter('wfu_before_file_check', 'wfu_before_file_check_handler', 10, 2); 
    }

    Regards

    Nickolas

    Plugin Author nickboss

    (@nickboss)

    Hi

    The plugin provides filters that run right after the upload. Here is a list of them.

    Check wfu_after_upload filter. You can set custom Javascript code inside $changable_data["js_script"] variable that will run right after the upload.

    You can add this filter inside functions.php file of your theme.

    Regards

    Nickolas

    • This reply was modified 1 month, 1 week ago by nickboss.
    Plugin Author nickboss

    (@nickboss)

    It can also be done in prestart check. The plugin has a wfu_before_upload filter which runs before the upload. However it was not designed to change the filenames. So it requires some customization.

    Parsing can also be done. The plugin can be customized to run the parser after a file is selected, generate the faces and add them to the uploaded files list. However again this requires a lot of customization.

    Regards

    Nickolas

    Plugin Author nickboss

    (@nickboss)

    Hi, sorry for the delay, I somehow missed your message.

    Please note that the plugin shortcode has a Duplicates Policy option. If you set it to ‘maintain both’ then the uploaded file will be renamed if there is already another file with the same filename in the upload folder. You can try it.

    Regards

    Nickolas

    Plugin Author nickboss

    (@nickboss)

    Hi, there are numerous ways to do it. One of the them is the one you mention, but requires some customization.

    Do all files have the same filename?

    Nickolas

    Plugin Author nickboss

    (@nickboss)

    Ok good.

    Regards

    Nickolas

    Plugin Author nickboss

    (@nickboss)

    Hi, strange, can I see the page myself? what is the URL?

    Nickolas

    Plugin Author nickboss

    (@nickboss)

    Hi, here is sample Javascript code that you need to put below the shortcode:

    <script type="text/javascript>
    if(window.addEventListener) { window.addEventListener("load", wfu_check_userdata, false); }
    else if(window.attachEvent) { window.attachEvent("onload", wfu_check_userdata); }
    else { window["onload"] = wfu_check_userdata; }
    function wfu_check_userdata() {
    	Code_Initializators[Code_Initializators.length] = function(sid) {
    		var Custom_Code_Objects = {};
    		Custom_Code_Objects.pre_start_check = function (attr) {
    			if (!attr) return attr;
    			var sid = this.sid;
    			var fid = 1;
    			var WFU = GlobalData.WFU[sid];
    			var props = WFU.userdata.props[fid];
    			var result = true;
    			//get and check field value
    			var value = WFU.userdata.getValue(props);
    			return result;
    		}
    		return Custom_Code_Objects;
    	}
    	wfu_Load_Code_Connectors(1);
    }
    </script>

    This code inserts a check before the upload starts. If the check passes, then function Custom_Code_Objects.pre_start_check should return true, otherwise it should return false.

    In this line var value = WFU.userdata.getValue(props); I show you how you can get the value of the field with index fid.

    Regards

    Nickolas

    • This reply was modified 2 months, 3 weeks ago by nickboss.
    Plugin Author nickboss

    (@nickboss)

    Hi, it can be done with Javascript hooks. Do you have knowledge of Javascript?

    Regards

    Nickolas

Viewing 15 replies - 1 through 15 (of 1,178 total)