Jump to content

ordering images by filename


simun

Recommended Posts

i need to order my images by file name (name of image). my images are not in mysql base, they are on server, here is page that show my images

 

<?php
include('templates/' . $__config['template'] . '/header.php');?> <div id="headerbanner"><img src="/images/MM_DESIGN.jpg" /></div>
<div id="content-wrapper"><? include('templates/' . $__config['template'] . '/menu2.php');	




$object->gallery->getPhotos();



?>


<div id="content">

	<h1 style="padding-bottom:10px;">
        
        <a style="text-decoration:none; color:#237DB7;" href=" "><?=$__current['naslov'][$__language]?></a> - <?=$object->{'naziv_' . $__language}?>
        
        </h1>
       







        
        
        
        
	<div class="clear"></div>
        

<div style="float:left; width:350px; border-right:solid 1px #cccccc; margin-right:5px;" >

        
        
<? if ($object->{'zupanija'} > ""){?>
	 <p style=" padding-bottom:5px; font-size:11px;"><?  echo $object->{'zupanija'}; ?></p>
<? ;}
else {echo "";}?>
<? if ($object->{'lokacija'} > ""){?>
	 <p style=" padding-bottom:5px; font-size:11px;">Lokacija: <?  echo $object->{'lokacija'}; ?></p>
<? ;}
else {echo "";}?>
<? if ($object->{'kategorizacija'} > ""){?>
	 <p style=" padding-bottom:5px; font-size:11px;">Datum: 



	 <?php 

$timee=date('d.m.Y',strtotime($object->{'kategorizacija'}));
echo $timee;
?>.

	</p>
<? ;}
else {echo "";}?>
<? if ($object->{'brdodatnihkreveta'} > ""){?>
	 <p style=" padding-bottom:5px; font-size:11px;">Klijent: <?  echo $object->{'brdodatnihkreveta'}; ?></p>
<? ;}
else {echo "";}?>
<? if ($object->{'udaljenostodmora'} > ""){?>
	 <p style=" padding-bottom:5px; font-size:11px;">Autor: <?  echo $object->{'udaljenostodmora'}; ?></p>
<? ;}
else {echo "";}?>
                                               
                                                           
</div>
<div style="float:left; width:360px; padding-left:10px:" >

	<p style=" padding-bottom:5px; font-size:11px;"><?=$object->{'opis_' . $__language}?></p>
          
                                               
                                                           
</div>

            <div class="clear"></div>
            
            
      
            
            
            
           
            
            
            
            
            
            
            
            
            
            <div class="clear"></div>
            
            
            <h2><?php echo $__l['galerija'] ?></h2>

		<div class="images-details" >
<?php
if (is_array($object->gallery->photos)) {
	foreach($object->gallery->photos as $photo) {


	$myFile = "files/naslovi/hr/" . $object->id . "/" . $photo['filename'] . ".txt";
	$fh = fopen($myFile, 'r');
	$theData = fgets($fh);
	fclose($fh);

	$myFileen = "files/naslovi/en/" . $object->id . "/" . $photo['filename'] . ".txt";
	$fhen = fopen($myFileen, 'r');
	$theDataen = fgets($fhen);
	fclose($fhen);


?>
			<a class="thickbox" title="<? if ($__language == hr){echo $theData;} else {echo $theDataen;}?>" href="/images/cache/objects/<?=$object->id?>/<?=$photo['filename']?>/w-800.jpg" rel="galler"><?

				?><img alt=""  src="/images/cache/objects/<?=$object->id?>/<?=$photo['filename']?>/h-98.jpg" /><?
			?></a>

<?php
	}
}
?>
			</div>
		</div>
          
        

<?php
include('templates/' . $__config['template'] . '/footer.php');
?>

 

Is there any php code for do that?

Link to comment
https://forums.phpfreaks.com/topic/166960-ordering-images-by-filename/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.