Author Topic: User customized order of images in lightbox  (Read 4362 times)

0 Members and 1 Guest are viewing this topic.

Offline zhono

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
User customized order of images in lightbox
« on: August 19, 2012, 01:55:15 AM »
So awhile back, I built a screensaver mod to replace the one that used to be available, but was taken down when he left the site. Basically it loads a custom page as a windows screensaver, and that page displays the users lightbox images as a fullscreen slideshow with controls. So now I'm looking for a way for the user to change the order of the images in his lightbox. That way you would also be changing the order that the images appear in the screensaver. Drag and drop would be awesome, but even if it's just setting a number for each image, that would work. Does such a mod exist somewhere?

Offline zhono

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
Re: User customized order of images in lightbox
« Reply #1 on: August 21, 2012, 08:13:53 AM »
Okay, I'm about half-way done with creating it myself. Customized the lightbox.php file so that it can read the lightbox image ids as "001-65856, 002-846, 003-749" and display the thumbnails in the correct order. Now I need to create the system that will allow the user to set the "001 002 003" part, and have the lightbox.php file overwrite the image id's with the proper info.

Offline zhono

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
Re: User customized order of images in lightbox
« Reply #2 on: August 22, 2012, 09:30:46 AM »
There, I did it. Realized that I didn't need to change the way the id's are stored in the database. Now my users can set the order of every image in their lightbox, hit save, and it will reload the page with the images in the new order. The images also appear in the screensaver in the new order. Not quite sure I can remember all of the changes I made, but if someone needs this, let me know and I'll try to post it up for you.

*edit*

Might as well say exactly what it does. When you go to your lightbox, each thumbnail has a textbox with a default number. The first thumbnail gets 10, the next gets 20, then 30, then 40, and so on. Now you can change each one of those to any number you like and hit save. It will take the image ids from your lightbox, arrange them to match the values you chose, save them back to the database and then reload the page.

No what what numbers you set before, even though the thumbnails will be in the order you wanted, they get numbered 10, 20, 30, all over again. This makes it easy to change the order again and again(and there was no easy way to save the exact numbers in the database, not with editing a lot of code in 4images).

For a demo, try out my site: http://anime-themes.com. Create an account, add a few images to your lightbox, then click the screensaver link in the menu. You can then edit the order of the images in your favorites, and you can click the create screensaver button, and then edit that as well. Click the test button to see the screensaver in action. I'd also recommend pressing "F11" to view it fullscreen. I'm thinking about also making a mod that would allow you to use that page to view whole categories as a slideshow.
« Last Edit: August 22, 2012, 10:07:38 AM by zhono »