prepare("SELECT * FROM ads WHERE id = :ad_id"); $sth->execute(array(":ad_id" => $ad_id)); $ad = $sth->fetch(); if ($ad['template_id'] == 15 || $ad['template_id'] == 16 || $ad['template_id'] == 17) { $ad_data = $ad_data = json_decode($ad['ad_data'], true); } else { $ad_data = unserialize($ad['ad_data']); } SWITCH ($ad['template_id']) { case '1': $template = "300x250_1"; break; case '2': $template = "300x250_2"; break; case '3': $template = "300x250_3"; break; case '4': $template = "300x250_4"; break; case '5': $template = "728x90_1"; break; case '6': $template = "160x600_1"; break; case '7': $template = "160x600_2"; break; case '8': $template = "160x600_3"; break; case '9': $template = "300x250_5"; break; case '10': $template = "728x90_2"; break; case '11': $template = "160x600_4"; break; case '12': $template = "fb_1"; break; case '13': $template = "fb_2"; break; case '14': $template = "custom"; break; case '15': $template = "ad2"; break; case '16': $template = "300x600"; break; case '17': $template = "pixelAd_300x250_1"; break; } include('../templates/'.$template.'/display.php'); ?>