All-For-Kompa.RU

Сегодня:
Карта сайта форум Главная
Скрыть рекламный блок
  • Страница 1 из 1
  • 1
Модератор форума: Vladislavik-36  
Форум » Движки » uCoz » Иконки темы
Иконки темы
leonP4Дата: Вторник, 03.08.2010, 01:17 | Сообщение # 1
.:хакер:.
Группа: Администратор
Сообщений: 664
Награды: 11
Статус: Offline
1. Подключаем jQuery
2. В CSS

Code
.thDescr,
.threadDescr {display:none}
#frM30 img {opacity:.33; -moz-opacity: 0.33; filter: alpha(opacity=33);}   
#frM30 img:hover {opacity:.5; -moz-opacity: 0.5; filter: alpha(opacity=50);}   
#frM30 img.selectedImg {opacity:1; ; -moz-opacity: 1; filter: alpha(opacity=100);}

Стили можно изменить на свой вкус
3. Вставляем в "Общий вид страниц форума" после $BODY$

Code
<script type="text/javascript">$('.thDescr').each(function(){
  var s = $(this).html().match( /sml\[(\w+)\]/ );
  $(this).show();
  if (s==null) return;
  var name = s[1];
  s = s[0];
  $(this).html( $(this).html().replace(s,'') );
  if( $(this).html()=='()' ) $(this).html('');
  if( $('table.gTable:first td.gTableTop div.gTopCornerRight + img').size()==0 ) $('table.gTable:first td.gTableTop div.gTopCornerRight').after('<img src="/images/threadIcons/'+name+'.png" /> ');
})
$('.threadDescr').each(function(){
  var s = $(this).html().match( /sml\[(\w+)\]/ );
  $(this).show();
  if (s==null) return;
  var name = s[1];
  s = s[0];
  $(this).html( $(this).html().replace(s,'') );
  $(this).parent().prev().find('img').attr('src','/images/threadIcons/'+name+'.png');
});
</script>

Свои иконки заливаем в папку images/threadIcons. Имена картинок должны состоять только из букв, цифр и знака нижнего подчеркивания
4. Открываем шаблон формы добавления сообщения. Заменяем $_THREAD_DESCR$ на

Code
<input type="text" id="threadAbout" value="" class="postDescrFl" size="60" maxlength="50" />
<img src="http://s3.ucoz.net/img/fr/ic1/thread.gif" alt="" class="selectedImg" />
<img src="/images/threadIcons/картинка1.png" alt="картинка1" />
...
<img src="/images/threadIcons/картинкаN.png" alt="картинкаN" />
<div style="display:none">$_THREAD_DESCR$</div>

Где http://s3.ucoz.net/img/fr/ic1/thread.gif - адрес стандартной картинки (при выборе этой картинки, никаких замен происходить не будет)
В конец шаблона вставляем

Code
<?if($_THREAD_NAME$)?>
<script type="text/javascript">
$('#frF3').css('width','auto').attr('size', 60);
$('#frM30 img').click(function(){
  $('#frM30 .selectedImg').removeClass('selectedImg');
  $(this).addClass('selectedImg')
});
if( $('#frF4').val()!='' ){
  if( $('#frF4').val().match( /sml\[\w+\]/ ) ){
   $('#threadAbout').val( $('#frF4').val().replace( $('#frF4').val().match( /sml\[(\w+)\]/ )[0], '' ) );
   $('#frM30 .selectedImg').removeClass('selectedImg');
   $('#frM30 img[src$="'+ $('#frF4').val().match( /sml\[(\w+)\]/ )[1] +'.png"]').addClass('selectedImg');
  } else $('#threadAbout').val( $('#frF4').val() );
}
function checksubmit(){
  var s = $('#frM30 .selectedImg').attr('src').match( /\/(\w*)\.png/i );
  if( s!=null ) s = 'sml['+s[1]+']'; else s='';
  $('#frF4').val( s + $('#threadAbout').val() );
  return true;
}</script>
<?endif?>


Админ - Первый источник флуда на форуме =)
 
Форум » Движки » uCoz » Иконки темы
  • Страница 1 из 1
  • 1
Поиск:
Реклама