# [web] Photo Album Design

This topic is 4383 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I've made many, many photo albums in the past, but I've never been quite satisfied. Right now, I'm in the process of remaking my site (gsgraham.com, new window) in a very, very simple style. I want to be able to find things when I need to - I'm sure I'm the primary user of the site. I don't want to use Flash, ASP, or PhP. javascript, to some extent, is probably a necessity. I'll probably have 10 photo topics (you know, different events), maybe 50 pictures in each. Many amateur sites simply place all fifty pictures on one page, resize with the browser to 400 wide or so, and allow the user to click to see the full size in a new (or the same) window. I don't like this. Plain old HTML. Worse are sites that simply list the filename in a link and force you to click each and every filename. I've expanded on that before, with pre-resized images on one page (150 wide or so). You click, it pops up a nice preformatted window and loads the image (and description you want. I've also used a minor variation with tiny little sample pictures that you click on. These are obviously javascript. Has anyone found any better ways to do this? There may not be some brilliant way to do this without some sort of more powerful tool, of course.

##### Share on other sites
I haven't done anything like this before, but I have a tip -- if you find a way that works nice, but is rather long and tedious, what you should do is make a program to do all the work for you. For example, if I were to place the tags myself on my C++ syntax coloring program, it would take hours. Instead, I have a program I can run in seconds that does it all for me. So, what you can do is maybe something along these lines:
1. Create a list of all the images you want on the page2. Load the entire list, and for each image name   a. Create the HTML/JS block that shows the thumbnail for that image   b. Create the HTML/JS block that links to the real image where ever it is   c. Do whatever else you need it to do, or revise the previous two steps3. Write out all of the final HTML/JS to a file, to which you can simply copy paste into your page and test to see how it looks.
This technique is very useful if you need a lot of template pages, but with certain data, a friend had to create 32 seperate pages for an online version of a book, so what I did was make a simple program that did it for her, though the simple logics, it properly linked the page numbers, the next and previous page, and so on. I know you're not much of a programmer, but if you ened some help with a content generating program, you know I'm always around [wink]

##### Share on other sites
Why don't you want to use some kind of server side scripting for this? That would allow you to make a really interactive photo album. As far as IU's go, I really like the UI that F-Spot uses. Maybe you can do something similar in HTML.

##### Share on other sites
...Because I don't know how [grin]. I agree that it would be the best approach for me. It would be the most functional, most usable, and the easiest to maintain. Of course, it would require me to write the code, which would require me to learn some new language, not to mention how to use said language on a website.

I may go with Drew's suggestion, though. I did that once upon a time (I wrote a program, it worked, but barely. pi_equals_3 wrote a better one, but not that can handle what I'm doing now).

I might have to bug you some about that... ^^
(but I'll figure out what I want first, don't you worry)

##### Share on other sites
If you know C/C++, Perl or (to a lesser extent) Java, then learning PHP is a breeze. The most important differences between C and PHP can be picked up in an afternoon. Just read the manual on www.php.net front-to-back and browse a bit through the appendices. I learned all my PHP from the manual and just hacking away at some code.

##### Share on other sites
Wow, alright.

Well, that might be worth it. I really have been wanting to learn it, and just haven't had/taken the time yet. I'd love to make something F-Spotty/Picasa...y, or at least something better than I can with HTML.

Thanks for the links... let ya know how it goes.

##### Share on other sites
Quote:
 Original post by SanderIf you know C/C++, Perl or (to a lesser extent) Java, then learning PHP is a breeze. The most important differences between C and PHP can be picked up in an afternoon. Just read the manual on www.php.net front-to-back and browse a bit through the appendices. I learned all my PHP from the manual and just hacking away at some code.

Seconded -- I feel that PHP is just C for the Web [smile] Of course people try to convience me otherwise, but I've been able to learn PHP as if it was a native language just due to how similar it resembles C/C++. Of course different syntaxes, but same concepts.

##### Share on other sites
Well, that's cool, cause I can't remember any syntax for more than a week to save my life. Even friggin HTML, sometimes... if I don't make a website for a month or so, I just forget.

##### Share on other sites
Quote:
 Original post by Drew_BentonSeconded -- I feel that PHP is just C for the Web [smile] Of course people try to convience me otherwise, but I've been able to learn PHP as if it was a native language just due to how similar it resembles C/C++. Of course different syntaxes, but same concepts.

I actually feel that way about all curly-braced languages. The fact that PHP also reimplements loads of standard C functions helps as well. I've always felt that there are only three or four main families of programming languages (C and derivations, the BASIC inspired languages, LISP and deratives, Assembler-like (including shader languages), plus a few totally unique languages). Learning a language in a family you have no experience in takes time. Loads of time sometimes. Learning a language in a family you are already proficient in is easy. All you have to do is know the main differences and then practice some.

As for PHP for someone with a C/C++ background, this is what I recommend you learn:

* Look up if your server has PHP 4 or 5. PHP's Object Oriented Programming facilities are very different between PHP 4 and PHP 5. PHP 4 has very little and PHP 5 only superficially resembles C++.
* Get to grips with the page model. A script is a single page request. You can't carry information between pages in an easy way. You need sessions, cookies and form variables for that. This means that you need to do certain things every page, like checking user credentials, connecting to a database, etcetera. It's not like a C/C++ program that once started just keeps running. Youstart and stop for every page request.
* Learn MySQL. It's not hard and databases are the *best* way to store data. MySQL should take you about a day or so.
* PHP does dynamic typing. So, a variable can be an integer, a double, a string, etcetera all at once. Also, no need to fuss around with null-terminating strings.
* PHP has memory management built in. As a consequence, there are no pointers or pointer arithmatic. References do still work though, but a bit different from C.
* All variables start with a \$. It's easy to forget when you just start out. If you do forget, PHP will complain that it's either a function it can't find, or it will convert the variablename to a string.