List nodes of children using taxonomy_select_nodes
I would say these are your problems:

taxonomy_get_children() returns term objects, not term IDs, so that is going to break that query. This I would say is your main issue. Instead you could do this:

  $taxonomies = array();
  $taxonomies = taxonomy_get_children($tid);
  // Get the child term tids.
  $taxonomies = array_keys($taxonomies);
  // Add the parent tid.
  $taxonomies[] = $tid;
  $query-&gt;condition('t.tid', $taxonomies,'IN');


Your IN statement with the children won't work currently because earlier in the function is this line:

$query-&gt;condition('tid', $tid);


So that will only ever return values for $tid, never for the children unless you remove that line also.

Also I would recommend giving the new $promote parameter a default value, like this:

function taxonomy_select_nodes_ext($tid, $pager = TRUE, $limit = FALSE, $order = array('t.sticky' =&gt; 'DESC', 't.created' =&gt; 'DESC'), $promote = 0) {