CVS edit link for himue
For long time i've searched for a simple picture-gallery working out of the box.
All suggestions i've read in the meantime are to complicated, complex or not usable for me. I've found, that many other users have the same problem.
Therefore I wrote my own picture-gallery. It implements a new node-type to show all pictures in an specified directory. Descriptions will be automatically generated from the filenames, so there is no need to administer a seperate databse table, etc.
My gallery works with automated generetated thumbnails so it seems to be fast.
It can use Lightbox2 to simply generate lightshows and naturally it makes use of user configurable css-files to style the gallery. Some styles will be delivered with the module, so users don't eb worried about this.
several other features you can use (but not must use) are described in the README.txt
Comments
Comment #1
himue commentedAll Documentation of the module himuesgallery is in the README.txt
A live example can be found under http://st-michael.de/node/27
Comment #2
avpadernoHello, and thanks for applying for a CVS account. I am adding the review tags, and some volunteers will review your code, reporting what needs to be changed.
I would suggest to expand the description of the proposed project, and report the differences between it and the existing projects. The
reason is not sufficient to add a project that duplicates the work done in other projects (see http://drupal.org/node/539608).
Comment #3
himue commentedHello and thanks for reply.
you tell me to explain the differeences betwenn my gallery and the gallery in other Projects.
I thought I've described something in the second parapraph of my original description, but i will do it detailed here.
Other gallery projects have I've found have an enourmous complexity to copy files on the webspace, to put the description of the pictures in a database and to sort the pictures in the order you want to show it to the visitor.
All what you have to do with himuesgallery is to put the pictures in a directory on webspace, create a new node from type himuesgallery, maybe select some presettings and your visitor will get a wellformated picture-gallery with descriptions, that are automatically generated descriptions under the pictures.
I'll try to compare some differences (O: = other gallerys; H: = himuesgallery)
O: You have to use a filemanger to put files on webspace. With many filemangers this is sometimes difficult and use a lot of time.
H: You can use filemanagers to, but you also can copy your files with your favorite ftp-programm.
O: Some programs upload files to a temporary directory an then copy it anywhere on the webserver. If you want to find it in the webservers filestructure, you have to do a long search.
H: The pictures will allways reside in the directory where you upload it. No matter to search for.
O: After you upload the files to webserver you have to describe the pictures manually and put the descriptions in an database.
H: description will automatically generated from the filenames of the pictures.
O: If you want to change the description, you have to search and change the corresponding database entry.
H: Change a description is simply done by renaming the file.
O: You have to do a "mouse orgy" to sort pictures in the way you want. I know, drag and drop is simple but cost a lot of time.
H: You order the pictures by giving the filename a leading number. E.g.: you name a file "001-This is the first picture.jpg" and "005-This ist the second picture.gif". Picters will then be sorted by the leading number, but the number will not be shown shown in description. In this exapmle the description will be "This is the first picture" for the first and "This ist the second picture" for the second.
O: To add or delete pictures you have to put the fiels on webserver and add a description to the database. Then you have to reorder the pictures if the new one should be betwenn 2 existing pictures.
H: To add a picture you simply copy it to the picture directory on webspace (eg. by using a filemanager or simply by using your ftp-programm). I'v you name your files with leading numbers like described before, it is very simple to insert a new picture betwenn 2 existing. Let's say you have pictures namen "005-File1.jpg", "010-File2.jpg" and "015-File3.jpg". to insert a picture named NewOne.jpg between File1 and File2 simply name it 007-NewOne.jpg" and copy t to the webspace.
O: To delete a picture you have to got to the website, delete the corresponding entry in drupal and maybe you have to delete the picture manually.
H: To delete a picture you simply delete the file from webspace.
O: I've found no gallery where you can highlight parts of the description.
H: In himuesgallery there are tags wich you can use in filename to do some highlighting.
Some examples:
- You have a file namend "001-This is RED text.jpg" you put to tags in filename like "001-This is .red.RED.-red. text.jpg" and the word RED will be shown in red color to the visitor.
- You name a file "this description have .qm.quotation mark.qm. in it.jpg and it will be shown as "this description have "quotation mark" in it".
- You name a file "001-Whats this.qe..jpg". The visitor will see se description "Whats this?"
There are lot of more tags you can use. All will be described in READEME.txt
O: Other gallerys can use tools like Lightbox2 to show pictures.
H: Himuesgallery also can use use Lightbox2 but contrary to other gallerys you need only a few mouse-clicks to change from showing single pictures to showing a slide show.
O: I know, many of the gallerys I've tried can format the output using css-files, but either I'm to stupid to find the css-files or I can only use one css-file for all my gallerys on a site.
H: Himuesgallery also use css-files to format the output. There are yome predefined css-files in the css-subfolder of the module-dir. You can put your own files there and then selsect the one you want to use in a dropdownbox on node-creation.
You also can tell the gallery-node to search for a css-file named himeusgallery.css in the picture-dir. So you can have your own css for any gallery.
O: Often i found no way to put some kind of longer text (intoducten, etc.) in top of the gallery.
H: In hiemuesgallery you simply fill the textfield (body) of the node. You can use HTML or WYSYWIG-editors to create it.
Hope this helps and meet your requirements of description.
Comment #4
himue commentedHello.
I've reviewed my code an have found some missing t()-functions etc.
Attachement is the final code.
Greetings,
himue
Comment #5
dave reidComment #6
avpadernot(); see what Drupal core modules do.If the code is always included, then it is better to merge the files. There is not pro to separate two files, if then one is always included. The purpose to write code in separated files is to reduce the memory usage, but that doesn't happen in this case, where there is also a delay caused by loading a file.
Code comments should be written in English.
Strings used in the user interface should be in sentence case, not title case.
should be . Then the form item should be simply write as
It's useless to group form fields when there is just a group (the group).
All that code can be replaced with a single call to
str_replace().Also variables should use English words.
There is a Drupal function to scan a directory content. The code should use the Drupal Unicode functions, when available.
There is no reason to suppress error warnings, in that case; the function doesn't emit any warning message.
There is no reason to create a file for that code; it can stay on the module file.
Comment #7
himue commentedI think, i've considerd all your suggestions.
Only one comment on point 5:
I've changed "meine" to "main".
I think the group is'nt useless, because i found no other way to prevent, that "Menu settings" will between the body-field "Info-text in top of the gallery" and the rest of my settings.
Greetings,
himue
Comment #8
avpadernoTo accomplish that is enough to set the weight of the fields, or add all the settings in a fieldset.
Comment #9
himue commentedWith the weight-settings i'm not able to get the fields in the order i want. Don't know why, but there are allways problems with the body field or the menu-fieldset...
Maybe i'm wrong, but when you look in #6 point 4.)
Isn't this the definition of an fieldset? (I'vre renamed "meine" in "main" allredy).
Thanks,
Himue
Comment #10
avpadernoThe package name is not supposed to be used to report who developed the module; as this is just a single module, and not a set of modules, the package ID used should be one already used by other projects (, in example), or it should not reported.
The parentheses surrounding the string are not necessary.
should be written in upper case letters.
There is a Drupal function to get the content of a directory.
There is a Drupal function to scan the content of a directory. The code should also use the Drupal Unicode functions.
See http://drupal/coding-standards, which reports how PHP constants should be written, and how the code should be formatted.
Comment #11
himue commentedThanks for reply.
I hope, i've considered all of your hints.
"Code review" from the coding module shows no errors/hints.
Himue
Comment #12
himue commentedComment #13
avpadernoThe curly brackets are not considered optional from Drupal coding standards. The code is correctly written as
Before, and after the operator = there should be a space (
$variable = 'value'); that is true also for the other operators.Thank you for your contribution! I am going to update your account.
These are some recommended readings to help with excellent maintainership:
You can find more contributors chatting on the IRC #drupal-contribute channel. So, come hang out and stay involved.
Thank you, also, for your patience with the review process.
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
I thank all the dedicated reviewers as well.
Comment #14
himue commentedO.k., i've fixed this.
Thanks for help,
himue
Comment #17
avpaderno