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.

Mod Table for staff

View previous topic View next topic Go down

Solved Mod Table for staff

Post by Mati on September 11th 2015, 12:31 pm

I want a mod table code to appear like in the sceditor-group for staff only, I want to add 2 table one for Accepted Forums and one for Rejected Forums.



Last edited by Mati on September 11th 2015, 4:19 pm; edited 1 time in total

Mati
Active Poster

Posts : 1873
Reputation : 281
Language : || HTML || CSS || jQuery ||
Location : At the Gym

http://elite-gaming.forumotion.net/

Back to top Go down

Solved Re: Mod Table for staff

Post by Ange Tuteur on September 11th 2015, 12:35 pm

Hi @Mati,

Something like this topic, right ?
http://help.forumotion.com/t141539-is-that-possible-simple-menu-with-quick-replys#965626

If so, change the condition in the script :
Code:
if (!$.sceditor) return;

to this :
Code:
if (!$.sceditor || !_userdata.user_level) return;

That way it will only show for moderators and admins. If any questions let me know. Smile

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2684
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Mod Table for staff

Post by Mati on September 11th 2015, 12:49 pm

Hi, @Ange Tuteur

I found this code which has classes and is easy for me to understand but is this only for staff members or for everyone?

Can you help me making this for staff only.

Code:
jQuery(window).load(function() {
        /* mod tables */
        jQuery('body').append('<div id="fa_modtable" class="select" style="visibility:hidden;width:auto;text-align:left;"><div class="modOption" id="MTable1">Solved</div><div class="modOption" id="MTable2">Denied</div><div class="modOption" id="MTable3">Information</div>');
        jQuery('.sceditor-group:last-child').after('<div class="sceditor-group" id="fa_modtools"><a class="sceditor-button" title="Mod Tables" onclick="selectWysiwyg(this, \'fa_modtable\');"><div style="background:url(http://i56.servimg.com/u/f56/18/45/41/65/modera10.png) no-repeat center;"></div></a></div>');

        /* mtable functions */
        jQuery('#MTable1').click(function() { /* Solved */
        jQuery('#text_editor_textarea').sceditor('instance').insertText('[table class="notice-solved"][tr][td]Text for solved here','[/td][/tr][/table]');
        });
        jQuery('#MTable2').click(function() { /* Denied */
        jQuery('#text_editor_textarea').sceditor('instance').insertText('[table class="notice-denied"][tr][td]Text for Denied here','[/td][/tr][/table]');
        });
        jQuery('#MTable3').click(function() { /* Information */
        jQuery('#text_editor_textarea').sceditor('instance').insertText('[table class="notice-info"][tr][td]Text for Information here','[/td][/tr][/table]');
        });

        /* hide list onclick */
        jQuery('.modOption').click(function() { jQuery('#fa_modtable').css('visibility','hidden'); });
        });

Mati
Active Poster

Posts : 1873
Reputation : 281
Language : || HTML || CSS || jQuery ||
Location : At the Gym

http://elite-gaming.forumotion.net/

Back to top Go down

Solved Re: Mod Table for staff

Post by Ange Tuteur on September 11th 2015, 12:57 pm

Sure, replace it with this script :
Code:
jQuery(function(){
  _userdata.user_level && jQuery(function() {
    /* mod tables */
    jQuery('body').append('<div id="fa_modtable" class="select" style="visibility:hidden;width:auto;text-align:left;"><div class="modOption" id="MTable1">Solved</div><div class="modOption" id="MTable2">Denied</div><div class="modOption" id="MTable3">Information</div>');
    jQuery('.sceditor-group:last-child').after('<div class="sceditor-group" id="fa_modtools"><a class="sceditor-button" title="Mod Tables" onclick="selectWysiwyg(this, \'fa_modtable\');"><div style="background:url(http://i56.servimg.com/u/f56/18/45/41/65/modera10.png) no-repeat center;"></div></a></div>');

    /* mtable functions */
    jQuery('#MTable1').click(function() { /* Solved */
      jQuery('#text_editor_textarea').sceditor('instance').insertText('[table class="notice-solved"][tr][td]Text for solved here','[/td][/tr][/table]');
    });

    jQuery('#MTable2').click(function() { /* Denied */
      jQuery('#text_editor_textarea').sceditor('instance').insertText('[table class="notice-denied"][tr][td]Text for Denied here','[/td][/tr][/table]');
    });

    jQuery('#MTable3').click(function() { /* Information */
      jQuery('#text_editor_textarea').sceditor('instance').insertText('[table class="notice-info"][tr][td]Text for Information here','[/td][/tr][/table]');
    });

    /* hide list onclick */
    jQuery('.modOption').click(function() { jQuery('#fa_modtable').css('visibility','hidden'); });
  });
});

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2684
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Mod Table for staff

Post by Mati on September 11th 2015, 4:20 pm

Thank you this is solved now you may lock it Smile

Mati
Active Poster

Posts : 1873
Reputation : 281
Language : || HTML || CSS || jQuery ||
Location : At the Gym

http://elite-gaming.forumotion.net/

Back to top Go down

Solved Re: Mod Table for staff

Post by Ange Tuteur on September 11th 2015, 4:30 pm

You're welcome ^^

Topic archived

Have a good day. Smile

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2684
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.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