» Log in
User Name:

Password:

Not a member yet?
Register Now!
» Online Users: 62
0 members and 62 guests
No Members online
Most users ever online was 611, 03-21-2008 at 11:10 PM.
» .::.
Web Hosting - web hosting, dedicated servers and web design services
Online Degree - search for 1000+ online degrees, online colleges & online universities.
Tattoo - we are a group of tattoo enthusiasts
Gexa Energy - your absolute best choice in electric service
Texas electricity - save on electric rates
Football Betting - best nfl betting promotions at sportsbook.com.
Oral Chelation - initial cleansing of your veins & arteries
Portatiles - Ofertas en Ordenadores y Portatiles. Increibles Ofertas DELL.

Register Now! Contact Us

About this Page
This is a discussion on Google Adsense in Forum Posts How to... within the Open topics forums, part of the General category; Ever wanted to have Google Adsense within your forums threads, heres how. Open: modules/Forums/viewtopic.php: Find: Code: // // Okay, ...


Go Back   Nukemods Forum » General » Open topics

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-05-2006, 09:32 AM
Member
 
Join Date: Jul 2004
Posts: 450
Google Adsense in Forum Posts How to...
Ever wanted to have Google Adsense within your forums threads, heres how.

Open: modules/Forums/viewtopic.php:
Find:
Code:
//
// Okay, let's do the loop, yeah come on baby let's do the loop
// and it goes like this ...
//
Right under that is the statement that begins the looping through the posts:
Code:
for($i = 0; $i < $total_posts; $i++)
{
Under that code add:
Code:
if ($i=="0") {
$adblock = $adblocktext;
} else {
$adblock = "";
}
Find on Line 1:
Code:
<?php
Next Line add:
Code:
$adblocktext = <<<EOM
<tr><td colspan=2 align=center>
Insert your Google AdSense Code Here
</td></tr>
EOM;
Find:
Code:
$template->assign_block_vars('postrow', array(
'ROW_COLOR' => '#' . $row_color,
'ROW_CLASS' => $row_class,
Next Line add:
Code:
'AD_BLOCK' => $adblock,
Save and close.

Now go into the themes directory, and into the subdirectory of the theme you are using (i.e. themes/Your_Theme).

Open forums/viewtopic_body.tpl

Find:
Code:
Right above it, add the following:
Code:
{postrow.AD_BLOCK}
Save the file, and you're done!

Now your forums will insert related Google Adsense adverts refering to the topic, after the first post.

As with Google Adsense codes, you can edit Colors to match your theme.

If you need a Google Adsense signup : HERE

DEMO: www.gamers-crib.com
__________________
What is Pay Per Play ?
ADVERTISING has commenced!!! We have launched!!!!!!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 11-05-2006, 02:19 PM
Duke's Avatar
Super Moderator
 
Join Date: Dec 2005
Location: Under your bed
Posts: 1,002
Send a message via AIM to Duke
Great tutorial, thanks Marty!

BTW, have you made recent changes to your site? I seem to remember visiting before and the theme was different?

At any rate, it looks great.
__________________


My Daughter Rules!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 11-05-2006, 05:15 PM
Member
 
Join Date: Jul 2004
Posts: 450
Just a face lift yeah.... BTW can you still do that m8 ?
__________________
What is Pay Per Play ?
ADVERTISING has commenced!!! We have launched!!!!!!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-07-2007, 09:00 PM
Junior Member
 
Join Date: Sep 2006
Location: Italy
Posts: 5
Hi dear,
I've the last version of phpnuke and your trick no have success! The banner doesn't appear... same solution?
Thanks!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 01-08-2007, 03:31 AM
Member
 
Join Date: Jul 2004
Posts: 450
Originally Posted by PSYKKO
Hi dear,
I've the last version of phpnuke and your trick no have success! The banner doesn't appear... same solution?
Thanks!
It should work on any 7.x version including platinum & PNC

Are you sure you dont have adds blocked on your Browser ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 01-08-2007, 10:41 AM
Junior Member
 
Join Date: Sep 2006
Location: Italy
Posts: 5
I'm very sure becouse I'm able to see the ads in home page... not in forum!
See my situation:
http://www.acspiritosanto.altervista.org/web/index.php
Thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 01-08-2007, 11:49 AM
Member
 
Join Date: Jul 2004
Posts: 450
Originally Posted by PSYKKO
I'm very sure becouse I'm able to see the ads in home page... not in forum!
See my situation:
http://www.acspiritosanto.altervista.org/web/index.php
Thanks.
I looked at your source code and your google ads code is there however I think its the code you are using thats the problem, try just using the google ads code from <script> then center your firefox add.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 01-08-2007, 01:33 PM
Junior Member
 
Join Date: Sep 2006
Location: Italy
Posts: 5
Doesn't work again... I think that there is same protection in this version of phpnuke. I've just delete protection in mainfile.php, about script, but nothing...

Note that the script work in a simple html page... :cry:
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Google adsense problem .... pleeeease help .... krish1234 Nuke 7.x - General 15 03-23-2007 03:01 AM
google adsense in phpnuke afghanano Nuke 7.x - General 3 06-03-2006 10:55 PM
Google Adsense. Please look ldude69000 Site design 0 09-15-2005 05:54 PM
Google Adsense David789 Site design 0 08-24-2005 10:30 AM
latest forum posts in forum index? unknown Purged Topics 3 03-24-2003 03:21 PM


All times are GMT -5. The time now is 01:36 PM.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.

LinkBacks Enabled by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31