--- workspace.module.org 2006-04-13 18:03:05.000000000 +0100 +++ workspace.module 2006-04-24 17:28:28.000000000 +0100 @@ -109,7 +110,7 @@ '#type' => 'textfield', '#title' => t('Number of files'), '#description' => t('Maximum number of filenames to display in your workspace.'), - '#default_value' => $user->workspaces ? $user->workspaces['default']['maxfilesnames'] : 50, + '#default_value' => $user->workspaces ? $user->workspaces['default']['maxfilenames'] : 50, '#size' => 4 ); $form['submit'] = array( @@ -125,8 +126,8 @@ if (!is_numeric($edit['maxnodes'])) { form_set_error('maxnodes', t('Please enter a numeric value.')); } - if (!is_numeric($edit['maxfiles']) && !form_get_errors()) { - form_set_error('maxfiles', t('Please enter a numeric value.')); + if (!is_numeric($edit['maxfilenames']) && !form_get_errors()) { + form_set_error('maxfilenames', t('Please enter a numeric value.')); } } @@ -137,7 +138,9 @@ } $user->workspaces['default']['maxnodes'] = $edit['maxnodes']; $user->workspaces['default']['maxfilenames'] = $edit['maxfilenames']; - return user_save($user, array('workspaces' => $user->workspaces)); + user_save($user, array('workspaces' => $user->workspaces)); + drupal_set_message("Workspace configuration saved."); + drupal_goto('workspace'); } /******************************************************************** @@ -182,7 +185,7 @@ } $comment_sql = 'SELECT c.nid AS cnid, c.uid, "" AS type, c.cid, c.subject, c.status, c.timestamp, c.pid, 0 '. $select .' FROM {comments} AS c, {node} n LEFT JOIN {node_comment_statistics} s ON n.nid = s.nid WHERE c.uid = '. db_escape_string($user->uid); $sql .= ' UNION '. $comment_sql; - $count_sql = 'SELECT COUNT(n.nid) + COUNT(c.cid) FROM '. implode(', ', $node_from) .' '. implode(' ', $node_join) .' LEFT JOIN {comments} AS c ON c.uid = '. db_escape_string($user->uid). ' WHERE '. implode(' ', $node_where); + $count_sql = 'SELECT COUNT(DISTINCT(n.nid)) + COUNT(DISTINCT(c.cid)) FROM '. implode(', ', $node_from) .' '. implode(' ', $node_join) .' LEFT JOIN {comments} AS c ON c.uid = '. db_escape_string($user->uid). ' WHERE '. implode(' ', $node_where); } // build the combined node/comment listing