PDA

View Full Version : How to disable Image Uploading v4.1.4


LVC
07-04-2011, 01:22 AM
Hi,

for the life of me I cannot figure how to do the following

1. Not allow users to upload images into forum posts
2. when they click on insert image icon in the editor -- I want the user to just be able to paste url so editor could place the tags in the post (same as when you click on the "insert an image" icon in the vbulletin.org editor.

As of right now-- unless they paste the image tags themselves (i.e. copy/paste from Photobucket etc) -- all of their images automatically get uploaded and inserted into database.

I do not want this -- what can I do?

Thanks

LVC
07-05-2011, 12:41 PM
Anybody?

Keysailor
07-05-2011, 03:48 PM
I think the simplest way would be to change the switch from the new insert image popup to the older style.

In adminCP, go to Settings | Options | Message Attachment Options and scroll to the bottom.

The last entry is Advanced Insert Image Popup - Enable. If you set it to NO, the old dialogue box will show, which only allows you to do an image reference from a url, not upload an image from your computer.

You should have all your usergroups also not able to use html codes, or you end up with them being able to bypass the bbcode restrictions.

I could be wrong though...

Oh, and in the usergroup options, you can stop them from uploading attachments. That still allows them to use the BB IMG code to show images, but they aren't uploaded (I think) except for maybe a thumbnail if you've enabled thumbnails. Go to Usergroup Manager and edit a usergroup (like Registered Users) and scroll down to Attachment Permissions.

Hope this helps!

LVC
07-05-2011, 04:08 PM
OK -- tried it

I get Invalid URL message when I paste an image url in the legacy dialogue box


I think the simplest way would be to change the switch from the new insert image popup to the older style.

In adminCP, go to Settings | Options | Message Attachment Options and scroll to the bottom.

The last entry is Advanced Insert Image Popup - Enable. If you set it to NO, the old dialogue box will show, which only allows you to do an image reference from a url, not upload an image from your computer.

You should have all your usergroups also not able to use html codes, or you end up with them being able to bypass the bbcode restrictions.

I could be wrong though...

Oh, and in the usergroup options, you can stop them from uploading attachments. That still allows them to use the BB IMG code to show images, but they aren't uploaded (I think) except for maybe a thumbnail if you've enabled thumbnails. Go to Usergroup Manager and edit a usergroup (like Registered Users) and scroll down to Attachment Permissions.

Hope this helps!

kh99
07-05-2011, 04:59 PM
You could remove the button by creating a plugin using hook location editor_toolbar_filter and this code:

$key = array_search('Attach', $toolbar[0]);
if ($key !== false)
{
unset($toolbar[0][$key]);
if ($toolbar[0][$key + 1] == '-')
unset($toolbar[0][$key + 1]);
$toolbar[0] = array_values($toolbar[0]);
}


or if you really want a duplicate of the image button you could do this:

$key = array_search('Attach', $toolbar[0]);
if ($key !== false)
{
$toolbar[0][$key] = 'Image';
}


BTW, this just changes the buttons in the editor, I'm not sure it actually prevents someone who knows what they're doing from uploding attachements, but it may be good enough for your purposes.

ETA: ...and I misunderstood the question - see below.

LVC
07-05-2011, 05:06 PM
Is this the only way to get the Legacy Image Insert function to work?

and is this another bug in 4.1.4?

If so.... this is a big one (at least for me)



You could remove the button by creating a plugin using hook location editor_toolbar_filter and this code:

$key = array_search('Attach', $toolbar[0]);
if ($key !== false)
{
unset($toolbar[0][$key]);
if ($toolbar[0][$key + 1] == '-')
unset($toolbar[0][$key + 1]);
$toolbar[0] = array_values($toolbar[0]);
}


or if you really want a duplicate of the image button you could do this:

$key = array_search('Attach', $toolbar[0]);
if ($key !== false)
{
$toolbar[0][$key] = 'Image';
}


BTW, this just changes the buttons in the editor, I'm not sure it actually prevents someone who knows what they're doing from uploding attachements, but it may be good enough for your purposes.

kh99
07-05-2011, 05:08 PM
Is this the only way to get the Legacy Image Insert function to work?

and is this another bug in 4.1.4?

If so.... this is a big one (at least for me)


I don't know about that, I was just offering another option.

...and I see now that I'm wrong, I misunderstood the question - you weren't talking about attachments. What Keysailor suggested should have worked, I think, but I get the same error message that you reported.

LVC
07-05-2011, 05:15 PM
I appreciate the help.

I am wondering if other folks are experiencing the same issue in 4.1.4 --- if they are not -- then I am most likely doing something wrong somewhere else that is affecting the Legacy option.

I would like to get that clarified first if possible before I start changing things around.

I don't know about that, I was just offering another option.

...and I see now that I'm wrong, I misunderstood the question - you weren't talking about attachments. What Keysailor suggested should have worked, I think, but I get the same error message that you reported.

kh99
07-05-2011, 05:55 PM
I think it is a bug, it seems to do the attachment stuff even if you have that option tunred off. You could see if that's been reported as a bug, but meanwhile you could make a temporary fix by editing file clientscript/ckeplugins/vbimage/dialogs/image.js, and around line 109 where it looks like this:

doAttachmentFromUrl: function(dialog)
{
var url = dialog.getContentElement('from_url', 'url').getValue();
if (dialog.getContentElement('from_url', 'remote_file').getValue())
{
var postData = {


change it to look like this:

doAttachmentFromUrl: function(dialog)
{
var url = dialog.getContentElement('from_url', 'url').getValue();
if (false) //dialog.getContentElement('from_url', 'remote_file').getValue())
{
var postData = {


(the only change is that I added the part in red).

LVC
07-05-2011, 08:14 PM
to be clear -- this will do what?

sorry for the questions but I am not a programmer --

Thanks




I think it is a bug, it seems to do the attachment stuff even if you have that option tunred off. You could see if that's been reported as a bug, but meanwhile you could make a temporary fix by editing file clientscript/ckeplugins/vbimage/dialogs/image.js, and around line 109 where it looks like this:

doAttachmentFromUrl: function(dialog)
{
var url = dialog.getContentElement('from_url', 'url').getValue();
if (dialog.getContentElement('from_url', 'remote_file').getValue())
{
var postData = {


change it to look like this:

doAttachmentFromUrl: function(dialog)
{
var url = dialog.getContentElement('from_url', 'url').getValue();
if (false) //dialog.getContentElement('from_url', 'remote_file').getValue())
{
var postData = {


(the only change is that I added the part in red).

--------------- Added 1309901653 at 1309901653 ---------------

Looks like a bug

http://tracker.vbulletin.com/browse/VBIV-12369

kh99
07-05-2011, 08:37 PM
to be clear -- this will do what?

sorry for the questions but I am not a programmer --

Thanks

It will force the image button to always insert url

--------------- Added 1309901653 at 1309901653 ---------------

Looks like a bug

http://tracker.vbulletin.com/browse/VBIV-12369

The fix shown in that thread is better than what I posted above.

LVC
07-13-2011, 01:57 AM
My objective is to offer users only one option for inserting images in a post -- and that is having them linked from a URL with tags -- like the old editor.

OK -- so first thing I do is disable the advanced Image Pop-up - according to note --- "Disabling this option will display the legacy from URL attachment dialog" this is good! Exactly what I want!

https://vborg.vbsupport.ru/external/2011/07/81.jpg


OK so I saved it and went to the editor to test.

I click on the insert an image icon and the correct legacy pop-up displays

https://vborg.vbsupport.ru/external/2011/07/82.jpg

I paste a URL

https://vborg.vbsupport.ru/external/2011/07/83.jpg

I hit the OK button --- and I get the invalid URL message and the image does not post

https://vborg.vbsupport.ru/external/2011/07/84.jpg


So how can I fix this? I have a music gear website that I just launched -- and I do not want to host a million pictures on my server -- so I need the legacy from URL attachment dialog to be the default -- and I need it to work.

Am I doing something wrong?
Is this a bug?
Is there a fix?

Thanks for taking the time and looking at this.

Locou
07-28-2011, 06:02 PM
Bumping, because I have the same problem.

LVC
07-28-2011, 06:30 PM
this is how I was able to fix

https://www.vbulletin.com/forum/showthread.php/381588-Invalid-Url-On-Image-4.1.4?p=2180263&viewfull=1#post2180263