A copy of my site doesn't work

Hello and welcome all :slight_smile:
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.

OK, I reached the root of the problem:

[php]Warning: require_once(libs/smarty/Smarty.class.php) [function.require-once]: failed to open stream: No such file or catalogue 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[/php]

Whats my next step?

Sponsor our Newsletter | Privacy Policy | Terms of Service