MyBB Community Forums

Full Version: Disable Avatar by URL
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello I recently installed avatar gallery plugin and I want my users to pick avatar from these galleries only.
So I make users unable to upload an avatar.
But I can't make them unable to get avatar by url.

What should I do ?
(2015-08-16, 11:54 PM)Darkrad Wrote: [ -> ]So I make users unable to upload an avatar.
But I can't make them unable to get avatar by url.

But they are still also able to upload an avatar from their computer, aren't they? When they choose the gallery avatar in anorher way than through UserCP -> Change Avatar you can delete this option by removing the line below from template usercp_nav_profile:

<div><a href="usercp.php?action=avatar" class="usercp_nav_item usercp_nav_avatar">{$lang->ucp_nav_change_avatar}</a></div>
[Image: AqLvzz.jpg]

I want to disable or remove this part.
I want to make users pick from gallery. No custom avatar, no avatar from computer, no avatar by URL. Everyone should pick avatar from gallery. No custom avatar.
I expect that the template usercp_avatar_upload has been changed by your plugin. Then you could remove the following lines from your template usercp_avatar:
<tr>
	<td class="trow2" width="40%">
		<strong>{$lang->avatar_url}</strong>
		<br /><span class="smalltext">{$lang->avatar_url_note}</span>
	</td>
	<td class="trow2" width="60%">
		<input type="text" class="textbox" name="avatarurl" size="45" value="{$avatarurl}" />
		<br /><span class="smalltext">{$lang->avatar_url_gravatar}</span>
	</td>
</tr>
I think it worked, thank you!
It seems I need to remove those parts too.

[Image: mzJ5RR.jpg]

There should not be Custom Avatar tab.
and there should not be that Set as avatar button, when you click it gives that error (invalid URL)
Can you show the template usercp_avatar.
<html>
<head>
<title>{$mybb->settings['bbname']} - {$lang->change_avatar}</title>
{$headerinclude}
</head>
<body>
{$header}
<table width="100%" border="0" align="center">
<tr>
{$usercpnav}
<td valign="top">
{$avatar_error}
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead" colspan="2"><strong>{$lang->change_avatar}</strong></td>
</tr>
<tr>
<td class="trow1" colspan="2">
<table cellspacing="0" cellpadding="0" width="100%">
<tr>
<td>{$lang->avatar_note}{$avatarmsg}</td>
{$currentavatar}
</tr>
</table>
</td>
</tr>
<tr>
{$avatargallery}<td class="tcat" colspan="2"><strong>{$lang->custom_avatar}</strong></td>
</tr>
<form enctype="multipart/form-data" action="usercp.php" method="post">
<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
</tr>
{$avatarupload}
<br />
</table>
<div align="center">
<input type="hidden" name="action" value="do_avatar" />
<input type="submit" class="button" name="submit" value="{$lang->change_avatar}" />
{$removeavatar}
</div>
</td>
</tr>
</table>
</form>
{$footer}
</body>
</html>

I want only administrators&moderators having custom avatar option, users should pick from library.
Currently it works okay.

But still users who can not actually get avatar by URL sees " Custom Avatar" and " Set it as my avatar " button.
When one clicks it says you didnt write any URL.
(2015-08-21, 03:04 PM)Darkrad Wrote: [ -> ]I want only administrators&moderators having custom avatar option, users should pick from library.
Currently it works okay.

But still users who can not actually get avatar by URL sees " Custom Avatar" and " Set it as my avatar " button.
When one clicks it says you didnt write any URL.

Is this not a contradiction. First you say that administrators&moderators should have custom avatar options. Then you want all custom avatar options removed from the template.

When you only want to have the two blocks removed that you indicate in res, remove the line:
<td class="tcat" colspan="2"><strong>{$lang->custom_avatar}</strong></td>

from the template and also the line:
    <input type="submit" class="button" name="submit" value="{$lang->change_avatar}" />


Then these 2 blocks disappear.
Custom Avatar Options :
No one can get avatar by URL.
Only administrators and moderators can get avatar by uploading it.

It works like this right now but Users - who can not get avatar by both url and upload still can see " Custom Avatar " block that was what I meant in first post.

Now its awesome, thank you!
Pages: 1 2