Great hack Amy. <plug>I think it compliments
my postbit mod quite really well</plug>
One suggestion I have is that you could use PHP's "heredoc" syntax to avoid having to quote any of the ad calls.
If you used:
PHP Code:
$output .= <<<EOBANNER
Google adsense code goes here
...
...
...
end adsense code
EOBANNER;
Then no escaping is required, the code can just be pasted in from Google's adsense interface without having to check for/escape single or double quotes.