Page 1 of 1

Re: Specify different ads for different categories?

Posted: Mon May 30, 2011 4:33 am
by kimgold2010
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.