Welcome to Geeklog, Anonymous Saturday, April 20 2024 @ 12:14 am EDT

Geeklog Forums

Ads in stories


Status: offline

::Ben

Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
Hello everybody,

I looking for a simple way to put some code in stories between intro-text and body-text.

Thanks.

::Ben
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

Status: offline

1000ideen

Forum User
Full Member
Registered: 08/04/03
Posts: 1298
You mean when they unfold? You want to do it manually each time or automatically in a thtml file? A good idea is to place it in the blockfooter-related.thtml
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
what kind of code are we talking about? HTML, JavaScript, PHP?

If you're talking about PHP, then you'll have to hack the core.
HTML (and I think JavaScript--don't quote me) can go right into your story intro or body according to what tags are allowed by $_CONF['user_html'] and/or $_CONF['admin_html'] and/or $_CONF['advanced_editor'].

...and of course, as 1000ideen has suggested, where you put the code will depend upon how you want it to function.
 Quote

Status: offline

::Ben

Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
@ 1000ideen: Yes when they unfold and I want do it automaticaly. blockfooter-related is a good place but I want exactely between intro-text and body-text.

@ machinari: This time it's JavaScript from Google Adsense Wink

Thanks.

::Ben
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
easy as pie!

use storytext.thtml for example.
fine the variable {story_introtext} in storytext.thtml and replace with {story_introtext_only}{story_bodytext_only}.
Then place your script between those 2 variables.

The result is that your script will display below your intro text whether on the front page or on the article page. If you want the script to only display on the article page then you have to include the script in the bodytext variable, which is set in lib-story.php -- STORY_renderArticle() is the function you're looking for.

I thought that using storybodytext.thtml would work, which would be cool, but I couldn't get it done. I might try again later.
 Quote

Status: offline

::Ben

Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
I will edit the lib-story.php

Thanks machinari.

::Ben
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

Status: offline

::Ben

Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
So near line 285 in lib-story.php there is :

Text Formatted Code
$article->set_var( 'story_introtext', $introtext . '<br><br>'
                               . $bodytext );


You can add code like this to draw a line for exemple :

Text Formatted Code
$article->set_var( 'story_introtext', $introtext . '<div style="clear:both;"></div><hr><br><br>'
                               . $bodytext );


Thanks.

::Ben
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

All times are EDT. The time is now 12:14 am.

  • 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