hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : List Dir
Reply

Programming Discussion Discussions related to web programming languages and other related issues. Topics may include configuration, optimization, practical usage and database connectivity.
Forum Jump

List Dir

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 08-09-2010, 06:18 PM
Danny159 Danny159 is offline
Web Hosting Evangelist
 
Join Date: Aug 2007
Location: Oakham England
Posts: 454

List Dir


Hey,

I have the following script and this works fine and echos all the photos listed in the directory!

PHP Code:
<?php
$image_dir 
"clients/" $_GET['imgdir'] . "/";
$image_dirb "clients/" $_GET['imgdir'] . "/";

/* settings */
$per_column 100;
        

if(!
opendir($image_dir)){
    echo 
"<br><br>Oops... This album is lost!<br>Please contact me!";
    
}else{
        
/* step one:  read directory, make array of files */
if ($handle opendir($image_dir)) {
while (
false !== ($file readdir($handle))) 
{
if (
$file != '.' && $file != '..' && preg_match("/t/",$file) && $file != '_notes'
{
$files[] = $file;
}
}
closedir($handle);
}
        
$b $_GET["bride"];
$g $_GET["groom"];
        
/* step two: loop through, format gallery */
if(count($files)){
foreach(
$files as $file){
$count++;
$new_name str_replace("t.jpg"".jpg"$file);
echo 
'
<a href="?portal=view&groom=' 
$g '&bride=' $b '&imgdir=' $image_dirb '' $new_name '&file=' $new_name '">
<img src="' 
$image_dirb '' $file '" style="margin: 5px; padding: 4px; border: 1px solid #e8e8e8; background-color: white;" />
</a>
'
;

if(
$count $per_column == 0) { echo ''; }
}}
else
{
echo 
"";
}

// End if no folder
}
?>
However I want it to only show 10 images at a time, then have page numbers for however many pages is needed and also be in file order as they are names 001.jpg, 002.jpg etc... but it doesnt seem to display them in order.

Help please!
Dan

__________________
Streama - Your WordPress Friend
http://www.streama.co.uk

Reply With Quote


Sponsored Links
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to find a script.. todo list/task manager list MartynD Web Design and Content 2 08-11-2007 05:26 AM
List of emails to outlook contact list? NationHosts Web Hosting Lounge 1 04-05-2007 08:50 AM
publish dir list to webpage chavite Programming Discussion 3 10-31-2006 12:43 PM
Members Database list / Emailing list 247ursites Programming Discussion 1 01-28-2004 11:57 PM
ls, no dir, or is it ls? IceCell Web Hosting Lounge 12 01-23-2004 07:17 PM

Related posts from TheWhir.com
Title Type Date Posted
Pingdom Talks Top Web Hosting Cities and Countries Web Hosting News 2013-03-27 18:49:54
Datapipe Makes Forbes List of America's Most Promising Companies Web Hosting News 2013-02-14 12:34:25
Web Hosts, IT Services Firms Make Inc 5000 Fastest Growing Companies Web Hosting News 2012-09-19 16:45:40
Why you should get on the blogging bandwagon Blog 2011-11-03 16:26:00
Web Hosts Climb Inc. 5000 List of Fastest-Growing US Companies for 2011 Web Hosting News 2011-08-23 20:52:20


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?