simun Posted July 22, 2009 Share Posted July 22, 2009 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 More sharing options...
simun Posted July 22, 2009 Author Share Posted July 22, 2009 i know there is a sort() and rsort() fuctions but i dot know how to add them to my script please helpppp Link to comment https://forums.phpfreaks.com/topic/166960-ordering-images-by-filename/#findComment-880266 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.