Hide 'from the web' in image upload

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.

1 Like

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

5 Likes

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.

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;
  }
}
7 Likes

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.

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.

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

1 Like

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