jDownloads Support Forum

Older Versions => jDownloads 3.2 (Support ended) => Suggestions - Feature Request => Topic started by: bositman on 08.05.2015 11:16:25

Title: Limit google ads to 3 per page
Post by: bositman on 08.05.2015 11:16:25
When using the google adsese feature, if you set it to appear in each download of a category and you have >3 downloads in some category, jdownloads will display more than 3 google ads in a single category page, which violates the limits of google.

I actually asked this a couple of years back ( :P ) and arno gave me this solution (pretty simple really):

omponents/com_jdownloads/jdownloads.html.php

Line 650 ADD:
$sum_google=0;

Line 682:

// google adsense
             if (($jlistConfig['google.adsense.active']) && ($sum_google <= 2)) {

                     $html_file = str_replace('{google_adsense}', stripslashes($jlistConfig['google.adsense.code']), $html_file);
                     $sum_google++;
                 } else {
                     $html_file = str_replace('{google_adsense}', '', $html_file);
                 } 


Not sure if it would need to be included anywhere else, but I think it should be in the latest jdownloads :)
Title: Re: Limit google ads to 3 per page
Post by: Arno on 08.05.2015 13:58:11
Hi bositman,
your example must be from an older version (maybe 1.9.x).
But i will see what i can do...
Title: Re: Limit google ads to 3 per page
Post by: bositman on 08.05.2015 14:07:32
Indeed it's from 1.9.x. Thanks :)
Title: Re: Limit google ads to 3 per page
Post by: bositman on 06.08.2015 14:18:10
I've made the modification for the new version of Jdownloads. Here it is (i guess other views should be modified as well) :


components/com_jdownloads/views/category/tmpl/default.php

Line 709 ADD $sum_google=0;
Line 791 if (($jlistConfig['google.adsense.active']) && ($sum_google <= 2)) {
Line 793  $sum_google++;