News:

Dear forum visitors, if the support forum is not available, please try again a few minutes later. Thanks!

Main Menu
Support-Forum

Limit google ads to 3 per page

Started by bositman, 08.05.2015 11:16:25

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bositman

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 :)
  •  

Arno

Hi bositman,
your example must be from an older version (maybe 1.9.x).
But i will see what i can do...
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •  

bositman

Indeed it's from 1.9.x. Thanks :)
  •  

bositman

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++;
  •