<?php

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


/*
$tugulgan_kun = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `dayb` = '" . date('j', time()) . "' AND `monthb` = '" . date('n', time()) . "' AND `preg` = '1'"), 0);
if($tugulgan_kun==0){ } else {
echo '<div class="menu" style="text-align: center;"><img src="/images/birthday.gif" alt="#" /> <b>Bugun saytimizda <a href="users/index.php?act=birth">' . $tugulgan_kun . ' ta</a> foydalanuvchining tug\'ilgan kuni !!!</b></div>';
} 
echo '<div class="phdr">Foydalanuvchilar fotoalbomidan</div>';   
echo '<div class="menu"><center>';   
$limit_fox = '6'; // rasim soni   
$style = 'style="width: 65px; height: 65px; border: 1px solid rgba(0, 0, 0, 0.17);"';  
$req_fox = mysql_query("SELECT `id`, `user_id`, `album_id`, `tmb_name` FROM `cms_album_files` ORDER BY `time` DESC LIMIT $limit_fox ");
while ($res_fox = mysql_fetch_array($req_fox)){   
echo '<a href="/users/album.php?act=show&amp;al=' . $res_fox['album_id'] . '&amp;user=' . $res_fox['user_id'] . '"><img ' .$style. ' class="short-image" src="/files/users/album/' . $res_fox['user_id'] . '/' . $res_fox['tmb_name'] . '" /></a>';   
} 

echo '</center></div>';  
*/

$mp = new mainpage();

echo '<div class="phdr"><b>Yangiliklar</b></div>';
echo '<b>'.$mp->news.'</b>';

echo '<div class="menu">&raquo; <a href="/news/">' . $lng['news_archive'] . ' (' . $mp->newscount . ')</a></div>';


 echo '<div class="menu">&raquo; <a href="yangiliklar/">Dunyo yangiliklari </a></div>';
echo '<div class="menu">&raquo; <a href="futbol/">Futbol yangiliklari </a></div>';
echo '<div class="menu">&raquo; <a href="qiziqarli/">Qiziqarli yangiliklar </a></div>';
echo '<div class="menu">&raquo; <a href="yulduz/">Shou-biznes yangiliklari </a></div>';

 /*echo'<div class="menu"><a href="pages/faq.php?act=parvoz"><img src="/images/news.png"
//alt="&raquo;" /> <span class="red">Bu qanday sayt? (!)</span></a></div>';
 
 echo '<div class="phdr"><b>O\'yinlar</b></div>';
	echo '<div class="menu"><a href="ferma/"><img src="/images/menu.png"
		  alt="&raquo;" /> Quvnoq ferma!<span class="red">(New!)</span></a></div>';
 	echo '<div class="menu"><a href="oyinlar/gol/"><img src="/images/menu.png"
		  alt="&raquo;" /> Penalty teping!<span class="red">(New!)</span></a></div>';
 	echo '<div class="menu"><a href="oyinlar/love/"><img src="/images/menu.png"
		  alt="&raquo;" /> Sevgi Kalkulyatori!<span class="red">(New!)</span></a></div>'; */
	 
 echo '<div class="phdr"><b>Foydali</b></div>';
echo '<div class="menu"><img src="/img/search.png" width="16" height="16" alt="icon"/> Izlash: <a href="/pics"> Rasm</a> | <a href="newmp3/">Musiqa</a> | <a href="/youtube/">Video</a> </div>';
// Ссылка на гостевую
if ($set['mod_guest'] || $rights >= 7)
    echo '<div class="menu">&raquo; <a href="guestbook/index.php">' . $lng['guestbook'] . ' ('. counters::guestbook().')</a></div>';

$chat_online = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `lastdate` > '" . ($realtime - 300) . "' AND `place` LIKE 'chat%'"), 0);

        echo '<div class="menu">&raquo; <a href="chat/index.php?id=1">Chat' . $chat_online . ' kishi</a></div>';
//echo '<div class="menu"><a href="/lenta/lenta.php?sort=vse">Лента сайта (' . statlenta() . ')</a></div>';
// Ссылка на Форум
if ($set['mod_forum'] || $rights >= 7)
    echo '<div class="menu">&raquo; <a href="forum/">' . $lng['forum'] . ' (' . counters::forum() . ')</a></div>';

// Ссылка на библиотеку
if ($set['mod_lib'] || $rights >= 7)
echo '<div class="menu">&raquo; <a href="library/">' . $lng['library'] . '</a> (' . counters::library() . ')</div>';
// Ссылка на загрузки
if ($set['mod_down'] || $rights >= 7)
include_once $SERVER['DOCUMENT_ROOT'].'download/functions.php';  echo '<div class="menu">&raquo; <a href="download/">' . $lng['downloads'] . '</a> (' .dcount_simba() . ')</div>';
/*

// zakaz stol
echo '<div class="menu"><a href="stol/"><img src="/images/menu.png" 
 alt="&raquo;" /> Mp3 buyurtma </a></div>';
// Ссылка на загрузки
if ($set['mod_down'] || $rights >= 7)
    echo '<div class="menu"><a href="download/"><img src="/images/menu.png"
alt="&raquo;" /> ' . $lng['downloads'] . ' (' . counters::downloads() . ')</a></div>';
*/
/*



    echo '<div class="menu"><a href="http://lib.uzbender.ru/"><img src="/images/menu.png"
alt="&raquo;" /> Kutubxona <span class="red"> + 5000</span></a></div>';
// Ссылка на библиотеку
/*if ($set['mod_gal'] || $rights >= 7)
    echo '<div class="menu"><a href="gallery/"><img src="/images/menu.png"
alt="&raquo;" /> ' . $lng['gallery'] . ' (' . counters::gallery() . ')</a></div>';
*/

/* userlar
if ($user_id || $set['active']) {
    echo '<div class="menu"><a href="users/index.php"><img src="/images/menu.png"
alt="&raquo;" /> ' . $lng['users'] . ' (' . counters::users() . ')</a></div>' .
        '<div class="menu"><a href="users/album.php"><img src="/images/menu.png"
alt="&raquo;" /> ' . $lng['photo_albums'] . ' (' . counters::album() . ')</a></div>';
}
*/
//service
echo '<div class="menu">&raquo; <a href="sms/">SMS yuborish</a></div>';
echo '<div class="menu">&raquo; <a href="uff/">Futbol anons <span class="red">(Live)</span></a></div>';
echo '<div class="menu">&raquo; <a href="foydali/tv.php">Tv dasturlar <span class="red">(Kunlik)</span></a></div>';
echo '<div class="menu">&raquo; <a href="kurs/">Valyuta kursi <span class="red">(Kunlik)</span></a></div>';
echo '<div class="menu">&raquo; <a href="tarjimon/">Onlayn tarjimon <span class="red">(Uz)</span></a></div>';
echo '<div class="menu">&raquo; <a href="/ob-havo/">Ob-havo ma`lumoti <span class="red">(Kunlik)</span></a></div>';
echo '<div class="menu">&raquo; <a href="/horo/">Munajjimlar bashorati <span class="red">(Kunlik)</span></a></div>';
echo '<div class="menu">&raquo; <a href="/gul_bazm_sherlari/gul_bazm_sherlari.php">Gul bazm she\'rlari <span class="red">(Ajoyib)</span></a></div>';

echo '<div class="phdr"><b>Yuklamalar</b></div>';
 //yuklamalar

echo '<div class="menu">&raquo; <a href="loads/">Yuklamalar ombori <span class="red">(org)</span></a></div>';
echo '<div class="menu">&raquo; <a href="smartzone/">Android | Symbian | Windows Phone <span class="red">(Super)</span></a></div>';





/* 
#forum
if ($set['mod_forum'] || $rights >= 7)
    echo '<div class="menu"><a href="forum/">' . $lng['forum'] . '</a> (' . counters::forum() . ')</div>';

    echo '<div class="phdr"><a href="index.php"><b>' . $lng['forum'] . '</b></a> | ' . $lng_forum['unread_last_10'] . '</div>';
    $req = mysql_query("SELECT * FROM `forum` WHERE `type` = 't' AND `close` != '1' ORDER BY `time` DESC LIMIT 5");
    if (mysql_num_rows($req)) {
        for ($i = 0; $res = mysql_fetch_assoc($req); ++$i) {
            $q3 = mysql_query("select `id`, `refid`, `text` from `forum` where type='r' and id='" . $res['refid'] . "' LIMIT 1");
            $razd = mysql_fetch_assoc($q3);
            $q4 = mysql_query("select `id`, `refid`, `text` from `forum` where type='f' and id='" . $razd['refid'] . "' LIMIT 1");
            $frm = mysql_fetch_assoc($q4);
            $nikuser = mysql_query("SELECT `from`, `time` FROM `forum` WHERE `type` = 'm' AND `close` != '1' AND `refid` = '" . $res['id'] . "'ORDER BY `time` DESC");
            $colmes1 = mysql_num_rows($nikuser);
            $cpg = ceil($colmes1 / $kmess);
            $nam = mysql_fetch_assoc($nikuser);
            echo $i % 2 ? '<div class="list2">' : '<div class="list1">';
            // Значки
            $icons = array(
                ($res['vip'] ? functions::image('pt.gif') : ''),
                ($res['realid'] ? functions::image('rate.gif') : ''),
                ($res['edit'] ? functions::image('tz.gif') : '')
            );
            echo functions::display_menu($icons, '');
            echo '<a href="/forum/index.php?id=' . $res['id'] . '">' . $res['text'] . '</a>&#160;[' . $colmes1 . ']';
            if ($cpg > 1)
                echo '&#160;<a href="/forum/index.php?id=' . $res['id'] . '&amp;clip&amp;page=' . $cpg . '">&gt;&gt;</a>';
            echo '<br/><div class="sub"><a href="/forum/index.php?id=' . $razd['id'] . '">' . $frm['text'] . '&#160;/&#160;' . $razd['text'] . '</a><br />';
            echo $res['from'];
            if (!empty($nam['from'])) {
                echo '&#160;/&#160;' . $nam['from'];
            }
            echo ' <span class="gray">' . date("d.m.y / H:i", $nam['time']) . '</span>';
            echo '</div></div>';
        }
    } else {
        echo '<div class="menu"><p>' . $lng['list_empty'] . '</p></div>';
    }
#forum 1000% ishlaydigan

echo '<div class="phdr"><b>Forum so`ngi mavzulari</b></div>'; ishlaydi
$limit = '5'; // количество тем
$req_t = mysql_query("SELECT `id`, `text` FROM `forum` WHERE `type`='t' ORDER BY `time` DESC LIMIT $limit "); // запрос
while($res_t = mysql_fetch_array($req_t)){
echo '<div class="menu"> <a href="/forum/?id='.$res_t['id'].'"> '.$res_t['text'].'</a></div>'; // вывод темы
}

echo '<div class="phdr"><b>Eng so`ngi maqolalar</b></div>'; tayyormas
$limit = '5'; // количество выводимых статей
$req_lib = mysql_query("SELECT `id`, `name` FROM `library` WHERE `type`='bk' ORDER BY `time` DESC LIMIT $limit "); // запрос
while($res_lib = mysql_fetch_array($req_lib)){
echo '<li class="lis"><a href="/library/index.php?id='.$res_lib['id'].'">'.$res_lib['name'].'</a></li>'; // вывод статьи
}
*/
/* tug'ilgan kuni bo'lgan foydalanuvchilarni bosh sahifaga chiqarish (Одноклассники saytdidagiday almashib chiqib turadi) */ 


/*
$arg = array('iphide' => 1);
$sql = mysql_query("select * from `users` order by `id` desc limit 8");
while($row = mysql_fetch_assoc($sql)) {
echo '<div class="menu">' . functions::display_user($row, $arg) . ' </div>';
}
*/
//bosh sahifaga chiqarish

include ('pages/mp3.php');
//echo '<div class="menu"><img src="/img/playmp3.png" width="16" height="16" alt=""/> <a href="http://ajoyib.ru/youtube/watch?v=xdfPXC_JVxY&n=%D0%A2%D1%83%D1%80%D1%86%D0%B8%D1%8F%20%E2%80%93%20%D1%82%D1%8A%D1%80%D1%81%D0%B8%20%D1%82%D0%B0%D0%BB%D0%B0%D0%BD%D1%82%D0%B8%201%20%D0%BA%D1%80%D1%8A%D0%B3">Turkiyada bo\'lib o\'tgan yosh yulduzlar g\'olibi</a></div>';
include 'maqola.php';

/*
echo '<div class="phdr">So\'nggi a\'zolar:</div>'; 

$req = mysql_query("SELECT * FROM `users` WHERE `preg` = 1 ORDER BY `datereg` DESC LIMIT 2");
for ($i = 0; ($res = mysql_fetch_assoc($req)) !== false; $i++) {
    echo $i % 2 ? '<div class="menu">' : '<div class="menu">';
    echo functions::display_user($res) . '</div>';
}

echo '<div class="phdr">Statistika</div><div class="menu">';
$users = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `lastdate` > '" . (time() - 300) . "'"), 0); 
$guests  = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_sessions` WHERE `lastdate` > '" . (time() - 300) ."'"), 0); 
$online=$users+$guests; 
echo ''. 
'<a href="/users/index.php?act=online">Foydalanuvchilar:  '.$users.'</a><br/>'. 
'<a href="/users/index.php?act=online&mod=guest">Mehmonlar:  '.$guests.'</a><br/>';
echo '<b>Hammasi:</b>  '. $online.'</div>'; */
/*
echo '<div class="menu">» Hozir saytda: '; 
$sql_total = "SELECT COUNT(*) FROM `users` WHERE `lastdate` > " . (time() - 300); 
$sql_list = "SELECT * FROM `users` WHERE `lastdate` > " . (time() - 300) . " ORDER BY rand() ASC LIMIT 20"; 
if ($sql_total) { 
$req = mysql_query($sql_list); 
$i = 0; 

while (($res = mysql_fetch_assoc($req)) !== false) { 
echo '<a href="/users/profile.php?user='.$res['id'].'">'.$res['name'].'</a>, '; 
} 
} 
echo '</div>';
*/

//echo '<div class="menu"><img style="margin-bottom: -2px;" src="/images/aloqa/feedback.png"> <span style="border-bottom: 1px dotted red;"><a href="feedback.php"><font color="red">Bog\'lanish</font></a></span></div>'; 



?>