where('id', $id)->getOne(T_VIDEO_ADS); if (empty($get_ad)) { header("Location: " . PT_LoadAdminLink('')); exit(); } $link = $get_ad->ad_media; if (!empty($get_ad->ad_image)) { $page_link = 'Image link, e.g (http://site.com/image.png)'; $link = $get_ad->ad_image; $page = 'image'; } if (!empty($get_ad->vast_xml_link)) { $page_link = 'XML link, e.g (http://yourdomain.com/vast.xml)'; $link = $get_ad->vast_xml_link; $page = 'vast'; } ?>