Please post all install related problems here. Visit this forum first for troubleshooting.
thebadflo
Posts: 21 Joined: Sat 26. Feb 2005, 12:28
Post
by thebadflo » Tue 17. Apr 2007, 23:09
My content part is included with this code:
Code: Select all
[PHP]
if (logged_in())
echo '{CONTENT}';
else
echo "Dies ist ein Bereich für Benutzer. Logge dich ein oder melde dich an!";
[/PHP]
With this code the content is showed without any paragraphs (<br>, etc.).
If I include the content part with only {CONTENT} it function.
Oliver Georgi
Site Admin
Posts: 9951 Joined: Fri 3. Oct 2003, 22:22
Location: Dessau-Roßlau
Contact:
Post
by Oliver Georgi » Fri 20. Apr 2007, 17:45
You can not do this! [PHP] is processed after {CONTENT} was replaced!
thebadflo
Posts: 21 Joined: Sat 26. Feb 2005, 12:28
Post
by thebadflo » Fri 20. Apr 2007, 19:49
and how can i fix this? or which ways are better?
Oliver Georgi
Site Admin
Posts: 9951 Joined: Fri 3. Oct 2003, 22:22
Location: Dessau-Roßlau
Contact:
Post
by Oliver Georgi » Sat 21. Apr 2007, 08:04
Über frontend_render ist das besser zu handeln. Und dann schneidet man einfach den Bereich heraus.
Template:
Code: Select all
<!--LOGIN_CHECK_START//-->
{CONTENT}
<!--LOGIN_CHECK_END//-->
Code: Select all
<?php
if(!logged_in()) {
$_login_text = 'Dies ist ein Bereich für Benutzer. Logge dich ein oder melde dich an!';
$content['all'] = replace_tmpl_section('LOGIN_CHECK', $content['all'], $_login_text);
} else {
$content['all'] = str_replace('<!--LOGIN_CHECK_START//-->', '', $content['all']);
$content['all'] = str_replace('<!--LOGIN_CHECK_END//-->', '', $content['all']);
}
?>
Oliver
thebadflo
Posts: 21 Joined: Sat 26. Feb 2005, 12:28
Post
by thebadflo » Sat 21. Apr 2007, 15:17
Danke, könntest du mir evtl. noch kurz erklären woe ich den PHP Code eintragen muss?
Oliver Georgi
Site Admin
Posts: 9951 Joined: Fri 3. Oct 2003, 22:22
Location: Dessau-Roßlau
Contact:
Post
by Oliver Georgi » Sat 21. Apr 2007, 15:31
template/inc_script/frontend_render/neuedatei.php
Oliver
thebadflo
Posts: 21 Joined: Sat 26. Feb 2005, 12:28
Post
by thebadflo » Sat 21. Apr 2007, 17:29
cool! das funktioniert ja einwandfrei!
Danke!
Oliver Georgi
Site Admin
Posts: 9951 Joined: Fri 3. Oct 2003, 22:22
Location: Dessau-Roßlau
Contact:
Post
by Oliver Georgi » Mon 30. Apr 2007, 11:23
Eine Funktion "logged_in()" gibt es nicht innerhalb von phpwcms - also musst Du Dich selbst darum kümmern und prüfen, wo Du das verbockt hast.
Oliver
thebadflo
Posts: 21 Joined: Sat 26. Feb 2005, 12:28
Post
by thebadflo » Mon 30. Apr 2007, 18:37
Hallo habe den Bock gefunden. Jedoch habe ich nun das problem, dass meine funktion login() (setzt die session()) nicht mehr funktioniert. daher die funktion logged_in() gibt immmer false zurück?
hast du eine idee?
Oliver Georgi
Site Admin
Posts: 9951 Joined: Fri 3. Oct 2003, 22:22
Location: Dessau-Roßlau
Contact:
Post
by Oliver Georgi » Mon 30. Apr 2007, 18:52
sorry, ich kann bei Custom Hacks keinen kostenfreien Support leisten.
Oliver