21:01 Сколько положительных и отрицательных отзывов о пользователе | |
![]() Данный хак позволяет выводить на персональной странице пользователя, сколько положительных и отрицательных отзывов о нём. Управление дизайном » Пользователи » Персональная страница пользователя. По месту ставим: Code <span style="border-bottom:1px dotted green;color:green;" id="pOt">Положительных: </span> | <span style="border-bottom:1px dotted red;color:red;" id="oOt">Отрицательных: </span> В самый конец документа: Code <script type="text/javascript"> function getHistory(id) { var plus = 0, minus = 0; $.get("/index/9-" + id, function (data) { var pages = $('a.pgSwch:last', $('cmd[p="content"]', data).text()).html() || 0; $("div[title]", $('cmd[p="content"]', data).text()).each(function () { if ($(this).attr("title").indexOf("повышен") != -1) plus++; if ($(this).attr("title").indexOf("понижен") != -1) minus++; }); if (pages == 0) { $('#pOt').append(plus);$('#oOt').append(minus); } else { for (var i = pages; i > 0; i--) { $.get("/index/9-" + id + "-" + i, function (dt) { $("div[title]", $('cmd[p="content"]', dt).text()).each(function () { if ($(this).attr("title").indexOf("повышен") != -1) plus++; if ($(this).attr("title").indexOf("понижен") != -1) minus++; }); _plus = plus, _minus = minus; }); } $('#pOt').append(_plus);$('#oOt').append(_minus); } }); }; getHistory($_USER_ID$); </script> | |
|
Всего комментариев: 0 | |