View Single Post
  #17  
Old 07-10-2008, 02:25 AM
 
qrichou qrichou is offline
 

Advanced Member
  
Join Date: Oct 2007
Posts: 39
 

Default Re: Rubymods Live Currency Rates for XCart 4.1x

Our site goes live next week and we have been waiting for over a week for an answer this is what is being displayed when the module is turned on, can anyone help please!!!!

This is what is being displayed:-

5 || (date('w') = 17 && $config["Rubymods_Currency_Rates"]["ruby_rates_base"] == $source) { $date_condition = " WHERE date $v) { if ($v > 0) { if ($source == "USD" && ($k== "GBP" || $k == "EUR" || $k == "AUD" || $k == "NZD") ) { $v = 1 / $v; } $this_rate = $v * $rates[$config["Rubymods_Currency_Rates"]["ruby_rates_base"]]; if ($k == $config["Rubymods_Currency_Rates"]["ruby_rates_base"]) $this_rate = 1; } #echo "k=".$k." :source=".$source." :v=".$v." :rrb=".$rates[$config["Rubymods_Currency_Rates"]["ruby_rates_base"]]." :rate=".$this_rate." :rates_base=".$config["Rubymods_Currency_Rates"]["ruby_rates_base"]."
"; if ($this_rate > 0) { //Only update rates in $db_rate array if (is_array($db_rates)) { foreach ($db_rates as $db_rate) { if ($db_rate["code"] == $k) { db_query("UPDATE ruby_exchange_rates set value = '$this_rate', date ='".time()."' where code = '$k'"); } } } } } func_write_to_log($source); } function func_write_to_log($source) { global $UTC,$config,$xcart_dir,$var_dirs; #write results to log file if (!$var_dirs["log"]) $var_dirs["log"] = $xcart_dir.'/log'; $filename = $var_dirs["log"]."/ruby_rates.txt"; $content_head = "date: ".date("r")."\nUTC hour: ".$UTC."\nRates source: ".$source."\nSource preference: ".$config["Rubymods_Currency_Rates"]["ruby_rates_prefer"]."\nBase currency: ".$config["Rubymods_Currency_Rates"]["ruby_rates_base"]."\nOld base currency: ".$config["ruby_rates_base_old"]; $content_coda = "\n".$return."\n++++++++++++++++++++++++++++++++++ ++++++++++++=\n"; if (!$handle = fopen($filename, 'a')) { echo "Cannot open file ($filename)"; } if (fwrite($handle, $content_head.$content_body.$content_coda) === FALSE) { echo "Cannot write to file ($filename)"; } fclose($handle); } //Input country code, returns currency code function func_get_currency_code($code) { switch ($code) { case "UK": return "GBP"; case "CH": return "CHF"; case "AT": return "EUR"; case "BE": return "EUR"; case "FI": return "EUR"; case "FR": return "EUR"; case "DE": return "EUR"; case "GR": return "EUR"; case "IE": return "EUR"; case "IT": return "EUR"; case "LU": return "EUR"; case "NL": return "EUR"; case "PT": return "EUR"; case "ES": return "EUR"; default: break; } return func_query_first_cell("SELECT code FROM ruby_exchange_rates WHERE code LIKE '".$code."%'"); } /* Notes FRB Australia,European Monetary Union, United Kingdom These rates are quoted in U.S. dollars per foreign currency unit. All other rates are quoted in foreign currency units per U.S. dollar. */ ?>
Reply With Quote