1
jimkarvo
Adsense ads between posts!
  • 2007/6/13 16:14

  • jimkarvo

  • Not too shy to talk

  • Posts: 169

  • Since: 2005/9/19


Hello,

How I can have Google's adsense advertisments between the posts of a thread? I have installed the CBB

Yours,
JimKarvo
www.pc4allgr.com - Greek community for PCs

PC4ALL Admins' Team!

2
chippyash
Re: Adsense ads between posts!
  • 2007/6/13 19:12

  • chippyash

  • Friend of XOOPS

  • Posts: 501

  • Since: 2004/1/29


The only way to do this that I can think of is for you to edit the templates that display the articles to put the adsense block in the footer of each article.

3
nachenko
Re: Adsense ads between posts!
  • 2007/6/13 19:22

  • nachenko

  • Quite a regular

  • Posts: 356

  • Since: 2005/1/18


No big deal.

Just edit the template to include adsense code.

To insert the ads only in some spaces, such as first or second post, you can use $smarty variable:

$smarty.foreach.name_of_the_loop.iteration

This will tell you how many times has the loop been executed.

4
jimkarvo
Re: Adsense ads between posts!
  • 2007/6/14 6:23

  • jimkarvo

  • Not too shy to talk

  • Posts: 169

  • Since: 2005/9/19


Quote:

nachenko wrote:
No big deal.

$smarty.foreach.name_of_the_loop.iteration

This will tell you how many times has the loop been executed.


Hm.. I don't know so good code:P anyway, Maybe I have to change the "name_of_loop".. Rigth? But with I have to change? Also, Where I have to put the code...
www.pc4allgr.com - Greek community for PCs

PC4ALL Admins' Team!

5
nachenko
Re: Adsense ads between posts!
  • 2007/6/14 9:46

  • nachenko

  • Quite a regular

  • Posts: 356

  • Since: 2005/1/18


The usual thing is that foreach loops have no name.

You need to assign a name to posts loop. Like this:

{foreach name=myname item=myitem from=$myarray}


An example:

http://www.marruecosdigital.net/xoops/modules/wfsection/

You have an ad after 3rd item.

The loop begins with:

Quote:
<{foreach name=featureloop item=feature from=$features}>


and just before reaching loop end, is this code:

Quote:
<{if $smarty.foreach.featureloop.iteration == 3}>

... code that inserts the ad here ...

<{/if}>

6
jimkarvo
Re: Adsense ads between posts!
  • 2007/6/14 13:36

  • jimkarvo

  • Not too shy to talk

  • Posts: 169

  • Since: 2005/9/19


Do you know the file that I have to edit?
www.pc4allgr.com - Greek community for PCs

PC4ALL Admins' Team!

7
huzhenghui
Re: Adsense ads between posts!
  • 2007/6/15 6:42

  • huzhenghui

  • Just popping in

  • Posts: 53

  • Since: 2007/3/24


Quote:

jimkarvo wrote:
Do you know the file that I have to edit?

What is the URL in which you want to add advertisement?
gmail & gtalk: huzhengh (at) gmail (dot) com
Skype: huzhenghui

8
jimkarvo
Re: Adsense ads between posts!
  • 2007/6/15 15:25

  • jimkarvo

  • Not too shy to talk

  • Posts: 169

  • Since: 2005/9/19


Do you mean the site?http://www.pc4allgr.com
www.pc4allgr.com - Greek community for PCs

PC4ALL Admins' Team!

9
CiberEspia
Re: Adsense ads between posts!

Mario Burga
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>Adictoshp.org|Web Blog<<
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

10
huzhenghui
Re: Adsense ads between posts!
  • 2007/6/16 2:01

  • huzhenghui

  • Just popping in

  • Posts: 53

  • Since: 2007/3/24


Quote:

jimkarvo wrote:
Do you mean the site?http://www.pc4allgr.com

I want to know the page url in which you want to add advertisement.
Perhaps you have already solved the problem.
gmail & gtalk: huzhengh (at) gmail (dot) com
Skype: huzhenghui

Login

Who's Online

189 user(s) are online (114 user(s) are browsing Support Forums)


Members: 0


Guests: 189


more...

Donat-O-Meter

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

Latest GitHub Commits