The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Mod/Admin botton?

3 posters

Go down

Solved Mod/Admin botton?

Post by neb is krazy April 1st 2012, 6:01 pm

I added this to my Java scripts

Code:
$(document).ready(function(){
$('input[value="Others"]').after('<img src="http://2img.net/i/fa/wysiwyg/separator.png"><button type="button" onclick="input(\'[img]http://img576.imageshack.us/img576/5444/76766987.png[/img]\');" class="button2">solved</button>');
});

function input(text) {
document.getElementById('text_editor_textarea').value+=text;
}

I just dont get how to make the button mod/ Admin ONLY!

Someone plz help!
avatar
neb is krazy
New Member

Posts : 22
Reputation : 1
Language : english

Back to top Go down

Solved Re: Mod/Admin botton?

Post by LGforum April 1st 2012, 10:08 pm

Put the code inside <script> tags, inside a widget. Then set the widgets permissions accordingly (i.e for only admin and mods).
LGforum
LGforum
Hyperactive

Male Posts : 2265
Reputation : 264
Language : English
Location : UK

Back to top Go down

Solved Re: Mod/Admin botton?

Post by neb is krazy April 3rd 2012, 2:30 am

How do i enter in scripts and what widget do i enter it in?
avatar
neb is krazy
New Member

Posts : 22
Reputation : 1
Language : english

Back to top Go down

Solved Re: Mod/Admin botton?

Post by neb is krazy April 3rd 2012, 7:27 am

Ya, but i cant get rid of this ?

Mod/Admin botton? 2e55y0m
avatar
neb is krazy
New Member

Posts : 22
Reputation : 1
Language : english

Back to top Go down

Solved Re: Mod/Admin botton?

Post by kirk April 3rd 2012, 6:46 pm

Well you have the image with bbcode, so thats one thing thats mesing it up.

Code:
[img]http://img576.imageshack.us/img576/5444/76766987.png[/img]

You either want that to be in html format.
Code:
<img src="http://img576.imageshack.us/img576/5444/76766987.png" border="0" alt="" />

or it may be you just have to add the direct image link here like this.

Code:
(\'http://img576.imageshack.us/img576/5444/76766987.png\')
But something dont look right to me like that either? so test them out and let us know. I do not have time to test it right now my self, but can latter when i get home if it is not yet solved by then Smile
kirk
kirk
Forumaster

Male Posts : 11037
Reputation : 653
Language : English,Vulcan,Klingon, Romulan,& Gorn

Back to top Go down

Solved Re: Mod/Admin botton?

Post by kirk April 3rd 2012, 6:57 pm

Rideem3 wrote:

Try this code:
Code:
    <script type="text/javascript">
        jQuery(document).ready(function(){
        jQuery('input[value="Others"]').after('<img src="http://2img.net/i/fa/wysiwyg/separator.png"><button type="button" onclick="input(\'http://img576.imageshack.us/img576/5444/76766987.png\')" class="button2">solved</button>');
        });

        function input(text) {
        document.getElementById('text_editor_textarea').value+="[img]"+text+"[/img]";
        }
    </script>

that looks like it should work, i was not sure about the slashes thats why i dint put the code up.That should most likely should do the trick Smile

thanx man thumright
kirk
kirk
Forumaster

Male Posts : 11037
Reputation : 653
Language : English,Vulcan,Klingon, Romulan,& Gorn

Back to top Go down

Solved Re: Mod/Admin botton?

Post by LGforum April 4th 2012, 3:16 am

RD, you've put the img tags in the function now though meaning it isn't re-usable. Which is the main point of functions Wink
The img tags should stay in the parameter, so the user has the option to add more buttons and input different text.
LGforum
LGforum
Hyperactive

Male Posts : 2265
Reputation : 264
Language : English
Location : UK

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum