Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Problem z nice URLs
di_kamilo
post
Post #1





Grupa: Zarejestrowani
Postów: 16
Pomógł: 0
Dołączył: 8.01.2006
Skąd: Nowa Sól

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


Mam problem z nice URLs, wykorzystałem funkcje z tego forum, wszystko pięknie gra...

Przykładowy link jest taki:

http://localhost/news/1

news - plik news.php
1 - id
itp.

I teraz jest problem bo jak przepuszczę tpl przez pasera szablonów to zmieniają
się linki do obrazków itp.

Link wygląda tak:

http:/localhost/news/templates/images/image.gif

a powinien wyglądać tak

http:/localhost/templates/images/image.gif


Wie ktoś może jak to naprawić aby paser nie pobierał tego /news/ z adresu (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif)
Wykorzystuję Smaty Templates. Siedze już nad tym pare godzin i nie mogę nic wymyślić...

  1. <?php
  2.  
  3. require('config.php');
  4. require(LIB_DIR . 'smarty/Smarty.class.php');
  5. require(LIB_DIR . 'nice_urls.class.php');
  6.  
  7. $url =& nice_Urls::getinstance ( ); 
  8. $module = $url -> give_option();
  9.  
  10. $template = new Smarty;
  11.  
  12. if (!empty($module[0]))
  13. {
  14. $module_file = MODULES_DIR.'/'.$module[0].'.module.php';
  15.  
  16. if (file_exists($module_file))
  17. {
  18. require($module_file);
  19. }
  20. else
  21. {
  22. $template -> assign('page_title', 'System ERROR !');
  23. $template -> assign('error', '<b>System ERROR</b><br /><br />Nieprawidłowy parametr lub brak potrzebnych plików !');
  24. $template -> display('error.tpl');
  25. }
  26. }
  27. else
  28. {
  29. $template -> assign('page_title', SYSTEM_NAME . ' :: Strona Główna');
  30. $template -> display('index.tpl');
  31.  
  32. }
  33. ?>


Ten post edytował di_kamilo 13.01.2006, 19:41:57
Go to the top of the page
+Quote Post

Posty w temacie


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: 23.08.2025 - 21:20