Не нравятся результаты поиска? Попробуйте другой поиск!
DLE FAQ » Все вопросы » Ламерские вопросы » Почему не работает рейтинг в записи?

Почему не работает рейтинг в записи?


     19.03.2018    Все вопросы » Ламерские вопросы    2145

вопрос
Почему-то получаю вот такую ошибку при попытке выставить рейтинг

{"error":true, "errorinfo":"Your user session has expired. Please, refresh the page and log in if necessary."}


В теме этот участок прописан как

					[rating-type-3]
					<div class="rate3">
						<div class="rate3-views">{views} [declination={comments-num}]views[/declination]</div>
						<div class="rate3-vote icon-l">
							<div class="ps" id="ps-{news-id}" onclick="doRateLD('plus', '{news-id}');"><span class="fa fa-thumbs-up"></span></div>
							<div class="ms" id="ms-{news-id}" onclick="doRateLD('minus', '{news-id}');"><span class="fa fa-thumbs-down"></span></div>
						</div>
						{rating}
						{vote-num}
					</div>
					[/rating-type-3]


В настройках все хорошо. Пробую ставить рейтинг из под учетки автора, гостя и юзера. Время в профиле выставил по местному (где-то читал что может влиять), больше идей нет и вариантов в сети не нашел. Ответа скорее всего не получу, как обычно, но мало ли?

Ответа пока нет


4 комментария

Kedub
Юзер

Kedub - 20 марта 2018 00:49 -

Консоль в хроме ссылается на файл js в теме, его содержимое

function doRateLD(a,b){ShowLoading(""),$.get(dle_root+"engine/ajax/rating.php",{go_rate:a,news_id:b,skin:dle_skin},function(a){if(HideLoading(""),a.success){var c=a.rating;c=c.replace(/&lt;/g,"<"),c=c.replace(/&gt;/g,">"),c=c.replace(/&amp;/g,"&"),$("#ratig-layer-"+b).html(c),$("#vote-num-id-"+b).html(a.votenum);var d=parseInt($(c).text()),e=(a.votenum-d)/2,f=a.votenum-e;$("#ps-"+b).children(".psc").text(f),$("#ms-"+b).children(".msc").text(e);var g=$("#ps-"+b).parent().prev(".rbar"),h=Math.round(f/a.votenum*100);g.find(".rfill").css({width:""+h+"%"})}else a.error&&DLEalert(a.errorinfo,dle_info)},"json")}$(document).ready(function(){$("body").addClass("js"),$("body").on("click",".ps-link",function(){var a=$(this).attr("data-href");window.location.href=a}),$("#show-menu").click(function(){return"1"!=$.cookie("vis-menu")?($("#menu-inner").slideDown(200),$.cookie("vis-menu",1,{path:"/",expires:7}),$(this).find(".fa").toggleClass("fa-bars fa-times")):($("#menu-inner").slideUp(200),$.cookie("vis-menu",0,{path:"/",expires:7}),$(this).find(".fa").toggleClass("fa-bars fa-times")),!1}),$(window).width()>600&&("1"!=$.cookie("vis-menu")?$("#menu-inner").hide():($("#menu-inner").show(),$("#show-menu").find(".fa").removeClass("fa-bars").addClass("fa-times"))),$(".ratingtypeplusminus").hasClass("ratingminus")&&$(".ratingminus").parent("span").parent(".t-rate").addClass("t-down").find(".fa").removeClass("fa-thumbs-o-up").addClass("fa-thumbs-o-down"),$(".t-rate").wRatePercent(),$(".rate3").each(function(){var a=$(this),b=parseInt(a.find(".ratingtypeplusminus").text()),c=parseInt(a.find("span[id]:last").text());if(a.children(".rate3-views").after('<div class="rbar"><div class="rfill"></div></div>'),c>=b){var d=(c-b)/2,e=c-d;if(c>0){var f=a.find(".rbar"),g=Math.round(e/c*100);f.find(".rfill").css({width:""+g+"%"})}a.find(".ps").append('<span class="psc">'+e+"</span>"),a.find(".ms").append('<span class="msc">'+d+"</span>")}}),$("body").on("click","#pagi-load a",function(){var a=$(this).attr("href"),b=$(this).offset().top-200;return void 0!==a&&$.ajax({url:a,beforeSend:function(){ShowLoading("")},success:function(c){$("#bottom-nav").remove(),$("#dle-content").append($("#dle-content",c).html()),$("#dle-content").after($("#bottom-nav")),$(".t-rate:not(.wp)").wRatePercent(),window.history.pushState("","",a),$("html, body").animate({scrollTop:b},800),HideLoading("")},error:function(){HideLoading(""),alert("что-то пошло не так")}}),!1}),$("#login-box").dialog({autoOpen:!1,modal:!0,show:"fade",hide:"fade",width:320}),$("#show-login").click(function(){$("#login-box").dialog("open")}),$(".add-comm-btn").click(function(){$("#add-comm-form").slideToggle(200)}),$("#dle-content > #dle-ajax-comments").appendTo($("#full-comms"))}),jQuery.fn.wRatePercent=function(){return this.each(function(){var a=$(this),b=parseInt(a.find(".ratingtypeplusminus").text(),10),c=parseInt(a.find("span[id]:last").text(),10);if(c>=b&&c>0){var d=Math.round((c-(c-b)/2)/c*100);a.text(d+"%")}else a.text("0%");a.addClass("wp")})},jQuery.fn.wTextSlicer=function(a){var a=jQuery.extend({height:"200",textExpand:"expand text",textHide:"hide text"},a);return this.each(function(){var b=$(this),c=b.outerHeight();c>a.height&&b.addClass("slice slice-masked").attr("data-height",c).height(a.height).after('<div class="slice-btn"><span>'+a.textExpand+"</span></div>");var d=$(this).next(".slice-btn").children("span");d.click(function(){var e=parseInt(b.css("height"),10);e==c?b.css({height:a.height}):b.css({height:c}),d.text(d.text()==a.textExpand?a.textHide:a.textExpand),b.toggleClass("slice-masked")})})};


 (function(e,h,j){function k(b){return b}function l(b){return decodeURIComponent(b.replace(m," "))}var m=/\+/g,d=e.cookie=function(b,c,a){if(c!==j){a=e.extend({},d.defaults,a);null===c&&(a.expires=-1);if("number"===typeof a.expires){var f=a.expires,g=a.expires=new Date;g.setDate(g.getDate()+f)}c=d.json?JSON.stringify(c):String(c);return h.cookie=[encodeURIComponent(b),"=",d.raw?c:encodeURIComponent(c),a.expires?"; expires="+a.expires.toUTCString():"",a.path?"; path="+a.path:"",a.domain?"; domain="+
a.domain:"",a.secure?"; secure":""].join("")}c=d.raw?k:l;a=h.cookie.split("; ");f=0;for(g=a.length;f<g;f++){var i=a[f].split("=");if(c(i.shift())===b)return b=c(i.join("=")),d.json?JSON.parse(b):b}return null};d.defaults={};e.removeCookie=function(b,c){return null!==e.cookie(b)?(e.cookie(b,null,c),!0):!1}})(jQuery,document);

$(function()
{
	$("body").on("click", "#cookie_fav", function()
	{
		var $newsid = $(this).attr("data-newsid");
		$.post(dle_root + "engine/ajax/cookie_fav.php", {newsid: $newsid, af: "add"}, function(data){
			if(data)
			{
				var content = jQuery.parseJSON( data );
				DLEalert(content.t, "Информация");
				$("#cookie_fav").attr("title",content.h);
			}
		});
	});
});

/* end */

vitnet
PHP-developer

vitnet - 20 марта 2018 09:53 -

Это потому что файлы движка обновили а dle_js.js нет
function doRateLD(a,b){ShowLoading(""),$.get(dle_root+"engine/ajax/rating.php",{go_rate:a,news_id:b,user_hash:dle_login_hash,skin:dle_skin}........

Kedub
Юзер

Kedub - 20 марта 2018 15:52 -

а можно чуть подробнее что надо именно мне сделать?

Kedub
Юзер

Kedub - 21 марта 2018 19:52 -

dle_js.js соответствует файлу из предпоследней версии с оф сайта

Чтобы комментировать - войдите или зарегистрируйтесь на сайте

Похожие вопросы

наверх