View file modules/libs/core/libs.php

File size: 2.57Kb
<?
if(!defined('SHCMS_ENGINE')) {
	die( "Неправильное действие" );
}
	
	        $id = intval($_GET['id']);
			
		    if($users['group'] == 15) {
		        echo '<div class="mainname">'.Lang::__('Разделы').'</div>';
				
				    echo '<div class="mainpost">';
					    echo '<img src="/engine/template/icons/notepad.png"> <a href="index.php?do=newfiles&id='.$id.'">'.Lang::__('Новая статья').'</a>';
					echo '</div>';
			}		
			
			$lcount = $db->get_array( $db->query( "SELECT COUNT(*) FROM `libs_files` WHERE `id_lib` = '".intval($id)."'" ));
		    $newlist = new Navigation($lcount[0],25,true); 
			if($lcount[0] > 0 ){
				$file = $db->query( "SELECT * FROM `libs_files` WHERE `id_lib` = '".$id."' ORDER BY `id` DESC ". $newlist->limit()."" );
			}
			if($db->num_rows($file) > 0) {
				
		        while($files = $db->get_array($file)) {
				    
					//Определяем ник
		                $nick = $user->users($files['id_user'],array('nick'),false);
		
		            //Определяем id
                        $id_users = $user->users($files['id_user'],array('id'));
						
						
							if($users['group'] == 15 or $files['id_user'] == $id_user) {
			                    $group = '&nbsp;&nbsp;<a href="index.php?do=editfiles&id='.$files['id'].'">';
				                $group .= '<img src="/engine/template/icons/edit.png"></a>&nbsp;';
				                $group .= '<a href="index.php?do=delfiles&id='.$files['id'].'">';
				                $group .= '<img src="/engine/template/icons/delete.png"></a>';
			                }
							
							
				    echo '<div class="mainpost">';
					
					    echo '<b><a href="index.php?do=view&id='.$files['id'].'">'.$files['name'].'</a></b>'.$group.'<span class="time">'.date::make_date($files['time']).'</span><br/>';
                        echo '<div class="details">';
						
						echo '<span><img src="/engine/template/icons/author.png">&nbsp;<a style="color:#1E90FF;" href="'.MODULE.'profile.php?act=view&id='.$id_users.'">'.$nick.'</a></span>';
		                echo '<span><img src="/engine/template/icons/eye.png">&nbsp;<font color="#778899">'.$files['view'].'</font></span></div>';
		               
					   echo '<div class="row">'.engine::input_text(engine::substr($files['text'],900)).'</div>';
					
					echo '</div>';
					
				}
				
				echo $newlist->pagination('do=libs&id='.$id.'');
				
			}else{
				echo engine::error(Lang::__('Статей не найдено'));
			}
			
            echo engine::home(array('Назад','index.php'));			
	   
?>