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/Admin botton?

View previous topic View next topic Go down

Solved Mod/Admin botton?

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

I added this to my Java scripts

Code:
$(document).ready(function(){
$('input[value="Others"]').after('<img src="http://illiweb.com/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!

neb is krazy
New Member

Posts : 22
Reputation : 1
Language : english

Back to top Go down

Solved Re: Mod/Admin botton?

Post by LGforum on 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
Hyperactive

Male Posts : 2260
Reputation : 258
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

Solved Re: Mod/Admin botton?

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

How do i enter in scripts and what widget do i enter it in?

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 on April 3rd 2012, 7:27 am

Ya, but i cant get rid of this ?


neb is krazy
New Member

Posts : 22
Reputation : 1
Language : english

Back to top Go down

Solved Re: Mod/Admin botton?

Post by kirk on 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
Forumaster

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

Back to top Go down

Solved Re: Mod/Admin botton?

Post by kirk on 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://illiweb.com/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
Forumaster

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

Back to top Go down

Solved Re: Mod/Admin botton?

Post by LGforum on 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
Hyperactive

Male Posts : 2260
Reputation : 258
Language : English
Location : UK

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