
archiver.module installation instructions

1) Copy this directory to your modules directory
2) Enable the module at: administer -> modules
3) Configure the module settings at: administer -> settings -> archiver
4) Assign permissions to user roles at: administer -> access control
5) Optionally, patch the core (see below why).
patch -p0 < archiver/patches/node.module.patch
patch -p0 < taxonomy/patches/node.module.patch

Read more about http://drupal.org/node/60108

PATCHING THE CORE:
==================
Unfortunately, as of now, hiding of archived nodes
on regular pages (e.g. front page, category listings) is
implemented by core hacks (see below).
A possible workaround would be storing the promote variable and all
term ids into the archiver table and DELETE FROM term_node
WHERE nid = %d and update node.promote to 1. However, if such
nodes would be edited (promoted, terms),we need to make sure
that these newly entered parameters are saved in archiver
and immediately overwritten (unless unarchiving was selected
at the same time). Still, it would not be clear whether a node
used to be promoted/terms from the edit form of the archived node.

5) This is what the supplied patches do: Edit node.module at around line #2374:

From
      function node_page_default() {
         $result = pager_query(db_rewrite_sql('SELECT n.nid, n.sticky, n.created FROM {node} n WHERE n.promote = 1 AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC'), variable_get('default_nodes_main', 10));

to
      // HACK (archiver module) to hide archived nodes from the front page
      if(variable_get('archiver_remove_from_frontpage', FALSE)) {
          $query = db_rewrite_sql('SELECT DISTINCT n.nid, n.sticky, n.created FROM {node} AS n LEFT JOIN {archiver} AS a ON n.nid = a.nid WHERE a.nid IS NULL AND n.promote = 1 AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC');
          $result = pager_query($query, variable_get('default_nodes_main', 10));

      } else {
          $result = pager_query(db_rewrite_sql('SELECT n.nid, n.sticky, n.created FROM {node} n WHERE n.promote = 1 AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC'), variable_get('default_nodes_main', 10));
      }
    
    
6) Optionally, if you want to hide archived nodes from all category listings,
edit taxonomy.module at around line #1230:

From
      $sql = 'SELECT DISTINCT(n.nid), n.sticky, n.title, n.created FROM {node} n INNER JOIN {term_node} tn ON n.nid = tn.nid WHERE tn.tid IN ('. $str_tids .') AND n.status = 1 ORDER BY '. $order;
      $sql_count = 'SELECT COUNT(DISTINCT(n.nid)) FROM {node} n INNER JOIN {term_node} tn ON n.nid = tn.nid WHERE tn.tid IN ('. $str_tids .') AND n.status = 1';

to

      //HACK (archiver module) to hide archived nodes from the front page
      if(variable_get('archiver_remove_from_categories', FALSE)) {
        $sql = 'SELECT DISTINCT(n.nid), n.sticky, n.title, n.created FROM {node} n INNER JOIN ( {term_node} tn LEFT JOIN {archiver} a ON tn.nid = a.nid ) ON n.nid = tn.nid WHERE tn.tid IN ('. $str_tids .') AND n.status = 1 AND a.nid IS NULL ORDER BY '. $order;
        $sql_count = 'SELECT COUNT(DISTINCT(n.nid)) FROM {node} n INNER JOIN ( {term_node} tn LEFT JOIN {archiver} a ON tn.nid = a.nid ) ON n.nid = tn.nid WHERE tn.tid IN ('. $str_tids .') AND n.status = 1 AND a.nid IS NULL';
      }
      else {
        $sql = 'SELECT DISTINCT(n.nid), n.sticky, n.title, n.created FROM {node} n INNER JOIN {term_node} tn ON n.nid = tn.nid WHERE tn.tid IN ('. $str_tids .') AND n.status = 1 ORDER BY '. $order;
        $sql_count = 'SELECT COUNT(DISTINCT(n.nid)) FROM {node} n INNER JOIN {term_node} tn ON n.nid = tn.nid WHERE tn.tid IN ('. $str_tids .') AND n.status = 1';
      }
    
and around line #1240

From
      $sql = 'SELECT DISTINCT(n.nid), n.sticky, n.title, 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;

to
     //HACK (archiver module) to hide archived nodes from the front page
      if(variable_get('archiver_remove_from_categories', FALSE)) {
        $sql = 'SELECT DISTINCT(n.nid), n.sticky, n.title, n.created FROM {node} n '. $joins .' LEFT JOIN {archiver} a ON tn0.nid = a.nid WHERE a.nid IS NULL AND n.status = 1 '. $wheres .' ORDER BY '. $order;
        $sql_count = 'SELECT COUNT(DISTINCT(n.nid)) FROM {node} n '. $joins .' LEFT JOIN {archiver} a ON tn0.nid = a.nid WHERE a.nid IS NULL AND n.status = 1 '. $wheres;
      }
      else {
        $sql = 'SELECT DISTINCT(n.nid), n.sticky, n.title, 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;
      }
 
 
