<?php
defined('_IN_JOHNCMS') or die('Error: restricted access');
$sql = mysql_result(mysql_query('SELECT COUNT(*) FROM `library_texts` WHERE `premod`=1'), 0);
$page = $page >= ceil($sql / $kmess) ? ceil($sql / $kmess) : $page;
$start = $page == 1 ? 0 : ($page - 1) * $kmess;
$req_lib = mysql_query("SELECT * FROM `library_texts` WHERE `premod`='1' ORDER BY `time` DESC LIMIT 8 ");
if ($sql) {
	$i = 0; 
			echo '<div class="phdr"><b>' . $lng['information'] . '</b></div>';
	?>
	<br>
<div class="w3-container w3-teal">
		<h5>Yangi maqolalar</h5>
	</div>
	<div class="w3-white w3-round w3-margin">
		<div class="w3-row-padding" style="margin:0 -16px;">
			<?php 
			while ($lib = mysql_fetch_assoc($req_lib)) { 
				if (file_exists((ROOTPATH . 'files/library/images/orig/' . $lib['id'] . '.png'))){ ?>
				<div class="w3-half w3-hover-opacity">
					<div class="container"><br>
						<img class="w3-border w3-padding w3-margin-bottom" src="<?php echo $home; ?>/files/library/images/orig/<?php echo $lib['id']; ?>.png" style="width:99%; height: 300px;">
						<h5 class="content"><a href="<?php echo $set['homeurl']; ?>/library/index.<?php echo$akb_for;?>?id=<?php echo $lib['id']; ?>"><?php echo  $lib['name']; ?></a></h5>	
						</div>
					</div>
				<?php } } } ?>
			</div>
		</div>
	</div>
</div>
</div>
</div>
<!-- SHU YERDA NIMADIR UZULISHI KERAK -->
<?php 
$limit_fox = '4';
$req_fox = mysql_query("SELECT `id`, `user_id`, `album_id`, `img_name` FROM `cms_album_files` ORDER BY `time` DESC LIMIT $limit_fox "); ?>
<div class="w3-container w3-card w3-white w3-round w3-margin"><br>
	<div class="w3-container w3-teal">
		<h5>Yangi rasmlar</h5></div>
		<div class="w3-row-padding" style="margin:0 -16px">
			<?php while ($res_fox = mysql_fetch_array($req_fox)){  ?> 
				<div class="w3-half w3-hover-opacity"><br>
					<a href="/users/album.<?php echo$akb_for;?>?act=show&al=<?php echo $res_fox['album_id']; ?>&img=<?php echo $res_fox['id']; ?>&user=<?php echo $res_fox['user_id']; ?>&view">
						<img class="w3-border w3-padding" src="../files/users/album/<?php echo $res_fox['user_id']; ?>/<?php echo $res_fox['img_name']; ?>" style=" width:100%";  alt="Northern Lights;"></a></div>
					<?php } ?>
				</div>
			</div>
			<!-- Middle Column -->
			<div class="w3-row-padding">
				<div class="w3-col m12">
					<div class="w3-card w3-round w3-white">
						<div class="w3-container w3-padding">
							<?php $reg_lim = '5';
							$reg_akbar = mysql_query("SELECT `id`, `name`, `datereg` FROM `users` ORDER BY `datereg` DESC LIMIT $reg_lim"); ?>
							<b>Yangilar</b><br>
							<?php while ($reg_akbar1 = mysql_fetch_array($reg_akbar)) { ?>
								<img src="../images/m_new.png" width="15" height="15" alt="Foydalanuvchi">
								<a href="<?php echo $home;?>/users/profile.<?php echo$akb_for;?>?user=<?php echo $reg_akbar1['id']; ?>">
									<?php echo $reg_akbar1['name']; ?></a>
								<?php } ?> <br> <br>
							<?php echo include 'lider/main.php'; ?>