Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Adsense in 1.4.x  (Read 3190 times)

0 Members and 1 Guest are viewing this topic.

lordprodigy

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 228
    • B514 ///
Adsense in 1.4.x
« on: February 16, 2006, 05:28:02 am »

Aparently Google doesnt like (I had no idea) their ads on login and register screens, so I am wondering if this thread (http://forum.coppermine-gallery.net/index.php?topic=18284.0) for 1.3.2 works with 1.4.x. If it does, it is a really good way of handling ads.
« Last Edit: February 17, 2006, 06:25:20 pm by Nibbler »
Logged

lordprodigy

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 228
    • B514 ///
Re: Adsense in 1.4.x
« Reply #1 on: February 17, 2006, 05:42:22 pm »

I followed exactly what was said in the above thread but the ads didnt show up and instead i get the {AD}  on the page.... I dont know where the problem is. Has anyone tried the above thread mod in 1.4.x?

thanks in advance!
Logged

Nibbler

  • Guest
Re: Adsense in 1.4.x
« Reply #2 on: February 17, 2006, 05:53:43 pm »

Make sure you put the {AD} before the {GALLERY} tag, make it a custom footer otherwise.
Logged

lordprodigy

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 228
    • B514 ///
Re: Adsense in 1.4.x
« Reply #3 on: February 17, 2006, 06:24:58 pm »

right ON.. that was the problem. its working now. thanks.  ;)

I had to update the old code (menu section) to meet 1.4.x standard. Here is what I used. Its working. Is it correct?

Code: [Select]
// Function for page header and Google Ads
function pageheader($section, $meta = '')
{
    global $CONFIG, $THEME_DIR;
    global $template_header, $lang_charset, $lang_text_dir;

    $custom_header = cpg_get_custom_include($CONFIG['custom_header_path']);

    header('P3P: CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"');
    user_save_profile();

    $template_vars = array('{LANG_DIR}' => $lang_text_dir,
        '{TITLE}' => $CONFIG['gallery_name'] . ' - ' . strip_tags(bb_decode($section)),
        '{CHARSET}' => $CONFIG['charset'] == 'language file' ? $lang_charset : $CONFIG['charset'],
        '{META}' => $meta,
        '{GAL_NAME}' => $CONFIG['gallery_name'],
        '{GAL_DESCRIPTION}' => $CONFIG['gallery_description'],
        '{SYS_MENU}' => theme_main_menu('sys_menu'),
        '{SUB_MENU}' => theme_main_menu('sub_menu'),
        '{ADMIN_MENU}' => theme_admin_mode_menu(),
        '{CUSTOM_HEADER}' => $custom_header,
        '{AD}' => generate_ad_block()       
);

    echo template_eval($template_header, $template_vars);
}

function generate_ad_block()
{
if (!defined('REGISTER_PHP') && !defined('LOGIN_PHP')){
$ad = <<< EOT
your google ad code goes here
EOT;

} else $ad = '';

return $ad;
}

mark this solved and compatible with 1.4.x
« Last Edit: February 17, 2006, 06:30:17 pm by lordprodigy »
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 19 queries.