ClioSport.net

Register a free account today to become a member!
Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

  • When you purchase through links on our site, we may earn an affiliate commission. Read more here.

Website coding help, please?



Ian

  Focus TDCi
Hi,

Over the past year or two I've taught myself how to code my own websites. I started out on MySpace covering up their awful standard design and have progressed slowly from there.

I'm currently in the process of designing my own website, but I'm stuck on the gallery side of things. I'm perfectly comfortable with getting it how I want to look etc, but it's the automated content that I can't get my head round.

I want to be able to upload my photos and the code automatically be generated so that they instantly appear in the gallery. I'm also trying to get it so that each image has its own reference code and preferably a watermark, thumbnail and large version that can be called up using Lightbox or similar (I've added it to the first image on the page).

Also I'm trying to arrange them by month per page so that it isn't one long sprawling page.

I believe it is based in PHP and MySQL.. Can somebody either talk me through the basic principals of creating a gallery, or link me to somewhere that can help me? I don't want to use a plug-in really as I'd rather learn to do it myself.

Thanks
Ian :)


P.S. If you're going to attack my attempts at coding, please be constructive. I know it's far from perfect and there are bits missing and bits I don't need, but I've not tidied it up yet! Also the images won't be hosted on Facebook, nor the website at the host it currently is lol.
 
  DCi
Would you want the code to generate the thumbnail / water marks? as apposed to something like batch processing them with photoshop?

it seems like a fairly straightforward project, a good place to start!!

the fundamental way to do it I guess, is to come up with a reference system for your photos, and then lookup some resources to create a file uploader, which saves the file(s) on your server with the reference code as the file name and then also a record in a mySQL table

I dont know how much you know about PHP/MySQL but you basically write a table in HTML and the for each row you write a loop in PHP to generate each record in your MySQL database to display each photo stored there.


If that sounds confusing sorry, if you have any specific questions then I will try to help, this seems pretty do-able, a nice project to start learning with!!
 

Ian

  Focus TDCi
Cheers Iain. Well the bad news is: I know nothing about either PHP or MySQL, except for the include function for adding things to multiple pages using PHP.

Erm, so to break it down a bit, I need:

- An upload interface, which is basically a private page on my site made with html/css with some sort of form for locating and uploading the files.
- A folder on the server to store the images once they upload.
- A MySQL table to store the reference codes and other information, which is within a html page and repeated using PHP

Is that right?

I don't have Photoshop, so I would prefer it if the watermarks etc could be done at this stage if possible?
 
  DCi
pretty much

-an upload interface is pretty easy really, though I don't know much about about making the folder secure
-yeah pretty easy again, just create it on your FTP server!
-well the MySQL server will run on it's own server, your PHP code will connect to the MySQL server and retrieve info from it, in order to display the information you want to show.

-re: photoshopping: I think it can be done via PHP, would have to look it up though as I've not done it before.
 

Ian

  Focus TDCi
dunno if you have photoshop but if you need anything doing let me know

Cheers Luke :approve: Might get back to you if I can get the infrastructure sorted first!

pretty much

-an upload interface is pretty easy really, though I don't know much about about making the folder secure
-yeah pretty easy again, just create it on your FTP server!
-well the MySQL server will run on it's own server, your PHP code will connect to the MySQL server and retrieve info from it, in order to display the information you want to show.

-re: photoshopping: I think it can be done via PHP, would have to look it up though as I've not done it before.

Ah right ok, sorry I misunderstood the last point.

So if I start with the easy bit.. the uploader:

I'm not worried about security, as long as the link isn't visible on the website I'm sure it'll be private enough for now.
Is all I need a form with two buttons, one to load up a file selection window and the other to submit the chosen file? Do I need to have Javascript or something like that for the selection window?
 
  DCi
what you could do, is have a form that asks you for a password, which then plants a cookie on your PC. Then you could have the upload form only letting you use it, if it finds the cookie, I guess.

the basic mechanics of the uploader will be like this> you will have an html form with a file input (creates a browse button) and then a submit button, which submits to a .php doc which processes the upload with a bit of code

If you go somewhere like www.planet-source-code.com and search for file uploader in the php section, you might find something like: http://planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=1036&lngWId=8

which you could adapt to fit your website in some way
 

Ian

  Focus TDCi
Ok thanks Iain, sorry to hog your attention lol. I'll keep browsing and test a few things out. :)
 

Ian

  Focus TDCi
Woop, ok, I've got the uploader working. I won't link to it as I'll no doubt get a load of rude images filling up my folder! It's a bit basic but I've applied my stylesheet to it and added a few navigation links. It'll do for now. Will have a look at how it works at some point too!

So the next step is to get the information from the uploaded file? Having a look on the internet at the mo, so will see if I can find anything.
 
  DCi
I'd start looking at how to set up your mySQL database then how to get the info from the file into it, in a way that you will be able to get it back out too ;)
 

Ian

  Focus TDCi
Out come the criptic clues :)

Well, I've found this, but I feel like I'm cheating lol. Just reading through it now.
 

KDF

  Audi TT Stronic
If you want to watermark/resize etc your images using php you will need the gd2 or imagemagick plugin.

If you get stuck on any PHP code I can help, and good for you for trying to learn it yourself. PHP is a really easy language to learn.
 

Ian

  Focus TDCi
Just trying to expand my horizons, can't do any harm to learn a few new skills! Need to finish some uni work, but I'll get back on this maybe Thursday. Cheers for the offer, may well take you up on it at some point. :)
 


Top