Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Smarty not working On local server

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Installation and Setup
View previous topic :: View next topic  
Author Message
hamad2
Smarty Rookie


Joined: 31 Jul 2012
Posts: 6

PostPosted: Fri Jun 21, 2013 4:39 pm    Post subject: Smarty not working On local server Reply with quote

Hi
I am still having trouble letting smarty working on wamp Server..
Code:
Undefined variable: GENERAL in C:\wamp\www\webcar\classlibrary\publicconfigsmarty.php on line 3


I don't have any problem when uploading my file on live server.
I am getting error on publicconfigsmarty.php file

Here is my publicconfigsmarty.php

Code:

<?php
require_once("configuration.php");
require_once($GENERAL['PHYSICAL_PATH_CLASSLIB']."/db.php");
require_once($GENERAL['PHYSICAL_PATH_CLASSLIB']."/paging.php");
require_once($GENERAL['PHYSICAL_PATH_CLASSLIB']."/frontpaging.php");
require(PHYSICAL_SMARTY_DIR . 'Smarty.class.php');
?>


and configuration.php

Code:

<?
session_start();
error_reporting(E_ALL);
///define application URL
define('SITE_URL', "http://".$_SERVER['SERVER_NAME']."/webcar");



// define our application directory
$fullpath2 = strtolower(__FILE__);
$fullpath2 = str_replace("\\", "/", $fullpath2);                  
$rootpath = substr($fullpath2, 0, strpos($fullpath2, "/classlibrary", 1));
$rootpath= str_replace("\\", "/", $rootpath);         
         

define('EDITOR_URL', '/webcar/uploads/');
define('EDITOR_PATH',$rootpath.'/uploads/');

define('PHYSICAL_PATH', $rootpath);
define('PHYSICAL_SITE_DIR', $rootpath.'/smarty/');

// define smarty lib directory
define('PHYSICAL_SMARTY_DIR', $rootpath.'/smarty/libs/');

define('PAGINGCSS', 'th');
define('PAGESIZE', '20');
define('PAGESIZEFRONT','10');
define('PUBLICPAGESIZE', '5');

define('HOST', 'localhost');
define('USERNAME', 'root');
define('PASSWORD', '');
define('DATABASE', 'webcar');

global $GENERAL;
$GENERAL = array();

///////// front end paths///////////////
$GENERAL['BASE_DIR_ROOT'] = $rootpath;
$GENERAL['BASE_URL_ROOT'] = SITE_URL;

$GENERAL['FRONT_BASE_DIR_TPL'] = $GENERAL['BASE_DIR_ROOT'].'/templates';
$GENERAL['FRONT_IMG_DIR'] = $GENERAL['BASE_DIR_ROOT'].'/images';
$GENERAL['FRONT_IMG_URL'] = $GENERAL['BASE_URL_ROOT'].'/images';
$GENERAL['FRONT_UPLOAD_URL'] = $GENERAL['BASE_URL_ROOT'].'/uploads';
$GENERAL['FRONT_DIR_LIB'] = $GENERAL['BASE_DIR_ROOT'].'/libs';
/////////////// admin side paths //////////////
$GENERAL['BASE_DIR_ADMIN'] = $rootpath.'/admin';
$GENERAL['BASE_URL_ADMIN'] = SITE_URL.'/admin';

$GENERAL['BASE_DIR_ADMIN_TPL'] = $GENERAL['BASE_DIR_ADMIN'].'/templates';
$GENERAL['ADMIN_IMG_DIR'] = $GENERAL['BASE_DIR_ADMIN'].'/images';
$GENERAL['ADMIN_IMG_URL'] = $GENERAL['BASE_URL_ADMIN'].'/images';
$GENERAL['ADMIN_DIR_LIB'] = $GENERAL['BASE_DIR_ADMIN'].'/libs';

///////////////end admin side paths //////////////
$GENERAL['PHYSICAL_PATH_CLASSLIB'] = $GENERAL['BASE_DIR_ROOT'].'/classlibrary';

if(get_magic_quotes_gpc()){
   quoteOff($_POST);
   quoteOff($_REQUEST);
   quoteOff($_GET);
}

function quoteOff(&$arr){
   foreach($arr as $key=>$value){
      if(is_array($value)){
         $temArry = '';
         foreach($value as $subkey=>$subval){
            $temArry[$subkey] = stripslashes($subval);
         }
         $arr[$key] =  $temArry;
      }else{
         $arr[$key] =  stripslashes($value);
      }
   }
}

function loadServiceByCategory($category_id)
{
   $tblservices = "tblservices";
   $data=null;
   $_query = "select *  from ".$tblservices." where category_id=".$category_id." order by sort_index limit 1";
   $rs=mysql_query($_query);

   if($rs!=false)
   {
      $fetch = mysql_fetch_array($rs);
      $fetch['title'] = urlencode($fetch['title']);
      $data = $fetch;      
   }         
   
   return $data;
}
?>
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Sat Jun 22, 2013 10:34 am    Post subject: Reply with quote

To me it looks like that configuration.php is not executed.

However this problem is not Smarty related as your configuration files not part of the Smarty package.
Back to top
View user's profile Send private message
hamad2
Smarty Rookie


Joined: 31 Jul 2012
Posts: 6

PostPosted: Tue Jun 25, 2013 12:43 am    Post subject: Reply with quote

Hi Tews
Thank you I will take another look to configuraiton.php

Regards
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Installation and Setup All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP