Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 07-04-2011, 01:22 AM
LVC LVC is offline
 
Join Date: Mar 2011
Location: NJ
Posts: 54
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How to disable Image Uploading v4.1.4

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
Reply With Quote
  #2  
Old 07-05-2011, 12:41 PM
LVC LVC is offline
 
Join Date: Mar 2011
Location: NJ
Posts: 54
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anybody?
Reply With Quote
  #3  
Old 07-05-2011, 03:48 PM
Keysailor's Avatar
Keysailor Keysailor is offline
 
Join Date: Jan 2010
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
Reply With Quote
Благодарность от:
Mooff
  #4  
Old 07-05-2011, 04:08 PM
LVC LVC is offline
 
Join Date: Mar 2011
Location: NJ
Posts: 54
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK -- tried it

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


Quote:
Originally Posted by Keysailor View Post
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!
Reply With Quote
  #5  
Old 07-05-2011, 04:59 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

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:

Code:
$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.
Reply With Quote
  #6  
Old 07-05-2011, 05:06 PM
LVC LVC is offline
 
Join Date: Mar 2011
Location: NJ
Posts: 54
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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)



Quote:
Originally Posted by kh99 View Post
You could remove the button by creating a plugin using hook location editor_toolbar_filter and this code:

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:

Code:
$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.
Reply With Quote
  #7  
Old 07-05-2011, 05:08 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by LVC View Post
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.
Reply With Quote
  #8  
Old 07-05-2011, 05:15 PM
LVC LVC is offline
 
Join Date: Mar 2011
Location: NJ
Posts: 54
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.

Quote:
Originally Posted by kh99 View Post
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.
Reply With Quote
  #9  
Old 07-05-2011, 05:55 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:

Code:
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:

Code:
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).
Reply With Quote
Благодарность от:
moonclamp
  #10  
Old 07-05-2011, 08:14 PM
LVC LVC is offline
 
Join Date: Mar 2011
Location: NJ
Posts: 54
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

to be clear -- this will do what?

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

Thanks




Quote:
Originally Posted by kh99 View Post
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:

Code:
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:

Code:
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 [DATE]1309901653[/DATE] at [TIME]1309901653[/TIME] ---------------

Looks like a bug

http://tracker.vbulletin.com/browse/VBIV-12369
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:23 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04103 seconds
  • Memory Usage 2,270KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (8)bbcode_code
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (2)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete