- Поиск на Youtube Быстрый поиск видео на Youtube.
- Фоторедактор Здесь вы можете отредактировать свои изображения перед размещением их на фотохостинге. Многофункциональный онлайн-инструментарий.
- iPleer.fm Здесь вы можете найти практически любую песню.
- Гид по сайту Тема о новых опциях на сайте с инструкциями и иллюстрациями.
- Наша беседка В этой теме можете задать любой интересующий вопрос относительно сайта и не только.
- Техподдержка В этом разделе Вы можете создать тему технического характера, связанных с компьютерами, телефонами и интернетом.
Последние темы
Любимые темы
Загрузка избранного...
Страница 1 из 1 • Поделиться
Пагинация в постах
В этой теме вы можете наглядно увидеть туториал в работе.
[page] В таблицу CSS (все версии):
Название - на ваше усмотрение.
Расположение - на всех страницах.
В зависимости от вашей версии, надо заменить в коде selecteur_suivant_version :
[page] В таблицу CSS (все версии):
- Код:
.postpagination span {
float: left;
display: inline;
margin-left: 4px;
padding: 0 8px;
height: 26px;
border: 1px solid;
border-color: #C2D5E3;
background-color: #FFF;
background-repeat: no-repeat;
color: #333;
overflow: hidden;
text-decoration: none;
margin: 0 4px 0 0;
line-height: 26px;
cursor: pointer;
font-weight: normal;
}
.postpagination span:hover {
border-color: #369;
color: #369;
}
.postpagination span.pp_current {
background-color: #E5EDF2;
border-color: #C2D5E3;
color: #333;
font-weight: bold;
}
.postpagination {
display: block;
font: 12px/1.5 Tahoma,Helvetica,'SimSun',sans-serif;
}
.postpagination:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
div.postpagination { margin: 10px 0 }
span.postpagination span {
float: none;
padding: 0 4px;
font-size: 0.8em;
margin: 0 2px 0 0;
}
.postpagination span.pp_next {
padding-right: 25px;
background-image: url(http://i.imgur.com/2C4dvL5.gif);
background-position: 90% 50%;
}
span.postpagination span.pp_next {
padding-right: 12px;
background-position: 90% 50%;
}
Название - на ваше усмотрение.
Расположение - на всех страницах.
- Код:
$(function() {
var x= "div.postbody .content";
if($("#text_editor_textarea").length && $.sceditor) {
$(function() {
if(!$("#text_editor_textarea").sceditor("instance")) {
return
}
$('<a class="sceditor-button" unselectable="on" title="Страницы"><div unselectable="on" style="background:url(http://i.imgur.com/a3RgTJc.gif);opacity:1">Страницы</div></a>').insertAfter(".sceditor-button-fahide").click(function(e) {
$("#text_editor_textarea").sceditor("instance").insertText("[page]")
})
})
}
var c, y, g = function(a) {
var b;
a = document.createElement(a);
b = "getComputedStyle" in window;
document.body.appendChild(a);
b = (b ? window.getComputedStyle(a, "") : a.currentStyle).display;
document.body.removeChild(a);
return b
}, t = function(o) {
if(o.tagName == "CODE") {
return
}
if(!o.hasChildNodes()) {
return
}
var a = 0;
var p = [0];
var i;
for(i = 0;i < o.childNodes.length;i++) {
c = o.childNodes[i];
if(c.nodeType == 1) {
p.push(c);
t(c)
}else {
if(c.nodeType == 3 && c.nodeValue.indexOf("[page]") != -1) {
while((y = c.nodeValue.indexOf("[page]")) != -1) {
if(y != 0) {
p.push(document.createTextNode(c.nodeValue.substr(0, y)))
}
p.push(0);
a++;
c.nodeValue = c.nodeValue.substr(y + 6)
}
p.push(c)
}else {
p.push(c)
}
}
}
if(a == 0) {
return
}
var b = g(o.tagName) == "block";
for(i = 0;i < p.length;i++) {
if(p[i] === 0) {
y = document.createElement(b ? "DIV" : "SPAN");
y.className = "postpage";
o.appendChild(y)
}else {
y.appendChild(p[i])
}
}
$("> .postpage", o).not(":first").hide();
y = document.createElement(b ? "DIV" : "SPAN");
y.className = "postpagination";
$(y).append('<span class="pp_current">1</span><span>2</span>');
if(a > 1) {
$(y).append("<span>... " + (a + 1) + "</span>")
}
if(b) {
$(y).append('<span class="pp_next">Далее</span><span class="pp_all">Посмотреть все</span>')
}else {
$(y).append('<span class="pp_next"></span>')
}
o.appendChild(y);
$(y).on("click", "span", function() {
if($(this).hasClass("pp_all")) {
$(this).parent().parent().children().show();
$(this).parent().remove();
return
}
var pagin = $(this).parent();
var num = parseInt($(".pp_next", pagin).prev().text().replace(/ ?\.\.\. ?/, ""));
var cur = parseInt($(".pp_current", pagin).text().replace(/ ?\.\.\. ?/, ""));
if($(this).hasClass("pp_next")) {
cur += 1
}else {
cur = parseInt($(this).text().replace(/ ?\.\.\. ?/, ""))
}
if(cur < 1) {
cur = 1
}else {
if(cur > num) {
cur = num
}
}
$(".pp_next", pagin).prevUntil().remove();
if(cur < num - 1) {
$(pagin).prepend("<span>... " + num + "</span>")
}else {
if(cur == num) {
$(pagin).prepend('<span class="pp_current">' + num + "</span>")
}
}
if(cur < num) {
$(".pp_next", pagin).show();
$(pagin).prepend('<span class="pp_current">' + cur + "</span><span>" + (cur + 1) + "</span>")
}else {
$(".pp_next", pagin).hide()
}
if(cur > 1) {
$(pagin).prepend("<span>" + (cur - 1) + "</span>");
if(cur > 2) {
$(pagin).prepend("<span>1 ...</span>")
}
}
$(".postpage", $(pagin).parent()).hide();
$(".postpage", $(pagin).parent()).eq(cur - 1).show()
})
};
$(x).each(function() {
t(this)
})
});
В зависимости от вашей версии, надо заменить в коде selecteur_suivant_version :
- для phpbb3 :
- Код:
div.postbody .content
- для phpbb2 :
- Код:
div.postbody
- для invision :
- Код:
div.postbody div.post-entry
- для punbb :
- Код:
div.post-entry .entry-content > div
Феникс- Администратор
Посты : 1598
Очки : 6389
Возраст : 52
Откуда : Россошь
Страница 1 из 1
URL: | |
BBCode: | |
HTML: |
Права доступа к этому форуму:
Вы не можете отвечать на сообщения
Вт 29 Мар - 7:21 автор Nataliya
» Шаман......
Вт 29 Мар - 7:19 автор Nataliya
» [Салаты] Пять ошибок при приготовлении оливье
Ср 26 Янв - 13:20 автор Scheila
» Наша Беседка.. :)
Сб 18 Дек - 13:17 автор Феникс
» Супы из рыбы и морепродуктов
Вт 14 Дек - 22:26 автор Scheila
» Другие закуски
Вт 14 Дек - 22:25 автор Scheila
» Теперь мы есть в Telegram
Чт 26 Авг - 7:59 автор Феникс
» мои клипы.
Ср 4 Авг - 20:55 автор Nataliya
» МОМЕНТЫ ЖИЗНИ
Ср 4 Авг - 20:44 автор Nataliya