News:

Support for jDownloads 3 has been ended
Since 17 August 2023 Joomla.org has discontinued support for Joomla 3.x. Therefore, we will no longer offer official support for our Joomla 3 jDownloads version 3.9.x from January 2024.
Please update your website to the latest Joomla version (Joomla 4 or Joomla 5) as soon as possible. Afterwards, please update jDownloads to the latest published version. The longer you delay, the more difficult the upgrade process for your website is likely to be.

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