Fix for errors shown when using ads and working on localhost

Resolve undefined variable errors for ads on localhost.

Overview

The issue occurs because the `$counter` variable is not defined when checking advertisement conditions in the CF template.
Modify the advertisement template file to check if the `$counter` variable is set before using it in the conditional statement.

Answered
ct ctweed 01 Mar, 2020
Answer
For development I find it useful to clone the live system to localhost and do the trial validation when needed. I noticed a bunch of error messages reporting "counter" as an undefined variable when using ads, and thought I'd send a fix for it:

in components\com_chronoforums2\chronoforums\themes\default\views\topics\advertisement.php

Change
if(!empty($this->get('settings.adverts_code', ''))){ 
to
 if(isset($counter) && !empty($this->get('settings.adverts_code', ''))){
This topic is locked and no more replies can be posted.