Advertisement
SSYT

zBB by SSYT

Apr 3rd, 2016
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 1.76 KB | None | 0 0
  1. // zBB Functions
  2. // zBB is sceditor new functions, thanks Zeus, SSYT !
  3. // Beta version of code !
  4. (function($) {
  5.     $(function() {$(function() {
  6.         var zBB_config = {
  7.             list: [
  8.                 "a.sceditor-button.sceditor-button-bold",
  9.                 "a.sceditor-button.sceditor-button-italic",
  10.                 "a.sceditor-button.sceditor-button-underline",
  11.                 "a.sceditor-button.sceditor-button-strike",
  12.                 "a.sceditor-button.sceditor-button-left",
  13.                 "a.sceditor-button.sceditor-button-center",
  14.                 "a.sceditor-button.sceditor-button-right",
  15.                 "a.sceditor-button.sceditor-button-justify",
  16.                 "a.sceditor-button.sceditor-button-quote",
  17.                 "a.sceditor-button.sceditor-button-code",
  18.                 "a.sceditor-button.sceditor-button-faspoiler",
  19.                 "a.sceditor-button.sceditor-button-fahide"
  20.             ],
  21.             type: {
  22.                 onStaff : {
  23.                     admin: false,
  24.                     moderator: false
  25.                 },
  26.                
  27.                 byPosts:
  28.                 {
  29.                     active: true,
  30.                     postNumber: 15
  31.                 }
  32.             },
  33.             actived: true
  34.         };
  35.        
  36.         if($('.sceditor-container').length && zBB_config.actived == true) {
  37.             console.log('SCEditor has been detected !'); // For debugg
  38.             if((_userdata.user_level == 1) && (zBB_config.type.onStaff.admin == true)) {
  39.                 var o = 0, sc = $('.sceditor-container');
  40.                 for(o; o<zBB_config.list.length; o++) $(zBB_config.list[o], sc).hide();
  41.             }
  42.            
  43.             if((_userdata.user_level == 2) && (zBB_config.type.onStaff.moderator == true)) {
  44.                 var o = 0, sc = $('.sceditor-container');
  45.                 for(o; o<zBB_config.list.length; o++) $(zBB_config.list[o], sc).hide();
  46.             }
  47.            
  48.             if((zBB_config.type.byPosts.active == true) && (_userdata.user_posts < zBB_config.type.byPosts.postNumber)) {
  49.                 var o = 0, sc = $('.sceditor-container');
  50.                 for(o; o<zBB_config.list.length; o++) $(zBB_config.list[o], sc).hide();
  51.             }
  52.         }
  53.     })});
  54. })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement