We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Locked Topic
[ C ] How To Use Color Codes On Shoutbox
Topic Started: May 28 2013, 09:52 AM (2,551 Views)
barlevy21
Member
[ * ]
hi, i would like to request for a code only for admins that can post on diffrent color, like red/blue etc, but only for admins i mean it isnt allow for another members.

is it possible?
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Admin CP Posted Image Themes Posted Image Board Template Posted Image Below the Board
Code:
 
<script type="text/javascript">
//<![CDATA[
$(document).ready(function () {
$('#shoutpost button').click(function (e) {
if ($('input[name="shouttext"]').val().indexOf('/color') === 1 && $.zb.admin !== 1) {
e.returnValue = e.preventDefault && e.preventDefault() ? false : false;
alert('Only administrators are allowed to use the Color BBCode in the shoutbox');
}
});
});
//]]>
</script>
If you want the Color BBCode drop down menu added to the shoutbox for administrators only as well, I can add that.
Offline Profile Goto Top
 
barlevy21
Member
[ * ]
i am the admin of the board but it seems wrong code cus i cant use any color.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Code:
 
[color=red]Test[/color]
What happens when you try posting that?
Offline Profile Goto Top
 
barlevy21
Member
[ * ]
it is do red color but i dont want to do every notice like this
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Use this instead:
Code:
 
<script type="text/javascript">
//<![CDATA[
$('#shoutpost button').click(function (e) {
if ($('input[name="shouttext"]').val().indexOf('/color') === 1 && $.zb.admin !== 1) {
e.returnValue = e.preventDefault && e.preventDefault() ? false : false;
alert('Only administrators are allowed to use the Color BBCode in the shoutbox');
}
});

if ($.zb.admin === 1) {
$('#shoutpost button').after('<select id="shoutcolor"><option value="" selected="selected">Color</option> <option value="#000">Black</option> <option value="#fff">White</option> <option value="#ee4a2d">Red</option> <option value="#fb8a00">Orange</option> <option value="#fe0">Gold</option> <option value="#090">Green</option> <option value="#80a0ff">Light Blue</option> <option value="#5a70b3">Blue</option> <option value="#9300C4">Purple</option></select>');
}

function wrapText(elementID, openTag, closeTag) {
var textArea = $(elementID);
var len = textArea.val().length;
var start = textArea[0].selectionStart;
var end = textArea[0].selectionEnd;
var selectedText = textArea.val().substring(start, end);
var replacement = openTag + selectedText + closeTag;
textArea.val(textArea.val().substring(0, start) + replacement + textArea.val().substring(end, len));
}

$('#shoutcolor').change(function () {
var color = $(this).val();
wrapText('input[name="shouttext"]', '[color=' + color + ']', '[/color]');
$(this).val('');
});
//]]>
</script>
Offline Profile Goto Top
 
barlevy21
Member
[ * ]
thanks!
could i ask how you can do a slide notice in the top of the board? i saw a code but couldnt find
btw the code you gave me show me the colors but it doesnt show me the color on shoutbox
Edited by barlevy21, Jun 6 2013, 06:19 PM.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
I think this is what you're wanting: http://if.invisionfree.com/single/?p=18025331&t=5168406

Does the Color BBCode generate in the input field when you select a color from the drop down menu?
Offline Profile Goto Top
 
barlevy21
Member
[ * ]
Cory
Jun 7 2013, 01:39 AM
I think this is what you're wanting: http://if.invisionfree.com/single/?p=18025331&t=5168406

Does the Color BBCode generate in the input field when you select a color from the drop down menu?
nop and no it wasnt what i have ask, it should be like a notice from the right side to left, i can also choose color on shoutbox but it doesnt appear the color
up
Edited by barlevy21, Jun 7 2013, 12:28 PM.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
I think you're wanting to use the non-standard marquee tag: http://www.tagindex.net/html/text/marquee_example.html

If not, an example would be nice.

A workable link to your board would help.
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Closed Requests · Next Topic »
Locked Topic