Why all the same Drupal? - Initially, I opted for Wordpress, since the multiplayer CMS does not interest me, I decided to try Wordpress. It was in 2008. But at that time (perhaps now something has changed) I could not find a single module or several modules that would satisfy the following simple requirements (in order of importance):
- grouping photos by album, with the possibility of adding a description to the album
- upload multiple photos to an album with a minimum number of clicks
- album grouping by category
- showing albums in the form of topics with a description and a preview of several photos on the main page
- direct link to any album
- Comments of visitors for the album and a separate photo (with pre-moderation)
- output size control
But with Drupal we managed to implement all this, and this topic is about it.
First I stopped at the
Brilliant Gallery module, which is still used for old albums. The module allows you to show all photos located in a specific folder on the server in the body of the note. The module allows you to sort the image alphabetically or randomly. It is possible to cache images using Drupal. In addition, you can control the size of icons and full-size images, the choice of Ajax plug-in for viewing.
The note itself consists of a small line with data for the module:
[bg | girls / bonya ||||| black || no]
As you can see, the options are formed for each album separately, and when you change the theme, changing the background color is not so easy, you need to edit each album separately.
Other disadvantages of the module:
- There is no web interface for creating the appropriate folder, uploading photos to it
- unable to comment on a single photo
- the inability to sort photos by popularity
As you can see, the module does not solve all the tasks.
')
I continued searching, and installed
Image , which allows you to upload individual photos into the appropriate categories (one picture may belong to several categories). But I don’t know how to group photos into albums. A useful feature was the appearance of the "random picture" block. I note that for Anonymus the picture is the same all the time, if you enable block caching. If you enable only page caching, then the picture will be the same for when updating the same page, but different for different pages.
This module also did not solve the tasks.
And finally, I got to the most powerful module
album photos , which can do everything you need and other useful things.
It was possible to vote for each individual photo (like / dislike), but for this you need the
Voting API , with which you can also organize surveys of visitors.
Module features:
- Settings for displaying pictures separately for the main one and separately for the album itself
- Adding an album to the site menu during creation
- Album description may be in html format
- Manage images directly from the album menu
- Turn on / off comments for a single album
- The ability to put / not put the album home
The task is solved and you can go to the site improvements for themselves.
To display full-size images from the main and album pages, set
Lightbox2 (In the settings for album photos, you can select other ajax viewers)
For comments installed
Ajax and
Ajax CommentsDHTML Menu is useful for simplifying and speeding up navigation.
The most difficult task was the choice of the interface theme. I used this pleasant and high-quality theme for a long time, having slightly edited CSS and
Deco pictures. But the photos look better on a black background (in my subjective opinion), so I recently switched to
Decayed . The theme had problems with the menu and a large skull in the upper right corner. After a little CSS editing and background theme problems were fixed.
I took pictures for one iPhone resource and got more than 3,000 visitors from there per day. The hoster began to complain about the high consumption of resources and at times turned off access to the site. I thought about caching and stopped on
boost , since the main (almost all) traffic to the site is generated by anonymous users. The module is very powerful, but requires access to .htaccess - it is necessary for hosting to support this and cron, otherwise the cache will not be automatically cleared. If hosting does not support creating tasks for cron, then you can use a little trick -
sitename / cron.php can be
pulled from any server.
UPD: the purpose of the article is to show a possible solution of the task set by means of Drupal and discuss the advantages and disadvantages of the stated approach with the Habro community, learn about other solutions
UPD2: there are already other interesting solutions in the comments
UPD3: The result can be
seen here
bb.org.ua (Decayed theme) and here
mike.pp.ua (the old version with the Deco theme, hosted at hosting.ua, but as you can see, they restored virtual hosting and everything works)