Hello and welcome all 
Recently I started to work on a new website. I want it to run from a server I bought for my first site. I also want the two sites to look very alike - same layout, different colours and content.
So I copied all the files from my servers root directory and put them in a subfolder, www.pikwadrat.pl/pw/ (with /pw/ containing the copy of my site). The problem is that the site wonât work - and frankly, Iâm out of options here. Since itâs an exact copy - nothing has been changed - the site should work properly. Yet, it doesnât. So my question is - whatâs wrong with the code? I looked at it and see no connection to the root directory. Here is the full code of index.php5:
[php]<?php
require_once(âlibs/smarty/Smarty.class.phpâ);
$smarty = new Smarty;
$smarty->template_dir = âtemplates/â;
$smarty->compile_dir = âvar/templates/â;
$smarty->config_dir = âcore/â;
$smarty->cache_dir = âvar/cache/â;
$smarty->debugging = false;
$params = $_REQUEST;
$content = $params[âcontentâ];
$boolGallery = false;
// sprawdza, czy to IE 6.0
$strBrowser = $_SERVER[âHTTP_USER_AGENTâ];
$boolIE6 = strpos($strBrowser, âMSIE 6.0â);
$boolIE6 = $boolIE6 ? true : false;
//wysokosc strony
$smarty->config_load( âconfig.confâ );
$intPageHeight = $smarty->_config[0][âvarsâ][âpageHeightâ];
//$intWidthBonus = 36;
$intHeightBonus = 23;
$intIEHeightBonus = 4;
$intPageHeight = $boolIE6 ? ( $intPageHeight + $intIEHeightBonus ) : ( $intPageHeight + $intHeightBonus );
$smarty->assign( âMaxHeightâ, $intPageHeight );
// konfiguracja glownego menu
$smarty->config_load( âconfig.confâ, âTopMenuâ );
$smarty->config_load( âconfig.confâ, âTopMenuHrefâ );
$smarty->config_load( âconfig.confâ, âTopMenuGalleriesâ );
$arrConfig = &$smarty->_config[0][âvarsâ];
$arrTopMenu = array();
$intCounter = 0;
foreach ($arrConfig as $strKey => $strItem) {
$intEnd = strpos($strKey, â_hrefâ );
if ( $intEnd !== false ) {
$strName = substr( $strKey, 0, $intEnd);
if ( substr($strItem, 0, 4) == âhttpâ ) {
$strHref = $strItem;
$arrTopMenu[ $intCounter ][ânameâ] = $arrConfig[ $strName ];
$arrTopMenu[ $intCounter ][âhrefâ] = $strHref;
$arrTopMenu[ $intCounter ][âouterLinkâ] = true;
$intCounter++;
} else {
if (!file_exists( â$smarty->template_dir/topmenu/$strItemâ ) ) {
unset($arrConfig[ $strName ] );
} else {
$strHref = âtopmenu/â.$strItem;
$arrTopMenu[ $intCounter ][ânameâ] = $arrConfig[ $strName ];
$arrTopMenu[ $intCounter ][âhrefâ] = $strHref;
$arrTopMenu[ $intCounter ][âgalleryâ] = $arrConfig[ $strName.â_galleryâ ] ? $arrConfig[ $strName.â_galleryâ ] : false;
$arrTopMenu[ $intCounter ][âselectedâ] = ( $params[âcontentâ] === $strHref) ? true : false;
$intCounter++;
}
}
}
}
//konfiguracja submenu
$arrSubMenu = array();
$strNavigationDisplay = ânoneâ;
foreach ($arrTopMenu as $intKey=>$arrTopMenuItem) {
if ($arrTopMenuItem[âgalleryâ] === true) { //&& $arrTopMenuItem[âselectedâ] === true
if ($arrTopMenuItem[âselectedâ] === true) $strNavigationDisplay = âblockâ;
$boolGallery = true;
$strSubMenu = $arrTopMenuItem[ânameâ];
$smarty->config_load( âconfig.confâ, $strSubMenu.âItemsâ );
$arrConfig = &$smarty->_config[0][âvarsâ];
$arrSubMenu = array();
$intCounter = 1;
foreach ($arrConfig as $strKey => $strSubMenuItem) {
if ( strpos( $strKey, $strSubMenu.$intCounter ) !== false ) {
$strSubMenuName = $arrConfig[ $strSubMenu.$intCounter ];
$arrSubMenu[ $intCounter ][ânameâ] = $strSubMenuName;
$arrSubMenu[ $intCounter ][âhrefâ] = $arrTopMenuItem[âhrefâ].â&gallery=â.$strSubMenuName;
$intCounter++;
}
}
}
}
if ( isset( $params[âgalleryâ] ) ) {
require_once( âcore/gallery.class.php5â );
$strGalleryDir = â./galleries/â.$params[âgalleryâ];
if ( file_exists($strGalleryDir) ) {
$gallery = new Gallery($strGalleryDir);
$arrImages = array();
$arrImages = $gallery->getShuffledImages();
//zmienne Smartyâow
if ( $gallery->getWidth() > 0 ) $smarty->assign( âMaxWidthâ, $gallery->getWidth() );
$smarty->assign( âimagesâ, $arrImages);
$content = âgallery.htmlâ;
}
}
if ( !empty($content) && file_exists("$smarty->template_dir/$content") ) {
$content = $smarty->fetch( $content );
} elseif ( empty($content) ) {
$content = $smarty->fetch( âstart.htmlâ );
} else {
$content = â
Strona nie istnieje.
â;}
$smarty->assign( âboolIE6â, $boolIE6 );
$smarty->assign( âboolGalleryâ, $boolGallery );
$smarty->assign( âtopMenuâ, $arrTopMenu );
$smarty->assign( âsubMenuâ, $arrSubMenu );
$smarty->assign( âNavigationDisplayâ, $strNavigationDisplay );
$smarty->assign( âCONTENTâ, $content );
$smarty->display( âindex.htmlâ );
?>
[/php]
Can you please take a look and tell me, what could possibly be wrong? Many, many thanks to you all.