diff options
Diffstat (limited to 'modules/taxonomy/taxonomy.module')
-rw-r--r-- | modules/taxonomy/taxonomy.module | 41 |
1 files changed, 7 insertions, 34 deletions
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index 109397f3c..4e25c3bd8 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -26,9 +26,6 @@ function taxonomy_theme() { 'taxonomy_term_select' => array( 'arguments' => array('element' => NULL), ), - 'taxonomy_term_page' => array( - 'arguments' => array('tids' => array(), 'result' => NULL), - ), 'taxonomy_overview_vocabularies' => array( 'arguments' => array('form' => array()), ), @@ -73,7 +70,7 @@ function taxonomy_nodeapi_view($node) { } } } - + $node->content['links']['terms'] = array( '#type' => 'node_links', '#value' => $links, @@ -323,7 +320,7 @@ function taxonomy_term_save($term) { $status = drupal_write_record('taxonomy_term_data', $term); module_invoke_all('taxonomy_term_update', $term); } - + $or = db_or()->condition('tid1', $term->tid)->condition('tid2', $term->tid); db_delete('taxonomy_term_relation')->condition($or)->execute(); @@ -1224,7 +1221,7 @@ function theme_taxonomy_term_select($element) { * @param $order * The order clause for the query that retrieve the nodes. * @return - * A resource identifier pointing to the query results. + * An array of node IDs. */ function taxonomy_select_nodes($tids = array(), $operator = 'or', $depth = 0, $pager = TRUE, $order = 'n.sticky DESC, n.created DESC') { if (count($tids) > 0) { @@ -1254,44 +1251,20 @@ function taxonomy_select_nodes($tids = array(), $operator = 'or', $depth = 0, $p $wheres .= ' AND tn' . $index . '.tid IN (' . db_placeholders($tids, 'int') . ')'; $args = array_merge($args, $tids); } - $sql = 'SELECT DISTINCT(n.nid), n.sticky, n.title, n.created FROM {node} n ' . $joins . ' WHERE n.status = 1 ' . $wheres . ' ORDER BY ' . $order; + $sql = 'SELECT DISTINCT(n.nid) AS nid, n.sticky, n.created FROM {node} n ' . $joins . ' WHERE n.status = 1 ' . $wheres . ' ORDER BY ' . $order; $sql_count = 'SELECT COUNT(DISTINCT(n.nid)) FROM {node} n ' . $joins . ' WHERE n.status = 1 ' . $wheres; } $sql = db_rewrite_sql($sql); $sql_count = db_rewrite_sql($sql_count); if ($pager) { - $result = pager_query($sql, variable_get('default_nodes_main', 10), 0, $sql_count, $args); + $nids = pager_query($sql, variable_get('default_nodes_main', 10), 0, $sql_count, $args)->fetchCol(); } else { - $result = db_query_range($sql, $args, 0, variable_get('feed_default_items', 10)); + $nids = db_query_range($sql, $args, 0, variable_get('feed_default_items', 10))->fetchCol(); } } - return $result; -} - -/** - * Accepts the result of a pager_query() call, such as that performed by - * taxonomy_select_nodes(), and formats each node along with a pager. - */ -function taxonomy_render_nodes($result) { - $output = ''; - $nids = array(); - foreach ($result as $record) { - $nids[] = $record->nid; - } - if (!empty($nids)) { - $nodes = node_load_multiple($nids); - - foreach ($nodes as $node) { - $output .= node_view($node, 1); - } - $output .= theme('pager', NULL, variable_get('default_nodes_main', 10), 0); - } - else { - $output .= '<p>' . t('There are currently no posts in this category.') . '</p>'; - } - return $output; + return $nids; } /** |