Hide 'from the web' in image upload


(David Kingham) #1

I would prefer users only upload images rather than having the option of using images on the web due to various display reasons. I tried to hide via css but the selectors seem to be the same for both options, the radio buttons would need to be hidden as well.


(Kane York) #2

Just make sure that download remote images to local is enabled, and linked images will be downloaded to the server and served locally.


(David Kingham) #3

Thanks Kane, I do have that turned on which helps with some issues, but ultimately I want to avoid external links for images, I know they will still be able to paste a link but I would like to have the option less obvious.


(Joe) #4

You can use :nth-of-type() in your CSS if there’s no unique selector for the element you want to target.

.upload-selector {
  label,
  input[type="radio"],
  .radios:nth-of-type(2) {
    display: none;
  }
}

(Jay Pfaffman) #5

What display reasons are affected by where an image is? If you disable them being able to have discourse download the image from the web, they can just download the image locally and then upload it, right?

Or is it that they might have access to an image because they are logged in to a site and discourse can’t get it because it’s not public?

I don’t understand why problem you’re solving.


(David Kingham) #6

The display issues were resolved by either the download remote images to local or there was a bug fix in topic list preview plugin, not sure which but the images were not displaying in the previews before but are now.

So the main issue I was trying to resolve was users posting a link to their website where the image is located, but not a direct link to the jpg which obviously just shows a tiny preview and users have to leave the site to go view the image and may possibly not come back or not view the image because they have to leave the site. Since my forum is centered around photography and image critiques this was important to me.


(Jay Pfaffman) #7

If you figure out how to resolve that, you’ll be rich. :wink:


(system) #8

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.