5, December 2008

Custom Photo Album - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: Custom Photo Album
« previous next »
Pages: [1] Print

Author Topic: Custom Photo Album  (Read 762 times)
World Wide Whale
***
Gender: Female
Posts: 153
1042 credits
Members referred : 0



« on: Jan 18, 2007, 09:50:27 PM »

I want to build a photo album for my website that you will be able to click next & back on photos to view my photos.  I don't want each photo to be a separate page & I don't want to use frames.  Does anyone have any good ideas?
Global Moderator
Internet Junkie
*****
Gender: Male
Posts: 1807
9006 credits
Members referred : 6



« Reply #1 on: Jan 18, 2007, 10:45:22 PM »

you should use php for that. Your page could be photoalbum.php and the next/prev links would look something like photoalbum.php?photo=12 where the number is the photo number...

I have recently created something like that, I'll send you a link in a PM
« Last Edit: Jan 18, 2007, 10:47:00 PM by Mind_nl »


Last blog : Are You Stumbling Yet?
World Wide Whale
***
Gender: Female
Posts: 153
1042 credits
Members referred : 0



« Reply #2 on: Jan 18, 2007, 10:47:27 PM »

That's kinda what I am looking for, how did you do it?
Global Moderator
Internet Junkie
*****
Gender: Male
Posts: 1807
9006 credits
Members referred : 6



« Reply #3 on: Jan 18, 2007, 10:52:53 PM »

To keep maintenance for the site owner as simple as possible the all pictures in a certain directory on the server will be shown in the photo album. To add pictures all he has to do is upload them to that directory. The script gets all .jpg files from the directory and stores them in an array
Code:
<?php
$dirlist "./images/gallery" // leave it alone if it's the same directory  
// Change it if you want to view a different
// directory. default value:  "./"                    

if (is_dir($dirlist)==true ) // check if directory exists
{
chdir$dirlist );
$handle=opendir"."); // open the directory
$x=0;
$files=array();
while (($file readdir($handle))!==false // while there's files to read....
{
$pieces explode ("."$file);
if ($pieces[0] && $pieces[1])  // filename.ext
{
if (($pieces[1]=="jpg"))  // add only .jpg files
{
$files[$x]=$file // add it to the array.
$x++;
}
}
}

closedir($handle);    //done finding files
?>


Then all you need to do is display the correct picture number from the array
« Last Edit: Jan 18, 2007, 10:55:31 PM by Mind_nl »


Last blog : Are You Stumbling Yet?
World Wide Whale
***
Gender: Female
Posts: 153
1042 credits
Members referred : 0



« Reply #4 on: Jan 18, 2007, 10:57:24 PM »

Thanks so much!  It is exactly what I was looking for!!
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8272
42619 credits
Members referred : 3



« Reply #5 on: Jan 19, 2007, 09:19:16 AM »

For the presentation part, you can check this : http://www.airtightinteractive.com/simpleviewer/ Visit through proxy

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy or twitter Visit through proxy

Last blog : Free Unlimited Bandwith and disk space to good to be true?
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=5676
Tags : Photo Albums Bookmark this thread : Digg Del.icio.us Dzone more....

Topic sponsors:
Get a permanent link here for $1.99!


Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: Custom Photo Album
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Dec 05, 2008, 05:42:52 AM





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!


Forum Statistics
Total Posts: 37.995
Total Topics: 7.685
Total Members: 4.468
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: sansthaa

28 Guests, 4 Users online :

10 users online today:



Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2008 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.