Log in

View Full Version : 如何不让phpld首页不显示adsense?


topvip
2007-07-01, 08:29 AM
This mod will show Google Adsense under the "Featured Links" as "Sponsored Links". You can see what I mean on the site in my sig.

This mod was inspired from a thread of "seothatworks", Thank you!

In main.tpl just before "{* Links heading and sorting*}" add:
{if $category.ID != 0}
{include file="googlead.tpl"}
{/if}

Make a new file and call it googlead.tpl with these lines:
<h3>{l}Sponsored Links{/l}</h3>

<DIV STYLE="text-align:center;margin-bottom:-10px;">
<script type="text/javascript"><!--
google_ad_client = "XXXXXXXXXXXX";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel ="XXXXXXXXXXXXX";
google_color_border = "FFFFFF";
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>
</DIV>

topvip
2007-07-01, 08:31 AM
How do I get adsense to appear on the search pages as well?

to make adsense appear in the search page as well, just use the following code:
{if $category.ID gt 0 or $qu}
{include file="googlead.tpl"}
{/if}

instead of
{if $category.ID != 0}
{include file="googlead.tpl"}
{/if}

topvip
2007-07-01, 08:36 AM
你也可以这么做:在main.tpl中加入

{if $category.ID != 0}
{literal}
<center>
<script type="text/javascript"><!--
google_ad_client = "pub-xxxxxxxxxxxxxxxx";
google_ad_width = 336;
google_ad_height = 280;
google_ad_format = "336x280_as";
google_ad_type = "text_image";
google_ad_channel = "";
google_color_border = "336699";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_text = "000000";
google_color_url = "008000";
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>


</center>
{/literal}
{/if}