Hi, I have a custom module I've built to present my users with a specialized home page including posts of various content types (You can see it at http://strangequarks.ca to get an idea of what I mean).

It worked great until I installed the Private module at which point any node marked Private appeared in duplicate but only for the user who originally posted the node. Making this even stranger, it only happens for regular users; nodes created by Admin account and marked private do not have this issue.

I've looked at my code and I really can't see where this issue is coming from... I don't even think it's something to do with my code, but regular node listings (ie, "http://{domain}/node" will not show duplicates). My code that creates the lists isn't even very interesting, except that I rely on the latest comments to build the list.

Below is my code to pull the list. If any gurus out there feel like taking a stab at this strange problem, I'd love any input they have to offer.


  $sql = db_rewrite_sql("SELECT nc.nid, nc.comment_count, n.created
                        FROM {node_comment_statistics} nc
                        INNER JOIN {node} n ON nc.nid = n.nid
                        WHERE n.type = 'forum'
                        ORDER BY nc.last_comment_timestamp DESC
                        LIMIT $numoftopics");

  $result = db_query($sql);

  $taxnodes = array(); //taxonomy-based array of nodes
  while ($row = db_fetch_object($result)) {
    $tempnode = node_load($row->nid);
    $taxnodes[$tempnode->tid][] = array('node' => $tempnode,
                                        'tidname' => $tempnode->taxonomy[$tempnode->tid]->name);
  }