Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [smarty] odświerzanie się
Ruch Radzionków
post
Post #1





Grupa: Zarejestrowani
Postów: 311
Pomógł: 25
Dołączył: 29.08.2011

Ostrzeżenie: (0%)
-----


witam mam problem otórz mam taki kod:
  1. <div id="srodek">
  2. {if ($stronadocelowa)}
  3. {include file="$stronadocelowa"}
  4. {/if}
  5. </div>

oraz 2 kod php:
  1. $str = $_GET['panel'];
  2. if($str == '')
  3. {
  4. include('page/news.php');
  5. $stronadocelowa = SZABLON_PELNA_SCIEZKA . 'news.tpl';
  6. $smarty->assign("stronadocelowa", SZABLON_PELNA_SCIEZKA . 'news.tpl');
  7. echo'1';
  8. }
  9. else
  10. {
  11. if(is_file('page/'.$str.'.php'))
  12. {
  13. include('page/'.$str.'.php');
  14. $stronadocelowa = SZABLON_PELNA_SCIEZKA . ''.$str.'.tpl';
  15. $smarty->assign("stronadocelowa", SZABLON_PELNA_SCIEZKA . ''.$str.'.tpl');
  16. }
  17. else
  18. {
  19. echo'2';
  20. include('page/news.php');
  21. $stronadocelowa = SZABLON_PELNA_SCIEZKA . 'news.tpl';
  22. $smarty->assign("stronadocelowa", SZABLON_PELNA_SCIEZKA . 'news.tpl');
  23. }
  24. }

i mam taki problem że jak zmienię stronę to w php zemienia się wszystko a na stronie w smartach nie jest dalej ta sama strona co była co musze zrobić żeby się automatycznie odświeżała ?
i jeszcze pokazuje mi się strona :
Kod
Smarty Debug Console - Total Time 0.02711
included templates & config files (load time in seconds)
theme\mit2\header.tpl (compile 0.00000) (render 0.00000) (cache 0.00067)
theme\mit2\left.tpl (compile 0.00000) (render 0.00000) (cache 0.00087)
theme\mit2\center.tpl (compile 0.00000) (render 0.00000) (cache 0.00075)
theme\mit2\footer.tpl (compile 0.00000) (render 0.00000) (cache 0.00065)
assigned template variables
$SCRIPT_NAME    Smarty_Variable Object (3)
->value = "/skill/panelsmarty/index.php"
->nocache = false
->scope = "Global"
$sesja    Smarty_Variable Object (3)
->value = "zle"
->nocache = false
->scope = "Smarty root"
$stronadocelowa    Smarty_Variable Object (3)
->value = "theme/mit2/news.tpl"
->nocache = false
->scope = "Smarty root"
$title    Smarty_Variable Object (3)
->value = "strona by mit2"
->nocache = false
->scope = "Smarty root"
$zliczhelp    Smarty_Variable Object (3)
->value = 0
->nocache = false
->scope = "Smarty root"
assigned config file variables (outer template scope)


Ten post edytował Ruch Radzionków 14.09.2012, 10:48:52
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 6)
nospor
post
Post #2





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




Moze najzwyklej w swiecie o ten warunek:
if(is_file('page/'.$str.'.php'))
nie jest spelniony i zawsze wyswietlasz stronę news....
Go to the top of the page
+Quote Post
Ruch Radzionków
post
Post #3





Grupa: Zarejestrowani
Postów: 311
Pomógł: 25
Dołączył: 29.08.2011

Ostrzeżenie: (0%)
-----


użyłem file_exists i jest tak samo. w php jeszcze dodałem echo "1" 2 i 3 które pokazuje mi co jest wybrane i z strony php pokazuje dobrze tylko że strona się nie zmienia
Go to the top of the page
+Quote Post
nospor
post
Post #4





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




W kodzie widzę tylko ECHO dla news. Nigdzie nie widzę byś miał echo w IF który ci pokazałem.
Go to the top of the page
+Quote Post
Ruch Radzionków
post
Post #5





Grupa: Zarejestrowani
Postów: 311
Pomógł: 25
Dołączył: 29.08.2011

Ostrzeżenie: (0%)
-----


dodałem w:
  1. if(is_file('page/'.$str.'.php'))
  2. {
  3. echo'3';
  4. include('page/'.$str.'.php');
  5. $stronadocelowa = SZABLON_PELNA_SCIEZKA . ''.$str.'.tpl';
  6. $smarty->assign("stronadocelowa", SZABLON_PELNA_SCIEZKA . ''.$str.'.tpl');
  7. }
Go to the top of the page
+Quote Post
nospor
post
Post #6





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




To jesszcze dla pewności zapytam: wyświetla ci sie to 3?

Bo z debugu jaki pokazałeś widać jak wół:
$stronadocelowa Smarty_Variable Object (3)
->value = "theme/mit2/news.tpl"
że ciągle masz wartość news ustawioną (IMG:style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post
Ruch Radzionków
post
Post #7





Grupa: Zarejestrowani
Postów: 311
Pomógł: 25
Dołączył: 29.08.2011

Ostrzeżenie: (0%)
-----


pokazuje mi 3
i teraz pokazuje:

Kod
$SCRIPT_NAME    Smarty_Variable Object (3)
->value = "/skill/panelsmarty/index.php"
->nocache = false
->scope = "Global"
$sesja    Smarty_Variable Object (3)
->value = "zle"
->nocache = false
->scope = "Smarty root"
$stronadocelowa    Smarty_Variable Object (3)
->value = "theme/mit2/login.tpl"
->nocache = false
->scope = "Smarty root"
$title    Smarty_Variable Object (3)
->value = "strona by mit2"
->nocache = false
->scope = "Smarty root"
$zliczhelp    Smarty_Variable Object (3)
->value = 0
->nocache = false
->scope = "Smarty root"


Ten post edytował Ruch Radzionków 14.09.2012, 14:33:19
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 18:10