how to disable "Retrieve remote file and reference locally"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • extra pc
    Member
    • Oct 2009
    • 95
    • 3.8.x

    [Answered] how to disable "Retrieve remote file and reference locally"

    Hello in this post u will see some members like me want to disable this option "Retrieve remote file and reference locally" in wysiwyg editor without disable attachments at all





    the good way to do that in page 2 from Mr. Michael Henretty


    and this is the solution


    Originally posted by Michael Henretty
    If I understand you correctly, you want only the "From URL" option. Is that correct?

    Ok, here is a fix for you:

    [forum-path]/clientscripts/vbulletin_textedit.js

    around line 1720, look for
    Code:
    /**
    * Insert Image
    *
    * @param    event    Event object
    *
    * @return    boolean
    */
    vB_Text_Editor.prototype.insertimage = function(e, forceoldway)
    {
        if (this.wysiwyg_mode && typeof(vBulletin.attachinfo) !=  "undefined" && typeof(vBulletin.attachinfo.contenttypeid) !=  "undefined" && vBulletin.attachinfo.contenttypeid != 0  && typeof(forceoldway) == "undefined")
        {
    add to the "if" false &&, so that it looks like this:
    Code:
    if (false && this.wysiwyg_mode &&  typeof(vBulletin.attachinfo) != "undefined" &&  typeof(vBulletin.attachinfo.contenttypeid) != "undefined" &&  vBulletin.attachinfo.contenttypeid != 0 && typeof(forceoldway)  == "undefined")
    That should get rid of both the "From Computer" option, as well as the "Retrieve remote file and reference locally" option, but still allow you to upload attachments using the attachment manager.



    just after edit the file mak sure u refresh ur forum page and try to insert image using wysiwyg editor
  • Michael Henretty
    Member
    • Aug 2009
    • 68
    • 4.0.x

    #2
    Currently, we are taking it under consideration to add an admin option to be able to disable the new image uploader (so that only the old javascript pop-up comes up). The problem is, we are not sure how many users want this option. So please, if you are reading this thread and would find such an option useful, respond here and let us know.

    The option would still allow users to upload images from a website and store them locally using the attachment manager. But it would force the "Insert Image" button to only allow external URL image references (like 3.x).

    So what do you think?

    Comment

    • Sunka
      Senior Member
      • Nov 2008
      • 131
      • 3.8.x

      #3
      I want that too!
      It is better to have option in ACP to allow or disable that, than not have option at all.

      Many people don't want to have big backup (database, or files) because people like to upload pictures in post

      Comment

      • Michael Henretty
        Member
        • Aug 2009
        • 68
        • 4.0.x

        #4
        Originally posted by Sunka
        Many people don't want to have big backup (database, or files) because people like to upload pictures in post
        Please keep in mind that this option will not prevent users from from uploading pictures to posts since they will still be able to do so with the regular attachment manager. This option would only affect the "Insert Image" dialog, in that it would no longer offer the "From Computer" tab, or the "Retrieve remote file and reference locally" check-box.

        Also, if you wanted to prevent users from uploading images to the server completely (not just posts) there are already global and usergroup permissions to do this.

        Comment

        • burntire
          Member
          • Jun 2006
          • 87
          • 4.0.0

          #5
          Originally posted by extra pc
          Hello in this post u will see some members like me want to disable this option "Retrieve remote file and reference locally" in wysiwyg editor without disable attachments at all





          the good way to do that in page 2 from Mr. Michael Henretty


          and this is the solution







          just after edit the file mak sure u refresh ur forum page and try to insert image using wysiwyg editor
          I tried that and it doesn't work.

          Click image for larger version

Name:	1..jpg
Views:	1
Size:	90.2 KB
ID:	3678210
          www.highperformancestangs.com

          Comment

          • Michael Henretty
            Member
            • Aug 2009
            • 68
            • 4.0.x

            #6
            Originally posted by burntire
            I tried that and it doesn't work.
            Hmmm, did you try clearing your browser cache?

            Comment

            • burntire
              Member
              • Jun 2006
              • 87
              • 4.0.0

              #7
              Yes and a Ctrl-F5


              Code:
              if (false && this.wysiwyg_mode && typeof(vBulletin.attachinfo) != "undefined" && typeof(vBulletin.attachinfo.contenttypeid) != "undefined" && vBulletin.attachinfo.contenttypeid != 0 && typeof(forceoldway) == "undefined")
              www.highperformancestangs.com

              Comment

              • Michael Henretty
                Member
                • Aug 2009
                • 68
                • 4.0.x

                #8
                Originally posted by burntire
                Yes and a Ctrl-F5
                Hmmm, ok. Can you try removing all the conditionals from that if statement, and just put false in there?

                So it would be something like:

                Code:
                /**
                * Insert Image
                *
                * @param    event    Event object
                *
                * @return    boolean
                */
                vB_Text_Editor.prototype.insertimage = function(e, forceoldway)
                {
                    if (false)
                    {
                ...
                ...
                    {

                Comment

                • burntire
                  Member
                  • Jun 2006
                  • 87
                  • 4.0.0

                  #9
                  It is still showing the reterview from external url option. Is it tied to a template?
                  www.highperformancestangs.com

                  Comment

                  • Michael Henretty
                    Member
                    • Aug 2009
                    • 68
                    • 4.0.x

                    #10
                    Originally posted by burntire
                    Is it tied to a template?
                    Well, yes and no. It can make an ajax call to get that pop-up template, but we are trying to avoid that here, and instead use a regular javascript style pop-up (like in vb3).

                    Can you paste the code you have for that entire javascript function here? Mine looks like:

                    Code:
                    /**
                    * Insert Image
                    *
                    * @param	event	Event object
                    *
                    * @return	boolean
                    */
                    vB_Text_Editor.prototype.insertimage = function(e, forceoldway)
                    {
                    	if (this.wysiwyg_mode && typeof(vBulletin.attachinfo) != "undefined" && typeof(vBulletin.attachinfo.contenttypeid) != "undefined" && vBulletin.attachinfo.contenttypeid != 0 && typeof(forceoldway) == "undefined")
                    	{
                    		this.show_editor_progress();
                    
                    		YAHOO.util.Connect.asyncRequest("POST", "ajax.php?do=fetchhtml", {
                    			success: this.insertimage_ajax,
                    			failure: this.remove_editor_dialog,
                    			timeout: vB_Default_Timeout,
                    			argument: [this.editorid],
                    			scope: this
                    		}, SESSIONURL
                    			+ "&securitytoken="
                    			+ SECURITYTOKEN
                    			+ "&ajax=1"
                    			+ "&do=fetchhtml"
                    			+ "&template=editor_upload_overlay"
                    		);
                    	}
                    	else
                    	{
                    		img = this.show_prompt(vbphrase['enter_image_url'], 'http://', true);
                    		if (img = this.verify_prompt(img))
                    		{
                    			return this.apply_format('insertimage', false, img);
                    		}
                    		else
                    		{
                    			return false;
                    		}
                    	}
                    };

                    Comment

                    • burntire
                      Member
                      • Jun 2006
                      • 87
                      • 4.0.0

                      #11
                      Code:
                      * Insert Image
                      *
                      * @param event Event object
                      *
                      * @return boolean
                      */
                      vB_Text_Editor.prototype.insertimage = function(e, forceoldway) 
                      { 
                           if (false) 
                          { 
                      ... 
                      ... 
                          {
                        this.show_editor_progress();
                        YAHOO.util.Connect.asyncRequest("POST", "ajax.php?do=fetchhtml", {
                         success: this.insertimage_ajax,
                         failure: this.remove_editor_dialog,
                         timeout: vB_Default_Timeout,
                         argument: [this.editorid],
                         scope: this
                        }, SESSIONURL
                         + "&securitytoken="
                         + SECURITYTOKEN
                         + "&ajax=1"
                         + "&do=fetchhtml"
                         + "&template=editor_upload_overlay"
                        );
                       }
                       else
                       {
                        img = this.show_prompt(vbphrase['enter_image_url'], 'http://', true);
                        if (img = this.verify_prompt(img))
                        {
                         return this.apply_format('insertimage', false, img);
                        }
                        else
                        {
                         return false;
                        }
                       }
                      };
                      www.highperformancestangs.com

                      Comment

                      • burntire
                        Member
                        • Jun 2006
                        • 87
                        • 4.0.0

                        #12
                        I deleted the entire vbulletin_textedit.js file from my server and the box still shows up?
                        www.highperformancestangs.com

                        Comment

                        • Michael Henretty
                          Member
                          • Aug 2009
                          • 68
                          • 4.0.x

                          #13
                          Originally posted by burntire
                          I deleted the entire vbulletin_textedit.js file from my server and the box still shows up?
                          That's interesting. That means the page must not be using the file you have been editing. Or there is a cached version of it somewhere.

                          Also, I think I wasn't quite as literally as I should have been when giving you code, the correct version of the function for you should look like this:

                          Code:
                          * Insert Image
                          *
                          * @param event Event object
                          *
                          * @return boolean
                          */
                          vB_Text_Editor.prototype.insertimage = function(e, forceoldway) 
                          { 
                               if (false) 
                              {
                            this.show_editor_progress();
                            YAHOO.util.Connect.asyncRequest("POST", "ajax.php?do=fetchhtml", {
                             success: this.insertimage_ajax,
                             failure: this.remove_editor_dialog,
                             timeout: vB_Default_Timeout,
                             argument: [this.editorid],
                             scope: this
                            }, SESSIONURL
                             + "&securitytoken="
                             + SECURITYTOKEN
                             + "&ajax=1"
                             + "&do=fetchhtml"
                             + "&template=editor_upload_overlay"
                            );
                           }
                           else
                           {
                            img = this.show_prompt(vbphrase['enter_image_url'], 'http://', true);
                            if (img = this.verify_prompt(img))
                            {
                             return this.apply_format('insertimage', false, img);
                            }
                            else
                            {
                             return false;
                            }
                           }
                          };

                          Comment

                          • burntire
                            Member
                            • Jun 2006
                            • 87
                            • 4.0.0

                            #14
                            No matter what I do I can't get things to change. I can PM you a login on my site if you want to see.
                            www.highperformancestangs.com

                            Comment

                            • nubian
                              Senior Member
                              • Nov 2004
                              • 495

                              #15
                              Originally posted by Michael Henretty
                              The problem is, we are not sure how many users want this option. So please, if you are reading this thread and would find such an option useful, respond here and let us know.
                              Well, you already know my answer.

                              Comment

                              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                              Working...