1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Adding Adsense to PHPBB

Discussion in 'vBulletin' started by NewComputer, Nov 8, 2004.

  1. dcristo

    dcristo Illustrious Member

    Messages:
    19,776
    Likes Received:
    1,199
    Best Answers:
    7
    Trophy Points:
    470
    Articles:
    7
    #21
    I see.

    Im really liking this adsense integration. It works really well with the link units format it's not too in the face of my forum members.
     
    dcristo, Jul 9, 2005 IP
  2. RectangleMan

    RectangleMan Notable Member

    Messages:
    2,825
    Likes Received:
    132
    Best Answers:
    0
    Trophy Points:
    210
    #22
    I have adsense integration on my phpbb sites as well.
    http://www.pspforums.com and I have it setup so that certain ads are for guests only. I have a subscription mod installed and subscribers see the site ad free. It has worked out very well for me.

    If anyone needs phpbb help I am the man to go to. I can do anything with phpbb.

    http://www.360forum.com
    http://www.blackjackforums.com

    These are just 2 of my sites that I even skinned myself.

    :)

    phpbb rocks if you know what you are doing.
     
    RectangleMan, Jul 16, 2005 IP
  3. dcristo

    dcristo Illustrious Member

    Messages:
    19,776
    Likes Received:
    1,199
    Best Answers:
    7
    Trophy Points:
    470
    Articles:
    7
    #23
    Your da man yo!

    I just had a quick browse of your xbox forums, looks good, but u may wanna look into improving load times its very slow even on broadband.
     
    dcristo, Jul 16, 2005 IP
  4. RectangleMan

    RectangleMan Notable Member

    Messages:
    2,825
    Likes Received:
    132
    Best Answers:
    0
    Trophy Points:
    210
    #24
    Thanks. The load time may also be part of the ads if you are not a member.
     
    RectangleMan, Jul 16, 2005 IP
  5. Bernard

    Bernard Well-Known Member

    Messages:
    1,608
    Likes Received:
    107
    Best Answers:
    0
    Trophy Points:
    185
    #25
    This is what I want to do. I currently show adsense to everyone. What condition do I need to check/wrap around the adsense code to exclude it for logged in members?
     
    Bernard, Oct 24, 2005 IP
  6. Bibofa

    Bibofa Peon

    Messages:
    100
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #26
    Your da man yo!
     
    Bibofa, Oct 30, 2005 IP
  7. Bibofa

    Bibofa Peon

    Messages:
    100
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #27
    This is what I want to do. I currently show adsense to everyone. What condition do I need to check/wrap around the adsense code to exclude it for logged in members?

    I agree with you
     
    Bibofa, Oct 30, 2005 IP
  8. TheSyndicate

    TheSyndicate Prominent Member

    Messages:
    5,410
    Likes Received:
    289
    Best Answers:
    0
    Trophy Points:
    365
    #28
    I will try to fix it on my swedish forum i got some nice ideas now thanks
     
    TheSyndicate, Oct 30, 2005 IP
  9. techlh

    techlh Peon

    Messages:
    324
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #29
    Does anyone know the PHP to add for determining if the user is logged in or not?
     
    techlh, Nov 4, 2005 IP
  10. 993ti

    993ti Well-Known Member

    Messages:
    314
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    108
    #30
    In php files:
    if ( $userdata['session_logged_in'] )
    {
    CODE HERE
    }
    
    Code (markup):
    In tpl files:
    
    <!-- BEGIN switch_user_logged_out --> 
    CODE HERE
    <!-- END switch_user_logged_out --> 
    
    Code (markup):
     
    993ti, Nov 4, 2005 IP
    Bernard likes this.
  11. 993ti

    993ti Well-Known Member

    Messages:
    314
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    108
    #31
    This is what i have in viewtopic.php:
    
    Find:
    }
    
    $template->pparse('body');
    
    REPLACE wITH
    
    if($i == 0)  
       {  
           $row_color = ( !($num_post % 2) ) ? $theme['td_color1'] : $theme['td_color2'];  
           $row_class = ( !($num_post % 2) ) ? $theme['td_class1'] : $theme['td_class2'];  
           $num_post ++;  
           $message = 'ADSENSE CODE HERE';  
           $template->assign_block_vars('postrow', array(  
               'ROW_COLOR' => '#' . $row_color,  
               'ROW_CLASS' => $row_class,  
               'POSTER_NAME' => 'Google',  
               'POST_DATE' => '',  
               'POST_SUBJECT' => 'Sponsored Link',  
               'MESSAGE' => $message,  
               'MINI_POST_IMG' => $mini_post_img,  
               'U_POST_ID' => '0'  
           ));  
       }
    }
    $template->pparse('body');
    
    Code (markup):
     
    993ti, Nov 4, 2005 IP
  12. techlh

    techlh Peon

    Messages:
    324
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #32
    Thanks, you rock!
     
    techlh, Nov 4, 2005 IP
  13. Dio

    Dio Well-Known Member

    Messages:
    725
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    120
    #33
    Just spotted this as I'm figuring out how to do it on my new vb board. just having it in the header could be a breach of TOS as it will also show on non-content pages like login and profiles.
     
    Dio, Feb 8, 2006 IP
  14. Imran

    Imran Notable Member

    Messages:
    2,340
    Likes Received:
    190
    Best Answers:
    0
    Trophy Points:
    230
    #34
    thats true having in header does breach TOS, but here DP as well its in header?
    what say?
     
    Imran, Feb 8, 2006 IP
  15. Dio

    Dio Well-Known Member

    Messages:
    725
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    120
    #35
    Its not on the log-on and register pages here, its just a link, not the adsense code. I choose to be extra careful and keep it off all the search, admin, profile pages etc, as well. I've got it on raw content pages only. Showthread, forum display and forumhome only.
     
    Dio, Feb 8, 2006 IP
  16. dcristo

    dcristo Illustrious Member

    Messages:
    19,776
    Likes Received:
    1,199
    Best Answers:
    7
    Trophy Points:
    470
    Articles:
    7
    #36
    Start up a new thread dude you should get a better response, this is a phpbb and adsense thread.
     
    dcristo, Feb 8, 2006 IP
  17. Dio

    Dio Well-Known Member

    Messages:
    725
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    120
    #37
    Hehe - surfed in through the Archive - but this is also relevant for PHPBB and Adsense. Any forum software in fact - global headers and adsense are a no-no if they also display on Login and other non-content pages. :)
     
    Dio, Feb 8, 2006 IP
  18. dcristo

    dcristo Illustrious Member

    Messages:
    19,776
    Likes Received:
    1,199
    Best Answers:
    7
    Trophy Points:
    470
    Articles:
    7
    #38
    True, but knowing which templates to edit is a different story though.
     
    dcristo, Feb 8, 2006 IP
  19. GTAce

    GTAce Notable Member

    Messages:
    1,389
    Likes Received:
    78
    Best Answers:
    0
    Trophy Points:
    210
    #39
    Not only is it a phpBB thread, but it is a phpBB thread that is well over a year old ;)
     
    GTAce, Feb 8, 2006 IP
  20. Dio

    Dio Well-Known Member

    Messages:
    725
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    120
    #40
    That's as maybe, but as I found myself here via the archive and a few key search terms in Google, I thought it would be a good idea to add the appropriate info rather than have others end up here and not realise, and risk their AdSense accounts. :)

    To bring it straight back on topic - if you want to do it PHPBB, the templates you can add the code to for the meatiest content pages are: index_body.tpl, viewforum_body.tpl and viewtopic_body.tpl :)
     
    Dio, Feb 9, 2006 IP