Jump to content

[SOLVED] Adsense Exceptions


Recommended Posts

We'd like to add exceptions to the positioning for the Adsense block to have it NOT show up on nay page
that requires SSL.

Reasoning behind this is that some ads may not be secure and we don't want the security dialog popping up.
Is there a way to know if a certain page requires SSL?

I placed an exception on order.php and history.php but there are others that the url is changed to https when
you have SSL enabled.

Any ideas?

Link to comment
Share on other sites

Try changing the hookHome function in modules/gadsense/gadsense.php from:

function hookHome($params)
{
   $output = html_entity_decode(Configuration::get('GADSENSE_ID'), ENT_COMPAT, 'UTF-8');
   return $output;
}



to:

function hookHome($params)
{
   global $protocol_link;

   $output = '';

   if ($protocol_link == 'http://')
       $output = html_entity_decode(Configuration::get('GADSENSE_ID'), ENT_COMPAT, 'UTF-8');
   return $output;
}

Link to comment
Share on other sites

Had to rewrite it like this because $protocol_content is what
we were looking for...

 function hookHome($params) {
   global $protocol_ssl;
   global $protocol_content;
   $output = '';
   if ($protocol_content != $protocol_ssl) {
     $output = html_entity_decode(Configuration::get('GADSENSE_ID'),  
                                                 ENT_COMPAT, 'UTF-8');
   }
   return $output;    
 }

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...