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.

A code staff color

View previous topic View next topic Go down

Solved A code staff color

Post by Mati on January 27th 2015, 3:30 pm

I want a script for staff color to be seen and use by staff members only. I like to have an icon https://i38.servimg.com/u/f38/14/73/12/96/color-10.png" alt="" /> to the sceditor group for example when you click on it a drop down shows with the members names.

Member 1
Member 1
Member 1

To add on the script something like this
Code:
[color=#000][b][/b][/color]

Mati
Active Poster

Posts : 1882
Reputation : 283
Language : || HTML || CSS || jQuery ||
Location : At the Gym

http://footballforums.forumotion.net/

Back to top Go down

Solved Re: A code staff color

Post by _Twisted_Mods_ on January 27th 2015, 5:41 pm

css

Code:

#memcolors {
  position: relative;
  display: block;
  height: initial;
  background-color: white;
  background-image: none;
  z-index: 9999;
  width: initial;
   border: 1px solid black;
   padding:4px
}
#colopt {
   
  color: black;
  font-size: 12px;
  line-height: initial;
  text-indent: 0;
  width: initial;
  background-image: none;
}

script
set to in all pages

var membrz = ['Twisted:#fff','Mati:#00f','Whoever:#ff0']; < title of list item and color seperated with :
var urlist = ['123','97664']; << list of user id#'s who you want to have access

Code:
$(function(){
var membrz = ['Twisted:#fff','Mati:#00f','Whoever:#ff0'];
   var urlist = ['123','97664'];
   var memcode ="";
for(var x= 0;x< urlist.length;x++){
   if(_userdata.user_id==urlist[x]){

$('.sceditor-button-fahide').after('<a class="sceditor-button sceditor-button-blah1"><div style="background-image: url\(&quot;http://i38.servimg.com/u/f38/14/73/12/96/color-10.png&quot;\); background-size: 100% 100%;" title="Member Color"></div></a>');

      for(var i=0;i<membrz.length;i++){
         var splmem = membrz[i].split(':');
      memcode = memcode + '<div id ="colopt" value="'+splmem[1]+'" >'+splmem[0]+'</div>'   ;
};                             
   $('.sceditor-button-blah1').append('<div id="memcolors" style="position:absolute;">'+memcode+'</div>');
$('#memcolors').css('display','none');
$('.sceditor-button-blah1').click(function(){
if($('#memcolors').css('display')=='block'){$('#memcolors').css('display','none');}else
{$('#memcolors').css('display','block');
}
})
$('#memcolors #colopt').click(function(){
$('#text_editor_textarea').sceditor('instance').insertText('[color='+$(this).attr('value')+'][b]','[/b][/color]');
});   
   }};
});

_Twisted_Mods_
Helper
Helper

Male Posts : 2032
Reputation : 302
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

Solved Re: A code staff color

Post by Mati on January 27th 2015, 6:43 pm

Hi Twisted,

I tried the code but didn't work so are we missing something or...

Mati
Active Poster

Posts : 1882
Reputation : 283
Language : || HTML || CSS || jQuery ||
Location : At the Gym

http://footballforums.forumotion.net/

Back to top Go down

Solved Re: A code staff color

Post by _Twisted_Mods_ on January 27th 2015, 7:23 pm

there was a error on my end but for some reason it still wont work for me and im not getting a error so idk maybe ange can take look when he gets a min

u can try this 1 maybe u have better luck then me

Code:

    $(function(){
    var membrz = ['Twisted:#fff','Mati:#00f','Whoever:#ff0'];
      var urlist = ['1','97664'];
      var memcode ="";
    for(var x= 0;x< urlist.length;x++){
      if(_userdata.user_id==urlist[x]){

    $('.sceditor-button-removeformat').after('<a class="sceditor-button sceditor-button-blah1"><div style="background-image: url\(&quot;http://i38.servimg.com/u/f38/14/73/12/96/color-10.png&quot;\); background-size: 100% 100%;" title="Member Color"></div></a>');

          for(var i=0;i<membrz.length;i++){
            var splmem = membrz[i].split(':');
          memcode = memcode + '<div id ="colopt" value="'+splmem[1]+'" >'+splmem[0]+'</div>';
    };                         
      $('.sceditor-button-blah1').append('<div id="memcolors" style="position:absolute;">'+memcode+'</div>');
    $('#memcolors').css('display','none');
    $('.sceditor-button-blah1').click(function(){
    if($('#memcolors').css('display')=='block'){$('#memcolors').css('display','none');}else
    {$('#memcolors').css('display','block');
    };
    });
    $('#memcolors #colopt').click(function(){
    $('#text_editor_textarea').sceditor('instance').insertText('[color='+$(this).attr('value')+'][b]','[/b][/color]');
    }); 
      };};
    });

_Twisted_Mods_
Helper
Helper

Male Posts : 2032
Reputation : 302
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

Solved Re: A code staff color

Post by Mati on January 27th 2015, 8:06 pm

Nope no luck at all still doesn't work. blackeye

Mati
Active Poster

Posts : 1882
Reputation : 283
Language : || HTML || CSS || jQuery ||
Location : At the Gym

http://footballforums.forumotion.net/

Back to top Go down

Solved Re: A code staff color

Post by _Twisted_Mods_ on January 28th 2015, 12:22 am

ok so after overlooking some of my other code i realised this had to be put into a double function .. witch i reall have no idea y ill have to ask ange abt that 1 because it confuses mee but either way here u go .. it works.. dont forget css from above


Code:

$(function(){
$(function(){
        var membrz = ['Twisted:#fff','Mati:#00f','Whoever:#ff0'];
          var urlist = ['1','97664'];
          var memcode ="";
        for(var x= 0;x< urlist.length;x++){
          if(_userdata.user_id==urlist[x]){

      
  $('.sceditor-button-removeformat').after('<a class="sceditor-button sceditor-button-mcolor"><div style="background-image: url\(&quot;http://i38.servimg.com/u/f38/14/73/12/96/color-10.png&quot;\); background-size: 100% 100%;" title="Insert Widget Code"></div></a>');



              for(var i=0;i<membrz.length;i++){
                var splmem = membrz[i].split(':');
              memcode = memcode + '<div id ="colopt" value="'+splmem[1]+'" >'+splmem[0]+'</div>';
        };                       
         
$('.sceditor-button-mcolor').append('<div id="memcolors" style="position:absolute;">'+memcode+'</div>');

        $('#memcolors').css('display','none');
        $('.sceditor-button-mcolor').click(function(){
        if($('#memcolors').css('display')=='block'){$('#memcolors').css('display','none');}else
        {$('#memcolors').css('display','block');
        };
        });
        $('#memcolors #colopt').click(function(){
        $('#text_editor_textarea').sceditor('instance').insertText('[color='+$(this).attr('value')+'][b]','[/b][/color]');
        });
          };};
        });});



_Twisted_Mods_
Helper
Helper

Male Posts : 2032
Reputation : 302
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

Solved Re: A code staff color

Post by _Twisted_Mods_ on February 13th 2015, 2:09 am

Topic solved and archived

_Twisted_Mods_
Helper
Helper

Male Posts : 2032
Reputation : 302
Language : English
Location : Ms

http://liquidcode.forumotion.com

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