[ Новые сообщения · Участники · Правила форума · Поиск · RSS ]
  • Страница 1 из 1
  • 1
Форум » Softing.do.am » Скрипты » Значок темы форума как на U.Helper
Значок темы форума как на U.Helper
  Добавил: Hoverik  
 
Установка:
Шаблон Форум - Общий вид страниц форума находим там $BODY$ сразу после него ставим этот скрипт.
Code
<script type="text/javascript">
// By U.Helper ~ http://helper.ucoz.ru/ & AllCity ~ http://allcity.net.ru/
$('.thDescr').each(function(){
var s = $(this).html().match( /sml\[(\w+)\]/ );
$(this).show();
if (s==null) return;
s = s[0];
$(this).html( $(this).html().replace(s,'') );
if( $(this).html()=='()' ) $(this).html('');
})
$('.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','/threadIcons/'+name+'.png');
});
</script>

или этот код (с иконками в самой теме)

<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>

Теперь в CSS кидаем этот код:

/* Значок темы форума */
.thDescr, .threadDescr {display:none}
#frM30 img {opacity:0.33; -moz-opacity:0.33; filter:alpha(opacity=33);}
#frM30 img:hover {opacity:0.5; -moz-opacity:0.5; filter:alpha(opacity=50);}
#frM30 img.selectedImg {opacity:1; ; -moz-opacity:1; filter:alpha(opacity=100);}
/* ------------- */

Ну и в шаблоне Форум - Форма добавления сообщения находим $_THREAD_DESCR$ и заменяем на этот код:
Code
<input type="text" id="threadAbout" class="postDescrFl" size="60" maxlength="50" />
<img src="/threadIcons/thread.gif" alt="" class="selectedImg" />
<img src="/threadIcons/arrow.png" alt="arrow" />
<img src="/threadIcons/warn.png" alt="warn" />
<img src="/threadIcons/engine.png" alt="engine" />
<img src="/threadIcons/hammer.png" alt="hammer" />
<img src="/threadIcons/info.png" alt="info" />
<img src="/threadIcons/help.png" alt="help" />
<img src="/threadIcons/idea.png" alt="idea" />
<img src="/threadIcons/smile.png" alt="smile" />
<img src="/threadIcons/lightning.png" alt="lightning" />
<img src="/threadIcons/question.png" alt="question" />
<img src="/threadIcons/star.png" alt="star" />
<div style="display: none;">$_THREAD_DESCR$</div>

<script type="text/javascript">
// By U.Helper ~ http://helper.ucoz.ru/ & AllCity ~ http://allcity.net.ru/
$('#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[alt="'+ $('#frF4').val().match( /sml\[(\w+)\]/ )[1] +'"]').addClass('selectedImg');
} else $('#threadAbout').val( $('#frF4').val() );
}
function checksubmit(){
var s = $('#frM30 .selectedImg').attr('alt');
if( s!='' ) s = 'sml['+s+']';
$('#frF4').val( s + $('#threadAbout').val() );
return true;
}
</script>

у кого стоит хинт как на DLE то ставим эту версию скрипта!
Code
<input type="text" id="threadAbout" class="postDescrFl" size="60" maxlength="50" />
<img src="/threadIcons/thread.gif" alt="" name="" class="selectedImg" />
<img src="/threadIcons/arrow.png" alt="arrow" name="arrow" />
<img src="/threadIcons/warn.png" alt="warn" name="warn" />
<img src="/threadIcons/engine.png" alt="engine" name="engine" />
<img src="/threadIcons/hammer.png" alt="hammer" name="hammer" />
<img src="/threadIcons/info.png" alt="info" name="info" />
<img src="/threadIcons/help.png" alt="help" name="help" />
<img src="/threadIcons/idea.png" alt="idea" name="idea" />
<img src="/threadIcons/smile.png" alt="smile" name="smile" />
<img src="/threadIcons/lightning.png" alt="lightning" name="lightning" />
<img src="/threadIcons/question.png" alt="question" name="question" />
<img src="/threadIcons/star.png" alt="star" name="star" />
<div style="display: none;">$_THREAD_DESCR$</div>

<script type="text/javascript">
// By U.Helper ~ http://helper.ucoz.ru/ & AllCity ~ http://allcity.net.ru/
$('#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[name="'+ $('#frF4').val().match( /sml\[(\w+)\]/ )[1] +'"]').addClass('selectedImg');
} else $('#threadAbout').val( $('#frF4').val() );
}
function checksubmit(){
var s = $('#frM30 .selectedImg').attr('name');
if( s!='' ) s = 'sml['+s+']';
$('#frF4').val( s + $('#threadAbout').val() );
return true;
}
</script>

теперь создаем в корне сайта папку threadIcons и загружаем туда все файлы что в архиве ниже.
Скачать
 
  Просмотров:  
Форум » Softing.do.am » Скрипты » Значок темы форума как на U.Helper
  • Страница 1 из 1
  • 1
Поиск: