"; $output[] = "\n"; $output[] = ""; return implode($output); } /** * @param $def Array of variables required to build Iframe tags * * @return string IFrame ad tag */ static function buildIframeTags($def) { $zone_id = $def['zone_id']; $output = array(); $size = explode('x', $def['size']); $params = "/;ID=" . $def['adbutler_id'] . ";size=" . $def['size'] . ";setID=" . $zone_id; $output[] = ""; return implode($output); } /** * @param $def Array of variables required to build basic image tags * * @return string Image ad tags */ static function buildImageTags($def) { $size = explode('x', $def['size']); $params = "/;ID=" . $def['adbutler_id'] . ";size=" . $def['size'] . ";setID=" . $def['zone_id']; $output[] = '"; $output[] = "\n"; $output[] = "var rnd = window.rnd || Math.floor(Math.random()*10e6);\n"; $output[] = "var pid$zone_id = window.pid$zone_id || rnd;\n"; $output[] = "var plc$zone_id = window.plc$zone_id || 0;\n"; $output[] = "var abkw = window.abkw || '';\n"; $output[] = "var absrc = '"; if ($def['secure']) { $output[] = "https://" . $def['ssl_host_name']; } else { $output[] = "http://" . $def['host_name']; } $output[] = "/adserve$params;type=iframe;kw='+abkw+';pid='+pid$zone_id+';place='+(plc$zone_id++)+';rnd='+rnd+'';"; $output[] = "\n"; $output[] = "document.write('"; $output[] = "\n"; $output[] = ""; return implode($output); } }