This module is just a simple module that allows users to add an audio file to there files folder in Drupal and then configure that setting in the configuration menu. The site then plays the audio on the background of the site. The player is a block that can be assigned to any block on the site.

http://drupal.org/sandbox/On_jtharpe/1371850

git clone --branch 7.x-1.x On_jtharpe@git.drupal.org:sandbox/On_jtharpe/1371850.git background_audio

For Drupal 7

CommentFileSizeAuthor
#8 drupalcs-result.txt1007 bytesmichaelmol

Comments

patrickd’s picture

Status: Needs review » Needs work

welcome,

you got some coding style issues (See automated report at http://ventral.org/pareview/httpgitdrupalorgsandboxonjtharpe1371850git, you can use this site to re-test your self).
If you got any questions on that, please ask!

Before switching back to needs review you should at least move to a version specific branch, create a README.txt and remove wrong file[] lines from your .info (See link above).

Unfortunately I don't think that your module is large enough to review your skills seriously, it would be great if you'd add some more functionality. Also there are quite few comments, think about commenting your code more detailed so we can follow you thoughts.

You say it is a drupal 7 module but your using hook_install/uninstall like in drupal 6. Please read about the use of hook_schema in the documentation for d7.

/**
* Implements hook_schema
**/

should be

/**
 * Implements hook_schema().
 */
  variable_set('Path', $form_state['values']['Path']);
  
  db_update('background_audio')
      ->fields(array(
          'path' => variable_get('Path'),
  ))
  ->execute();
  $var = variable_get('Path');
  variable_set('drupvar', $var);

You have to prefix variables with your module name, also I don't understand the sense of setting and getting variables that often. Can you explain what you want to do here?

regards

On_jtharpe’s picture

First of all thank you for reviewing.

I realize it is a very simple module, but the simplicity is exactly what I had a need/use for.

I have made the corrections to my code with the exception of the variable re-naming. To answer your question all I am trying to do is store the variable Path which I get from the form and store it into the database (which is working fine) then I want to make sure that when a users visits my page the variable is populated from the database so that the audio will play. It is all working but I think I made it more difficult then I had to.

Thanks,
Justin

On_jtharpe’s picture

Status: Needs work » Needs review
On_jtharpe’s picture

Code is ready to be reviewed again.

Thanks,
Justin

On_jtharpe’s picture

Issue summary: View changes

Re word description

On_jtharpe’s picture

Priority: Normal » Major
Ciraxis’s picture

Status: Needs review » Needs work

Review of the 7.x-1.x branch:

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. Go and review some other project applications, so we can get back to yours sooner.


FILE: ...sites/all/modules/pareview_temp/test_candidate/background_audio.install
--------------------------------------------------------------------------------
FOUND 1 ERROR(S) AFFECTING 1 LINE(S)
--------------------------------------------------------------------------------
 8 | ERROR | Files must end in a single new line character
--------------------------------------------------------------------------------

Source: http://ventral.org/pareview - PAReview.sh online service

@klausi sry i didn't know, was my bad.

klausi’s picture

@Ciraxis: please do not set the issue to "needs work" if there are only that view code style errors and you do not give a manual review.

michaelmol’s picture

StatusFileSize
new1007 bytes

Review of the 7.x-1.x branch:

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. Go and review some other project applications, so we can get back to yours sooner.

You can use http://ventral.org/pareview/httpgitdrupalorgsandboxonjtharpe1371850git to repeat the review.

Manual review of 7.x-1.x branch:

background_audio.info

  • Provide a config path in the .info file, such as configure = admin/config/system/background_audio

background_audio.install

  • The .install file is empty, you should or remove it or provide some functions, such as hook_enable()

background_audio.module

  • 4: Provide a better description in the @file
  • 14: In the background_audio_help() check the double spaces in the help text
  • 37: Use lowercase keys for $blocks
  • 53: I think the height and width should be an setting, instead of hardcoded
  • 65: Your $delta is recent, but it should check your block delta, in this case 'Background_Audio' and the variable_set() is not right either.
  • 76: Why are you using a textfield for a file field, I think you should use the http://api.drupal.org/api/drupal/developer--topics--forms_api_reference.... and give the users an upload field.
  • 100: You can directly return drupal_get_form() instead of using it through the variable $form

README.txt

klausi’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. Feel free to reopen if you are still working on this application.

klausi’s picture

Issue summary: View changes

Changed branch.