SMF Ads Support Forum

Support => Bugs => Topic started by: simmer. on June 19, 2009, 05:43:57 am

Title: ad codes not working on 2.0RC1-1
Post by: simmer. on June 19, 2009, 05:43:57 am
hi this is 2nd tym i'm asking this question  :-X

but this time i have proof that these codes are not working in smf 2.0 RC1-1

ok i tested all mobile site ad codes on a fresh install of smf 1.1.9 and 2.0 RC1-1 and i find out that these codes are nt working on 2.0 RC1-1

here is the code

Code: [Select]
echo (mobisolv_ad());
?>
<?
  function mobisolv_ad()
{
$request_timeout = 2;
$contents = '';
$errno = 0;
$errstr = '';
list($usec_start, $sec_start) = explode(' ', microtime());
$request = @fsockopen('myadz.in', 80, $errno, $errstr, $request_timeout);
if($request)
   {
stream_set_timeout($request, $request_timeout);
$mob_ua = urlencode($_SERVER['HTTP_USER_AGENT']);
$mob_ip = urlencode($_SERVER['REMOTE_ADDR']);
$mob_apn = urlencode($_SERVER['HTTP_APN']);
$mob_net = urlencode($_SERVER['HTTP_X_NETWORK_INFO']);
$mob_ver = 2;
$mob_url = "POST /ads.aspx?pid=1699&ua=".$mob_ua."&ip=".$mob_ip."&apn=".$mob_apn."&net=".$mob_net."&v=".$mob_ver." HTTP/1.0\r\nHost: myadz.in\r\nContent-Type: application/x-www-form-urlencoded\r\nContent-Length: " . strlen($post) . "\r\n\r\n" . $post;
    $post_body= $mob_url;
$post_body_len = strlen($post_body);
$bytes_written = 0;
$body = false;
$info = stream_get_meta_data($request);
    $timeout = $info['timed_out'];
    while($bytes_written < $post_body_len && !$timeout) {
      $current_bytes_written = fwrite($request, $post_body);
      if($current_bytes_written === false) return ''; // write failed
      $bytes_written += $current_bytes_written;
      if($bytes_written === $post_body_len) break;
      $post_body = substr($post_body, $bytes_written);
      $info = stream_get_meta_data($request);
      $timeout = $info['timed_out'];
    }
    while(!feof($request) && !$timeout) {
      $line = fgets($request);
      if(!$body && $line == "\r\n") $body = true;
      if($body && !empty($line)) $contents .= $line;
      $info = stream_get_meta_data($request);
      $timeout = $info['timed_out'];
    }
    fclose($request);
  }
  else {
    $contents = '';
  }
   if (!ereg('im=', $contents)) {
  $contents="";
      }

 return $contents;

 }

?>

please tell me is smf is  not able to parse the code or there is a bug in ad management for 2.0 RC1-1  ???

regards
sim  :)
Title: Re: ad codes not working on 2.0RC1-1
Post by: ChaWhoZer on July 04, 2009, 12:41:47 am
             I am not good to that but I know someone that can help you I will contact him I have time.,



_________________
How (http://www.chacha.com/topic/how)

Title: Re: ad codes not working on 2.0RC1-1
Post by: simmer. on July 13, 2009, 01:55:46 pm
bump  :'(

anybuddy please help me  :-\ :-\ :-\