Some (not sooo important) Questions

Discuss phpwcms here, please do not post support requests, bug reports, or feature requests! Non-phpwcms questions, discussion goes in General Chat!
Post Reply
wingover
Posts: 58
Joined: Wed 13. Apr 2005, 13:18
Contact:

Some (not sooo important) Questions

Post by wingover »

Hi,

I have two questions. Maybe someone has an answer...

The RT {SPACER} works in 1.2.8 only in templates, not in content.
In 1.2.6 it was working in content also. Does anybody know, where I can change that in the code?


I have a template with php-code. Something like:

[PHP]
if(blablabla)
{
include(blablabla);
}
else
{
echo 'aldfalflalal<br>
{CONTENT}';
}
[/PHP]

Now the linebreaks <br> or <br />, which are inside the PHP-Tags are lost. I found and changed this in the 'front.func.inc.php':

function include_int_phpcode($string) {
// return the PHP code
$s = html_despecialchars($string[1]);
$s = str_replace('<br>', "\n", $s);
$s = str_replace('<br />', "\n", $s);
ob_start();
eval($s.";");
$return = ob_get_contents();
ob_end_clean();
return $return;
}

For what is this good to replace the linebreaks into '\n'?


Thank you for your help.

Grüzli - Andi
---------------------------------------------------
Vol Libre - der Traum vom freien Fliegen
http://www.gleitschirm-taxi.de
Faszination Berge
http://www.mountain-panorama.com
---------------------------------------------------
User avatar
flip-flop
Moderator
Posts: 8178
Joined: Sat 21. May 2005, 21:25
Location: HAMM (Germany)
Contact:

Post by flip-flop »

Hi Andi,
The RT {SPACER} works in 1.2.8 only in templates, not in content.
In 1.2.6 it was working in content also. Does anybody know, where I can change that in the code?
I can´t confirm this. For me it is working in V1.2.8/9.
I have a template with php-code. Something like: .....

... For what is this good to replace the linebreaks into '\n'?
I don´t know, only O.G. can answer this question.

Regards Knut
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
wingover
Posts: 58
Joined: Wed 13. Apr 2005, 13:18
Contact:

Post by wingover »

Hallo flip-flop,

I have changed the order of some lines in the 'content.func.inc.php'.

If in the template the 'show_content' reptag is used, things like {SPACER} and [ID num]link[/ID] doesnt work, because the 'show_content' replacement is after the replacement of the other tags.

I moved this lines before the replacement-lines of the reptags:

// {SHOW_CONTENT:MODE,id[,id[,...]]}
if( ! ( strpos($content["all"],'{SHOW_CONTENT:')===false ) ) {
$content["all"] = preg_replace('/\{SHOW_CONTENT:(.*?)\}/e', 'showSelectedContent("$1");', $content["all"]);
}


Grüzli - Andi
---------------------------------------------------
Vol Libre - der Traum vom freien Fliegen
http://www.gleitschirm-taxi.de
Faszination Berge
http://www.mountain-panorama.com
---------------------------------------------------
Post Reply