function adshow_display_ad_full_path($ad_path) { if (!adshow_functions_exist()) { return false; } $showads = adshow_show_adverts(); if ($showads !== true) { if (adinj_config_debug_mode()) { echo "<!--ADINJ DEBUG: ad blocked at run time reason={$showads}-->"; } return; } if (file_exists($ad_path)) { $ad = file_get_contents($ad_path); if ($ad === false) { echo "\n<!--ADINJ DEBUG: could not read ad from file: {$ad_path}-->"; } if (stripos($ad_path, 'random_1.txt') > 0) { // TODO something better than this echo adinj_config_add_tags_rnd(adshow_eval_php($ad)); } else { if (stripos($ad_path, 'top_1.txt') > 0) { echo adinj_config_add_tags_top(adshow_eval_php($ad)); } else { if (stripos($ad_path, 'bottom_1.txt') > 0) { echo adinj_config_add_tags_bottom(adshow_eval_php($ad)); } else { echo adshow_eval_php($ad); } } } } else { echo "\n<!--ADINJ DEBUG: ad file does not exist: {$ad_path}.\nIf you have just upgraded you may need to re-save your ads to regenerate the ad files.\n-->"; } }
function adshow_display_ad_full_path_v2($ad_path, $ops = array()) { if (!adshow_functions_exist()) { return false; } if (!file_exists($ad_path)) { echo "<!--ADINJ DEBUG: ad file does not exist: {$ad_path}.\nIf you have just upgraded you may need to re-save your ads to regenerate the ad files.\n-->\n"; return false; } $ad = file_get_contents($ad_path); if ($ad === false) { echo "<!--ADINJ DEBUG: could not read ad from file: {$ad_path}-->\n"; } $ad = adshow_eval_php($ad); echo adshow_add_formatting($ad, $ops); }
function adinj_ad_code_eval($ad) { if (strlen($ad) == 0) { return $ad; } if (stripos($ad, '<?php') !== false) { return adshow_eval_php($ad); } return $ad; }