Clean up code based on coder module review.
in module file:
Line 39: Use an indent of 2 spaces, with no tabs
if ($op == 'list') {
Line 40: Use an indent of 2 spaces, with no tabs
$blocks[0]['info'] = t('Blog information');
Line 41: Use an indent of 2 spaces, with no tabs
return $blocks;
Line 42: Use an indent of 2 spaces, with no tabs
}
Line 43: Use an indent of 2 spaces, with no tabs
else if ($op == 'view') {
Line 44: Use an indent of 2 spaces, with no tabs
if (arg(0) == 'node' && is_numeric(arg(1))) $node = node_load(arg(1));
Line 45: Use an indent of 2 spaces, with no tabs
if (((arg(0) == 'blog' && is_numeric(arg(1))) || $node->type == 'blog')) {
Line 46: Use an indent of 2 spaces, with no tabs
if (arg(0) == 'blog') $authorid = arg(1);
Line 47: Use an indent of 2 spaces, with no tabs
else if ($node->type == 'blog') $authorid = $node->uid;
Line 48: Use an indent of 2 spaces, with no tabs
$count = db_result(db_query("SELECT COUNT(*) FROM {bloginfo} WHERE uid = %d", $authorid));
Line 49: Use an indent of 2 spaces, with no tabs
if ($count == 1){
Line 50: Use an indent of 2 spaces, with no tabs
$results = db_query("SELECT title, description, format FROM {bloginfo} WHERE uid = %d", $authorid);
Line 52: Use an indent of 2 spaces, with no tabs
$block['subject'] = check_plain($bloginfo->title);
Line 53: Use an indent of 2 spaces, with no tabs
$block['content'] = theme('bloginfo_block',$bloginfo->description, $bloginfo->format, $authorid);
Line 54: Use an indent of 2 spaces, with no tabs
return $block;
Line 55: Use an indent of 2 spaces, with no tabs
}
Line 56: Use an indent of 2 spaces, with no tabs
}
Line 57: Use an indent of 2 spaces, with no tabs
}
Line 71: Use an indent of 2 spaces, with no tabs
if ($category == 'account' && is_numeric(arg(1)) && (user_access('edit own bloginfo') || user_access('administer bloginfo'))) {
Line 72: Use an indent of 2 spaces, with no tabs
$result = db_query('SELECT title, description, format FROM {bloginfo} WHERE uid = %d', arg(1));
Line 73: Use an indent of 2 spaces, with no tabs
while ($bloginfo = db_fetch_object($result)) {
Line 74: Use an indent of 2 spaces, with no tabs
$mybloginfo['title'] = $bloginfo->title;
Line 75: Use an indent of 2 spaces, with no tabs
$mybloginfo['description'] = $bloginfo->description;
Line 77: Use an indent of 2 spaces, with no tabs
}
Line 78: Use an indent of 2 spaces, with no tabs
$fields['bloginfo_settings'] = array(
Line 79: Use an indent of 2 spaces, with no tabs
'#type' => 'fieldset',
Line 80: Use an indent of 2 spaces, with no tabs
'#title' => t('Blog Information'),
Line 81: Use an indent of 2 spaces, with no tabs
'#weight' => 5);
Line 82: Use an indent of 2 spaces, with no tabs
$fields['bloginfo_settings']['Title'] = array(
Line 83: Use an indent of 2 spaces, with no tabs
'#type' => 'textfield',
Line 84: Use an indent of 2 spaces, with no tabs
'#title' => t('Blog Title'),
Line 85: Use an indent of 2 spaces, with no tabs
'#maxlength' => 128,
Line 86: Use an indent of 2 spaces, with no tabs
'#default_value' => $mybloginfo['title'],
Line 87: Use an indent of 2 spaces, with no tabs
'#description' => t('Your blog title will display on your blog and blog posts.'));
Line 88: Use an indent of 2 spaces, with no tabs
$fields['bloginfo_settings']['Description'] = array(
Line 89: Use an indent of 2 spaces, with no tabs
'#type' => 'textarea',
Line 90: Use an indent of 2 spaces, with no tabs
'#title' => t('Blog Description'),
Line 91: Use an indent of 2 spaces, with no tabs
'#default_value' => $mybloginfo['description'],
Line 92: Use an indent of 2 spaces, with no tabs
'#description' => t('Your blog description will display on your blog and blog posts.'));
Line 94: Use an indent of 2 spaces, with no tabs
return $fields;
Line 95: Use an indent of 2 spaces, with no tabs
}//end if
Line 102: Use an indent of 2 spaces, with no tabs
if ($category == 'account') {
Line 104: Use an indent of 2 spaces, with no tabs
$results = db_query('SELECT uid FROM {bloginfo} WHERE uid = %d', arg(1));
Line 107: Use an indent of 2 spaces, with no tabs
if (db_num_rows($results) == 1){
Line 108: Use an indent of 2 spaces, with no tabs
db_query("Update {bloginfo} SET title = '%s', description = '%s', format = %d WHERE uid = %d", $edit['Title'], $edit['Description'], $edit['format'], arg(1));
Line 109: Use an indent of 2 spaces, with no tabs
}
Line 112: Use an indent of 2 spaces, with no tabs
else {
Line 113: Use an indent of 2 spaces, with no tabs
db_query("INSERT INTO {bloginfo} (uid, title, description, format) VALUES (%d, '%s', '%s', %d)", arg(1), $edit['Title'], $edit['Description'], $edit['format']);
Line 114: Use an indent of 2 spaces, with no tabs
}
Line 116: Use an indent of 2 spaces, with no tabs
}
Line 49: use a space between the closing parenthesis and the open bracket
if ($count == 1){
Line 107: use a space between the closing parenthesis and the open bracket
if (db_num_rows($results) == 1){
Line 9: string concatenation should be formatted without a space separating the operators (dot .) and a quote
$output = '
'. t('This module allows bloggers to have a title and description for their blog that is seperate from their username. This is similar to the title and descriptioin of blogs such as those at blogspot.com provided by blogger.'). '
';
Line 9: string concatenation should be formatted with a space separating the operators (dot .) and non-quote terms
$output = '
'. t('This module allows bloggers to have a title and description for their blog that is seperate from their username. This is similar to the title and descriptioin of blogs such as those at blogspot.com provided by blogger.'). '
';
Line 109: the final ?> should be omitted from all code files
Line 53: missing space after comma
$block['content'] = theme('bloginfo_block',$bloginfo->description, $bloginfo->format, $authorid);
Install file:
Line 44: use a space between the closing parenthesis and the open bracket
function bloginfo_update_1(){
Line 67: the final ?> should be omitted from all code files
Line 31: else statements should begin on a new line
} else {
Include the CVS keyword $Id$ in each file
Comments
Comment #1
mfer CreditAttribution: mfer commentedUpdated to drupal coding standard.
Comment #2
(not verified) CreditAttribution: commented