РРРРРР я все таки это сделал!

Доблся правлиьного ращета формулы велюты (читайте мой пост выше)...
Решиние как всегда генильное и простое.. как в сказке "Колобок" по сусеам поскреб и нашол выход!
Собственно для нормально ращета нужна заменить все содержимое приславутого файла convertECB.php на следующее:
<?php
if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
class convertECB {
var $archive = true;
var $last_updated = '';
var $document_address = 'http://mytest.ua/eurofxref-daily.xml';
var $info_address = 'http://mytest.ua/';
function convert( $amountA, $currA='', $currB='' ) {
global $mosConfig_cachepath, $mosConfig_live_site, $mosConfig_absolute_path,
$mosConfig_offset, $vendor_currency, $vmLogger;
// global $vendor_currency is DEFAULT!
if( !$currA ) {
$currA = $vendor_currency;
}
if( !$currB ) {
$currB = $GLOBALS['product_currency'];
}
// If both currency codes match, do nothing
if( $currA == $currB ) {
return $amountA;
}
if( $GLOBALS['converter_array'] == '') {
setlocale(LC_TIME, "en-GB");
$now = time() + 3600; // Time in ECB (Germany) is GMT + 1 hour (3600 seconds)
if (date("I")) {
$now += 3600; // Adjust for daylight saving time
}
$weekday_now_local = gmdate('w', $now); // week day, important: week starts with sunday (= 0)!!
$date_now_local = gmdate('Ymd', $now);
$time_now_local = gmdate('Hi', $now);
$time_ecb_update = '1415';
if( is_writable($mosConfig_cachepath) ) {
$store_path = $mosConfig_cachepath;
}
else {
$store_path = $mosConfig_absolute_path."/media";
}
$archivefile_name = $store_path.'/daily.xml';
$ecb_filename = $this->document_address;
$val = '';
if(file_exists($archivefile_name) && filesize( $archivefile_name ) > 0 ) {
// timestamp for the Filename
$file_datestamp = date('Ymd', filemtime($archivefile_name));
$curr_filename = $archivefile_name;
$this->last_updated = $file_datestamp;
$this->archive = false;
}
else {
$curr_filename = $ecb_filename;
}
if( !is_writable( $store_path )) {
$this->archive = false;
$vmLogger->debug( "The file $archivefile_name can't be created. The directory $store_path is not writable" );
}
if( $curr_filename == $ecb_filename ) {
// Fetch the file from the internet
require_once( CLASSPATH.'connectionTools.class.php');
$contents = vmConnector::handleCommunication( $curr_filename );
$this->last_updated = date('Ymd');
}
else {
$contents = @file_get_contents( $curr_filename );
}
if( $contents ) {
// if archivefile does not exist
if( $this->archive ) {
// now write new file
file_put_contents( $archivefile_name, $contents );
}
$contents = str_replace ("<Cube currency='USD'", " <Cube currency='EUR' rate='1'/> <Cube currency='USD'", $contents);
/* XML Parsing */
require_once( $mosConfig_absolute_path. '/includes/domit/xml_domit_lite_include.php' );
$xmlDoc = new DOMIT_Lite_Document();
if( !$xmlDoc->parseXML( $contents, false, true ) ) {
$vmLogger->err( 'Failed to parse the Currency Converter XML document.');
$GLOBALS['product_currency'] = $vendor_currency;
return $amountA;
}
$currency_list = $xmlDoc->getElementsByTagName( "Cube" );
// Loop through the Currency List
for ($i = 0; $i < $currency_list->getLength(); $i++) {
$currNode =& $currency_list->item($i);
$currency[$currNode->getAttribute("currency")] = $currNode->getAttribute("rate");
unset( $currNode );
}
$GLOBALS['converter_array'] = $currency;
}
else {
$GLOBALS['converter_array'] = -1;
$vmLogger->err( 'Failed to retrieve the Currency Converter XML document.');
$GLOBALS['product_currency'] = $vendor_currency;
return $amountA;
}
}
$valA = isset( $GLOBALS['converter_array'][$currA] )? $GLOBALS['converter_array'][$currA] : 1;
$valB = isset( $GLOBALS['converter_array'][$currB] )? $GLOBALS['converter_array'][$currB] : 1;
$val = $amountA * $valA/ $valB;
return $val;
} // end function convertecb
}
?>
К сожалению к аминке прирутить сие чудо у меня не получилось.. =( ибо там выдает тьму тараканью ошибок нефельтруемых переменных и прочего хлама =)
Возможно из за того что не прописаны какие то вещи в самом шаблонизаторе админки (я просто не нашо да и не понял чего там нуна присобачить)
При этом в шаблон админки Joomla должен быть вставлен код, реализующий открытие Highslide окон, иначе нужный интерфейс будет открыт просто в том же окне, что есть некрасиво.
Но пока полет нормальный! Посмотрим, что будет дальше =)
Для тех кому нетерсно! в посте
http://joomlaforum.ru/index.php/topic,26078.msg533727.html#msg533727допущена ошибка в коде
$res = round($nb,2);
if( $symbol != » ) {
$this->symbol = $old_symbol;
}
$res = $res.» грн.»;
return($res);
Должен иметь вид:
$res = round($nb,2);
if( $symbol != '' ) {
$this->symbol = $old_symbol;
}
$res = $res.' грн.';
return($res);
Иначе попросут вам выдаст ошибку и админка ляже.. вместе с сатом =)
Так же есть недостаток.. после проделавания оных вещей =) (а это закоментить строки начиня со 142 по 200 там какую то и замены кода...) все цены перещитываются, но знак валюты пишет только "грн."
P.S: сори ели об этом где писали уже =)