Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's
Author Message
foxyfemfem
New Member
New Member



Joined: Dec 07, 2003
Posts: 22
Location: USA

PostPosted: Sat Sep 10, 2005 8:49 am Reply with quote

OPEN VIEWTOPIC.PHP

FIND:

Code:


//
// Start initial var setup
//


BEFORE ADD:

Code:


$adblocktext = <<<EOM
<tr><td colspan=2 align=center>
Insert your Google AdSense Code Here
</td></tr>
<tr><td class="spaceRow" colspan="2" height="1"><img
src="templates/subSilver/images/spacer.gif"
alt="" width="1" height="1" /></td>
</tr>
EOM;


FIND:

Code:


//
// Okay, let's do the loop, yeah come on baby let's do the loop
// and it goes like this ...
//
for($i = 0; $i < $total_posts; $i++)
{


AFTER ADD:

Code:


if ($i=="0") {
$adblock = $adblocktext;
} else {
$adblock = "";
}


FIND:

Code:


$template->assign_block_vars('postrow', array(
'ROW_COLOR' => '#' . $row_color,
'ROW_CLASS' => $row_class,


AFTER ADD:

Code:


'AD_BLOCK' => $adblock,


SAVE FILE

OPEN VIEWTOPIC_BODY.TPL

FIND:

Code:


<!-- END postrow -->


BEFORE ADD:

Code:


{postrow.AD_BLOCK}


SAVE FILE

Now your forums will insert whatever you wish after the first post. And yes, you can insert Javascript.

Enjoy! Remember too many google ads can be annoying to members.
 
View user's profile Send private message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Sat Sep 10, 2005 9:04 am Reply with quote

FFF! It's been a very long time! Glad to know you're still alive and well Smile
 
View user's profile Send private message
gstrategic
Hangin' Around



Joined: Aug 15, 2005
Posts: 46

PostPosted: Sat Sep 10, 2005 1:59 pm Reply with quote

that's a good trick, but I'm trying to do do this to the news articles and not forums posts. I hope you have a cure for that too. Smile
 
View user's profile Send private message
Raven







PostPosted: Sun Sep 11, 2005 8:46 pm Reply with quote

gstrategic wrote:
that's a good trick, but I'm trying to do do this to the news articles and not forums posts. I hope you have a cure for that too. Smile
If you are referring to this article [ Only registered users can see links on this board! Get registered or login! ] we have demonstrated how to do it. The code works. If it is not working at your site then it's a problem either with how you coded it or something else is interferring with it, but the code does work.
 
blarneystone
Client



Joined: Sep 18, 2004
Posts: 62

PostPosted: Sat Oct 22, 2005 5:32 am Reply with quote

Raven,

How did you insert the google search and adsense up top of the forums? I'd like to do that too
 
View user's profile Send private message Visit poster's website
blarneystone







PostPosted: Sat Oct 22, 2005 3:06 pm Reply with quote

am I banned?? testing...
 
blarneystone







PostPosted: Sat Oct 22, 2005 3:08 pm Reply with quote

whew...I posted some adsense section targeting code and it said I was banned. since I am not, I was going to ask what file and where do I edit to implement section targeting as described on this site?
[ Only registered users can see links on this board! Get registered or login! ]

I am guessing config.php?
 
Raven







PostPosted: Sat Oct 22, 2005 3:15 pm Reply with quote

You insert that code in different files that display content. config.php does not so that is not a good one. For example, I add it to theme.php to get it to show on every page. Then, I inserted it into a couple of templates to show it elsewhere in the forums.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's

View next topic
View previous topic
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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©