# My Imagegallery

**URL:** <https://forum.kirupa.com/t/my-imagegallery/63585>\
**Category:** design\
**Created:** [September 8, 2004, 7:01am UTC](https://forum.kirupa.com/t/my-imagegallery/63585 "2004-09-08T07:01:09Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Danko](https://avatars.discourse-cdn.com/v4/letter/d/58956e/32.png) [@Danko](https://forum.kirupa.com/u/Danko)\
**Post date:** [September 8, 2004, 7:01am UTC](https://forum.kirupa.com/t/my-imagegallery/63585/1 "2004-09-08T07:01:09Z")

</div>

I’d like to have a word from you about the image gallery I made.

[http://dkozar.com/flash/imagegallery/](http://dkozar.com/flash/imagegallery/)

- It’s entirely dinamic: pictures are being upload (and folders created) through the HTML interface.
- After the upload, pictures are being resized to a 800x600 (or 600x800) format (depends of the portrait/landscape orientation) and thumbnails are automaticaly generated.  
Rotation by the steps of 90 degrees is available after download, thumbnails are then re-generated.
- Flash browses the folders communicating with simple PHP script (using LoadVars.sendAndLoad). PHP returns [the content](http://www.dkozar.com/flash/imagegallery/load.php) of that particular folder to flash.
- There are no limitations on the folder structure - the folder can have a sub-sub-subfolder at any depth

I was deffinitely inspired by that Sephiroth image gallery, so I made my own - but without AMFPHP, without any folder depth restrictions and with some keyboard-functionality added.  
The photos are not all mine, some of them are from all-around-the-web -\> for testing purposes only.  
After I fix a few bugs, I intend to put the installation on my site for a free download. 👼

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 8, 2004, 8:12am UTC](https://forum.kirupa.com/t/my-imagegallery/63585/2 "2004-09-08T08:12:09Z")

</div>

Good work !!

Could use some customisation features like skins etc. Yes and you have a few bugs to fix like Clicking on Back should take you to the folder and not to root folder.  
A scrollbar also would have been nice.

on the admin side, a flash only solution would have been perfect.

Once again. Overall

Good work !!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 8, 2004, 8:42am UTC](https://forum.kirupa.com/t/my-imagegallery/63585/3 "2004-09-08T08:42:24Z")

</div>

BACK means “one folder up” or “parent folder”!  
Clicking on SHOW THUMBS on the top of the screen (while in big picture mode) takes you to folder view.  
Using SPACE key:

- in big picture mode, SPACE means “show thumbs”
- in thumbs mode space means “folder up”

Thx for tips :sure:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 9, 2004, 4:00am UTC](https://forum.kirupa.com/t/my-imagegallery/63585/4 "2004-09-09T04:00:30Z")

</div>

normally back means goto the last page / last view

in your case,  
instead of SHOW THUMBS maybe you can put back and  
instead of back , parent folder

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 9, 2004, 12:01pm UTC](https://forum.kirupa.com/t/my-imagegallery/63585/5 "2004-09-09T12:01:18Z")

</div>

I love it! It’s so great! I’m working on something like this for a client. Was it super hard to create? My only suggestion is perhaps create a small icon for the folders so it’s easier to tell that they are folders.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 9, 2004, 12:37pm UTC](https://forum.kirupa.com/t/my-imagegallery/63585/6 "2004-09-09T12:37:35Z")

</div>

very nice work

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 9, 2004, 2:07pm UTC](https://forum.kirupa.com/t/my-imagegallery/63585/7 "2004-09-09T14:07:58Z")

</div>

> [@wanyo](#):
>
> I love it! It’s so great! I’m working on something like this for a client. Was it super hard to create?

I started from Macromedia image slide show example and came this far… no, it wasn’t hard, but it takes knowing many tips and tricks. First you try loading vars from a static .txt file, then you turn this .txt file it into .php script which browses dir… Then you put some sorting in it…

> [@wanyo](#):
>
> My only suggestion is perhaps create a small icon for the folders so it’s easier to tell that they are folders.

I can’t because I decided that folder browsing will be multi-level (Acdsee-ish tipe of).

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 10, 2004, 12:23am UTC](https://forum.kirupa.com/t/my-imagegallery/63585/8 "2004-09-10T00:23:56Z")

</div>

> [@Danko](#):
>
> I started from Macromedia image slide show example and came this far… no, it wasn’t hard, but it takes knowing many tips and tricks. First you try loading vars from a static .txt file, then you turn this .txt file it into .php script which browses dir… Then you put some sorting in it…

Thanks, I definitely keep that in mind! I already have the load vars thing down, but I guess I have to figure out how to get the sorting and how many images to display from the variables. We’re stuck using asp, but we can get it working just the same 🙂

Another quick question (sorry if I bother). What did you use to find out how many pages to display? Did you just use multiple keyframes(therefore creating a maximum of images/folders) or did you load/display all the images/movies in dynamically?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 10, 2004, 2:38pm UTC](https://forum.kirupa.com/t/my-imagegallery/63585/9 "2004-09-10T14:38:03Z")

</div>

> [@wanyo](#):
>
> What did you use to find out how many pages to display? Did you just use multiple keyframes(therefore creating a maximum of images/folders) or did you load/display all the images/movies in dynamically?

Let’s start with a PHP side - here’s what PHP script outputs (in this case for the root folder): [\>Click here!\<](http://dkozar.com/flash/imagegallery/load.php)

Just analyze this output and you will notice [COLOR=Navy]the pattern[/COLOR]:

name, date, size, type,  
name, date, size, type,  
name, date, size, type,  
…  
…  
and at the end, the last variable is [COLOR=Navy]TheNumberOfFiles[/COLOR] \<—IMPORTANT

[COLOR=Indigo](Oh, a little lesson in Croatian:  
ime = name  
datum = date  
tip = type (dir or pic)  
broj fajlova = number of files)[/COLOR]

So, that TheNumberOfFiles variable tells Flash how many screens it has to display for that particular folder.

[COLOR=DarkRed]numberOfScreens = int (numberOfFiles / numberOfObjectsPerScreen) + 1[/COLOR]

In this case:  
Number of objects per screen = 20  
Number of objects (files) found in folder = 42  
numberOfScreens = int(42 / 20)+1 = 2+1 = 3

Get it?

So, when you are on the first of that three screens, you load thumbs from 1 to 20, on the second screen you load thumbs 21-40, on third 41-42.  
You have to play with this, use some math… :tb:

When you hit NEXT, first you destroy all the thumbs holders on screen, and then create new ones, which then load new thumbs…

And you have to play with previous/next buttons visability too:

- if only one screen - there’s no buttons
- if many screens:

- on the first screen there’s no PREVIOUS button
- on the last screen there’s no NEXT button[list]  
[/list]  
One more thing… when you enter into a folder, flash puts the previous folder name on the STACK and sends that folder name to PHP to browse it. The STACK (push-pop array) is handy solution for this - when you hit FOLDER UP button, you POP the folder name which was last PUSHED on the stack. 🍺

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 15, 2004, 10:10pm UTC](https://forum.kirupa.com/t/my-imagegallery/63585/10 "2004-09-15T22:10:47Z")

</div>

Okaaay - as I prommised - here’s download of my ImageGallery:

[\> CLICK HERE: imagegallery.zip (33k) \<](http://dkozar.com/downloads/imagegallery/imagegallery.zip)

**Installation:**

You gotta have PHP and MySQL (IG uses one table in one database - for user administration only).

- extract this .zip in some folder on your local hard disk
- FTP it to your web server
- with \*\*ControlPanel \*\* or similar prog. change permissions for file \*\*config.php \*\* and for folder **upload** to [COLOR=Red] **777** [/COLOR]
- create a MySQL database (but not neccessary - you could use the existing one) (A)
- create a MySQL user (B) with password ©
- add this user to database with rights \*\*ALL \*\* ( **SELECT** + **INSERT** +\*\*DELETE \*\* will do)
- put the http address of your folder + “/install” into your browser (http://your\_server/your\_folder/install)
- a form will apear. Insert your MySQL connection data:  
[INDENT]+ Host name: \*\*localhost \*\* (if DB on the same server as scripts)

- Database: (A)
- Username: (B)
- Password: ©
- Table: give table a name. The table will be deleted if already exists![/INDENT]

- click **Submit**. Is everything OK? Installed?
- if yes, delete dir \*\*install \*\* from the server  
It’s done! 🐇

**Administration (HTTP upload of images):**

- put the http address of your folder + “/admin” into your browser (http://your\_server/your\_folder/admin)
- log in with user/pass: **test** / **test**
- create your user(s) and delete \*\*test \*\* user

**Epilogue:**

- Administrators can upload and delete, users can only upload files.
- Error **Call to undefined function: imagecreatefromjpeg() in … \upload.php** indicates the absence of **gd2.dll** extension in your php installation (check out your **php.ini**!)

So… that’s wery much it! You can use my ImageGallery everywhere you like… 🍺

I’d like to hear from you about this installation!

Danko Kozar, [DKOZAR.COM](http://dkozar.com) 😛

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 15, 2004, 10:42pm UTC](https://forum.kirupa.com/t/my-imagegallery/63585/11 "2004-09-15T22:42:43Z")

</div>

WOW!!!  
How about the flash file so that we can change the look of it??? Man great work, love it :thumb:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 16, 2004, 6:37am UTC](https://forum.kirupa.com/t/my-imagegallery/63585/12 "2004-09-16T06:37:15Z")

</div>

No… no fla… for now.

btw. I forgot to say that **you can use my IG unless you don’t change the copyright and linking to my site!**

You can check for updates on this address: [\> Click here! \<](http://dkozar.com/dk_web/downloads.php)

Now I’m thinking about \*\*skins \*\* 😃  
In the next version I’ll make an attaching of a custom GIF/JPEG from outside .swf as a custom logo! 🐇 Some other graphic stuff as well…  
Some buggy stuff (as this BACK button logic) will be repaired too…

The only thing that shouldn’t be changable is that CODED BY text in the bootom-right corner, and tiny window that it opens.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 16, 2004, 8:33am UTC](https://forum.kirupa.com/t/my-imagegallery/63585/13 "2004-09-16T08:33:42Z")

</div>

aww man :crying: ☹

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 16, 2004, 8:38am UTC](https://forum.kirupa.com/t/my-imagegallery/63585/14 "2004-09-16T08:38:09Z")

</div>

why no FLA?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 27, 2004, 4:23pm UTC](https://forum.kirupa.com/t/my-imagegallery/63585/15 "2004-09-27T16:23:00Z")

</div>

this looks great. gratz.
