Index: modules/xtracker/xtracker.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/xtracker/xtracker.module,v retrieving revision 1.4 diff -u -r1.4 xtracker.module --- modules/xtracker/xtracker.module 12 Nov 2005 01:18:32 -0000 1.4 +++ modules/xtracker/xtracker.module 25 Nov 2005 13:02:15 -0000 @@ -22,26 +22,29 @@ } function xtracker_settings() { - $vocabs = array(); - $vocabularies = taxonomy_get_vocabularies(); $vocabs[] = '<'. t('none') .'>'; foreach ($vocabularies as $vocabulary) { $vocabs[$vocabulary->vid] = $vocabulary->name; } - $output .= form_select(t('Node per page'), - XTRACKER_PAGE_COUNT, variable_get(XTRACKER_PAGE_COUNT, 10), - drupal_map_assoc(array(5, 10, 15, 20, 25, 30, 50, 100)), - t('Number of nodes to show per page.')); - - $output .= form_select(t('Category vocabulary'), - 'xtracker_vid', variable_get('xtracker_vid', 0), - $vocabs, - t('Select a vocabulary to show in xtracker. Choosing "none" will list by content type instead.')); - - return $output; + $form[XTRACKER_PAGE_COUNT] = array( + '#type' => 'select', + '#title' => t('Node per page'), + '#default_value' => variable_get(XTRACKER_PAGE_COUNT, 10), + '#options' => drupal_map_assoc(array(5, 10, 15, 20, 25, 30, 50, 100)), + '#decription' => t('Number of nodes to show per page.'), + ); + $form['xtracker_vid'] = array( + '#type' => 'select', + '#title' => t('Category vocabulary'), + '#default_value' => variable_get('xtracker_vid', 0), + '#options' => $vocabs, + '#description' => t('Select a vocabulary to show in xtracker. Choosing "none" will list by content type instead.'), + ); + + return $form; } /** @@ -175,8 +178,8 @@ array('data' => t('Replies'), 'field' => 'comment_count'), array('data' => t('Last Post'), 'field' => 'last_post', 'sort' => 'desc') ); - - + + if ($score) { $header = array_merge($header, array( @@ -185,7 +188,7 @@ } $sql = 'SELECT DISTINCT(n.nid), n.title, n.type, n.changed, n.uid, u.name, l.last_comment_timestamp AS last_post, l.comment_count ' . $score_column . ' FROM {node} n INNER JOIN {users} u ON n.uid = u.uid INNER JOIN {node_comment_statistics} l ON n.nid = l.nid ' . $nv_join . 'LEFT JOIN {term_node} t ON t.nid = n.nid LEFT JOIN {comments} c ON n.nid = c.nid WHERE n.status = 1 ' . $sql_where . ' GROUP BY n.nid '; - + $sql_count = 'SELECT COUNT(n.nid) FROM {node} n, {term_node} t LEFT JOIN {comments} c ON n.nid = c.nid WHERE n.nid = t.nid AND n.status = 1 ' . $sql_where; $sql .= tablesort_sql($header); @@ -210,7 +213,7 @@ array('class' => 'replies', 'data' => $comments), t('%time ago', array('%time' => format_interval(time() - $node->last_post))), ); - + if ($score) { $rows[] = array_merge($row, array(number_format($node->score, 1))); }