06.06.2020 Нам 4,4! Все самое свежее и вкусное - в этой теме!
20.05.2020 Дин-дон, дин-дон, а вот и новые сюжетные задания подвезли - подключаемся к игре, друзья :)
12.04.2020 Аве, Револт! У нас тут важный итоговый пост ГМ в сюжетном квесте. Готовьте самокрутки перед прочтением, а также изучайте внимательно обновления в вестях с фронта.!
08.02.2020 Эй, Револт! Ты уже совсем большой, тебе аж 4 года :О Live long and prosper! Все плюхи, включая интервью с персонажами, статистику, сюжетные новости и трейлер - по ссылке.
11.11.2019 Итак, подвезли итоги киновикторины, а также, наконец-то, появились долгожданные работы литературного конкурса - прямо здесь, в трех закрепленных разделах. Время голосовать, Револт!
16.09.2019 Гайз! Нужно ваше экспертное мнение об одной интересной скриптоплюхе.
15.09.2019 Немного новостей относительно старых эпизодов.
07.09.2019 А вот и долгожданные итоги ежегодного Revolt Awards!
01.09.2019 Для всех, кто не попал в квесты, есть шанс принять участие в сюжетном эпизоде. Всем по Эйяфьядлайёкюдлю!
26.08.2019 Друзья! Последняя неделя, чтобы оставить свои голоса в ежегодном Revolt Awards!
13.08.2019 Итак, время важных новостей с фронта - не пропустите!
07.08.2019 Итак, нам 3,5 года, мы безбожно пьем, отмечаем и читаем про ОБНОВЛЕНИЯ.
05.08.2019 Йоу, Револтянин! Успей записаться в мафию!
28.07.2019 Участники конкурса! У вас осталось СЕМЬ дней >:] (c)
22.07.2019 До дня рождения остается все меньше времени, и прекрасная Роми приготовила для вас бомбический конкурс. Налетай, Револт!
29.06.2019 Уже по традиции - тизер новых квестов (да-да, сразу двух). Всем огня и приятного просмотра :)
23.06.2019 В ожидании квестов Колтер не дает нам скучать, и здесь вы найдете его новое видео. Всем приятного просмотра, а Колтеру - отдельное спасибо ;)
23.06.2019 Экстренный выпуск новостей с фронта - не пропустите!
20.06.2019 Друзья! Все подписываемся под петицией Акселя! :)
15.06.2019 И-и-и они вернулись.
27.05.2019 Первая порция новых бонусных заданий подъехала - налетай!
23.05.2019 А вот и свежачок про твинков подвезли.
24.04.2019 Всем, кто посмотрит endgame раньше других и захочет поспойлерить и покричать.
06.04.2019 Псс, Револт! Не хочешь немного мафии?
08.03.2019 Прекрасная половина человечества: С Праздником!.
08.03.2019 Еще порция новостей по поводу очередного дня рождения форума!
23.02.2019 Без лишних слов и ложной скромности - мы поздравляем Револт с Днём защитника Отечества.
06.02.2019 Револту 3 ГОДА! Обо всех новостях и плюшках читаем здесь.
05.01.2019 Пс-с, Револт, немного интриги в вестях с фронта.
31.12.2018 Предновогоднее УРА для участников квеста и сюжетных заданий!
16.12.2018 Самое время выбрать номер и узнать, для кого ты станешь Тайным Сантой.
26.09.2018 Йо-хо-хо, пираты, подвезли свежий квест и сюжетные задания.
06.08.2018 С Днем Рождения, Револт! Чуть больше о приятном здесь. А в этой теме - результаты голосования.
01.08.2018 Револт! Настало время выбрать самых-самых в нашей практически ежегодной Revolt Awards #3.
13.06.2018 Револт, павший лидер сопротивления передает неожиданный привет.
06.06.2018 Тыры-пыры, Револт с Днем рождения! А здесь кое-что об обновлениях.
06.04.2018 Два новых квеста уже на передовой, а - здесь вы найдете их участников. А в этой теме - немного праздничного упороса. Ура, товарищи!
04.04.2018 В ожидании грядущих квестов - свежий тизер.
02.04.2018 А вот и свежие бонусные задания подвезли - налетаем!
21.03.2018 Друзья, радуем вас обновлением информации об экзоброне - в этой теме.
08.03.2018 Сегодня поздравляем наших дам - здесь и вот здесь!
06.02.2018 Без лишних слов - Револту два года! Кликайте по ссылке, там вас ждет много всего интересного. 30.12.2017 Предновогоднее организационное объявление о нашем с вами квестовом режиме во время праздников.
29.12.2017 Настроеньеподнимательный раздел. Поздравляем друг друга, обмениваемся подарочками, спасаем елки от котов.
11.12.2017 Открываем рождественский сезон записью в Тайного Санту. Спешите, набор участников продлится всего несколько дней.
08.11.2017 Очередная праздничная дата на Револте вместе с обновлениями и приятными бонусами
17.10.2017 сюжетные задания - в новом формате.
01.10.2017 Начало октября - время отопления, горячих напитков и нового сюжетного поста в вестях с фронта. На этот раз - о событиях прошлого.
06.09.2017 Шестое число - время новостей.
27.08.2017 Запись в новые задания.
21.08.2017 FAQ по последним новостям.
16.08.2017 участники квеста и сюжетных эпизодов: просьба внимательно ознакомиться с важными итогами в финальных постах гейм-мастера.
07.08.2017 Новый лидер боевой группы, перевод времени и сюжетные новости - все это вы найдете, пройдя по этой ссылке.
02.08.2017 Ввиду технических неполадок хостинга, на время возвращен один из старых дизайнов.
28.07.2017 Пока вы спали, мы принесли вам вести с фронта.
17.07.2017 У нас небольшие технические неполадки, поэтому до возвращения Иветт оформление таблицы будет в старом стиле :)
14.07.2017 Наш url стал немного короче, за что дружно благодарим мистера Харви ;]
06.07.2017 Новости - большие и не очень.
21.05.2017 Всех неспящих ждет сюрприз - сюжетные новости и видео с намеком на будущие игровые события.
06.04.2017 Начата запись в новые квест и задания.
04.04.2017 Небольшая памятка для игроков, а также объявление об итогах одного из личных эпизодов.
06.03.2017 Револту 13 месяцев! Разобрать подарки можно в этой теме.
15.02.2017 Очередная гигант-порция новостей, а также новые акции и сюжетные задания ждут вас здесь.
06.02.2017 ОЧЕНЬ много новостей, развлечений, занимательной статистики ждут вас здесь в компании нового револт-трейлера.
06.02.2017 Револт празднует 1 год!
16.01.2017 Участники завершенных квестов 7.1 и 7.2 приглашаются к ознакомлению с итогами, подведенными к окончанию седьмой сюжетной главы.
31.12.2016 Револт поздравляет своих жителей с наступающим Новым Годом!
13.12.2016 Стартовал конкурс рождественских историй!
11.12.2016 Принимаем участие в «Тайном Санте» и получаем письма от дедушки Револта! Спешите, время на запись ограничено!
9688
10 276
октябрь
2038
− Баттл-крик
− Мичиган
Нортфилд −
Миннесота −
Renegades
Vigilantes

18+

Авторский мир
Способности
John Grant
Самое простое — держать ответ перед самим собой; держать ответ за самого себя и быть предоставленным судьбе. Тогда все заботит лишь косвенно, нет ничего, что может в самый неподходящий момент нарисоваться на горизонте и испортить все твои планы. Ты волен распоряжаться собственной шкурой так, как сам того захочешь. Получил приказ, принял и исполняешь, пока... [читать далее]
Marco Alcacer Alexander Locke Elaine Winblad Soveig Eirnasson

STYLE DEMO

Объявление

Информация о пользователе

Привет, Гость! Войдите или зарегистрируйтесь.


Вы здесь » STYLE DEMO » EXAMPLE FORUM » Table of contents


Table of contents

Сообщений 1 страница 9 из 9

1

[fragment="Foreword"]Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum[/fragment]

0

2

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum

[fragment="Chapter 1"]Sed ut perspiciatis, unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam eaque ipsa, quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt, explicabo. Nemo enim ipsam voluptatem, quia voluptas sit, aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos, qui ratione voluptatem sequi nesciunt, neque porro quisquam est, qui dolorem ipsum, quia dolor sit, amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt, ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit, qui in ea voluptate velit esse, quam nihil molestiae consequatur, vel illum, qui dolorem eum fugiat, quo voluptas nulla pariatur? At vero eos et accusamus et iusto odio dignissimos ducimus, qui blanditiis praesentium voluptatum deleniti atque corrupti, quos dolores et quas molestias excepturi sint, obcaecati cupiditate non provident, similique sunt in culpa, qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio, cumque nihil impedit, quo minus id, quod maxime placeat, facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet, ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.[/fragment]

0

3

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum

[fragment="Chapter 2"]Sed ut perspiciatis, unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam eaque ipsa, quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt, explicabo. Nemo enim ipsam voluptatem, quia voluptas sit, aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos, qui ratione voluptatem sequi nesciunt, neque porro quisquam est, qui dolorem ipsum, quia dolor sit, amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt, ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit, qui in ea voluptate velit esse, quam nihil molestiae consequatur, vel illum, qui dolorem eum fugiat, quo voluptas nulla pariatur? At vero eos et accusamus et iusto odio dignissimos ducimus, qui blanditiis praesentium voluptatum deleniti atque corrupti, quos dolores et quas molestias excepturi sint, obcaecati cupiditate non provident, similique sunt in culpa, qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio, cumque nihil impedit, quo minus id, quod maxime placeat, facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet, ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.[/fragment]

0

4

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum

[fragment="Chapter 3"]Sed ut perspiciatis, unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam eaque ipsa, quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt, explicabo. Nemo enim ipsam voluptatem, quia voluptas sit, aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos, qui ratione voluptatem sequi nesciunt, neque porro quisquam est, qui dolorem ipsum, quia dolor sit, amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt, ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit, qui in ea voluptate velit esse, quam nihil molestiaе consequatur, vel illum, qui dolorem eum fugiat, quo voluptas nulla pariatur? At vero eos et accusamus et iusto odio dignissimos ducimus, qui blanditiis praesentium voluptatum deleniti atque corrupti, quos dolores et quas molestias excepturi sint, obcaecati cupiditate non provident, similique sunt in culpa, qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio, cumque nihil impedit, quo minus id, quod maxime placeat, facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet, ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.[/fragment]

0

5

Tool for making the table of contents on the literary forums
Adds a new button to the reply form which allows to select a fragment of the message, give it a title (or leave untitled) and bring it into the table of contents on the topic page
http://s0.uploads.ru/t/sF3Xe.png

Author: Ezingrin
Platform: MyBB

Description:
Every user sees a new button in topics, created or being created by them (admins and moders see it always). The button allows to select a fragment of the message, give it a title (or leave untitled) and bring it into the table of contents.
http://s8.uploads.ru/lkp6d.png
The table of contents is created automatically when you select the first fragment.
After the toc is created it's shown in the block above the messages of the topic. The toc displays the fragments' titles (if they have no ones, then link is named as "Fragment") and the posting time in Moscow time zone. New fragments (individually for each user) highlight by an icon (new).
http://s0.uploads.ru/sF3Xe.png
Below every message that conents the fragment of the toc or a block of such messages (untitled fragmets in sequence) there are a navigation bar which, I hope, is intuitive.
http://s5.uploads.ru/F73JU.png

CSS:

Код:
    #button-fragment{background:url(http://sa.uploads.ru/kl9Aw.png) no-repeat;}
     
    .chapters-box
    {
    	height: 15em;
    	overflow: auto;
    }
     
    #chapters
    {
    	width: 40em;
    	margin: auto;
    	padding-bottom: 1em;
    }
     
    .chapt .fragment-name
    {
    	display: block;
        padding-top: 0.7em;
        font-size: 1.3em;
        font-weight: bold;	
        font-style: normal;
    	text-align: center;
        margin: 0;	
    }
     
    #chpt td
    {
    	border: none !important;
        padding: 0.5em 0 0 0;
    }
    .mrk
    {
    	width:1em;
    	text-align: center;
    }
    .newc
    {
    	width:5em;
    }
     
    .new_chp
    {
    	background-color: #ca050f;
    	border-radius: 10px;
    	font-weight: bold;
    	color: #ffe78a;
    }
     
    .chp_name
    {
        font-size: 1.1em;
        font-weight: 600;
        font-style: normal;
    }
     
    .fragment
    {
    	border: 1px solid;
    	border-color: #fff #ccc #ccc #fff;
    	margin: 0.4em 1.8em 1.4em 1.8em;
    	padding: 1em;
    	background-color: #fff9e7;
    }
     
    .fragment h4
    {
    	display: block;
        padding-bottom: 0.7em;
        font-size: 1.3em;
        font-weight: bold;
        font-style: normal;
    	text-align: center;
        margin: 0;
    }
     
    .fragment-navigation 
    {
    	border-top: 1px solid #ccc;
    }
     
    .fragment-navigation ul
    {
    	margin: 0;
        padding: 4px;
    	text-align: center;
    }
     
    .fragment-navigation ul li
    {
    	display: inline;
        margin-right: 5px; 
        padding: 3px;
    }

JS (To HTML-bottom):

Код:
    <script type="text/javascript">
    // remove the guest ForumAPITicket and insert manually
    //you can see it by logging out the account and opening Sources (via chrome) (right mouse button -> source code -> Sources tab -> choose the current page in left list -> find ForumAPITicket)
    GuestAPITicket='3f29aad94e883b9c00f7227d6a2fa700bd934768'; 
     
    function NameTit() 
    {
    	var fname=prompt('Enter the chapter title!\n(leave blank if the fragment has no title)');
    	return (fname ? '[fragment=\"'+fname+'\"]':'[fragment]');
    }
     
    //Sending the toc by frame
    $.postFrame = function(lnk,data) {
       var rnd = Math.random().toString().substr(6);
       $('<iframe src="about:blank" name="MyFrame_'+rnd+'" id="MyFrame_'+rnd+'"></iframe>').appendTo("head");
       var form = $('<form action="'+lnk+'" target="MyFrame_'+rnd+'" method="post"></form>');
       var kk, vk;
       if(data)  for(var inf in data){
    	   vk=data[inf];
    	 kk='<input name="'+inf+'" id="'+inf+'" value=\''+vk+'\' type="hidden" />';
         form.append(kk);
       }
     	
       setTimeout(function(){ //Sending
         form.submit();
       },50);
       $('#MyFrame_'+rnd).on('load',function() {
         if($.trim($(this).contents().html()).length>0)$(this).remove()
       });
    };
     
    //Date format
    $.chTime = function(time) 
    {
    	var ctime = new Date();
    	ctime.setTime(parseInt(time)*1000);
    	return (ctime.getDate()<10 ? "0" : "")+ctime.getDate()+"."+(ctime.getMonth()<9 ? "0" : "")+(ctime.getMonth()+1)+"."+ctime.getFullYear()+" "+ctime.toTimeString().replace(/ .+$/img, "");
    }
     
    //Check and replacement of the toc tag
    var s='</p>',
    	e='<p>',
    	//c=$(this).html(),
    	x,
    	m,
    	end='<span class="fragment-inner">$1</span></div>';
      
    x=s+'<div class="fragment"><h4 class="fragment-name">$1</h4><span class="fragment-inner">$2</span></div>'+e;
    m=s+'<div class="fragment">'+end+e;
     
    $('.post').find('.post-content:contains("[fragment=")').map(function() {
    	var c=$(this).html();
    	c=c.replace(/\n/mgi,'');
     
    	try
    	{
    c=c.replace(/\[fragment=\"(.*?)\"\](.*?)\[\/fragment\]/mgi,x);
    	} catch(e){}
     
    	c=c.replace(/<p><\/p>/mgi,'');
    	$(this).html(c);
    });
     
    $('.post').find('.post-content:contains("[fragment]")').map(function() {
    	var c=$(this).html();
    	c=c.replace(/\n/mgi,'');
     
    	try
    	{
    c=c.replace(/\[fragment\](.*?)\[\/fragment\]/mgi,m);
    	} catch(e){}
     
    	c=c.replace(/<p><\/p>/mgi,'');
    	$(this).html(c);
    });
     
     
    var punv = $('#pun-viewtopic').length,
    	punp = $('#pun-post').length,
    	pune = $('#pun-edit').length;
    	
    //Preview, sending and editing messages
    if(punv || punp || pune)(function() {
      var tl0='Fragment';  
      var t0 = '<td id="button-fragment" style="cursor: pointer !important;"><img src="i/blank.gif" title="'+tl0+'" onclick="bbcode(NameTit(),\'[/fragment]\');"></td>';
      var tid; 
      var this_author=false;
      var last_rev, tmplr;
      var this_chapter;
      
      //If the topic view, then display the toc
      if(punv || pune)
      {
    	  tid=(punv ? document.URL.split("id=")[1].split("#")[0].split("&p=")[0] : $("#pun-crumbs1").find("a:last").attr("href").split("id=")[1]);
    	  
    	  //Request of the toc
    	  this_chapter = JSON.parse($.ajax({
    url: 'http://www.en.'+location.hostname.replace(/^www\./,'')+"/api.php?method=storage.get&key=chapters-"+tid,
    async: false,
    cache: false
    	}).responseText);
     
    	  //If the toc exists
    	  try
    	  {
      var q = /&quot;/g,
    	  a = /&apos;/g;
    	
      //replace the unicode quotes and apostrophes
      this_chapter=(this_chapter.response.storage.data['chapters-'+tid]).replace(q, "\"").replace(a, "\'");
      this_chapter=JSON.parse(this_chapter);
      
      //else empty array
    	  } catch(e) {this_chapter=[];}
    	  
    	  
    	  last_rev = JSON.parse($.ajax({
    	url: "/api.php?method=storage.get&key=newchp",
    	async: false,
    	cache: false
    }).responseText);
     
    	  try
    	  {
    last_rev=JSON.parse(last_rev.response.storage.data.newchp);
    if(last_rev=='') last_rev={};
    	  } catch(e){last_rev={};}
    	  
    	  if(!(last_rev[tid]))
    	  {
    last_rev[tid]=0;
    	  }
    	  
    	  tmplr=last_rev[tid];
    	  
    	  var hchp = '<div class="section"><div class="container chapt"><h4 class="fragment-name">The table of contents</h4><div class="formal chapters-box"><div id="chapters"><table id="chpt">';
    	  
    	  //And make changes if there is an appropriate cookie
    	  if($getCookie('postChap'))
    	  {
      $deleteCookie('postChap');
      
      var cc=$('.endpost:last .fragment-name')
      var PstId=$('.endpost:last').find('.permalink').attr('href').replace(/^.+?#p(\d+)$/gim,'$1');
      var PstD=$('.endpost:last').attr('data-posted');
      
      //If there is no toc element in the previous message
      if($('.endpost:last').prev().find('.fragment').length==0 || cc.length)
      {
    	  //create new
    	  this_chapter.push([PstId, PstId, PstD, (cc.length ? cc.text():"")]);
      }else
      {
    	  //else
    	  //the last post number
    	  this_chapter[this_chapter.length-1][1] = PstId;
      }
      
      var titstr='[';
      this_chapter.forEach(function(item, i)
      {
    	  //Asseble a line for bringing into the repository
    	  titstr+='[\"'+item[0]+'\",\"'+item[1]+'\",\"'+item[2]+'\",\"'+item[3]+'\"],';
    	  
    	  //Assemble the toc
    	  hchp+='<tr class="'+(item[3] ? 'yname':'nname')+'"><td class="mrk">'+(item[3] ? '• </td><td class="namech">':'</td><td class="namech">⚬ ')
    	+'<a href="'+($('#p'+item[0]).length ? '#p'+item[0] :'http://'+location.hostname+'/viewtopic.php?pid='+item[0]+'#p'+item[0])+'"' 
    	+'data-posted="'+item[2]+'">'+(item[3] ? '<span class="chp_name">'+item[3]+'</span>' : 'Fragment')+'</a></td><td class="datach" width="60%">'+' from '+$.chTime(item[2])
    	+' Moscow time '+(last_rev[tid]<item[2] ? '<span class="new_chp">&nbsp;new&nbsp;</span>':'')+'</td></tr>';
    	  
    	  if(tmplr<item[2]) tmplr=item[2];
    	  
    	  //inserting the nav bar
    	  var this_fragment=$('#p'+this_chapter[i][1]);
    	  if(this_fragment.length)
    	  {
      try
      {
      var nav = '<div class="fragment-navigation"><ul>'+
    	(i!=0 ? '<li class="prev_fragment"><a href="'+($('#p'+this_chapter[i-1][0]).length?'#p'+this_chapter[i-1][0] : 'http://'+location.hostname+'/viewtopic.php?pid='+this_chapter[i-1][0]+'#p'+this_chapter[i-1][0])+'">\<\<Previous fragment</a></li>' : '')+
    	'<li class="back_chapter"><a href="#pun-main">To the table of contents</a></li>'+
    	(i!=this_chapter.length-1 ? '<li class="next_fragment"><a href="'+($('#p'+this_chapter[i+1][0]).length?'#p'+this_chapter[i+1][0] : 'http://'+location.hostname+'/viewtopic.php?pid='+this_chapter[i+1][0]+'#p'+this_chapter[i+1][0])+'">Next fragment\>\></a></li>' : '')+
    	'</ul></div>';
      this_fragment.find('.post-box').after(nav);
      } catch(e)
      {
    	  var nav = '<div class="fragment-navigation"><ul>'+
    	'<li class="back_chapter"><a href="#pun-main">To the table of contents</a></li>'+
    	'</ul></div>';
      this_fragment.find('.post-box').after(nav);
      }
    	  }
      }); 
      
      titstr=titstr.substring(0,titstr.length-1)+']';
      
      //bringing into the repository
      $.postFrame(
    	'http://www.en.'+location.hostname.replace(/^www\./,'')+'/api.php', 
    	{
    method: 'storage.set',
    user_id: 1,
    token: GuestAPITicket,
    key: 'chapters-'+tid,
    value: titstr
    	});
    	  } else
    	  {
      //if no cookie
      //then asseble the toc and create the nav bar
      this_chapter.forEach(function(item, i)
      {
    	  hchp+='<tr class="'+(item[3] ? 'yname':'nname')+'"><td class="mrk">'+(item[3] ? '• </td><td class="namech">':'</td><td class="namech">⚬ ')
    	+'<a href="'+($('#p'+item[0]).length ? '#p'+item[0] :'http://'+location.hostname+'/viewtopic.php?pid='+item[0]+'#p'+item[0])+'"' 
    	+'data-posted="'+item[2]+'">'+(item[3] ? '<span class="chp_name">'+item[3]+'</span>' : 'Fragment')+'</a></td><td class="datach" width="60%">'+' from '+$.chTime(item[2])
    	+' Moscow time '+(last_rev[tid]<item[2] ? '<span class="new_chp">&nbsp;new&nbsp;</span>':'')+'</td></tr>';
    	  
    	  if(tmplr<item[2]) tmplr=item[2];
    	  
    	  var this_fragment=$('#p'+this_chapter[i][1]);
    	  if(this_fragment.length)
    	  {
      try
      {
      var nav = '<div class="fragment-navigation"><ul>'+
    	(i!=0 ? '<li class="prev_fragment"><a href="'+($('#p'+this_chapter[i-1][0]).length?'#p'+this_chapter[i-1][0] : 'http://'+location.hostname+'/viewtopic.php?pid='+this_chapter[i-1][0]+'#p'+this_chapter[i-1][0])+'">\<\<Previous fragment</a></li>' : '')+
    	'<li class="back_chapter"><a href="#pun-main">To the table of contents</a></li>'+
    	(i!=this_chapter.length-1 ? '<li class="next_fragment"><a href="'+($('#p'+this_chapter[i+1][0]).length?'#p'+this_chapter[i+1][0] : 'http://'+location.hostname+'/viewtopic.php?pid='+this_chapter[i+1][0]+'#p'+this_chapter[i+1][0])+'">Next fragment\>\></a></li>' : '')+
    	'</ul></div>';
      this_fragment.find('.post-box').after(nav);
      } catch(e)
      {
    	  var nav = '<div class="fragment-navigation"><ul>'+
    	'<li class="back_chapter"><a href="#pun-main">To the table of contents</a></li>'+
    	'</ul></div>';
      this_fragment.find('.post-box').after(nav);
      }
    	  }
      });
    	  }
    	  
    	  //if preview
    	  if(this_chapter.length && punv)
    	  {
      
      if(last_rev[tid]!=tmplr && UserID!=1)
      {
    	last_rev[tid]=tmplr;
      
    	$.post("/api.php", {
    method: "storage.set",
    token: ForumAPITicket,
    key: "newchp",
    value: JSON.stringify(last_rev)
    	}, "json");
      }
      
      //painting the toc
      hchp+='</table></div></div></div></div>';
      $('.topic').find('h2:first').before(hchp);
    	  }
      }else
      {
    	  //just to write the topic id on the sending page 
    	  tid=$("#pun-crumbs1").find("a:last").attr("href").split("id=")[1];
      }
      
      //author check
      var sel=".topicpost .pl-email:first>a";
      var id;
      if(document.URL.indexOf('fid')>-1) {this_author = true;} else
      if( $(".topicpost").length){ id = $(sel).attr("href").split("id=")[1]
      } else 
      {  
    	$.ajax({ url:"/viewtopic.php?id="+tid,async:false,cache:true,success:function(data){
          id = $(data).find(sel).attr("href").split("id=")[1];
    	}});
      }
      if( id && +id == UserID) this_author = true;
      
      //if author or moder
      if(GroupID<=2 || !!this_author)
      {
    	  $('#button-right').after(t0);
     
    	  // process the form, call the function...
    	  var xx=$('[name="submit"]');
    	  var nn=xx.length;
    	  xx.click(function() {
     
    //var tmp_chapter;
    var cc = $('#main-reply:first').val();
     
    var nameCook;
     
    // if edit
    if(pune)
    {
    	//ajax call for next and previous post
    	//and related info
    	var pid = document.URL.split("id=")[1].split("&amp;")[0];
    	var nextc, prevc, thc;
    	var dataPost;
    	var idn, idp;
    	$.ajax({ url:"/viewtopic.php?pid="+pid+"#p"+pid,async:false,cache:true,success:function(data){
    thc = $(data).find('#p'+pid).text();
    nextc = $(data).find('#p'+pid).next().text();
    try
    {
    	idn = $(data).find('#p'+pid).next().attr('id').replace(/p/gim,'');
    } catch(e){}
    prevc = $(data).find('#p'+pid).prev().text();
    try
    {
    	idp = $(data).find('#p'+pid).prev().attr('id').replace(/p/gim,'');
    } catch(e){}
    dataPost = $(data).find('#p'+pid).attr('data-posted');
    	}});
    	
    	//if was the part of toc and now the part of toc
    	if(cc.indexOf('[/fragment]')!=-1 && thc.indexOf('[/fragment]')!=-1)
    	{
    //now titled
    if(cc.indexOf('[fragment=')!=-1)
    {
    	//titled before
    	if(thc.indexOf('[fragment=')!=-1)
    	{
    //change the title in the appropriate element
    this_chapter.forEach(function(item, i){if(item[0]==pid)item[3]=cc.substring(cc.indexOf('[fragment="')+11,cc.indexOf('"]'));}); 
    	} else 
    	{
    //no title before
    //if previous and next messages are part of toc
    if(nextc.indexOf('[/fragment]')!=-1 && prevc.indexOf('[/fragment]')!=-1)
    {
    	//if next post has title
    	if(nextc.indexOf('[fragment=')!=-1)
    	{
    //to change the ending post number in previous element 
    var idarr;
    this_chapter.forEach(function(item, i)
    {
    	if(item[1]==pid)
    	{
    idarr=i;
    item[1]=idp;
    	}
    }); 
    //and insert a new toc element 
    this_chapter.splice(idarr+1,0,[pid, pid, dataPost, cc.substring(cc.indexOf('[fragment="')+11,cc.indexOf('"]'))]);
    	} else
    	{
    //if no title
    //find and change previous
    var idarr;
    var tmp;
    this_chapter.forEach(function(item, i)
    {
    	if(item[0]<pid && pid<item[1])
    	{
    idarr=i;
    tmp=item[1];
    item[1]=idp;
    	}
    }); 
    //and insert new
    //And I'm too lazy to keep commenting.
    this_chapter.splice(idarr+1,0,[pid, tmp, dataPost, cc.substring(cc.indexOf('[fragment="')+11,cc.indexOf('"]'))]);
    	}
    } else if(nextc.indexOf('[/fragment]')!=-1)
    {
    	this_chapter.forEach(function(item)
    	{
    if(item[0]==pid)
    {
    	item[3]=cc.substring(cc.indexOf('[fragment="')+11,cc.indexOf('"]'));
    }
    	});
    } else if(prevc.indexOf('[/fragment]')!=-1)
    {
    	var idarr;
    	this_chapter.forEach(function(item, i)
    	{
    if(item[1]==pid)
    {
    	idarr=i;
    	item[1]=idp;
    }
    	}); 
    	this_chapter.splice(idarr+1,0,[pid, pid, dataPost, cc.substring(cc.indexOf('[fragment="')+11,cc.indexOf('"]'))]);
    } else
    {
    	//var idarr=0;
    	this_chapter.forEach(function(item, i)
    	{
    if(item[0]==pid)
    {
    	item[3]=cc.substring(cc.indexOf('[fragment="')+11,cc.indexOf('"]'));
    }
    	}); 
    	//this_chapter.splice(idarr+1,0,[pid, pid, dataPost, cc.substring(cc.indexOf('[fragment="')+11,cc.indexOf('"]'))]);
    }
    	}
    } else 
    {
    	if(thc.indexOf('[fragment=')!=-1)
    	{
    if(prevc.indexOf('[/fragment]')!=-1)
    {
    	var idarr;
    	this_chapter.forEach(function(item, i)
    	{
    if(item[0]==pid)
    {
    	this_chapter[i-1][1]=item[1];
    	idarr=i;
    }
    	}); 
    	this_chapter.splice(idarr,1);
    } else 
    {
    	this_chapter.forEach(function(item, i)
    	{
    if(item[0]==pid)
    {
    	item[3]="";
    }
    	}); 
    }
    	}
    }
    	} else if(cc.indexOf('[/fragment]')!=-1)
    	{
    if(cc.indexOf('[fragment=')!=-1)
    {
    	if(nextc.indexOf('[/fragment]')!=-1 && prevc.indexOf('[/fragment]')!=-1)
    	{
    if(nextc.indexOf('[fragment=')!=-1)
    {
    	var idarr;
    	this_chapter.forEach(function(item, i)
    	{
    if(item[1]==idp)
    {
    	idarr=i;
    }
    	}); 
    	this_chapter.splice(idarr+1,0,[pid, pid, dataPost, cc.substring(cc.indexOf('[fragment="')+11,cc.indexOf('"]'))]);
    } else
    {
    	this_chapter.forEach(function(item, i)
    	{
    if(item[0]==idn)
    {
    	item[0]=pid;
    	item[3]=cc.substring(cc.indexOf('[fragment="')+11,cc.indexOf('"]'));
    }
    	}); 
    }
    	} else if(nextc.indexOf('[/fragment]')!=-1)
    	{
    if(nextc.indexOf('[fragment=')!=-1)
    {
    	var idarr;
    	this_chapter.forEach(function(item, i)
    	{
    if(item[0]==idn)
    {
    	idarr=i;
    }
    	}); 
    	this_chapter.splice(idarr,0,[pid, pid, dataPost, cc.substring(cc.indexOf('[fragment="')+11,cc.indexOf('"]'))]);
    } else
    {
    	this_chapter.forEach(function(item, i)
    	{
    if(item[0]==idn)
    {
    	item[0]=pid;
    	item[3]=cc.substring(cc.indexOf('[fragment="')+11,cc.indexOf('"]'));
    }
    	}); 
    }
    	} else if(prevc.indexOf('[/fragment]')!=-1)
    	{
    var idarr;
    this_chapter.forEach(function(item, i)
    {
    	if(item[1]==idp)
    	{
    idarr=i;
    	}
    }); 
    this_chapter.splice(idarr+1,0,[pid, pid, dataPost, cc.substring(cc.indexOf('[fragment="')+11,cc.indexOf('"]'))]);
    	} else
    	{
    var idarr=0;
    this_chapter.forEach(function(item, i)
    {
    	if(item[0]<pid)
    	{
    idarr=i;
    	}
    }); 
    this_chapter.splice(idarr+1,0,[pid, pid, dataPost, cc.substring(cc.indexOf('[fragment="')+11,cc.indexOf('"]'))]);
    	}
    } else 
    {
    	if(nextc.indexOf('[/fragment]')!=-1 && prevc.indexOf('[/fragment]')!=-1)
    	{
    if(nextc.indexOf('[fragment=')!=-1)
    {
    	this_chapter.forEach(function(item, i)
    	{
    if(item[1]==idp)
    {
    	item[1]=pid;
    }
    	}); 
    } else
    {
    	var idarr;
    	this_chapter.forEach(function(item, i)
    	{
    if(item[1]==idp)
    {
    	idarr=i;
    	item[1]=this_chapter[i+1][1];
    }
    	}); 
    	this_chapter.splice(idarr+1,1);
    }
    	} else if(nextc.indexOf('[/fragment]')!=-1)
    	{
    if(nextc.indexOf('[fragment=')!=-1)
    {
    	var idarr;
    	this_chapter.forEach(function(item, i)
    	{
    if(item[0]==idn)
    {
    	idarr=i;
    }
    	}); 
    	this_chapter.splice(idarr,0,[pid, pid, dataPost, ""]);
    } else
    {
    	this_chapter.forEach(function(item, i)
    	{
    if(item[0]==idn)
    {
    	item[0]=pid;
    }
    	}); 
    }
    	} else if(prevc.indexOf('[/fragment]')!=-1)
    	{
    this_chapter.forEach(function(item, i)
    {
    	if(item[1]==idp)
    	{
    item[1]=pid;
    	}
    }); 
    	} else
    	{
    var idarr=0;
    this_chapter.forEach(function(item, i)
    {
    	if(item[0]<pid)
    	{
    idarr=i;
    	}
    }); 
    this_chapter.splice(idarr+1,0,[pid, pid, dataPost, ""]);
    	}
    }
    	} else if(thc.indexOf('[/fragment]')!=-1)
    	{
    if(nextc.indexOf('[/fragment]')!=-1 && prevc.indexOf('[/fragment]')!=-1)
    {
    	if(nextc.indexOf('[fragment=')!=-1)
    	{
    var idarr;
    this_chapter.forEach(function(item, i)
    {
    	if(item[1]==pid)
    	{
    idarr=i;
    item[1]=idp;
    	}
    }); 
    if(thc.indexOf('[fragment=')!=-1)
    	this_chapter.splice(idarr,1);
    	} else
    	{
    if(thc.indexOf('[fragment=')!=-1)
    {
    	this_chapter.forEach(function(item, i)
    	{
    if(item[0]==pid)
    {
    	item[0]=idn;
    	item[3]="";
    }
    	}); 
    }else
    {
    	var idarr;
    	var tmp;
    	this_chapter.forEach(function(item, i)
    	{
    if(item[0]<pid && pid<item[1])
    {
    	idarr=i;
    	tmp=item[1];
    	item[1]=idp;
    }
    	}); 
    	this_chapter.splice(idarr+1,0,[idn, tmp, dataPost, ""]);
    }
    	}
    } else if(nextc.indexOf('[/fragment]')!=-1)
    {
    	if(nextc.indexOf('[fragment=')!=-1)
    	{
    var idarr;
    this_chapter.forEach(function(item, i)
    {
    	if(item[0]==pid)
    	{
    idarr=i;
    	}
    }); 
    this_chapter.splice(idarr,1);
    	} else
    	{
    this_chapter.forEach(function(item, i)
    {
    	if(item[0]==pid)
    	{
    item[0]=idn;
    item[3]="";
    	}
    }); 
    	}
    } else if(prevc.indexOf('[/fragment]')!=-1)
    {
    	if(thc.indexOf('[fragment=')!=-1)
    	{
    var idarr=0;
    this_chapter.forEach(function(item, i)
    {
    	if(item[1]==pid)
    	{
    idarr=i;
    	}
    }); 
    this_chapter.splice(idarr,1);
    	} else
    	{
    this_chapter.forEach(function(item, i)
    {
    	if(item[1]==pid)
    	{
    item[1]==idp;
    	}
    }); 
    	}
    } else
    {
    	var idarr=0;
    	this_chapter.forEach(function(item, i)
    	{
    if(item[1]==pid)
    {
    	idarr=i;
    }
    	}); 
    	this_chapter.splice(idarr,1);
    }
    	}
    	
    	//asseble a line for bringing into the repository
    	var titstr='[';
    	this_chapter.forEach(function(item, i)
    	{
    titstr+='[\"'+item[0]+'\",\"'+item[1]+'\",\"'+item[2]+'\",\"'+item[3]+'\"],';
    	}); 
      
    	titstr=titstr.substring(0,titstr.length-1)+']';
      
    	//of the line has a title
    	if(titstr.length>1)
    	{
    $.postFrame(
    	'http://www.en.'+location.hostname.replace(/^www\./,'')+'/api.php', 
    	{
    method: 'storage.set',
    user_id: 1,
    token: GuestAPITicket,
    key: 'chapters-'+tid,
    value: titstr
    	});
    	} else //else delete
    	{
    $.post('http://www.en.'+location.hostname.replace(/^www\./,'')+'/api.php', {
    method: "storage.delete",
    token: GuestAPITicket,
    key: 'chapters-'+tid
    	}, "json");
    	}
    //if create new post
    //and form has element
    } else if(cc.indexOf('[/fragment]')!=-1)
    {
    	//create cookie
    	nameCook='postChap';
    	$setCookie(nameCook, true, 120*1000);
    }
    	  });
    	  
    	  //if delete post
    	  $('[name="delete"]').click(function() {
      var pid = document.URL.split("id=")[1].split("&amp;")[0];
      if($('post-content:contains("[/fragment]")').length)
      {
    	var titstr='[';
    	this_chapter.forEach(function(item){if(item[0]!=pid || item[1]!=pid)
    {
    	if(item[1]==pid) item[1]=$(this).prev().attr("href").split("id=")[1];
    	if(item[0]==pid) item[0]=$(this).next().attr("href").split("id=")[1];
    	titstr+='[\"'+item[0]+'\",\"'+item[1]+'\",\"'+item[2]+'\",\"'+item[3]+'\"],';
    }}); 
    	titstr=titstr.substring(0,titstr.length-1)+']';
    	
    	if(titstr.length>1)
    	{
    $.postFrame(
    	'http://www.en.'+location.hostname.replace(/^www\./,'')+'/api.php', 
    	{
    method: 'storage.set',
    user_id: 1,
    token: GuestAPITicket,
    key: 'chapters-'+tid,
    value: titstr
    	});
    	} else
    	{
    $.post('http://www.en.'+location.hostname.replace(/^www\./,'')+'/api.php', {
    method: "storage.delete",
    token: GuestAPITicket,
    key: 'chapters-'+tid
    	}, "json");
    	}
      }
    	  });
      } 
      else 
      {
        $('.formsubmit .button').click(function() {
    	  var txt = $('#main-reply:first').val();
    	  if(txt.indexOf('[/fragment]')!=-1)
    	  {
    alert('You are not allowed to use the table of contents tags outside of your artworks!');
    $('.button[disabled]').removeAttr('disabled');return false;
    	  }
        });
      }
    }());
    </script>

0

6

0

7

0

8

0

9

Modify the hide text
Scipt improves the abilities of the hide text: by groups, certain users, age or reputation.
http://gerda.moy.su/_bd/0/87.jpg

Author: Duka
Platform: MyBB

This script improves the standard abilities of "hide text".

Includes the next conditions:
Возможности использования по нескольким условиям:
• by reputation points (respect);
• by positive points;
• by group;
• by certain user;
• by age.

Put the script to HTML - Form of reply (Admin → Options: 7th form). If you need the script only for closed topics, then put it to HTML-bottom (Admin → Options: 2nd form).

How does it work? Use the standard hide http://forum.mybb.ru/i/lock.png, then, in the beginning of hide's body, write one of the next requirements:
user=56; //for user with id=56 (check the profile link)
group=3; //for group. Check the id in the parameter show_group= of the Members page web address
respect=50; //for users with total reputation (+/-) is over 50
positive=20; //for users with total positive (+/-) is over 20
age=18; //for users over 18 years old
For example,

Код:
[hide]group=2; Message for moderators...[/hide]

With the number of posts requirement

Код:
[hide=20]group=2; Message for moderators having 20 posts...[/hide]

Screen:
https://forumupload.ru/uploads/0007/e3/f7/60175-2-f.jpg
Script:

Код:
<script type="text/javascript">
var quote = document.getElementsByTagName("blockquote")
var n, condition;
var typet = new Array("respect", "group", "positive", "user", "age");
var typer = new Array((UserRespectPlus-UserRespectMinus).toString(), (GroupID).toString(), (UserPositivePlus-UserPositiveMinus).toString(), (UserID).toString(), (UserAge).toString());
for(q=0;q<typet.length;q++){
for(i=0;i<quote.length;i++){
if(quote[i].previousSibling.innerHTML.indexOf("Скрытый текст")!=-1){
if(quote[i].innerHTML.indexOf(typet[q]+"=")!=-1){
n=parseInt(quote[i].innerHTML.substring(quote[i].innerHTML.indexOf(typet[q]+"=")+(typet[q].length+1), quote[i].innerHTML.indexOf(";")))
if(isNaN(n)==false){
if(q==0){condition = parseInt(typer[0]) < n;}
else if(q==1){condition = parseInt(typer[1]) != n;}
else if(q==2){condition = parseInt(typer[2]) < n;}
else if(q==3){condition = parseInt(typer[3]) != n;}
else if(q==4){condition = parseInt(typer[4]) < n;}
	if(condition){
if(q==0){
	quote[i].innerHTML="To view the hidden text you need to have "+n+" points of reputation. It remains to get "+(n-parseInt(typer[q]))
}else if(q==1){
	quote[i].innerHTML="Your group is not allowed to view this message."
}else if(q==2){
	quote[i].innerHTML="To view the hidden text you need to have "+n+" points of positive. It remains to get "+(n-parseInt(typer[q]))
}else if(q==3){
	quote[i].innerHTML="This text is left for <a href='profile.php?id="+n+"'>this</a> user."
}else if(q==4){
	quote[i].innerHTML="You need to be "+n+" years old."
}
	} else {
quote[i].innerHTML=quote[i].innerHTML.substring(quote[i].innerHTML.indexOf(typet[q]+"="+n+";")+((typet[q].length+2)+n.toString().length))
	}
}
}
}
}
}
</script>

The script does not work with several requirements at the same time, so it's pointless to cross hides. :)

0


Вы здесь » STYLE DEMO » EXAMPLE FORUM » Table of contents


Рейтинг форумов | Создать форум бесплатно