Osclass forums

Support forums => Tips, tricks, and tutorials => Topic started by: agtbook on March 05, 2017, 07:11:45 am

Title: Different advertising banner in different categories
Post by: agtbook on March 05, 2017, 07:11:45 am
How to put a different advertising banner by category ?
Title: Re: Different advertising banner in different categories
Post by: marius-ciclistu on May 31, 2017, 11:30:14 pm
HI.
Just as an ideea, you could  compare the url of the page (https://stackoverflow.com/questions/1283327/how-to-get-url-of-current-page-in-php#1283330)  to see if it contains "category_name" and then execute a banner script for that category. You can compare the 2 strings of characters using php functions(you can find them on the web by searching).

You could do it in a case or with one if () statement for every category.

You can put all this code into admin area under every banner location's input area.

Maybe someone else would provide a code that returns only the category name based on the url or I don't know more details about osclass regarding this.