Status: offline

::Ben

Forum User
Full Member
Registered: 01/14/05
Posts: 1569
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

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

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.

Status: offline

::Ben

Forum User
Full Member
Registered: 01/14/05
Posts: 1569
@ 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

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.

Status: offline

::Ben

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

Thanks machinari.

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

Status: offline

::Ben

Forum User
Full Member
Registered: 01/14/05
Posts: 1569
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