• Resolved cargarm3

    (@cargarm3)


    Is there any option of not showing some messages? For example, in my site two messages are shown : “Please, wait while redirecting” and “File XXX was succesfully uploaded” down. I just want to show “File XXX was succesfully uploaded”, and not the first one (but of course, I want a direct redirection).

    Thank you.

    https://ww.wp.xz.cn/plugins/wp-file-upload/

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author nickboss

    (@nickboss)

    no unfortunately there is not such an option, however Javascript is a very reconfigurable language so I came up with a script that can do the job.

    Copy and paste the following code inside the page with the plugin, right below the shortcode:

    <script type="text/javascript">
    Object.prototype.watch||Object.defineProperty(Object.prototype,"watch",{enumerable:!1,configurable:!0,writable:!1,value:function(e,t){var r=this[e],n=r,c=function(){return n},i=function(c){return r=n,n=t.call(this,e,r,c)};if (delete this[e]) {Object.defineProperty(this,e,{get:c,set:i,enumerable:!0,configurable:!0})}}}),Object.prototype.unwatch||Object.defineProperty(Object.prototype,"unwatch",{enumerable:!1,configurable:!0,writable:!1,value:function(e){var t=this[e];delete this[e],this[e]=t}});
    if (typeof original_wfu_ProcessUploadComplete == "undefined") original_wfu_ProcessUploadComplete = window["wfu_ProcessUploadComplete"];
    window["wfu_ProcessUploadComplete"] = function(sid, file_id, upload_params, unique_id, params_index, session_token, safe_output, debug_data, request_type, js_script_enc) {
    	var w = false; if (!!GlobalData[sid]) { GlobalData[sid].watch("upload_state", function (id, ov, nv) { return (nv == 11) ? ov : nv; }); w = true; }
    	return original_wfu_ProcessUploadComplete(sid, file_id, upload_params, unique_id, params_index, session_token, safe_output, debug_data, request_type, js_script_enc);
    	if (w) GlobalData[sid].unwatch("upload_state"); }
    </script>

    I have tested it in all major browsers. Let me know if it works.

    Nickolas

    Thread Starter cargarm3

    (@cargarm3)

    Yes, it works. The problem is that I don’t want to show the arrow with two messages. I mean, when file is uploaded, both text are shown : “All Files uploaded succesfully” and “File XXX was succesfully uploaded” with a drop menu.

    What I want is to show is just this own text : “File XXX was succesfully uploaded, please wait while directing …” and no others.

    You can have a look at this example:

    Thank you.

    Plugin Author nickboss

    (@nickboss)

    ok try the following script:

    <script type="text/javascript">
    Object.prototype.watch||Object.defineProperty(Object.prototype,"watch",{enumerable:!1,configurable:!0,writable:!1,value:function(e,t){var r=this[e],n=r,c=function(){return n},i=function(c){return r=n,n=t.call(this,e,r,c)};if (delete this[e]) {Object.defineProperty(this,e,{get:c,set:i,enumerable:!0,configurable:!0})}}}),Object.prototype.unwatch||Object.defineProperty(Object.prototype,"unwatch",{enumerable:!1,configurable:!0,writable:!1,value:function(e){var t=this[e];delete this[e],this[e]=t}});
    if (typeof original_wfu_ProcessUploadComplete == "undefined") original_wfu_ProcessUploadComplete = window["wfu_ProcessUploadComplete"];
    window["wfu_ProcessUploadComplete"] = function(sid, file_id, upload_params, unique_id, params_index, session_token, safe_output, debug_data, request_type, js_script_enc) {
    	var w = false; var rl = ""; var G = null; if (!!GlobalData[sid]) { G = GlobalData[sid]; G.watch("last", function (id, ov, nv) { if (nv) {rl = G.redirect_link; G.redirect_link = "";} return nv; }); w = true; }
    	var last = original_wfu_ProcessUploadComplete(sid, file_id, upload_params, unique_id, params_index, session_token, safe_output, debug_data, request_type, js_script_enc);
    	if (w) GlobalData[sid].unwatch("last"); if (rl != "") wfu_Redirect(rl); return last; }
    </script>

    Nickolas

    Thread Starter cargarm3

    (@cargarm3)

    Great, It works. Now my last question). I Want to place the text “File XXX was succesfully uploaded, Please Wait“. Is there a way to change it with no modifying the languaje source files?

    Thanks for all

    Plugin Author nickboss

    (@nickboss)

    yes, using the visual editor of the plugin go to the Labels tab, there you can configure the success message

    Nickolas

    Thread Starter cargarm3

    (@cargarm3)

    Perfect, thank you very much. Great pluggin

    Plugin Author nickboss

    (@nickboss)

    thank you, marking it as resolved

    Thread Starter cargarm3

    (@cargarm3)

    Ops … detected another problems :

    – Now, if file fails (because of type of file not correct or because od any other reason), the script allows to go to next Step. ¿Any solution?

    (try for example to upload a PDF in http://scarabaeus.co.uk/image/ , configured just for png and jpg)

    Thank you.

    Plugin Author nickboss

    (@nickboss)

    I will check and let you know

    Nickolas

    Plugin Author nickboss

    (@nickboss)

    Hi, please try the following one:

    <script type="text/javascript">
    Object.prototype.watch||Object.defineProperty(Object.prototype,"watch",{enumerable:!1,configurable:!0,writable:!1,value:function(e,t){var r=this[e],n=r,c=function(){return n},i=function(c){return r=n,n=t.call(this,e,r,c)};if (delete this[e]) {Object.defineProperty(this,e,{get:c,set:i,enumerable:!0,configurable:!0})}}}),Object.prototype.unwatch||Object.defineProperty(Object.prototype,"unwatch",{enumerable:!1,configurable:!0,writable:!1,value:function(e){var t=this[e];delete this[e],this[e]=t}});
    if (typeof original_wfu_ProcessUploadComplete == "undefined") original_wfu_ProcessUploadComplete = window["wfu_ProcessUploadComplete"];
    window["wfu_ProcessUploadComplete"] = function(sid, file_id, upload_params, unique_id, params_index, session_token, safe_output, debug_data, request_type, js_script_enc) {
    	var w = false; var rl = ""; var G = null; if (!!GlobalData[sid]) {G = GlobalData[sid]; G.watch("last", function (id, ov, nv) { if (nv) {rl = G.redirect_link; G.redirect_link = ""; G.admin_messages.redirect = "";} return nv; }); w = true; }
    	var last = original_wfu_ProcessUploadComplete(sid, file_id, upload_params, unique_id, params_index, session_token, safe_output, debug_data, request_type, js_script_enc);
    if (w) GlobalData[sid].unwatch("last"); if (!!GlobalData[sid]) {G = GlobalData[sid]; if (!(G.errors.redirect != "" || rl == "")) wfu_Redirect(rl); return last;}}
    </script>

    Nickolas

    Thread Starter cargarm3

    (@cargarm3)

    Now it works, thank you.

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Avoid some messages’ is closed to new replies.