ФОРУМ «ГРИБНЫЕ МЕСТА»

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

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


Вы здесь » ФОРУМ «ГРИБНЫЕ МЕСТА» » ЕЛКА ЖЕЛАНИЙ


ЕЛКА ЖЕЛАНИЙ

</div> </div> </div> <script type="text/javascript">$(document).trigger("pun_main_ready");</script> <!-- pun_stats --> <div class="section" style="border:0 !important;max-width:100%;text-align:center;overflow:hidden;max-height:250px;overflow:hidden;min-width:300px;"> <!-- Yandex.RTB R-A-19568848-2 --> <div id="yandex_rtb_R-A-19568848-2"></div> <script> window.yaContextCb.push(() => { Ya.Context.AdvManager.render({ "blockId": "R-A-19568848-2", "renderTo": "yandex_rtb_R-A-19568848-2" }) }) </script> <script async src="https://cdn.digitalcaramel.com/caramel.js"></script> <script>window.CaramelDomain = "mybb.ru"</script> </div> <!-- banner_bottom --> <!-- bbo placeholder--> <div id="pun-break3" class="divider"><hr /></div> <div id="pun-crumbs2" class="section"> <p class="container crumbs"><strong>Вы здесь</strong> <em>&#187;&#160;</em><a href="http://gribnikikybani.mybb.ru/">ФОРУМ «ГРИБНЫЕ МЕСТА»</a> <em>&#187;&#160;</em>ЕЛКА ЖЕЛАНИЙ</p> </div> <div id="pun-break4" class="divider"><hr /></div> <div id="pun-about" class="section"> <p class="container"> <span class="item1" style="padding-left:0"><a title="создать бесплатный форум" href="//mybb.ru/" target="_blank">создать бесплатный форум</a></span> </p> </div> <script type="text/javascript">$(document).trigger("pun_about_ready"); if (typeof ym == 'object') {ym(201230, 'userParams', {UserId:1, is_user:0}); ym(201230, 'params', {forum_id: 1070191});}</script> <div id="html-footer" class="section"> <div class="container"><!-- Аватар в цитате V.2 © Alex_63 / Ч.2 в HTML низ --> <script type="text/javascript">setLinkAndAva()</script> <style> tr.isticky td { background-color: #f2e1f2; } tr.iclosed td{ background-color: #CFDCE8;g } tr.inew td{ background-color: #e0e2de; } </style> <style> /* Ужатие некликабельных и кликабельных картинок в постах */ .post-content .postimg, .post-content a .postimg { max-width:350px!important; max-height:350px!important; width:auto!important; height:auto!important; } @media screen and (min-width: 540px) { .post-content .postimg, .post-content a .postimg { max-width:400px!important; max-height:400px!important; width:auto!important; height:auto!important; } } </style> <!--Кнопки прокрутки вверх и вниз--> <div class="go-up" id='ToTop'><img src="https://s9.uploads.ru/ZoSUi.png" border="0" width=100%/></div> <div class="go-down" id='OnBottom'><img src="https://s9.uploads.ru/7ilTu.png" border="0" width=100%/></div> <style> .go-up,.go-down { display:none; position:fixed; /*позиционируем*/ right:0px; /*указываем положение, если слева - left*/ z-index:9999; /*показываем поверх все элементов на странице*/ cursor:pointer; opacity:.7; /*прозрачность*/ margin-bottom:5px; /*отступ снизу (можно не указывать)*/ width:30px; /*ширина кнопки*/ height:30px; /*высота кнопки*/ } .go-up { bottom:65px; /*положение от низа окна браузера верхняя кнопка*/ } .go-down { bottom:25px; /*положение от низа окна браузера нижняя кнопка кнопка*/ } .go-down:hover,.go-up:hover { opacity:1; } </style> <script type="text/javascript"> $(function(){ if ($(window).scrollTop()>="250") $("#ToTop").fadeIn("slow") $(window).scroll(function(){ if ($(window).scrollTop()<="250") $("#ToTop").fadeOut("slow") else $("#ToTop").fadeIn("slow") }); if ($(window).scrollTop()<=$(document).height()-"999") $("#OnBottom").fadeIn("slow") $(window).scroll(function(){ if ($(window).scrollTop()>=$(document).height()-"999") $("#OnBottom").fadeOut("slow") else $("#OnBottom").fadeIn("slow") }); $("#ToTop").click(function(){$("html,body").animate({scrollTop:0},"slow")}) $("#OnBottom").click(function(){$("html,body").animate({scrollTop:$(document).height()},"slow")}) }); </script> <!--Кнопки прокрутки вверх и вниз--> <!-- Регулировка размера шрифта в постах © Alex_63 --> <style> .FNTslider { border-radius: 4px; position:relative;z-index:1000; background: #E0E0E0; width: 110px; height: 5px; margin: 3px 5px; border: solid 1px #ccc; float: right; margin-right: 7%; } .FNTslider .before { height: 5px; border: solid 1px transparent; border-right: none 0; border-radius: 4px 0 0 4px; position: absolute; background: #A0BCDA; margin-top: -1px; } .FNTslider .thumb { width: 8px; height: 13px; border-radius: 3px; position: relative; top: -4px; background: #3980D8; cursor: pointer; } </style> <script type="text/javascript" src="https://forumstatic.ru/files/0015/c4/3f/31001.js"></script> <!-- Регулировка размера шрифта в постах © Alex_63 --> <!-- запятая после ника --> <script type="text/javascript"> function to(username) {insert('[b]' + username + '[/b]' + ', ');} </script> <!-- запятая после ника --> <!-- Аватарка в строке приветствия --> <style>.status_userava>img{width:34px;height:auto;vertical-align:middle;border-radius:4px;margin:-.6em 0}</style> <script>$('#pun-status>p').prepend('<span class="status_userava"><img src="'+(window.UserAvatar?UserAvatar:'/i/default_avatar.jpg')+'"/></span>')</script> <!-- Аватарка в строке приветствия --> <style> /* Красивые кнопки в форме ответа */ #form-buttons { display: inline-block; border: 1px solid #c9d9e9; border-left-width: 0; background-color: #e3ecf3; background-image: url(https://upforme.ru/uploads/0007/af/57/14152-4.png); background-repeat: repeat-x; } #form-buttons table { width: 100% !important; } #form-buttons td { border-left: 1px solid #c9d9e9 !important; border-right: 1px solid #f3f7fa !important; } #form-buttons td:hover { background-color: #f5f8fb; } #form-buttons td:active { background-color: #c9d9e9; -moz-box-shadow: inset 1px 1px 5px #92a9c1; -webkit-box-shadow: inset 1px 1px 5px #92a9c1; box-shadow: inset 1px 1px 5px #92a9c1; } /* Компактная форма ответа */ #post { margin: 0; padding: 0; } #post fieldset { border: none; } #post legend { display: none; } #post .formsubmit { padding: 0 18px 18px 18px; margin: 0 !important; } </style> <!-- // Кнопка "Показать пароль" в форме входа --> <style>#login label[for=fld16]{margin-left:3px!important;}.pw-wrp{margin:2px 0;} #Login_Punbb .inputfield:last-child{margin-top:17px!important;}</style> <script>if($('#pun-login,#Login_Punbb').length)(function(){ var Sp='<span style="display:block" class="pw-wrp"><input type=checkbox id=fld16 style="margin:1px 0 0 0;float:left;"/>\ <label for=fld16 style="font-weight:400">Показать пароль</label></span>'; $('input[name="req_password"]').after(Sp); $('#fld16,label[for="fld16"]').click(function(){ if($('#fld16').attr('checked')){$('input[name="req_password"]')[0].type='text';} else{$('input[name="req_password"]')[0].type='password';} });}()) </script> <!-- // Кнопка "Показать пароль" в форме входа --> <!-- Меню "Быстрый переход" © Alex_63 --> <script type="text/javascript" src="https://forumstatic.ru/files/0015/c4/3f/18390.js"></script> <!--Добавка ссылки на тему к заголовку поста--> <script><!--Добавка ссылки на тему к заголовку поста--> if($(".punbb").attr("id")=="pun-viewtopic"){ var s0=$("link[rel='alternate']").attr("href").replace(/^.*id=(\d+)$/igm,"$1"); var s1="/viewtopic.php?id="+s0;var s2=$(".main h1 span").text(); var s3='<li class="TopicLnk" style="font-weight:normal;display:inline-block;color:green;">&nbsp;Тема: <a href="'; s3+=s1+'">'+s2+'</a></li>';$(".post h3>span a.permalink").each(function(){ if($(this).parents(".post").hasClass("topicpost")){$(this).after(s3.replace("Re: ","")); }else{$(this).after(s3);};});} </script> <!--Добавка ссылки на тему к заголовку поста--> <!-- Рестор (восстановление) ссылки "Новые сообщения" на главной странице --> <script type="text/javascript"> if(GroupID != 3) { $('#pun-ulinks .container').prepend('<li class="item1"><a href="/search.php?action=show_new">Новые сообщения</a></li>'); } </script> <!-- Рестор (восстановление) ссылки "Новые сообщения" на главной странице --> <!-- Уменьшение количества кнопок в форме быстрого ответа при мобильном просмотре --> <style type="text/css"> @media only screen and (hover: none) and (pointer: coarse){ td#button-font, td#button-size, td#button-indent, td#button-link, td#button-quote, td#button-code, td#button-table, td#button-keyboard {display: none;} } </style> <!-- Уменьшение количества кнопок в форме быстрого ответа при мобильном просмотре --> <!-- Картинка перед ником юзера (например, шляпка) --> <script type="text/javascript"> var online = document.links; for (var i=0; i<online.length; i++) { if (online[i].innerHTML == "Фрикаделька"){online[i].innerHTML = "<img src='https://forumstatic.ru/files/001b/2e/23/39513.png' width='30' height='21' />" + online[i].innerHTML} else if (online[i].innerHTML == "Фрикаделька"){online[i].innerHTML = "<img src='https://forumstatic.ru/files/001b/2e/23/39513.png' width='30' height='21' />" + online[i].innerHTML} } </script> <!-- Картинка перед ником юзера (например, шляпка) --> <!-- Расширенная палитра цветов --> <!-- * Новая Палитра © Deff * --> <style> body #post #color-area { background-position: 0!important; background-size: 366px auto !important; padding: 21px 30px 8px 30px!important; width: 298px!important; } #color-area table.Myp .rightMy input{ /*margin-left:54px*/ } #color-area table.Myp input{ z-index:0!important; } </style> <script src="https://forumstatic.ru/files/0010/b4/f8/74494.js"></script> <!-- Расширенная палитра цветов --> <!-- Дополнительные смайлики в форме ответа --> <style type="text/css"> #wrapper{position:relative;width:500px;} .tabs{height:25px;line-height:21px;margin:0 0 3px;list-style:none;} .tabs li{float:left;cursor:pointer;} .tabs li a{background:transparent url("https://forumstatic.ru/files/0017/d8/50/91984.png")no-repeat scroll 0 0/cover;color:#444;display:block;margin-bottom:-1px;padding:0 4px 0px;position:relative;text-align:center;text-decoration:none;width:80px;} .tabs li a:hover{color:#efefef;background:url("https://forumstatic.ru/files/0017/d8/50/91984.png")no-repeat scroll 0-24px/cover;text-decoration:none;} .tabs li.active a{color:#444;border:medium hidden;line-height:22px;background-position:0 -50px;} .tabs li.active a:hover{color:#6A5ACD;} #smilies-area div[class^="t-"]:not(.t-0){display:none;width:470px; overflow: inherit; } #wrapper, #wrapper > div { max-width: 100%; } #smilies-block, #wrapper ul ~ div { clear: both; } </style> <script type="text/javascript"> var nabor=[]; nabor['CRAZY'] = [ 'https://kolobok.us/smiles/madhouse/alcoholic.gif', 'https://kolobok.us/smiles/madhouse/crazy_pilot.gif', 'https://kolobok.us/smiles/madhouse/dash1.gif', 'https://kolobok.us/smiles/madhouse/dash2.gif', 'https://kolobok.us/smiles/madhouse/dash3.gif', 'https://kolobok.us/smiles/madhouse/drag.gif', 'https://kolobok.us/smiles/madhouse/gamer1.gif', 'https://kolobok.us/smiles/madhouse/gamer2.gif', 'https://kolobok.us/smiles/madhouse/gamer3.gif', 'https://kolobok.us/smiles/madhouse/gamer4.gif', 'https://kolobok.us/smiles/madhouse/girl_crazy.gif', 'https://kolobok.us/smiles/madhouse/girl_hospital.gif', 'https://kolobok.us/smiles/madhouse/girl_wacko.gif', 'https://kolobok.us/smiles/madhouse/hang1.gif', 'https://kolobok.us/smiles/madhouse/hang2.gif', 'https://kolobok.us/smiles/madhouse/hang3.gif', 'https://kolobok.us/smiles/madhouse/hunter.gif', 'https://kolobok.us/smiles/madhouse/locomotive.gif', 'https://kolobok.us/smiles/madhouse/mail1.gif', 'https://kolobok.us/smiles/madhouse/man_in_love.gif', 'https://kolobok.us/smiles/madhouse/on_the_quiet2.gif', 'https://kolobok.us/smiles/madhouse/pilot.gif', 'https://kolobok.us/smiles/madhouse/prankster.gif', 'https://kolobok.us/smiles/madhouse/prankster2.gif', 'https://kolobok.us/smiles/madhouse/preved.gif', 'https://kolobok.us/smiles/madhouse/russian_roulette.gif', 'https://kolobok.us/smiles/madhouse/sarcastic.gif', 'https://kolobok.us/smiles/madhouse/sarcastic_blum.gif', 'https://kolobok.us/smiles/madhouse/sarcastic_hand.gif', 'https://kolobok.us/smiles/madhouse/slow.gif', 'https://kolobok.us/smiles/madhouse/stinker.gif', 'https://kolobok.us/smiles/madhouse/suicide2.gif', 'https://kolobok.us/smiles/madhouse/tease.gif', 'https://kolobok.us/smiles/madhouse/telephone.gif', 'https://kolobok.us/smiles/madhouse/to_become_senile.gif', 'https://kolobok.us/smiles/madhouse/to_pick_ones_nose.gif', 'https://kolobok.us/smiles/madhouse/to_pick_ones_nose2.gif', 'https://kolobok.us/smiles/madhouse/to_pick_ones_nose3.gif', 'https://kolobok.us/smiles/madhouse/to_pick_ones_nose_eat.gif', 'https://kolobok.us/smiles/madhouse/wacko.gif', 'https://kolobok.us/smiles/madhouse/wacko2.gif']; nabor['RPG'] = [ 'https://kolobok.us/smiles/rpg/assassin.gif', 'https://kolobok.us/smiles/rpg/butcher.gif', 'https://kolobok.us/smiles/rpg/dwarf.gif', 'https://kolobok.us/smiles/rpg/elf.gif', 'https://kolobok.us/smiles/rpg/girl_werewolf.gif', 'https://kolobok.us/smiles/rpg/jester.gif', 'https://kolobok.us/smiles/rpg/king.gif', 'https://kolobok.us/smiles/rpg/king2.gif', 'https://kolobok.us/smiles/rpg/orc.gif', 'https://kolobok.us/smiles/rpg/paladin.gif', 'https://kolobok.us/smiles/rpg/queen.gif', 'https://kolobok.us/smiles/rpg/vampire.gif', 'https://kolobok.us/smiles/rpg/wizard.gif']; nabor['Поздравления'] = [ 'https://forumstatic.ru/files/0010/54/6f/81390.gif', 'https://forumstatic.ru/files/0010/54/6f/21073.gif', 'https://forumstatic.ru/files/0010/54/6f/29009.gif', 'https://forumstatic.ru/files/0010/54/6f/28883.gif', 'https://forumstatic.ru/files/0010/54/6f/43591.gif', 'https://forumstatic.ru/files/0010/54/6f/67015.gif', 'https://forumstatic.ru/files/0010/54/6f/28362.gif', 'https://forumstatic.ru/files/0010/54/6f/87352.gif', 'https://forumstatic.ru/files/0010/54/6f/28509.gif', 'https://forumstatic.ru/files/0010/54/6f/48956.gif', 'https://forumstatic.ru/files/0010/54/6f/56575.gif', 'https://forumstatic.ru/files/0010/54/6f/35707.gif', 'https://forumstatic.ru/files/0010/54/6f/61070.gif', 'https://forumstatic.ru/files/0010/54/6f/15891.gif', 'https://forumstatic.ru/files/0010/54/6f/72585.gif', 'https://forumstatic.ru/files/0010/54/6f/18799.gif', 'https://forumstatic.ru/files/0010/54/6f/37228.gif', 'https://forumstatic.ru/files/0010/54/6f/28418.gif', 'https://forumstatic.ru/files/0010/54/6f/66304.gif']; nabor['Грибники'] = [ 'https://forumstatic.ru/files/0010/54/6f/75128.gif', 'https://forumstatic.ru/files/0010/54/6f/15011.gif', 'https://forumstatic.ru/files/0010/54/6f/22171.gif', 'https://forumstatic.ru/files/0010/54/6f/33079.gif', 'https://forumstatic.ru/files/0010/54/6f/66258.gif', 'https://forumstatic.ru/files/0010/54/6f/50758.gif', 'https://forumstatic.ru/files/0010/54/6f/85402.gif']; $('#button-smile').one('click',function(){$('#smilies-block').addClass('t-0');var vkl = '<div id="wrapper"><ul class="tabs" onclick="return changeVisibility (\'smilies-area\', false)"><li class="t-0 active"><a>Обычные</a></li></ul></div>';$('#smilies-area').prepend(vkl);for(var i in nabor){$('.tabs').append('<li class="t-'+i+'"><a>'+i+'</a></li>');$('#wrapper').append('<div class="t-'+i+'"></div>');$.each(nabor[i],function(q){$('div.t-'+i).append('<img loading="lazy" src="'+nabor[i][q]+'" onclick=smile("[img]'+nabor[i][q]+'[/img]") />');})};$('.tabs li').click(function(){var thisClass=this.className;$('#smilies-area div[class^="t-"]').hide();$('div.'+thisClass).fadeToggle('slow');$('.tabs li').removeClass('active');$(this).addClass('active');}); }); </script> <!-- Дополнительные смайлики в форме ответа --> <!-- Вставка видео с помощью Sendvid --> <script> (function() { // &#128257; Переключатель sandbox: включите/выключите при необходимости const SANDBOX_ENABLED = true; function embedSendvid(root = document) { // Ссылки вида https://sendvid.com/eke4ai5r const anchors = root.querySelectorAll('a[href*="sendvid.com"]'); anchors.forEach(a => { if (a.dataset.svEmbedded) return; const href = a.getAttribute('href') || a.textContent || ''; const m = href.match(/sendvid\.com\/(?:embed\/)?([a-zA-Z0-9]+)/i); if (!m) return; const id = m[1]; const wrapper = document.createElement('div'); wrapper.className = 'sv-embed'; wrapper.innerHTML = createIframeHTML(id); a.replaceWith(wrapper); wrapper.dataset.svEmbedded = "1"; }); } // &#128295; Функция генерации iframe-кода с/без sandbox function createIframeHTML(id) { const sandboxAttr = SANDBOX_ENABLED ? 'sandbox="allow-same-origin allow-scripts allow-presentation"' : ''; return ` <iframe src="https://sendvid.com/embed/${id}" title="Sendvid video" allowfullscreen loading="lazy" referrerpolicy="no-referrer" ${sandboxAttr} ></iframe> `; } // &#128133; Стили const css = ` .sv-embed { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; background: #000; border-radius: 8px; } .sv-embed iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; } `; const style = document.createElement('style'); style.textContent = css; document.head.appendChild(style); // &#128640; Инициализация if (document.readyState !== 'loading') embedSendvid(); else document.addEventListener('DOMContentLoaded', () => embedSendvid()); // &#9851;&#65039; Обработка динамической подгрузки const mo = new MutationObserver(muts => { for (const m of muts) { m.addedNodes.forEach(n => { if (n.nodeType === 1) embedSendvid(n); }); } }); mo.observe(document.body, { childList: true, subtree: true }); })(); </script> <!-- Вставка видео с помощью Sendvid --> <!-- Начало: Универсальный скрипт замены © Merlin777 kuban.mybb.ru --> <script src="https://forumstatic.ru/files/0010/54/6f/13402.js?v=2"></script> <!-- Конец: Универсальный скрипт замены © Merlin777 kuban.mybb.ru --> <!-- Превью темы и профиля (Invision Community style) --> <script src="https://forumstatic.ru/files/0010/54/6f/64398.js?v=4"></script> <!-- Превью темы и профиля (Invision Community style) --> <!--Последние сообщения на главной странице форума (лайв-бокс)--> <link rel="stylesheet" href="https://forumstatic.ru/files/0010/54/6f/45982.css?v=46"> <script src="https://forumstatic.ru/files/0010/54/6f/78002.js?v=26"></script> <!--Последние сообщения на главной странице форума (лайв-бокс)--> <!-- &#9889;Мгновенные" Быстроплюсы" и &#9889;мгновенные "Сказали спасибо" --> <style> /*Быстроплюсы для Топика!*/ div .post-rating p a { text-align: center; outline: 1px solid transparent; font-weight: 700; background: url(https://upforme.ru/uploads/0010/54/6f/3004/255596.png) no-repeat center; background-size: 36px auto; position: relative; z-index: 100; width: 36px; height: 36px; font-size: 12px !important; display: inline-block; vertical-align: middle; line-height: 34px; letter-spacing: -.1px; } .noNull:before { content: "+"; display: inline-block; margin-left: -1px; font-size: 9px; letter-spacing: 0 !important; } .punbb .post-rating p { padding: 0 !important; } body.dark-theme div .post-rating p a { background-image: url(https://forumstatic.ru/files/001a/f0/7d/94257.png?v=1) !important; } </style> <script> 'use strict'; // --- ПРОВЕРКА СТРАНИЦЫ (один раз при загрузке) --- const isViewTopicPage = document.getElementById('pun-viewtopic') !== null; if (!isViewTopicPage) { // Скрипт работает только на страницах просмотра тем } else { // --- ОБЩИЕ ВСПОМОГАТЕЛЬНЫЕ ФУНКЦИИ --- // Получает ID постов из указанного DOM-контекста function getPostIds(scope = document) { const postElements = scope.querySelectorAll('div.post'); const ids = []; postElements.forEach(function(el) { const id = el.id; if (id && id.startsWith('p')) { ids.push(id.slice(1)); } }); return ids; } // Поиск ближайшего родителя по селектору function findParent(el, selector) { let current = el; while (current && current !== document) { if (current.matches(selector)) { return current; } current = current.parentElement; } return null; } // --- ЧАСТЬ 1: БЫСТРОПЛЮСЫ --- // Обновляет отображение цифры рейтинга и управляет классом noNull function setDigit(th) { var d = parseInt(th.textContent); if (d > 0) { th.classList.add('noNull'); } else { th.classList.remove('noNull'); } th.textContent = d; } // Сохранение оригинального alert для восстановления после голосования var Busy = window.alert; // Обработка клика по кнопке "плюса": отправка запроса, обновление рейтинга и мини-профиля function setPlus(linkElement) { window.alert = null; var href = linkElement.href; var pidMatch = href.match(/\?id=(\d+)/); if (!pidMatch) return; var pid = pidMatch[1]; var postElement = findParent(linkElement, '.post'); if (!postElement) return; var profileLink = postElement.querySelector('.pl-email a[href*="profile.php?"]'); var uid = null; if (profileLink) { var uidMatch = profileLink.href.match(/\?id=(\d+)$/); if (uidMatch) uid = uidMatch[1]; } var vMatch = href.match(/&v=(\d+)/); if (!vMatch) return; var v = vMatch[1] == 0 ? -1 : 1; var postVoteElement = document.getElementById('post-' + pid + '-vote'); if (postVoteElement) { postVoteElement.style.display = 'none'; } fetch(href + '&format=json') .then(response => response.json()) .then(data => { if (data.error && data.error.message) { // Ошибка обрабатывается без уведомлений } else if (data.delta) { var ratingLink = document.querySelector('#p' + pid + ' .post-rating a'); if (ratingLink) { if (data.response !== undefined) { ratingLink.textContent = data.response; setDigit(ratingLink); } else { var oldRating = parseInt(ratingLink.textContent) || 0; var newRating = oldRating + data.delta; ratingLink.textContent = newRating; setDigit(ratingLink); } } // Обновление мини-профиля автора и текущего пользователя var respectElements = document.querySelectorAll('.pl-email a[href$="profile.php?id=' + uid + '"]'); var respectContainers = []; respectElements.forEach(function(el) { var post = findParent(el, '.post'); if (post) { var respect = post.querySelector('.pa-respect'); if (respect) respectContainers.push(respect); } }); var positiveElements = document.querySelectorAll('.pl-email a[href$="profile.php?id=' + UserID + '"]'); var positiveContainers = []; positiveElements.forEach(function(el) { var post = findParent(el, '.post'); if (post) { var positive = post.querySelector('.pa-positive'); if (positive) positiveContainers.push(positive); } }); function replaceRating(container, v, revert) { var html = container.innerHTML; var delta = v; if (revert) delta = delta > 0 ? -1 : 1; if (v > 0) { html = html.replace(/\[\+(\d+)\//g, function(str, p1) { return '[+' + (parseInt(p1) + delta) + '/'; }); } else { html = html.replace(/\/-(\d+)\]/g, function(str, p1) { return '/-' + (parseInt(p1) - delta) + ']'; }); } container.innerHTML = html; } if (respectContainers.length > 0 && respectContainers[0].innerHTML.indexOf('[') != -1) { respectContainers.forEach(function(el) { replaceRating(el, v); }); positiveContainers.forEach(function(el) { replaceRating(el, v); }); if (Math.abs(data.delta) == 2) { v = v > 0 ? -1 : 1; respectContainers.forEach(function(el) { replaceRating(el, v, 1); }); positiveContainers.forEach(function(el) { replaceRating(el, v, 1); }); } } else { respectContainers.forEach(function(container) { var span = container.querySelector('span:not(.fld-name)'); if (span) { var d0 = span.textContent; var d1 = parseInt(d0) + v; if (d1 && d1 > 0) { d1 = '+' + d1; } span.textContent = d1; } }); positiveContainers.forEach(function(container) { var span = container.querySelector('span:not(.fld-name)'); if (span) { var p0 = span.textContent; var p1 = parseInt(p0) + v; if (p1 && p1 > 0) { p1 = '+' + p1; } span.textContent = p1; } }); } // Генерация события для обновления списка "Спасибо" при лайке if (v === 1) { document.dispatchEvent(new CustomEvent('vote:happened', { detail: { pid: pid, type: 'thank' } })); } } setTimeout(function() { window.alert = Busy; }, 1300); }) .catch(error => { setTimeout(function() { window.alert = Busy; }, 1300); }); } // Обёртка для вызова setPlus из onclick window.BR = function(th) { var postBox = findParent(th, '.post-box'); if (!postBox) return; var lnk = postBox.querySelector('.post-vote > p > a'); if (lnk) setPlus(lnk); }; // Скрывает все вновь добавленные элементы .post-vote function hideAllNewPostVotes(scope = document) { scope.querySelectorAll('.post-vote[id^="post-"]').forEach(function(el) { var postId = el.id.replace('post-', ''); var postRatingLink = document.querySelector('.post#p' + postId + ' .post-rating p a'); if (postRatingLink) { el.style.display = 'none'; } }); } // Назначает обработчики для кнопок "плюса" в указанной области function applyPlusHandlers(scope = document) { scope.querySelectorAll('.post .post-rating p a').forEach(function(el) { if (!el.hasAttribute('data-plus-handler')) { el.setAttribute("onclick", "BR(this)"); setDigit(el); var postElement = findParent(el, '.post'); if (postElement) { var pid = postElement.id.slice(1); var postVoteLink = document.getElementById('post-' + pid + '-vote'); if (postVoteLink) { postVoteLink.style.display = 'none'; } } el.setAttribute('data-plus-handler', 'true'); } }); hideAllNewPostVotes(scope); } // --- ЧАСТЬ 2: СПИСОК ПОБЛАГОДАРИВШИХ (API-ЛОГИКА) --- // Отслеживание постов, для которых уже запрашивались "спасибо" const processedPostsForThanks = new Set(); // Отслеживание ID постов, для которых выполняется запрос (для дедупликации) const pendingUpdates = new Set(); // Вставка списка благодаривших в пост function insertThanksList(postId, thankersListHtml) { if (!thankersListHtml) { return; } var postBox = document.querySelector('.post#p' + postId + ' .post-box'); if (postBox && postBox.querySelector('.postVoters') === null) { var html = '<div class="postVoters"><strong><i><font color="#13355e">Сказали спасибо</font></i>:</strong> ' + thankersListHtml + '</div>'; postBox.insertAdjacentHTML('beforeend', html); processedPostsForThanks.add(postId); } else { if (!postBox) { var postElement = document.querySelector('.post#p' + postId); if (postElement && postElement.querySelector('.postVoters') === null) { var html = '<div class="postVoters"><strong><i><font color="#13355e">Сказали спасибо</font></i>:</strong> ' + thankersListHtml + '</div>'; postElement.insertAdjacentHTML('beforeend', html); processedPostsForThanks.add(postId); } } else { var existingVoters = postBox.querySelector('.postVoters'); if (existingVoters) { existingVoters.innerHTML = '<strong><i><font color="#13355e">Сказали спасибо</font></i>:</strong> ' + thankersListHtml; } } } } // Обработка ответа API: группировка и вставка благодаривших function processVotes(data) { if (!data || !data.response) { const postIdsFromRequest = currentFetchRequestIds || []; postIdsFromRequest.forEach(id => processedPostsForThanks.add(id)); currentFetchRequestIds = null; return; } const votesByPost = {}; data.response.forEach(item => { const postId = item.post_id; if (item.votes && Array.isArray(item.votes)) { item.votes.forEach(vote => { if (vote.value === '1') { if (!votesByPost[postId]) { votesByPost[postId] = []; } votesByPost[postId].push(vote); } }); } }); Object.keys(votesByPost).forEach(postId => { const votesForThisPost = votesByPost[postId]; let thankersHtml = ''; votesForThisPost.forEach((vote, index) => { thankersHtml += '<a href="/profile.php?id=' + vote.user_id + '">' + vote.username + '</a>'; if (index < votesForThisPost.length - 1) { thankersHtml += ', '; } }); insertThanksList(postId, thankersHtml); }); Object.keys(votesByPost).forEach(id => processedPostsForThanks.add(id)); data.response.forEach(item => { if (!processedPostsForThanks.has(item.post_id)) { processedPostsForThanks.add(item.post_id); } }); } // Выполнение API-запроса для получения списка благодаривших let currentFetchRequestIds = null; function fetchVotesForPosts(postIds) { if (!postIds || postIds.length === 0) { postIds.forEach(id => pendingUpdates.delete(id)); return; } const apiParams = new URLSearchParams({ method: 'post.getVotesByPosts', post_id: postIds.join(','), fields: 'post_id,user_id,username,value,datetime', sort_dir: 'desc' }); currentFetchRequestIds = [...postIds]; return fetch('/api.php?' + apiParams.toString()) .then(response => response.json()) .then(data => { processVotes(data); }) .catch(error => { postIds.forEach(id => processedPostsForThanks.add(id)); currentFetchRequestIds = null; }); } // Планирование обновления списка "спасибо" для новых постов function scheduleUpdate(scope = document) { requestAnimationFrame(() => { const allPostIds = getPostIds(scope); const newPostIds = allPostIds.filter(id => !processedPostsForThanks.has(id)); if (newPostIds.length > 0) { const idsToRequest = newPostIds.filter(id => !pendingUpdates.has(id)); if (idsToRequest.length > 0) { idsToRequest.forEach(id => pendingUpdates.add(id)); fetchVotesForPosts(idsToRequest).finally(() => { idsToRequest.forEach(id => pendingUpdates.delete(id)); }); } } }); } // --- ИНИЦИАЛИЗАЦИЯ И ПОДПИСКИ НА СОБЫТИЯ --- // Инициализация при загрузке DOM document.addEventListener('DOMContentLoaded', function() { document.querySelectorAll('.post .post-rating p a').forEach(function(el) { el.setAttribute("onclick", "BR(this)"); setDigit(el); var postElement = findParent(el, '.post'); if (postElement) { var pid = postElement.id.slice(1); var postVoteLink = document.getElementById('post-' + pid + '-vote'); if (postVoteLink && el.classList.contains('noNull')) { postVoteLink.style.display = 'none'; } } el.setAttribute('data-plus-handler', 'true'); }); scheduleUpdate(document); }); // Подписка на событие добавления нового поста (например, через AJAX) document.addEventListener('pun_post', function(e) { var scope = e.detail?.post || document.body; applyPlusHandlers(scope); scheduleUpdate(scope); }); // Подписка на собственное событие после успешного лайка document.addEventListener('vote:happened', function(e) { if (e.detail && e.detail.pid && e.detail.type === 'thank') { var pid = e.detail.pid; var specificPost = document.getElementById('p' + pid); if (specificPost) { if (!pendingUpdates.has(pid)) { pendingUpdates.add(pid); fetchVotesForPosts([pid]).finally(() => { pendingUpdates.delete(pid); }); } } } }); // Перехват fetch для отслеживания лайков от любых пользователей const originalFetch = window.fetch; window.fetch = function(...args) { const url = args[0]; if (typeof url === 'string' && /relation\.php.*[&?]v=(\d+)/.test(url)) { const match = url.match(/id=(\d+)/); const pid = match ? match[1] : null; const voteType = url.match(/v=(\d+)/)?.[1]; if (pid && voteType === '1') { if (!pendingUpdates.has(pid)) { pendingUpdates.add(pid); fetchVotesForPosts([pid]).finally(() => { pendingUpdates.delete(pid); }); } } } return originalFetch.apply(this, args); }; // Наблюдатель за изменениями DOM для динамических постов const observer = new MutationObserver(function(mutationsList) { let shouldUpdate = false; let relevantScope = document.body; for (let mutation of mutationsList) { if (mutation.type === 'childList') { for (let node of mutation.addedNodes) { if (node.nodeType === 1) { if (node.classList && node.classList.contains('post')) { relevantScope = node; shouldUpdate = true; break; } else if (node.querySelector && node.querySelector('div.post')) { relevantScope = node; shouldUpdate = true; break; } else { const nestedPosts = node.querySelectorAll && node.querySelectorAll('div.post'); if (nestedPosts && nestedPosts.length > 0) { relevantScope = node; shouldUpdate = true; break; } } } } if (shouldUpdate) break; } } if (shouldUpdate) { requestAnimationFrame(() => { applyPlusHandlers(relevantScope); hideAllNewPostVotes(relevantScope); scheduleUpdate(relevantScope); }); } }); observer.observe(document.body, { childList: true, subtree: true }); } // Конец блока if (isViewTopicPage) </script> <!-- &#9889;Мгновенные" Быстроплюсы" и &#9889;мгновенные "Сказали спасибо" --></div> </div> </div> </div> </div> </body> </html>