I have the ads showing on my site deal-depot.com, and the site validates fine. The problem I'm having is the way the ads are shown. They are all the way to the left of the page and close to the background color (because of the css) I wanted them to show up in the table under the adsense ads (where the links would look right). Can anyone help out a php 1D-10-T with where the php includes should go to get the links where they should be. Footer.php <? $tmpl->SetTemplate("footer"); $footerTemplate = $tmpl->ParseTemplate(); echo $footerTemplate; ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../'); include ('ad_network_296.php'); echo $ad_network; ?> PHP: Footer.tpl </td> </tr> </table> <table width="800" align="center" bgcolor="#FFFFFF" style="border: 7px solid #F2F2F2;> <tr> <td> <table width="800" align="center" bgcolor="#FFFFFF""> <tr> <td> <style type="text/css"> .copywrite {font-family: arial, verdana, sans-serif;font-size : 10px; font-variant: small-caps; font-weight : normal; padding: 2px; padding-left:20px;} a:link.copywrite, a:active.copywrite, a:visited.copywrite {font-family: Arial, verdana, sans-serif; font-size : 10px; font-variant: small-caps; font-weight : normal; color : #666666; text-align : center; text-decoration : none; padding: 2px;} a:hover.copywrite {color : #7D7B7B;} </style> <div align=center> <span class="copywrite">Copywrite © 2004 - 2005 <a href="http://www.deal-depot.com" class="copywrite">Deal Depot</a></span> </div> </td> </tr> <table width="800" align="center" bgcolor="#FFFFFF"> <tr> <td> <div align="center"> <script type="text/javascript"><!-- google_ad_client = "pub-5666569283544875"; google_ad_width = 728; google_ad_height = 90; google_ad_format = "728X90_as"; google_ad_channel ="2972539443"; google_color_border = "FFFFFF"; google_color_bg = "FFFFFF"; google_color_link = "4276A6"; google_color_url = "FFFFFF"; google_color_text = "4276A6"; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script><br /> </div> </td> </tr> </table> </td> </tr> </table> </body> </html> Code (markup):
It seems to me, that footer.tpl is read into the $footerTemplate variable. I'm not sure if this is the best way, you could split the $footerTemplate variable into two parts at whatever point you want the ads, then do $footerTemplate1 . $ad_network . $footerTemplate2. You could probably use www.php.net/split or www.php.net/explode. You could even put something in like [SPLIT] and split on that word. Not sure of the best way to do it, for immediate help, irc.freenode.net #PHP is a great place, lots of helpful people. But I am not the best programmer in the world, but that is how I would do it. Someone else may have a better suggestion.
As nddb says you could do something like this.. Footer.php <? $tmpl->SetTemplate("footer"); $footerTemplate = $tmpl->ParseTemplate(); // echo $footerTemplate; list ($top,$bottom) = explode ('{{SPLIT_HERE}}',$footerTemplate); ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../'); include ('ad_network_296.php'); echo $top.$ad_network.$bottom; ?> PHP: Footer.tpl </td> </tr> </table> <table width="800" align="center" bgcolor="#FFFFFF" style="border: 7px solid #F2F2F2;> <tr> <td> <table width="800" align="center" bgcolor="#FFFFFF""> <tr> <td> <style type="text/css"> .copywrite {font-family: arial, verdana, sans-serif;font-size : 10px; font-variant: small-caps; font-weight : normal; padding: 2px; padding-left:20px;} a:link.copywrite, a:active.copywrite, a:visited.copywrite {font-family: Arial, verdana, sans-serif; font-size : 10px; font-variant: small-caps; font-weight : normal; color : #666666; text-align : center; text-decoration : none; padding: 2px;} a:hover.copywrite {color : #7D7B7B;} </style> <div align=center> <span class="copywrite">Copywrite © 2004 - 2005 <a href="http://www.deal-depot.com" class="copywrite">Deal Depot</a></span> </div> </td> </tr> <table width="800" align="center" bgcolor="#FFFFFF"> <tr> <td> <div align="center"> <script type="text/javascript"><!-- google_ad_client = "pub-5666569283544875"; google_ad_width = 728; google_ad_height = 90; google_ad_format = "728X90_as"; google_ad_channel ="2972539443"; google_color_border = "FFFFFF"; google_color_bg = "FFFFFF"; google_color_link = "4276A6"; google_color_url = "FFFFFF"; google_color_text = "4276A6"; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script><br /> [color=red][b]{{SPLIT_HERE}}[/B][/COLOR] </div> </td> </tr> </table> </td> </tr> </table> </body> </html> Code (markup):