The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Using colored Title of the topic for only admin?

View previous topic View next topic Go down

Solved Using colored Title of the topic for only admin?

Post by Swedegfx on March 8th 2015, 6:04 pm

Hi,

Forum version: phpBB3

Right now I have it set that the 'Title of the topic' can be colored.

Is there any settings or script that it could be available only for admins and/or moderators?

I do not want the whole forum full with different colors for the topics, even though it is a graphic forum.
I know the members/taggers like colors but it soon looks like a circus... lol

We only want to use it for important topics.

Have searched on here but did not find anything.

Thanks for info or link where I can read about it!

sunny


Last edited by Swedegfx on March 18th 2015, 6:20 pm; edited 1 time in total

Swedegfx
Forumember

Posts : 40
Reputation : 3
Language : English

http://crazycoolpals.forumotion.com

Back to top Go down

Solved Re: Using colored Title of the topic for only admin?

Post by Ange Tuteur on March 9th 2015, 1:55 am

Hello @Swedegfx,

It's possible by making a modification to the template to hide the select box with CSS and showing with JavaScript based on user type. Go to Administration Panel > Display > Templates > Posts and Private messages > open the template posting_body

Find :
Code:
                    <!-- BEGIN switch_subject_color -->

                    <script type="text/javascript">
                    //<![CDATA[
                        input = document.getElementsByName('subject');
                    //]]>
                    </script>
                    <select name="topic_color" onchange="input[0].style.color = topic_color.value" style="margin-left:10px">
                        {switch_subject.switch_subject_color.TOPIC_TITLE_COLOR_OPTIONS}
                    </select>
                    <script type="text/javascript">
                    //<![CDATA[
                        input[0].style.color = '{switch_subject.switch_subject_color.TOPIC_TITLE_COLOR_DEFAULT}';
                    //]]>
                    </script>

                    <!-- END switch_subject_color -->

Replace by :
Code:
                    <!-- BEGIN switch_subject_color -->
                    <span id="topicColor" style="display:none">
                    <script type="text/javascript">
                    //<![CDATA[
                        if (_userdata.user_level) document.getElementById('topicColor').style.display = 'inline';
                        input = document.getElementsByName('subject');
                    //]]>
                    </script>
                    <select name="topic_color" onchange="input[0].style.color = topic_color.value" style="margin-left:10px">
                        {switch_subject.switch_subject_color.TOPIC_TITLE_COLOR_OPTIONS}
                    </select>
                    <script type="text/javascript">
                    //<![CDATA[
                        input[0].style.color = '{switch_subject.switch_subject_color.TOPIC_TITLE_COLOR_DEFAULT}';
                    //]]>
                    </script>
                    </span>
                    <!-- END switch_subject_color -->

In the replacement is this line of code :
Code:
if (_userdata.user_level) document.getElementById('topicColor').style.display = 'inline';

If you only want to display the colors for admins replace _userdata.user_level by _userdata.user_level == 1. By default, this modification shows the colors only to admins and moderators.

When finished, remember to save and publish your template. Add

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Using colored Title of the topic for only admin?

Post by Swedegfx on March 9th 2015, 2:33 am

Awesome!!

Thank you so much! I will for sure try this if the members do not follow my rules... Very Happy

Really cool!

My forum's name is CrazyCoolPals... lol

You can put solved and I can go here again later on if I get a problem and need to read.

Have a nice day and thanks bunches!
~1~

Swedegfx
Forumember

Posts : 40
Reputation : 3
Language : English

http://crazycoolpals.forumotion.com

Back to top Go down

Solved Re: Using colored Title of the topic for only admin?

Post by APE on March 22nd 2015, 2:42 pm

Topic solved and archived




APE
Manager
Manager

Male Posts : 8618
Reputation : 749
Language : fluent in dork / mumbojumbo & English haha
Location : STUCK IN FORUMOTIONS SERVERS HELP ME !!!!!!

http://chatworld.forumotion.co.uk/

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum