Warning button help
2 posters
Page 1 of 1
Warning button help
ok ange how do i setup your code so only users of that lvl can see the buttons
like admin can only see admin button,mods only see mod button?
like admin can only see admin button,mods only see mod button?
Re: Warning button help
Hello,
You're referring to this tuto ?
https://help.forumotion.com/t136169-warning-button-for-administrators-and-moderators
If so, by default Admins can see the admin/mod buttons, and users with moderation rights can only see the mod button.
You're referring to this tuto ?
https://help.forumotion.com/t136169-warning-button-for-administrators-and-moderators
If so, by default Admins can see the admin/mod buttons, and users with moderation rights can only see the mod button.
Re: Warning button help
yes....
i know but i wanna add more groups and only have each group see theres including admin
i know but i wanna add more groups and only have each group see theres including admin
Re: Warning button help
Okay, see if this works :
I've made some modifications for making buttons for groups.
Administration Panel > Modules > JavaScript codes management > Create a new script
Title : Your choice
Placement : In all the pages
Under the comment // custom buttons, you can write the following function to create new buttons : groupButton(users, tagname, image);
users : Takes an array. In the array insert the user ID of the users you want to view the button.
Example groupButton([1, 23, 6, 188], tagname, image);
tagname : Takes a string value. Insert the name of the tag.
Example groupButton([1, 23, 6, 188], 'tag', image);
[tag] ... [/tag]
image : Takes a string value. Insert the image that will be used as the button.
Example groupButton([1, 23, 6, 188], 'tag', '/myimage.gif');
I've made some modifications for making buttons for groups.
Administration Panel > Modules > JavaScript codes management > Create a new script
Title : Your choice
Placement : In all the pages
- Code:
$(function() {
// custom buttons
groupButton([1, 2, 3], 'test', 'http://i39.servimg.com/u/f39/18/21/41/30/bouton10.png');
function groupButton(users, tagname, image) {
for (i=0; i<users.length; i++) {
if (users[i] === _userdata.user_id) {
$("#text_editor_textarea").before("<img src='"+image+"' title='Warning' id='"+tagname+"-b'/>");
$('#'+tagname+'-b').click(function(){$('#text_editor_textarea').sceditor('instance').insertText('['+tagname+']','[/'+tagname+']')});
}
}
var reg = new RegExp('\\['+tagname+'\\](.+?)\\[/'+tagname+'\\]','ig');
$('div.postbody div').each(function () {if ($(this).text().indexOf('['+tagname+']') != -1) $(this).html($(this).html().replace(reg, '<div class="'+tagname+'_mess"><div class="titl">Warning</div><div>$1 </div></div>'))});
}
});
Under the comment // custom buttons, you can write the following function to create new buttons : groupButton(users, tagname, image);
users : Takes an array. In the array insert the user ID of the users you want to view the button.
Example groupButton([1, 23, 6, 188], tagname, image);
tagname : Takes a string value. Insert the name of the tag.
Example groupButton([1, 23, 6, 188], 'tag', image);
[tag] ... [/tag]
image : Takes a string value. Insert the image that will be used as the button.
Example groupButton([1, 23, 6, 188], 'tag', '/myimage.gif');
Re: Warning button help
no seems to be some kinda bug when i add more then the 2 groups
none of the buttons show up for the other groups unless i change the # to 2 even tho they are not in group 2
none of the buttons show up for the other groups unless i change the # to 2 even tho they are not in group 2
Re: Warning button help
In the first argument (users), are you inserting the user ID of that group member ?
Example :
I am 88576 https://help.forumotion.com/u88576
So I would write my ID, plus others separated by a comma.
Example :
I am 88576 https://help.forumotion.com/u88576
So I would write my ID, plus others separated by a comma.
- Code:
groupButton([88576], 'test', 'http://i39.servimg.com/u/f39/18/21/41/30/bouton10.png');
Re: Warning button help
Yep, you must create an array of UIDs. There's no way to check groups that I know of, so this is the next best way.
Re: Warning button help
You could use _lang.rank_title however, that data requires the toolbar to be active. Also if it contains HTML you need to compare it with the HTML.
ex :
ex :
- Code:
if (_lang.rank_title === '<span style="color:#f00">my</span> rank') console.log(true);
Similar topics
» Warning button for Administrators and Moderators not working
» Warning button for Administrators and Moderators
» Warning button for Administrators and Moderators not working
» "Do not display again button" how to re enable(without clear cache) or use it just as a close button...?
» Warning button for Administrators and Moderators Not Working?
» Warning button for Administrators and Moderators
» Warning button for Administrators and Moderators not working
» "Do not display again button" how to re enable(without clear cache) or use it just as a close button...?
» Warning button for Administrators and Moderators Not Working?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum