Perfe <3 ViP
Брой мнения : 575 Дата на регистрация : 10.10.2018
| Заглавие: Как да добавим бутон благодаря във форума ни Вто 14 Май 2019, 20:24 | |
| Примерна снимка: от моя форум :Д[You must be registered and logged in to see this image.]Този скрипт важни за: phpbb2, phpbb3, punbb, invision Та, този скрипт ви добавя съобщение под отговора на потребител, само ако вие благодарите на този човек. Ето го скрипта:
CSS
- Код:
-
#fa_thanks_message img { vertical-align:middle } #fa_thanks_message { color:#280; font-size:16px; font-weight:bold; text-align:center; background-color:#DFD; border:1px solid #BDB; border-radius:6px; padding:6px; margin:6px; }
Javascript Титла: ThankYouMessage Място: В форумите (In the topics) - Код:
-
$(function() { var message = function(child, parent) { var pseudo = $(child, parent).text(), icon = '<img src="http://i18.servimg.com/u/f18/18/21/60/73/fa_sta10.png" alt=""/>'; return '<div id="fa_thanks_message">' + icon + ' The topic starter has thanked ' + pseudo + ' ! ' + icon + '</div>'; }, version = $('.bodylinewidth')[0] ? 0 : document.getElementById('wrap') ? 1 : $('.pun')[0] ? 2 : document.getElementById('ipbwrapper') ? 3 : 'badapple', // version check node = document.createElement(version ? 'DIV' : 'TR'), post = $(version ? 'div.post' : 'tr.post'), j = post.length, i = 0; if (version == 'badapple') { if (window.console) console.error('This plugin is not optimized for your forum version. Please contact the support for further assistance.'); return; } node.id = 'fa_thanks'; // id for style modifications if (!version) node.innerHTML = '<td colspan="2"></td>'; // phpbb2 must have a cell as the child node for (; i < j; i++) { if ((version ? post[i] : post[i].firstChild).style.backgroundColor) { // thanked posts have the backgroundColor style property post[i].className += ' thanked'; // mark the thanked post with a class (version ? node : node.firstChild).innerHTML = message(['.name', 'dl > dt > strong', '.username', '.popmenubutton'][version], post[i]); // thanks message switch (version) { case 0 : // phpbb2 node.firstChild.style.backgroundColor = post[i].firstChild.style.backgroundColor; node.firstChild.className = post[i].firstChild.className; post[i].parentNode.insertBefore(node, post[i].nextSibling); break; case 1 : // phpbb3 post[i].firstChild.insertBefore(node, post[i].firstChild.lastChild.previousSibling); break; case 2 : // punbb node.className = 'postfoot'; node.style.margin = '0'; post[i].appendChild(node); break; case 3 : // invision node.className = 'post-footer'; node.style.backgroundColor = post[i].style.backgroundColor; post[i].appendChild(node); break; } break; // break out of the for loop when the thanked post is found } } }); - за smurfavr:
както винаги мислише, че това е въпрос ,а ? И може ли твоето мнение за първата ми такава тема.
|
|