Acest script permite alegerea culori pentru titlul temei de discuție. În General appearance of forum pages după $BODY$ punem codul:
Cod
<?if($PAGE_ID$='forum' || $PAGE_ID$='recentthreads')?>
<script>
$('.threadLink').each(function () {
str = $(this).text();
exp = /^\[color\=(ff0000|ffa500|ffff00|00ff00|42aaff|0000ff|8b00ff)\](.*?)\[\/color\]$/;
if (exp.test(str)) {
matches = exp.exec(str);
$(this).html('<span style="color:#'+matches[1]+'">'+matches[2]+'</span>');
}
});
</script>
<?endif?>
<?if($PAGE_ID$='threadpage' || $PAGE_ID$='postedit')?>
<script>
exp = /^\[color\=(ff0000|ffa500|ffff00|00ff00|42aaff|0000ff|8b00ff)\](.*?)\[\/color\]$/;
str = $('.forumBarA').eq('0').html();
if (exp.test(str)) {
matches = exp.exec(str);
$('.forumBarA').html('<span style="color:#'+matches[1]+'">'+matches[2]+'</span>');
}
</script>
<?endif?>
<?if($PAGE_ID$='postedit' || $PAGE_ID$='addthread' || $PAGE_ID$='addpoll')?>
<script>
$('input[name="name"]').css({'width': '87%','border-right': '0px'}).after('<select id="color"><option selected disabled value="none"> Alege culoarea </option><option value="ff0000">Roșu</option><option value="ffa500">Portocaliu</option><option value="ffff00">Galben</option><option value="00ff00">Verde</option><option value="42aaff">Albastru deschis</option><option value="0000ff">Albastru</option><option value="8b00ff">Violet</option></select>');
$('#frF16').hide().after('<input type="button" value="Salvează" class="postSubmit" style="width:150px;font-weight:bold;" id="post">');
$('#post').live('click', function () {
c = $('#color').val();
if (c != 'none') {
d = $('input[name="name"]').val();
$('input[name="name"]').val('[color=' + c + ']' + d + '[/color]');
}
$('#frF16').click();
});
</script>
<?endif?>
Rezultat: http://maxrom.ucoz.com/forum/31
[texterror4]Sursa: http://webo4ka.ru
[/texterror4]