Latest topics
» Forumactif Edge - Releases
by Ange Tuteur Tue 03 Sep 2019, 11:49
» GIFActif - Giphy Button for the Editor
by Ange Tuteur Wed 08 May 2019, 17:21
» Forum Closure
by Ange Tuteur Mon 01 Jan 2018, 01:28
» Chit Chat Thread
by Valoish Sun 31 Dec 2017, 19:15
» Font/Text background color.
by Valoish Sun 31 Dec 2017, 19:11
» Forumactif Messenger - Instant Message Application for Forumotion
by Wolfuryo Sun 31 Dec 2017, 18:24
» [GAME] Count to One Million!
by brandon_g Fri 29 Dec 2017, 18:58
» Post Cards
by manikbiradar Wed 20 Dec 2017, 07:50
» [GAME] Countdown from 200,000
by Valoish Wed 13 Dec 2017, 23:22
» GeekPolice Tech Support Forums - GeekPolice.net
by Dr Jay Mon 11 Dec 2017, 19:12
» Asking about some plugin for Forumotion
by Dr Jay Mon 11 Dec 2017, 19:10
» [GAME] What are you thinking right now?
by Van-Helsing Sat 09 Dec 2017, 14:51
» Widget : Similar topics
by ranbac Wed 06 Dec 2017, 18:11
» Change the Background of the Forum and put an image and how to make prefixs?
by Clement Wed 06 Dec 2017, 15:19
» Hello from Western Australia
by SarkZKalie Wed 06 Dec 2017, 05:34
by Ange Tuteur Tue 03 Sep 2019, 11:49
» GIFActif - Giphy Button for the Editor
by Ange Tuteur Wed 08 May 2019, 17:21
» Forum Closure
by Ange Tuteur Mon 01 Jan 2018, 01:28
» Chit Chat Thread
by Valoish Sun 31 Dec 2017, 19:15
» Font/Text background color.
by Valoish Sun 31 Dec 2017, 19:11
» Forumactif Messenger - Instant Message Application for Forumotion
by Wolfuryo Sun 31 Dec 2017, 18:24
» [GAME] Count to One Million!
by brandon_g Fri 29 Dec 2017, 18:58
» Post Cards
by manikbiradar Wed 20 Dec 2017, 07:50
» [GAME] Countdown from 200,000
by Valoish Wed 13 Dec 2017, 23:22
» GeekPolice Tech Support Forums - GeekPolice.net
by Dr Jay Mon 11 Dec 2017, 19:12
» Asking about some plugin for Forumotion
by Dr Jay Mon 11 Dec 2017, 19:10
» [GAME] What are you thinking right now?
by Van-Helsing Sat 09 Dec 2017, 14:51
» Widget : Similar topics
by ranbac Wed 06 Dec 2017, 18:11
» Change the Background of the Forum and put an image and how to make prefixs?
by Clement Wed 06 Dec 2017, 15:19
» Hello from Western Australia
by SarkZKalie Wed 06 Dec 2017, 05:34
Recent Tutorials
Top posting users this month
Top Achievers
Who is online?
In total there are 7 users online :: 0 Registered, 0 Hidden and 7 Guests
None
Most users ever online was 515 on Tue 14 Sep 2021, 15:24
None
Most users ever online was 515 on Tue 14 Sep 2021, 15:24
[SOLVED] about code snippet
Page 1 of 1 • Share
could i make this button of code snippet for moderator Only
i tried to take the code and put it in module of Forum widgets management
and make his Rights for moderator only but it was failed
could you help me
because i will use this code to make special tables
i tried to take the code and put it in module of Forum widgets management
and make his Rights for moderator only but it was failed
could you help me
because i will use this code to make special tables
You're using the following tutorial, correct ?
https://fmdesign.forumotion.com/t411-how-to-install-the-code-snippet-button
If so, replace
in the script with
. This will make the button only display for moderators and admins.
if _userdata.user_level is equal to 2 or 1 it'll show the button.
if _userdata.user_level is equal to 0 it wont show the button
In javascript 0 returns false and any number above 0 returns true.
https://fmdesign.forumotion.com/t411-how-to-install-the-code-snippet-button
If so, replace
|
|
if _userdata.user_level is equal to 2 or 1 it'll show the button.
if _userdata.user_level is equal to 0 it wont show the button
In javascript 0 returns false and any number above 0 returns true.
should i make it like this ?
- Code:
$(function() {
if ($.sceditor && _userdata.user_level = 1)
$.sceditor.command.set('inline-code', {
exec : function() {
this.insert('[table class="inline-code"][tr][td][code]','[/code][/td][/tr][/table]');
},
txtExec : function() {
this.insert('[table class="inline-code"][tr][td][code]','[/code][/td][/tr][/table]');
},
tooltip : 'Code snippet'
});
toolbar = toolbar.replace(/code/, 'code,inline-code');
}
});
document.write('<style type="text/css">.inline-code,.inline-code *{display:inline-block!important}.inline-code .codebox{background-color:rgba(0,0,0,.04)!important;border:1px solid rgba(0,0,0,.05)!important;margin:0;line-height:12px;border-radius:3px}#mpage-body .inline-code .codebox p,.inline-code .codebox dt{display:none!important}.inline-code .codebox code{padding:0!important;margin:0;border:none;background:0 0}.sceditor-button-inline-code div{background-image:url(http://i21.servimg.com/u/f21/18/21/41/30/snippe10.png)!important}</style>');
No, if you're comparing two values you should use this comparison symbol :
Like this :
If you want it to work for both admins and mods you should write the condition like this :
|
Like this :
- Code:
_userdata.user_level == 1
If you want it to work for both admins and mods you should write the condition like this :
- Code:
if ($.sceditor && _userdata.user_level)
I'm sorry but my language is arabic and i week in English
do you mean that if i need it to Admins only i have to write that
do you mean that if i need it to Admins only i have to write that
|
- Sponsored content
Similar topics
Create an account or log in to leave a reply
You need to be a member in order to leave a reply.
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|