After I am done installing this script I get this error:

????????????????????????? ???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????x???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????‡??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????Ç??????????????????????????????????????????
Warning: require_once(ROOT_PATH/modules/system/models/system.class.php) [function.require-once]: failed to open stream: No such file or directory in /home/name/public_html/index.php on line 17

Fatal error: require_once() [function.require]: Failed opening required 'ROOT_PATH/modules/system/models/system.class.php' (include_path='.:/usr/lib/php') in /home/mane/public_html/index.php on line 17

Here is the files requested above:

INDEX.PHP

<?php
#CHECK FOR INSTALL
if(!file_exists($_SERVER['DOCUMENT_ROOT'].'/data/uploads/language/config.php')) {
	header('Location: /install/index.php');
	die();
}

require_once 'config.php';
	require_once $config ['root_path'] . '/base/functions.php';
	
	include_once $config ['engine_path'] . "/initEngine.php";
	
//
// HERE YOU CAN PUT YOUR SOURCE
//

require_once ROOT_PATH.'/modules/system/models/system.class.php';
$systemClass = new system();
	
$currency = $systemClass->getActiveCurrency();
abr('currency', $currency);

###################################
# META DATA
###################################
$meta = $systemClass->getAllKeyValue();
$smarty->assign('title', $meta['meta_title']);
$smarty->assign('meta_keywords', $meta['meta_keywords']);
$smarty->assign('meta_description', $meta['meta_description']);

$config['paypal']['business'] = $meta['paypal_email'];
	

if($_GET['module'] != 'admin') {
	
#SUBSCRIBE TO NEWSLETTER	
	if(isset($_POST['subscribe'])) {
		require_once ROOT_PATH.'/modules/bulletin/models/bulletin.class.php';
		$bulletinClass = new bulletin();				
		
		$s = $bulletinClass->addBulletinEmail();
		if($s === true) {
			refresh('', $langArray['complete_add_to_newsletter'], 'complete');
		}
		elseif($s == 'already') {
			refresh('', $langArray['already_in_newsletter'], 'info');
		}
		else {
			refresh('', $langArray['error_newsletter'], 'error');
		}
	}
	
#SAVE REFERAL USERNAME	
	if(isset($_GET['ref'])) {
		$_SESSION['temp']['referal'] = $_GET['ref'];
	}
	
#LOAD PAGES IN MENU
	require_once ROOT_PATH.'/modules/pages/models/pages.class.php';
	$pagesClass = new pages();
	
	$menuPages = $pagesClass->getAll(0, 0, " `visible` = 'true' AND `menu` = 'true' ", true);
	abr('menuPages', $menuPages);
	
#LOAD MAIN CATEGORIES
	require_once ROOT_PATH.'/modules/categories/models/categories.class.php';
	$categoriesClass = new categories();

	$mainCategories = $categoriesClass->getAll(0, 0, " `visible` = 'true' AND `sub_of` = '0' ");
	abr('mainCategories', $mainCategories);
	
#LOAD COUTNERS
	require_once ROOT_PATH.'/modules/items/models/items.class.php';
	$itemsClass = new items();

	abr('itemsCount', $itemsClass->getItemsCount());	

	require_once ROOT_PATH.'/modules/users/models/users.class.php';
	$usersClass = new users();
	
	abr('usersCount', $usersClass->getUsersCount(" `status` = 'activate' "));

	
#UPDATE USER AMOUNT
	if(check_login_bool()) {
		$_SESSION['user'] = $usersClass->get($_SESSION['user']['user_id']);
	}
	
}


	include_once $config ['engine_path'] . "/endEngine.php";
	
?>

System.Class.php

<?php
class system extends base {
	
	function __construct() {
	
	}

	
	/*
	 * GET FUNCTIONS
	 */
	public function getAllKeyValue() {
		global $mysql;
		
		$mysql->query("
			SELECT *
			FROM `system`
			ORDER BY `id` ASC
		", __FUNCTION__ );
		
		if($mysql->num_rows() == 0) {
			return false;
		}
		
		$return = array();
		while($d = $mysql->fetch_array()) {
			$return[$d['key']] = $d['value'];
		}
		
		return $return;
	}
	
	public function getAll($start=0, $limit=0) {
		global $mysql;
		
		$limitQuery = "";
		if($limit!=0) {
			$limitQuery = "LIMIT $start,$limit";
		}
		
		$return = $mysql->getAll("
			SELECT SQL_CALC_FOUND_ROWS *
			FROM `system`
			ORDER BY `id` ASC
			$limitQuery
		");
			
		$this->foundRows = $mysql->getFoundRows();
		
		return $return;
	}
	
	public function get($id) {
		global $mysql;
		
		$return = $mysql->getRow("
			SELECT *
			FROM `system`
			WHERE `id` = '".intval($id)."'
		");
		
		return $return;
	}
	
	
	/*
	 * ADD
	 */
	public function add() {
		global $mysql, $langArray;

		if(!isset($_POST['key']) || strlen(trim($_POST['key'])) < 1) {
			$error['key'] = $langArray['error_fill_this_field'];
		}
		
		if(!isset($_POST['value']) || strlen(trim($_POST['value'])) < 1) {
			$error['value'] = $langArray['error_fill_this_field'];
		}
		
		if(isset($error)) {
			return $error;
		}
		
		$mysql->query("
			INSERT INTO `system` (
				`key`,
				`value`
			)
			VALUES (
				'".sql_quote($_POST['key'])."',
				'".sql_quote($_POST['value'])."'
			)
		", __FUNCTION__ );
		
		return true;
	}
	
	
	/*
	 * EDIT
	 */
	public function edit($id) {
		global $mysql, $langArray;

		if(!isset($_POST['key']) || strlen(trim($_POST['key'])) < 1) {
			$error['key'] = $langArray['error_fill_this_field'];
		}
		
		if(!isset($_POST['value']) || strlen(trim($_POST['value'])) < 1) {
			$error['value'] = $langArray['error_fill_this_field'];
		}
		
		if(isset($error)) {
			return $error;
		}
				
		$mysql->query("
			UPDATE `system` 
			SET `key` = '".sql_quote($_POST['key'])."',
					`value` = '".sql_quote($_POST['value'])."'
			WHERE `id` = '".intval($id)."'
		", __FUNCTION__ );
		
		return true;
	}
	
	/*
	 * DELETE
	 */
	public function delete($id) {
		global $mysql;

		if($id < 10) {
			return false;
		}
		
		$mysql->query("
			DELETE FROM `system`
			WHERE `id` = '".intval($id)."'
			LIMIT 1
		", __FUNCTION__ );
		
		return true;
	}
	
	
	
/* CURRENCY */	
	
	public function getCurrency() {
		global $mysql;
		
		$mysql->query("
			SELECT *
			FROM `currency`
			ORDER BY `name` ASC
		");
		
		if($mysql->num_rows() == 0) {
			return false;
		}
		
		$return = array();
		while($d = $mysql->fetch_array()) {
			$return[] = $d;
		}
		
		return $return;
	}
	
	public function getActiveCurrency() {
		global $mysql;
		
		$mysql->query("
			SELECT *
			FROM `currency`
			WHERE `active` = 'yes'
		");
		
		if($mysql->num_rows() == 0) {
			return false;
		}
		
		return $mysql->fetch_array();
	}
	
	public function saveCurrency() {
		global $mysql;
		
		if(!isset($_POST['code'])) {
			$_POST['code'] = '';
		}
		
		$mysql->query("
			UPDATE `currency`
			SET `active` = 'no'
		");
		
		$mysql->query("
			UPDATE `currency`
			SET `active` = 'yes'
			WHERE `code` = '".sql_quote($_POST['code'])."'
		");
		
		return true;
	}
	

}
?>

CONFIG.PHP

<?php

include_once $_SERVER['DOCUMENT_ROOT'].'/data/uploads/language/config.php';

$config = array (

	//e7Studio Engine Setup
	'engine_path' => $configArr['engine_path'],  //path to engine		

	
	//Site Setup
	'root_path' => $configArr['root_path'],  //path
	'domain' => $configArr['domain'],  //domain bez http || www
	'site_title' => 'Webmedia client website',  //set to html default title
	'use_language' => false,
	'default_language' => 'en',
	'langs' => array('en'),
	

	//Debug Setup	
	'debug' => false,  //dali da pokazva debug?
	'debug_ips' => array (
		'80.80.149.234',  //deyan belashtica
		'78.130.227.163',  //deyan pld
		'78.130.225.209' //deyan maxtelecom 
	), 
	

	//MySQL Setup
	'mysql_host' => 'localhost', 
	'mysql_user' => $configArr['mysql_user'], 
	'mysql_pass' => $configArr['mysql_pass'], 
	'mysql_db' => $configArr['mysql_db'], 

	//Upload Files Setup
	'max_audio_size' => 1024 * 1024 * 500,  //500 MB
	'audio_ext' => array (
		'mp3' 
	), 

	'max_video_size' => 1024 * 1024 * 500,  //500 MB
	'video_ext' => array (
		'flv' 
	), 

	'max_file_size' => 1024 * 1024 * 10,  //10 MB
	'file_ext' => array (
		'pdf',
		'xls',
		'xlsx',
		'doc',
		'docx',
		'txt',
		'rtf',
		'png',
		'jpg' 
	),

	'max_upload_size' => 1024 * 1024 * 500,  //500 MB
	'upload_ext' => array(
		'jpg',
		'png',
		'zip'
	),
	
	'max_photo_size' => 1024 * 1024 * 10,  //10 MB
	'photo_ext' => array (
		'jpg', 
		'gif', 
		'png' 
	), 

	'photo_sizes' => array (
		'A' => '50x50' 
	),
	
	'avatar_photo_sizes' => array (
		'A' => '80x80' 
	),
	
	'homeimage_photo_sizes' => array (
		'A' => '590x242' 
	),
	
	
);

//Data Server Configuration
$config['data_server_path'] = $config['root_path'].'data/';

if(substr($_SERVER['SERVER_NAME'], 0, 4) == 'www.') {
	$config['data_server'] = 'http://www.'.$config['domain'].'/data/';
}
else {
	$config['data_server'] = 'http://'.$config['domain'].'/data/';
}

//FCKEditor Setup
$config ['fckfiles_short'] = '/data/uploads/fck/';
$config ['fckfiles'] = $config ['data_server_path'] . '/uploads/fck/';

$config['recaptcha_public_key'] = '6Le7n7wSAAAAAHth1qfwrobV6zV29O4NQbY67vJF';
$config['recaptcha_private_key'] = '6Le7n7wSAAAAAEQ-Ljdys7exRAj7EQA5NGYSbH02';

//PayPal Settings
$config['paypal'] = array(
	'url' => 'https://www.paypal.com/cgi-bin/webscr', //url na koeto da prashta formata
	'business' => 'demo@demo.com', //Your PayPal ID or an email address associated with your PayPal account. Email addresses must be confirmed. 
	'currency' => 'USD' //valuta v koqto e cenata EUR, USD etc.
);

//Emoticons
$config['emoticons'] = array(
	':D' => 'emoticon_grin.png',
	':O' => 'emoticon_surprised.png',
	']:)' => 'emoticon_evilgrin.png',
	':))' => 'emoticon_happy.png',
	':P' => 'emoticon_tongue.png',
	':(' => 'emoticon_unhappy.png',
	';)' => 'emoticon_wink.png',
	':)' => 'emoticon_smile.png',
);

?>

check your system.class.php file saved in correct path...

Check where is ROOT_PATH defined and what is its value?

Check where is ROOT_PATH defined and what is its value?

I have no clue TBH

echo out your document root

echo $_SERVER['DOCUMENT_ROOT'];

and check whether the root_path is correct.

echo out your document root

echo $_SERVER['DOCUMENT_ROOT'];

and check whether the root_path is correct.

On the index? and I have no clue what the root path is or where

On the index? and I have no clue what the root path is or where

Yes in index only..

echo $_SERVER['DOCUMENT_ROOT']

this will print your root_path

karhik pranas..i also have same problems ti install this script, i have fatal error when use your echo $_SERVER..IN (index.php)..appear.
Warning: require_once(ROOT_PATH/modules/system/models/system.class.php) [function.require-once]: failed to open stream: No such file or directory in /home/idiricom/public_html/index.php on line 18

Fatal error: require_once() [function.require]: Failed opening required 'ROOT_PATH/modules/system/models/system.class.php' (include_path='.:/usr/lib/php') in /home/idiricom/public_html/index.php on line 18

Member Avatar for diafol

Seems that ROOT_PATH isn't defined in config.php.

define("CONST_NAME","the value");

is the usual method to define constants.

FOR NOW, just to see if it works:

define("ROOT_PATH",$_SERVER['DOCUMENT_ROOT']);

At start of config.php

You'd never actually do this in the wild, but just to see if it does anything :)

ok..i will try, but where can i put

define("CONST_NAME","the value");

you mean in index.php or config.php ?

INDEX.PHP

<?php
#CHECK FOR INSTALL
if(!file_exists($_SERVER['DOCUMENT_ROOT'].'/data/uploads/language/config.php')) {
	header('Location: /install/index.php');
	die();
}

require_once 'config.php';
	require_once $config ['root_path'] . '/base/functions.php';
	
	include_once $config ['engine_path'] . "/initEngine.php";
	
//
// HERE YOU CAN PUT YOUR SOURCE
//
// require_once(dirname(__FILE__).'/modules/system/models/system.class.php'); 

define("CONST_NAME","the value");
define("ROOT_PATH",$_SERVER['DOCUMENT_ROOT']);
  
require_once ROOT_PATH.'/modules/system/models/system.class.php';
$systemClass = new system();

	
$currency = $systemClass->getActiveCurrency();
abr('currency', $currency);

###################################
# META DATA
###################################
$meta = $systemClass->getAllKeyValue();
$smarty->assign('title', $meta['meta_title']);
$smarty->assign('meta_keywords', $meta['meta_keywords']);
$smarty->assign('meta_description', $meta['meta_description']);

$config['paypal']['business'] = $meta['paypal_email'];
	

if($_GET['module'] != 'admin') {
	
#SUBSCRIBE TO NEWSLETTER	
	if(isset($_POST['subscribe'])) {
		require_once ROOT_PATH.'/modules/bulletin/models/bulletin.class.php';
		$bulletinClass = new bulletin();				
		
		$s = $bulletinClass->addBulletinEmail();
		if($s === true) {
			refresh('', $langArray['complete_add_to_newsletter'], 'complete');
		}
		elseif($s == 'already') {
			refresh('', $langArray['already_in_newsletter'], 'info');
		}
		else {
			refresh('', $langArray['error_newsletter'], 'error');
		}
	}
	
#SAVE REFERAL USERNAME	
	if(isset($_GET['ref'])) {
		$_SESSION['temp']['referal'] = $_GET['ref'];
	}
	
#LOAD PAGES IN MENU
	require_once ROOT_PATH.'/modules/pages/models/pages.class.php';
	$pagesClass = new pages();
	
	$menuPages = $pagesClass->getAll(0, 0, " `visible` = 'true' AND `menu` = 'true' ", true);
	abr('menuPages', $menuPages);
	
#LOAD MAIN CATEGORIES
	require_once ROOT_PATH.'/modules/categories/models/categories.class.php';
	$categoriesClass = new categories();

	$mainCategories = $categoriesClass->getAll(0, 0, " `visible` = 'true' AND `sub_of` = '0' ");
	abr('mainCategories', $mainCategories);
	
#LOAD COUTNERS
	require_once ROOT_PATH.'/modules/items/models/items.class.php';
	$itemsClass = new items();

	abr('itemsCount', $itemsClass->getItemsCount());	

	require_once ROOT_PATH.'/modules/users/models/users.class.php';
	$usersClass = new users();
	
	abr('usersCount', $usersClass->getUsersCount(" `status` = 'activate' "));

	
#UPDATE USER AMOUNT
	if(check_login_bool()) {
		$_SESSION['user'] = $usersClass->get($_SESSION['user']['user_id']);
	}
	
}


	include_once $config ['engine_path'] . "/endEngine.php";
	
?>

i have found error..when i use your code..

Fatal error: Class 'base' not found in /home/idiricom/public_html/modules/system/models/system.class.php on line 2

can you check this..

Member Avatar for diafol

It refers to this line:

class system extends base {

Have you inlcuded the file with the base class? prob. called Base.Class.php

Judging from the files, the ROOT_PATH would be set in data/uploads/language/config.php.
And not the other config file, though it is set there, the value is in the previous config file.

Edit: Forgive me I didn't notice there was a page two when replying.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.