Вебдизайн и Техническая поддержка
Skype: disbb.ru
Контакты: обратная связь
Часы работы:
Пн-Пт 10:00-18:00
* по московскому времени


Быстрое управление статусом тем (RUSSIAN_GOBLIN)


Скриншот

  • Позволяет быстро открывать, закрывать и выделять, снимать выделение тем, нажимая на кнопочки возле названий тем в форуме.
  • Автор: RUSSIAN_GOBLIN
  • Платформа: MyBB
  • Категория: Страница списка тем форума
  • Оценка: 5.0/1
  • 20.06.2015, 01:48

Скриншот

Благодаря скрипту можно быстро открывать, закрывать и выделять, снимать выделение тем, нажимая на кнопочки возле названий тем в форуме.
В HTML-низ:
Код
<style>
img.mod_topic {
  cursor:pointer;
}
</style>
<script type="text/javascript">
var tnum= 0;  
var mod_topic = [];
mod_topic[0]= ['dafDw.png','stick','Выделить'];
mod_topic[1]= ['wDvgx.png','unstick','Снять выделение'];
mod_topic[2]= ['dsnFu.png','open','Открыть'];
mod_topic[3]= ['twBuH.png','close','Закрыть'];
function ModTopic(it,rt,tt){return (' <img src="http://s2.uploads.ru/'+it+'" class="mod_topic" rel="'+rt+'" title="'+tt+'" /> ')};
function GetModTopic(th,tn,tr,tnp,tnr,tnt){
  $.get('/moderate.php?fid='+tn+ '&'+tr+'='+tn);  
  // alert(tnp+'#'+tnr+'#'+tnt);
  $(th).attr({'src':'http://s2.uploads.ru/'+tnp}).attr({'rel':tnr}).attr({'title':tnt});
  if(tnr=='unstick') {
  $(th).parent().find('span.acchide:first').after('<span class="stickytext">Важно: </span>');
  $(th).parents('tr').attr({'class':'isticky'});
  }
  if(tnr=='open') {
  $(th).parent().find('span.acchide:first').after('<span class="closedatafield">Закрыта </span>');
  $(th).parents('tr').attr({'class':'iclosed'});
  }
  if(tnr=='stick') {
  $(th).parent().find('span.stickytext').remove();
  $(th).parents('tr').attr({'class':''});
  }
  if(tnr=='close') {
  $(th).parent().find('span.closedatafield').remove();
  $(th).parents('tr').attr({'class':''});
  }
};

if (document.URL.indexOf('viewforum.php') != -1 && GroupID <= 2){
var fnum=$('div.forum[id^=forum_f]').attr('id').replace('forum_f','');

$('div.forum div.tclcon').each(function(){

if($(this).html().indexOf('closedatafield')!=-1) $(this).append(ModTopic(mod_topic[2][0],mod_topic[2][1],mod_topic[2][2]));
else $(this).append(ModTopic(mod_topic[3][0],mod_topic[3][1],mod_topic[3][2]));

if($(this).html().indexOf('stickytext')!=-1) $(this).append(ModTopic(mod_topic[1][0],mod_topic[1][1],mod_topic[1][2]));
else $(this).append(ModTopic(mod_topic[0][0],mod_topic[0][1],mod_topic[0][2]));

});

$("img.mod_topic").live("click", function(){
tnum=$(this).parent().find('a').attr('href').replace('http://'+document.domain+'/viewtopic.php?id=','');
var threl=$(this).attr('rel');
if(threl=='stick') GetModTopic(this,tnum,threl,mod_topic[1][0],mod_topic[1][1],mod_topic[1][2]);
if(threl=='unstick') GetModTopic(this,tnum,threl,mod_topic[0][0],mod_topic[0][1],mod_topic[0][2]);
if(threl=='open') GetModTopic(this,tnum,threl,mod_topic[3][0],mod_topic[3][1],mod_topic[3][2]);
if(threl=='close') GetModTopic(this,tnum,threl,mod_topic[2][0],mod_topic[2][1],mod_topic[2][2]);
});

}
</script>
Теги: Админы и модераторы, скрипт, Страница списка тем форума, RUSSIAN_GOBLIN, mybb

Просмотров: 695, Загрузок: 0, Оценка: 5.0 (1)
Страницы:
Имя *:
Email *:
Код *:
Сайт создан в системе uCoz