Tutorial: Placing Adsense after first post in IPB

Discussion in 'Placement / Reviews / Examples' started by Scriptona, Sep 16, 2006.

  1. #1
    Hello guys,

    i've been searching for this for a while and i found it then thought of sharing it with you

    This is basicly for IPB 2.1.x - not sure if it will work in previous/coming versions

    Screenshot (click Here)


    Open
    sources/lib/func_topic_linear.php

    Find:

    
    
    }
            
            //-----------------------------------------
            // Print the footer
            //-----------------------------------------
    
    
    Code (markup):
    Add Before It

            // Google Adsense banner mod  
    
      $this->post_count++;
      if ($this->post_count == 1 )
      {
       $ad = array ( 'name_css' => 'normalname',
           'post_css' => ($post_count % 2 ? 'post1' : 'post2'),
           'pid' => '0',
           // Paste your Google ad code inside the single quotes
           'post'  => '
    
           
    <script type="text/javascript"><!--
    google_ad_client = "pub-XXXXXXXXXXXX";
    google_ad_width = 250;
    google_ad_height = 250;
    google_ad_format = "250x250_as";
    google_ad_type = "text";
    google_ad_channel ="";
    //--></script>
    <script type="text/javascript"
      src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script><script type="text/javascript"><!--
    google_ad_client = "pub-XXXXXXXXXXXX";
    google_ad_width = 250;
    google_ad_height = 250;
    google_ad_format = "250x250_as";
    google_ad_type = "text";
    google_ad_channel ="";
    //--></script>
    <script type="text/javascript"
      src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
    
    
       '              );
       
       $bot_poster = array (
            
             'members_display_name'   => '<a href="http://www.myhotimage.com">Advertisements</a>',
             'title'   => 'Thanks for your support!',
             'avatar'  => '<img src=http://www.google.com/images/logo_sm.gif>',
             'member_group' => $this->ipsclass->lang['m_group'].' Advertisements',        
             'member_joined' => $this->ipsclass->lang['m_joined'].' '.$this->ipsclass->get_date( time(), 'JOINED' ),
             
            );   
       
       $this->post_count++;
       $ad['post_date'] = $row['post_date'];
       $this->output .= $this->ipsclass->compiled_templates['skin_topic']->RenderRow( $ad, $bot_poster );
       
      }
    Code (markup):



    Notes:

    1- Replace "myhotimage.com" with your domain.
    2- replace "pub-XXXXXXXXXXXX" with your Adsense ID
    3- best format for this AD is 2 blocks on 250x250 - feel free to make your own size

    Hope that helped :)
     
    Scriptona, Sep 16, 2006 IP
  2. Scriptona

    Scriptona Notable Member

    Messages:
    4,957
    Likes Received:
    265
    Best Answers:
    0
    Trophy Points:
    280
    #2
    anyone interested in that ?
     
    Scriptona, Oct 3, 2006 IP
  3. wahba87

    wahba87 Member

    Messages:
    86
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #3
    WOW !!!

    Really Gr8 :D , thanks ba7ebahaaa


    waiting 4 more ;)
     
    wahba87, Nov 27, 2006 IP