admob in wapdesire v2

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    admob in wapdesire v2

    i donno whether this code is not working or admob have problem..anybody can help me?i use this code but the ads not appear..

    PHP Code:
    function mobads()
    {
    $mob_mode "test";
    $mob_alternate_link "<a class=\"link\" href=\"http://wapdesire.com\">Best Web n Wap Community</a>";

    $mob_ua urlencode(getenv("HTTP_USER_AGENT"));
    $mob_ip urlencode($_SERVER['REMOTE_ADDR']);

    if (
    $mob_mode=='live')
    $mob_m "&m";
    $mob_url 'http://ads.admob.com/ad_source.php?s=a147bceef2a4c2a&u='.$mob_ua.'&i='.$mob_ip.$mob_m;
    @
    $mob_ad_serve fopen($mob_url,'r');
    if (
    $mob_ad_serve)
    {
    while (!
    feof($mob_ad_serve))
    $mob_contents .= fread($mob_ad_serve,1024);
    fclose($mob_ad_serve);
    }
    $mob_link explode("><",$mob_contents);
    $mob_ad_text $mob_link[0];
    $mob_ad_link $mob_link[1];
    if (isset(
    $mob_ad_link) && ($mob_ad_link !=''))
    $ret "<a class=\"link\" href=\"$mob_ad_link\">$mob_ad_text</a>";
    else
    $ret $mob_alternate_link;

    return 
    $ret;


    it only show Best Web n Wap Community

    #2
    Change variabel mob_mode:

    $mob_mode = "live";

    Comment


      #3
      PHP Code:
      function mobads() 

      $mob_mode "test"
      $mob_alternate_link "<a class=\"link\" href=\"http://wapdesire.com\">Best Web n Wap Community</a>"

      $mob_ua urlencode(getenv("HTTP_USER_AGENT")); 
      $mob_ip urlencode($_SERVER['REMOTE_ADDR']); 

      if (
      $mob_mode=='live'
      $mob_m "&m"
      $mob_url 'http://ads.admob.com/ad_source.php?s=a147bceef2a4c2a&u='.$mob_ua.'&i='.$mob_ip.$mob_m
      @
      $mob_ad_serve fopen($mob_url,'r'); 
      if (
      $mob_ad_serve

      while (!
      feof($mob_ad_serve)) 
      $mob_contents .= fread($mob_ad_serve,1024); 
      fclose($mob_ad_serve); 

      $mob_link explode("><",$mob_contents); 
      $mob_ad_text $mob_link[0]; 
      $mob_ad_link $mob_link[1]; 
      if (isset(
      $mob_ad_link) && ($mob_ad_link !='')) 
      $ret "<a class=\"link\" href=\"$mob_ad_link\">$mob_ad_text</a>"
      else 
      $ret $mob_alternate_link

      return 
      $ret


      do u mean change this :

      PHP Code:
      $mob_mode "test"
      $mob_alternate_link "<a class=\"link\" href=\"http://wapdesire.com\">Best Web n Wap Community</a>"
      to this :

      PHP Code:
      $mob_mode "live"
      $mob_alternate_link "<a class=\"link\" href=\"http://wapdesire.com\">Best Web n Wap Community</a>"
      i have do it but it still show

      Best Web n Wap Community

      Comment


        #4
        Yess, i mean like that. Have you already registered to admob and put your publisher id at "s" variable correctly?

        Comment


          #5
          Originally posted by Xenax View Post
          Yess, i mean like that. Have you already registered to admob and put your publisher id at "s" variable correctly?
          yes i am..
          this is my publisher id : a14b2b49a740e42
          and i put it like this

          PHP Code:
          function mobads()
          {
          $mob_mode "live";
          $mob_alternate_link "<a class=\"link\" href=\"http://wapdesire.com\">Best Web n Wap Community</a>";

          $mob_ua urlencode(getenv("HTTP_USER_AGENT"));
          $mob_ip urlencode($_SERVER['REMOTE_ADDR']);

          if (
          $mob_mode=='live')
          $mob_m "&m";
          $mob_url 'http://ads.admob.com/ad_source.php?s=a14b2b49a740e42='.$mob_ua.'&i='.$mob_ip.$mob_m;
          @
          $mob_ad_serve fopen($mob_url,'r');
          if (
          $mob_ad_serve)
          {
          while (!
          feof($mob_ad_serve))
          $mob_contents .= fread($mob_ad_serve,1024);
          fclose($mob_ad_serve);
          }
          $mob_link explode("><",$mob_contents);
          $mob_ad_text $mob_link[0];
          $mob_ad_link $mob_link[1];
          if (isset(
          $mob_ad_link) && ($mob_ad_link !=''))
          $ret "<a class=\"link\" href=\"$mob_ad_link\">$mob_ad_text</a>";
          else
          $ret $mob_alternate_link;

          return 
          $ret;


          but the code still not appear..

          Comment


            #6
            Originally posted by JoEsaR View Post
            yes i am..
            this is my publisher id : a14b2b49a740e42
            and i put it like this

            PHP Code:
            function mobads()
            {
            $mob_mode "live";
            $mob_alternate_link "<a class=\"link\" href=\"http://wapdesire.com\">Best Web n Wap Community</a>";

            $mob_ua urlencode(getenv("HTTP_USER_AGENT"));
            $mob_ip urlencode($_SERVER['REMOTE_ADDR']);

            if (
            $mob_mode=='live')
            $mob_m "&m";
            $mob_url 'http://ads.admob.com/ad_source.php?s=a14b2b49a740e42='.$mob_ua.'&i='.$mob_ip.$mob_m;
            @
            $mob_ad_serve fopen($mob_url,'r');
            if (
            $mob_ad_serve)
            {
            while (!
            feof($mob_ad_serve))
            $mob_contents .= fread($mob_ad_serve,1024);
            fclose($mob_ad_serve);
            }
            $mob_link explode("><",$mob_contents);
            $mob_ad_text $mob_link[0];
            $mob_ad_link $mob_link[1];
            if (isset(
            $mob_ad_link) && ($mob_ad_link !=''))
            $ret "<a class=\"link\" href=\"$mob_ad_link\">$mob_ad_text</a>";
            else
            $ret $mob_alternate_link;

            return 
            $ret;


            but the code still not appear..
            are you calling the function on the page you want the ad displaying?

            you need to add

            mobads();

            where you want the ads to appear

            Comment


              #7
              Originally posted by woody View Post
              are you calling the function on the page you want the ad displaying?

              you need to add

              mobads();

              where you want the ads to appear

              yes i put that code at header..put only show

              Best Web n Wap Community

              Comment


                #8
                Just wait, it will randomly select ad from admob.

                Comment


                  #9
                  easier way i used do it was this put ya code from admob into admobcode.php and upload it ya site docs with rest and then ad this
                  Code:
                  ?>
                  <? include ('admobcode.php'); ?>
                  <?php
                  and anywhere u put it the ads will show on site

                  Comment


                    #10
                    Originally posted by lee27 View Post
                    easier way i used do it was this put ya code from admob into admobcode.php and upload it ya site docs with rest and then ad this
                    Code:
                    ?>
                    <? include ('admobcode.php'); ?>
                    <?php
                    and anywhere u put it the ads will show on site
                    i have also try this way..but the ads also not appear..maybe because i use freehostia.com free hosting..

                    Comment


                      #11
                      admob should be providing php code to sever ads
                      Follow me @ksg91 | My Blog: http://ksg91.com | Nokia Blog: http://NokiaTips.in

                      Comment

                      Working...
                      X