Is it possible (preferably without a plugin having to be written) to restrict certain usergroups from using or even seeing the Avatar URL section of the UserCP?
I have a premium forum user group that I would like to allow use of this instead of non-premium users.
Thanks
You can use template conditional plugin and hide url avtar upload box from any specific usergroup easily.
Install
http://mybbhacks.zingaburga.com/showthread.php?tid=260
Login to ACP, Open your theme's template and expand it, -> Expand User Control Panel Templates -> find and edit "usercp_changeavatar" template
Add
<if in_array($GLOBALS['mybb']->user['usergroup'], array(0,0,4)) then>
(Change 0 with the usergroup's you want them to see url box, rest usergroups wil not be able to see that box.)
before
<tr>
<td align="center" class="trow1" width="1%"><input type="radio" class="radio" name="avatar" value="url"{$checked['url']} /></td>
<td class="trow1" width="40%"><strong>{$lang->avatar_url}</strong><br /><span class="smalltext">{$lang->avatar_url_note}</span></td>
<td class="trow1" width="55%"><input type="text" class="textbox" name="avatarurl" size="25" maxlength="100" value="{$avatarurl}" /></td>
</tr>
and after that ^ , add
</if>
(2013-02-14, 07:49 PM)Alone warrior Wrote: [ -> ]You can use template conditional plugin and hide url avtar upload box from any specific usergroup easily.
Install http://mybbhacks.zingaburga.com/showthread.php?tid=260
Login to ACP, Open your theme's template and expand it, -> Expand User Control Panel Templates -> find and edit "usercp_changeavatar" template
Add
<if in_array($GLOBALS['mybb']->user['usergroup'], array(0,0,4)) then>
(Change 0 with the usergroup's you want them to see url box, rest usergroups wil not be able to see that box.)
before
<tr>
<td align="center" class="trow1" width="1%"><input type="radio" class="radio" name="avatar" value="url"{$checked['url']} /></td>
<td class="trow1" width="40%"><strong>{$lang->avatar_url}</strong><br /><span class="smalltext">{$lang->avatar_url_note}</span></td>
<td class="trow1" width="55%"><input type="text" class="textbox" name="avatarurl" size="25" maxlength="100" value="{$avatarurl}" /></td>
</tr>
and after that ^ , add
</if>
Thank you very much for the response. However I tried what you suggested but it's not working. Other usergroups are able to see the Avatar URL box as if nothing has changed.
This is what I'm using:
<if in_array($GLOBALS['mybb']->user['usergroup'], array(4,6,8,9)) then>
<tr>
<td align="center" class="trow1" width="1%"><input type="radio" class="radio" name="avatar" value="url"{$checked['url']} /></td>
<td class="trow1" width="40%">{$lang->avatar_url}<br /><span class="smalltext">{$lang->avatar_url_note}</span></td>
<td class="trow1" width="55%"><input type="text" class="textbox" name="avatarurl" size="25" maxlength="100" value="{$avatarurl}" /></td>
</tr>
</if>
Usergroups 4, 6, 8 and 9 can see the avatar URL box is that what you wanted?
If you want to stop those usergroups from seeing the input then replace:
<if in_array($GLOBALS['mybb']->user['usergroup'], array(4,6,8,9)) then>
With:
<if !in_array($GLOBALS['mybb']->user['usergroup'], array(4,6,8,9)) then>
(2013-02-17, 01:38 PM)JordanMussi Wrote: [ -> ]Usergroups 4, 6, 8 and 9 can see the avatar URL box is that what you wanted?
If you want to stop those usergroups from seeing the input then replace:
<if in_array($GLOBALS['mybb']->user['usergroup'], array(4,6,8,9)) then>
With:
<if !in_array($GLOBALS['mybb']->user['usergroup'], array(4,6,8,9)) then>
The usergroups 4,6,8,9 are the only ones I want to give access to the avatar URL, any other groups shouldn't see it. No matter the suggestions I've tried none seem to work.
Try using:
<if in_array($mybb->user['usergroup'], array(4,6,8,9)) then>
(2013-02-17, 04:30 PM)JordanMussi Wrote: [ -> ]Try using:
<if in_array($mybb->user['usergroup'], array(4,6,8,9)) then>
Registered users can still see the Avatar URL option in their profile :/
There doesn't appear to be a valid solution to this so I'm going to abandon the thread. Thanks for the help.