All of this code was stripped from the block module. You can drag and drop photos to sort them and when you click save sort the database will be updated. Easily move photos to a different album and navigate to your other albums by clicking on the album name. Added an add photos link in the top right corner to improve flow.
To access the sort page.. there is no link yet.. /photos/album/4/sort
so, /photos/album/%node/sort
It requires imagecache and of course album photos (photos). Upon installation imagecache preset will be added "photos_sort" 50x50..
It would be cool to have little blocks with the thumbnail only instead of one long row for each photo, but javascript scares me..
**Potential problems with large albums. Imagecache load time.. and not practical to use with more than 20 images..
Open to feed back, suggestions and help with the code! I really want this functionality for my new website!!!
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | photos-grid-re-arrange.jpg | 43.75 KB | nathaniel |
| #11 | photos-grid-re-arrange-local.jpg | 120.08 KB | nathaniel |
| #6 | photos-sort-update-1.png | 79.46 KB | nathaniel |
| #6 | photos_sort.tar_.gz | 5.78 KB | nathaniel |
| photos-sort.png | 95.27 KB | nathaniel |
Comments
Comment #1
vako commentedTHANK YOU!! this will be a valuable addition to the module indeed.
Here's some feedback about my experience:
After enabling the module, I got the following error (refreshing the page seems to have fixed it):
Fatal error: Call to undefined function imagecache_preset_save() in /home/wwwaec/public_html/sites/all/modules/photos_sort/photos_sort.install on line 4The module works fine, but the thumbnails are all showing as broken links, I check that the folder:
/sites/default/files/imagecache/photos_sort/photos/image doesn't exist, even though I have ImageCache installed but not sure how/where to configure it, any suggestions for a fix?
thanks!
Comment #2
nathaniel commentedHmm, definitely a problem with the imagecache during install. To anyone else, make sure imagecache is up to date with the latest release before install.
Navigate to: /admin/build/imagecache and add new preset photos_sort add the actions that you prefer, anyone else can edit the actions there as well if you prefer a different size thumbnail.
Also, clearing cache may help: /admin/settings/performance
Comment #3
vako commentedAfter creating the preset, the thumbnails showed-up. However they were original size - huge! I had to create an Action as Scale to 150x100 to make them display as thumbnails. Is there any other way?
I think this module should be called Photo Re-arrange, since it's not really sorting, it's re-arranging the photos...;)
Question: is there any possibility that the re-arranging option can be done at
photos/album/###level? (just hoping)Thanks for the solution!! Woo hoo!
Comment #4
vako commentedI hope you can make the same functionality for the Albums section as well: /photos/album
Comment #5
eastcn commentedcool, thanks
Comment #6
nathaniel commentedI made a few changes to the css file and template page. Now it is more practical for larger albums.
For this to work properly you have to make a few changes to the photos.module file.
function photos_image_pager around line 653 add ,p.wid ... ORDER BY p.wid ASC
function photos_order_label Weight - smallest first will be weight|asc and largest first will be weight|desc around line 1540.
Now in the admin section: admin/settings/photos global settings set default Image display order: to Weight - smallest first.
Comment #7
plato1123 commentedNice module! Does this was have it's own modules page? Anyone improving it?
Comment #8
w00 commentedHi,
Yes, it's a fine module - eastcn has an enviable knowledge of PHP & Drupal.
Link is "album photos" at top of page; see: "album photos » Issues"
That's a very good question.
The various issues pages have a bunch of user-submitted patches, but I don't think anyone's put them together in one release. It would be challenging and mostly worthless unless we could get eastcn to bundle them into a fresh release that would be automatically updated on all installations using Album Photos.
Myself, I've created a Photos Search module that adds a Photos tab to the Search page, enabling searching of photos' Titles & Descriptions. My albums tend to have a brief description and no comments, but lengthy descriptions. So when searching through Drupal's normal Search page, nothing is found.
If normal Search did match an album description, and if there's several pages of photos, one would still have to page through all photos looking for relevant one. My module returns thumbnails of matching photos with links directly to the relevant image.
Ideally this should go into the main Album Photos module. I haven't released it as a separate module (yet). Ask if you're interested in trying it.
tl;dr
I've offered to assist in further development. No replies. We'd really need eastcn's cooperation ... or to deem project abandoned and assume maintenance (don't really want to do that).
Comment #9
summit commentedHi,
For D6 this photos module is still great. Wil this be implemented please?
Greetings, Martijn
Comment #10
nathaniel commentedI still want to add some support for a grid view drag and drop re arrange by weight feature. Anyone know of any examples, especially Drupal related?
Comment #11
nathaniel commentedTesting a drag and drop grid interface. So far so good. Tested with 350+ images on localhost with no problem. Attached a screenshot from the demo site with 5 images.
Not sure about scalability at this point. The image order is updated ever time an image is moved. It might save resources, but be less user friendly, to have a button that says "save order" or "save changes". Click that button after all the images are in the right place to save the changes to the database.
At this point the weight has to be updated for every image in the album to be sure that they are in the correct order.
Comment #12
nathaniel commentedComment #13
nathaniel commented