Specify different ads for different categories?

Any question you may have to help determine if this is the right forum script for you.
Post Reply
kimgold2010
Posts: 44
Joined: Fri Jun 18, 2010 2:35 pm

Re: Specify different ads for different categories?

Post by kimgold2010 » Mon May 30, 2011 4:33 am

Chuckun wrote:My question is as the title suggests.. Can I specify which adverts to show depending on what category the forum belongs to in the board directory?

Example: If a users forum is registered under a 'Technology' category, can I define an ad code specifically for the Technology category?

If so, would it be as simple as adding something like the following in the advert area (I believe you can use PHP there?):

Code: Select all

<? if($category_id == "5") {
include("../ads/tech_ads.php");
} else {
include("../ads/main_ads.php");
}
?>


Thanks for your time,
Chuckun

Hi!

You can follow these steps:
    1. Log into Admin Area PHP Multiforums.
    2. Look in System->Configuration->Hosted forums->Security Options->click select 'Yes' to Execute PHP Code in Ads.
    3. Look in Ads->Manages Ads->in "Is this PHP Code?" option->click select 'Yes'. Now, you can use php code in Ads.

    Code: Select all

    if ($echophp->forum['cat'] ==  '1')
    {
         include('put file path here');
    }
    else
    {
         include('put file path here');
    }

Hope this help. Let me know if you have any questions.

Thank you.

Post Reply