1
sabahan
adsense code in news module
  • 2006/11/26 9:48

  • sabahan

  • Quite a regular

  • Posts: 317

  • Since: 2006/3/4 5


How to put the adsense code in between summary and extended
text in the news module

i would like the ad to appear to user above of the extended text when they click read more

which template to edit ?

2
tcnet
Re: adsense code in news module
  • 2006/11/26 12:31

  • tcnet

  • Friend of XOOPS

  • Posts: 297

  • Since: 2006/5/12


To place an ad between the news "scoop" and the full story, edit news/article.php around line 198:
if ($storypage == 0) {
$story['text'] = $story['text'].'[color=0000FF]Your adsense code here[/color]'.$articletext[$storypage];
} else {
$story['text'] = $articletext[$storypage];
}
} else {
$story['text'] = $story['text'].'[color=0000FF]Your adsense code here[/color]'.$bodytext;
    }

3
sabahan
Re: adsense code in news module
  • 2006/11/26 13:30

  • sabahan

  • Quite a regular

  • Posts: 317

  • Since: 2006/3/4 5


wow thanks ...XOOPS rules

4
BDW
Re: adsense code in news module
  • 2007/1/7 21:35

  • BDW

  • Quite a regular

  • Posts: 280

  • Since: 2002/9/28


I there any way to get this to work so that the adsense banner shows at the bottom of the article.

5
christian
Re: adsense code in news module
  • 2007/1/7 21:54

  • christian

  • Just can't stay away

  • Posts: 401

  • Since: 2002/2/24


with the last version of News' Module 1.51, you can input your adsense code in module'setting.

You have a smarty variable {$advertisement} for each page from module.

6
BDW
Re: adsense code in news module
  • 2007/1/17 13:02

  • BDW

  • Quite a regular

  • Posts: 280

  • Since: 2002/9/28


And where do I find this smarty code?

I need to have the adsense ad at the bottom not the middle.

7
thepaul
Re: adsense code in news module
  • 2007/1/17 22:18

  • thepaul

  • Just popping in

  • Posts: 12

  • Since: 2006/6/20


Quote:

christian wrote:
with the last version of News' Module 1.51, you can input your adsense code in module'setting.

You have a smarty variable {$advertisement} for each page from module.


How would you make use of this {$advertisement} variable to place adsense after the first news entry on the news page.

i.e.

News Story 1
Adsense
News Story 2
News Story 3
News Story 4
News Story 5

8
BDW
Re: adsense code in news module
  • 2007/2/26 12:30

  • BDW

  • Quite a regular

  • Posts: 280

  • Since: 2002/9/28


No answer.......

I could not find this smarty template in any of the templates within news.

So, does anyone else know????

The News module actually puts the advert in a place that is unusual and goes against what google says is good optimisation.

Quote:
For example, on pages where users are typically focused on reading an article, ads placed directly below the end of the editorial content tend to perform very well. It is almost as if users finish reading and ask themselves, "What can I do next?" Precisely targeted ads can answer that question for them.

9
BDW
Re: adsense code in news module
  • 2007/2/26 12:42

  • BDW

  • Quite a regular

  • Posts: 280

  • Since: 2002/9/28


Solved.

Had to hack line 226 in article.php

Quote:

From: $story['text'] = $story['text'].'
'.news_getmoduleoption('advertisement')
'.$bodytext;

To: $story['text'] = $story['text'].'

'.$bodytext.'
'.news_getmoduleoption('advertisement');


And it looks alot better.

And I still have no clue as to where this smarty tag is. i tried putting it into one of the news templates and it didnt work.

Login

Who's Online

345 user(s) are online (279 user(s) are browsing Support Forums)


Members: 0


Guests: 345


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