Example #1
0
 public function request($request_type, $request_info, $network_ids, $backfill)
 {
     /*F:START*/
     error_reporting(0);
     /*Catch XML Exceptions*/
     global $zone_detail;
     $httpConfig['method'] = 'GET';
     $httpConfig['timeout'] = '1';
     $http = new Http();
     $http->initialize($httpConfig);
     if ($request_type == 'banner') {
         $request_url = 'http://m2m1.inner-active.mobi/simpleM2M/clientRequestEnhancedHtmlAd';
         $http->addParam('aid', $network_ids['p_1']);
         $http->addParam('v', 'Sm2m-1.5.3');
         if ($request_info['main_device'] == 'IPHONE' or $request_info['main_device'] == 'IPOD TOUCH') {
             $http->addParam('po', '642');
         } else {
             if ($request_info['main_device'] == 'IPAD') {
                 $http->addParam('po', '947');
             } else {
                 if ($request_info['main_device'] == 'ANDROID') {
                     $http->addParam('po', '559');
                 } else {
                     $http->addParam('po', '551');
                 }
             }
         }
         $http->addParam('ua', $request_info['user_agent']);
         $http->addParam('cip', $request_info['ip_address']);
         if (isset($_GET['o'])) {
             $http->addParam('hid', md5($_GET['o']));
         }
     } else {
         return false;
     }
     $http->execute($request_url);
     if ($http->error) {
         return false;
     }
     if ($http->result == '' or !preg_match('<input type="hidden" id="inneractive-error" value="OK" />', $http->result)) {
         return false;
     }
     $ad = array();
     $ad['main_type'] = 'display';
     $ad['type'] = 'markup';
     $ad['click_url'] = '';
     $ad['html_markup'] = $ad['markup'];
     $ad['trackingpixel'] = '';
     $ad['image_url'] = '';
     $ad['clicktype'] = 'safari';
     $ad['skipoverlay'] = 1;
     $ad['skippreflight'] = 'yes';
     return $ad;
     //old below
     /*F:END*/
 }
Example #2
0
 public function request($request_type, $request_info, $network_ids, $backfill)
 {
     /*F:START*/
     error_reporting(0);
     /*Catch XML Exceptions*/
     global $zone_detail;
     $httpConfig['method'] = 'POST';
     $httpConfig['timeout'] = '1';
     $http = new Http();
     $http->initialize($httpConfig);
     if ($request_type == 'banner') {
         $request_url = 'http://rq.vserv.mobi/delivery/adapi.php?';
         $http->addParam('zoneid', $network_ids['p_1']);
         $http->addParam('vr', '1.1.0-phpcurl-20100726');
         $http->addParam('ml', 'xhtml');
         $http->addParam('ip', $request_info['ip_address']);
         $http->addParam('ru', urlencode($request_info['referer']));
         $http->addParam('ua', $request_info['user_agent']);
         $http->addParam('tm', false);
     } else {
         return false;
     }
     $http->execute($request_url);
     if ($http->error) {
         return false;
     }
     if (preg_match("/href='([^']*)'/i", $http->result, $regs)) {
         $tempad['url'] = $regs[1];
     } else {
         if (preg_match('/href="([^"]*)"/i', $http->result, $regsx)) {
             $tempad['url'] = $regsx[1];
         } else {
             return false;
         }
     }
     $ad = array();
     $ad['main_type'] = 'display';
     $ad['type'] = 'markup';
     $ad['click_url'] = $tempad['url'];
     $ad['html_markup'] = $http->result;
     $ad['trackingpixel'] = '';
     $ad['image_url'] = '';
     $ad['clicktype'] = 'safari';
     $ad['skipoverlay'] = 0;
     $ad['skippreflight'] = 'yes';
     return $ad;
     /*F:END*/
 }
Example #3
0
 public function request($request_type, $request_info, $network_ids, $backfill)
 {
     /*F:START*/
     $httpConfig['method'] = 'GET';
     $httpConfig['timeout'] = '1';
     $http = new Http();
     $http->initialize($httpConfig);
     if ($request_type == 'banner') {
         $request_url = 'http://www.admoda.com/ads/fetch.php';
         $http->addParam('z', $network_ids['p_1']);
         $http->addParam('ua', $request_info['user_agent']);
         $http->addParam('a', $request_info['ip_address']);
         $http->addParam('v', '4');
         $http->addParam('l', 'php');
     } else {
         return false;
     }
     $http->execute($request_url);
     if ($http->error) {
         return false;
     }
     $response = $http->result;
     if ($response != '') {
         $banner = explode('|', $response);
         @($bannerid = $banner[0]);
         @($image_url = $banner[1]);
         @($click_url = $banner[2]);
         if ($bannerid && $image_url) {
             $ad = array();
             $ad['main_type'] = 'display';
             $ad['type'] = 'image-url';
             $ad['click_url'] = $click_url;
             $ad['trackingpixel'] = '';
             $ad['image_url'] = $image_url;
             $ad['clicktype'] = 'safari';
             $ad['skipoverlay'] = 0;
             $ad['skippreflight'] = 'yes';
             return $ad;
         } else {
             return false;
         }
     } else {
         return false;
     }
     /*F:END*/
 }
Example #4
0
 public function request($request_type, $request_info, $network_ids, $backfill)
 {
     /*F:START*/
     error_reporting(0);
     /*Catch XML Exceptions*/
     global $zone_detail;
     $httpConfig['method'] = 'POST';
     $httpConfig['timeout'] = '1';
     $http = new Http();
     $http->initialize($httpConfig);
     if ($request_type == 'banner') {
         $request_url = 'http://www.admanji.com/getAd.php';
         $http->addParam('s', $network_ids['p_1']);
         $http->addParam('ua', $request_info['user_agent']);
         $http->addParam('ra', $request_info['ip_address']);
         $http->addParam('b', '0');
     } else {
         return false;
     }
     $http->execute($request_url);
     if ($http->error) {
         return false;
     }
     if (preg_match("/href='([^']*)'/i", $http->result, $regs)) {
         $tempad['url'] = $regs[1];
     } else {
         if (preg_match('/href="([^"]*)"/i', $http->result, $regsx)) {
             $tempad['url'] = $regsx[1];
         } else {
             return false;
         }
     }
     $ad = array();
     $ad['main_type'] = 'display';
     $ad['type'] = 'markup';
     $ad['click_url'] = $tempad['url'];
     $ad['html_markup'] = $http->result;
     $ad['trackingpixel'] = '';
     $ad['image_url'] = '';
     $ad['clicktype'] = 'safari';
     $ad['skipoverlay'] = 0;
     $ad['skippreflight'] = 'yes';
     return $ad;
     /*F:END*/
 }
Example #5
0
 public function request($request_type, $request_info, $network_ids, $backfill)
 {
     /*F:START*/
     error_reporting(0);
     /*Catch XML Exceptions*/
     global $zone_detail;
     $httpConfig['method'] = 'GET';
     $httpConfig['timeout'] = '1';
     $http = new Http();
     $http->initialize($httpConfig);
     if ($request_type == 'banner') {
         $request_url = 'http://r.tapit.com/adrequest.php';
         $http->addParam('zone', $network_ids['p_1']);
         $http->addParam('ip', $request_info['ip_address']);
         $http->addParam('ua', $request_info['user_agent']);
         if (isset($_GET['o'])) {
             $http->addParam('udid', md5($_GET['o']));
         } else {
             if (isset($_GET['o_mcsha1'])) {
                 $http->addParam('udid', md5($_GET['o_mcsha1']));
             } else {
                 if (isset($_GET['o_mcmd5'])) {
                     $http->addParam('udid', md5($_GET['o_mcmd5']));
                 } else {
                     if (isset($_GET['o_openudid'])) {
                         $http->addParam('udid', md5($_GET['o_openudid']));
                     }
                 }
             }
         }
         $http->addParam('format', 'json');
         $http->addParam('long', $request_info['longitude']);
         $http->addParam('lat', $request_info['latitude']);
         $http->addParam('h', $zone_detail['zone_height']);
         $http->addParam('w', $zone_detail['zone_width']);
     } else {
         return false;
     }
     $http->execute($request_url);
     if ($http->error) {
         return false;
     }
     try {
         $json_response = json_decode($http->result);
     } catch (Exception $e) {
         // handle the error
         return false;
     }
     if (isset($json_response->imageurl)) {
         $tempad['image'] = $json_response->imageurl;
     } else {
         $tempad['image'] = '';
     }
     if (isset($json_response->clickurl)) {
         $tempad['url'] = $json_response->clickurl;
     } else {
         $tempad['url'] = '';
     }
     if (isset($json_response->type)) {
         $tempad['type'] = $json_response->type;
     } else {
         $tempad['type'] = '';
     }
     if (isset($json_response->adtext)) {
         $tempad['text'] = $json_response->adtext;
     } else {
         $tempad['text'] = '';
     }
     if ($request_type == 'banner') {
         if ($tempad['type'] == 'banner') {
             $ad = array();
             $ad['main_type'] = 'display';
             $ad['type'] = 'image-url';
             $ad['click_url'] = $tempad['url'];
             $ad['trackingpixel'] = '';
             $ad['image_url'] = $tempad['image'];
             $ad['clicktype'] = 'safari';
             $ad['skipoverlay'] = 0;
             $ad['skippreflight'] = 'yes';
             return $ad;
         } else {
             if ($tempad['type'] == 'text') {
                 $ad = array();
                 $ad['main_type'] = 'display';
                 $ad['type'] = 'markup';
                 $ad['click_url'] = $tempad['url'];
                 $ad['html_markup'] = '<a href="' . $tempad['url'] . '">' . $tempad['text'] . '</a>';
                 $ad['trackingpixel'] = '';
                 $ad['image_url'] = '';
                 $ad['clicktype'] = 'safari';
                 $ad['skipoverlay'] = 0;
                 $ad['skippreflight'] = 'yes';
                 return $ad;
             } else {
                 return false;
             }
         }
     } else {
         return false;
     }
     /*F:END*/
 }
Example #6
0
 public function request($request_type, $request_info, $network_ids, $backfill)
 {
     /*F:START*/
     error_reporting(0);
     /*Catch JSON Exceptions*/
     $httpConfig['method'] = 'GET';
     $httpConfig['timeout'] = '1';
     $http = new Http();
     $http->initialize($httpConfig);
     if ($request_type == 'banner') {
         $request_url = 'http://show.buzzcity.net/showads.php';
         $http->addParam('partnerid', $network_ids['p_1']);
         $http->addParam('ua', $request_info['user_agent']);
         $http->addParam('ip', $request_info['ip_address']);
         if ($request_info['main_device'] == 'IPAD') {
             $http->addParam('get', 'tab');
         } else {
             $http->addParam('get', 'mweb');
         }
         $http->addParam('limit', 1);
         $http->addParam('wait', 0);
         if ($request_info['main_device'] == 'IPAD' or $request_info['main_device'] == 'IPHONE' or $request_info['main_device'] == 'IPOD TOUCH') {
             $http->addParam('browser', 'app_apple');
         } else {
             if ($request_info['main_device'] == 'ANDROID') {
                 $http->addParam('browser', 'app_android');
             }
         }
     } else {
         return false;
     }
     $http->execute($request_url);
     if ($http->error) {
         return false;
     }
     try {
         $json_response = json_decode($http->result);
     } catch (Exception $e) {
         // handle the error
         return false;
     }
     if (!empty($json_response->error->errmsg)) {
         return false;
     } else {
         if (isset($json_response->data[0]->campaign[0]->cid) && !empty($json_response->data[0]->campaign[0]->cid)) {
             $ad_temp['bc_show_url'] = $json_response->data[0]->url_show;
             $ad_temp['bc_click_url'] = $json_response->data[0]->url_click;
             $ad_temp['cid'] = $json_response->data[0]->campaign[0]->cid;
             $ad_temp['image'] = str_replace("\$cid", $ad_temp['cid'], $ad_temp['bc_show_url']);
             $ad_temp['url'] = str_replace("\$cid", $ad_temp['cid'], $ad_temp['bc_click_url']);
             $ad = array();
             $ad['main_type'] = 'display';
             $ad['type'] = 'image-url';
             $ad['click_url'] = $ad_temp['url'];
             $ad['trackingpixel'] = '';
             $ad['image_url'] = $ad_temp['image'];
             $ad['clicktype'] = 'safari';
             $ad['skipoverlay'] = 0;
             $ad['skippreflight'] = 'yes';
             return $ad;
         }
     }
     /*F:END*/
 }
Example #7
0
 public function request($request_type, $request_info, $network_ids, $backfill)
 {
     /*F:START*/
     error_reporting(0);
     /*Catch XML Exceptions*/
     global $zone_detail;
     $httpConfig['method'] = 'GET';
     $httpConfig['timeout'] = '1';
     $http = new Http();
     $http->initialize($httpConfig);
     if ($request_type == 'banner' or $request_type == 'interstitial') {
         $request_url = 'http://serve.vdopia.com/adserver/html5/adFetch/';
         $http->addParam('ak', $network_ids['p_1']);
         if ($request_type == 'banner') {
             $http->addParam('adFormat', 'vdobanner');
         } else {
             if ($request_type == 'interstitial') {
                 $http->addParam('adFormat', 'preappvideo');
             }
         }
         $http->addParam('output', 'xhtml');
         $http->addParam('showClose', '0');
         $http->addParam('sleepAfter', '0');
         $http->addParam('version', '1.0');
         $http->addParam('ua', $request_info['user_agent']);
         $http->addParam('ipAddress', $request_info['ip_address']);
         if (isset($_GET['o'])) {
             $http->addParam('di', sha1($_GET['o']));
             $http->addParam('dif', 'ds');
         } else {
             if (isset($_GET['o_mcsha1'])) {
                 $http->addParam('di', $_GET['o_mcsha1']);
                 $http->addParam('ms', 'ds');
             } else {
                 if (isset($_GET['o_mcmd5'])) {
                     $http->addParam('di', $_GET['o_mcmd5']);
                     $http->addParam('mm', 'ds');
                 }
             }
         }
     } else {
         return false;
     }
     $http->execute($request_url);
     if ($http->error) {
         return false;
     }
     if ($http->result == '') {
         return false;
     }
     try {
         $xml_response = new SimpleXmlElement($http->result, LIBXML_NOCDATA);
     } catch (Exception $e) {
         // handle the error
         return false;
     }
     if (isset($xml_response->xhtml)) {
         $tempad['markup'] = $xml_response->xhtml;
     } else {
         $tempad['markup'] = '';
     }
     if (isset($xml_response['type'])) {
         $tempad['type'] = $xml_response['type'];
     } else {
         $tempad['type'] = '';
     }
     if ($tempad['type'] == 'error') {
         return false;
     }
     if ($tempad['markup'] != '') {
         if ($request_type == 'banner') {
             $ad = array();
             $ad['main_type'] = 'display';
             $ad['type'] = 'markup';
             $ad['click_url'] = '';
             $ad['html_markup'] = $tempad['markup'];
             $ad['trackingpixel'] = '';
             $ad['image_url'] = '';
             $ad['clicktype'] = 'safari';
             $ad['skipoverlay'] = 0;
             $ad['skippreflight'] = 'yes';
             return $ad;
         } else {
             if ($request_type == 'interstitial') {
                 $ad = array();
                 $ad['main_type'] = 'interstitial';
                 $ad['type'] = 'interstitial';
                 $ad['animation'] = 'None';
                 /* Interstitial */
                 $ad['interstitial-orientation'] = 'portrait';
                 $ad['interstitial-preload'] = 0;
                 $ad['interstitial-autoclose'] = 0;
                 $ad['interstitial-type'] = 'markup';
                 $ad['interstitial-content'] = $tempad['markup'];
                 $ad['interstitial-skipbutton-show'] = 1;
                 $ad['interstitial-skipbutton-showafter'] = 0;
                 $ad['interstitial-navigation-show'] = 0;
                 $ad['interstitial-navigation-topbar-show'] = 0;
                 $ad['interstitial-navigation-bottombar-show'] = 0;
                 $ad['interstitial-navigation-topbar-custombg'] = '';
                 $ad['interstitial-navigation-bottombar-custombg'] = '';
                 $ad['interstitial-navigation-topbar-titletype'] = 'fixed';
                 $ad['interstitial-navigation-topbar-titlecontent'] = '';
                 $ad['interstitial-navigation-bottombar-backbutton'] = 0;
                 $ad['interstitial-navigation-bottombar-forwardbutton'] = 0;
                 $ad['interstitial-navigation-bottombar-reloadbutton'] = 0;
                 $ad['interstitial-navigation-bottombar-externalbutton'] = 0;
                 $ad['interstitial-navigation-bottombar-timer'] = 0;
                 /* Interstitial */
                 return $ad;
             }
         }
     } else {
         return false;
     }
     //old below
     // GET AD LINK
     if (preg_match('/href="([^"]*)"/i', $http->result, $regs)) {
         $tempad['url'] = $regs[1];
     } else {
         $tempad['url'] = '';
     }
     // GET AD IMAGE URL
     if (preg_match('/src="([^"]*)"/i', $http->result, $regsa)) {
         $tempad['image'] = $regsa[1];
     } else {
         $tempad['image'] = '';
     }
     if ($ad['url'] != "" && $ad['image'] != "") {
         $ad = array();
         $ad['main_type'] = 'display';
         $ad['type'] = 'markup';
         $ad['click_url'] = $tempad['url'];
         $ad['html_markup'] = $http->result;
         $ad['trackingpixel'] = '';
         $ad['image_url'] = '';
         $ad['clicktype'] = 'safari';
         $ad['skipoverlay'] = 0;
         $ad['skippreflight'] = 'yes';
         return $ad;
     } else {
         return false;
     }
     /*F:END*/
 }
Example #8
0
 public function request($request_type, $request_info, $network_ids, $backfill)
 {
     error_reporting(0);
     /*F:START*/
     $httpConfig['method'] = 'GET';
     $httpConfig['timeout'] = '1';
     $http = new Http();
     $http->initialize($httpConfig);
     if ($request_type == 'banner') {
         $request_url = 'http://a.zestadz.com/waphandler/deliverad';
         $http->addParam('cid', $network_ids['p_1']);
         $http->addParam('ua', $request_info['user_agent']);
         $http->addParam('response_type', 'xml');
         $http->addParam('ip', $request_info['ip_address']);
         $http->addParam('url', $request_info['referer']);
     } else {
         return false;
     }
     $http->execute($request_url);
     if ($http->error) {
         return false;
     }
     try {
         $xml_response = new SimpleXmlElement($http->result, LIBXML_NOCDATA);
     } catch (Exception $e) {
         // handle the error
         return false;
     }
     if ($xml_response['type'] == 'error') {
         return false;
     } else {
         if ($xml_response['type'] == 'picture' or $xml_response['type'] == 'text') {
             switch ($xml_response['type']) {
                 case 'picture':
                     $ad = array();
                     $ad['main_type'] = 'display';
                     $ad['type'] = 'image-url';
                     $ad['click_url'] = $xml_response->url;
                     $ad['trackingpixel'] = '';
                     $ad['image_url'] = $xml_response->picture;
                     $ad['clicktype'] = 'safari';
                     $ad['skipoverlay'] = 0;
                     $ad['skippreflight'] = 'yes';
                     return $ad;
                     break;
                 case 'text':
                     $ad = array();
                     $ad['main_type'] = 'display';
                     $ad['type'] = 'markup';
                     $ad['click_url'] = $xml_response->url;
                     $ad['html_markup'] = '<a href="' . $xml_response->url . '">' . $xml_response->text . '</a>';
                     $ad['trackingpixel'] = '';
                     $ad['image_url'] = '';
                     $ad['clicktype'] = 'safari';
                     $ad['skipoverlay'] = 0;
                     $ad['skippreflight'] = 'yes';
                     return $ad;
                     break;
             }
         } else {
             return false;
         }
     }
     /*F:END*/
 }
Example #9
0
 public function request($request_type, $request_info, $network_ids, $backfill)
 {
     /*F:START*/
     error_reporting(0);
     /*Catch XML Exceptions*/
     global $zone_detail;
     $httpConfig['method'] = 'POST';
     $httpConfig['timeout'] = '1';
     $http = new Http();
     $http->initialize($httpConfig);
     if ($request_type == 'banner') {
         $request_url = 'http://ads.mobgold.com/request.php';
         $http->addParam('ua', $request_info['user_agent']);
         $http->addParam('ipr', $request_info['ip_address']);
         $http->addParam('ipc', $request_info['ip_address']);
         $http->addParam('ref', $request_info['referer']);
         $http->addParam('uri', $request_info['referer']);
         $http->addParam('pt', 'http');
         $http->addParam('fmt', 'xml');
         $http->addParam('ver', '0.1.5');
         $http->addParam('sm', $network_ids['p_1']);
         $http->addParam('test', '1');
     } else {
         return false;
     }
     $http->execute($request_url);
     if ($http->error) {
         return false;
     }
     try {
         $xml_response = new SimpleXmlElement($http->result, LIBXML_NOCDATA);
     } catch (Exception $e) {
         // handle the error
         return false;
     }
     if (isset($xml_response->link)) {
         $tempad['url'] = $xml_response->link;
     } else {
         $tempad['url'] = '';
     }
     if (isset($xml_response->adtype)) {
         $tempad['type'] = $xml_response->adtype;
     } else {
         $tempad['type'] = '';
     }
     if (isset($xml_response->banner)) {
         $tempad['image'] = $xml_response->banner;
     } else {
         $tempad['image'] = '';
     }
     if (isset($xml_response->text)) {
         $tempad['text'] = $xml_response->text;
     } else {
         $tempad['text'] = '';
     }
     if ($tempad['url'] != '' && ($tempad['type'] == 1 or $tempad['type'] == 2)) {
         $ad = array();
         switch ($tempad['type']) {
             case 1:
                 $ad['main_type'] = 'display';
                 $ad['type'] = 'markup';
                 $ad['click_url'] = $tempad['url'];
                 $ad['html_markup'] = '<a href="' . $tempad['url'] . '">' . $tempad['text'] . '</a>';
                 $ad['trackingpixel'] = '';
                 $ad['image_url'] = '';
                 $ad['clicktype'] = 'safari';
                 $ad['skipoverlay'] = 0;
                 $ad['skippreflight'] = 'yes';
                 break;
             case 2:
                 $ad['main_type'] = 'display';
                 $ad['type'] = 'image-url';
                 $ad['click_url'] = $tempad['url'];
                 $ad['trackingpixel'] = '';
                 $ad['image_url'] = $tempad['image'];
                 $ad['clicktype'] = 'safari';
                 $ad['skipoverlay'] = 0;
                 $ad['skippreflight'] = 'yes';
                 break;
         }
         return $ad;
     } else {
         return false;
     }
     /*F:END*/
 }
Example #10
0
 public function request($request_type, $request_info, $network_ids, $backfill)
 {
     /*F:START*/
     error_reporting(0);
     /*Catch XML Exceptions*/
     global $zone_detail;
     $httpConfig['method'] = 'GET';
     $httpConfig['timeout'] = '1';
     $http = new Http();
     $http->initialize($httpConfig);
     if ($request_type == 'banner') {
         $request_url = 'http://ads.admarvel.com/fam/postGetAd.php';
         $http->addParam('partner_id', $network_ids['p_1']);
         $http->addParam('site_id', $network_ids['p_2']);
         $http->addParam('version', '1.5');
         $http->addParam('language', 'php');
         $http->addParam('format', 'wap');
         $http->addParam('target_params', 'RESPONSE_TYPE=>xml');
         $http->addParam('phone_headers', 'REMOTE_ADDR=>' . $request_info['ip_address'] . '||HTTP_USER_AGENT=>' . $request_info['user_agent'] . '');
         if (isset($_GET['o'])) {
             $http->addParam('UNIQUE_ID', $_GET['o']);
         }
     } else {
         return false;
     }
     $http->execute($request_url);
     if ($http->error) {
         return false;
     }
     try {
         $xml_response = new SimpleXmlElement($http->result, LIBXML_NOCDATA);
     } catch (Exception $e) {
         // handle the error
         return false;
     }
     if (isset($xml_response->image->url)) {
         $tempad['image'] = $xml_response->image->url;
     } else {
         $tempad['image'] = '';
     }
     if (isset($xml_response->clickurl)) {
         $tempad['url'] = $xml_response->clickurl;
     } else {
         $tempad['url'] = '';
     }
     if (isset($xml_response->text)) {
         $tempad['text'] = $xml_response->text;
     } else {
         $tempad['text'] = '';
     }
     if (isset($xml_response['type'])) {
         $tempad['type'] = $xml_response['type'];
     } else {
         $tempad['type'] = '';
     }
     if (isset($xml_response->pixels->pixel)) {
         $tempad['pixel'] = $xml_response->pixels->pixel;
     } else {
         $tempad['pixel'] = '';
     }
     if ($request_type == 'banner') {
         if ($xml_response['type'] == 'image') {
             $ad = array();
             $ad['main_type'] = 'display';
             $ad['type'] = 'image-url';
             $ad['click_url'] = $tempad['url'];
             $ad['trackingpixel'] = $tempad['pixel'];
             $ad['image_url'] = $tempad['image'];
             $ad['clicktype'] = 'safari';
             $ad['skipoverlay'] = 0;
             $ad['skippreflight'] = 'yes';
             return $ad;
         } else {
             if ($xml_response['type'] == 'text') {
                 $ad = array();
                 $ad['main_type'] = 'display';
                 $ad['type'] = 'markup';
                 $ad['click_url'] = $tempad['url'];
                 $ad['html_markup'] = '<a href="' . $tempad['url'] . '">' . $tempad['text'] . '</a>';
                 $ad['trackingpixel'] = $tempad['pixel'];
                 $ad['image_url'] = '';
                 $ad['clicktype'] = 'safari';
                 $ad['skipoverlay'] = 0;
                 $ad['skippreflight'] = 'yes';
                 return $ad;
             } else {
                 return false;
             }
         }
     } else {
         return false;
     }
     /*F:END*/
 }
Example #11
0
 public function request($request_type, $request_info, $network_ids, $backfill)
 {
     /*F:START*/
     error_reporting(0);
     /*Catch XML Exceptions*/
     global $zone_detail;
     $httpConfig['method'] = 'GET';
     $httpConfig['timeout'] = '1';
     $randomnumber = sha1(rand(1, 500000));
     $http = new Http();
     $http->initialize($httpConfig);
     if ($request_type == 'banner') {
         $request_url = 'http://ro.plus1.wapstart.ru';
         $http->addParam('area', 'viewBannerXml');
         $http->addParam('site', $network_ids['p_1']);
         $http->addParam('position', '1');
         $http->addParam('markup', '2');
         $http->addParam('userAgent', $request_info['user_agent']);
         $http->addParam('ip', $request_info['ip_address']);
         $http->addParam('tplVersion', '2');
         $http->addParam('pageId', $randomnumber);
         if (isset($_GET['o'])) {
             $http->addParam('clientSession', sha1($_GET['o']));
         } else {
             if (isset($_GET['o_mcsha1'])) {
                 $http->addParam('clientSession', sha1($_GET['o_mcsha1']));
             }
         }
     } else {
         return false;
     }
     $http->execute($request_url);
     if ($http->error) {
         return false;
     }
     if ($http->result == "<!-- i4jgij4pfd4ssd -->") {
         return false;
     }
     try {
         $xml_response = new SimpleXmlElement($http->result, LIBXML_NOCDATA);
     } catch (Exception $e) {
         // handle the error
         return false;
     }
     $tempad['content'] = $xml_response->content;
     $tempad['title'] = $xml_response->title;
     $tempad['url'] = $xml_response->link;
     $tempad['singlelinecontent'] = $xml_response->singleLineContent;
     $tempad['imageurl'] = $xml_response->pictureUrl;
     // START AD URL NOT EMPTY
     if ($tempad['url'] != "") {
         if ($tempad['imageurl'] != "") {
             $ad = array();
             $ad['main_type'] = 'display';
             $ad['type'] = 'image-url';
             $ad['click_url'] = $tempad['url'];
             $ad['trackingpixel'] = '';
             $ad['image_url'] = $tempad['imageurl'];
             $ad['clicktype'] = 'safari';
             $ad['skipoverlay'] = 0;
             $ad['skippreflight'] = 'yes';
             return $ad;
         } else {
             if (strlen($tempad['imageurl']) < 3 && $tempad['singlelinecontent'] != "") {
                 $ad['main_type'] = 'display';
                 $ad['type'] = 'markup';
                 $ad['click_url'] = $tempad['url'];
                 $ad['html_markup'] = '<a href="' . $tempad['url'] . '">' . $tempad['singlelinecontent'] . '</a>';
                 $ad['trackingpixel'] = '';
                 $ad['image_url'] = '';
                 $ad['clicktype'] = 'safari';
                 $ad['skipoverlay'] = 0;
                 $ad['skippreflight'] = 'yes';
             } else {
                 if (strlen($tempad['imageurl']) < 3 && $tempad['title'] != "") {
                     $ad['main_type'] = 'display';
                     $ad['type'] = 'markup';
                     $ad['click_url'] = $tempad['url'];
                     $ad['html_markup'] = '<a href="' . $tempad['url'] . '">' . $tempad['title'] . ' - ' . $tempad['content'] . '</a>';
                     $ad['trackingpixel'] = '';
                     $ad['image_url'] = '';
                     $ad['clicktype'] = 'safari';
                     $ad['skipoverlay'] = 0;
                     $ad['skippreflight'] = 'yes';
                 } else {
                     return false;
                 }
             }
         }
     } else {
         return false;
     }
     /*F:END*/
 }
Example #12
0
 public function request($request_type, $request_info, $network_ids, $backfill)
 {
     /*F:START*/
     error_reporting(0);
     /*Catch XML Exceptions*/
     global $zone_detail;
     $httpConfig['method'] = 'POST';
     $httpConfig['timeout'] = 1;
     $httpConfig['special'] = 'INMOBI';
     $httpConfig['inmobisiteid'] = $network_ids['p_1'];
     $http = new Http();
     $http->initialize($httpConfig);
     if ($request_type == 'banner' or $request_type == 'interstitial') {
         $request_url = 'http://w.inmobi.com/showad.asm';
         $http->addParam('mk-siteid', $network_ids['p_1']);
         $http->addParam('mk-carrier', $request_info['ip_address']);
         $http->addParam('h-user-agent', $request_info['user_agent']);
         $http->addParam('mk-version', 'pr-SPEC-ATATA-20090521');
         $http->addParam('h-page-url', $request_info['referer']);
         $http->addParam('format', 'axml');
         if ($request_type == 'interstitial') {
             if ($request_info['main_device'] == 'IPAD') {
                 $http->addParam('mk-ad-slot', '16');
             } else {
                 $http->addParam('mk-ad-slot', '14');
             }
         } else {
             /*Zone Size Identification*/
             if ($zone_detail['zone_width'] == '300' && $zone_detail['zone_height'] == '250') {
                 $http->addParam('mk-ad-slot', '10');
             } else {
                 if ($zone_detail['zone_width'] == '728' && $zone_detail['zone_height'] == '90') {
                     $http->addParam('mk-ad-slot', '11');
                 } else {
                     if ($zone_detail['zone_width'] == '468' && $zone_detail['zone_height'] == '60') {
                         $http->addParam('mk-ad-slot', '12');
                     } else {
                         if ($zone_detail['zone_width'] == '120' && $zone_detail['zone_height'] == '600') {
                             $http->addParam('mk-ad-slot', '13');
                         } else {
                             if ($zone_detail['zone_width'] == '320' && $zone_detail['zone_height'] == '480') {
                                 $http->addParam('mk-ad-slot', '14');
                             } else {
                                 if ($zone_detail['zone_width'] == '1024' && $zone_detail['zone_height'] == '768') {
                                     $http->addParam('mk-ad-slot', '16');
                                 } else {
                                     if ($zone_detail['zone_width'] == '1280' && $zone_detail['zone_height'] == '800') {
                                         $http->addParam('mk-ad-slot', '17');
                                     } else {
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
             /*END: Zone Size Identification*/
         }
         if (isset($_GET['rt']) && ($_GET['rt'] == 'iphone_app' or $_GET['rt'] == 'android_app' or $_GET['rt'] == 'ipad_app')) {
             if (isset($_GET['o'])) {
                 $http->addParam('u-id', $_GET['o']);
             }
             $http->addParam('d-localization', 'en_US');
             $http->addParam('d-netType', 'WiFi');
         }
     } else {
         return false;
     }
     $http->execute($request_url);
     if ($http->error) {
         return false;
     }
     if ($http->result == '' or preg_match("<!-- mKhoj: No advt for this position -->", $http->result)) {
         return false;
     }
     try {
         $xml_response = new SimpleXmlElement($http->result, LIBXML_NOCDATA);
     } catch (Exception $e) {
         // handle the error
         return false;
     }
     if (isset($xml_response->Ads->Ad['type'])) {
         $tempad['type'] = $xml_response->Ads->Ad['type'];
     } else {
         $tempad['type'] = '';
     }
     if (isset($xml_response->Ads->Ad)) {
         $tempad['markup'] = $xml_response->Ads->Ad;
     } else {
         $tempad['markup'] = '';
     }
     if (isset($xml_response->Ads->Ad->AdURL)) {
         $tempad['url'] = $xml_response->Ads->Ad->AdURL;
     } else {
         $tempad['url'] = '';
     }
     if ($tempad['url'] == 'null' or $tempad['url'] == '') {
         return false;
     }
     if ($request_type == 'banner') {
         if ($tempad['type'] == 'banner' or $tempad['type'] == 'text') {
             $ad = array();
             $ad['main_type'] = 'display';
             $ad['type'] = 'markup';
             $ad['click_url'] = $tempad['url'];
             $ad['html_markup'] = $tempad['markup'];
             $ad['trackingpixel'] = '';
             $ad['image_url'] = '';
             $ad['clicktype'] = 'safari';
             $ad['skipoverlay'] = 0;
             $ad['skippreflight'] = 'yes';
             return $ad;
         } else {
             if ($tempad['type'] == 'rm') {
                 $ad = array();
                 $ad['main_type'] = 'display';
                 $ad['type'] = 'mraid-markup';
                 $ad['click_url'] = $tempad['url'];
                 $ad['html_markup'] = $tempad['markup'];
                 $ad['trackingpixel'] = '';
                 $ad['image_url'] = '';
                 $ad['clicktype'] = 'safari';
                 $ad['skipoverlay'] = 0;
                 $ad['skippreflight'] = 'yes';
                 return $ad;
             } else {
                 return false;
             }
         }
     } else {
         if ($request_type == 'interstitial') {
             if ($tempad['type'] == 'banner' or $tempad['type'] == 'text') {
                 $ad = array();
                 $ad['main_type'] = 'interstitial';
                 $ad['type'] = 'interstitial';
                 $ad['animation'] = 'None';
                 /* Interstitial */
                 $ad['interstitial-orientation'] = 'portrait';
                 $ad['interstitial-preload'] = 0;
                 $ad['interstitial-autoclose'] = 0;
                 $ad['interstitial-type'] = 'markup';
                 $ad['interstitial-content'] = $tempad['markup'];
                 $ad['interstitial-skipbutton-show'] = 1;
                 $ad['interstitial-skipbutton-showafter'] = 0;
                 $ad['interstitial-navigation-show'] = 0;
                 $ad['interstitial-navigation-topbar-show'] = 0;
                 $ad['interstitial-navigation-bottombar-show'] = 0;
                 $ad['interstitial-navigation-topbar-custombg'] = '';
                 $ad['interstitial-navigation-bottombar-custombg'] = '';
                 $ad['interstitial-navigation-topbar-titletype'] = 'fixed';
                 $ad['interstitial-navigation-topbar-titlecontent'] = '';
                 $ad['interstitial-navigation-bottombar-backbutton'] = 0;
                 $ad['interstitial-navigation-bottombar-forwardbutton'] = 0;
                 $ad['interstitial-navigation-bottombar-reloadbutton'] = 0;
                 $ad['interstitial-navigation-bottombar-externalbutton'] = 0;
                 $ad['interstitial-navigation-bottombar-timer'] = 0;
                 /* Interstitial */
                 return $ad;
             } else {
                 return false;
             }
         } else {
             return false;
         }
     }
     /*F:END*/
 }
Example #13
0
 public function request($request_type, $request_info, $network_ids, $backfill)
 {
     /*F:START*/
     error_reporting(0);
     /*Catch JSON Exceptions*/
     global $zone_detail;
     $httpConfig['method'] = 'GET';
     $httpConfig['timeout'] = '1';
     $http = new Http();
     $http->initialize($httpConfig);
     if ($request_type == 'banner') {
         $request_url = 'http://0000-0000-0000-0000.reporo.net/api';
         $http->addParam('z', $network_ids['p_1']);
         $http->addParam('ua', $request_info['user_agent']);
         $http->addParam('ip', $request_info['ip_address']);
     } else {
         return false;
     }
     $http->execute($request_url);
     if ($http->error) {
         return false;
     }
     try {
         $json_response = json_decode($http->result);
     } catch (Exception $e) {
         // handle the error
         return false;
     }
     if (isset($json_response->bannerurl)) {
         $tempad['image'] = $json_response->bannerurl;
     } else {
         $tempad['image'] = '';
     }
     if (isset($json_response->url)) {
         $tempad['url'] = $json_response->url;
     } else {
         $tempad['url'] = '';
     }
     if (isset($json_response->adtext)) {
         $tempad['text'] = $json_response->adtext;
     } else {
         $tempad['text'] = '';
     }
     if ($request_type == 'banner') {
         if ($tempad['image'] != '' && $tempad['url'] != '') {
             $ad = array();
             $ad['main_type'] = 'display';
             $ad['type'] = 'image-url';
             $ad['click_url'] = $tempad['url'];
             $ad['trackingpixel'] = '';
             $ad['image_url'] = $tempad['image'];
             $ad['clicktype'] = 'safari';
             $ad['skipoverlay'] = 0;
             $ad['skippreflight'] = 'yes';
             return $ad;
         } else {
             if ($tempad['text'] != '' && $tempad['url'] != '') {
                 $ad = array();
                 $ad['main_type'] = 'display';
                 $ad['type'] = 'markup';
                 $ad['click_url'] = $tempad['url'];
                 $ad['html_markup'] = '<a href="' . $tempad['url'] . '">' . $tempad['text'] . '</a>';
                 $ad['trackingpixel'] = '';
                 $ad['image_url'] = '';
                 $ad['clicktype'] = 'safari';
                 $ad['skipoverlay'] = 0;
                 $ad['skippreflight'] = 'yes';
                 return $ad;
             } else {
                 return false;
             }
         }
     } else {
         return false;
     }
     /*F:END*/
 }
Example #14
0
 public function request($request_type, $request_info, $network_ids, $backfill)
 {
     /*F:START*/
     $httpConfig['method'] = 'GET';
     $httpConfig['timeout'] = '1';
     $http = new Http();
     $http->initialize($httpConfig);
     if ($request_type == 'banner') {
         $request_url = 'http://api.mobpartner.mobi';
         $http->addParam('pool', $network_ids['p_1']);
         $http->addParam('ua', $request_info['user_agent']);
         $http->addParam('ip', $request_info['ip_address']);
         if (isset($_GET['o'])) {
             $http->addParam('udid', $_GET['o']);
         } else {
             if (isset($_GET['o_mcsha1'])) {
                 $http->addParam('udid', $_GET['o_mcsha1']);
             }
         }
         $http->addParam('api', 'param');
     } else {
         return false;
     }
     $http->execute($request_url);
     if ($http->error) {
         return false;
     }
     $response = $http->result;
     if ($response != '') {
         $banner = explode('><', $response);
         @($type = $banner[0]);
         @($link_url = $banner[1]);
         @($image_url = $banner[2]);
         @($text = $banner[3]);
         if ($type && $link_url) {
             if ($type == 1 or $type == 2) {
                 $ad = array();
                 $ad['main_type'] = 'display';
                 $ad['type'] = 'image-url';
                 $ad['click_url'] = $link_url;
                 $ad['trackingpixel'] = '';
                 $ad['image_url'] = $image_url;
                 $ad['clicktype'] = 'safari';
                 $ad['skipoverlay'] = 0;
                 $ad['skippreflight'] = 'yes';
                 return $ad;
             } else {
                 if ($type == 3) {
                     $ad = array();
                     $ad['main_type'] = 'display';
                     $ad['type'] = 'markup';
                     $ad['click_url'] = $link_url;
                     $ad['html_markup'] = '<a href="' . $link_url . '">' . $text . '</a>';
                     $ad['trackingpixel'] = '';
                     $ad['image_url'] = '';
                     $ad['clicktype'] = 'safari';
                     $ad['skipoverlay'] = 0;
                     $ad['skippreflight'] = 'yes';
                     return $ad;
                 } else {
                     return false;
                 }
             }
         } else {
             return false;
         }
     } else {
         return false;
     }
     /*F:END*/
 }
Example #15
0
 public function request($request_type, $request_info, $network_ids, $backfill)
 {
     /*F:START*/
     error_reporting(0);
     /*Catch XML Exceptions*/
     global $zone_detail;
     $httpConfig['method'] = 'POST';
     $httpConfig['timeout'] = '1';
     $httpConfig['special'] = 'MADVERTISE';
     $http = new Http();
     $http->initialize($httpConfig);
     if ($request_type == 'banner') {
         $request_url = 'http://ad.madvertise.de/site/' . $network_ids['p_1'] . '';
         $http->addParam('ua', $request_info['user_agent']);
         $http->addParam('ip', $request_info['ip_address']);
         $http->addParam('url', $request_info['referer']);
         $http->addParam('requester', 'madserve_api');
         $http->addParam('version', 'api_2.1');
         $http->addParam('lng', $request_info['longitude']);
         $http->addParam('lat', $request_info['latitude']);
         $http->addParam('site_url', $request_info['referer']);
         $http->addParam('must_have_banner', true);
         /*Zone Size Identification*/
         if ($zone_detail['zone_width'] == '766' && $zone_detail['zone_height'] == '66') {
             $http->addParam('banner_type', 'portrait');
         } else {
             if ($zone_detail['zone_width'] == '300' && $zone_detail['zone_height'] == '250') {
                 $http->addParam('banner_type', 'medium_rectangle,mma');
             } else {
                 if ($zone_detail['zone_width'] == '1024' && $zone_detail['zone_height'] == '66') {
                     $http->addParam('banner_type', 'landscape');
                 } else {
                     if ($zone_detail['zone_width'] == '768' && $zone_detail['zone_height'] == '768') {
                         $http->addParam('banner_type', 'fullscreen');
                     } else {
                         if ($zone_detail['zone_width'] == '728' && $zone_detail['zone_height'] == '90') {
                             $http->addParam('banner_type', 'leaderboard');
                         } else {
                             $http->addParam('banner_type', 'mma');
                         }
                     }
                 }
             }
         }
         /*END: Zone Size Identification*/
         if (isset($_GET['o'])) {
             $http->addParam('unique_device_id', $_GET['o']);
         } else {
             if (isset($_GET['o_mcsha1'])) {
                 $http->addParam('unique_device_id', $_GET['o_mcsha1']);
             } else {
                 if (isset($_GET['o_mcmd5'])) {
                     $http->addParam('unique_device_id', $_GET['o_mcmd5']);
                 } else {
                     if (isset($_GET['o_openudid'])) {
                         $http->addParam('unique_device_id', $_GET['o_openudid']);
                     }
                 }
             }
         }
     } else {
         return false;
     }
     $http->execute($request_url);
     if ($http->error) {
         return false;
     }
     try {
         $xml_response = new SimpleXmlElement($http->result, LIBXML_NOCDATA);
     } catch (Exception $e) {
         // handle the error
         return false;
     }
     if (isset($xml_response->click_url) && isset($xml_response->banner_url) && !empty($xml_response->banner_url)) {
         $ad = array();
         $ad['main_type'] = 'display';
         $ad['type'] = 'image-url';
         $ad['click_url'] = $xml_response->click_url;
         if (isset($xml_response->tracking->url) && !empty($xml_response->tracking->url)) {
             $ad['trackingpixel'] = $xml_response->tracking->url;
         } else {
             $ad['trackingpixel'] = '';
         }
         $ad['image_url'] = $xml_response->banner_url;
         $ad['clicktype'] = 'safari';
         $ad['skipoverlay'] = 0;
         $ad['skippreflight'] = 'yes';
         return $ad;
     } else {
         return false;
     }
     /*F:END*/
 }
Example #16
0
 public function request($request_type, $request_info, $network_ids, $backfill)
 {
     /*F:START*/
     error_reporting(0);
     /*Catch XML Exceptions*/
     global $zone_detail;
     $httpConfig['method'] = 'GET';
     $httpConfig['timeout'] = '1';
     $http = new Http();
     $http->initialize($httpConfig);
     if ($request_type == 'banner') {
         $request_url = 'http://a.jumptap.com/a/ads';
         $http->addParam('pub', $network_ids['p_1']);
         $http->addParam('site', $network_ids['p_2']);
         $http->addParam('spot', $network_ids['p_3']);
         $http->addParam('ua', $request_info['user_agent']);
         $http->addParam('gateway-ip', $request_info['ip_address']);
         $http->addParam('client-ip', $request_info['ip_address']);
         $http->addParam('v', 'v30');
         $http->addParam('l', 'en');
         $http->addParam('url', urlencode($request_info['referer']));
         if (isset($_GET['o'])) {
             $http->addParam('hid', $_GET['o']);
         } else {
             if (isset($_GET['o_mcsha1'])) {
                 $http->addParam('mac_sha1', md5($_GET['o_mcsha1']));
             }
         }
     } else {
         return false;
     }
     $http->execute($request_url);
     if ($http->error) {
         return false;
     }
     // GET AD LINK
     if (preg_match('/href="([^"]*)"/i', $http->result, $regs)) {
         $tempad['url'] = $regs[1];
     } else {
         $tempad['url'] = '';
     }
     // GET AD IMAGE URL
     if (preg_match('/src="([^"]*)"/i', $http->result, $regsa)) {
         $tempad['image'] = $regsa[1];
     } else {
         $tempad['image'] = '';
     }
     if ($tempad['url'] != "" && $tempad['image'] != "") {
         $ad = array();
         $ad['main_type'] = 'display';
         $ad['type'] = 'markup';
         $ad['click_url'] = $tempad['url'];
         $ad['html_markup'] = $http->result;
         $ad['trackingpixel'] = '';
         $ad['image_url'] = '';
         $ad['clicktype'] = 'safari';
         $ad['skipoverlay'] = 0;
         $ad['skippreflight'] = 'yes';
         return $ad;
     } else {
         return false;
     }
     /*F:END*/
 }
Example #17
0
 public function request($request_type, $request_info, $network_ids, $backfill)
 {
     /*F:START*/
     error_reporting(0);
     /*Catch XML Exceptions*/
     global $zone_detail;
     $httpConfig['method'] = 'GET';
     $httpConfig['timeout'] = '1';
     $http = new Http();
     $http->initialize($httpConfig);
     if ($request_type == 'banner') {
         $request_url = 'http://ads.mdotm.com/ads/feed.php';
         $http->addParam('partnerkey', $network_ids['p_1']);
         $http->addParam('apikey', $network_ids['p_2']);
         $http->addParam('secretkey', $network_ids['p_3']);
         $http->addParam('appkey', $network_ids['p_4']);
         if (isset($_GET['o'])) {
             $http->addParam('deviceid', $_GET['o']);
         } else {
             if (isset($_GET['o_mcsha1'])) {
                 $http->addParam('deviceid', $_GET['o_mcsha1']);
             } else {
                 if (isset($_GET['o_mcmd5'])) {
                     $http->addParam('deviceid', $_GET['o_mcmd5']);
                 } else {
                     if (isset($_GET['o_openudid'])) {
                         $http->addParam('deviceid', $_GET['o_openudid']);
                     }
                 }
             }
         }
         $http->addParam('ua', $request_info['user_agent']);
         $http->addParam('clientip', $request_info['ip_address']);
         $http->addParam('height', $zone_detail['zone_height']);
         $http->addParam('width', $zone_detail['zone_width']);
         $http->addParam('fmt', 'json');
     } else {
         return false;
     }
     $http->execute($request_url);
     if ($http->error) {
         return false;
     }
     try {
         $json_response = json_decode($http->result);
     } catch (Exception $e) {
         // handle the error
         return false;
     }
     if (isset($json_response[0]->img_url)) {
         $tempad['image'] = $json_response[0]->img_url;
     } else {
         $tempad['image'] = '';
     }
     if (isset($json_response[0]->landing_url)) {
         $tempad['url'] = $json_response[0]->landing_url;
     } else {
         $tempad['url'] = '';
     }
     if ($tempad['image'] != '' && $tempad['url']) {
         $ad = array();
         $ad['main_type'] = 'display';
         $ad['type'] = 'image-url';
         $ad['click_url'] = $tempad['url'];
         $ad['trackingpixel'] = '';
         $ad['image_url'] = $tempad['image'];
         $ad['clicktype'] = 'safari';
         $ad['skipoverlay'] = 0;
         $ad['skippreflight'] = 'yes';
         return $ad;
     } else {
         return false;
     }
     /*F:END*/
 }
Example #18
0
 public function request($request_type, $request_info, $network_ids, $backfill)
 {
     /*F:START*/
     error_reporting(0);
     /*Catch XML Exceptions*/
     global $zone_detail;
     $httpConfig['method'] = 'GET';
     $httpConfig['timeout'] = '1';
     $httpConfig['referrer'] = $request_info['referer'];
     $httpConfig['user_agent'] = $request_info['user_agent'];
     $http = new Http();
     $http->initialize($httpConfig);
     if ($request_type == 'banner') {
         $request_url = 'http://adserver.ubiyoo.com/adbanner.php';
         $http->addParam('who', $network_ids['p_1']);
         $http->addParam('format', 'adsnipplet');
         $http->addParam('gateway', $request_info['ip_address']);
         $http->addParam('width', $zone_detail['zone_width']);
         if (isset($_GET['o'])) {
             $http->addParam('cid', md5($_GET['o']));
         } else {
             if (isset($_GET['o_mcsha1'])) {
                 $http->addParam('cid', md5($_GET['o_mcsha1']));
             } else {
                 if (isset($_GET['o_mcmd5'])) {
                     $http->addParam('cid', md5($_GET['o_mcmd5']));
                 } else {
                     if (isset($_GET['o_openudid'])) {
                         $http->addParam('cid', md5($_GET['o_openudid']));
                     }
                 }
             }
         }
     } else {
         return false;
     }
     $http->execute($request_url);
     if ($http->error) {
         return false;
     }
     if (substr($http->result, 0, 2) == '<p') {
         // GET AD LINK
         if (preg_match('/href="([^"]*)"/i', $http->result, $regs)) {
             $ad['url'] = $regs[1];
         }
         // GET AD IMAGE URL
         if (preg_match('/src="([^"]*)"/i', $http->result, $regsa)) {
             $ad['image'] = $regsa[1];
         }
         if ($ad['url'] != "" && $ad['image'] != "") {
             $ad = array();
             $ad['main_type'] = 'display';
             $ad['type'] = 'image-url';
             $ad['click_url'] = $ad['url'];
             $ad['trackingpixel'] = '';
             $ad['image_url'] = $ad['image'];
             $ad['clicktype'] = 'safari';
             $ad['skipoverlay'] = 0;
             $ad['skippreflight'] = 'yes';
             return $ad;
         } else {
             return false;
         }
     } else {
         return false;
     }
     /*F:END*/
 }
Example #19
0
 public function request($request_type, $request_info, $network_ids, $backfill)
 {
     /*F:START*/
     error_reporting(0);
     /*Catch XML Exceptions*/
     global $zone_detail;
     $httpConfig['method'] = 'GET';
     $httpConfig['timeout'] = '1';
     $http = new Http();
     $http->initialize($httpConfig);
     if ($request_type == 'banner') {
         $request_url = 'http://ads.mp.mydas.mobi/getAd.php5';
         $http->addParam('apid', $network_ids['p_1']);
         $http->addParam('uip', $request_info['ip_address']);
         $http->addParam('ua', $request_info['user_agent']);
         if (isset($_GET['o'])) {
             $http->addParam('auid', $_GET['o']);
         } else {
             if (isset($_GET['o_mcsha1'])) {
                 $http->addParam('auid', $_GET['o_mcsha1']);
             } else {
                 $http->addParam('auid', $request_info['ip_address']);
             }
         }
     } else {
         return false;
     }
     $http->execute($request_url);
     if ($http->error) {
         return false;
     }
     if (preg_match("/href='([^']*)'/i", $http->result, $regs)) {
         $tempad['url'] = $regs[1];
     } else {
         if (preg_match('/href="([^"]*)"/i', $http->result, $regsx)) {
             $tempad['url'] = $regsx[1];
         } else {
             if (preg_match("<script>", $http->result)) {
                 $tempad['url'] = '';
             } else {
                 if (preg_match("<noscript>", $http->result)) {
                     $tempad['url'] = '';
                 } else {
                     return false;
                 }
             }
         }
     }
     $ad = array();
     $ad['main_type'] = 'display';
     $ad['type'] = 'markup';
     $tempad['url'] = str_replace("&amp;", "&", $tempad['url']);
     $ad['click_url'] = $tempad['url'];
     $tempad['markup'] = str_replace("&amp;", "&", $http->result);
     $ad['html_markup'] = $tempad['markup'];
     $ad['trackingpixel'] = '';
     $ad['image_url'] = '';
     $ad['clicktype'] = 'safari';
     $ad['skipoverlay'] = 0;
     $ad['skippreflight'] = 'yes';
     return $ad;
     /*F:END*/
 }
Example #20
0
 public function request($request_type, $request_info, $network_ids, $backfill)
 {
     /*F:START*/
     error_reporting(0);
     /*Catch XML Exceptions*/
     global $zone_detail;
     $httpConfig['method'] = 'GET';
     $httpConfig['timeout'] = '1';
     $http = new Http();
     $http->initialize($httpConfig);
     if ($request_type == 'banner') {
         $request_url = 'http://generic.aditic.net/';
         $http->addParam('alid', $network_ids['p_1']);
         $http->addParam('pid', $network_ids['p_2']);
         $http->addParam('ua', $request_info['user_agent']);
         $http->addParam('srcip', $request_info['ip_address']);
         $http->addParam('network', 'wifi');
         $http->addParam('format', 'xml');
         if ($request_info['main_device'] == 'IPHONE' or $request_info['main_device'] == 'IPOD TOUCH') {
             $http->addParam('support', 'iphone');
         } else {
             if ($request_info['main_device'] == 'IPAD') {
                 $http->addParam('support', 'ipad');
             } else {
                 if ($request_info['main_device'] == 'ANDROID') {
                     $http->addParam('support', 'android');
                 } else {
                     $http->addParam('support', 'wap');
                 }
             }
         }
     } else {
         return false;
     }
     $http->execute($request_url);
     if ($http->error) {
         return false;
     }
     try {
         $xml_response = new SimpleXmlElement($http->result, LIBXML_NOCDATA);
     } catch (Exception $e) {
         // handle the error
         return false;
     }
     $ad['type'] = $xml_response->type;
     $ad['image'] = $xml_response->image1;
     $ad['url'] = $xml_response->clic;
     $error['code'] = $xml_response->code;
     if (isset($xml_response->code)) {
         $tempad['code'] = $xml_response->code;
     } else {
         $tempad['code'] = '';
     }
     if (isset($xml_response->clic)) {
         $tempad['url'] = $xml_response->clic;
     } else {
         $tempad['url'] = '';
     }
     if (isset($xml_response->image1)) {
         $tempad['image'] = $xml_response->image1;
     } else {
         $tempad['image'] = '';
     }
     if (isset($xml_response->texte1)) {
         $tempad['text'] = $xml_response->texte1;
     } else {
         $tempad['text'] = '';
     }
     if (isset($xml_response->type)) {
         $tempad['type'] = $xml_response->type;
     } else {
         $tempad['type'] = '';
     }
     if ($tempad['url'] != '') {
         if ($tempad['type'] == 'banner' or $tempad['type'] == 'bannertext') {
             $ad = array();
             $ad['main_type'] = 'display';
             $ad['type'] = 'image-url';
             $ad['click_url'] = $tempad['url'];
             $ad['trackingpixel'] = '';
             $ad['image_url'] = $tempad['image'];
             $ad['clicktype'] = 'safari';
             $ad['skipoverlay'] = 0;
             $ad['skippreflight'] = 'yes';
             return $ad;
         } else {
             if ($tempad['type'] == 'textlink') {
                 $ad = array();
                 $ad['main_type'] = 'display';
                 $ad['type'] = 'markup';
                 $ad['click_url'] = $tempad['url'];
                 $ad['html_markup'] = '<a href="' . $tempad['url'] . '">' . $tempad['text'] . '</a>';
                 $ad['trackingpixel'] = '';
                 $ad['image_url'] = '';
                 $ad['clicktype'] = 'safari';
                 $ad['skipoverlay'] = 0;
                 $ad['skippreflight'] = 'yes';
                 return $ad;
             } else {
                 return false;
             }
         }
     } else {
         return false;
     }
     //old below
     if (isset($xml_response->error) && !empty($xml_response->error)) {
         return false;
     } else {
         if (isset($xml_response->ad['type']) && ($xml_response->ad['type'] == 'image' or $xml_response->ad['type'] == 'image/jpeg' or $xml_response->ad['type'] == 'text' or $xml_response->ad['type'] == 'thirdparty' or $xml_response->ad['type'] == 'richmedia')) {
             $ad = array();
             switch ($xml_response->ad['type']) {
                 case 'image':
                 case 'image/jpeg':
                     $ad['main_type'] = 'display';
                     $ad['type'] = 'image-url';
                     $ad['click_url'] = $xml_response->ad->url;
                     $ad['trackingpixel'] = $xml_response->ad->track;
                     $ad['image_url'] = $xml_response->ad->img;
                     $ad['clicktype'] = 'safari';
                     $ad['skipoverlay'] = 0;
                     $ad['skippreflight'] = 'yes';
                     break;
                 case 'text':
                     $ad['main_type'] = 'display';
                     $ad['type'] = 'markup';
                     $ad['click_url'] = $xml_response->ad->url;
                     $ad['html_markup'] = '<a href="' . $xml_response->ad->url . '">' . $xml_response->ad->text . '</a>';
                     $ad['trackingpixel'] = $xml_response->ad->track;
                     $ad['image_url'] = '';
                     $ad['clicktype'] = 'safari';
                     $ad['skipoverlay'] = 0;
                     $ad['skippreflight'] = 'yes';
                     break;
                 case 'thirdparty':
                     $ad['main_type'] = 'display';
                     $ad['type'] = 'markup';
                     $ad['click_url'] = $xml_response->ad->url;
                     $ad['html_markup'] = $xml_response->ad->content;
                     $ad['trackingpixel'] = $xml_response->ad->track;
                     $ad['image_url'] = '';
                     $ad['clicktype'] = 'safari';
                     $ad['skipoverlay'] = 0;
                     $ad['skippreflight'] = 'yes';
                     break;
                 case 'richmedia':
                     $ad['main_type'] = 'display';
                     $ad['type'] = 'mraid-markup';
                     $ad['click_url'] = $xml_response->ad->url;
                     $ad['html_markup'] = $xml_response->ad->content;
                     $ad['trackingpixel'] = $xml_response->ad->track;
                     $ad['image_url'] = '';
                     $ad['clicktype'] = 'safari';
                     $ad['skipoverlay'] = 1;
                     $ad['skippreflight'] = 'yes';
                     break;
             }
             return $ad;
         } else {
             return false;
         }
     }
     /*F:END*/
 }
Example #21
0
 public function request($request_type, $request_info, $network_ids, $backfill)
 {
     /*F:START*/
     error_reporting(0);
     /*Catch XML Exceptions*/
     global $zone_detail;
     $httpConfig['method'] = 'GET';
     $httpConfig['timeout'] = '1';
     $http = new Http();
     $http->initialize($httpConfig);
     if ($request_type == 'banner' or $request_type == 'interstitial') {
         $request_url = 'http://sjc.ads.nexage.com/adServe';
         $http->addParam('dcn', $network_ids['p_1']);
         $http->addParam('pos', $network_ids['p_2']);
         $http->addParam('ua', $request_info['user_agent']);
         $http->addParam('ip', $request_info['ip_address']);
         if (isset($_GET['o'])) {
             $http->addParam('d(id2)', sha1($_GET['o']));
         }
         if (isset($_GET['o_mcsha1'])) {
             $http->addParam('d(id3)', $_GET['o_mcsha1']);
         }
         if (isset($_GET['o_mcmd5'])) {
             $http->addParam('d(id13)', $_GET['o_mcmd5']);
         }
         $http->addParam('req(url)', urlencode($request_info['referer']));
     } else {
         return false;
     }
     $http->execute($request_url);
     if ($http->error) {
         return false;
     }
     if (preg_match("/href='([^']*)'/i", $http->result, $regs)) {
         $tempad['url'] = $regs[1];
     } else {
         if (preg_match('/href="([^"]*)"/i', $http->result, $regsx)) {
             $tempad['url'] = $regsx[1];
         } else {
             return false;
         }
     }
     if ($request_type == 'banner') {
         $ad = array();
         $ad['main_type'] = 'display';
         $ad['type'] = 'markup';
         $ad['click_url'] = $tempad['url'];
         $ad['html_markup'] = $http->result;
         $ad['trackingpixel'] = '';
         $ad['image_url'] = '';
         $ad['clicktype'] = 'safari';
         $ad['skipoverlay'] = 0;
         $ad['skippreflight'] = 'yes';
         $ad['click_url'] = str_replace('&amp;', '&', $ad['click_url']);
         $ad['html_markup'] = str_replace('&amp;', '&', $ad['html_markup']);
         return $ad;
     } else {
         if ($request_type == 'interstitial') {
             $ad = array();
             $ad['main_type'] = 'interstitial';
             $ad['type'] = 'interstitial';
             $ad['animation'] = 'None';
             /* Interstitial */
             $ad['interstitial-orientation'] = 'portrait';
             $ad['interstitial-preload'] = 0;
             $ad['interstitial-autoclose'] = 0;
             $ad['interstitial-type'] = 'markup';
             $ad['interstitial-content'] = $http->result;
             $ad['interstitial-skipbutton-show'] = 1;
             $ad['interstitial-skipbutton-showafter'] = 0;
             $ad['interstitial-navigation-show'] = 0;
             $ad['interstitial-navigation-topbar-show'] = 0;
             $ad['interstitial-navigation-bottombar-show'] = 0;
             $ad['interstitial-navigation-topbar-custombg'] = '';
             $ad['interstitial-navigation-bottombar-custombg'] = '';
             $ad['interstitial-navigation-topbar-titletype'] = 'fixed';
             $ad['interstitial-navigation-topbar-titlecontent'] = '';
             $ad['interstitial-navigation-bottombar-backbutton'] = 0;
             $ad['interstitial-navigation-bottombar-forwardbutton'] = 0;
             $ad['interstitial-navigation-bottombar-reloadbutton'] = 0;
             $ad['interstitial-navigation-bottombar-externalbutton'] = 0;
             $ad['interstitial-navigation-bottombar-timer'] = 0;
             $ad['interstitial-content'] = str_replace('&amp;', '&', $ad['interstitial-content']);
             /* Interstitial */
             return $ad;
         }
     }
     /*F:END*/
 }
Example #22
0
 public function request($request_type, $request_info, $network_ids, $backfill)
 {
     /*F:START*/
     error_reporting(0);
     /*Catch XML Exceptions*/
     global $zone_detail;
     $httpConfig['method'] = 'GET';
     $httpConfig['timeout'] = '1';
     $http = new Http();
     $http->initialize($httpConfig);
     if ($request_type == 'banner') {
         $request_url = 'http://ads.mocean.mobi/ad';
         $http->addParam('site', $network_ids['p_1']);
         $http->addParam('zone', $network_ids['p_2']);
         $http->addParam('ua', $request_info['user_agent']);
         $http->addParam('ip', $request_info['ip_address']);
         $http->addParam('url', $request_info['referer']);
         if (isset($_GET['o'])) {
             $http->addParam('udid', md5($_GET['o']));
         } else {
             if (isset($_GET['o_mcsha1'])) {
                 $http->addParam('udid', md5($_GET['o_mcsha1']));
             } else {
                 if (isset($_GET['o_mcmd5'])) {
                     $http->addParam('udid', md5($_GET['o_mcmd5']));
                 } else {
                     if (isset($_GET['o_openudid'])) {
                         $http->addParam('udid', md5($_GET['o_openudid']));
                     }
                 }
             }
         }
         $http->addParam('key', '3');
         $http->addParam('type', '-1');
         $http->addParam('size_y', $zone_detail['zone_height']);
         $http->addParam('size_x', $zone_detail['zone_width']);
         $http->addParam('long', $request_info['longitude']);
         $http->addParam('lat', $request_info['latitude']);
     } else {
         return false;
     }
     $http->execute($request_url);
     if ($http->error) {
         return false;
     }
     try {
         $xml_response = new SimpleXmlElement($http->result, LIBXML_NOCDATA);
     } catch (Exception $e) {
         // handle the error
         return false;
     }
     if (isset($xml_response->error) && !empty($xml_response->error)) {
         return false;
     } else {
         if (isset($xml_response->ad['type']) && ($xml_response->ad['type'] == 'image' or $xml_response->ad['type'] == 'image/jpeg' or $xml_response->ad['type'] == 'text' or $xml_response->ad['type'] == 'thirdparty' or $xml_response->ad['type'] == 'richmedia')) {
             $ad = array();
             switch ($xml_response->ad['type']) {
                 case 'image':
                 case 'image/jpeg':
                     $ad['main_type'] = 'display';
                     $ad['type'] = 'image-url';
                     $ad['click_url'] = $xml_response->ad->url;
                     $ad['trackingpixel'] = $xml_response->ad->track;
                     $ad['image_url'] = $xml_response->ad->img;
                     $ad['clicktype'] = 'safari';
                     $ad['skipoverlay'] = 0;
                     $ad['skippreflight'] = 'yes';
                     break;
                 case 'text':
                     $ad['main_type'] = 'display';
                     $ad['type'] = 'markup';
                     $ad['click_url'] = $xml_response->ad->url;
                     $ad['html_markup'] = '<a href="' . $xml_response->ad->url . '">' . $xml_response->ad->text . '</a>';
                     $ad['trackingpixel'] = $xml_response->ad->track;
                     $ad['image_url'] = '';
                     $ad['clicktype'] = 'safari';
                     $ad['skipoverlay'] = 0;
                     $ad['skippreflight'] = 'yes';
                     break;
                 case 'thirdparty':
                     $ad['main_type'] = 'display';
                     $ad['type'] = 'markup';
                     $ad['click_url'] = $xml_response->ad->url;
                     $ad['html_markup'] = $xml_response->ad->content;
                     $ad['trackingpixel'] = $xml_response->ad->track;
                     $ad['image_url'] = '';
                     $ad['clicktype'] = 'safari';
                     $ad['skipoverlay'] = 0;
                     $ad['skippreflight'] = 'yes';
                     break;
                 case 'richmedia':
                     $ad['main_type'] = 'display';
                     $ad['type'] = 'mraid-markup';
                     $ad['click_url'] = $xml_response->ad->url;
                     $ad['html_markup'] = $xml_response->ad->content;
                     $ad['trackingpixel'] = $xml_response->ad->track;
                     $ad['image_url'] = '';
                     $ad['clicktype'] = 'safari';
                     $ad['skipoverlay'] = 1;
                     $ad['skippreflight'] = 'yes';
                     break;
             }
             return $ad;
         } else {
             return false;
         }
     }
     /*F:END*/
 }
Example #23
0
 public function request($request_type, $request_info, $network_ids, $backfill)
 {
     /*F:START*/
     error_reporting(0);
     /*Catch XML Exceptions*/
     global $zone_detail;
     $httpConfig['method'] = 'POST';
     $httpConfig['timeout'] = '1';
     $http = new Http();
     $http->initialize($httpConfig);
     if ($request_type == 'banner') {
         $request_url = 'http://api.4info.com/AdHaven/v1/getAd';
         $http->addParam('api_key', $network_ids['p_1']);
         $http->addParam('placement_id', $network_ids['p_2']);
         $http->addParam('date', gmdate(DATE_RFC1123));
         $http->addParam('header_user-agent', $request_info['user_agent']);
         $http->addParam('header_REMOTE_ADDR', $request_info['ip_address']);
         $http->addParam('client_ip', $request_info['ip_address']);
         if (isset($_GET['o'])) {
             $http->addParam('device_id', $_GET['o']);
         }
         $http->addParam('lat_lon', $request_info['latitude'] . ',' . $request_info['longitude']);
     } else {
         return false;
     }
     $http->execute($request_url);
     if ($http->error) {
         return false;
     }
     if ($http->result == '') {
         return false;
     }
     try {
         $xml_response = new SimpleXmlElement($http->result, LIBXML_NOCDATA);
     } catch (Exception $e) {
         // handle the error
         return false;
     }
     if (isset($xml_response->ad->markup)) {
         $tempad['markup'] = $xml_response->ad->markup;
     } else {
         return false;
     }
     if ($tempad['markup'] == '') {
         return false;
     }
     if (preg_match("/href='([^']*)'/i", $tempad['markup'], $regs)) {
         $tempad['url'] = $regs[1];
     } else {
         if (preg_match('/href="([^"]*)"/i', $tempad['markup'], $regsx)) {
             $tempad['url'] = $regsx[1];
         }
     }
     if (preg_match("/src='([^']*)'/i", $tempad['markup'], $regsa)) {
         $tempad['image'] = $regsa[1];
     } else {
         if (preg_match('/src="([^"]*)"/i', $tempad['markup'], $regsax)) {
             $tempad['image'] = $regsax[1];
         }
     }
     if (isset($tempad['image']) && isset($tempad['url'])) {
         $tempad['url'] = str_replace("&amp;", "&", $tempad['url']);
         $ad = array();
         $ad['main_type'] = 'display';
         $ad['type'] = 'image-url';
         $ad['click_url'] = $tempad['url'];
         $ad['trackingpixel'] = '';
         $ad['image_url'] = $tempad['image'];
         $ad['clicktype'] = 'safari';
         $ad['skipoverlay'] = 0;
         $ad['skippreflight'] = 'yes';
         return $ad;
     } else {
         return false;
     }
     /*F:END*/
 }