carlos69 Posted June 24, 2006 Posted June 24, 2006 Hi All, I've been trying too long now to add Adsense in the footer.php or the banner manager so I come crawling here for help, I have read all the threads regarding this topic but still cant get it to work. So how to do it? This is my 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 © 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 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 } ?> And this is the google code that I would like to add. <!-- Search Google --> <center> <form method="get" action="http://www.google.com/custom" target="google_window"> <table bgcolor="#ffffff"> <tr><td nowrap="nowrap" valign="top" align="left" height="32"> <a href="http://www.google.com/"> <img src="http://www.google.com/logos/Logo_25wht.gif" border="0" alt="Google" align="middle"></img></a> <input type="text" name="q" size="31" maxlength="255" value=""></input> <input type="submit" name="sa" value="Search"></input> <input type="hidden" name="client" value="pub-0269717150018777"></input> <input type="hidden" name="forid" value="1"></input> <input type="hidden" name="ie" value="ISO-8859-1"></input> <input type="hidden" name="oe" value="ISO-8859-1"></input> <input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;A LC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1;"></input> <input type="hidden" name="hl" value="en"></input> </td></tr></table> </form> </center> <!-- Search Google --> Any help would be appreciated.
Guest Posted June 24, 2006 Posted June 24, 2006 Well I just went through this two weeks ago lol. But if you have any firewall/anti pop up/virus software running, disable it and view it in Internet Explorer. Mine were working right but didn't know it because my internet security software was blocking it AND it only showed in IE. Hi All, I've been trying too long now to add Adsense in the footer.php or the banner manager so I come crawling here for help, I have read all the threads regarding this topic but still cant get it to work. So how to do it? This is my 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 ? 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 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 } ?> And this is the google code that I would like to add. <!-- Search Google --> <center> <form method="get" action="http://www.google.com/custom" target="google_window"> <table bgcolor="#ffffff"> <tr><td nowrap="nowrap" valign="top" align="left" height="32"> <a href="http://www.google.com/"> <img src="http://www.google.com/logos/Logo_25wht.gif" border="0" alt="Google" align="middle"></img></a> <input type="text" name="q" size="31" maxlength="255" value=""></input> <input type="submit" name="sa" value="Search"></input> <input type="hidden" name="client" value="pub-0269717150018777"></input> <input type="hidden" name="forid" value="1"></input> <input type="hidden" name="ie" value="ISO-8859-1"></input> <input type="hidden" name="oe" value="ISO-8859-1"></input> <input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;A LC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1;"></input> <input type="hidden" name="hl" value="en"></input> </td></tr></table> </form> </center> <!-- Search Google --> Any help would be appreciated.
carlos69 Posted June 24, 2006 Author Posted June 24, 2006 I posted the wrong code, I have no problems placing the search box in the footer. But when I try adding the adsense for content code it doesnt work. This is the code I wish to add. <script type="text/javascript"><!-- google_ad_client = "pub-0269717150018777"; google_ad_width = 728; google_ad_height = 90; google_ad_format = "728x90_as"; google_ad_type = "text_image"; google_ad_channel =""; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
lrjbart Posted June 24, 2006 Posted June 24, 2006 You can add the code in the banner manager just add your code in the html text box.
carlos69 Posted July 1, 2006 Author Posted July 1, 2006 You can add the code in the banner manager just add your code in the html text box. Ive tried that with my usual installation and with a totally new installation. The ads are not showing up at all in the footer. The normal banner dissapears and thats it. Any ideas?
matrix2223 Posted July 1, 2006 Posted July 1, 2006 the best and easiest way to do this is name a file say adds.php place it in the footer with this code <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" align="center"> <TR> <TD><center><?php if ($request_type == NONSSL) { /* only show adsense in NON SSL else it causes warning */ include(DIR_WS_BOXES . 'add.php'); } ?> </center> </TD> </TR> </TABLE><br> then place your add.php file in the includes/boxes/ your file should have this inside <?php /* $Id: adds.php,v 1.6 2003/02/10 22:31:00 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions [url=http://www.oscommerce.com]http://www.oscommerce.com[/url] Copyright ? 2003 osCommerce Released under the GNU General Public License */ ?> <!-- adds //--> <tr> <td> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_ADDS); new infoBoxHeading($info_box_contents, false, false); $info_box_contents = array(); $info_box_contents[] = array('align' => 'center', 'text' => 'YOUR JAVA SCRIPT GOES HERE'); new infoBox($info_box_contents); ?> <!-- adds_eof //--> Also dont forget to name your new file in the includes/filenames.php Hope this helps out, Eric
carlos69 Posted July 1, 2006 Author Posted July 1, 2006 Hi thanks for the help, but it is still not working. This is my 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. */ echo FOOTER_TEXT_BODY ?> <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" align="center"> <TR> <TD><center><?php if ($request_type == NONSSL) { /* only show adsense in NON SSL else it causes warning */ include(DIR_WS_BOXES . 'adds.php'); } ?> </center> </TD> </TR> </TABLE><br> </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 } ?> My filenames.php <?php /* $Id: filenames.php,v 1.4 2003/06/11 17:38:00 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ // define the filenames used in the project define('FILENAME_ACCOUNT', 'account.php'); define('FILENAME_ACCOUNT_EDIT', 'account_edit.php'); define('FILENAME_ACCOUNT_HISTORY', 'account_history.php'); define('FILENAME_ACCOUNT_HISTORY_INFO', 'account_history_info.php'); define('FILENAME_ACCOUNT_NEWSLETTERS', 'account_newsletters.php'); define('FILENAME_ACCOUNT_NOTIFICATIONS', 'account_notifications.php'); define('FILENAME_ACCOUNT_PASSWORD', 'account_password.php'); define('FILENAME_ADDRESS_BOOK', 'address_book.php'); define('FILENAME_ADDRESS_BOOK_PROCESS', 'address_book_process.php'); define('FILENAME_ADVANCED_SEARCH', 'advanced_search.php'); define('FILENAME_ADVANCED_SEARCH_RESULT', 'advanced_search_result.php'); define('FILENAME_ALSO_PURCHASED_PRODUCTS', 'also_purchased_products.php'); define('FILENAME_CHECKOUT_CONFIRMATION', 'checkout_confirmation.php'); define('FILENAME_CHECKOUT_PAYMENT', 'checkout_payment.php'); define('FILENAME_CHECKOUT_PAYMENT_ADDRESS', 'checkout_payment_address.php'); define('FILENAME_CHECKOUT_PROCESS', 'checkout_process.php'); define('FILENAME_CHECKOUT_SHIPPING', 'checkout_shipping.php'); define('FILENAME_CHECKOUT_SHIPPING_ADDRESS', 'checkout_shipping_address.php'); define('FILENAME_CHECKOUT_SUCCESS', 'checkout_success.php'); define('FILENAME_CONTACT_US', 'contact_us.php'); define('FILENAME_CONDITIONS', 'conditions.php'); define('FILENAME_COOKIE_USAGE', 'cookie_usage.php'); define('FILENAME_CREATE_ACCOUNT', 'create_account.php'); define('FILENAME_CREATE_ACCOUNT_SUCCESS', 'create_account_success.php'); define('FILENAME_DEFAULT', 'index.php'); define('FILENAME_DOWNLOAD', 'download.php'); define('FILENAME_INFO_SHOPPING_CART', 'info_shopping_cart.php'); define('FILENAME_LOGIN', 'login.php'); define('FILENAME_LOGOFF', 'logoff.php'); define('FILENAME_NEW_PRODUCTS', 'new_products.php'); define('FILENAME_PASSWORD_FORGOTTEN', 'password_forgotten.php'); define('FILENAME_POPUP_IMAGE', 'popup_image.php'); define('FILENAME_POPUP_SEARCH_HELP', 'popup_search_help.php'); define('FILENAME_PRIVACY', 'privacy.php'); define('FILENAME_PRODUCT_INFO', 'product_info.php'); define('FILENAME_PRODUCT_LISTING', 'product_listing.php'); define('FILENAME_PRODUCT_REVIEWS', 'product_reviews.php'); define('FILENAME_PRODUCT_REVIEWS_INFO', 'product_reviews_info.php'); define('FILENAME_PRODUCT_REVIEWS_WRITE', 'product_reviews_write.php'); define('FILENAME_PRODUCTS_NEW', 'products_new.php'); define('FILENAME_REDIRECT', 'redirect.php'); define('FILENAME_REVIEWS', 'reviews.php'); define('FILENAME_SHIPPING', 'shipping.php'); define('FILENAME_SHOPPING_CART', 'shopping_cart.php'); define('FILENAME_SPECIALS', 'specials.php'); define('FILENAME_SSL_CHECK', 'ssl_check.php'); define('FILENAME_TELL_A_FRIEND', 'tell_a_friend.php'); define('FILENAME_UPCOMING_PRODUCTS', 'upcoming_products.php'); define('FILENAME_ADDS', 'adds.php'); ?> and my adds.php box code <?php /* $Id: adds.php,v 1.6 2003/02/10 22:31:00 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions [url=http://www.oscommerce.com]http://www.oscommerce.com[/url] Copyright ? 2003 osCommerce Released under the GNU General Public License */ ?> <!-- adds //--> <tr> <td> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_ADDS); new infoBoxHeading($info_box_contents, false, false); $info_box_contents = array(); $info_box_contents[] = array('align' => 'center', 'text' => '<script type="text/javascript"><!-- google_ad_client = "pub-0269717150018777"; google_ad_width = 728; google_ad_height = 90; google_ad_format = "728x90_as"; google_ad_type = "text_image"; google_ad_channel =""; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>'); new infoBox($info_box_contents); ?> <!-- adds_eof //--> The box is showing up, but no adds and the title of the box reads BOX_HEADING_ADDS Any ideas on what might be wrong??
matrix2223 Posted July 1, 2006 Posted July 1, 2006 Sorry forgot to tell you in lang./english.php add define('BOXHEADING_ADDS', 'YOUR NAME HERE'); As for the adds not showing it should only not show when your on a https page/s
matrix2223 Posted July 1, 2006 Posted July 1, 2006 Here is a sniblet of my footer so you can compair it to yours <?php if ($banner = tep_banner_exists('dynamic', '468x60')) { ?> <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 } ?> <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" align="center"> <TR> <TD><center><?php if ($request_type == NONSSL) { /* only show adsense in NON SSL else it causes warning */ include(DIR_WS_BOXES . 'google.js'); } ?> </center> </TD> </TR> </TABLE><br> Egnore the .js use the php instead
matrix2223 Posted July 1, 2006 Posted July 1, 2006 To see what it look like look under my profile and look at my site
lrjbart Posted July 1, 2006 Posted July 1, 2006 Ive tried that with my usual installation and with a totally new installation. The ads are not showing up at all in the footer. The normal banner dissapears and thats it. Any ideas? Did you turn the add on in the banner manager e.g. is the green light on. I tried your code in my banner manager and it worked perfectly
Recommended Posts
Archived
This topic is now archived and is closed to further replies.