--- bookreview.module 2004/12/31 04:03:34 1.3 +++ bookreview.module 2004/12/31 05:08:39 @@ -1,5 +1,5 @@ @@ -59,7 +59,7 @@ case 'fields': break; case 'insert': - db_query("INSERT INTO {bookreview} (nid, booktitle, publisher, copyright, isbn, synopsis, contents, review, pages, rating) VALUES (%d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d)", $node->nid, $node->booktitle, $node->publisher, $node->copyright, $node->isbn, $node->synopsis, $node->contents, $node->review, $node->pages, $node->rating); + db_query("INSERT INTO {bookreview} (nid, booktitle, publisher, copyright, isbn, synopsis, contents, review, pages, rating) VALUES (%d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d)", $node->nid, $node->booktitle, $node->publisher, $node->copyright, $node->isbn, $node->synopsis, $node->contents, $node->review, $node->pages, $node->rating); foreach ($node->authors as $weight => $author) { if ($author) { db_query("INSERT INTO {bookreview_authors} (nid, author, weight) VALUES (%d, '%s', %d)", $node->nid, $author, $weight); @@ -73,7 +73,7 @@ } break; case 'update': - db_query("UPDATE {bookreview} SET booktitle = '%s', publisher = '%s', copyright = %d, isbn = '%s', pages = %d, rating = %d, synopsis = '%s', contents = '%s', review = '%s' WHERE nid = %d", $node->booktitle, $node->publisher, $node->copyright, $node->isbn, $node->pages, $node->rating, $node->synopsis, $node->contents, $node->review, $node->nid); + db_query("UPDATE {bookreview} SET booktitle = '%s', publisher = '%s', copyright = '%s', isbn = '%s', pages = '%s', rating = %d, synopsis = '%s', contents = '%s', review = '%s' WHERE nid = %d", $node->booktitle, $node->publisher, $node->copyright, $node->isbn, $node->pages, $node->rating, $node->synopsis, $node->contents, $node->review, $node->nid); db_query("DELETE FROM {bookreview_authors} WHERE nid = %d", $node->nid); $i = 0; foreach ($node->authors as $author) { @@ -157,9 +157,9 @@ $output .= form_checkbox(t('add more authors'), 'bookreview_more_authors', 1, 0, t('If the book has more authors, you can create space to list them by checking this box and clicking '). ''. t('Preview'). '.'); $output .= form_textfield(t('Publisher'), 'publisher', $node->publisher, 60, 255, $error['publisher'] ? $error['publisher'] : t('Optional. The publisher of the book being reviewed.')); - $output .= form_textfield(t('Copyright'), 'copyright', $node->copyright, 4, 4, $error['copyright'] ? $error['copyright'] : t('Optional. The year the book was published. (Format: YYYY).')); + $output .= form_textfield(t('Copyright'), 'copyright', $node->copyright, 60, 255, $error['copyright'] ? $error['copyright'] : t('Optional. The year the book was published and other copyright details, if any.')); $output .= form_textfield(t('ISBN'), 'isbn', $node->isbn, 60, 64, $error['isbn'] ? $error['isbn'] : t('Optional. The ISBN of the book being reviewed.')); - $output .= form_textfield(t('Pages'), 'pages', $node->pages, 60, 5, $error['pages'] ? $error['pages'] : t('Optional. The total number of pages in the book being reviewed.')); + $output .= form_textfield(t('Pages'), 'pages', $node->pages, 60, 255, $error['pages'] ? $error['pages'] : t('Optional. The total number of pages in the book being reviewed.')); $output .= form_select(t('Rating'), 'rating', $node->rating, (array("<" . t('none') . ">") + drupal_map_assoc(range(1, 10))), $error['rating'] ? $error['rating'] : t('Optional. Score of the book on a 1 to 10 scale.')); $output .= form_item(t('Offsite links'), ''); // TODO: Replace table formatting with css