Extra ad Plugin Help

leonor

Active Member
License Active
Hm i have a plugin that are showing me ads to the right category.

like this:
PHP:
$TMPL['extra_ad'] = '';
 
if($TMPL['cat_exist'] == "Cat one")
{
    $TMPL['extra_ad'] .= '<center>banner comes here</center>';
 
}
 
if($TMPL['cat_exist'] == "Cat two")
{
    $TMPL['extra_ad'] .= '<center>banner comes here</center>';
 
}
Normal AD
But for some category i didint need this, and i want to display my standard Ads.
I tryed it with else and else if, but i didint get it to work :/


Some have a idea?

greetz
leonor
 

Basti

Administrator
Staff member
PHP:
$TMPL['extra_ad'] = '';
 
if($TMPL['cat_exist'] == "Cat one")
{
    $TMPL['extra_ad'] .= '<center>banner comes here</center>';
 
}
elseif($TMPL['cat_exist'] == "Cat two")
{
    $TMPL['extra_ad'] .= '<center>banner comes here</center>';
 
}
 
elseif($TMPL['cat_exist'] == "Cat three" ||  $TMPL['cat_exist'] == "Cat four" )
{
    // maybe you dont want ads at all at some categories
    $TMPL['extra_ad'] .= '';
}
elseif(isset($FORM['cat']))
{
    // all other ads
    $TMPL['extra_ad'] .= ' <center>banner comes here</center> ';
}
That should do it
 
Top