Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

SSL & Google Adsense Banner in Footer


k1w1guy

Recommended Posts

Posted

I had my site secure and all was fine then I added the Google Adsense code to english.php of MangoPill.com.

 

It looks great but hinders with the SSL when you Log-In or Create an Account.

 

Did I paste the adsense script into the wrong file??

 

Thanks,

 

Pete

Posted

You did nothing wrong according to the Adwords directions.

The SSL problem is caused by the fact the Adwords javascript is sourced from a http (nonsecure) site.

 

A viable solution is to display the Adwords scripts only when the pages are not protected by SSL.

 

Try this...

if ($request_type != 'SSL') {
Your Adwords stuff here...
}

 

HTH,

Robert

Posted
You did nothing wrong according to the Adwords directions.

The SSL problem is caused by the fact the Adwords javascript is sourced from a http (nonsecure) site.

 

A viable solution is to display the Adwords scripts only when the pages are not protected by SSL.

 

Try this...

if ($request_type != 'SSL') {
Your Adwords stuff here...
}

 

HTH,

Robert

 

Thanks Robert.

 

Where exactly do I insert this code into the english.php code. I tried several places and got a syntax error. Here is the standard OSC footer codes in english.php with my info in it.

 

Please insert your code below the way you think it should work. Thanks.

 

define('FOOTER_TEXT_BODY', '[Would like your code here]<br><br>Copyright ? 2003 <a href="http://www.sidekicksonline.com" target="_blank">SidekicksOnline.com</a><br>Our Partner Sites: <a href="http://www.sidekicksclub.com" target="_blank">SidekicksClub</a>, <a href="http://www.quallife.info" target="_blank">QualLife.INFO</a>, <a href="http://www.procalshakes.com" target="_blank">ProCalShakes.com</a><br>Ph: (303) 675-4927');
?>

Posted

Ah...

English.php is a file that simply contains a bunch of defines. I would not recommend adding php code in that file.

However, if you want to to place the Google code in your footer above the copyright follow the directions below:

 

Find the file called footer.php. It should be in your ../catalog/includes/ folder.

I am guessing (since I am not near my work computer) that you can open ../catalog/includes/footer.php and search for

echo FOOTER_TEXT_BODY;

 

Right above it add

if ($request_type != 'SSL') {
Your Adwords stuff here...
}

 

Give it a shot and let me know how it goes.

Robert

Posted
Ah...

English.php is a file that simply contains a bunch of defines.  I would not recommend adding php code in that file.

However, if you want to to place the Google code in your footer above the copyright follow the directions below:

 

Find the file called footer.php. It should be in your ../catalog/includes/ folder.

I am guessing (since I am not near my work computer) that you can open ../catalog/includes/footer.php and search for

echo FOOTER_TEXT_BODY;

 

Right above it add

if ($request_type != 'SSL') {
Your Adwords stuff here...
}

 

Give it a shot and let me know how it goes.

Robert

 

I got this error:

Parse error: parse error, unexpected '<' in /home/content/k/1/w/k1w1guy/html/includes/footer.php on line 44

 

Heres how I did the code in includes/footer.php

 

<?php
/*
 $Id: footer.php,v 1.26 2003/02/10 22:30:54 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require(DIR_WS_INCLUDES . 'counter.php');
?>
<table border="0" width="100%" cellspacing="0" cellpadding="1">
 <tr class="footer">
   <td class="footer">  <?php echo strftime(DATE_FORMAT_LONG); ?>  </td>
   <td align="right" class="footer">  <?php echo $counter_now . ' ' . FOOTER_TEXT_REQUESTS_SINCE . ' ' . $counter_startdate_formatted; ?>  </td>
 </tr>
</table>
<br>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
   <td align="center" class="smallText">
<?php
/*
 The following copyright announcement can only be
 appropriately modified or removed if the layout of
 the site theme has been modified to distinguish
 itself from the default osCommerce-copyrighted
 theme.

 For more information please read the following
 Frequently Asked Questions entry on the osCommerce
 support site:

 http://www.oscommerce.com/community.php/faq,26/q,50

 Please leave this comment intact together with the
 following copyright announcement.
*/

if ($request_type != 'SSL') {
<script type="text/javascript"><!--
google_ad_client = "pub-0392299737523608";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_channel ="";
google_color_border = "DE0000";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_url = "008000";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
 src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
}
 echo FOOTER_TEXT_BODY
?>
   </td>
 </tr>
</table>
<?php
 if ($banner = tep_banner_exists('dynamic', '468x50')) {
?>
<br>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
   <td align="center"><?php echo tep_display_banner('static', $banner); ?></td>
 </tr>
</table>
<?php
 }
?>

Posted
I got this error:

Parse error: parse error, unexpected '<' in /home/content/k/1/w/k1w1guy/html/includes/footer.php on line 44

 

Heres how I did the code in includes/footer.php

 

<?php
/*
 $Id: footer.php,v 1.26 2003/02/10 22:30:54 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require(DIR_WS_INCLUDES . 'counter.php');
?>
<table border="0" width="100%" cellspacing="0" cellpadding="1">
 <tr class="footer">
   <td class="footer">  <?php echo strftime(DATE_FORMAT_LONG); ?>  </td>
   <td align="right" class="footer">  <?php echo $counter_now . ' ' . FOOTER_TEXT_REQUESTS_SINCE . ' ' . $counter_startdate_formatted; ?>  </td>
 </tr>
</table>
<br>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
   <td align="center" class="smallText">
<?php
/*
 The following copyright announcement can only be
 appropriately modified or removed if the layout of
 the site theme has been modified to distinguish
 itself from the default osCommerce-copyrighted
 theme.

 For more information please read the following
 Frequently Asked Questions entry on the osCommerce
 support site:

 http://www.oscommerce.com/community.php/faq,26/q,50

 Please leave this comment intact together with the
 following copyright announcement.
*/

if ($request_type != 'SSL') {
<script type="text/javascript"><!--
google_ad_client = "pub-0392299737523608";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_channel ="";
google_color_border = "DE0000";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_url = "008000";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
 src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
}
 echo FOOTER_TEXT_BODY
?>
   </td>
 </tr>
</table>
<?php
 if ($banner = tep_banner_exists('dynamic', '468x50')) {
?>
<br>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
   <td align="center"><?php echo tep_display_banner('static', $banner); ?></td>
 </tr>
</table>
<?php
 }
?>

 

 

 

 

like this

 

<?php

if ($request_type != 'SSL') {

?>

<script type="text/javascript"><!--

google_ad_client = "pub-0392299737523608";

google_ad_width = 728;

google_ad_height = 90;

google_ad_format = "728x90_as";

google_ad_channel ="";

google_color_border = "DE0000";

google_color_bg = "FFFFFF";

google_color_link = "0000FF";

google_color_url = "008000";

google_color_text = "000000";

//--></script>

<script type="text/javascript"

src="http://pagead2.googlesyndication.com/pagead/show_ads.js">

</script>

<?php

}

?>

Treasurer MFC

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...