Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [HTML][PHP] Kopia strony, + odpalanie jej z podfolderu na sewerze
Propi
post 11.07.2011, 09:10:55
Post #1





Grupa: Zarejestrowani
Postów: 2
Pomógł: 0
Dołączył: 11.07.2011

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


Witam wszystkich!
Mam nadzieję, że pytanie uda mi się sformułować w miarę składnie...

Otóż mam swoją stronę, www.pikwadrat.pl, wykonaną dla mnie przez znajomego. Chciałbym odpalić drugą jej wersję jako mój prywatny site z fotografią koncertową i muzyczną itp. Planuję zatem skopiować tę stronę, pozmieniać oczywiście kolorystykę i treść, a następnie umieścić ją na obecnym serwerze, w osobnym podfolderze. Wykupiłem już domenę i jestem chyba gotów do przenosin.

Problemy pojawiają się dwa. Zgrana z serwera kopia strony nie odpala mi się ni cholery na komputerze - firefox zdaje się jej nie widzieć - ani z podfolderu na serwerze (o czym poniżej). Czy brakuje mi jakiegoś komponentu do poprawnego wyświetlania plików .php5? Czym to najlepeij ugryźć

Druga rzecz - czy mogę odpalić stronę z podfolderu, np. www.pikwadrat.nazwa.pl/pw/, podpinając ten folder pod wykupioną domenę, czy może strona musi znajdować się w katalogu głównym serwera? Póki co, wrzucam idealną kopię całej strony do podkatalogu na serwerze i niestety, nic się nie uruchami. Adres to http://pikwadrat.pl/pw/, możecie sami sprawdzić smile.gif

Czy da się rzecz ogarnąć zgodnie z moim marzeniem, czy niezbędny będzie osobny serwer lub zbudowanie strony od podstaw?

Z góry wielkie dzięki za pomoc!
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Propi
post 18.07.2011, 17:45:26
Post #2





Grupa: Zarejestrowani
Postów: 2
Pomógł: 0
Dołączył: 11.07.2011

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


Opera operą, tym zajmiemy się później smile.gif

Stworzyłem dokładną kopię wszystkich plików z roota www.pikwadrat.pl i umieściłem w www.pikwadrat.pl/pw/.
Index znajduje się tu: http://pikwadrat.pl/pw/index.php5.
Babka z nazwa.pl mówi, że serwer wyświetla pliki, ale występują błędy w kodzie. Możecie rzucić okiem, co jest nie tak?

Zawartość indexu:

  1. <?php
  2. require_once('libs/smarty/Smarty.class.php');
  3.  
  4. $smarty = new Smarty;
  5.  
  6. $smarty->template_dir = 'templates/';
  7. $smarty->compile_dir = 'var/templates/';
  8. $smarty->config_dir = 'core/';
  9. $smarty->cache_dir = 'var/cache/';
  10. $smarty->debugging = false;
  11.  
  12. $params = $_REQUEST;
  13. $content = $params['content'];
  14.  
  15. $boolGallery = false;
  16.  
  17. // sprawdza, czy to IE 6.0
  18. $strBrowser = $_SERVER['HTTP_USER_AGENT'];
  19. $boolIE6 = strpos($strBrowser, 'MSIE 6.0');
  20. $boolIE6 = $boolIE6 ? true : false;
  21.  
  22. //wysokosc strony
  23. $smarty->config_load( 'config.conf' );
  24. $intPageHeight = $smarty->_config[0]['vars']['pageHeight'];
  25.  
  26. //$intWidthBonus = 36;
  27. $intHeightBonus = 23;
  28. $intIEHeightBonus = 4;
  29.  
  30. $intPageHeight = $boolIE6 ? ( $intPageHeight + $intIEHeightBonus ) : ( $intPageHeight + $intHeightBonus );
  31. $smarty->assign( 'MaxHeight', $intPageHeight );
  32.  
  33. // konfiguracja glownego menu
  34. $smarty->config_load( 'config.conf', 'TopMenu' );
  35. $smarty->config_load( 'config.conf', 'TopMenuHref' );
  36. $smarty->config_load( 'config.conf', 'TopMenuGalleries' );
  37.  
  38. $arrConfig = &$smarty->_config[0]['vars'];
  39. $arrTopMenu = array();
  40. $intCounter = 0;
  41. foreach ($arrConfig as $strKey => $strItem) {
  42. $intEnd = strpos($strKey, '_href' );
  43. if ( $intEnd !== false ) {
  44. $strName = substr( $strKey, 0, $intEnd);
  45. if ( substr($strItem, 0, 4) == 'http' ) {
  46. $strHref = $strItem;
  47. $arrTopMenu[ $intCounter ]['name'] = $arrConfig[ $strName ];
  48. $arrTopMenu[ $intCounter ]['href'] = $strHref;
  49. $arrTopMenu[ $intCounter ]['outerLink'] = true;
  50. $intCounter++;
  51. } else {
  52. if (!file_exists( "$smarty->template_dir/topmenu/$strItem" ) ) {
  53. unset($arrConfig[ $strName ] );
  54. } else {
  55. $strHref = 'topmenu/'.$strItem;
  56. $arrTopMenu[ $intCounter ]['name'] = $arrConfig[ $strName ];
  57. $arrTopMenu[ $intCounter ]['href'] = $strHref;
  58. $arrTopMenu[ $intCounter ]['gallery'] = $arrConfig[ $strName.'_gallery' ] ? $arrConfig[ $strName.'_gallery' ] : false;
  59. $arrTopMenu[ $intCounter ]['selected'] = ( $params['content'] === $strHref) ? true : false;
  60. $intCounter++;
  61. }
  62. }
  63. }
  64. }
  65.  
  66. //konfiguracja submenu
  67. $arrSubMenu = array();
  68. $strNavigationDisplay = 'none';
  69. foreach ($arrTopMenu as $intKey=>$arrTopMenuItem) {
  70. if ($arrTopMenuItem['gallery'] === true) { //&& $arrTopMenuItem['selected'] === true
  71. if ($arrTopMenuItem['selected'] === true) $strNavigationDisplay = 'block';
  72. $boolGallery = true;
  73. $strSubMenu = $arrTopMenuItem['name'];
  74. $smarty->config_load( 'config.conf', $strSubMenu.'Items' );
  75. $arrConfig = &$smarty->_config[0]['vars'];
  76. $arrSubMenu = array();
  77. $intCounter = 1;
  78. foreach ($arrConfig as $strKey => $strSubMenuItem) {
  79. if ( strpos( $strKey, $strSubMenu.$intCounter ) !== false ) {
  80. $strSubMenuName = $arrConfig[ $strSubMenu.$intCounter ];
  81. $arrSubMenu[ $intCounter ]['name'] = $strSubMenuName;
  82. $arrSubMenu[ $intCounter ]['href'] = $arrTopMenuItem['href'].'&gallery='.$strSubMenuName;
  83. $intCounter++;
  84. }
  85. }
  86. }
  87. }
  88.  
  89. if ( isset( $params['gallery'] ) ) {
  90. require_once( 'core/gallery.class.php5' );
  91. $strGalleryDir = './galleries/'.$params['gallery'];
  92. if ( file_exists($strGalleryDir) ) {
  93. $gallery = new Gallery($strGalleryDir);
  94. $arrImages = array();
  95. $arrImages = $gallery->getShuffledImages();
  96. //zmienne Smarty'ow
  97. if ( $gallery->getWidth() > 0 ) $smarty->assign( 'MaxWidth', $gallery->getWidth() );
  98. $smarty->assign( 'images', $arrImages);
  99. $content = 'gallery.html';
  100. }
  101. }
  102.  
  103. if ( !empty($content) && file_exists("$smarty->template_dir/$content") ) {
  104. $content = $smarty->fetch( $content );
  105. } elseif ( empty($content) ) {
  106. $content = $smarty->fetch( 'start.html' );
  107. } else {
  108. $content = '<p>Strona nie istnieje.</p>';
  109. }
  110.  
  111. $smarty->assign( 'boolIE6', $boolIE6 );
  112. $smarty->assign( 'boolGallery', $boolGallery );
  113. $smarty->assign( 'topMenu', $arrTopMenu );
  114. $smarty->assign( 'subMenu', $arrSubMenu );
  115. $smarty->assign( 'NavigationDisplay', $strNavigationDisplay );
  116. $smarty->assign( 'CONTENT', $content );
  117.  
  118.  
  119. $smarty->display( 'index.html' );
  120. ?>


Widzicie, co tutaj nie gra?

Ok, doszedłem do tego:


Warning: require_once(libs/smarty/Smarty.class.php) [function.require-once]: failed to open stream: Nie ma takiego pliku ani katalogu in /home/pikwadrat/ftp/pw/index.php5 on line 4

Fatal error: require_once() [function.require]: Failed opening required 'libs/smarty/Smarty.class.php' (include_path='.:/usr/share/pear/') in /home/pikwadrat/ftp/pw/index.php5 on line 4

A plik jest gdzie miał być. Co zrobić?
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 20:06