I'm writing a photo management tool to host photos for a trading site.
I don't need super granular functionality, just something to allow users to upload photos and get basic management features. I'm writing this in CFML and hosting on Bluedragon 7.0. They have a nifty tag called CF_image that I'm using to resize uploaded photos and make them more web friendly. That all works, but now I'm trying to make it so the photo
order consolidates after a user adds to or deletes a photo from a group. Right now users can upload up to 15 photos per item, so if they were to delete, for example, photo 12, the photo order needs to consolidate so that photo 13 becomes 12, photo 14 becomes 13, etc.
In the database, I have a column called photo_position so, for example, photo 13 would have an entry of "13". Pretty simple. Any time an action is done on a photo, I need a script to run afterwards that will make sure the photo_position count is in order and not missing any steps.
The way records are kept is that each photo has its own record, with a column for the item_id along with the photo_position number. The problem would be if I had for example, 3 records of photos for a particular item, but the position entries werent 1,2, and 3.. If they were maybe 1,2, and 5. This might happen when someone deletes photos 3,4.
If any body has any ideas on how to approach this script (logic, etc) it would be greatly appreciated..
I don't need super granular functionality, just something to allow users to upload photos and get basic management features. I'm writing this in CFML and hosting on Bluedragon 7.0. They have a nifty tag called CF_image that I'm using to resize uploaded photos and make them more web friendly. That all works, but now I'm trying to make it so the photo
order consolidates after a user adds to or deletes a photo from a group. Right now users can upload up to 15 photos per item, so if they were to delete, for example, photo 12, the photo order needs to consolidate so that photo 13 becomes 12, photo 14 becomes 13, etc.
In the database, I have a column called photo_position so, for example, photo 13 would have an entry of "13". Pretty simple. Any time an action is done on a photo, I need a script to run afterwards that will make sure the photo_position count is in order and not missing any steps.
The way records are kept is that each photo has its own record, with a column for the item_id along with the photo_position number. The problem would be if I had for example, 3 records of photos for a particular item, but the position entries werent 1,2, and 3.. If they were maybe 1,2, and 5. This might happen when someone deletes photos 3,4.
If any body has any ideas on how to approach this script (logic, etc) it would be greatly appreciated..