Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Problem with Directory Structure

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 01-22-2003, 01:27 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default Problem with Directory Structure

It looks as though Smarty is setup to only use two directory levels, either ./ or /store for example.

We need to be able to do /store/directory however it doesn't seem to be working.

Back tracking the code in various places this example seems to be the standard for parsing directories:

if ($reg_globals) {
if (is_readable("../globals.php"))
require_once "../globals.php";
elseif (is_readable("./globals.php"))
require_once "./globals.php";
}

If this is the case, i think it's a serious design flaw. Has anybody had any problems with this before, and does anybody have suggestions on the most efficient fix.

I back tracked the problem right into the smarty class writing of the template_c files.

Thanks.
Reply With Quote
  #2  
Old 01-23-2003, 12:35 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

Well this is a mess. I changed my smarty settings in smarty.php to include full path information.


define("SMARTY_DIR","/usr/local/home/site/httpdocs/Smarty-2.1.1/");

#
# Smarty object for processing html templates
#
$smarty = new Smarty;

$smarty->template_dir = "/usr/local/home/site/httpdocs/skin1";
$smarty->compile_dir = "/usr/local/home/site/httpdocs/templates_c";
$smarty->config_dir = "/usr/local/home/site/httpdocs/skin1";
$smarty->cache_dir = "/usr/local/home/site/httpdocs/cache";
$smarty->secure_dir = "/usr/local/home/site/httpdocs/skin1";
$smarty->debug_tpl="file:debug_templates.tpl";


Now I've got file references like:

<a href="javascript:document.loginform.submit()"><fon t class="TableLeftElements">Log out </font>[img]/usr/local/home/site/httpdocs/skin1/images/GObouton.gif[/img]

Reply With Quote
  #3  
Old 01-23-2003, 03:34 PM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

Just move your smarty directory as well as templates_c into your store directory, and use ./ and ../
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #4  
Old 01-23-2003, 05:17 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

I've done EXTENSIVE modifications and am using Smarty for other areas of our website including a VIP lounge and online learning locker, so that the xcart database can be used for other aspects of the site. I also created our index file in smarty so that we can have a login on the main page.

I have:

index file in ./
store in ./store
learning locker in ./locker
assessment tool in ./locker/assessment

and I can't put the assessment in ./locker because eventually we will have too many of them.

What I ended up doing was creating a second smarty.php, changed all the links and setup the templates to reference ../../skin1. I then had the php files in ./locker/assessment reference this second smarty.

The site is LIVE and is located at: https://www.crgleader.com/
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 12:56 AM.

   

 
X-Cart forums © 2001-2020