Current Path : /web/htdocs/www.entinoprofit.org/home/
Upload File :
Current File : /web/htdocs/www.entinoprofit.org/home/gallerie.php

<?php
include("include/config.php");


?>

<?php include('head.php'); ?>

<body>

<!-- wrap starts here -->
<div id="wrap">
	
<?php include('header.php'); ?>				
		
		<div id="sidebar" >							
				
<?php include('tabellasx.php'); ?>				
		
		</div>
			
<div id="mainFull">	
			
			<a name="TemplateInfo"></a>
			
			<h1>Galleria fotografica</h1>
			
<?php
		
	echo '<div class="news">';
	
	$query = "SELECT g.titolo,c.nome,g.data,g.id FROM gallery g, club_list c WHERE c.id = g.idclub AND c.acsi = '1'";
	$result = mysql_query($query) or die(mysql_error());
	
	$num_rows = mysql_num_rows($result);
										
	$Directory = 'gallery/foto/'; 
	$formati=array('jpg','JPG');
		
	echo '<div id="gallery-news">
	<ul id="griglia">';
					
	while ($array = mysql_fetch_array($result, MYSQL_BOTH)) {
	
	
	$titolo = $array['titolo'];
    $club = $array['nome'];				
						
		$Entry = $array['id'];
							

		if(is_dir($Directory.'/'.$Entry)) {
								
								

			$Directory2 = 'gallery/foto/'.$Entry.'/tn/'	;	 
			if(is_dir($Directory2)) {
			$SubDirectory = opendir($Directory2) or die('errore subdirectory');
			}
			$img = array();
				while($Entry2 = @readdir($SubDirectory)) {
										
					$formato=substr($Entry2,(strlen($Entry2)-3),strlen($Entry2));
					if(in_array($formato,$formati)){
						$img[] = $Entry2;
					}
									
				} 
								
								
		$info = rand(0,(count($img)-1));
	
								
			echo '<li class="foto">
				<a href="/galleria.php?gallery='.$Entry.'">
				<img height="50px" src="/'.$Directory2.$img[$info].'"></a>'.cutHtmlText($club,15,'...',0,0,0).'
				</li>';
								
								
		}
		
		}
								
								
			echo '</ul>
			</div>';
	
	
	echo '</div>';
include('infoacsi.php'); 
		
						
?>
	
							
	  </div>	
	<!-- content-wrap ends here -->		
	</div>

<!-- footer starts here -->	
<?php include('footer.php'); ?>
<!-- footer ends here -->
	
<!-- wrap ends here -->
</div>

</body>
</html>