Ladder is a module that allows users to put leaderboards on their website.
A user will first add a Game to their Ladder installation. A game could be anything from StarCraft II ladders to hockey standings.
Once a game has been added a Leaderboard can be created for that game (up to as many as the user wants)
Administrators can delegate reporting of wins and losses to specific roles if they so choose.
Comments
Comment #1
lang14 commentedPlease go to http://drupal.org/sandbox/williamlang/1156830 to download the project.
Comment #2
MasterChief commentedHi lang14!
Can you explain me what is a ladder exactly ?
I just install your module to test it.
A readme.txt would be good to explain how to use your module.
You talk about leaderboards in #1, the main goal of your module is to manage these leaderboards or it will be more than that ?
Thank you for your answers :)
Comment #3
lang14 commentedLadder is just the name of module. The name follows the theme of climbing the proverbial ladder.
The whole point of the module is to manage a league of players or teams and their standings in the league.
Eventually I hope to add more modules that allow the creation of tournaments and allows users to issues challenges to one another.
Comment #4
jordojuice commentedComment #5
jordojuice commentedAlright you have some big changes to make with formatting.
- Missing @file in some files.
- Your indentation is all wrong. All of your code is indented four and five spaces? You don't need to indent all of your code at all and especially not that much. i.e. this
should just be
plus indentation inside your functions is three spaces in .install and four spaces elsewhere. All indentation should be two spaces.
- Many of your functions have no documentation at all. In other words this is all wrong:
Whether it's a hook or it's not you still need to document the function. Please see documentation documentation (haha, not a typo) for more information.
- This is not correct either:
}else{- As I said, many many functions have no documentation at all, but especially functions like this:
function ladder_games_admin($op = '', $gid = 0) {need documentation. Here is the documentation on that documentation: http://drupal.org/node/1354It will explain how to document parameters and return values which are often necessary to make your module's API functions understandable.
- These types of inline comments should preferrably be of the
// Variety.Full sentence comments should start with a capital letter and end with a period.-This is precisely what an @see reference is for.
echo $g->name.'<br />';- String concatenation should have spaces around the operator so it's easier to read.
In hook_menu()...
$items['admin/ladder'] = array(and
$items['admin/ladder/settings'] = array(- I'm almost certain you do not want that path. This should be placed in a more appropriate place like admin/config/somewhere I dunno, but certainly not there.
- Why is this necessary? Drupal already provides the ability to enable/disable modules so this seems like it may be a bit misleading as this does not actually do anything but set a variable. I haven't been able to find anywhere that this variable is used either.
- I think you should have an empty line at the bottom of each file as well.
- Need a README.txt file with instructions on how to use the module if possible.
- Other than that, I would just say it looks like a lot of spacing for me but it could just be the indentation issues, and also there are some empty lines (with spaces).
- This last part is just my opinion, but do you think the name Ladder might impact the success of people looking for a module like this? Ladder just doesn't describe what it does to me at all. But I guess the good names are already taken. Maybe someone can make a suggestion, but I'm not that creative!
So, fix those issues and set it back to needs review when you're ready! Good luck!
Comment #6
jordojuice commentedLittle more:
- Why not just use empty() and beyond that why not just make the 'name' field required?
This should use placeholders not string concatenation and still need to use t() like:
... as should watchdog()...
Line 260 in ladder_leaderboards.module has a form_set() function:
form_set('', t('Your starting date must be before your end date'));- Again, why not just use module_exists()? This is exactly what it does, and that's what API functions are for. This is just duplicating code in my opinion.
Updating all these issues should get you right on track!
Comment #7
lang14 commentedI'm definitely open to suggestions on the name.
A lot of these issues you've brought up are just because of my inexperience as a Drupal module developer so I appreciate how thorough you are being with how painstaking it must be =)
I have since pushed an update and hopefully this go round is more satisfactory.
Thanks!
Comment #8
jthorson commentedLang14,
While the initiative is quite a ways behind compared to where you are with your Drupal 7 module and plans, please consider joining the 'Sports Club (League) Management' group (http://groups.drupal.org/sports-club-league-management), both to keep tabs on and participate in the discussions regarding development of a centralized 'league' API initiative within D7 (http://groups.drupal.org/node/150659).
It's an awfully big dream ... and I could really use involvment from a few more developers to pull it off.
Comment #9
jordojuice commented@lang14 great! I'm sure that got a lot of the issues out of the way. For the best examples on correct Drupal coding practices refer to the core modules. That's how I figured out what the Drupal way is. Or the Examples for Developers module has some good stuff as well and they work hard to make sure it's done right.
Comment #10
alexreinhart commentedI've taken a quick look through this module to see if there are any other issues to fix. A few comments:
In general, ensure you pass everything through t() that needs to be translatable, and check that you properly escape your HTML output so users cannot insert malicious HTML.
Once you've corrected these issues, set the status back to "needs review" and I'll try to take another look through.
Comment #11
klausiNo activity in several months. Reopen and set the status to "needs review" if you are still pursuing this application.
Comment #12
avpaderno