Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I like to make a name day module. (http://en.wikipedia.org/wiki/Name_day)
Comment | File | Size | Author |
---|---|---|---|
#21 | nameday-6.x-1.1-alpha2.tar_.gz | 6.26 KB | sajt |
#16 | nameday-6.x-1.1-alpha1.tar_.gz | 6.16 KB | sajt |
#1 | nameday.tgz | 11.17 KB | sajt |
Comments
Comment #1
sajt CreditAttribution: sajt commentedI like a CVS account for this module. And some review of my code :)
Thanks!
Comment #2
apadernoHello, and thanks for applying for a CVS account. I am adding the review tags, and some volunteers will review your code, pointing out what needs to be changed.
As per http://drupal.org/cvs-application/requirements, the motivation message should be expanded to contain more details about the features of the proposed module/theme; for modules it should include also a comparison with the existing solutions, while for themes a screenshot is also required.
Comment #3
sajt CreditAttribution: sajt commentedWhat I must to do? Waiting?
Comment #4
apadernoWe are waiting for reviewers to check the code and report what needs to be changed.
Comment #5
sajt CreditAttribution: sajt commentedThe nameday module creates a block with the current (in this time only Hungarian) name-day(s) and holiday if it exists. You can easily add your country's name-days and holidays.
Comment #6
apadernoComment #7
sajt CreditAttribution: sajt commentedWhat I must to make? Is somthing wrong?
Comment #8
sajt CreditAttribution: sajt commentedI putted the code to the github: http://github.com/sajt/nameday I do not really understand why I can not get CVS access.
Comment #9
tanoshimi CreditAttribution: tanoshimi commentedFrom http://drupal.org/cvs-application/requirements, "...You must provide a motivation message, which should be a few paragraphs instead of only a few sentences. It should include details about your contribution, its features, how it compares to already existing solutions, links to screenshots or a demo, etc...."
Comment #10
sajt CreditAttribution: sajt commentedA lot of portal site like to show the actual name day, in some country (you can see a list in the Wikipedia). There was a lot of solution for it, but no drupal modules. (I did not find).
This module is very easy of use. Install it as usual and select the block from the admin/build/block list. The name day is depend on the current language (and naturally on the current date) and now only hungarian name days is working.
I welcome the new languages files for other countries. The file description is in the datas/README.txt. This file is included when You install the module.
Comment #11
sajt CreditAttribution: sajt commentedWhats news?
Comment #12
sajt CreditAttribution: sajt commentedI think my project a little bit better than this: http://drupal.org/project/chuck
Comment #13
joachim CreditAttribution: joachim commentedI've done a visual review of the code.
It looks pretty good overall -- clearly good attention to detail and use of Drupal's APIs and conventions. Its purpose is quite esoteric, but that's fine :)
A few things that need work though:
- Quite a big architectural problem this one: you populate your database table from the included data file in hook_install. How is a user of the module going to get updated data from later versions of the module, or from their own data file? You need to think about a more flexible way of doing this. I suggest you look at how Ubercart handles country information files: there's a UI for adding a custom one, or for reading in data from one that's in the module's own data folder. It looks like you have the same requirements.
- variable_set("show_date", TRUE); -- namespace your variables.
- also, there's no point in setting a variable in your hook_install. Instead, take the value TRUE as your default!
- $lang = $GLOBALS["language"]->language; -- I'm not sure of this, but should you just say 'global $language'?
- $date = getdate(); -- you might want to account for the user's timezone?
- echo format_date(time(), "small"); -- the standard in TPL files is print, not echo.
- also, it's a nice touch to indent the code in TPL, ie indent this line because it's inside an if block. It makes the logic of your TPL much clearer to follow, as at the moment it's hard to see where the ifs end and what gets printed unconditionally.
- <?php if ($date):?> -- think the convention is a space before the closing angle bracket -- check what core does.
- finally, a minor point: no blank line between function doc blocks and the function declaration. But bonus points for putting these in! :)
I'm not sure whether to set this to 'needs work' or RTBC. The architectural problem I mentioned is a big task and needs addressing, but on the other hand the best course might be to grant CVS access so the module author can make a dev release and potentially get the attention of other interested developers to help with this. I'll leave this decision to one of the admins :)
Comment #14
apadernoWhy isn't the code using
file_scan_dir()
?Strings used in the user interface should be translated.
Comment #15
sajt CreditAttribution: sajt commentedThank you for the nice reviews. In last time I rewritten the full module, for example I putted the token support. I make some changes and I am considering your suggestions. When I finished it, I will put the new module.
Thanks.
Comment #16
sajt CreditAttribution: sajt commentedI finished the changes. Only Joachim's UI suggestion is missing for the data-table manipulation, I must to think about the correct interface.
I hope every other errors is fixed. I added a little token support, what is pre-alpha and maybe very useless.
Comment #17
sajt CreditAttribution: sajt commentedChange status
Comment #18
sajt CreditAttribution: sajt commentedanybody?
Comment #19
sajt CreditAttribution: sajt commentedTeszt
Comment #20
joachim CreditAttribution: joachim commentedA few minor points for consistency within Drupal:
- the 'datas' directory should be 'data'. ('data' is already a plural...)
- the standard filename for admin pages is MODULE.admin.inc rather than nameday.settings.inc.
The more complex logic in your TPL should really be moved up to a preprocessor function:
- print format_date(time(), variable_get('nameday_date_format', 'small'), variable_get('nameday_date_format_custom', ''));
This should be just a print $nameday_date; do the formatting work in the preprocessor.
- if ($nameday['holiday'] != '' && variable_get('nameday_show_holiday', TRUE))
This should be just if ($holiday):
> I must to think about the correct interface.
What I'd suggest is something like a list of the language files the system has found, along with operations depending on whether the system also has data for that language in the DB:
language status operations
- English new [load data button]
- French loaded [refresh data button]
Good idea adding token support btw! :)
Comment #21
sajt CreditAttribution: sajt commentedThanks for the fast answer. I made the suggested changes, except the last one. I will make it, when I get an other name-day file than Hungarian :)
Comment #22
apadernoThank you for your contribution!
I am going to update your account so you can opt into security advisory coverage now.
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 #25
apadernoComment #26
apadernoI am giving credits to the users who participated in this issue.