Top Poster
#1 ramon fincken 400
#2 Site admin 3
#3 Ber|Art 2
#4 braddmark 1
#5 accentmedia 1
#6 Xarzu 1
#7 pEcosespedex 1
#8 khadish 1
#9 moxxx 1
#10 nistelrock 1
phpbb2 inline google ads



Rating : 3.5 / 5

 
Post new topic   Reply to topic    Ramonfincken.com Forum Index -> PHP coding
Beta
Want to be notified by email when this topic gets a reply?  
View previous topic :: View next topic  
Author Message
ramon fincken
Site's programmer

Get a free globally recognized avatar
It's free!


Joined: 03 Aug 2007
Posts: 400
Location: A'dam/Diemen, The Netherlands

PostPosted: Mon Mar 10, 2008 5:02 pm    Post subject: phpbb2 inline google ads Reply with quote

Want to have these google ads appearing in your forum?

Here's a howto:

OPEN
Code:
viewtopic.php


FIND
# Around line 840
Code:
//
// Okay, let's do the loop, yeah come on baby let's do the loop
// and it goes like this ...
//


FIND
Code:
for($i = 0; $i < $total_posts; $i++)
{


REPLACE WITH
Code:
// Google AD
// Ramon Fincken, Websitefreelancers.nl Ramonfincken.com
$i_clone = 0;
for($i = 0; $i < $total_posts; $i++)
{
   $i_clone++;
   // Google AD
   // Ramon Fincken, Websitefreelancers.nl Ramonfincken.com



FIND
Code:
      'L_MINI_POST_ALT' => $mini_post_alt,

      'U_MINI_POST' => $mini_post_url,
      'U_POST_ID' => $postrow[$i]['post_id'])
   );



AFTER, ADD
Code:

   // Google AD
   // Ramon Fincken, Websitefreelancers.nl Ramonfincken.com
   if($i_clone === 1 || $i_clone === 7)
   {
      $row_color = ( !($i_clone % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
      $row_class = ( !($i_clone % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
         $i_clone++;

      $message = '<strong>Advertisement</strong>';
      $message .= '<script type="text/javascript"><!--
         google_ad_client = "pub-0964453741274626";
         google_ad_slot = "9315104464";
         google_ad_width = 468;
         google_ad_height = 60;
         //--></script>
         <script type="text/javascript"
         src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
         </script>';
      $template->assign_block_vars('postrow', array(
         'ROW_COLOR' => '#' . $row_color,
         'ROW_CLASS' => $row_class,
         'POSTER_NAME' => 'Google adsense',
         'POSTER_RANK' => 'Advertisement',
         'RANK_IMAGE' => $rank_image,
         'POSTER_JOINED' => '',
         'POSTER_POSTS' => '',
         'POSTER_FROM' => '',
         'POSTER_AVATAR' => '',
         'POST_DATE' => $post_date,
         'POST_SUBJECT' => $post_subject,
         'MESSAGE' => $message,
         'SIGNATURE' => '',
         'EDITED_MESSAGE' => '',
   
         'MINI_POST_IMG' => $mini_post_img,
         'PROFILE_IMG' => '',
         'PROFILE' => '',
         'SEARCH_IMG' => '',
         'SEARCH' => '',
         'PM_IMG' => '',
         'PM' => $pm,
         'EMAIL_IMG' => '',
         'EMAIL' => '',
         'WWW_IMG' => '',
         'WWW' => '',
         'ICQ_STATUS_IMG' => '',
         'ICQ_IMG' => '',
         'ICQ' => '',
         'AIM_IMG' => '',
         'AIM' => '',
         'MSN_IMG' => '',
         'MSN' => '',
         'YIM_IMG' => '',
         'YIM' => '',
         'EDIT_IMG' => '',
         'EDIT' => '',
         'QUOTE_IMG' => '',
         'QUOTE' => '',
         'IP_IMG' => '',
         'IP' => '',
         'DELETE_IMG' => '',
         'DELETE' => '',
   
         'L_MINI_POST_ALT' => $mini_post_alt,
   
         'U_MINI_POST' => $mini_post_url,
         'U_POST_ID' => $postrow[$i]['post_id'])
      );
   }
   // Google AD
   // Ramon Fincken, Websitefreelancers.nl Ramonfincken.com


DIY INSTRUCTIONS
Edit the
Code:
         google_ad_client = "pub-0964453741274626";
         google_ad_slot = "9315104464";

bit to fit your own google code, see the google page when creating a new ad


DIY INSTRUCTIONS
adjust the
Code:
if($i_clone === 1 || $i_clone === 7)

to fit your needs ( and times ) to show the google ad, right now it will show after the 1rst and the 7th post
Back to top
View user's profile Send private message Visit poster's website
Google adsense
Advertisement





PostPosted: Mon Mar 10, 2008 5:02 pm    Post subject: phpbb2 inline google ads

Advertisement
Back to top
GravityForms
Advertisement





PostPosted: Mon Mar 10, 2008 5:02 pm    Post subject: phpbb2 inline google ads

Advertisement
Gravity Forms Plugin for WordPress
Back to top
ramon fincken
Site's programmer

Get a free globally recognized avatar
It's free!


Joined: 03 Aug 2007
Posts: 400
Location: A'dam/Diemen, The Netherlands

PostPosted: Mon Jun 09, 2008 9:21 pm    Post subject: Re: phpbb2 inline google ads Reply with quote

See also:

http://www.mydigitallife.info/2005/11/0...e-adsense/
Back to top
View user's profile Send private message Visit poster's website
Post new topic   Reply to topic    Ramonfincken.com Forum Index -> PHP coding All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
General forums
The world of freelance
Programming
Other projects
Poll
I love gifts

Yes goodies and presents! [3]
No but I love polls ! [1]

Related google ads