<?php


defined('_IN_JOHNCMS') or die('Error: restricted access');

$mp = new mainpage();

/*
-----------------------------------------------------------------
Блок информации
-----------------------------------------------------------------
*/
echo '<div class="links"></div><div class="kuk"><b>Bo`limlar</b></div><div class="links"></div>';

include_once $SERVER['DOCUMENT_ROOT'].'download/functions.php';
echo '<div class="list1"><img src="images/music.png" alt="" /> <a href="download/index.html">Barcha taronalar </a>('.dcount_simba().')</div>';
$zap = mysql_fetch_array(mysql_query("SELECT * FROM `downpath` WHERE `id` = '1'"));
$old = $realtime - (3 * 24 * 3600);
$countnf = mysql_result(mysql_query("SELECT COUNT(*) FROM `downfiles` WHERE `type`!= 1 && `time` > '".$old."' && `way` LIKE '" . $zap['way'] ."%' "),0);
$countf = mysql_result(mysql_query("SELECT COUNT(*) FROM `downfiles` WHERE `type`!= 1 && `way` LIKE '" . $zap['way']."%' "), 0);


echo '<div class="list2"><img src="/images/mp3.png" alt="" /> <a href="download/dir_1.html">Yangi o`zbek taronalari</a> ('.$countf;
if($countnf > 0){ echo'<span class="red"> +'.$countnf.'</span>'; }
echo')</div>';
$z = mysql_fetch_array(mysql_query("SELECT * FROM `downpath` WHERE `id` = '3'"));
$o = $realtime - (3 * 24 * 3600);
$countnf = mysql_result(mysql_query("SELECT COUNT(*) FROM `downfiles` WHERE `type`!= 1 && `time` > '".$o."' && `way` LIKE '" . $z['way'] ."%' "),0);
$countf = mysql_result(mysql_query("SELECT COUNT(*) FROM `downfiles` WHERE `type`!= 1 && `way` LIKE '" . $z['way']."%' "), 0);

echo '<div class="list1"><img src="images/muzuz.png" alt="" /> <a href="download/dir_3.html">Xorij Taronalari</a> ('.$countf;
if($countnf > 0){ echo'<span class="red"> +'.$countnf.'</span>'; }
echo')</div>';
$za = mysql_fetch_array(mysql_query("SELECT * FROM `downpath` WHERE `id` = '2'"));
$ol = $realtime - (3 * 24 * 3600);
$countnf = mysql_result(mysql_query("SELECT COUNT(*) FROM `downfiles` WHERE `type`!= 1 && `time` > '".$ol."' && `way` LIKE '" . $za['way'] ."%' "),0);
$countf = mysql_result(mysql_query("SELECT COUNT(*) FROM `downfiles` WHERE `type`!= 1 && `way` LIKE '" . $za['way']."%' "), 0);

echo '<div class="list2"><img src="/images/musicpurple.png" alt="" /> <a href="download/dir_2.html">Yosh xonandalar</a> ('.$countf;
if($countnf > 0){ echo'<span class="red"> +'.$countnf.'</span>'; }
echo')</div>';
echo '<div class="list1"><img src="/images/rss_blue.gif" alt="" /> <a href="news/index.php">Sayt Yangiliklari</a> (' . $mp->newscount . ')</div>';

$zapa = mysql_fetch_array(mysql_query("SELECT * FROM `downpath` WHERE `id` = '4'"));
$olda = $realtime - (3 * 24 * 3600);
$countnf = mysql_result(mysql_query("SELECT COUNT(*) FROM `downfiles` WHERE `type`!= 1 && `time` > '".$olda."' && `way` LIKE '" . $zapa['way'] ."%' "),0);
$countf = mysql_result(mysql_query("SELECT COUNT(*) FROM `downfiles` WHERE `type`!= 1 && `way` LIKE '" . $zapa['way']."%' "), 0);
echo '<div class="list2"><img src="/images/mp4.png" alt="" /> <a href="download/dir_4.html">Kliplar</a> ('.$countf;
if($countnf > 0){ echo'<span class="red"> +'.$countnf.'</span>'; }
echo')</div>';
if ($set['mod_gal'] || $rights >= 7) echo '<div class="list1"><img src="download/img/jpg.png" alt="" /> <a href="gallery/">Fotoalbom</a> (' . counters::gallery() . ')</div>';
//echo '<div class="list2"><img src="/images/chat.png" alt="" /> <a href="qchat">Musiqiy Chat</a><font color="red">+13</font></div>';

if ($set['mod_guest'] || $rights >= 7)
echo '<div class="list1"><img src="/images/stolzakaz.png" alt="" /> <a href="guestbook/index.php">Musiqa buyurtma qilish</a> (' . counters::guestbook() . ')</div>';
if ($set['mod_lib'] || $rights >= 7)
echo '<div class="list2"><img src="/images/news.png" alt="" /> <a href="library/">Shou biznes yangiliklari</a> (' . counters::library() . ')</div><div class="list1"><img src="/images/lupa.png" alt="" /> <a href="download/search.php">Mp3 qidiruv</a></div>';

echo '<div class="links"></div><div class="label"><b>Новости сайта</b></div><div class="links"></div>';
echo $mp->news;
include_once $SERVER['DOCUMENT_ROOT'].'download/out_file.php';
echo '<div class="links"></div><div class="kuk"><b>Eng yangi xit taronalar</b></div><div class="links"></div>';
echo out_file(1, 10, 30);
echo '<div class="links"></div><div class="kuk"><b>Yosh xonandalar</b></div><div class="links"></div>';
echo out_file(2, 10, 30);
echo '<div class="links"></div><div class="kuk"><b>Xorij taronalari</b></div><div class="links"></div>';
echo out_file(3, 10, 30);
echo '<div class="links"></div><div class="kuk"><b>Eng yangi kliplar</b></div><div class="links"></div>';
echo out_file(4, 10, 30);

echo '<div class="links"></div><div class="phdr"><b>Shou-biznes yangiliklari</b></div><div class="links"></div>';

$req_lib = mysql_query("SELECT * FROM `lib` WHERE `type`='bk' ORDER BY `time` DESC LIMIT 5 ");

for ($i = 0; $lib = mysql_fetch_assoc($req_lib); ++$i) {
echo '<div class="list1"><img src="/images/news.png" alt="" /> <a href="/library/index.php?id='.$lib['id'].'">'.$lib['name'].'</a>
';

$komm = mysql_num_rows(mysql_query("select `id` from `lib` where type = 'komm' and refid = '" . $lib['id'] . "'"));
echo '<br />Просмотров: '.$lib['count'].'  |  ';
echo ' <a href="/library/index.php?act=komm&amp;id=' . $lib['id'] . '">Комментарии</a> ('.$komm.')
</div>';
}
if (!$user_id) {
echo '<div class="links"></div><div class="label"><b>Профил</b></div><div class="links"></div>';

echo '<div class="list2"><p><form action="/login.php" method="post"><p>' . $lng['login_name'] . ':<br/>' .
'<input type="text" name="n" value="' . htmlentities($user_login, ENT_QUOTES, 'UTF-8') . '" maxlength="20"/>' .
'<br/>' . $lng['password'] . ':<br/>' .
'<input type="password" name="p" maxlength="20"/></p>' .
'<p><input type="checkbox" name="mem" value="1" checked="checked"/>' . $lng['remember'] . '</p>' .
'<p><input type="submit" value="' . $lng['login'] . '"/></p>' .
'</form></p></div>' .
'<div class="list1"><a href="registration.php">' . $lng['registration'] . '</a> | ' .
'<a href="users/skl.php?continue">' . $lng['forgotten_password'] . '?</a></div>';

}
echo '<div class="links"></div><div class="headbar"><b>Контакты</b></div><div class="links"></div><div class="list1"><img src="/images/admin.png" alt="" />Admin: [REMIX_GROUP]</div><div class="list2"><img src="/images/mail.png" alt="" /> studio_uz@inbox.ru</div><div class="links"></div>';
?>
