Welcome to Geeklog, Anonymous Saturday, December 21 2024 @ 01:57 pm EST

Geeklog Forums

AdSense ads in article text


martingale

Anonymous
How can I insert google adsense ads into the text of my stories? (As opposed to in the left/right blocks, I want the ads in the text.)

I have had no problem getting them on the index pages, just by creating a right block and dropping in the adsense code for a skyscraper. Works *almost* great: my only problem there was that I didn't actually want a title on the block, I just want it to start with Google's "Ads By Google". Any way to suppress the title for a block? But basically it's working.

Next I wanted to drop the ads into the article itself. Basically, I wanted an ad to come between the intro-text and the body text of the story, and one at the end of the story. This was trouble: the whole story is rendered in one-shot as {formatted_article} or something, so far as I can see. I had to edit some PHP file, lib-story.php, and modify it to put my own code between the intro and the body. The problem with this is that I have to redo that every time I update geeklog.

Is there a better way? Is there a clean way to insert some boilerplate HTML between the intro text and the body of a story? I didn't see one.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by martingale: Is there a clean way to insert some boilerplate HTML between the intro text and the body of a story?

Not currently. I'd suggest you define two separate variables for the intro and body text in lib-story.php, e.g.
Text Formatted Code
$article->set_var( 'story_intro_only', $introtext );
$article->set_var( 'story_body_only', $bodytext );
 

and use those.

And if you submit this as a feature request, it may even make it into the next Geeklog release Wink

bye, Dirk
 Quote

Status: offline

ScurvyDawg

Forum User
Full Member
Registered: 11/06/02
Posts: 523
I did not want to put the adsense code in between the story texts I placed it in the comment.thtml file I think ..... or something like that.

Check it out

www.scurvydawg.com
 Quote

Status: offline

newblogger

Forum User
Regular Poster
Registered: 08/22/04
Posts: 107
Location:Virginia Beach
I'm having some problems with adsense. I have created a new normal block for the right hand side. I have used the skyscapper settings as suggested. I then placed the javascript code from google into the block content. However I am not recieving anything. I was under the impression that I would get public service announcements if nothing else while google revisits my site. You can see the block in all it's nothingness at my site
The block title is Relative Stuff. Any help would be greatly appreciated.

Got Hot wheels? http://www.dcmotoring.com
 Quote

All times are EST. The time is now 01:57 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content