Файл: index.php
Строк: 48
<?php
require('core/start.php');
$data = array(
'title' => lang('title_home')
);
head($data);
$query = "SELECT * FROM news order by id desc limit 1";
$result = mysqli_query($db, $query);
$data = mysqli_fetch_array($result);
if (!empty($data)) {
echo '<div class="novosti"><b>', $data['date'], '</b><br />', nl2br(htmlspecialchars_decode(get_index_new($data['text']))), '</div>';
} else {
echo '<div class="novosti">Новости не опубликованы</div>';
}
?>
<div class="title"><img src="img/01.png"/><?= lang('main_site') ?></div>
<div class="link">
<a href="category.php?select=new"><img src="img/1.png"/><?= lang('new_music') ?></a>
<a href="category.php?select=popular"><img src="img/2.png"/><?= lang('popular_24_hour') ?></a>
<a href="category.php?select=top"><img src="img/3.png"/><?= lang('top_20') ?></a>
<a href="category.php?select=last"><img src="img/4.png"/><?= lang('download_last') ?></a>
<a href="category.php"><img src="img/4.png"/><?= lang('all_music') ?> +</a>
</div>
<div class="title"><img src="img/02.png"/><?= lang('poslednee_dobavili') ?></div>
<?php
$i = 0;
$query = "SELECT * FROM files ORDER BY id DESC LIMIT 10";
$result = mysqli_query($db, $query);
while ($row = mysqli_fetch_array($result)) {
?>
<div class="menu">
<img src="screens/<?= $row['id'] ?>_mini.jpg" class="screen" alt=""/> <a href="track.php?id=<?= $row['id'] ?>"><?= $row['name'] ?></a><br/>
<span><a href="category.php?select=artist&name=<?= base64_encode($row['artist']) ?>"><?= $row['artist'] ?></a></span>
</div>
<?php
$i++;
}
if (empty($i)) {
?>
<div class="menu">
<?= lang('no_files') ?>
</div>
<?php
}
if (!empty($_POST)) {
if (empty($_POST['type']) && !empty($_POST['query'])) {
$_SESSION['query'] = $_POST['query'];
redirect(HOME . 'category.php?select=search');
exit;
}
}
?>
<div class="search">
<form action="#" method="POST">
<input type="text" name="query" placeholder="<?= lang('search') ?>..."/>
<input type="submit" value="<?= lang('search_iskaty') ?>"/>
</form>
</div>
<div class="link"><a href="<?= HOME ?>/contacts.php">Контакты</a></div>
<?php
footer();
?>