Option Required Currently  Status  Comments
Operation system - Linux OK  
PHP version   4.0.6 5.3.3 OK  
Perl-compatible regular expressions   On On OK  
PHP Server API   CGI unknown OK  
MySQL support is ...   On On OK  
safe_mode   0 0 OK  
register_long_arrays   1 0 Failed Please check php.ini to correct problem
disabled functions list   Not (exec, popen, pclose, ini_set) OK  
file_uploads   1 1 OK  
upload_max_filesize   2M 2M OK  
magic_quotes_gpc   1 0 Warning Emulation is used
magic_quotes_runtime   0 0 OK  
magic_quotes_sybase   0 0 OK  
register_globals   1 0 Warning Emulation is used

Please contact your host administrators and ask them to correct PHP-settings for your site according to the requirements above.

Directory Permissions Required Comments
(root) /var/www/vhosts/masterstoystore.com/httpdocs/shop 40777 xx755
(customer) 40777 xx755
(admin) /admin 40777 xx755
(provider) /provider 40777 xx755
(partner) /partner 40777 xx755

# All rights reserved. # # DESCRIPTION: # Allow skin swapping on the fly. Options configurable via General Settings in # x-cart admin area. Please see README.txt for more details!! # ============================================================================= if ( !defined('XCART_START') ) { header("Location: index.php"); die("Access denied"); } umask(0); # may need to add this to customer/https.php if your https uses a different location or server: # $additional_query .= "&".$value_to_swap_with."=".$HTTP_COOKIE_VARS["skinswap"]; # # Define SMARTY_DIR to avoid problems with PHP 4.2.3 & SunOS # define('SMARTY_DIR', $xcart_dir.DIRECTORY_SEPARATOR."Smarty-2.6.12".DIRECTORY_SEPARATOR); ini_set('include_path', $xcart_dir . "/include/templater" . PATH_SEPARATOR . SMARTY_DIR . PATH_SEPARATOR . ini_get('include_path')); include_once($xcart_dir."/include/templater/templater.php"); # # Smarty object for processing html templates # $smarty = new Templater; # # Get absolute path # define('BASEDIR', realpath(dirname(__FILE__))); # ============================================================================= # read config.php variables for mysql info # ============================================================================= $regs = array (); # Read data from config.php if (!($fp = fopen(BASEDIR.DIRECTORY_SEPARATOR."/config.php", "r"))) { return false; } # Loop through config to find db info while (!feof($fp)) { $buffer = fgets($fp, 4096); # look for host if(ereg('^\$sql_host *=', $buffer)) { ereg('^\$sql_host *=\'(.*)\';', $buffer, $regs); $mysql_host = $regs[1]; } # look for user if(ereg('^\$sql_user *=', $buffer)) { ereg('^\$sql_user *=\'(.*)\';', $buffer, $regs); $mysql_user = $regs[1]; } # look for db if(ereg('^\$sql_db *=', $buffer)) { ereg('^\$sql_db *=\'(.*)\';', $buffer, $regs); $mysql_db = $regs[1]; } # look for password if(ereg('^\$sql_password *=', $buffer)) { ereg('^\$sql_password *=\'(.*)\';', $buffer, $regs); $mysql_password = $regs[1]; } } fclose($fp); # ============================================================================= # Execute mysql query and store result into associative array # ============================================================================= function skin_swap_func_query($query) { if ($p_result = mysql_query($query)) { while($arr = mysql_fetch_array($p_result, MYSQL_ASSOC)) $result[]=$arr; mysql_free_result($p_result); } return $result; } # ============================================================================= # Connect to Database and read skinswap configs # ============================================================================= $skin_swap_connect = mysql_connect($mysql_host, $mysql_user, $mysql_password); mysql_select_db($mysql_db) || die("Could not connect to SQL db"); # ============================================================================= # Grab config variables relative to Skin Swap # ============================================================================= $query = "select * from xcart_config where category = 'Skin_Swap' order by orderby"; $skin_swap_configs = skin_swap_func_query($query); # ============================================================================= # Close mysql connection # ============================================================================= mysql_close($skin_swap_connect); # ============================================================================= # Set skin swap configure variables # ============================================================================= $allow_skin_swap_mod = $skin_swap_configs[0][value]; $value_to_swap_with = $skin_swap_configs[1][value]; $skin_swap_template_repository = $skin_swap_configs[2][value]; $skin_swap_default_skin = $skin_swap_configs[3][value]; $skin_swap_debug_tpl = $skin_swap_configs[4][value]; # ============================================================================= # Try and preserve as much resources as possible # ============================================================================= unset($skin_swap_configs, $query, $fp, $buffer, $regs); unset($mysql_host, $mysql_user, $mysql_db, $mysql_password); # ============================================================================= # default skin subdirectory (fallback if none found) # ============================================================================= $default_skin = $skin_swap_default_skin; # ============================================================================= # Template repository # ============================================================================= $skin_swap_repository = $skin_swap_template_repository."/"; # ============================================================================= # Skin directory found boolean # ============================================================================= $skinswap_found_dir = true; # ============================================================================= # Get URL method, set cookie (if needed) and set skin to swap into # ============================================================================= if($allow_skin_swap_mod=="Y") { if($HTTP_GET_VARS[$value_to_swap_with]) { if(!is_dir($xcart_dir.$skin_swap_repository.$HTTP_GET_VARS[$value_to_swap_with])) { $skinswap_found_dir = false; $skinswap = $default_skin; } if($skinswap_found_dir) { $skinswap = $HTTP_GET_VARS[$value_to_swap_with]; setcookie ("skinswap", "", time()-31536000); setcookie ("skinswap", $HTTP_GET_VARS[$value_to_swap_with], time()+31536000); } } elseif($HTTP_COOKIE_VARS["skinswap"] && !$HTTP_GET_VARS[$value_to_swap_with]) { $skinswap = $HTTP_COOKIE_VARS["skinswap"]; } elseif(!$HTTP_COOKIE_VARS["skinswap"] or !$HTTP_GET_VARS[$value_to_swap_with]) { $skinswap = $default_skin; } } else { $skinswap = $default_skin; } # ============================================================================= # Assign Smarty # ============================================================================= # Use skin variable and Request URI for compile_id (NOT RECOMMENDED!) # $smarty->compile_id = $skinswap.$_SERVER['REQUEST_URI']; # # Store all compiled templates to the single directory # $smarty->use_sub_dirs = false; $smarty->request_use_auto_globals = false; $smarty->compile_id = $skinswap; $smarty->template_dir = $xcart_dir.$skin_swap_repository.$skinswap; $smarty->compile_dir = $var_dirs["templates_c"]; $smarty->config_dir = $xcart_dir.$skin_swap_repository.$skinswap; $smarty->cache_dir = $var_dirs["cache"]; $smarty->secure_dir = $xcart_dir.$skin_swap_repository.$skinswap; # trim whitespace for cleaner output (disabled as it causes issues with exporting and HTML emails) # $smarty->load_filter("output","trimwhitespace"); # default smarty debug template if($skin_swap_debug_tpl=="debug.tpl") { $smarty->debug_tpl="file:debug.tpl"; } else { $smarty->debug_tpl="file:debug_templates.tpl"; } # ============================================================================= # Assign images and dir # ============================================================================= $skinswap_images = $xcart_web_dir.$skin_swap_repository.$skinswap."/images"; $skinswap_dir = $xcart_web_dir.$skin_swap_repository.$skinswap; $smarty->assign("ImagesDir",$skinswap_images); $smarty->assign("SkinDir",$skinswap_dir); $smarty->assign("template_dir", $smarty->template_dir); # ============================================================================= # Smarty object for processing mail templates # ============================================================================= $mail_smarty = $smarty; # # WARNING : # Please ensure that you have no whitespaces / empty lines below this message. # Adding a whitespace or an empty line below this line will cause a PHP error. # ?>