Просмотр файла modules/libs/core/libs.php

Размер файла: 2.84Kb
<?
if(!defined('SHCMS_ENGINE')) {
	die( "Неправильное действие" );
}
	
	$id = intval($_GET['id']);

	
		if( $users['group'] == 15 ) 
		{
		
			$aview = '<img src="/engine/template/icons/notepad.png"> <a href="index.php?do=newfiles&id='.$id.'">'.Lang::__('Новая статья').'</a>';

		
		}		
			echo  '<div class="mainname">Все статьи<span class="time">'.$aview.'</span></div>';
			echo  '<div class="mainpost">';
			$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()."" );
			    
				}else {
				
				    $file = $db->query( "SELECT * FROM `libs_files` WHERE `id_lib` = '".$id."' " );
				 
				}
			
			    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="subpost">';
					    echo  '<b style="font-size:14px;"><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['mtext'],500)).'</div>';
					    echo  '</div>';
					
				    }
		                echo  '</div>';
				        echo  $newlist->pagination('do=libs&id='.$id.'');
				
			    }
				else 
				{
				
				    echo   engine::error(Lang::__('Статей не найдено'));
					
			
			    }
			
        echo  engine::home(array('Назад','index.php'));			
	   
?>