Support Forums - Classified Ads Script Osclass
Osclass plugin support => Advertisement Manager Plugin => Topic started by: webcity on May 01, 2021, 12:11:25 PM
-
Hi,
I've setup a banner and a group, selected the banner to show in one category, and this works OK and shows in the selected category..
When I view mysite.com/search to show all listings, the banner I have created shows even though I haven't created a banner to show here.
Can you please suggest how I stop showing a banner in the mysite.com/search results?
Many thanks
-
@webcity
In index.php of plugin find this code:
function show_banner( $id_name, $only_banner = NULL, $stats_not_count = NULL ) {
//Get ID, if shortname
if(is_int($id_name)) {
$id = $id_name;
} else {
$b = ModelAds::newInstance()->getBannerGroup( '', '', $id_name );
$id = isset($b['b_id']) ? $b['b_id'] : 0;
}
//Category check
$cat = osc_search_category_id();
$cat = isset($cat[0]) ? $cat[0] : '';
and change it into:
function show_banner( $id_name, $only_banner = NULL, $stats_not_count = NULL ) {
//Get ID, if shortname
if(is_int($id_name)) {
$id = $id_name;
} else {
$b = ModelAds::newInstance()->getBannerGroup( '', '', $id_name );
$id = isset($b['b_id']) ? $b['b_id'] : 0;
}
//Category check
$cat = osc_search_category_id();
$cat = isset($cat[0]) ? $cat[0] : '';
if(($cat == 0 or $cat == '') && osc_is_search_page()) {
return false;
}
-
Thanks for your help.
That solved the problem, all works great now :-)