News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

Question about topic(s)

Started by Anonyomus, August 22, 2015, 10:32:56 AM

Previous topic - Next topic

Anonyomus

Hello!
First of all, sorry if posted it to wrong topic (newb >_<), and sorry for eng.

My question is, how can i disable to users, to change topic icon (angry face, etc...)
i mean, check the img hxxp:i.imgur.com/b8jTf5d.png?1 [nonactive], the users can change their topic's icon, and i want to remove this function not the icons, just users dont change icon, the only person who can change is admin (myb from PMA if needed)

Thanks for help!

margarett

For you to disable the possibility to change the icon directly in the topic display (eg, when viewing posts inside a topic):
Display.template.php
Find:
<img src="', $message['icon_url'] . '" alt=""', $message['can_modify'] ? ' id="msg_icon_' . $message['id'] . '"' : '', ' />

Replace with:
<img src="', $message['icon_url'] . '" alt=""', $context['user']['is_admin'] ? ' id="msg_icon_' . $message['id'] . '"' : '', ' />


For you to disable the possibility to change the icon when creating or editing a post:
Post.template.php, find:
</dd>
<dt class="clear_left">
', $txt['message_icon'], ':
</dt>
<dd>
<select name="icon" id="icon" onchange="showimage()">';

// Loop through each message icon allowed, adding it to the drop down list.
foreach ($context['icons'] as $icon)
echo '
<option value="', $icon['value'], '"', $icon['value'] == $context['icon'] ? ' selected="selected"' : '', '>', $icon['name'], '</option>';

echo '
</select>
<img src="', $context['icon_url'], '" name="icons" hspace="15" alt="" />
</dd>

Replace with:
</dd>';
if ($context['user']['is_admin'])
{
echo '
<dt class="clear_left">
', $txt['message_icon'], ':
</dt>
<dd>
<select name="icon" id="icon" onchange="showimage()">';

// Loop through each message icon allowed, adding it to the drop down list.
foreach ($context['icons'] as $icon)
echo '
<option value="', $icon['value'], '"', $icon['value'] == $context['icon'] ? ' selected="selected"' : '', '>', $icon['name'], '</option>';

echo '
</select>
<img src="', $context['icon_url'], '" name="icons" hspace="15" alt="" />
</dd>';
}
echo '


I think I didn't forget anything :P
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Advertisement: