I am currently working on my own phptemplate and I have a question.
I am trying to ad google ads to content but I only want them to appear when someone clicks on read more.
Any advice? I am using the adsense module.
if (module_exist("adsense")) { print adsense_display("120x600", 2, 4); }
Peter Apockotos wrote:
I am currently working on my own phptemplate and I have a question.
I am trying to ad google ads to content but I only want them to appear when someone clicks on read more.
Any advice? I am using the adsense module.
With the phptemplate module, I think this modification might do what you want;
if (module_exist("adsense")) { print adsense_display("120x600", 2, 4); }
(Also, adjusted to fit the Drupal codying style)
if (module_exist("adsense")) { if ($page) { print adsense_display("120x600", 2, 4); } }
On Aug 11, 2005, at 10:45 AM, Earl Miles wrote:
Peter Apockotos wrote:
I am currently working on my own phptemplate and I have a question. I am trying to ad google ads to content but I only want them to appear when someone clicks on read more. Any advice? I am using the adsense module.
With the phptemplate module, I think this modification might do what you want;
if (module_exist("adsense")) { print adsense_display("120x600", 2, 4); }
(Also, adjusted to fit the Drupal codying style)
if (module_exist("adsense")) { if ($page) { print adsense_display("120x600", 2, 4); } }
Will that only let the ad load when the full story is shown?
Peter Apockotos wrote:
if (module_exist("adsense")) { if ($page) { print adsense_display("120x600", 2, 4); } }
Will that only let the ad load when the full story is shown?
I need to doublecheck and drupal.org is timing out just now; you can look for yourself in the handbooks under themeing the PHPTemplate engine, where it gives a list of variables (that I think is 1 revision out of date, but is still pretty accurate) and it tells you all of the variables. If I Remember It Right, $page is set to true if you're looking at a node's full page. It's possible I remember this wrong and there's a different variable that tells you this.
I'll try to check again later today if you're not able to figure this out with that info.
On Aug 11, 2005, at 10:58 AM, Earl Miles wrote:
Peter Apockotos wrote:
if (module_exist("adsense")) { if ($page) { print adsense_display("120x600", 2, 4); } }
Will that only let the ad load when the full story is shown?
I need to doublecheck and drupal.org is timing out just now; you can look for yourself in the handbooks under themeing the PHPTemplate engine, where it gives a list of variables (that I think is 1 revision out of date, but is still pretty accurate) and it tells you all of the variables. If I Remember It Right, $page is set to true if you're looking at a node's full page. It's possible I remember this wrong and there's a different variable that tells you this.
I'll try to check again later today if you're not able to figure this out with that info. --
It wouldn't make any sense to me. If you see http:// www.apockotos.com I am almost done with the conversion of my template. But I don't enough about php to get all of the functionality I want.
And thank you for assisting me.
Peter Apockotos wrote:
On Aug 11, 2005, at 10:58 AM, Earl Miles wrote:
Peter Apockotos wrote:
if (module_exist("adsense")) { if ($page) { print adsense_display("120x600", 2, 4); } }
It wouldn't make any sense to me. If you see http:// www.apockotos.com I am almost done with the conversion of my template. But I don't enough about php to get all of the functionality I want.
And thank you for assisting me.
I did doublecheck finally, and yes, that little modified snippet should make adsense only show up when looking at a node in full page view.
On Aug 11, 2005, at 10:17 PM, Earl Miles wrote:
Peter Apockotos wrote:
On Aug 11, 2005, at 10:58 AM, Earl Miles wrote:
Peter Apockotos wrote:
if (module_exist("adsense")) { if ($page) { print adsense_display("120x600", 2, 4); } }
It wouldn't make any sense to me. If you see http:// www.apockotos.com I am almost done with the conversion of my template. But I don't enough about php to get all of the functionality I want. And thank you for assisting me.
I did doublecheck finally, and yes, that little modified snippet should make adsense only show up when looking at a node in full page view. --
Thank you Earl!!
Hi,
In the node.tpl.php you can use the $main value which is set to 0 when you are looking at the full content.
Gordon.
On Thu, 2005-08-11 at 05:40 -0400, Peter Apockotos wrote:
I am currently working on my own phptemplate and I have a question.
I am trying to ad google ads to content but I only want them to appear when someone clicks on read more.
Any advice? I am using the adsense module.
if (module_exist("adsense")) { print adsense_display("120x600", 2, 4); }