Hej!
Mam na stronie system szablonów. Podpatrzyłem w kodzie phpBB, w szablonach, mniej więcej takie coś ( chodzi mi o te if-y w komentarzach ) :
<!-- IF not S_USER_LOGGED_IN and not S_IS_BOT -->
<form method="post" action="{S_LOGIN_ACTION}" class="headerspace"> <h3><a href="{U_LOGIN_LOGOUT}">{L_LOGIN_LOGOUT}
</a><!-- IF S_REGISTER_ENABLED --> • <a href="{U_REGISTER}">{L_REGISTER}
</a><!-- ENDIF --></h3> <label for="username">{L_USERNAME}:
</label> <input type="text" name="username" id="username" size="10" class="inputbox" title="{L_USERNAME}" /> <label for="password">{L_PASSWORD}:
</label> <input type="password" name="password" id="password" size="10" class="inputbox" title="{L_PASSWORD}" /> <!-- IF S_AUTOLOGIN_ENABLED -->
|
<label for="autologin">{L_LOG_ME_IN}
<input type="checkbox" name="autologin" id="autologin" /></label> <!-- ENDIF -->
<input type="submit" name="login" value="{L_LOGIN}" class="button2" /> <!-- ENDIF -->
Próbowałem takie coś zrobić u mnie. Inne takie bajery w komentarzach wyszły ale to nie

np. include robię tak:
<?php
$inc = preg_match_all ("/(<!-- INCLUDE (.*?) -->)/", $this->plik['glowny'], $include); foreach ( $incKeys as $k ){
$this->elements['includes'][$include[$k][0]] = $include[$k][0];
$this->elements['includes'][$include[$k][1]] = $include[$k][1];
$this->elements['includes'][$include[1][$k]] = $include[1][$k];
$this->elements['includes'][$include[0][$k]] = $include[0][$k];
}
//a potem zamiana
$keys = array_keys( $this->elements['includes'] ); foreach ( $keys as $k ) {
$this->gotowy_szablon = str_replace( "<!-- INCLUDE " . $k . " -->", "<?php include \"" . $this->element['SZABLONY_SCIEZKA'] . $this->elements['includes'][$k] . "\"; ?>", $this->gotowy_szablon ); }
// i include działa ;)
?>
Jakby mógł ktoś coś podpowiedzieć, byłoby miło