MyBB Community Forums

Full Version: Disabling IMG tags
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there a way to disable IMG tags BUT not effect the current IMG tags in my forum? Basically I hate when people link photos from Photobucket because they always seem to disappear later. I want to keep people from doing this for future posts but not lose the posts already there. Is this possible?
I don't think so, as if the settings was off, older posts wouldn't parse the IMG tag when viewed. It might be possible with some sort of code modification though.
If your OK that the modification affects all the forums, I believe this would do the trick.

Basically, it will disable the img code on all the new posts.

In inc/functions_post.php
Find:
		case 1: // Message preview
			global $forum;
			$parser_options['allow_html'] = $forum['allowhtml'];
			$parser_options['allow_mycode'] = $forum['allowmycode'];
			$parser_options['allow_smilies'] = $forum['allowsmilies'];
			$parser_options['allow_imgcode'] = $forum['allowimgcode'];
			$parser_options['me_username'] = $post['username'];
			$parser_options['filter_badwords'] = 1;
			$id = 0;
			break;
Replace with:
		case 1: // Message preview
			global $forum;
			$parser_options['allow_html'] = $forum['allowhtml'];
			$parser_options['allow_mycode'] = $forum['allowmycode'];
			$parser_options['allow_smilies'] = $forum['allowsmilies'];
			$parser_options['allow_imgcode'] = 0;
			$parser_options['me_username'] = $post['username'];
			$parser_options['filter_badwords'] = 1;
			$id = 0;
			break;

Also, find:
		default: // Regular post
			global $forum, $thread, $tid;
			$oldforum = $forum;
			$id = intval($post['pid']);
			$parser_options['allow_html'] = $forum['allowhtml'];
			$parser_options['allow_mycode'] = $forum['allowmycode'];
			$parser_options['allow_smilies'] = $forum['allowsmilies'];
			$parser_options['allow_imgcode'] = $forum['allowimgcode'];
			$parser_options['filter_badwords'] = 1;

Replace with:
		default: // Regular post
			global $forum, $thread, $tid;
			$oldforum = $forum;
			$id = intval($post['pid']);
			$parser_options['allow_html'] = $forum['allowhtml'];
			$parser_options['allow_mycode'] = $forum['allowmycode'];
			$parser_options['allow_smilies'] = $forum['allowsmilies'];
			$parser_options['allow_imgcode'] = 0;
			$parser_options['filter_badwords'] = 1;
Thanks so much for the info. However, i replaced the code and it disabled the IMG images in the old posts. Any suggestions? Thanks!
Is there anyway to just remove the Icon from the new thread box?
YottabyteWizard's disables img tags for all posts. Disabling for just new posts _can_ be done, but is problematic - for example, would editing an old post constitute a new post, or an old one?

I suggest you reconsider your approach. If you don't like having images, just disable it from everywhere. If you just don't want Photobucket, ask your users to upload images elsewhere, and if you want, stick in a word censor for Photobucket to prevent images on that site being posted.
Disabling images would probably simply get your users to post links to the picture, which won't prevent it from disappearing later on anyway.
Is it possible to disable the [IMG] tags EXCEPT for images located on your own server?
(2010-12-31, 04:44 AM)KrinkleGator Wrote: [ -> ]Is it possible to disable the [IMG] tags EXCEPT for images located on your own server?

Not without a plugin.
Also for future reference it's better to make your own thread rather than bump a thread that's over two years old and is asking something different to what you're asking.
Well, I did, but nobody had put anything on it since 12/15 - so I decided to try to look it up some more and found this.

Sorry about that and I guess you can delete these posts.