Moderator: Moderators


Silverado05 wrote:
Like I said I am working on an admin function that will allow you to use mutiple ads just by adding them via the ACP. So you will be able to have a lot of different ad services. I.E. Google. Affilate Banners from other sites, etc. So with that you could use your phpMyAds and use google at the same time, it will just rotate on visit like it does not with the google ads, but it will be with all of the ads you enter. It is not on the top of my list to complete rigtht away but it is on my board to get completed in the near furture.


Silverado05 wrote:That doesn't look like the one I wrote. Did you modify it or something. or you using a different one?


Silverado05 wrote:Ok here is the code I wrote for a google bot. I don't know if you would actually consider this as a bot, but what it does is add your google adsense ads after the first post of each thread. Now I am working on a ACP function that will allow you to edit ads on the fly and how many ads to add. I.E. just after the first of every other post of 3 post etc. Also allow you to add banners ads that will rotate with your google ads if that is your flavor. This is a real simple code. One file to edit and two lines. I looked for something like this but none that actually worked or looked right. As you can see this flows nicely with your fourm and looks like google actually posted it. Anyways enjoy and if you have an ideas let me know.
Now it you notice at the bottom of the code it says YOUR ADSENSE CODE HERE you need to replace that with your adsense code of course. Also if you wish to use an advatar with it you need to uncomment the line 'POSTER_AVATAR' and then upload your image to your image dir. and then name it accordingly
If you would like to download the entire mode with the code change done this click below.
Google_Adsense_in_topics_1.0.zip
Now if you have a stock forum or have not made changes to the viewtopic.php then just upload this over your exsiting file. Upload the image to your image dir. and you are good to go and it works right out of the box with no changes. I would advise you to change to adsesne code though unless you wish to make me money.The verison in the file uses the avartar. If you don't want to use it then just comment it like shown in the code below.
Screenshot is attached below
- Code: Select all
<?php #
#-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
#
#-----[ REPLACE WITH ]------------------------------------------
#
$row_color = ( !($num % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = ( !($num % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
$num ++;
#
#-----[ FIND ]------------------------------------------
#
'U_POST_ID' => $postrow[$i]['post_id'])
);
#
#-----[ AFTER, ADD ]------------------------------------------
#
if($i == $ad_after)
{
$row_color = ( !($num % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = ( !($num % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
$num ++;
$mini_post_url = append_sid('viewtopic.' . $phpEx . '?' . POST_POST_URL . '=' . $postrow[$i]['post_id']) . '#ad';
$template->assign_block_vars('postrow', array(
'ROW_COLOR' => '#' . $row_color,
'ROW_CLASS' => $row_class,
'POST_DATE' => $post_date,
'POST_SUBJECT' => 'Advertisement',
'MINI_POST_IMG' => $mini_post_img,
'POSTER_NAME' => 'Advertisement',
'POSTER_RANK' => 'Sponsors<br />',
// 'POSTER_AVATAR' => '<img src="images/google_avatar.gif" alt="" border="1" />',
'MESSAGE' => '<div align="center">YOUR ADSENSE CODE HERE</div>',
'L_MINI_POST_ALT' => $mini_post_alt,
'U_MINI_POST' => $mini_post_url,
'U_POST_ID' => 'ad')
);
}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM ?>
Enjoy and is you have any questions let me know.




Users browsing this forum: No registered users and 5 guests