$tpl->set( '{title}', str_replace("&", "&", htmlspecialchars( $row['title'], ENT_QUOTES, $config['charset'] ) ) );
$tpl->set( '{title.lowercase}', str_replace("&", "&", htmlspecialchars( mb_strtolower($row['title'], $config['charset']), ENT_QUOTES, $config['charset'] ) ) );
[title]Скачать {title} для [cat-tag id="9,10,19-44,101,102" sub="no"]Симс 4[/cat-tag][cat-tag id="53,55,56,57,66,70,74,77-100" sub="no"]Симс 3[/cat-tag][/title]
$key == 'header_title' && $metatags[$key] = mb_strtolower($metatags[$key], $config['charset']);
$metatags[$key] = trim(strip_tags($meta_found[2]));
$key == 'title' && $metatags[$key] = mb_strtolower($metatags[$key], $config['charset']);
! empty ( $metatags['title'] ) && $metatags['title'] = mb_convert_case( $metatags['title'], MB_CASE_LOWER, $config['charset'] ); ! empty ( $metatags['title'] ) && $metatags['title'] = mb_convert_case( $metatags['title'], MB_MB_CASE_TITLE, $config['charset'] );
private static $tpl_header = '<h%1$d id="hmenu-%2$d">%3$s</h%1$d>';
private static $tpl_header = '<div class="prehead prehead-%1$d"></div><h%1$d id="hmenu-%2$d">%3$s</h%1$d>';
.prehead {display: none;} .prehead.prehead-2 {display: block;}
private static $tpl_header = '<h%1$d id="hmenu-%2$d"><a href="#hmenu-item-%2$d" title="К меню">↑</a> %3$s</h%1$d>';
var count = $("#favorite_count").html(); if ($this.hasClass('active')) { $("#favorite_count").html(parseInt(count) + 1); } else { $("#favorite_count").html(parseInt(count) - 1); }
function getIp() { $keys = [ 'HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'REMOTE_ADDR' ]; foreach ($keys as $key) { if (!empty($_SERVER[$key])) { $ip = trim(end(explode(',', $_SERVER[$key]))); if (filter_var($ip, FILTER_VALIDATE_IP)) { return $ip; } } } }
$user_id = md5($_SERVER['REMOTE_ADDR']);
$user_id = md5(getIp());
[category=3,4,5]<ul>{include file="engine/mods/autocats.php?parent=2"}</ul>[/category]
$('#dle-content').append($('#dle-content', data).html());
$('.js-count-percent').each(function() { var a = $(this), b = parseInt(a.find('.ratingtypeplusminus').text(),10), c = parseInt(a.find('span[id*=vote]').text(),10); if ( c >= b && c > 0 ) { var t = Math.round((c - (c - b)/2)/c*100); a.text(t+'%').addClass('high'); if ( t < 50 ) { a.addClass('low'); } } else { a.text('0%'); }; a.addClass('wdone'); }); $('.inner-page__rating').each(function(){ var rate = $(this), p = parseInt(rate.find('.inner-page__rating-likes').text(), 10), m = parseInt(rate.find('.inner-page__rating-dislikes').text(), 10), perc = p+m, fill = Math.round(p/perc*100); rate.prepend('<div class="inner-page__rating-percent">0%</div><div class="inner-page__rating-bar"><div class="inner-page__rating-fill"></div></div>'); if ( p > 0 || m > 0 ) { rate.find('.inner-page__rating-fill').css({'width':''+fill+'%'}); rate.find('.inner-page__rating-percent').html(''+fill+'%'); }; console.log('лайк '+p+' дизлайк '+m+' общее '+perc+' процент '+fill+''); });
$(document).ready(function(){ $('body').on('click','#nav-load a',function(){ var urlNext = $(this).attr('href'); var scrollNext = $(this).offset().top - 200; if (urlNext !== undefined) { $.ajax({ url: urlNext, beforeSend: function() { ShowLoading(''); }, success: function(data) { $('#bottom-nav').remove(); $('#dle-content').append($('#dle-content', data).html()); $('#dle-content').after($('#bottom-nav')); window.history.pushState("", "", urlNext); $('html, body').animate({scrollTop:scrollNext}, 800); HideLoading(''); }, error: function() { HideLoading(''); alert('что-то пошло не так'); } }); }; return false; }); });
$("#dle-content").html(html); ratingStyling();
$('#dle-content').append($('#dle-content', data).html()); ratingStyling();
$("#dle-content").html(html);
ratingStyling();
<div class="thumb-item__label thumb-item__label--rating"> <span class="myicon-thumb-up6"></span><span class="js-count-percent">{rating}{vote-num}</span> </div>
$(document).ready(function(){ /* ====================== BUILDING ====================== */ $('.js-count-percent').each(function() { var a = $(this), b = parseInt(a.find('.ratingtypeplusminus').text(),10), c = parseInt(a.find('span[id*=vote]').text(),10); if ( c >= b && c > 0 ) { var t = Math.round((c - (c - b)/2)/c*100); a.text(t+'%').addClass('high'); if ( t < 50 ) { a.addClass('low'); } } else { a.text('0%'); }; a.addClass('wdone'); }); $('.inner-page__rating').each(function(){ var rate = $(this), p = parseInt(rate.find('.inner-page__rating-likes').text(), 10), m = parseInt(rate.find('.inner-page__rating-dislikes').text(), 10), perc = p+m, fill = Math.round(p/perc*100); rate.prepend('<div class="inner-page__rating-percent">0%</div><div class="inner-page__rating-bar"><div class="inner-page__rating-fill"></div></div>'); if ( p > 0 || m > 0 ) { rate.find('.inner-page__rating-fill').css({'width':''+fill+'%'}); rate.find('.inner-page__rating-percent').html(''+fill+'%'); }; console.log('лайк '+p+' дизлайк '+m+' общее '+perc+' процент '+fill+''); }); $('body').append('<div class="overlay hidden"></div><div class="mobile-menu" id="mobile-menu"></div><div class="mobile-menu-close"><span class="far fa-times"></span></div><div id="scrolltop"><span class="far fa-long-arrow-up"></span></div>'); $('.js-this-in-mobile-menu').each(function() { $(this).clone().appendTo('#mobile-menu'); }); /* ====================== EVENTS ====================== */ $(document).on('click','.js-show-login',function(){ $('.overlay, .login').fadeIn(200); $('body').addClass('modal-is-opened'); return false; }); $(".js-show-mobile-menu").click(function(){ $('.overlay').fadeIn(200); $('#mobile-menu, .mobile-menu-close').addClass('is-active'); $('body').addClass('mobile-menu-is-opened'); }); $(document).on('click','.overlay, .login__close, .mobile-menu-close',function(){ $('.overlay, .login').fadeOut(200); $('#mobile-menu, .mobile-menu-close').removeClass('is-active'); $('body').removeClass('modal-is-opened mobile-menu-is-opened'); }); $(document).on({ mouseenter: function () { var mimg = $(this), mimgsrc = mimg.data('modelimg'), mimgtitle = mimg.text(), winHeight = window.innerHeight, mimgPosTop = mimg.offset().top - $(window).scrollTop(); mimg.append('<div class="model-preview img-wide"><img src="'+mimgsrc+'" alt="'+mimgtitle+'"></div>'); if (mimgPosTop < winHeight/2) { mimg.addClass('bottom'); }; }, mouseleave: function () { $('.model-preview').remove(); $('[data-modelimg]').removeClass('bottom'); } },'[data-modelimg]'); /* ====================== DLE SCRIPTS ====================== */ $(document).on('click','.inner-page__comments-btn',function(){ $('.add-comments-form').slideToggle(200); }); $(document).on('click','.form__textarea-inside textarea, .fr-wrapper',function(){ $('.add-comments-form').find('.form__row--protect').removeClass('hidden'); }); $('#dle-content > #dle-ajax-comments').appendTo($('#inner-page__comments')); $('.login__social-btns a').on('click',function(){ var href = $(this).attr('href'), width = 820, height = 420, left = (screen.width - width)/2, top = (screen.height - height)/2-100; auth_window = window.open(href, 'auth_window', "width="+width+",height="+height+",top="+top+",left="+left+"menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no"); return false; }); $('.js-comm-author').each(function(){ var a = $(this), b = a.closest('.js-comm'), c = a.text().substr(0,1), f = b.find('.js-comm-avatar'), e = f.children('img').attr('src'), d = ["#c57c3b","#753bc5","#79c53b","#eb3b5a","#45aaf2","#2bcbba","#778ca3"], rand = Math.floor(Math.random() * d.length); if (e == '/templates/'+dle_skin+'/dleimages/noavatar.png') { f.html('<div class="comment-item__letter d-flex jc-center ai-center" style="background-color:'+d[rand]+'">'+c+'</div>'); }; }); var gotop = $('#scrolltop'); $(window).scroll (function () { if ( $(this).scrollTop () > 300 ) { gotop.fadeIn(200); } else { gotop.fadeOut(200); } }); gotop.click(function(){ $('html, body').animate({ scrollTop : 0 }, 'slow'); }); }); function doRateLD( rate, id ) { ShowLoading(''); $.get(dle_root + "engine/ajax/controller.php?mod=rating", { go_rate: rate, news_id: id, skin: dle_skin, user_hash: dle_login_hash }, function(data){ HideLoading(''); if ( data.success ) { var rating = data.rating; rating = rating.replace(/</g, "<"); rating = rating.replace(/>/g, ">"); rating = rating.replace(/&/g, "&"); $("#ratig-layer-" + id).html(rating); $("#vote-num-id-" + id).html(data.votenum); var rt = parseInt($(rating).text()), m = (data.votenum - rt)/2, p = data.votenum - m, fill = Math.round(p/data.votenum*100), frate = $('#inner-page__rating--' + id); frate.find('.inner-page__rating-percent').html(''+fill+'%'); frate.find('.inner-page__rating-fill').css({'width':''+fill+'%'}); } else if (data.error) {DLEalert ( data.errorinfo, dle_info );} }, "json"); }; /* END */ $(document).ready(function(){ $('body').on('click','#nav-load a',function(){ var urlNext = $(this).attr('href'); var scrollNext = $(this).offset().top - 200; if (urlNext !== undefined) { $.ajax({ url: urlNext, beforeSend: function() { ShowLoading(''); }, success: function(data) { $('#bottom-nav').remove(); $('#dle-content').append($('#dle-content', data).html()); $('#dle-content').after($('#bottom-nav')); window.history.pushState("", "", urlNext); $('html, body').animate({scrollTop:scrollNext}, 800); HideLoading(''); }, error: function() { HideLoading(''); alert('что-то пошло не так'); } }); }; return false; }); });