diff -Nup nodereview5/LICENSE.txt nodereview/LICENSE.txt
--- nodereview5/LICENSE.txt	2006-04-23 05:54:26.000000000 -0400
+++ nodereview/LICENSE.txt	2009-02-24 19:23:20.000000000 -0500
@@ -1,274 +1,274 @@
-GNU GENERAL PUBLIC LICENSE
-
-              Version 2, June 1991
-
-Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave,
-Cambridge, MA 02139, USA. Everyone is permitted to copy and distribute
-verbatim copies of this license document, but changing it is not allowed.
-
-                  Preamble
-
-The licenses for most software are designed to take away your freedom to
-share and change it. By contrast, the GNU General Public License is
-intended to guarantee your freedom to share and change free software--to
-make sure the software is free for all its users. This General Public License
-applies to most of the Free Software Foundation's software and to any other
-program whose authors commit to using it. (Some other Free Software
-Foundation software is covered by the GNU Library General Public License
-instead.) You can apply it to your programs, too.
-
-When we speak of free software, we are referring to freedom, not price. Our
-General Public Licenses are designed to make sure that you have the
-freedom to distribute copies of free software (and charge for this service if
-you wish), that you receive source code or can get it if you want it, that you
-can change the software or use pieces of it in new free programs; and that
-you know you can do these things.
-
-To protect your rights, we need to make restrictions that forbid anyone to
-deny you these rights or to ask you to surrender the rights. These restrictions
-translate to certain responsibilities for you if you distribute copies of the
-software, or if you modify it.
-
-For example, if you distribute copies of such a program, whether gratis or for
-a fee, you must give the recipients all the rights that you have. You must make
-sure that they, too, receive or can get the source code. And you must show
-them these terms so they know their rights.
-
-We protect your rights with two steps: (1) copyright the software, and (2)
-offer you this license which gives you legal permission to copy, distribute
-and/or modify the software.
-
-Also, for each author's protection and ours, we want to make certain that
-everyone understands that there is no warranty for this free software. If the
-software is modified by someone else and passed on, we want its recipients
-to know that what they have is not the original, so that any problems
-introduced by others will not reflect on the original authors' reputations.
-
-Finally, any free program is threatened constantly by software patents. We
-wish to avoid the danger that redistributors of a free program will individually
-obtain patent licenses, in effect making the program proprietary. To prevent
-this, we have made it clear that any patent must be licensed for everyone's
-free use or not licensed at all.
-
-The precise terms and conditions for copying, distribution and modification
-follow.
-
-           GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND
-               MODIFICATION
-
-0. This License applies to any program or other work which contains a notice
-placed by the copyright holder saying it may be distributed under the terms
-of this General Public License. The "Program", below, refers to any such
-program or work, and a "work based on the Program" means either the
-Program or any derivative work under copyright law: that is to say, a work
-containing the Program or a portion of it, either verbatim or with
-modifications and/or translated into another language. (Hereinafter, translation
-is included without limitation in the term "modification".) Each licensee is
-addressed as "you".
-
-Activities other than copying, distribution and modification are not covered
-by this License; they are outside its scope. The act of running the Program is
-not restricted, and the output from the Program is covered only if its contents
-constitute a work based on the Program (independent of having been made
-by running the Program). Whether that is true depends on what the Program
-does.
-
-1. You may copy and distribute verbatim copies of the Program's source
-code as you receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice and
-disclaimer of warranty; keep intact all the notices that refer to this License
-and to the absence of any warranty; and give any other recipients of the
-Program a copy of this License along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and you
-may at your option offer warranty protection in exchange for a fee.
-
-2. You may modify your copy or copies of the Program or any portion of it,
-thus forming a work based on the Program, and copy and distribute such
-modifications or work under the terms of Section 1 above, provided that you
-also meet all of these conditions:
-
-a) You must cause the modified files to carry prominent notices stating that
-you changed the files and the date of any change.
-
-b) You must cause any work that you distribute or publish, that in whole or in
-part contains or is derived from the Program or any part thereof, to be
-licensed as a whole at no charge to all third parties under the terms of this
-License.
-
-c) If the modified program normally reads commands interactively when run,
-you must cause it, when started running for such interactive use in the most
-ordinary way, to print or display an announcement including an appropriate
-copyright notice and a notice that there is no warranty (or else, saying that
-you provide a warranty) and that users may redistribute the program under
-these conditions, and telling the user how to view a copy of this License.
-(Exception: if the Program itself is interactive but does not normally print such
-an announcement, your work based on the Program is not required to print
-an announcement.)
-
-These requirements apply to the modified work as a whole. If identifiable
-sections of that work are not derived from the Program, and can be
-reasonably considered independent and separate works in themselves, then
-this License, and its terms, do not apply to those sections when you distribute
-them as separate works. But when you distribute the same sections as part
-of a whole which is a work based on the Program, the distribution of the
-whole must be on the terms of this License, whose permissions for other
-licensees extend to the entire whole, and thus to each and every part
-regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest your rights to
-work written entirely by you; rather, the intent is to exercise the right to
-control the distribution of derivative or collective works based on the
-Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of a
-storage or distribution medium does not bring the other work under the scope
-of this License.
-
-3. You may copy and distribute the Program (or a work based on it, under
-Section 2) in object code or executable form under the terms of Sections 1
-and 2 above provided that you also do one of the following:
-
-a) Accompany it with the complete corresponding machine-readable source
-code, which must be distributed under the terms of Sections 1 and 2 above
-on a medium customarily used for software interchange; or,
-
-b) Accompany it with a written offer, valid for at least three years, to give
-any third party, for a charge no more than your cost of physically performing
-source distribution, a complete machine-readable copy of the corresponding
-source code, to be distributed under the terms of Sections 1 and 2 above on
-a medium customarily used for software interchange; or,
-
-c) Accompany it with the information you received as to the offer to distribute
-corresponding source code. (This alternative is allowed only for
-noncommercial distribution and only if you received the program in object
-code or executable form with such an offer, in accord with Subsection b
-above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source code
-means all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation and
-installation of the executable. However, as a special exception, the source
-code distributed need not include anything that is normally distributed (in
-either source or binary form) with the major components (compiler, kernel,
-and so on) of the operating system on which the executable runs, unless that
-component itself accompanies the executable.
-
-If distribution of executable or object code is made by offering access to
-copy from a designated place, then offering equivalent access to copy the
-source code from the same place counts as distribution of the source code,
-even though third parties are not compelled to copy the source along with the
-object code.
-
-4. You may not copy, modify, sublicense, or distribute the Program except as
-expressly provided under this License. Any attempt otherwise to copy,
-modify, sublicense or distribute the Program is void, and will automatically
-terminate your rights under this License. However, parties who have received
-copies, or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
-5. You are not required to accept this License, since you have not signed it.
-However, nothing else grants you permission to modify or distribute the
-Program or its derivative works. These actions are prohibited by law if you
-do not accept this License. Therefore, by modifying or distributing the
-Program (or any work based on the Program), you indicate your acceptance
-of this License to do so, and all its terms and conditions for copying,
-distributing or modifying the Program or works based on it.
-
-6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the original
-licensor to copy, distribute or modify the Program subject to these terms and
-conditions. You may not impose any further restrictions on the recipients'
-exercise of the rights granted herein. You are not responsible for enforcing
-compliance by third parties to this License.
-
-7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues), conditions
-are imposed on you (whether by court order, agreement or otherwise) that
-contradict the conditions of this License, they do not excuse you from the
-conditions of this License. If you cannot distribute so as to satisfy
-simultaneously your obligations under this License and any other pertinent
-obligations, then as a consequence you may not distribute the Program at all.
-For example, if a patent license would not permit royalty-free redistribution
-of the Program by all those who receive copies directly or indirectly through
-you, then the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply and
-the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any patents or
-other property right claims or to contest validity of any such claims; this
-section has the sole purpose of protecting the integrity of the free software
-distribution system, which is implemented by public license practices. Many
-people have made generous contributions to the wide range of software
-distributed through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing to
-distribute software through any other system and a licensee cannot impose
-that choice.
-
-This section is intended to make thoroughly clear what is believed to be a
-consequence of the rest of this License.
-
-8. If the distribution and/or use of the Program is restricted in certain
-countries either by patents or by copyrighted interfaces, the original copyright
-holder who places the Program under this License may add an explicit
-geographical distribution limitation excluding those countries, so that
-distribution is permitted only in or among countries not thus excluded. In such
-case, this License incorporates the limitation as if written in the body of this
-License.
-
-9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will be
-similar in spirit to the present version, but may differ in detail to address new
-problems or concerns.
-
-Each version is given a distinguishing version number. If the Program specifies
-a version number of this License which applies to it and "any later version",
-you have the option of following the terms and conditions either of that
-version or of any later version published by the Free Software Foundation. If
-the Program does not specify a version number of this License, you may
-choose any version ever published by the Free Software Foundation.
-
-10. If you wish to incorporate parts of the Program into other free programs
-whose distribution conditions are different, write to the author to ask for
-permission. For software which is copyrighted by the Free Software
-Foundation, write to the Free Software Foundation; we sometimes make
-exceptions for this. Our decision will be guided by the two goals of
-preserving the free status of all derivatives of our free software and of
-promoting the sharing and reuse of software generally.
-
-               NO WARRANTY
-
-11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE,
-THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT
-PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE
-STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
-WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
-INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
-PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
-NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR
-AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR
-ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE
-LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL,
-SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
-ARISING OUT OF THE USE OR INABILITY TO USE THE
-PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA
-OR DATA BEING RENDERED INACCURATE OR LOSSES
-SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE
-PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN
-IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.
-
-          END OF TERMS AND CONDITIONS
+GNU GENERAL PUBLIC LICENSE
+
+              Version 2, June 1991
+
+Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave,
+Cambridge, MA 02139, USA. Everyone is permitted to copy and distribute
+verbatim copies of this license document, but changing it is not allowed.
+
+                  Preamble
+
+The licenses for most software are designed to take away your freedom to
+share and change it. By contrast, the GNU General Public License is
+intended to guarantee your freedom to share and change free software--to
+make sure the software is free for all its users. This General Public License
+applies to most of the Free Software Foundation's software and to any other
+program whose authors commit to using it. (Some other Free Software
+Foundation software is covered by the GNU Library General Public License
+instead.) You can apply it to your programs, too.
+
+When we speak of free software, we are referring to freedom, not price. Our
+General Public Licenses are designed to make sure that you have the
+freedom to distribute copies of free software (and charge for this service if
+you wish), that you receive source code or can get it if you want it, that you
+can change the software or use pieces of it in new free programs; and that
+you know you can do these things.
+
+To protect your rights, we need to make restrictions that forbid anyone to
+deny you these rights or to ask you to surrender the rights. These restrictions
+translate to certain responsibilities for you if you distribute copies of the
+software, or if you modify it.
+
+For example, if you distribute copies of such a program, whether gratis or for
+a fee, you must give the recipients all the rights that you have. You must make
+sure that they, too, receive or can get the source code. And you must show
+them these terms so they know their rights.
+
+We protect your rights with two steps: (1) copyright the software, and (2)
+offer you this license which gives you legal permission to copy, distribute
+and/or modify the software.
+
+Also, for each author's protection and ours, we want to make certain that
+everyone understands that there is no warranty for this free software. If the
+software is modified by someone else and passed on, we want its recipients
+to know that what they have is not the original, so that any problems
+introduced by others will not reflect on the original authors' reputations.
+
+Finally, any free program is threatened constantly by software patents. We
+wish to avoid the danger that redistributors of a free program will individually
+obtain patent licenses, in effect making the program proprietary. To prevent
+this, we have made it clear that any patent must be licensed for everyone's
+free use or not licensed at all.
+
+The precise terms and conditions for copying, distribution and modification
+follow.
+
+           GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND
+               MODIFICATION
+
+0. This License applies to any program or other work which contains a notice
+placed by the copyright holder saying it may be distributed under the terms
+of this General Public License. The "Program", below, refers to any such
+program or work, and a "work based on the Program" means either the
+Program or any derivative work under copyright law: that is to say, a work
+containing the Program or a portion of it, either verbatim or with
+modifications and/or translated into another language. (Hereinafter, translation
+is included without limitation in the term "modification".) Each licensee is
+addressed as "you".
+
+Activities other than copying, distribution and modification are not covered
+by this License; they are outside its scope. The act of running the Program is
+not restricted, and the output from the Program is covered only if its contents
+constitute a work based on the Program (independent of having been made
+by running the Program). Whether that is true depends on what the Program
+does.
+
+1. You may copy and distribute verbatim copies of the Program's source
+code as you receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice and
+disclaimer of warranty; keep intact all the notices that refer to this License
+and to the absence of any warranty; and give any other recipients of the
+Program a copy of this License along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and you
+may at your option offer warranty protection in exchange for a fee.
+
+2. You may modify your copy or copies of the Program or any portion of it,
+thus forming a work based on the Program, and copy and distribute such
+modifications or work under the terms of Section 1 above, provided that you
+also meet all of these conditions:
+
+a) You must cause the modified files to carry prominent notices stating that
+you changed the files and the date of any change.
+
+b) You must cause any work that you distribute or publish, that in whole or in
+part contains or is derived from the Program or any part thereof, to be
+licensed as a whole at no charge to all third parties under the terms of this
+License.
+
+c) If the modified program normally reads commands interactively when run,
+you must cause it, when started running for such interactive use in the most
+ordinary way, to print or display an announcement including an appropriate
+copyright notice and a notice that there is no warranty (or else, saying that
+you provide a warranty) and that users may redistribute the program under
+these conditions, and telling the user how to view a copy of this License.
+(Exception: if the Program itself is interactive but does not normally print such
+an announcement, your work based on the Program is not required to print
+an announcement.)
+
+These requirements apply to the modified work as a whole. If identifiable
+sections of that work are not derived from the Program, and can be
+reasonably considered independent and separate works in themselves, then
+this License, and its terms, do not apply to those sections when you distribute
+them as separate works. But when you distribute the same sections as part
+of a whole which is a work based on the Program, the distribution of the
+whole must be on the terms of this License, whose permissions for other
+licensees extend to the entire whole, and thus to each and every part
+regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest your rights to
+work written entirely by you; rather, the intent is to exercise the right to
+control the distribution of derivative or collective works based on the
+Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of a
+storage or distribution medium does not bring the other work under the scope
+of this License.
+
+3. You may copy and distribute the Program (or a work based on it, under
+Section 2) in object code or executable form under the terms of Sections 1
+and 2 above provided that you also do one of the following:
+
+a) Accompany it with the complete corresponding machine-readable source
+code, which must be distributed under the terms of Sections 1 and 2 above
+on a medium customarily used for software interchange; or,
+
+b) Accompany it with a written offer, valid for at least three years, to give
+any third party, for a charge no more than your cost of physically performing
+source distribution, a complete machine-readable copy of the corresponding
+source code, to be distributed under the terms of Sections 1 and 2 above on
+a medium customarily used for software interchange; or,
+
+c) Accompany it with the information you received as to the offer to distribute
+corresponding source code. (This alternative is allowed only for
+noncommercial distribution and only if you received the program in object
+code or executable form with such an offer, in accord with Subsection b
+above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source code
+means all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation and
+installation of the executable. However, as a special exception, the source
+code distributed need not include anything that is normally distributed (in
+either source or binary form) with the major components (compiler, kernel,
+and so on) of the operating system on which the executable runs, unless that
+component itself accompanies the executable.
+
+If distribution of executable or object code is made by offering access to
+copy from a designated place, then offering equivalent access to copy the
+source code from the same place counts as distribution of the source code,
+even though third parties are not compelled to copy the source along with the
+object code.
+
+4. You may not copy, modify, sublicense, or distribute the Program except as
+expressly provided under this License. Any attempt otherwise to copy,
+modify, sublicense or distribute the Program is void, and will automatically
+terminate your rights under this License. However, parties who have received
+copies, or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+5. You are not required to accept this License, since you have not signed it.
+However, nothing else grants you permission to modify or distribute the
+Program or its derivative works. These actions are prohibited by law if you
+do not accept this License. Therefore, by modifying or distributing the
+Program (or any work based on the Program), you indicate your acceptance
+of this License to do so, and all its terms and conditions for copying,
+distributing or modifying the Program or works based on it.
+
+6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the original
+licensor to copy, distribute or modify the Program subject to these terms and
+conditions. You may not impose any further restrictions on the recipients'
+exercise of the rights granted herein. You are not responsible for enforcing
+compliance by third parties to this License.
+
+7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues), conditions
+are imposed on you (whether by court order, agreement or otherwise) that
+contradict the conditions of this License, they do not excuse you from the
+conditions of this License. If you cannot distribute so as to satisfy
+simultaneously your obligations under this License and any other pertinent
+obligations, then as a consequence you may not distribute the Program at all.
+For example, if a patent license would not permit royalty-free redistribution
+of the Program by all those who receive copies directly or indirectly through
+you, then the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply and
+the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any patents or
+other property right claims or to contest validity of any such claims; this
+section has the sole purpose of protecting the integrity of the free software
+distribution system, which is implemented by public license practices. Many
+people have made generous contributions to the wide range of software
+distributed through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing to
+distribute software through any other system and a licensee cannot impose
+that choice.
+
+This section is intended to make thoroughly clear what is believed to be a
+consequence of the rest of this License.
+
+8. If the distribution and/or use of the Program is restricted in certain
+countries either by patents or by copyrighted interfaces, the original copyright
+holder who places the Program under this License may add an explicit
+geographical distribution limitation excluding those countries, so that
+distribution is permitted only in or among countries not thus excluded. In such
+case, this License incorporates the limitation as if written in the body of this
+License.
+
+9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will be
+similar in spirit to the present version, but may differ in detail to address new
+problems or concerns.
+
+Each version is given a distinguishing version number. If the Program specifies
+a version number of this License which applies to it and "any later version",
+you have the option of following the terms and conditions either of that
+version or of any later version published by the Free Software Foundation. If
+the Program does not specify a version number of this License, you may
+choose any version ever published by the Free Software Foundation.
+
+10. If you wish to incorporate parts of the Program into other free programs
+whose distribution conditions are different, write to the author to ask for
+permission. For software which is copyrighted by the Free Software
+Foundation, write to the Free Software Foundation; we sometimes make
+exceptions for this. Our decision will be guided by the two goals of
+preserving the free status of all derivatives of our free software and of
+promoting the sharing and reuse of software generally.
+
+               NO WARRANTY
+
+11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE,
+THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT
+PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE
+STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
+WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
+PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
+NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR
+AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR
+ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE
+LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL,
+SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
+ARISING OUT OF THE USE OR INABILITY TO USE THE
+PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA
+OR DATA BEING RENDERED INACCURATE OR LOSSES
+SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE
+PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN
+IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGES.
+
+          END OF TERMS AND CONDITIONS
diff -Nup nodereview5/nodereview.admin.inc nodereview/nodereview.admin.inc
--- nodereview5/nodereview.admin.inc	1969-12-31 19:00:00.000000000 -0500
+++ nodereview/nodereview.admin.inc	2009-02-24 19:23:20.000000000 -0500
@@ -0,0 +1,224 @@
+<?php
+// $Id$
+
+
+/**
+ * @file
+ * Administration page callbacks for the nodereview module.
+ */
+
+
+/**
+ * Form builder. Configure nodereview node types.
+ *
+ * @ingroup forms
+ *
+ */
+
+function nodereview_configure_axes(&$form_state, $type, $name) {
+
+  drupal_set_title(t('Reviews for %type nodes', array('%type' => check_plain($name))));
+
+  $form['use'] = array(
+      '#type' => 'fieldset',
+      '#title' => t('reviews'),
+      '#collapsible' => TRUE,
+      '#collapsed' => FALSE,
+  );
+
+  $form['use']['node_type'] = array('#type' => 'hidden', '#value' => $type);
+  $form['use']['guide'] = array(
+    '#type' => 'textarea',
+    '#title' => t('Usage Guide to the User'),
+    '#return_value' => 1,
+    '#default_value' => variable_get('nodereview_guide_'. $type, ''),
+    '#description' => t('Instructions to users for how to use this review.  These will be shown on the "Add Review" page. Note that if you have help text defined on admin/settings/content-types/nodereview, this value will override it.'),
+  );
+
+  $form['axes'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('review axes'),
+    '#collapsible' => TRUE,
+    '#collapsed' => FALSE,
+    '#tree' => TRUE,
+  );
+
+  // We'll store field information in its own table
+  $result = db_query("SELECT aid, tag, description, weight FROM {nodereview_axes} WHERE node_type='%s' ORDER BY weight", $type);
+
+  $axes = array();
+
+  while ($record = db_fetch_object($result)) {
+    $axes[] = _nodereview_configure_axis($record);
+  }
+
+  $record = new stdClass();
+  $record->aid = 0;
+  $record->node_type = $type;
+
+  $axes[] = _nodereview_configure_axis($record);
+
+  $form['axes'] += $axes;
+
+  $form['submit'] = array('#type' => 'submit', '#value' => t('Save'));
+
+  return $form;
+
+}
+
+
+/**
+ * Handle submission of the nodereview node type axes
+ * form and saving of the data to the database.
+ *
+ */
+
+function nodereview_configure_axes_submit($form, $form_state) {
+  $form_values = $form_state['values'];
+  // Save whether or not we're reviewing this node type
+  // variable_set('nodereview_use_' . $form_values['node_type'], $form_values['use']);
+  variable_set('nodereview_guide_'. $form_values['node_type'], $form_values['guide']);
+
+  // Regardless, save the user's data, just in case they may want it later
+  foreach ($form_values['axes'] as $axis) {
+    if ($axis['aid'] && $axis['use']) {
+      // Update an existing axis
+      $axis['description'] = check_plain($axis['description']);
+      db_query("UPDATE {nodereview_axes} SET tag='%s', description='%s', weight=%d WHERE aid=%d", $axis['tag'], $axis['description'], $axis['weight'], $axis['aid']);
+    }
+    elseif ($axis['aid'] && ! $axis['use']) {
+      // Delete an existing axis
+      db_query("DELETE FROM {nodereview_axes} WHERE aid=%d", $axis['aid']);
+    }
+    elseif ($axis['use'] && ! $axis['aid']) {
+      // Create a new axis
+      $axis['description'] = check_plain($axis['description']);
+      db_query("INSERT INTO {nodereview_axes} (node_type, tag, description, weight) VALUES ('%s', '%s', '%s', %d)", $form_values['node_type'], $axis['tag'], $axis['description'], $axis['weight']);
+    }
+    else {
+      // Doesn't exist and don't use, so just ignore
+    }
+  }
+}
+
+
+/**
+ * Form builder. To build additional axes on submit.
+ *
+ * @ingroup forms
+ *
+ */
+function _nodereview_configure_axis($record) {
+  $form['aid'] = array(
+    '#type' => 'hidden',
+    '#value' => $record->aid,
+  );
+  $form['use'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Use axis'),
+    '#return_value' => 1,
+    '#default_value' => (boolean)($record->aid),
+    '#description' => t(''),
+  );
+  $form['tag'] = array(
+    '#type' => 'textfield',
+    '#title' => t('name'),
+    '#return_value' => 1,
+    '#default_value' => $record->tag,
+    '#size' => 30,
+  );
+  $form['description'] = array(
+    '#type' => 'textarea',
+    '#title' => t('description'),
+    '#return_value' => 1,
+    '#default_value' => $record->description,
+    '#rows' => 2,
+  );
+  $form['weight'] = array(
+    '#type' => 'weight',
+    '#title' => t('weight'),
+    '#delta' => 10,
+    '#default_value' => $record->weight,
+    '#description' => t(''),
+  );
+
+  return $form;
+}
+
+
+/**
+ * We use this function in place of hook_settings(), because hook_settings()
+ * isn't fancy enough to support what we need to do.
+ *
+ */
+function nodereview_configure() {
+
+  $form = array();
+  $default = array();
+  foreach(node_get_types() as $type => $info) {
+    $options[$type] = $info->name;
+    if (variable_get('nodereview_use_'. $type, 0)) {
+      $default[] = $type;
+    }
+  }
+
+  $form['nodereview'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Review types'),
+    '#collapsible' => FALSE,
+    '#collapsed' => FALSE,
+  );
+  $form['nodereview']['types'] = array(
+    '#type' => 'checkboxes',
+    '#title' => t('Reviewable content types'),
+    '#default_value' => $default,
+    '#options' => $options,
+    '#description' => t('Specify which content types can be reviewed.'),
+  );
+
+  if (module_exists('fivestar')) {
+    $form['fivestar'] = array(
+      '#type' => 'fieldset',
+      '#title' => t('Fivestar options'),
+      '#collapsible' => FALSE,
+      '#collapsed' => FALSE,
+      '#tree' => TRUE,
+    );
+    $form['fivestar']['enable'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Use Fivestar for reviews'),
+      '#default_value' => variable_get('nodereview_fivestar_enable', 0),
+      '#description' => t('Enabling Fivestar for reviews will replace select list options with a JavaScript star display.'),
+    );
+    $form['fivestar']['stars'] = array(
+      '#type' => 'select',
+      '#title' => t('Number of stars'),
+      '#options' => drupal_map_assoc(range(1, 10)),
+      '#default_value' => variable_get('nodereview_fivestar_stars', 5),
+    );
+  }
+
+  $form['submit'] = array(
+    '#type' => 'submit',
+    '#value' => t('Save'),
+  );
+
+  return $form;
+}
+
+
+function nodereview_configure_submit($form, $form_state) {
+  $form_values = $form_state['values'];
+  foreach ($form_values['types'] as $type => $checked) {
+    variable_set('nodereview_use_'. $type, (bool)$checked);
+  }
+  if(module_exists('fivestar')) {
+    foreach ($form_values['fivestar'] as $option => $value) {
+    variable_set('nodereview_fivestar_'. $option, $value);
+    }
+  }
+  cache_clear_all();
+  menu_rebuild();
+
+}
+
diff -Nup nodereview5/nodereview.info nodereview/nodereview.info
--- nodereview5/nodereview.info	2008-05-15 20:11:16.000000000 -0400
+++ nodereview/nodereview.info	2009-02-24 19:23:20.000000000 -0500
@@ -1,10 +1,7 @@
-; $Id: nodereview.info,v 1.1.2.2 2007/06/18 23:06:54 dww Exp $
+;$Id$
 name = Node Review
 description = "Add reviews to arbitrary node types."
-dependencies = views votingapi
-
-; Information added by drupal.org packaging script on 2008-05-16
-version = "5.x-1.x-dev"
-project = "nodereview"
-datestamp = "1210896676"
+core = "6.x"
+dependencies[] = views
+dependencies[] = votingapi
 
diff -Nup nodereview5/nodereview.install nodereview/nodereview.install
--- nodereview5/nodereview.install	2008-05-15 13:27:14.000000000 -0400
+++ nodereview/nodereview.install	2009-02-24 19:23:20.000000000 -0500
@@ -1,79 +1,143 @@
 <?php
-// $Id: nodereview.install,v 1.3.2.4 2008/05/15 17:27:14 johnforsythe Exp $
+// $Id$
+
+
+/**
+ * Implementation of hook_install().
+ */
 
 function nodereview_install() {
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      db_query("CREATE TABLE {nodereview} (
-        nid int unsigned NOT NULL default '0',
-        reviewed_nid int unsigned NOT NULL default '0',
-        PRIMARY KEY  (nid),
-        KEY (reviewed_nid)
-      ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
-      db_query("CREATE TABLE {nodereview_axes} (
-        aid int(11) NOT NULL auto_increment,
-        tag varchar(255) NOT NULL default '',
-        node_type varchar(255) NOT NULL default '',
-        weight int(11) NOT NULL default 0,
-        description text NOT NULL default '',
-        PRIMARY KEY  (aid)
-      ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
-      db_query("CREATE TABLE {nodereview_reviews} (
-        nid int(11) NOT NULL default 0,
-        aid int(11) NOT NULL default 0,
-        review text NOT NULL,
-        KEY (nid)
-      ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
-      break;
-    
-    // this syntax seems to be incorrect, a patch by someone familiar with pgsql would be appreciated.
-    case 'pgsql':
-      db_query("CREATE TABLE {nodereview} (
-        nid int unsigned NOT NULL default '0',
-        reviewed_nid int unsigned NOT NULL default '0',
-        PRIMARY KEY  (nid),
-        KEY (reviewed_nid)
-      );");
-      db_query("CREATE TABLE {nodereview_axes} (
-        aid int(11) NOT NULL auto_increment,
-        tag varchar(255) NOT NULL default '',
-        node_type varchar(255) NOT NULL default '',
-        weight int(11) NOT NULL default 0,
-        description text NOT NULL default '',
-        PRIMARY KEY  (aid)
-      );");
-      db_query("CREATE TABLE {nodereview_reviews} (
-        nid int(11) NOT NULL default 0,
-        aid int(11) NOT NULL default 0,
-        review text NOT NULL,
-        KEY (nid)
-      );");
-      break;
-  }
-}
 
-function nodereview_update_1() {
-  $ret = array();
-  switch ($GLOBALS['db_type']) {
-    case 'mysqli':
-    case 'mysql':
-      $ret[] = update_sql("ALTER TABLE {nodereview_axes} ADD COLUMN description text NOT NULL default ''");
-      break;
-    case 'pgsql':
-      db_add_column($ret, 'nodereview_axes', 'description', 'text', array('default' => '', 'not null' => TRUE));
-      break;
-  }
-  return $ret;
+  // Use schema API to create database table.
+  drupal_install_schema('nodereview');
 }
 
+/**
+ * Implementation of hook_uninstall().
+ */
 function nodereview_uninstall() {
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      db_query("DROP TABLE {nodereview}}");
-      db_query("DROP TABLE {nodereview_axes}}");
-      db_query("DROP TABLE {nodereview_reviews}");
-      db_query("DELETE FROM {node_type} WHERE type='nodereview'");
+  // Use schema API to delete database table.
+  drupal_uninstall_schema('nodereview');
+
+  //Delete all the node type entry from nodetype table
+  db_query("DELETE FROM {node_type} WHERE type='nodereview'");
+
+  //Delete nodereview fivestar variables
+  variable_del('nodereview_fivestar_enable');
+  variable_del('nodereview_fivestar_stars');
+
+  //Delete nodereview node types & its help info
+  foreach(node_get_types() as $type => $info) {
+    variable_del('nodereview_use_' . $type);
+    variable_del('nodereview_guide_' . $info->name);
   }
 }
+
+
+/**
+ * Implementation of hook_schema().
+ */
+function nodereview_schema() {
+
+  $schema['nodereview'] = array(
+    'description' => t('Stores reviewed node and the review node mapping.'),
+    'fields' => array(
+      'nid' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'default' => 0,
+        'description' => t('The {node}.nid of the review.'),
+      ),
+
+      'reviewed_nid' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'default' => 0,
+        'description' => t('The {node}.nid to which is reviewed.'),
+      ),
+
+    ),
+    'primary key' => array('nid'),
+  );
+
+
+  $schema['nodereview_axes'] = array(
+    'description' => t('Stores axes labels for particular node types.'),
+    'fields' => array(
+      'aid' => array(
+        'type' => 'serial',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'description' => t('The {node}.nid of the review.'),
+      ),
+
+      'tag' => array(
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+        'default' => '',
+        'description' => t('The tag for the axes.'),
+      ),
+
+      'node_type' => array(
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+        'default' => '',
+        'description' => t('The node type to which the axes belong.'),
+      ),
+
+      'weight' => array(
+        'type' => 'int',
+        'not null' => TRUE,
+        'length'   => 11,
+        'default'  => 0,
+        'description' => t('The axes weight.'),
+      ),
+
+      'description' => array(
+        'type' => 'text',
+        'not null' => TRUE,
+        'default' => '',
+        'description' => t('The decsription about the axes.'),
+      ),
+    ),
+    'primary key' => array('aid'),
+  );
+
+
+
+  $schema['nodereview_reviews'] = array(
+    'description' => t('Stores reviews.'),
+    'fields' => array(
+      'nid' => array(
+        'type' => 'int',
+        'length'   => 11,
+        'not null' => TRUE,
+        'default' => 0,
+        'description' => t('The {node}.nid of the review.'),
+      ),
+
+      'aid' => array(
+        'type' => 'int',
+        'not null' => TRUE,
+        'length'   => 11,
+        'default'  => 0,
+        'description' => t('The {axes}.nid of the review.'),
+      ),
+
+      'review' => array(
+        'type' => 'text',
+        'not null' => TRUE,
+        'description' => t('The review.'),
+      ),
+
+    ),
+    'key' => array('nid'),
+  );
+  return $schema;
+}
+
+
diff -Nup nodereview5/nodereview.module nodereview/nodereview.module
--- nodereview5/nodereview.module	2008-05-15 13:27:14.000000000 -0400
+++ nodereview/nodereview.module	2009-02-24 19:23:20.000000000 -0500
@@ -1,17 +1,18 @@
 <?php
-// $Id: nodereview.module,v 1.5.2.6 2008/05/15 17:27:14 johnforsythe Exp $
+// $Id$
 
 define('NODEREVIEW_FIVESTAR_ENABLE', module_exists('fivestar') && variable_get('nodereview_fivestar_enable', 0));
 
-require_once(
-  drupal_get_path('module', 'nodereview') . '/nodereview_node_nodereview.inc'
-);
 
-if (module_exists('views')) {
-  require_once(drupal_get_path('module', 'nodereview') . '/nodereview_views.inc');
-}
+if(!function_exists("node_object_prepare")) {
+  include_once(drupal_get_path('module', 'node') . '/node.pages.inc');
+ }
+
+ require_once(drupal_get_path('module', 'nodereview') . '/nodereview_node_nodereview.inc');
+
 
-/** 
+
+/**
  * @file
  * This module adds user reviews to specified node types, on multiple axes and with
  * voting via the Voting API module (required).  It uses the Views module
@@ -19,15 +20,14 @@ if (module_exists('views')) {
  *
  */
 
-/* ----- System hooks ----- */
 
 /**
  * Implementation of hook_help().
- * 
+ *
  */
-function nodereview_help($section) {
+function nodereview_help($path, $arg) {
 
-  // We want to show custom help text on both the add and edit pages, which 
+  // We want to show custom help text on both the add and edit pages, which
   // have very different path structures
   if ('node' == arg(0)) {
     if ('addreview' == arg(2)) {
@@ -38,8 +38,8 @@ function nodereview_help($section) {
     }
     elseif ('edit' == arg(2)) {
       // Get the type of the node we're reviewing, which is not the nid in the path
-      $type = db_result(db_query("SELECT n.type 
-        FROM {node} n 
+      $type = db_result(db_query("SELECT n.type
+        FROM {node} n
           INNER JOIN {nodereview} nr ON n.nid=nr.reviewed_nid
         WHERE nr.nid=%d", arg(1)));
 
@@ -51,13 +51,13 @@ function nodereview_help($section) {
 
 /**
  * Implementation of hook_node_info().
- * 
+ *
  */
 
 function nodereview_node_info() {
   return array(
     'nodereview' => array(
-      'name' => t('Review'), 
+      'name' => t('Review'),
       'module' => 'nodereview',
       'description' => 'A review is a user-supplied critique of another node.',
       'has_title' => TRUE,
@@ -73,7 +73,12 @@ function nodereview_node_info() {
  *
  */
 function nodereview_perm() {
-  return array('administer reviews', 'read reviews', 'submit reviews', 'edit own reviews');
+  return array(
+    'administer reviews',
+    'read reviews',
+    'submit reviews',
+    'edit own reviews'
+  );
 }
 
 /**
@@ -84,8 +89,8 @@ function nodereview_link($type, $node = 
   $links = array();
   global $user;
 
-  if ('node' == $type && 'nodereview' == $node->type) {
-  
+  if ($type == 'node' && $node->type == 'nodereview') {
+
     // Add a link back to the node being reviewed by this node
     $reviewed_type = node_get_types('type', db_result(db_query("SELECT type FROM {node} WHERE nid=%d", $node->reviewed_nid)));
     $reviewed_type = $reviewed_type->name;
@@ -104,116 +109,122 @@ function nodereview_link($type, $node = 
  * Implementation of hook_menu().
  *
  */
-function nodereview_menu($may_cache) {
+function nodereview_menu() {
   $items = array();
-
   global $user;
 
-  if ($may_cache) {
-    $items[] = array(
-      'path' => 'admin/content/nodereview',
-      'title' => t('Review types'),
-      'callback' => 'drupal_get_form',
-      'callback arguments' => t('nodereview_configure'),
-      'access' => user_access('administer reviews'),
-    );
-    $items[] = array(
-      'path' => 'admin/content/nodereview/types',
-      'title' => t('List'),
-      'callback' => 'drupal_get_form',
-      'callback arguments' => t('nodereview_configure'),
-      'access' => user_access('administer reviews'),
-      'type' => MENU_DEFAULT_LOCAL_TASK,
-      'weight' => -1,
+  $items['admin/content/nodereview'] = array(
+    'title' => t('Review types'),
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('nodereview_configure'),
+    'file' => 'nodereview.admin.inc',
+    'file path' => drupal_get_path('module', 'nodereview'),
+    'access arguments' => array('administer reviews'),
+    'description' => t('Configure the axes for node type review'),
     );
-    // Hide the normal node-add page, since we never want users to see it
-    $items[] = array(
-      'path' => 'node/add/nodereview',
-      'access' => FALSE,
+
+  $items['admin/content/nodereview/types'] = array(
+    'title' => t('List'),
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('nodereview_configure'),
+    'file' => 'nodereview.admin.inc',
+    'file path' => drupal_get_path('module', 'nodereview'),
+    'access arguments' => array('administer reviews'),
+    'type' => MENU_DEFAULT_LOCAL_TASK,
+    'weight' => -1,
     );
-  }
-  else {
 
-    // Add a tab for each node type that we can review
-    // It's slow to put this here, as it should go in 
-    foreach(node_get_types() as $type => $info) {
-      if (variable_get('nodereview_use_'. $type, 0)) {
-        $items[] = array(
-          'path' => 'admin/content/nodereview/'. $type,
-          'type' => MENU_LOCAL_TASK,
-          'title' => t($info->name),
-          'callback' => 'drupal_get_form',
-          'callback arguments' => array('nodereview_configure_axes', $type),
-          'access' => user_access('administer reviews'),
-        );
-      }
-    }
 
-    // To avoid SQL overhead, check whether we are on a node page and whether the
-    // user is allowed to write reviews.
-    if (arg(0) == 'node' && is_numeric(arg(1))) {
-
-      // Only add review tabs if this is one of the nodes we want to review.
-      $type = db_result(db_query("SELECT n.type FROM {node} n WHERE n.nid = %d", arg(1)));
-
-      // Only add menu items for reviews if we're supposed to on this node type, *and* there is at least one axis defined.
-      if (variable_get('nodereview_use_' . $type, 0) && db_result(db_query("SELECT COUNT(*) FROM {nodereview_axes} WHERE node_type='%s'", $type))) {
-        $items[] = array(
-          'path' => 'node/' . arg(1) . '/reviews',
-          'callback' => 'views_page',
-          'callback arguments' => array('review list', arg(1)),
-          'type' => MENU_LOCAL_TASK,
-          'title' => t('Reviews'),
-          'weight' => 2,
-          'access' => user_access('read reviews'),
-        );
-        // The permission check is redundant, but is to avoid the SQL hit if we don't need these menu items anyway
-        if (user_access('submit reviews')) {
-          $review_nid = db_result(db_query("SELECT n.nid FROM {node} n INNER JOIN {nodereview} nr ON n.nid=nr.nid WHERE uid=%d AND reviewed_nid=%d", $user->uid, arg(1)));
-          if ($review_nid) {
-            $review_node = node_load(array('nid'=>$review_nid));
-            $items[] = array(
-              'path' => 'node/'. arg(1) .'/editreview',
-              'title' => t('Edit your review'),
-              'callback' => 'node_page_edit',
-              'callback arguments' => array($review_node),
-              'access' => user_access('edit own reviews') || user_access('administer reviews'),
-              'type' => MENU_LOCAL_TASK,
-              'weight' => 3
-            );
-          }
-          else {
-            $items[] = array(
-              'path' => 'node/'. arg(1) .'/addreview',
-              'title' => t('Add review'),
-              'callback' => 'node_add',
-              'callback arguments' => array('nodereview'),
-              'access' => user_access('submit reviews'),
-              'type' => MENU_LOCAL_TASK,
-              'weight' => 3
-            );
-          }
-        }
-      }
+  // Add a tab for each node type that we can review
+  // It's slow to put this here, as it should go in
+
+  foreach(node_get_types() as $type => $info) {
+    if(variable_get('nodereview_use_'. $type, 0)) {
+      $items['admin/content/nodereview/' . $type] = array(
+        'title callback' => 'check_plain',
+        'title arguments' => array($info->name),
+        'page callback' => 'drupal_get_form',
+        'page arguments' => array('nodereview_configure_axes', $type, $info->name),
+        'file' => 'nodereview.admin.inc',
+        'file path' => drupal_get_path('module', 'nodereview'),
+        'access arguments' => array('administer reviews'),
+        'type' => MENU_LOCAL_TASK,
+      );
+
     }
+
   }
 
+   $items['node/%/reviews'] = array(
+     'title' => t('Reviews'),
+     'page callback' => 'views_page',
+     'page arguments' => array('review_list', 'page_1', 1),
+     'access callback' => 'read_reviews_access',
+     'access arguments' => array(1),
+     'file' => 'views.module',
+     'file path' => drupal_get_path('module', 'views'),
+     'type' => MENU_LOCAL_TASK,
+     'weight' => 2,
+   );
+
+  
+
+  $items['node/%node_add_review/addreview'] = array(
+    'title' => t('Add review'),
+    'page callback' => 'node_add',
+    'page arguments' => array('nodereview'),
+    'access callback' => 'addreview_access',
+    'access arguments' => array(1),
+    'type' => MENU_LOCAL_TASK,
+    'weight' => 3,
+  );
+
+  $items['node/%node_edit_review/editreview'] = array(
+    'title' => t('Edit your review'),
+    'page callback' => 'node_page_edit',
+    'page arguments' => array(1),
+    'access arguments' => array('edit own reviews'),
+    'type' => MENU_LOCAL_TASK,
+    'weight' => 3,
+  );
+
   return $items;
 }
 
+
+
+/**
+ * Implementation of hook_menu_alter()
+ *
+ */
+function nodereview_menu_alter(&$callbacks) {
+  // Hide the normal node-add page, since we never want users to see it
+  unset($callbacks['node/add/nodereview']);
+
+
+}
+
+
+
 /**
  * Implementation of hook_form_alter()
+ *
  */
-function nodereview_form_alter($form_id, &$form) {
-//   dpm($form_id);
+function nodereview_form_alter(&$form, $form_state, $form_id) {
 
-  if ('node_type_form' == $form_id) {
+  if ($form_id == 'node_type_form') {
+
+    // variable_set('nodereview_node_types', array());
     $node_type = $form['old_type']['#value'];
-    if ($node_type == 'nodereview') { // We don't use the normal submission guidelines anyway, so hide the form field for them.
+
+    // We don't use the normal submission guidelines anyway, so hide the form field for them.
+    if ($node_type == 'nodereview') {
       $form['submission']['help']['#type'] = 'value';
       $form['submission']['help']['#value'] = '';
     }
-    $form['workflow']['nodereview_use'] = array(  // The node type form automatically appends the node type to the variable name when saving
+
+    // The node type form automatically appends the node type to the variable name when saving
+    $form['workflow']['nodereview_use'] = array(
       '#type' => 'radios',
       '#title' => t('Enable user reviews'),
       '#default_value' => variable_get('nodereview_use_' . $node_type, 0),
@@ -224,48 +235,38 @@ function nodereview_form_alter($form_id,
 }
 
 
-/* ----- Menu callbacks ----- */
-
-/*
-function nodereview_add_review($reviewed_nid) {
-  //return node_add('nodereview');
+/**
+  * Implementation of hook_theme().
+  * We declare  nodereview_configure_axes so
+  * Drupal will look for a function
+  * named theme_nodereview_configure_axes().
+  */
+function nodereview_theme() {
+   return array(
+      'nodereview_configure_axes' => array(
+         'arguments' => array('form'),
+         'file' => 'nodereview.theme.inc',
+         'path' => drupal_get_path('module', 'nodereview'),
+      ),
+      'nodereview_review_body' => array(
+         'arguments' => array('review' => NULL, 'node' => NULL),
+         'file' => 'nodereview.theme.inc',
+         'path' => drupal_get_path('module', 'nodereview'),
+      ),
+      'nodereview_review_preview' => array(
+         'arguments' => array('review' => NULL, 'node' => NULL),
+         'file' => 'nodereview.theme.inc',
+         'path' => drupal_get_path('module', 'nodereview'),
+      ),
+      'nodereview_teaser' => array(
+         'arguments' => array('node' => NULL),
+         'file' => 'nodereview.theme.inc',
+         'path' => drupal_get_path('module', 'nodereview'),
+      ),
 
-  // Borrowed from node_add(), and modified as needed
-  global $user;
-  $node = array('uid' => $user->uid, 'name' => $user->name, 'type' => 'nodereview');
- 
-  $output = node_form($node);
-  drupal_set_title(t('Submit %name', array('%name' => node_get_name($node))));
-  
-  return $output;
+   );
 }
-*/
 
-/*
-function nodereview_edit_review() {
-
-  global $user;
-
-  // We'll want the title from the real node
-  $node = node_load(arg(1));
-
-  // This code ripped straight from node_page() and tweaked
-  if (is_numeric(arg(1))) {
-    $review_nid = db_result(db_query("SELECT n.nid FROM {node} n INNER JOIN {nodereview} nr ON n.nid=nr.nid WHERE uid=%d AND reviewed_nid=%d", $user->uid, arg(1)));
-    $review_node = node_load(array('nid'=>$review_nid));
-    if ($review_node->nid) {
-      drupal_set_title(check_plain($node->title));
-      return node_form($review_node);
-    }
-    else if (db_result(db_query('SELECT nid FROM {node} WHERE nid = %d', arg(1)))) {
-      drupal_access_denied();
-    }
-    else {
-      drupal_not_found();
-    }
-  }
-}
-*/
 
 function nodereview_view_reviews($nid) {
 
@@ -277,249 +278,96 @@ function nodereview_view_reviews($nid) {
 }
 
 
-/**
- * We use this function in place of hook_settings(), because hook_settings()
- * isn't fancy enough to support what we need to do.
- * 
- */
-function nodereview_configure($type = NULL) {
-
-  $form = array();
+function nodereview_list_axes($node_type) {
+  static $axes = array();
 
-  foreach(node_get_types() as $type => $info) {
-    $options[$type] = $info->name;
-    if (variable_get('nodereview_use_'. $type, 0)) {
-      $default[] = $type;
+  if (! isset($axes[$node_type])) {
+    $result = db_query("SELECT na.aid, na.tag FROM {nodereview_axes} na WHERE na.node_type='%s'", $node_type);
+    while ($record = db_fetch_object($result)) {
+      $axes[$node_type][$record->aid] = $record->tag;
     }
   }
-
-  $form['nodereview'] = array(
-    '#type' => 'fieldset',
-    '#title' => t('Review types'),
-    '#collapsible' => FALSE,
-    '#collapsed' => FALSE,
-  );
-  $form['nodereview']['types'] = array(
-    '#type' => 'checkboxes',
-    '#title' => t('Reviewable content types'),
-    '#default_value' => $default,
-    '#options' => $options,
-    '#description' => t('Specify which content types can be reviewed.'),
-  );
-
-  if (module_exists('fivestar')) {
-    $form['fivestar'] = array(
-      '#type' => 'fieldset',
-      '#title' => t('Fivestar options'),
-      '#collapsible' => FALSE,
-      '#collapsed' => FALSE,
-      '#tree' => TRUE,
-    );
-    $form['fivestar']['enable'] = array(
-      '#type' => 'checkbox',
-      '#title' => t('Use Fivestar for reviews'),
-      '#default_value' => variable_get('nodereview_fivestar_enable', 0),
-      '#description' => t('Enabling Fivestar for reviews will replace select list options with a JavaScript star display.'),
-    );
-    $form['fivestar']['stars'] = array(
-      '#type' => 'select',
-      '#title' => t('Number of stars'),
-      '#options' => drupal_map_assoc(range(1, 10)),
-      '#default_value' => variable_get('nodereview_fivestar_stars', 5),
-    );
-  }
-
-  $form['submit'] = array(
-    '#type' => 'submit', 
-    '#value' => t('Save'),
-  );
-
-  return $form;
-
-
-
+  return $axes[$node_type];
 }
 
 
-function nodereview_configure_submit($form_id, $form_values) {
-  foreach ($form_values['types'] as $type => $checked) {
-    variable_set('nodereview_use_'. $type, (bool)$checked);
-  }
-  foreach ($form_values['fivestar'] as $option => $value) {
-    variable_set('nodereview_fivestar_'. $option, $value);
-  }
+/**
+ * Implementation of hook_node_type()
+ *
+ * To clear the cache when a content type
+ * is modified and the changes to reflect
+ * in nodereview settings page
+ *
+ */
+function nodereview_node_type($op, $info) {
+  cache_clear_all();
+  menu_rebuild();
 }
 
 
-function nodereview_configure_axes($type) {
-
-  //drupal_set_title("review for '{$type}' nodes");
-  drupal_set_title(t('Reviews for %type nodes', array('%type' => check_plain($type))));
-
-  $form['use'] = array(
-      '#type' => 'fieldset',
-      '#title' => t('reviews'),
-      '#collapsible' => TRUE,
-      '#collapsed' => FALSE,
-  );
-  /*
-  $form['use']['use'] = array(
-    '#type' => 'checkbox',
-    '#title' => t('Enable reviews for this content type'),
-    '#return_value' => 1,
-    '#default_value' => variable_get('nodereview_use_'. $type, 0),
-    '#description' => t('Enable the reviewing of content of this type.  (If unchecked, the information below is ignored.)'),
-  );
-  */
-  $form['use']['node_type'] = array('#type' => 'hidden', '#value' => $type);
-  $form['use']['guide'] = array(
-    '#type' => 'textarea',
-    '#title' => t('Usage Guide to the User'),
-    '#return_value' => 1,
-    '#default_value' => variable_get('nodereview_guide_'. $type, ''),
-    '#description' => t('Instructions to users for how to use this review.  These will be shown on the "Add Review" page. Note that if you have help text defined on admin/settings/content-types/nodereview, this value will override it.'),
-  );
+/**
+ * Implementation of hook_views_api()
+ *
+ */
+function nodereview_views_api() {
 
-  $form['axes'] = array(
-    '#type' => 'fieldset',
-    '#title' => t('review axes'),
-    '#collapsible' => TRUE,
-    '#collapsed' => FALSE,
-    '#tree' => TRUE,
+  return array(
+    'api' => '2.0',
+    'path' =>drupal_get_path('module', 'nodereview'),
   );
-
-  // We'll store field information in its own table
-  $result = db_query("SELECT aid, tag, description, weight FROM {nodereview_axes} WHERE node_type='%s' ORDER BY weight", $type);
-  //$result = db_query("SELECT aid, tag, weight FROM {nodereview_axes} ORDER BY weight");
-
-  $axes = array();
-
-  while ($record = db_fetch_object($result)) {
-    $axes[] = _nodereview_configure_axis($record);
-  }
-
-  $record = new stdClass();
-  $record->aid = 0;
-  $record->node_type = $type;
-
-  $axes[] = _nodereview_configure_axis($record);
-
-  $form['axes'] += $axes;
-
-  $form['submit'] = array('#type' => 'submit', '#value' => t('Save'));
-
-  return $form;
-
 }
 
-function nodereview_configure_axes_submit($form_id, $form_values) {
 
-  // Save whether or not we're reviewing this node type
-//   variable_set('nodereview_use_' . $form_values['node_type'], $form_values['use']);
-  variable_set('nodereview_guide_'. $form_values['node_type'], $form_values['guide']);
-
-  // Regardless, save the user's data, just in case they may want it later
-  foreach ($form_values['axes'] as $axis) {
-    if ($axis['aid'] && $axis['use']) {
-      // Update an existing axis
-      $axis['description'] = check_plain($axis['description']);
-      db_query("UPDATE {nodereview_axes} SET tag='%s', description='%s', weight=%d WHERE aid=%d", $axis['tag'], $axis['description'], $axis['weight'], $axis['aid']);
-    }
-    elseif ($axis['aid'] && ! $axis['use']) {
-      // Delete an existing axis
-      db_query("DELETE FROM {nodereview_axes} WHERE aid=%d", $axis['aid']);
-    }
-    elseif ($axis['use'] && ! $axis['aid']) {
-      // Create a new axis
-      $axis['description'] = check_plain($axis['description']);
-      db_query("INSERT INTO {nodereview_axes} (node_type, tag, description, weight) VALUES ('%s', '%s', '%s', %d)", $form_values['node_type'], $axis['tag'], $axis['description'], $axis['weight']);
-    }
-    else {
-      // Doesn't exist and don't use, so just ignore
-    }
+/**
+ * Menu callback
+ * Returns TRUE if no review for the current node from current user
+ * Returns FALSE if review review for the current node from current user
+ */
+function node_add_review_load($arg) {
+  global $user;
+  $add_review = FALSE;
+  $current_node = node_load($arg);
+  $type =$current_node->type;
+  $axes_count = db_result(db_query("SELECT COUNT(*) FROM {nodereview_axes} WHERE node_type='%s'", $type));
+  if (variable_get('nodereview_use_' . $type, 0) && $axes_count) {
+    $add_review = db_result(db_query("SELECT n.nid FROM {node} n INNER JOIN {nodereview} nr ON n.nid=nr.nid WHERE uid=%d AND reviewed_nid=%d", $user->uid, $arg));
   }
+  return $add_review ? FALSE : $arg;
 }
 
 
-function _nodereview_configure_axis($record) {
-
-  $form['aid'] = array(
-    '#type' => 'hidden',
-    '#value' => $record->aid,
-  );
-  $form['use'] = array(
-    '#type' => 'checkbox',
-    '#title' => t('Use axis'),
-    '#return_value' => 1,
-    '#default_value' => (boolean)($record->aid),
-    '#description' => t(''),
-  );
-  $form['tag'] = array(
-    '#type' => 'textfield',
-    '#title' => t('name'),
-    '#return_value' => 1,
-    '#default_value' => $record->tag,
-    '#size' => 30,
-  );
-  $form['description'] = array(
-    '#type' => 'textarea',
-    '#title' => t('description'),
-    '#return_value' => 1,
-    '#default_value' => $record->description,
-    '#rows' => 2,
-  );
-  $form['weight'] = array(
-    '#type' => 'weight',
-    '#title' => t('weight'),
-    '#delta' => 10,
-    '#default_value' => $record->weight,
-    '#description' => t(''),
-  );
-
-  return $form;
-}
-
-
-function nodereview_list_axes($node_type) {
-  static $axes = array();
-
-  if (! isset($axes[$node_type])) {
-    $result = db_query("SELECT na.aid, na.tag FROM {nodereview_axes} na WHERE na.node_type='%s'", $node_type);
-    while ($record = db_fetch_object($result)) {
-      $axes[$node_type][$record->aid] = $record->tag;
-    }
+/**
+ * Menu callback
+ * Returns FALSE if no review for the current node from current user
+ * Returns review node object if review for the current node exists to alter the review
+ */
+function node_edit_review_load($arg) {
+  global $user;
+  $edit_review = FALSE;
+  $current_node = node_load($arg);
+  $type =$current_node->type;
+  $axes_count = db_result(db_query("SELECT COUNT(*) FROM {nodereview_axes} WHERE node_type='%s'", $type));
+  if (variable_get('nodereview_use_' . $type, 0) && $axes_count) {
+    $edit_review = db_result(db_query("SELECT n.nid FROM {node} n INNER JOIN {nodereview} nr ON n.nid=nr.nid WHERE uid=%d AND reviewed_nid=%d", $user->uid, $arg));
   }
-  return $axes[$node_type];
+  return $edit_review ? node_load($edit_review) : FALSE;
 }
 
-
-function theme_nodereview_configure_axes($form) {
-  
-  $rows = array();
-  $output = '';
-  
-//   $output .= form_render($form['use']);
-  
-  foreach (element_children($form['axes']) as $key) {
-    $row = array();
-    // Strip out the labels on each form element, since they're redundant with the header
-    $form['axes'][$key]['use']['#title'] = '';
-    $form['axes'][$key]['tag']['#title'] = '';
-    $form['axes'][$key]['description']['#title'] = '';
-    $form['axes'][$key]['weight']['#title'] = '';
-
-    $row[] = drupal_render($form['axes'][$key]['aid']) . drupal_render($form['axes'][$key]['use']);
-    $row[] = drupal_render($form['axes'][$key]['tag']);
-    $row[] = drupal_render($form['axes'][$key]['description']);
-    $row[] = drupal_render($form['axes'][$key]['weight']);
-    $rows[] = $row;
-  }
- 
-  $header = array('use', 'name', 'description', 'weight');
-  // This is how we get the table to be "inside" the fieldset
-  $form['axes']['#children'] = theme('table', $header, $rows);
-  $output .= drupal_render($form);
-  return $output;
- 
+/**
+ * Custom access menucallback for add review
+ */
+function addreview_access($arg) {
+  $current_node = node_load($arg);
+  $type =$current_node->type;
+  $axes_count = db_result(db_query("SELECT COUNT(*) FROM {nodereview_axes} WHERE node_type='%s'", $type));
+  return variable_get('nodereview_use_' . $type, 0) && $axes_count && user_access('submit reviews');
 }
 
+/**
+ * Custom access menucallback for read review
+ */
+function read_reviews_access($arg) {
+  $current_node = node_load($arg);
+  $type =$current_node->type;
+  return variable_get('nodereview_use_' . $type, 0) && user_access('read reviews');
+}
diff -Nup nodereview5/nodereview.module~ nodereview/nodereview.module~
--- nodereview5/nodereview.module~	1969-12-31 19:00:00.000000000 -0500
+++ nodereview/nodereview.module~	2009-02-24 19:23:20.000000000 -0500
@@ -0,0 +1,375 @@
+<?php
+// $Id$
+
+define('NODEREVIEW_FIVESTAR_ENABLE', module_exists('fivestar') && variable_get('nodereview_fivestar_enable', 0));
+
+
+if(!function_exists("node_object_prepare")) {
+  include_once(drupal_get_path('module', 'node') . '/node.pages.inc');
+ }
+
+ require_once(drupal_get_path('module', 'nodereview') . '/nodereview_node_nodereview.inc');
+
+
+
+/**
+ * @file
+ * This module adds user reviews to specified node types, on multiple axes and with
+ * voting via the Voting API module (required).  It uses the Views module
+ * (required) for some displays.
+ *
+ */
+
+
+/**
+ * Implementation of hook_help().
+ *
+ */
+function nodereview_help($path, $arg) {
+
+  // We want to show custom help text on both the add and edit pages, which
+  // have very different path structures
+  if ('node' == arg(0)) {
+    if ('addreview' == arg(2)) {
+      $reviewed_nid = arg(1);
+      $reviewed_node = node_load($reviewed_nid);
+      $help_text = filter_xss_admin(variable_get('nodereview_guide_'. $reviewed_node->type, ''));
+      if ($help_text) return $help_text;
+    }
+    elseif ('edit' == arg(2)) {
+      // Get the type of the node we're reviewing, which is not the nid in the path
+      $type = db_result(db_query("SELECT n.type
+        FROM {node} n
+          INNER JOIN {nodereview} nr ON n.nid=nr.reviewed_nid
+        WHERE nr.nid=%d", arg(1)));
+
+      $help_text = filter_xss_admin(variable_get('nodereview_guide_'. $type, ''));
+      if ($help_text) return $help_text;
+    }
+  }
+}
+
+/**
+ * Implementation of hook_node_info().
+ *
+ */
+
+function nodereview_node_info() {
+  return array(
+    'nodereview' => array(
+      'name' => t('Review'),
+      'module' => 'nodereview',
+      'description' => 'A review is a user-supplied critique of another node.',
+      'has_title' => TRUE,
+      'title_label' => t('Short comment'),
+      'has_body' => FALSE,
+    )
+  );
+}
+
+
+/**
+ * Implementation of hook_perm().
+ *
+ */
+function nodereview_perm() {
+  return array(
+    'administer reviews',
+    'read reviews',
+    'submit reviews',
+    'edit own reviews'
+  );
+}
+
+/**
+ * Implementation of hook_link().
+ *
+ */
+function nodereview_link($type, $node = NULL, $teaser = FALSE) {
+  $links = array();
+  global $user;
+
+  if ($type == 'node' && $node->type == 'nodereview') {
+
+    // Add a link back to the node being reviewed by this node
+    $reviewed_type = node_get_types('type', db_result(db_query("SELECT type FROM {node} WHERE nid=%d", $node->reviewed_nid)));
+    $reviewed_type = $reviewed_type->name;
+
+    $links['nodereview_reviewed_node'] = array(
+    'title' => t('View @type', array('@type' => $reviewed_type)),
+    'href' => "node/{$node->reviewed_nid}",
+    'attributes' => array('title' => t('View the @type being reviewed', array('@type' => $reviewed_type))),
+   );
+  }
+
+  return $links;
+}
+
+/**
+ * Implementation of hook_menu().
+ *
+ */
+function nodereview_menu() {
+  $items = array();
+  global $user;
+
+  $items['admin/content/nodereview'] = array(
+    'title' => t('Review types'),
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('nodereview_configure'),
+    'file' => 'nodereview.admin.inc',
+    'file path' => drupal_get_path('module', 'nodereview'),
+    'access arguments' => array('administer reviews'),
+    'description' => t('Configure the axes for node type review'),
+    );
+
+  $items['admin/content/nodereview/types'] = array(
+    'title' => t('List'),
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('nodereview_configure'),
+    'file' => 'nodereview.admin.inc',
+    'file path' => drupal_get_path('module', 'nodereview'),
+    'access arguments' => array('administer reviews'),
+    'type' => MENU_DEFAULT_LOCAL_TASK,
+    'weight' => -1,
+    );
+
+
+  // Add a tab for each node type that we can review
+  // It's slow to put this here, as it should go in
+
+  foreach(node_get_types() as $type => $info) {
+    if(variable_get('nodereview_use_'. $type, 0)) {
+      $items['admin/content/nodereview/' . $type] = array(
+        'title callback' => 'check_plain',
+        'title arguments' => array($info->name),
+        'page callback' => 'drupal_get_form',
+        'page arguments' => array('nodereview_configure_axes', $type, $info->name),
+        'file' => 'nodereview.admin.inc',
+        'file path' => drupal_get_path('module', 'nodereview'),
+        'access arguments' => array('administer reviews'),
+        'type' => MENU_LOCAL_TASK,
+      );
+
+    }
+
+  }
+
+   $items['node/%/reviews'] = array(
+     'title' => t('Reviews'),
+     'page callback' => 'views_page',
+     'page arguments' => array('review_list', 'page_1', 1),
+     'access callback' => 'read_reviews_access',
+     'access arguments' => array(1),
+     'file' => 'views.module',
+     'file path' => drupal_get_path('module', 'views'),
+     'type' => MENU_LOCAL_TASK,
+     'weight' => 2,
+   );
+
+  
+
+  $items['node/%node_add_review/addreview'] = array(
+    'title' => t('Add review'),
+    'page callback' => 'node_add',
+    'page arguments' => array('nodereview'),
+    'access callback' => 'addreview_access',
+    'access arguments' => array(1),
+    'type' => MENU_LOCAL_TASK,
+    'weight' => 3,
+  );
+
+  $items['node/%node_edit_review/editreview'] = array(
+    'title' => t('Edit your review'),
+    'page callback' => 'node_page_edit',
+    'page arguments' => array(1),
+    'access arguments' => array('edit own reviews'),
+    'type' => MENU_LOCAL_TASK,
+    'weight' => 3,
+  );
+
+  return $items;
+}
+
+
+
+/**
+ * Implementation of hook_menu_alter()
+ *
+ */
+function nodereview_menu_alter(&$callbacks) {
+  //    Logger::debug_var('callbacks', $callbacks);
+  // Hide the normal node-add page, since we never want users to see it
+  unset($callbacks['node/add/nodereview']);
+
+
+}
+
+
+
+/**
+ * Implementation of hook_form_alter()
+ *
+ */
+function nodereview_form_alter(&$form, $form_state, $form_id) {
+
+  if ($form_id == 'node_type_form') {
+
+    // variable_set('nodereview_node_types', array());
+    $node_type = $form['old_type']['#value'];
+
+    // We don't use the normal submission guidelines anyway, so hide the form field for them.
+    if ($node_type == 'nodereview') {
+      $form['submission']['help']['#type'] = 'value';
+      $form['submission']['help']['#value'] = '';
+    }
+
+    // The node type form automatically appends the node type to the variable name when saving
+    $form['workflow']['nodereview_use'] = array(
+      '#type' => 'radios',
+      '#title' => t('Enable user reviews'),
+      '#default_value' => variable_get('nodereview_use_' . $node_type, 0),
+      '#options' => array(0 => t('Disabled'), 1 => t('Enabled')),
+      '#description' => t('You can configure axes for reviewable nodes on the <a href="!url">reviews page</a>.', array('!url' => url('admin/content/nodereview'))),
+    );
+  }
+}
+
+
+/**
+  * Implementation of hook_theme().
+  * We declare  nodereview_configure_axes so
+  * Drupal will look for a function
+  * named theme_nodereview_configure_axes().
+  */
+function nodereview_theme() {
+   return array(
+      'nodereview_configure_axes' => array(
+         'arguments' => array('form'),
+         'file' => 'nodereview.theme.inc',
+         'path' => drupal_get_path('module', 'nodereview'),
+      ),
+      'nodereview_review_body' => array(
+         'arguments' => array('review' => NULL, 'node' => NULL),
+         'file' => 'nodereview.theme.inc',
+         'path' => drupal_get_path('module', 'nodereview'),
+      ),
+      'nodereview_review_preview' => array(
+         'arguments' => array('review' => NULL, 'node' => NULL),
+         'file' => 'nodereview.theme.inc',
+         'path' => drupal_get_path('module', 'nodereview'),
+      ),
+      'nodereview_teaser' => array(
+         'arguments' => array('node' => NULL),
+         'file' => 'nodereview.theme.inc',
+         'path' => drupal_get_path('module', 'nodereview'),
+      ),
+
+   );
+}
+
+
+function nodereview_view_reviews($nid) {
+
+  $output = 'test ' . $nid;
+
+  drupal_set_title('Reviews');
+
+  return $output;
+}
+
+
+function nodereview_list_axes($node_type) {
+  static $axes = array();
+
+  if (! isset($axes[$node_type])) {
+    $result = db_query("SELECT na.aid, na.tag FROM {nodereview_axes} na WHERE na.node_type='%s'", $node_type);
+    while ($record = db_fetch_object($result)) {
+      $axes[$node_type][$record->aid] = $record->tag;
+    }
+  }
+  return $axes[$node_type];
+}
+
+
+/**
+ * Implementation of hook_node_type()
+ *
+ * To clear the cache when a content type
+ * is modified and the changes to reflect
+ * in nodereview settings page
+ *
+ */
+function nodereview_node_type($op, $info) {
+  cache_clear_all();
+  menu_rebuild();
+}
+
+
+/**
+ * Implementation of hook_views_api()
+ *
+ */
+function nodereview_views_api() {
+
+  return array(
+    'api' => '2.0',
+    'path' =>drupal_get_path('module', 'nodereview'),
+  );
+}
+
+
+/**
+ * Menu callback
+ * Returns TRUE if no review for the current node from current user
+ * Returns FALSE if review review for the current node from current user
+ */
+function node_add_review_load($arg) {
+  global $user;
+  $add_review = FALSE;
+  $current_node = node_load($arg);
+  $type =$current_node->type;
+  $axes_count = db_result(db_query("SELECT COUNT(*) FROM {nodereview_axes} WHERE node_type='%s'", $type));
+  if (variable_get('nodereview_use_' . $type, 0) && $axes_count) {
+    $add_review = db_result(db_query("SELECT n.nid FROM {node} n INNER JOIN {nodereview} nr ON n.nid=nr.nid WHERE uid=%d AND reviewed_nid=%d", $user->uid, $arg));
+  }
+  return $add_review ? FALSE : $arg;
+}
+
+
+/**
+ * Menu callback
+ * Returns FALSE if no review for the current node from current user
+ * Returns review node object if review for the current node exists to alter the review
+ */
+function node_edit_review_load($arg) {
+  global $user;
+  $edit_review = FALSE;
+  $current_node = node_load($arg);
+  $type =$current_node->type;
+  $axes_count = db_result(db_query("SELECT COUNT(*) FROM {nodereview_axes} WHERE node_type='%s'", $type));
+  if (variable_get('nodereview_use_' . $type, 0) && $axes_count) {
+    $edit_review = db_result(db_query("SELECT n.nid FROM {node} n INNER JOIN {nodereview} nr ON n.nid=nr.nid WHERE uid=%d AND reviewed_nid=%d", $user->uid, $arg));
+  }
+  return $edit_review ? node_load($edit_review) : FALSE;
+}
+
+/**
+ * Custom access menucallback for add review
+ */
+function addreview_access($arg) {
+  $current_node = node_load($arg);
+  $type =$current_node->type;
+  $axes_count = db_result(db_query("SELECT COUNT(*) FROM {nodereview_axes} WHERE node_type='%s'", $type));
+  return variable_get('nodereview_use_' . $type, 0) && $axes_count && user_access('submit reviews');
+}
+
+/**
+ * Custom access menucallback for read review
+ */
+function read_reviews_access($arg) {
+  Logger::debug_var('arg', $arg);
+  $current_node = node_load($arg);
+  $type =$current_node->type;
+  return variable_get('nodereview_use_' . $type, 0) && user_access('read reviews');
+}
diff -Nup nodereview5/nodereview_node_nodereview.inc nodereview/nodereview_node_nodereview.inc
--- nodereview5/nodereview_node_nodereview.inc	2008-05-15 13:27:14.000000000 -0400
+++ nodereview/nodereview_node_nodereview.inc	2009-02-24 19:23:22.000000000 -0500
@@ -1,366 +1,306 @@
-<?php
-// $Id: nodereview_node_nodereview.inc,v 1.6.2.3 2008/05/15 17:27:14 johnforsythe Exp $
-
-/* ----- Node hooks ----- */
-
-/**
- * Implementation of hook_access().
- *
- */
-function nodereview_access($op, $node) {
-  global $user;
-
-  if ($op == 'create') {
-    // Only users with permission to do so may create this node type.
-    return user_access('submit reviews');
-
-  }
-
-  // Users who create a node may edit or delete it later, assuming they have the
-  // necessary permissions.
-  if ($op == 'update' || $op == 'delete') {
-    if (user_access('administer reviews') || (user_access('edit own reviews') && ($user->uid == $node->uid))) {
-      return TRUE;
-    }
-  }
-
-  if ($op == 'view') {
-    return user_access('read reviews');
-  }
-}
-
-
-/**
- * Implementation of hook_form().
- *
- */
-function nodereview_form(&$node) {
-
-  // This is for the LOCAL_TASK version, node/nid/addreview
-  if (! $node->reviewed_nid) $node->reviewed_nid = arg(1);
-
-  $node_info = node_get_types('type', 'nodereview');
-
-  $form['reviewed_nid'] = array(
-    '#type' => 'hidden',
-    '#value' => $node->reviewed_nid,
-  );
-
-  $form['title'] = array(
-    '#type' => 'textfield',
-    '#title' => t($node_info->title_label),
-    '#default_value' => $node->title,
-    '#required' => TRUE
-  );
-
-  $reviewed_node = node_load(array('nid'=>$node->reviewed_nid));
-
-  $votes = array();
-  $votes_obj = votingapi_get_user_votes('node', $node->reviewed_nid, $node->uid);
-  foreach ($votes_obj as $vote) {
-    $votes[$vote->tag] = $vote->value;
-  }
-
-  $form['reviews']['#tree'] = TRUE;
-  $form['reviews']['#weight'] = 0;
-
-  $result = db_query("SELECT * FROM {nodereview_axes} WHERE node_type ='%s' ORDER BY weight, tag", $reviewed_node->type);
-
-  while ($record = db_fetch_object($result)) {
-    _nodereview_form_review($form, $record, $node->reviews, $votes);
-  }
-
-  // We'll use a single filter format for all textareas on the page
-  $form['filter'] = filter_form($node->format);
-
-  return $form;
-}
-
-/**
- * Add the review axis to the node edit form
- * 
- * @param $form
- *  The form object for the node edit form
- * @param $axis
- *  An object representing the axis for which to display the form component
- * @param $reviews
- *  An array of review objects from this node
- * @param $votes
- *  An array of votes (scores) for this review, keyed by axis name
- */
-function _nodereview_form_review(&$form, $axis, $reviews, $votes) {
-  
-  static $options;
-  if (!isset($options)) {
-    $options = array(
-      10 => 1,
-      20 => 2,
-      30 => 3,
-      40 => 4,
-      50 => 5,
-      60 => 6,
-      70 => 7, 
-      80 => 8,
-      90 => 9,
-      100 => 10,
-    );
-  }
-  $form['reviews'][$axis->aid] = array(
-    '#type' => 'fieldset',
-    '#title' => $axis->tag,
-    '#collapsible' => TRUE,
-    '#collapsed' => FALSE,
-  ); 
-  $form['reviews'][$axis->aid]['score'] = array(
-    '#type' => 'select',
-    '#title' => t('Score'),
-    '#options' => $options,
-    '#default_value' => $votes[$axis->tag] ? $votes[$axis->tag] : 50,
-    '#description' => $axis->description,
-    '#required' => TRUE,
-  );
-
-  if (NODEREVIEW_FIVESTAR_ENABLE) {
-    $form['reviews'][$axis->aid]['score']['#type'] = 'fivestar';
-    $form['reviews'][$axis->aid]['score']['#stars'] = variable_get('nodereview_fivestar_stars', 5);
-  }
-
-  $form['reviews'][$axis->aid]['review'] = array(
-    '#type' => 'textarea',
-    '#title' => t('Review'),
-    '#default_value' => $reviews[$axis->aid]->review,
-    '#required' => TRUE,
-  );
- 
-}
-
-
-/**
- * Implementation of hook_validate().
- *
- */
-function nodereview_validate(&$node) {
-
-  if (! $node->reviewed_nid || ! db_result(db_query("SELECT Count(*) FROM {node} WHERE nid=%d", $node->reviewed_nid))) {
-    // There is no such node, so error
-    form_set_error('reviewed_nid', t('The node you are trying to review does not exist.'));
-  }
-  foreach ($node->reviews as $aid => $review) {
-    if (! $review['score']) {
-      form_set_error('', t('You must enter a score for every axis.'));
-    }
-    if (! $review['review']) {
-      form_set_error('', t('You must enter a review for every axis.'));
-    }
-  }
-}
-
-/**
- * Implementation of hook_load().
- *
- */
-function nodereview_load($node) {
-
-  // Get the basic information from the nodereview node table
-  $additions = db_fetch_object(db_query('SELECT reviewed_nid FROM {nodereview} WHERE nid = %d', $node->nid));
-
-  // And now get the actual review info.  The numeric scores are stored with voteapi,
-  // while textual reviews are in our own auxiliary table.  We need to merge them properly
-
-  $votes_obj = votingapi_get_user_votes('node', $additions->reviewed_nid, $node->uid);
-  $votes = array();
-  foreach ($votes_obj as $vote) {
-    $votes[$vote->tag] = $vote;
-  }
-
-  $additions->reviews = array();
-  $result = db_query('SELECT nr.aid, tag, review FROM {nodereview_reviews} nr INNER JOIN {nodereview_axes} na ON nr.aid=na.aid WHERE nid = %d ORDER BY na.weight, na.tag', $node->nid);
-  while ($record = db_fetch_object($result)) {
-    // Add in the numeric scores
-    $record->score = $votes[$record->tag]->value;
-    $additions->reviews[$record->aid] = $record;
-  }
-
-  return $additions;
-}
-
-
-/**
- * Implementation of hook_insert().
- *
- */
-function nodereview_insert($node) {
-
-  db_query("INSERT INTO {nodereview} (nid, reviewed_nid) VALUES (%d, %d)", $node->nid, $node->reviewed_nid);
-
-  nodereview_save_reviews($node);
-}
-
-/**
- * Implementation of hook_update().
- *
- */
-function nodereview_update($node) {
-  db_query("UPDATE {nodereview} SET reviewed_nid=%d WHERE nid = %d", $node->reviewed_nid, $node->nid);
-
-  // Delete and rebuild the textual reviews, but the votingapi takes care of overwriting old values
-  db_query("DELETE FROM {nodereview_reviews} WHERE nid=%d", $node->nid);
-  nodereview_save_reviews($node);
-}
-
-function nodereview_save_reviews($node) {
-  global $user;
-
-  $votes = array();
-
-  /*
-  $result = db_query("SELECT na.aid, na.tag
-                        FROM {nodereview_axes} na
-                          INNER JOIN {node} n ON na.node_type=n.type
-                        WHERE n.nid=%d", $node->reviewed_nid);
-  while ($record = db_fetch_object($result)) {
-    $axes[$record->aid] = $record->tag;
-  }
-  */
-
-  $axes = nodereview_list_axes(db_result(db_query("SELECT type FROM {node} WHERE nid=%d", $node->reviewed_nid)));
-
-  foreach ($node->reviews as $aid => $review) {
-    // Save the text review
-    db_query("INSERT INTO {nodereview_reviews} (nid, aid, review) VALUES (%d, %d, '%s')", $node->nid, $aid, $review['review']);
-
-    // And use the votingapi to save the score
-    $votes[] = (object)array('value'=>$review['score'], 'tag'=>$axes[$aid]);
-  }
-
-  votingapi_set_vote('node', $node->reviewed_nid, $votes, $node->uid);
-}
-
-/**
- * Implementation of hook_delete().
- *
- */
-function nodereview_delete($node) {
-  db_query('DELETE FROM {nodereview} WHERE nid = %d', $node->nid);
-  db_query('DELETE FROM {nodereview_reviews} WHERE nid=%d', $node->nid);
-
-  // Delete the votes in the votingapi associated with this node
-  votingapi_delete_votes(votingapi_get_user_votes('node', $node->reviewed_nid, $node->uid));
-  votingapi_recalculate_results('node', $node->reviewed_nid);
-}
-
-
-/**
- * Implementation of hook_view().
- *
- */
-function nodereview_view($node, $teaser = FALSE, $page = FALSE) {
-  //$node = node_prepare($node, $teaser);
-
-  $aids = array_keys($node->reviews);
-  $num_aids = sizeof($aids);
-
-  // Previews are just plain ugly, because the $node object is not really a node
-  // but a mutated $_POST.  It has to be handled completely differently.
-  if ($node->in_preview) {
-
-    // We have to load in our axis data, which the $_POST doesn't have but we need
-    $result = db_query("SELECT tag, aid 
-      FROM {nodereview_axes} na 
-        INNER JOIN {node} n ON na.node_type=n.type
-      WHERE n.nid=%d", $node->reviewed_nid);
-    while ($record = db_fetch_array($result)) {
-      $node->reviews[$record['aid']]['tag'] = $record['tag'];
-    }
-
-    foreach ($node->reviews as $review) {
-      $node->content['reviews'][$review['tag']] = array(
-        '#value' => theme('nodereview_review_preview', $review, $node),
-      );
-    }
-    return $node;
-  }
-  else {
-    $node = node_prepare($node, $teaser);
-
-    // Do a markup check on the fields
-    for ($i=0; $i < $num_aids; $i++) {
-      $node->reviews[$aids[$i]]->review = check_markup($node->reviews[$aids[$i]]->review);
-    }
-
-    if ($teaser) {
-      $node->content['reviews'] = array(
-          '#value' => theme('nodereview_teaser', $node),
-        );
-    }
-
-    if ($page) {
-      foreach ($node->reviews as $review) {
-        $node->content['reviews'][$review->tag] = array(
-          '#value' => theme('nodereview_review_body', $review, $node),
-        );
-      }
-    }
-
-    return $node;
-  }
-}
-
-/* ----- Theme functions ----- */
-
-function theme_nodereview_review_body($review, $node) {
-  $output = '';
-
-  $title = $review->tag;
-  if (NODEREVIEW_FIVESTAR_ENABLE) {
-    $output = theme('fivestar_static', $review->score, variable_get('nodereview_fivestar_stars', 5));
-  }
-  else {
-    $title .= ': ' . $review->score/10 . '/10';
-  }
-  $output = theme('box', $title, $output . $review->review);
-
-  return $output;
-}
-
-function theme_nodereview_review_preview($review, $node) {
-  $output = '';
-
-  $title = $review['tag'];
-  if (NODEREVIEW_FIVESTAR_ENABLE) {
-    $output = theme('fivestar_static', $review['score']);
-  }
-  else {
-    $title .= ': ' . $review['score']/10 . '/10';
-  }
-  $output = theme('box', $title, $output . check_markup($review['review'], $node->format));
-
-  return $output;
-}
-
-function theme_nodereview_teaser($node) {
-  $output = '';
-  static $header;
-
-  // Presumably teaser will be called multiple times on different nodes
-  // on the same page, so static cache the static strings
-  if (!isset($header)) {
-    $header = array(t('axis'), t('score'), t('review'));
-  }
-
-  foreach ($node->reviews as $review) {
-    $row = array();
-    $row[] = $review->tag;
-    if (NODEREVIEW_FIVESTAR_ENABLE) {
-      $row[] = theme('fivestar_static', $review->score, variable_get('nodereview_fivestar_stars', 5));
-    }
-    else {
-      $row[] = $review->score/10 . '/10';
-    }
-    $row[] = truncate_utf8($review->review, 50, TRUE, TRUE);
-    $rows[] = $row;
-  }
-
-  $output = theme('table', $header, $rows, array('class'=>'review-teaser'));
-  return $output;
-}
+<?php
+// $Id$
+
+/**
+ * @file
+ * Used to build the nodereview content type form
+ *
+ */
+
+
+/**
+ * Implementation of hook_access().
+ *
+ */
+function nodereview_access($op, $node) {
+  global $user;
+
+  if ($op == 'create') {
+    // Only users with permission to do so may create this node type.
+    return user_access('submit reviews');
+
+  }
+
+  // Users who create a node may edit or delete it later, assuming they have the
+  // necessary permissions.
+  if ($op == 'update' || $op == 'delete') {
+    if (user_access('administer reviews') || (user_access('edit own reviews') && ($user->uid == $node->uid))) {
+      return TRUE;
+    }
+  }
+
+  if ($op == 'view') {
+    return user_access('read reviews');
+  }
+}
+
+
+/**
+ * Implementation of hook_form().
+ *
+ */
+function nodereview_form(&$node) {
+
+  // This is for the LOCAL_TASK version, node/nid/addreview
+  if (!$node->reviewed_nid) {
+    $node->reviewed_nid = arg(1);
+  }
+  $node_info = node_get_types('type', 'nodereview');
+
+  $form['reviewed_nid'] = array(
+    '#type' => 'hidden',
+    '#value' => $node->reviewed_nid,
+  );
+
+  $form['title'] = array(
+    '#type' => 'textfield',
+    '#title' => t($node_info->title_label),
+    '#default_value' => $node->title,
+    '#required' => TRUE
+  );
+
+  $reviewed_node = node_load(array('nid'=>$node->reviewed_nid));
+
+  $form['reviews']['#tree'] = TRUE;
+  $form['reviews']['#weight'] = 0;
+
+  $result = db_query("SELECT * FROM {nodereview_axes} WHERE node_type ='%s' ORDER BY weight, tag", $reviewed_node->type);
+
+  while ($record = db_fetch_object($result)) {
+    _nodereview_form_review($form, $record, $node);
+  }
+
+  // We'll use a single filter format for all textareas on the page
+  $form['filter'] = filter_form($node->format);
+
+  return $form;
+}
+
+/**
+ * Add the review axis to the node edit form
+ *
+ * @param $form
+ *  The form object for the node edit form
+ * @param $axis
+ *  An object representing the axis for which to display the form component
+ * @param $reviews
+ *  An array of review objects from this node
+ * @param $votes
+ *  An array of votes (scores) for this review, keyed by axis name
+ */
+//function _nodereview_form_review(&$form, $axis, $reviews, $votes) {
+function _nodereview_form_review(&$form, $axis, $node) {
+  static $options;
+  if (!isset($options)) {
+    $options = array(
+      10 => 1,
+      20 => 2,
+      30 => 3,
+      40 => 4,
+      50 => 5,
+      60 => 6,
+      70 => 7,
+      80 => 8,
+      90 => 9,
+      100 => 10,
+    );
+  }
+  $form['reviews'][$axis->aid] = array(
+    '#type' => 'fieldset',
+    '#title' => $axis->tag,
+    '#collapsible' => TRUE,
+    '#collapsed' => FALSE,
+  );
+
+  $form['reviews'][$axis->aid]['score'] = array(
+    '#type' => 'select',
+    '#title' => t('Score'),
+    '#options' => $options,
+    '#default_value' => $node->reviews[$axis->aid]['score'] ? $node->reviews[$axis->aid]['score'] : 50,
+    '#description' => $axis->description,
+    '#required' => TRUE,
+  );
+
+  if (NODEREVIEW_FIVESTAR_ENABLE) {
+    $form['reviews'][$axis->aid]['score']['#type'] = 'fivestar';
+    $form['reviews'][$axis->aid]['score']['#stars'] = variable_get('nodereview_fivestar_stars', 5);
+  }
+
+  $form['reviews'][$axis->aid]['review'] = array(
+    '#type' => 'textarea',
+    '#title' => t('Review'),
+    '#default_value' => $node->reviews[$axis->aid]['review'],
+    '#required' => TRUE,
+  );
+}
+
+
+/**
+ * Implementation of hook_validate().
+ *
+ */
+function nodereview_validate(&$node) {
+  if (! $node->reviewed_nid || ! db_result(db_query("SELECT Count(*) FROM {node} WHERE nid=%d", $node->reviewed_nid))) {
+    // There is no such node, so error
+    form_set_error('reviewed_nid', t('The node you are trying to review does not exist.'));
+  }
+  foreach ($node->reviews as $aid => $review) {
+    if (! $review['score']) {
+      form_set_error('', t('You must enter a score for every axis.'));
+    }
+    if (! $review['review']) {
+      form_set_error('', t('You must enter a review for every axis.'));
+    }
+  }
+}
+
+/**
+ * Implementation of hook_load().
+ *
+ */
+function nodereview_load($node) {
+  // Get the basic information from the nodereview node table
+  $additions = db_fetch_object(db_query('SELECT reviewed_nid FROM {nodereview} WHERE nid = %d', $node->nid));
+  // And now get the actual review info.  The numeric scores are stored with voteapi,
+  // while textual reviews are in our own auxiliary table.  We need to merge them properly
+
+  $criteria = array(
+    'content_type' => 'node',
+    'content_id' => $additions->reviewed_nid,
+    'uid' => $node->uid,
+  );
+
+  $votes_obj = votingapi_select_votes($criteria);
+
+
+  //  $votes_obj = votingapi_get_user_votes('node', $additions->reviewed_nid, $node->uid);
+  $votes = array();
+  foreach ($votes_obj as $vote) {
+    $votes[$vote['tag']] = $vote;
+  }
+
+
+  $additions->reviews = array();
+  $result = db_query('SELECT nr.aid, tag, review FROM {nodereview_reviews} nr INNER JOIN {nodereview_axes} na ON nr.aid=na.aid WHERE nid = %d ORDER BY na.weight, na.tag', $node->nid);
+  while ($record = db_fetch_object($result)) {
+    // Add in the numeric scores
+    $record->score = $votes[$record->tag]['value'];
+    $additions->reviews[$record->aid] = (array)$record;
+  }
+  return $additions;
+}
+
+
+/**
+ * Implementation of hook_insert().
+ *
+ */
+function nodereview_insert($node) {
+  db_query("INSERT INTO {nodereview} (nid, reviewed_nid) VALUES (%d, %d)", $node->nid, $node->reviewed_nid);
+  nodereview_save_reviews($node);
+}
+
+/**
+ * Implementation of hook_update().
+ *
+ */
+function nodereview_update($node) {
+  db_query("UPDATE {nodereview} SET reviewed_nid=%d WHERE nid = %d", $node->reviewed_nid, $node->nid);
+
+  // Delete and rebuild the textual reviews, but the votingapi takes care of overwriting old values
+  db_query("DELETE FROM {nodereview_reviews} WHERE nid=%d", $node->nid);
+  nodereview_save_reviews($node);
+}
+
+function nodereview_save_reviews($node) {
+  global $user;
+
+  $votes = array();
+
+  $axes = nodereview_list_axes(db_result(db_query("SELECT type FROM {node} WHERE nid=%d", $node->reviewed_nid)));
+  foreach ($node->reviews as $aid => $review) {
+    // Save the text review
+    db_query("INSERT INTO {nodereview_reviews} (nid, aid, review) VALUES (%d, %d, '%s')", $node->nid, $aid, $review['review']);
+
+    // And use the votingapi to save the score
+    $votes[] = array('value'=>$review['score'], 'tag'=>$axes[$aid], 'content_type' => 'node', 'content_id' => $node->reviewed_nid);
+
+  }
+  //  votingapi_set_vote('node', $node->reviewed_nid, $votes, $node->uid);
+  votingapi_set_votes($votes);
+}
+
+/**
+ * Implementation of hook_delete().
+ *
+ */
+function nodereview_delete($node) {
+  db_query('DELETE FROM {nodereview} WHERE nid = %d', $node->nid);
+  db_query('DELETE FROM {nodereview_reviews} WHERE nid=%d', $node->nid);
+
+
+ $criteria = array(
+    'content_type' => 'node',
+    'content_id' => $node->reviewed_nid,
+    'uid' => $node->uid,
+  );
+
+  $vote_obj = votingapi_select_votes($criteria);
+  // Delete the votes in the votingapi associated with this node
+  votingapi_delete_votes($vote_obj);
+  votingapi_recalculate_results('node', $node->reviewed_nid);
+}
+
+
+/**
+ * Implementation of hook_view().
+ *
+ */
+function nodereview_view($node, $teaser = FALSE, $page = FALSE) {
+  //$node = node_prepare($node, $teaser);
+  $aids = array_keys($node->reviews);
+  $num_aids = sizeof($aids);
+  // Previews are just plain ugly, because the $node object is not really a node
+  // but a mutated $_POST.  It has to be handled completely differently.
+
+  if ($node->op == 'Preview') {
+    // We have to load in our axis data, which the $_POST doesn't have but we need
+    $result = db_query("SELECT tag, aid
+                        FROM {nodereview_axes} na
+                        INNER JOIN {node} n ON na.node_type=n.type
+                        WHERE n.nid=%d", $node->reviewed_nid);
+    while ($record = db_fetch_array($result)) {
+      $node->reviews[$record['aid']]['tag'] = $record['tag'];
+    }
+
+    foreach ($node->reviews as $review) {
+      $node->content['reviews'][$review['tag']] = array(
+        '#value' => theme('nodereview_review_preview', $review, $node),
+      );
+    }
+    return $node;
+  }
+  else {
+    $node = node_prepare($node, $teaser);
+
+    // Do a markup check on the fields
+    for ($i=0; $i < $num_aids; $i++) {
+      $node->reviews[$aids[$i]]['review'] = check_markup($node->reviews[$aids[$i]]['review']);
+    }
+    if ($teaser) {
+      $node->content['reviews'] = array(
+          '#value' => theme('nodereview_teaser', $node),
+        );
+    }
+    if ($page) {
+      foreach ($node->reviews as $review) {
+        $node->content['reviews'][$review['tag']] = array(
+          '#value' => theme('nodereview_review_body', $review, $node),
+        );
+      }
+    }
+
+
+    return $node;
+  }
+}
diff -Nup nodereview5/nodereview.theme.inc nodereview/nodereview.theme.inc
--- nodereview5/nodereview.theme.inc	1969-12-31 19:00:00.000000000 -0500
+++ nodereview/nodereview.theme.inc	2009-02-24 19:23:22.000000000 -0500
@@ -0,0 +1,116 @@
+<?php
+  //$Id$
+
+/**
+ * Implementation of theme_nodereview_configure_axes()
+ * We declare this function to theme the axes in table
+ * format
+ */
+function theme_nodereview_configure_axes($form) {
+
+  $rows = array();
+  $output = '';
+  foreach (element_children($form['axes']) as $key) {
+    $row = array();
+    // Strip out the labels on each form element, since they're redundant with the header
+    $form['axes'][$key]['use']['#title'] = '';
+    $form['axes'][$key]['tag']['#title'] = '';
+    $form['axes'][$key]['description']['#title'] = '';
+    $form['axes'][$key]['weight']['#title'] = '';
+
+    $row[] = drupal_render($form['axes'][$key]['aid']) . drupal_render($form['axes'][$key]['use']);
+    $row[] = drupal_render($form['axes'][$key]['tag']);
+    $row[] = drupal_render($form['axes'][$key]['description']);
+    $row[] = drupal_render($form['axes'][$key]['weight']);
+    $rows[] = $row;
+  }
+
+  $header = array('use', 'name', 'description', 'weight');
+
+  // This is how we get the table to be "inside" the fieldset
+  $form['axes']['#children'] = theme('table', $header, $rows);
+
+  $output .= drupal_render($form);
+  return $output;
+}
+
+/**
+ * Implementation of  theme_nodereview_review_body
+ * We declare this function to theme the full node
+ * view
+ *
+ */
+
+function theme_nodereview_review_body($review, $node) {
+  //Logger::debug_var('review', $review);
+
+  $output = '';
+
+  $title = $review['tag'];
+  if (NODEREVIEW_FIVESTAR_ENABLE) {
+    $output = theme('fivestar_static', $review['score'], variable_get('nodereview_fivestar_stars', 5));
+  }
+  else {
+    $title .= ': ' . $review['score']/10 . '/10';
+  }
+  $output = theme('box', $title, $output . $review['review']);
+
+  return $output;
+}
+
+
+/**
+ * Implementation of  theme_nodereview_review_preview
+ * We declare this function to theme the node preview
+ *
+ */
+
+function theme_nodereview_review_preview($review, $node) {
+  $output = '';
+
+  $title = $review['tag'];
+  if (NODEREVIEW_FIVESTAR_ENABLE) {
+    $output = theme('fivestar_static', $review['score']);
+  }
+  else {
+    $title .= ': ' . $review['score']/10 . '/10';
+  }
+  $output = theme('box', $title, $output . check_markup($review['review'], $node->format));
+
+  return $output;
+}
+
+
+/**
+ * Implementation of  theme_nodereview_teaser
+ * We declare this function to theme the node teaser
+ * view
+ *
+ */
+
+function theme_nodereview_teaser($node) {
+  $output = '';
+  static $header;
+
+  // Presumably teaser will be called multiple times on different nodes
+  // on the same page, so static cache the static strings
+  if (!isset($header)) {
+    $header = array(t('axis'), t('score'), t('review'));
+  }
+
+  foreach ($node->reviews as $review) {
+    $row = array();
+    $row[] = $review['tag'];
+    if (NODEREVIEW_FIVESTAR_ENABLE) {
+      $row[] = theme('fivestar_static', $review['score'], variable_get('nodereview_fivestar_stars', 5));
+    }
+    else {
+      $row[] = $review['score']/10 . '/10';
+    }
+    $row[] = truncate_utf8($review['review'], 50, TRUE, TRUE);
+    $rows[] = $row;
+  }
+
+  $output = theme('table', $header, $rows, array('class'=>'review-teaser'));
+  return $output;
+}
diff -Nup nodereview5/nodereview.views_default.inc nodereview/nodereview.views_default.inc
--- nodereview5/nodereview.views_default.inc	1969-12-31 19:00:00.000000000 -0500
+++ nodereview/nodereview.views_default.inc	2009-02-24 19:23:22.000000000 -0500
@@ -0,0 +1,148 @@
+<?php
+
+  //$Id$
+
+/**
+ * Implementation of hook_views_default_views().
+ */
+function nodereview_views_default_views() {
+
+$view = new view;
+$view->name = 'review_list';
+$view->description = 'A list of teasers for reviews of a given node';
+$view->tag = 'nodereview';
+$view->view_php = '';
+$view->base_table = 'node';
+$view->is_cacheable = FALSE;
+$view->api_version = 2;
+$view->disabled = TRUE; /* Edit this to true to make a default view disabled initially */
+$handler = $view->new_display('default', 'Defaults', 'default');
+$handler->override_option('fields', array(
+  'title' => array(
+    'label' => 'Title',
+    'link_to_node' => 1,
+    'exclude' => 0,
+    'id' => 'title',
+    'table' => 'node',
+    'field' => 'title',
+    'override' => array(
+      'button' => 'Override',
+    ),
+    'relationship' => 'none',
+  ),
+  'changed' => array(
+    'label' => 'Updated',
+    'date_format' => 'small',
+    'custom_date_format' => '',
+    'exclude' => 0,
+    'id' => 'changed',
+    'table' => 'node',
+    'field' => 'changed',
+    'override' => array(
+      'button' => 'Override',
+    ),
+    'relationship' => 'none',
+  ),
+));
+$handler->override_option('sorts', array(
+  'changed' => array(
+    'order' => 'DESC',
+    'granularity' => 'second',
+    'id' => 'changed',
+    'table' => 'node',
+    'field' => 'changed',
+    'override' => array(
+      'button' => 'Override',
+    ),
+    'relationship' => 'none',
+  ),
+));
+$handler->override_option('arguments', array(
+  'reviewed_nid' => array(
+    'default_action' => 'not found',
+    'style_plugin' => 'default_summary',
+    'style_options' => array(),
+    'wildcard' => '',
+    'wildcard_substitution' => '',
+    'title' => '',
+    'default_argument_type' => 'fixed',
+    'default_argument' => '',
+    'validate_type' => 'none',
+    'validate_fail' => 'not found',
+    'break_phrase' => 0,
+    'not' => 0,
+    'id' => 'reviewed_nid',
+    'table' => 'nodereview',
+    'field' => 'reviewed_nid',
+    'relationship' => 'none',
+    'default_options_div_prefix' => '',
+    'default_argument_user' => 0,
+    'default_argument_fixed' => '',
+    'default_argument_php' => '',
+    'validate_argument_node_type' => array(
+      'nodereview' => 0,
+      'page' => 0,
+      'story' => 0,
+    ),
+    'validate_argument_node_access' => 0,
+    'validate_argument_nid_type' => 'nid',
+    'validate_argument_vocabulary' => array(),
+    'validate_argument_type' => 'tid',
+    'validate_argument_php' => '',
+  ),
+));
+$handler->override_option('filters', array(
+  'type' => array(
+    'operator' => 'in',
+    'value' => array(
+      'nodereview' => 'nodereview',
+    ),
+    'group' => '0',
+    'exposed' => FALSE,
+    'expose' => array(
+      'operator' => FALSE,
+      'label' => '',
+    ),
+    'id' => 'type',
+    'table' => 'node',
+    'field' => 'type',
+    'override' => array(
+      'button' => 'Override',
+    ),
+    'relationship' => 'none',
+  ),
+));
+$handler->override_option('access', array(
+  'type' => 'none',
+));
+$handler->override_option('title', 'Reviews');
+$handler->override_option('empty', 'No reviews have been submitted.  Maybe you should be the first?');
+$handler->override_option('empty_format', '1');
+$handler->override_option('use_pager', '1');
+$handler->override_option('distinct', 0);
+$handler->override_option('style_options', NULL);
+$handler->override_option('row_plugin', 'node');
+$handler->override_option('row_options', array(
+  'teaser' => 1,
+  'links' => 1,
+  'comments' => 0,
+));
+$handler = $view->new_display('page', 'Reviews', 'page_1');
+$handler->override_option('path', 'node/%/reviews');
+$handler->override_option('menu', array(
+  'type' => 'none',
+  'title' => '',
+  'weight' => 0,
+  'name' => 'navigation',
+));
+$handler->override_option('tab_options', array(
+  'type' => 'none',
+  'title' => '',
+  'weight' => 0,
+));
+
+ $views[$view->name] = $view;
+  return $views;
+}
+
+
diff -Nup nodereview5/nodereview.views_default.inc~ nodereview/nodereview.views_default.inc~
--- nodereview5/nodereview.views_default.inc~	1969-12-31 19:00:00.000000000 -0500
+++ nodereview/nodereview.views_default.inc~	2009-02-24 19:23:22.000000000 -0500
@@ -0,0 +1,148 @@
+<?php
+
+  //$Id$
+
+/**
+ * Implementation of hook_views_default_views().
+ */
+function nodereview_views_default_views() {
+
+$view = new view;
+$view->name = 'review_list';
+$view->description = 'A list of teasers for reviews of a given node';
+$view->tag = 'nodereview';
+$view->view_php = '';
+$view->base_table = 'node';
+$view->is_cacheable = FALSE;
+$view->api_version = 2;
+$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
+$handler = $view->new_display('default', 'Defaults', 'default');
+$handler->override_option('fields', array(
+  'title' => array(
+    'label' => 'Title',
+    'link_to_node' => 1,
+    'exclude' => 0,
+    'id' => 'title',
+    'table' => 'node',
+    'field' => 'title',
+    'override' => array(
+      'button' => 'Override',
+    ),
+    'relationship' => 'none',
+  ),
+  'changed' => array(
+    'label' => 'Updated',
+    'date_format' => 'small',
+    'custom_date_format' => '',
+    'exclude' => 0,
+    'id' => 'changed',
+    'table' => 'node',
+    'field' => 'changed',
+    'override' => array(
+      'button' => 'Override',
+    ),
+    'relationship' => 'none',
+  ),
+));
+$handler->override_option('sorts', array(
+  'changed' => array(
+    'order' => 'DESC',
+    'granularity' => 'second',
+    'id' => 'changed',
+    'table' => 'node',
+    'field' => 'changed',
+    'override' => array(
+      'button' => 'Override',
+    ),
+    'relationship' => 'none',
+  ),
+));
+$handler->override_option('arguments', array(
+  'reviewed_nid' => array(
+    'default_action' => 'not found',
+    'style_plugin' => 'default_summary',
+    'style_options' => array(),
+    'wildcard' => '',
+    'wildcard_substitution' => '',
+    'title' => '',
+    'default_argument_type' => 'fixed',
+    'default_argument' => '',
+    'validate_type' => 'none',
+    'validate_fail' => 'not found',
+    'break_phrase' => 0,
+    'not' => 0,
+    'id' => 'reviewed_nid',
+    'table' => 'nodereview',
+    'field' => 'reviewed_nid',
+    'relationship' => 'none',
+    'default_options_div_prefix' => '',
+    'default_argument_user' => 0,
+    'default_argument_fixed' => '',
+    'default_argument_php' => '',
+    'validate_argument_node_type' => array(
+      'nodereview' => 0,
+      'page' => 0,
+      'story' => 0,
+    ),
+    'validate_argument_node_access' => 0,
+    'validate_argument_nid_type' => 'nid',
+    'validate_argument_vocabulary' => array(),
+    'validate_argument_type' => 'tid',
+    'validate_argument_php' => '',
+  ),
+));
+$handler->override_option('filters', array(
+  'type' => array(
+    'operator' => 'in',
+    'value' => array(
+      'nodereview' => 'nodereview',
+    ),
+    'group' => '0',
+    'exposed' => FALSE,
+    'expose' => array(
+      'operator' => FALSE,
+      'label' => '',
+    ),
+    'id' => 'type',
+    'table' => 'node',
+    'field' => 'type',
+    'override' => array(
+      'button' => 'Override',
+    ),
+    'relationship' => 'none',
+  ),
+));
+$handler->override_option('access', array(
+  'type' => 'none',
+));
+$handler->override_option('title', 'Reviews');
+$handler->override_option('empty', 'No reviews have been submitted.  Maybe you should be the first?');
+$handler->override_option('empty_format', '1');
+$handler->override_option('use_pager', '1');
+$handler->override_option('distinct', 0);
+$handler->override_option('style_options', NULL);
+$handler->override_option('row_plugin', 'node');
+$handler->override_option('row_options', array(
+  'teaser' => 1,
+  'links' => 1,
+  'comments' => 0,
+));
+$handler = $view->new_display('page', 'Reviews', 'page_1');
+$handler->override_option('path', 'node/%/reviews');
+$handler->override_option('menu', array(
+  'type' => 'none',
+  'title' => '',
+  'weight' => 0,
+  'name' => 'navigation',
+));
+$handler->override_option('tab_options', array(
+  'type' => 'none',
+  'title' => '',
+  'weight' => 0,
+));
+
+ $views[$view->name] = $view;
+  return $views;
+}
+
+
diff -Nup nodereview5/nodereview_views.inc nodereview/nodereview_views.inc
--- nodereview5/nodereview_views.inc	2007-02-24 21:50:10.000000000 -0500
+++ nodereview/nodereview_views.inc	1969-12-31 19:00:00.000000000 -0500
@@ -1,153 +0,0 @@
-<?php
-// $Id: nodereview_views.inc,v 1.5 2007/02/25 02:50:10 crell Exp $
-
-/* ----- Views API ----- */
-
-function nodereview_views_tables() {
- 
-  $tables['nodereview'] = array(
-    'name' => 'nodereview',
-    'provider' => 'nodereview',
-    'join' => array(
-      'left' => array(
-        'table' => 'node',
-        'field' => 'nid',
-      ),
-      'right' => array(
-        'field' => 'nid'
-      ),
-    ),
-    'filters' => array(
-      'reviewed_nid' => array(
-         'name' => t('Review: Reviewed Node'),
-         'list' => 'nodereview_views_handler_filter_reviewed_node',
-         'operator' => 'views_handler_operator_andor',
-         'help' => t('This allows you to filter reviews based on the reviewed node.'),
-      ),
-    ),
-  );
-  
-  return $tables;
-}
-
-function nodereview_views_arguments() {
-  $arguments = array(
-    'reviewed_node' => array(
-      'name' => t("Review: Reviewed Node ID"), 
-      'handler' => "nodereview_views_handler_arg_reviewed_node",
-    ),
-  );
-  return $arguments;
-}
-
-function nodereview_views_handler_arg_reviewed_node($op, & $query, $argtype, $arg = '') {
-  switch ($op) {
-    case 'summary' :
-      $query->ensure_table("nodereview");
-      $query->add_field("reviewed_nid");
-      $fieldinfo['field'] = "nodereview.reviewed_nid";
-      return $fieldinfo;
-    case 'sort':
-      //$query->add_orderby('book', 'weight', $argtype);
-      //$query->add_orderby('book_parent_node', 'title', $argtype);
-      break;
-    case 'filter' :
-      $query->ensure_table("nodereview");
-      $query->add_where("reviewed_nid = '$arg'");
-      $query->add_where("nodereview.nid = node.nid");
-      break;
-    case 'link' :
-      return l($query->title, "$arg/$query->nid");
-    case 'title' :
-      if ($query) {
-        $term = db_fetch_object(db_query("SELECT title FROM {node} WHERE nid = '%d'", $query));
-        return $term->title;
-      }
-  }
-}
-
-function nodereview_views_handler_filter_reviewed_node() {
-  $reviewed_nids = array();
-
-  $result = db_query("SELECT DISTINCT reviewed_nid FROM {nodereview} ORDER BY reviewed_nid");
-  while ($obj = db_fetch_object($result)) {
-    $reviewed_nids[$obj->reviewed_nid] = "$obj->reviewed_nid";
-  }
-  return $reviewed_nids;
-}
-
-
-function nodereview_views_default_views() {
-  $view = new stdClass();
-  $view->name = 'review_list';
-  $view->description = 'A list of teasers for reviews of a given node';
-  $view->access = array (
-    0 => '1',
-    1 => '2',
-  );
-  $view->view_args_php = '';
-  $view->page = TRUE;
-  $view->page_title = '%1';
-  $view->page_header = '';
-  $view->page_header_format = '1';
-  $view->page_footer = '';
-  $view->page_footer_format = '1';
-  $view->page_empty = 'No reviews have been submitted.  Maybe you should be the first?';
-  $view->page_empty_format = '1';
-  $view->page_type = 'teaser';
-  $view->url = 'node/$arg/reviews';
-  $view->use_pager = TRUE;
-  $view->nodes_per_page = '10';
-  $view->sort = array (
-    array (
-      'tablename' => 'node',
-      'field' => 'changed',
-      'sortorder' => 'DESC',
-      'options' => '',
-    ),
-  );
-  $view->argument = array (
-    array (
-      'type' => 'reviewed_node',
-      'argdefault' => '1',
-      'title' => '',
-      'options' => '',
-      'wildcard' => '',
-      'wildcard_substitution' => '',
-    ),
-  );
-  $view->field = array (
-    array (
-      'tablename' => 'node',
-      'field' => 'changed',
-      'label' => 'updated',
-      'handler' => 'views_handler_field_date_small',
-      'defaultsort' => 'DESC',
-    ),
-    array (
-      'tablename' => 'node',
-      'field' => 'title',
-      'label' => 'title',
-      'handler' => 'views_handler_field_nodelink_with_mark',
-      'options' => 'link',
-    ),
-  );
-  $view->filter = array (
-    array (
-      'tablename' => 'node',
-      'field' => 'type',
-      'operator' => 'OR',
-      'options' => '',
-      'value' => array (
-        0 => 'nodereview',
-      ),
-    ),
-  );
-  $view->exposed_filter = array (
-  );
-  $view->requires = array(node);
-  $views[$view->name] = $view;
-
-  
-  return $views;
-}
diff -Nup nodereview5/nodereview.views.inc nodereview/nodereview.views.inc
--- nodereview5/nodereview.views.inc	1969-12-31 19:00:00.000000000 -0500
+++ nodereview/nodereview.views.inc	2009-02-24 19:23:22.000000000 -0500
@@ -0,0 +1,26 @@
+<?php
+
+//$Id$
+
+function nodereview_views_data() {
+  $data['nodereview']['table']['group']  =t('Node Review');
+  $data['nodereview']['table']['join']['node'] = array(
+    'left_field' => 'nid',
+    'field' => 'nid',
+  );
+
+  $data['nodereview']['reviewed_nid'] = array(
+    'title' => t('Reviewed Node'),
+    'help' => t('The node which is reviewed.'),
+    'filter' => array(
+      'handler' => 'views_handler_filter_numeric',
+      'numeric' => TRUE,
+    ),
+    'argument' => array(
+      'handler' => 'views_handler_argument_numeric',
+      'numeric' => TRUE,
+    ),
+
+  );
+  return $data;
+}
diff -Nup nodereview5/README.TXT nodereview/README.TXT
--- nodereview5/README.TXT	2008-04-14 13:31:41.000000000 -0400
+++ nodereview/README.TXT	2009-02-24 19:23:20.000000000 -0500
@@ -1,38 +1,38 @@
-ABOUT
-
-This module allows users to write reviews of any other node in the system.  Each
-review is itself a node, which in turn can be reviewed as well.  The format of 
-a review is fully configurable by the admin, and includes both a numeric and
-textual grade in an arbitrary number of axes.
-
-REQUIREMENTS
-
-- Drupal 5
-- Views module
-- VotingAPI module
-
-INSTALLATION
-
-- Copy the nodereview directory to your modules directory.
-- Go to admin/build/modules and enable it.
-- Go to admin/user/access and set proper permissions.
-- Reviews can be enabled for a specific node type on the node configuration page (admin/content/types) 
-or on the review configuration page(admin/content/nodereview).
-- Review axes can be configured per-node type on admin/content/nodereview/<typename>
-
-AUTHORS AND CREDIT
-
-Larry Garfield
-larry at garfieldtech dot com
-http://www.garfieldtech.com/
-
-John Forsythe
-john at blamcast dot net
-http://blamcast.net/
-
-This module was initially developed for EdibleSense.com, and released to the Drupal
-community under the GNU General Public License v2.
-
-Additional funding for this module has been provided by (in the order added):
-
-- Dublit.com
+ABOUT
+
+This module allows users to write reviews of any other node in the system.  Each
+review is itself a node, which in turn can be reviewed as well.  The format of 
+a review is fully configurable by the admin, and includes both a numeric and
+textual grade in an arbitrary number of axes.
+
+REQUIREMENTS
+
+- Drupal 5
+- Views module
+- VotingAPI module
+
+INSTALLATION
+
+- Copy the nodereview directory to your modules directory.
+- Go to admin/build/modules and enable it.
+- Go to admin/user/access and set proper permissions.
+- Reviews can be enabled for a specific node type on the node configuration page (admin/content/types) 
+or on the review configuration page(admin/content/nodereview).
+- Review axes can be configured per-node type on admin/content/nodereview/<typename>
+
+AUTHORS AND CREDIT
+
+Larry Garfield
+larry at garfieldtech dot com
+http://www.garfieldtech.com/
+
+John Forsythe
+john at blamcast dot net
+http://blamcast.net/
+
+This module was initially developed for EdibleSense.com, and released to the Drupal
+community under the GNU General Public License v2.
+
+Additional funding for this module has been provided by (in the order added):
+
+- Dublit.com
