Thanks a million! That did the trick perfectly. Just a question, if I want to do the same for another ad, can I just modify the code as follows for the second ad?
function pageheader($section, $meta = '')
{
global $CONFIG, $THEME_DIR;
global $template_header, $lang_charset, $lang_text_dir;
$charset = ($CONFIG['charset'] == 'language file') ? $lang_charset : $CONFIG['charset'];
header('P3P: CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"');
header("Content-Type: text/html; charset=$charset");
user_save_profile();
$template_vars = array('{LANG_DIR}' => $lang_text_dir,
'{TITLE}' => $CONFIG['gallery_name'] . ' - ' . $section,
'{CHARSET}' => $charset,
'{META}' => $meta,
'{GAL_NAME}' => $CONFIG['gallery_name'],
'{GAL_DESCRIPTION}' => $CONFIG['gallery_description'],
'{MAIN_MENU}' => theme_main_menu(),
'{ADMIN_MENU}' => theme_admin_mode_menu(),
'{AD}' => generate_ad_block(),
'{AD2}' => generate_ad_block2()
);
echo template_eval($template_header, $template_vars);
}
function generate_ad_block()
{
if (!defined('REGISTER_PHP') && !defined('LOGIN_PHP')){
$ad = <<< EOT
<center><br>
<script type="text/javascript"><!--
google_ad_client = "xxxxx";
google_alternate_ad_url = "xxxxl";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_channel ="";
google_page_url = document.location;
google_color_border = "5B5B5B";
google_color_bg = "5B5B5B";
google_color_link = "ffffff";
google_color_url = "ffffff";
google_color_text = "ffffff";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></center>
EOT;
} else $ad = '';
return $ad;
}
function generate_ad_block2()
{
if (!defined('REGISTER_PHP') && !defined('LOGIN_PHP')){
$ad = <<< EOT
<center><br>
<script type="text/javascript"><!--
code_ for_other_ad;
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></center>
EOT;
} else $ad = '';
return $ad;
}