View file engine/services/last_news.php

File size: 371B
<?php
	
	echo '<div class="link"><a href="/pages/news.php">Новости</a>';

	$sql->query('SELECT `time`, `title`, `msg` FROM `news` order by `id` DESC LIMIT 1');
	
	if ($sql->num_rows() == 1)
	{
	    $news = $sql->fetch();
		echo '<br />'.htmlspecialchars($news['title']) .' ('.Core::time($news['time']).')<br />'.mb_substr($news['msg'], 0, 50);
	}

	echo '</div>';