Forum Moderators: open

Message Too Old, No Replies

Order of pictures in a gallery

         

defanjos

8:08 pm on Jul 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have designed a picture gallery for a client using classic ASP. Right now all the info is in a DB. I added a field called pic_order, and assigned it a number, so I can call the pics according to pic_order.
Right now I have (simplified example):
Db entry 1 - pic_order=1
Db entry 2 - pic_order=2
Db entry 3 - pic_order=5
Db entry 4 - pic_order=3
Db entry 5 - pic_order=4

This does not work well, because if I want to change the order of one picture, I have to change pic_order in the other pictures, so two pictures don't end up with the same number.

What is the best way to set the order of pictures in a Gallery? Looking for better ideas.

Thanks

txbakers

9:44 pm on Jul 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your pic order is the right way to go, but instead of using 1,2,3,4,5 you could use 10,20,30,40,50 which would allow you to insert between an order without having to re-order everything.

defanjos

10:04 pm on Jul 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



txbakers,

Thanks, great idea. That will make things easier.

Just an addition to the initial question, does anyone know how to change the order of the pictures using a dropdown?

For example, all the pictures for one category would be displayed in a dropdown, then with an up-down arrow I could change the order. I have seen this done before, but have no idea where to start.

Any pointers would be appreciated.

txbakers

11:45 pm on Jul 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There are javascripts available which can sort a list.

I use one to sort a list, then when the user clicks "save" it will save the list in that order on the database.

defanjos

11:49 pm on Jul 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thank you