1
tgotch
Newbb and Adsense Code
  • 2005/12/3 18:55

  • tgotch

  • Just popping in

  • Posts: 66

  • Since: 2005/1/31


I have seen a few forums where people are putting adsense code between thread posts in their forum. Does anyone know how/where to implement the code in Newbb to do something like this?

Regards.

2
dickinsd
Re: Newbb and Adsense Code
  • 2005/12/3 19:09

  • dickinsd

  • Quite a regular

  • Posts: 278

  • Since: 2004/11/14


You would make this change in the thread template.

You need to clone your default template before you can make changes to it.

Assuming you have a cloned template set go to the template manager and look for forum or whatever you have called the forum module on your site.
Click on the link that says List and then look for a template called newbb_thread.html and click edit.

Originally it will look something like this (I am using Newbb2)

Quote:



























  • <{$down}> <{$topic_post.poster_name}>






      <{$topic_post.poster_userbar}>
      <{if $viewer_is_admin == true and $topic_post.poster_ip}>






      <{/if}>
      <{$personal}><{$topic_post.poster_name}>
      <{$smarty.const._MD_TOPICOPTIONADMIN}>
      IP: <{$topic_post.poster_ip}>




<{$topic_post.post_title}>
#<{$topic_post.post_no}>

<{if $topic_post.poster_uid != 0}>
<{$topic_post.poster_rank_title}>
<{$topic_post.poster_rank_image}>


<{$smarty.const._MD_JOINED}>: <{$topic_post.poster_regdate}>

<{$smarty.const._MD_FROM}> <{$topic_post.poster_from}>

<{$smarty.const._MD_POSTS}>: <{$topic_post.poster_postnum}>

<{if $groupbar_enable}>
<{$smarty.const._MD_GROUP}>
<{$topic_post.poster_groups}>

<{/if}>
<{$topic_post.poster_status}>

<{else}>
<{$anonymous_prefix}><{$topic_post.poster_uname}>

<{/if}>

<{$topic_post.post_text}>HERE

<{if $topic_post.post_attachment}>
<{$topic_post.post_attachment}>

<{/if}>
<{if $topic_post.post_edit}>

<{$topic_post.post_edit}>


<{/if}>

<{if $topic_post.poster_sig}>

_________________

<{$topic_post.poster_sig}>

<{/if}>
<{$smarty.const._MD_POSTEDON}><{$topic_post.post_date}>

<{foreach item=abtn from=$topic_post.thread_action}> <{$abtn.image}> <{/foreach}>

<{foreach item=btn from=$topic_post.thread_buttons}> <{$btn.image}> <{/foreach}>



You should see about half way down the code above I wrote HERE This is where you would add your Adsense code.

However I think that I remember seeing that you should have no more than 3 instances of adsense on a single page AND of course too many adds will distract from the content of the forums so you may want to add something like this:

<{if $topic_post.post_no == 1}><center><BR>[b]GOOGLE CODE HERE[/b]center><BR><{/if}>


I think there may be a FAQ giving this info on this site somewhere you may want to try doing a search for more information.

Dave

Edit:FAQ for adding Adsense code to Newbb or Cbb

3
tgotch
Re: Newbb and Adsense Code
  • 2005/12/3 19:24

  • tgotch

  • Just popping in

  • Posts: 66

  • Since: 2005/1/31


Dave,
Thanks, that did it. I implemented the code as you said. It only shows one instance of adsense in the first post of the thread. Not sure what this does:

<{if $topic_post.post_no == 1}><center><BR>GOOGLE CODE HEREcenter><BR><{/if}>


Anyway, thanks again!

4
gawel
Re: Newbb and Adsense Code
  • 2007/1/10 11:27

  • gawel

  • Just popping in

  • Posts: 28

  • Since: 2004/2/2 2


Could you tell me wwhta does it mean "$topic_post.post_no == 1"
This is number of the post in thread? If I put 3 or 4 it will display adsense in 3rd or 4th post?
It does not work on my site. I use NewBB 1.0.

Login

Who's Online

454 user(s) are online (385 user(s) are browsing Support Forums)


Members: 0


Guests: 454


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits