Hi Guys,
I have been doing a few add-ons to drupal using teh node-api hook, which I have to admit I really like. And encountered the problem that when you have a few modules implementing the nodeapi interface, there is order in the execution of the modules, except for the alphabetical order of the module names. An example of such use can be seen at LOKI Hostel - Balcony WIP. On the first runs I did (before hacking the module.inc) the book navigation appeared before the image gallery photos and navigation controls, which seemed all wrong.
My solution, a fast and simple one was to add a new column in the 'system' DB table called 'forder' and change the select getting the modules list to use that column for ordering of the modules. I then place a -1 value for the image module, and that solved my problem.

This is the code I changed in 'modules.inc':

function module_list($refresh = FALSE, $bootstrap = FALSE) {
  static $list;

  if ($refresh) {
    $list = array();
  }

  if (!$list) {
    $list = array('filter' => 'filter', 'system' => 'system', 'user' => 'user', 'watchdog' => 'watchdog');
    if ($bootstrap) {
// DRU75 - ORDER BY added
      $result = db_query("SELECT name, filename, throttle, bootstrap FROM {system} WHERE type = 'module' AND status = 1 AND bootstrap = 1 ORDER BY forder ASC");
    }
    else {
// DRU75 - ORDER BY added
	    $result = db_query("SELECT name, filename, throttle, bootstrap FROM {system} WHERE type = 'module' AND status = 1 ORDER BY forder ASC");
    }
    while ($module = db_fetch_object($result)) {
      if (file_exists($module->filename)) {
        // Determine the current throttle status and see if the module should be
        // loaded based on server load. We have to directly access the throttle
        // variables, since throttle.module may not be loaded yet.
        $throttle = ($module->throttle && variable_get('throttle_level', 0) > 0);
        if (!$throttle) {
          drupal_get_filename('module', $module->name, $module->filename);
          $list[$module->name] = $module->name;
        }
      }
    }
// DRU75 - Sort remarked, does an alphabetical sort
//    asort($list);
  }
  return $list;
}

I know this is a fast and dirty solution, but I think this might give you guys some ideas about setting such a thing. Till now I only needed it for the nodeapi 'view' interface, since we have a small group of writers that will suffer almost everything anyway. But I guess a similar mechanism would be useful for the 'form_post' interface, and maybe others. So this might be placed as another tab for the admin/module.

And more important than anything else, if you can think of any problems that can occur from using this hack, please reply here (I'm sure I can find another solution if I need to).

Cheers,
Dru