Drupal implementing an advertising takeover with page background image
In your theme's preprocess_page() hook you could set a variable that is accessible in your page.tpl.php file.  Basically something like:

function YOURMODULE_preprocess_page(&amp;$vars) {

  $vars['background_image']=make_me_a_background_for_page($_GET['q']);

  // other page preprocessing goes here

}


where make_me_a_background_for_page() is a custom function that returns a path to an image based upon the page being viewed.  You can then use that variable however you want to create the background.

One way would be to put a quick div in the page somewhere like...

&lt;?php if (!empty($background_image)): ?&gt;
  &lt;div id="use-this-background-image"&gt;&lt;?php print $background_image; ?&gt;&lt;/div&gt;
&lt;?php endif; ?&gt;


and have it hidden in css:

#use-this-background-image {
  display: none;
}


and then use jQuery to set the body's background to it:

// Drupal Behaviors Wrapper here :)

  if ($('#use-this-background-image').length) {
    $('body').css('background-image','url("' + $('#use-this-background-image').text() + '")');
  }

// Drupal Behaviors Wrapper here :)


An added bonus of doing it in this somewhat convoluted way is the background image isn't loaded until after your page is, so it pops in after the content, which, to me at least, is nicer looking than watching a big background load and THEN the content.