this code make the flexinode list /flexinode-x/list

**
 * Menu callback; presents a listing of all nodes of one type.
 */
function flexinode_page_list($ctype_id = 0) {

  if (!$ctype_id) {
    drupal_not_found();
  }

  $output = '';
  $ctype = flexinode_load_content_type($ctype_id);

  if ($ctype_id) {
    $type = 'flexinode-' . db_escape_string($ctype_id);
  }
  else {
    $type = 'flexinode-%';
  }
  $result = pager_query(db_rewrite_sql("SELECT n.nid FROM {node} n WHERE n.status = 1 AND n.type LIKE '%s' ORDER BY n.sticky DESC, n.created DESC"), variable_get('flexinode_list_count', 10), 0, NULL, $type);

  while ($node = db_fetch_object($result)) {
    $output .= node_view(node_load($node->nid), 1);
  }
  $output .= theme('pager', NULL, variable_get('flexinode_list_count', 10));

  drupal_set_title(t($ctype->name));
  return $output ? $output : drupal_not_found();
}

How could I modify to sort the list by a term ???

maybe modify the sql select?? how?

-----
thanks to all drupaler

Comments

pablov2’s picture

I have found by my own the solution:

Modify the SQL SELECT

SELECT n.nid FROM {node} n, {term_node} t,{term_data} d WHERE n.status = 1 AND n.type LIKE '%s' 
  AND n.nid = t.nid AND d.tid = t.tid AND d.vid = 8  ORDER BY n.sticky DESC, t.tid DESC, d.name DESC

I have tried and i think it run ok...