DataLife Engine > Версия для печати > Красивый вид TopNews с Хинтом fix

Красивый вид TopNews c Хинтом + автор новости

Установка:

1. Идем в engine/modules/topnews.php (для 9.4 с версии 9.5 может отличаться) и находим:

$db->query( "SELECT id, short_story, title, date, alt_name, category, flag FROM

Заменить на:

$db->query( "SELECT id, short_story, title, date, alt_name, category, flag, autor FROM

Далее ищем:

$tpl->set( '{link}', $full_link );

Ниже добавить:

$tpl->set( '{author}', "" );

2. В topnews.tpl добавить с заменой.

{title} Автор: {author}

{text limit=»130″}

3. В engine.css в самый низ добавить.

/*topnews*/
#topnews {
padding: 3px;
border-bottom: 1px  solid rgba(0,0,0,0.3); 
cellpadding: 0; 
cellspacing: 0; 
width: 200px;  
}

#topnewss {
border:1px solid #BED8EA;
 padding:2px;
 width:53px;
 height:53px;
 -webkit-border-radius: 3px;-moz-border-radius: 3px;border-radius: 3px;   
}

#topnewse {
width:120px;
height:120px; 
border:1px solid  rgba(189,190,174,0.8);
padding:2px;
-webkit-border-radius: 3px;-moz-border-radius: 3px;border-radius: 3px; 
}

#newstr{
 font-size:8pt; 
}

#newtext{
padding:4px;
width:120px; 
}

.tooltip-style1 {border: 3px solid rgba(0,0,0,0.6); background:rgba(255,255,255,1.8);color:fff;max-width:260px;padding:5px;box-shadow:0 0 3px rgba(255, 255, 255, 0.5);-moz-box-shadow:0 0 3px rgba(255, 255, 255, 0.5);-webkit-box-shadow:0 0 3px rgba(255,255,255,0.5);  z-index: 2; -webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px; display:none;position:absolute;}
 /*topnews end*/

4. В любой подключенный JS Скрипт в самый низ с новой строки добавить.

//topnews
 $(document).ready(function() {
        $(".tooltips").hover(
            function() { $(this).contents("span:last-child").css({ display: "block" }); },
            function() { $(this).contents("span:last-child").css({ display: "none" }); }
        );
$(".tooltips").mousemove(function(e) {
            var mousex = e.pageX + 10;
            var mousey = e.pageY + 5;
            $(this).contents("span:last-child").css({  top: mousey, left: mousex });
        });
    }); 
//topnews

Автор переделки: Sinsei