![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 156 Pomógł: 15 Dołączył: 13.09.2003 Skąd: London Ostrzeżenie: (0%) ![]() ![]() |
Mam taka funkcje:
[php:1:29914852a5]<?php function gettemplate($templatename, $gethtmlcomments = 1) { if(file_exists("templates/$templatename.htm")){ $fd = fopen ("templates/$templatename.htm", "r"); $template_file = fread ($fd, filesize ("templates/$templatename.htm")); $template = preg_replace_callback('/{_([^ ]+)}/U', create_function('$matchs', 'return $GLOBALS["lang_$matchs[1]"];'), $template_file); $template = preg_replace_callback('/{([^ ]+)}/U', create_function('$matches', 'return $GLOBALS[$matches[1]];'), $template); if ($options['addtemplatename'] = 1 AND $gethtmlcomments = 1) { $template = "n<!-- POCZATEK SZABLONU: $templatename -->n$templaten<!-- KONIEC SZABLONU: $templatename -->n"; } fclose($fd); return $template; } else { return "<center><font color="red">Wystapil blad krytyczny - Brak szablonu '$tplfile'. Skontaktuj sie z administratorem.</font></center>"; } } ?>[/php:1:29914852a5] Chce miec mozliwosc dodania do szablonu czegos takiego: Kod <if condition="$show"> tutaj tresc strony </if>
i jesli funkcja natrafi na taki kod zeby sprawdzila czy np. $show == 1, a jesli tak to wyswietlila kod miedzy znacznikiem <if></if>. Ma ktos pomysl jak to zrobic? (IMG:http://forum.php.pl/style_emoticons/default/sad.gif) widze, ze chyba nikt (IMG:http://forum.php.pl/style_emoticons/default/sad.gif) |
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Przyjaciele php.pl Postów: 660 Pomógł: 0 Dołączył: 28.08.2002 Skąd: Starachowice Ostrzeżenie: (0%) ![]() ![]() |
A w szablonie masz zmienne z $ ?
[xml:1:1362f07aa0]<if condition="$show">TRESC STRONY</if>[/xml:1:1362f07aa0] |
|
|
![]() ![]() |
![]() |
Aktualny czas: 18.09.2025 - 23:09 |