Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Images

Best way to do this?

images php coding issues or problems here.

Moderators: macek, egami, gesf

Best way to do this?

Postby sanukk » Fri Apr 05, 2013 7:15 am

Hi All

I help out with a charity event, and I'm gradually putting together a site for them. I have a *LOT* of pictures that need to go up, but instead of just doing a standard gallery, what I thought about doing was letting the user select via check-boxes who they want in the pictures, which rooms the pictures were taken in, and what day the photos were taken on (or any combination thereof) and showing the thumbnails for only the pictures meeting the search criteria (if there are any).

The problem is I have no idea of the best way to go about this.

1) Would it be better to include the image itself in the database, or just a link to it in a folder?

2) Would it be better to do everything server side (i.e. let php do it's stuff when a button is pushed), or a mix (let JavaScript, or similar, update the selections live as the boxes are ticked/unticked)?

3) As new people/rooms/dates will be added with each new event (although most of the rooms/people will stay) what is the best way to design the database, each person/room/date as a separate field with a 1 for each for each picture, or have one field each for person,room,date and just add the name to the end? (i.e. either lots of fields with only 1/0 in them, or only three fields with lots of names in each)?

4) Anything else daft I've missed?

-S
sanukk
New php-forum User
New php-forum User
 
Posts: 4
Joined: Wed Apr 03, 2013 1:47 pm

Re: Best way to do this?

Postby johnj » Fri Apr 05, 2013 8:04 pm

1) as this is a charity event, link to a folder is good.

2) it depends on what you want the user experience to be. Ideal to go with server side processing but you can use javascript or jquery on client side if your site is "candy/ cute". It also depends on what is easier for you , if you have great JavaScript skill, then use that.
johnj
php-forum Super User
php-forum Super User
 
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: Best way to do this?

Postby johnj » Fri Apr 05, 2013 8:10 pm

3) each person/room/date as a separate field with a 1 for each for each picture is the right way.

Key1,person,room should be in one table and in the other table it should be key2,key1 ,date,link to picture

Create the db design on paper and then make a decision - I need not be always correct.
johnj
php-forum Super User
php-forum Super User
 
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: Best way to do this?

Postby sanukk » Thu Apr 11, 2013 7:15 am

johnj wrote:1) as this is a charity event, link to a folder is good.
Not sure how it being for charity is relevant here?

2) it depends on what you want the user experience to be. Ideal to go with server side processing but you can use javascript or jquery on client side if your site is "candy/ cute". It also depends on what is easier for you , if you have great JavaScript skill, then use that.
I'd like it to be as slick as possible, but I'm terrible with JavaScript, so will probably just go with PHP only (unless anybody know an easy way to do it).

-S
sanukk
New php-forum User
New php-forum User
 
Posts: 4
Joined: Wed Apr 03, 2013 1:47 pm

Re: Best way to do this?

Postby sanukk » Thu Apr 11, 2013 7:21 am

johnj wrote:3) each person/room/date as a separate field with a 1 for each for each picture is the right way.

Key1,person,room should be in one table and in the other table it should be key2,key1 ,date,link to picture
Thinking about it would it be better to have a day table, a room table, a person table, and a file table and add to each as needed, or just two tables you sugested (or have I missunderstood what you are saying)?

-S
sanukk
New php-forum User
New php-forum User
 
Posts: 4
Joined: Wed Apr 03, 2013 1:47 pm

Re: Best way to do this?

Postby johnj » Fri Apr 12, 2013 8:58 pm

....not sure how it being for charity is relevant here?


Usually this sort of sites are temporary, I mean for one event in a year. Also, people involved in this charity are likely to be local people. Hence, we do not need a highly secure site by saving pictures in a database. But if you have the time and money go ahead and save all pictures in a table.
johnj
php-forum Super User
php-forum Super User
 
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: Best way to do this?

Postby sanukk » Mon Apr 15, 2013 9:08 am

johnj wrote:
....not sure how it being for charity is relevant here?

Usually this sort of sites are temporary, I mean for one event in a year. Also, people involved in this charity are likely to be local people. Hence, we do not need a highly secure site by saving pictures in a database. But if you have the time and money go ahead and save all pictures in a table.

Well the idea is to make this a permanant site with ongoing events. What are the pro's and con's of putting the files in a database, and in a folder? Perhaps I am missing something, but wouldn't a database be just as insecure as a folder once the image is sent as part of a page?

-S
sanukk
New php-forum User
New php-forum User
 
Posts: 4
Joined: Wed Apr 03, 2013 1:47 pm


Return to PHP coding => Images

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron