View Single Post
  #3  
Old 08-14-2006, 11:35 PM
  B00MER's Avatar 
B00MER B00MER is offline
 

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

Default

Quote:
Originally Posted by nevets1219
EDIT: Not being all that familiar with regular expressions. Let's say I moved it into a sub-directory.
From /usr/home/xcart/
To /usr/home/xcart/upgraded/

I should have:
$pattern = "\/xcart";
$replace = "/xcart/upgraded";

Is that assumption correct?

Yes, you are correct. /xcart would become /xcart/upgraded. Of course this will append both leading and trailing content as well.

If your not too familiar with regular expressions:
http://weitz.de/regex-coach/

You also correct in assuming x-cart does a string compare for the full path, within the func_get_thumbnail_url function in include/func.php using $xcart_dir. (4.0.x)

Code:
$cmpfunc = (X_DEF_OS_WINDOWS ? 'strncasecmp' : 'strncmp');
...
Code:
if (X_DEF_OS_WINDOWS) { $thumbnail_info['image_path'] = str_replace('/', '\\', $thumbnail_info['image_path']); } if (!$cmpfunc($xcart_dir, $thumbnail_info["image_path"], strlen($xcart_dir))) { # image_path is an locally placed image $url = $current_location.str_replace("\\", "/", substr($thumbnail_info["image_path"], strlen($xcart_dir))); return $url;
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote