View file modules/gallery/inc/photo.php

File size: 1.5Kb
<?php
if( ! defined( 'SHCMS_ENGINE' ) ) {
    die('SHCMS Engine No access');
}

	     
	$id = intval($_GET['id']);
	$dir = $db->super_query( "SELECT * FROM `gallery_dir` WHERE `id` = '{$id}'" );
		
		if($dir['id_user'] == $id_user)
		{
		    $iview = '<a href="?do=newphoto&id='.$dir['id'].'">'.Lang::__('Добавить').'</a>';
		}
		
		
		echo '<div class="mainname">'.Lang::__('Фотографии из папки').': '.$dir['name'].'';
		echo '<span class="time">'.$iview.'</span></div>';
		echo '<div class="mainpost">';
		    
			$files = $db->query( "SELECT * FROM `gallery_files` WHERE `id_dir` = '{$dir[id]}'" );
			    
			echo '<center>';
			    
			if($db->num_rows($files) > 0) {
			    echo '<ul class="thumbnails" data-toggle="lightbox">';
				while( $gallery = $db->get_array( $files ) ) 
				{
				        $gview = '</li>';
                        $gview .= '<a title="Просмотр" class="thumbnail" href="/upload/gallery/max/'.$gallery['images'].'">';
	                    $gview .= '<img src="/upload/gallery/mini/'.$gallery['images'].'" title="'.$gallery['images'].'" /></a>';
					    $gview .= '</li>';
					
					echo $gview;
				
				}
			echo '</ul>';
            }else {
			    
				echo engine::error('Фотографий не найдено');
			
			}			
				
			echo '</center>';
			
		echo '</div>';
		
    //Переадресация	
	echo engine::home( array( Lang::__('Назад') , 'index.php?do=user&id='.$dir['id_user'].'' ) );

?>