MyBB Community Forums

Full Version: Imgur Links only for avatar/sigs?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there a plugin for this? If the link isn't an imgur link when changing your avatar, you will receive an error. Tried finding this in the extended page but can't find any plugin related to it
Actually, it doesn't exist.

Stupid question, but why do you want to force imgur usage for avatars and signatures pictures ?
(2019-06-18, 10:13 AM)Crazycat Wrote: [ -> ]Actually, it doesn't exist.

Stupid question, but why do you want to force imgur usage for avatars and signatures pictures ?

Security reasons of course man
You would need to hook into usercp.php and intercept the upload URL. Checking would be easy, then just make $avatar_error global and assign an error message to it, if it isn't from Imgur.
$plugins->add_hook("usercp_do_avatar_start", "my_function");

function my_function()
{
	global $avatar_error;

	if (strpos($mybb->input['avatarurl'], 'imgur.com') === false) {
		$avatar_error = 'Uploads must be from Imgur!';
	}
}


^ that is untested, I just typed it out in the textbox, but that's the basic idea.