Wednesday 21st May 2008

by Mr Me
This entry is part 2 of 5 in the series Online Photoshop

Implementation of the Browse Photos Area >>

Today we will implement the browse photos area of online photoshop

Those who haven’t seen the online photo editing tool, click on the above icon (baloon)

You can see the browse area implementation here: http://www.sajithmr.com/photoshop-tuts/browse.php

What you need for this is 4 php functions: is_dir , opendir, readdir, filetype

Normal file browsing can be implemented using while loop with above four functions.

See its usage:

PHP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
if (is_dir($dir)){if ($dh = opendir($dir)){
while ( ($file = readdir($dh)) !== false )
{
if($file != '.' && $file != '..')
{
//if it is a directory show folder icon
if( filetype($dir .$dir_sep. $file) == "dir" )
{
//display a folder icon here with folder name using img tag
}
else
{
// display image here in img tag
}
}
}
}
}

The whole source code is here: http://www.sajithmr.com/photoshop-tuts/browse.zip

Tags: , , , , ,

· · · ◊ ◊ ◊ · · ·

4 Responses to “Online Photoshop in PHP (Series Part 2)”

  1. Elie Cottage says:

    Brain buffet…

    Just a suggestion – you could write at high school education level for more mass appeal….

  2. Jim Williams says:

    Really inspiring site! I’m viewing it in a Chrome browser, and the image links are explicitly not coming through. For example, http://www.sajithmr.com/wp-content/uploads/2008/05/winzip_180x180.thumbnail.gif is a non-working link.

    I’m seriously interested in learning from your code and possibly using it in a site.

  3. ajith says:

    hai can you send me the http://www.sajithmr.com/photoshop-tuts/browse.zip files yaar. the link attacked by virus
    please send me yaar

  4. ron says:

    hey can you update me the photoshop files and src

· · · ◊ ◊ ◊ · · ·

Leave a Reply

Need your support
More in php, php source code (68 of 115 articles)


Introduction >> As i announced in my birthday post: celebrating-1st-year-of-sajithmr.com , i am starting my post series How to make ...