Board Thread:Support Requests - Designing Your Wikia/@comment-24911095-20150717225623/@comment-24911095-20150718175218

PhilippL wrote: This is also a good code for making own user-groups/user-tags: // WRITTEN BY User // If you use this on your wiki, you assume responsibility for // ensuring compliance with Wikia’s ToU // BEGIN CREATING ADDITIONAL USER RIGHTS ICONS FOR PROFILEMASTHEADS function addMastheadTags ( ) { var rights  = { } ; // BEGIN List of Accounts Given Extra User Rights Icons rights[ <span class="st0" style="color:rgb(42,161,152);">"YOUR USERNAME" <span class="br0" style="color:rgb(0,153,0);">]               <span class="sy0" style="color:rgb(51,153,51);"> = <span class="br0" style="color:rgb(0,153,0);">[ <span class="st0" style="color:rgb(42,161,152);">"YOUR TAG NAME" <span class="br0" style="color:rgb(0,153,0);">] <span class="sy0" style="color:rgb(51,153,51);">; <span class="co1" style="font-style:italic;color:rgb(147,161,161);">// END List of Accounts Given Extra User Rights Icons <span class="co1" style="font-style:italic;color:rgb(147,161,161);">// BEGIN Script to Remove Old Rights Icons & Insert New <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( wgCanonicalSpecialPageName <span class="sy0" style="color:rgb(51,153,51);"> == <span class="st0" style="color:rgb(42,161,152);">"Contributions" <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var user <span class="sy0" style="color:rgb(51,153,51);"> = wgPageName.<span class="me1" style="color:rgb(38,139,210);">substring <span class="br0" style="color:rgb(0,153,0);">( wgPageName.<span class="me1" style="color:rgb(38,139,210);">lastIndexOf <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">"/" <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">+ <span class="nu0" style="color:rgb(211,54,130);">1 <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">replace <span class="br0" style="color:rgb(0,153,0);">( <span class="co2" style="font-style:italic;color:rgb(147,161,161);">/_/g <span class="sy0" style="color:rgb(51,153,51);">, <span class="st0" style="color:rgb(42,161,152);">" " <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">else <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var user <span class="sy0" style="color:rgb(51,153,51);"> = wgTitle<span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">typeof rights<span class="br0" style="color:rgb(0,153,0);">[ user<span class="br0" style="color:rgb(0,153,0);">] <span class="sy0" style="color:rgb(51,153,51);">!= <span class="st0" style="color:rgb(42,161,152);">"undefined" <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="co1" style="font-style:italic;color:rgb(147,161,161);">// remove old rights <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'.UserProfileMasthead .masthead-info span.tag' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">remove <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">for <span class="br0" style="color:rgb(0,153,0);">( <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var i<span class="sy0" style="color:rgb(51,153,51);"> = <span class="nu0" style="color:rgb(211,54,130);">0 <span class="sy0" style="color:rgb(51,153,51);">, len<span class="sy0" style="color:rgb(51,153,51);"> = rights<span class="br0" style="color:rgb(0,153,0);">[ user<span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">length <span class="sy0" style="color:rgb(51,153,51);">; i <span class="sy0" style="color:rgb(51,153,51);">< len<span class="sy0" style="color:rgb(51,153,51);">; i<span class="sy0" style="color:rgb(51,153,51);">++ <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="co1" style="font-style:italic;color:rgb(147,161,161);">// add new rights <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'<span class="tag" span style="margin-left: 10px !important">' <span class="sy0" style="color:rgb(51,153,51);">+ rights<span class="br0" style="color:rgb(0,153,0);">[ user<span class="br0" style="color:rgb(0,153,0);">] <span class="br0" style="color:rgb(0,153,0);">[ i<span class="br0" style="color:rgb(0,153,0);">] <span class="sy0" style="color:rgb(51,153,51);">+           <span class="st0" style="color:rgb(42,161,152);">' ' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">appendTo <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'.masthead-info hgroup' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} <span class="co1" style="font-style:italic;color:rgb(147,161,161);">// END Script to Remove Old Rights Icons & Insert New <span class="br0" style="color:rgb(0,153,0);">} <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'#UserProfileMasthead' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{      addMastheadTags<span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="co1" style="font-style:italic;color:rgb(147,161,161);">// END CREATING ADDITIONAL USER RIGHTS ICONS FOR  PROFILEMASTHEADS <span class="co1" style="font-style:italic;color:rgb(147,161,161);">// Nice, but can you tell me how it works?