View file modules/libs/core/view.php

File size: 1.52Kb
<?
if(!defined('SHCMS_ENGINE')) {
	die( "Неправильное действие" );
}
			    
			$id = intval($_GET['id']);
				
				$view = $db->super_query( "SELECT * FROM `libs_files` WHERE `id` = '".$id."'" );
			    $count = $db->get_array($db->query("SELECT COUNT(*) FROM `libs_comment` WHERE `id_libs` = '".$id."'"));
					
					//Счетчик обновляем
					$db->query("UPDATE `libs_files` SET `view` = '".($view['view']+1)."' WHERE `id` = '".$id."'");
		                
						//Вывод ника
                            $nick = $user->users($view['id_user'],array('nick'),false);
							
			            //Вывод id
                            $id_users = $user->users($view['id_user'],array('id'));
					
					echo '<h2 class="mainname"><center>'.$view['name'].'</center></h2>';
					echo '<div class="mainpost">';
					
					
					echo '<div class="details"><span><img src="/engine/template/icons/author.png">
					<span><a href="/modules/profile.php?id='.$id_user.'">'.$nick.'</a>&nbsp;&nbsp; </span>
					<span><img src="/engine/template/icons/date.png"> '.date::make_date($view['time']).'&nbsp;&nbsp;</span> 
					<span><img src="/engine/template/icons/comment.png">
					<span><a href="index.php?do=comment&id='.$id.'"><b>Комментрий: '.$count[0].'</b></a></span></div>';
					
					echo '<div class="row">'.engine::input_text($view['text']).'</div>';
					echo '</div>';
					
			    echo engine::home(array('Назад','index.php?do=libs&id='.$view['id_lib'].''));
				
?>