Index: nodecomment.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/nodecomment/nodecomment.module,v
retrieving revision 1.3.2.15.2.6
diff -u -p -r1.3.2.15.2.6 nodecomment.module
--- nodecomment.module	5 Oct 2008 14:26:22 -0000	1.3.2.15.2.6
+++ nodecomment.module	6 Oct 2008 11:25:56 -0000
@@ -141,7 +141,7 @@ function nodecomment_admin_settings() {
       COMMENT_ANONYMOUS_MAYNOT_CONTACT => t('Anonymous posters may not enter their contact information'),
       COMMENT_ANONYMOUS_MAY_CONTACT => t('Anonymous posters may leave their contact information'),
       COMMENT_ANONYMOUS_MUST_CONTACT => t('Anonymous posters must leave their contact information')),
-    '#description' => t('This option is enabled when anonymous users have permission to post comments on the <a href="@url">permissions page</a>.', array('@url' => url('admin/user/access'))),
+    '#description' => t('This option is enabled when anonymous users have permission to post comments on the <a href="@url">permissions page</a>.', array('@url' => url('admin/user/permissions'))),
   );
   if (!user_access('post comments', user_load(array('uid' => 0)))) {
     $form['posting_settings']['comment_anonymous']['#disabled'] = TRUE;
@@ -313,14 +313,14 @@ function nodecomment_form_alter(&$form, 
   }
 }
 
-function nodecomment_comment_type_validate($form_id, $form_values) {
+function nodecomment_comment_type_validate($form, &$form_state) {
   // if comments are enabled
-  if ($form_values['comment'] > 0) {
+  if ($form_state['values']['comment'] > 0) {
     // make sure a comment_type is chosen
-    if (!$form_values['comment_type']) {
+    if (!$form_state['values']['comment_type']) {
       form_set_error('comment_type', 'You must choose a comment type.');
     }
-    if (!$form_values['comment_view']) {
+    if (!$form_state['values']['comment_view']) {
       form_set_error('comment_view', 'You must choose a comment view.');
     }
   }
@@ -454,7 +454,7 @@ function nodecomment_save($node) {
   db_query("INSERT INTO {node_comments} ".
          "(cid,        nid,                       pid,                       hostname,                thread,        name,        uid,        mail,        homepage)".
   "VALUES (%d,         %d,                        %d,                        '%s',                    '%s',          '%s',        %d,         '%s',        '%s')",
-           $node->nid, $node->comment_target_nid, $node->comment_target_cid, $_SERVER['REMOTE_ADDR'], $node->thread, $node->name, $node->uid, $node->mail, $node->homepage);
+           $node->nid, $node->comment_target_nid, $node->comment_target_cid, ip_address(), $node->thread, $node->name, $node->uid, $node->mail, $node->homepage);
 
   _nodecomment_update_node_statistics($node->comment_target_nid);
 
@@ -533,7 +533,7 @@ function nodecomment_link($type, $node =
           'title' => t('Add new @comment_type', array('@comment_type' => node_get_types('name', $comment_type))),
           'attributes' => array('title' => t('Add a new comment to this page.')),
         );
-        if (variable_get('comment_form_location', COMMENT_FORM_SEPARATE_PAGE) == 1) {
+        if (variable_get('comment_form_location_'. $node->type, COMMENT_FORM_SEPARATE_PAGE) == 1) {
           $links['comment_add']['href'] = "node/$node->nid";
           $links['comment_add']['fragment'] = 'node-form';
         }
@@ -544,7 +544,7 @@ function nodecomment_link($type, $node =
       else if ($user->uid == 0) {
         // Show anonymous users the chance to login or register
         // we cannot use drupal_get_destination() because these links sometimes appear on /node and taxo listing pages
-        if (variable_get('comment_form_location', COMMENT_FORM_SEPARATE_PAGE) == COMMENT_FORM_SEPARATE_PAGE) {
+        if (variable_get('comment_form_location_'. $node->type, COMMENT_FORM_SEPARATE_PAGE) == COMMENT_FORM_SEPARATE_PAGE) {
           // TODO: This is wrong and has to be addressed with the whole separate page business.
           $destination = "destination=". drupal_urlencode("node/$node->nid#nodecomment_form");
         }
@@ -636,7 +636,7 @@ function nodecomment_render($node, $cid 
 
     // If enabled, show new comment form.
     $comment_type = variable_get('comment_type_'. $node->type, variable_get('default_comment_type', ''));
-    if (user_access("create $comment_type content") && user_access('post comments') && node_comment_mode($nid) == COMMENT_NODE_READ_WRITE && (variable_get('comment_form_location', COMMENT_FORM_SEPARATE_PAGE) == COMMENT_FORM_BELOW)) {
+    if (user_access("create $comment_type content") && user_access('post comments') && node_comment_mode($nid) == COMMENT_NODE_READ_WRITE && (variable_get('comment_form_location_'. $node->type, COMMENT_FORM_SEPARATE_PAGE) == COMMENT_FORM_BELOW)) {
       // There is likely a cleaner way to do this, but for now it will have to do. -- JE
       $friendly_name = node_get_types('name', $comment_type);
       $output .= nodecomment_form_box($node, t('Post new !type', array('!type' => $friendly_name)));
