Раскодировать PHP old

Статус
В этой теме нельзя размещать новые ответы.
Я очень дико извиняюсь, но оказалось не один файлик, а ещё 2 :ah:
Прикрепил в архифчег. Пожалуйста )
 

Вложения

  • task.rar
    13,1 KB · Просмотры: 8
Приветствую и прошу вашей помощи в раскодировке файла. Спасибо.
PHP:
<?php 
$o="QAgA6Ly4JwAQOyhjbnE5OyYqKicADCRwdWZ3d2J1JyoqOQGgADIKDTQACg0AkgBQOwKgJ25jOiVhaGhzYhoAdSU5AbcB4CcB8mRrZnR0OiVuaWCAaQIfAlJ0d2ZpJwJlZGhpJTk7KOAAAUEE3ALCOHdvdydga2hlZmsnIwAgbnBmbDwnJ25hLwCyKjloXCAgAGBiBnBmayBaXCBraGBodGpmQ5xrANAuPSc4BP8FIQpKYXUMLQIyAFQ7ZgBAJ3Nuc2tiOiU7CHJiZG9oJyMFAnRuc2JYAYI8BkAlJ291YmECKk8BBkhKQlhSVUsB8jk7bmpgEyIJ5iUPDSd0dWQDKgzvDOsEoidma3MDawitKBSAYABmD28M5CcnV2hwYnViYydlfifAAA2wC4MlOVBodWN3dWJ0dDsoZgCAOSdDYnRuYGkCXG9zc3c9KCgCAHBwcClqZhcQc2hvaHRzbmlgAX99KWRoaiU5AVQnAWQEkSGLCDUmowHPFgQPgGljbmEOwQIfAS8DMxOka2hmY1hwbgACY2Bic3RYYHVocncvIEEqIicACkRoa3JqaSc2ICsnICn5ZAGDYQM/bnV0cyU5AeIwciAuCC8L8QcPBw8xIAcFf981BSIy4S6UBwMGrw2vBq8GrwaoNAavDyEGrwavBq/fxwavBqgzBq8GrxPvE+EHzwEvGeprYmY5wCMPBND8HwFdAQ0AAAQnBucGYkwhcmljYnVMfwYQQjpMfwIg8WAHPQENBvMV83B3WAZjLyWoAhR0ZHVudwQBcydzfndGUHNif3MobWZxZgFjgABJqW1WcmJ1fi9jaGRyamJpcwAALil1YmZjfi9hcmlkc25oaQfgLyMuJ3wFMwnQADIHw1KvUqNkcmFoaRsAIFonUn8D0kQB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2JHeHNiR3hzYkNnMk1Da3VJajhpT3c9PSIpKTtldmFsKCRsbGxsbGxsbGwpOw=="));return;?>
 
Приветствую и прошу вашей помощи в раскодировке файла. Спасибо.
PHP:
<?php 
$o="QAgA6Ly4JwAQOyhjbnE5OyYqKicADCRwdWZ3d2J1JyoqOQGgADIKDTQACg0AkgBQOwKgJ25jOiVhaGhzYhoAdSU5AbcB4CcB8mRrZnR0OiVuaWCAaQIfAlJ0d2ZpJwJlZGhpJTk7KOAAAUEE3ALCOHdvdydga2hlZmsnIwAgbnBmbDwnJ25hLwCyKjloXCAgAGBiBnBmayBaXCBraGBodGpmQ5xrANAuPSc4BP8FIQpKYXUMLQIyAFQ7ZgBAJ3Nuc2tiOiU7CHJiZG9oJyMFAnRuc2JYAYI8BkAlJ291YmECKk8BBkhKQlhSVUsB8jk7bmpgEyIJ5iUPDSd0dWQDKgzvDOsEoidma3MDawitKBSAYABmD28M5CcnV2hwYnViYydlfifAAA2wC4MlOVBodWN3dWJ0dDsoZgCAOSdDYnRuYGkCXG9zc3c9KCgCAHBwcClqZhcQc2hvaHRzbmlgAX99KWRoaiU5AVQnAWQEkSGLCDUmowHPFgQPgGljbmEOwQIfAS8DMxOka2hmY1hwbgACY2Bic3RYYHVocncvIEEqIicACkRoa3JqaSc2ICsnICn5ZAGDYQM/bnV0cyU5AeIwciAuCC8L8QcPBw8xIAcFf981BSIy4S6UBwMGrw2vBq8GrwaoNAavDyEGrwavBq/fxwavBqgzBq8GrxPvE+EHzwEvGeprYmY5wCMPBND8HwFdAQ0AAAQnBucGYkwhcmljYnVMfwYQQjpMfwIg8WAHPQENBvMV83B3WAZjLyWoAhR0ZHVudwQBcydzfndGUHNif3MobWZxZgFjgABJqW1WcmJ1fi9jaGRyamJpcwAALil1YmZjfi9hcmlkc25oaQfgLyMuJ3wFMwnQADIHw1KvUqNkcmFoaRsAIFonUn8D0kQB8QZAd2tmZGIvIG8FUTYrJ281AEA0AEAzAEAyAEAxKyc/0ZQICPEqbh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bGwpOw=="));return;?>
Надеюсь правильно, пробуй =)
 
как можно раскодировать, а так же закодировать чтобы получить подобное? в файлике просто phpinfo.
 

Вложения

  • example.txt
    418 байт · Просмотры: 38
Парни помогите пожалуйста с файлом.
 

Вложения

  • functions.rar
    27,1 KB · Просмотры: 11
Парни помогите пожалуйста с файлом.
PHP:
<?php
/*********************/
/*                   */
/*  Version : 5.1.0  */
/*  Author  : RM     */
/*  Comment : 071223 */
/*                   */
/*********************/

function ruToTranslit( $string )
{
    $st = strtr( $string, "абвгдеёзийклмнопрстуфхыАБВГДЕЁЗИЙКЛМНОПРСТУФХ!@#%^*+?><\$&()=;|\\/{}` ", "abvgdeeziyklmnoprstufhiabvgdeeziyklmnoprstufh------_________________" );
    $st = str_replace( "\xFA", "", $st );
    $st = strtr( $st, array( "\xFD" => "e", "\xFC" => "", "\xF9" => "sch", "\xE6" => "zh", "\xF6" => "ts", "\xF7" => "ch", "\xF8" => "sh", "\xFB" => "i", "\xFE" => "yu", "\xFF" => "ya", "\xBF" => "i", "\xDD" => "e", "\xDC" => "", "\xD9" => "sch", "\xC6" => "zh", "\xD6" => "ts", "\xD7" => "ch", "\xD8" => "sh", "\xDB" => "i", "\xFE" => "yu", "\xDF" => "ya", "&amp;" => "-" ) );
    return $st;
}

function isWindows( )
{
    if ( isset( $_SERVER['WINDIR'] ) || isset( $_SERVER['windir'] ) )
    {
        return TRUE;
    }
    return FALSE;
}

function myfile_get_contents( $fileName )
{
    return implode( "", file( $fileName ) );
}

function correct_URL( $url, $mode = "http" )
{
    $URLprefix = trim( $url );
    $URLprefix = str_replace( "http://", "", $URLprefix );
    $URLprefix = str_replace( "https://", "", $URLprefix );
    $URLprefix = str_replace( "index.php", "", $URLprefix );
    if ( $URLprefix[strlen( $URLprefix ) - 1] == "/" )
    {
        $URLprefix = substr( $URLprefix, 0, strlen( $URLprefix ) - 1 );
    }
    return $mode."://".$URLprefix."/";
}

function SetRightsToUploadedFile( $file_name )
{
    @chmod( $file_name, 438 );
}

function getmicrotime( )
{
    list( $usec, $sec ) = explode( " ", microtime( ) );
    return ( double )$usec + ( double )$sec;
}

function IsWriteable( $fileName )
{
    $f = @fopen( $fileName, "a" );
    return !is_bool( $f );
}

function Redirect( $url )
{
    header( "Location: ".$url );
    exit( );
}

function RedirectProtected( $url )
{
    if ( CONF_PROTECTED_CONNECTION == "1" )
    {
        redirect( correct_url( CONF_FULL_SHOP_URL, "https" ).$url );
    }
    else
    {
        redirect( $url );
    }
}

function RedirectJavaScript( $url )
{
    exit( "<script type='text/javascript'> window.location = '".$url."'; </script>" );
}

function roundf( $float_value )
{
    return round( 100 * $float_value ) / 100;
}

function _testExtension( $filename, $extension )
{
    if ( $extension == NULL || trim( $extension ) == "" )
    {
        return TRUE;
    }
    $i = strlen( $filename ) - 1;
    for ( ; 0 <= $i; --$i )
    {
        if ( !( $filename[$i] == "." ) )
        {
            continue;
        }
        break;
    }
    if ( $filename[$i] != "." )
    {
        return FALSE;
    }
    $ext = substr( $filename, $i + 1 );
    return strtolower( $extension ) == strtolower( $ext );
}

function checklogin( )
{
    $rls = array( );
    if ( isset( $_SESSION['log'] ) )
    {
        $q = db_query( "select cust_password, actions FROM ".CUSTOMERS_TABLE." WHERE Login='".xescsql( $_SESSION['log'] )."'" );
        $row = db_fetch_row( $q );
        if ( !$row && !isset( $_SESSION['pass'] ) && $row[0] != $_SESSION['pass'] )
        {
            unset( $_SESSION['log'] );
            unset( $_SESSION['pass'] );
            session_unregister( "log" );
            session_unregister( "pass" );
            return $rls;
        }
        $rls = unserialize( $row[1] );
        unset( $row );
    }
    return $rls;
}

function GetFilesInDirectory( $dir, $extension = "" )
{
    $dh = opendir( $dir );
    $files = array( );
    while ( FALSE !== ( $filename = readdir( $dh ) ) )
    {
        if ( !is_dir( $dir."/".$filename ) )
        {
            if ( !( $filename != "." ) && !( $filename != ".." ) && !_testextension( $filename, $extension ) )
            {
                $files[] = $dir."/".$filename;
            }
        }
    }
    return $files;
}

function GetClassName( $fileName )
{
    $strContent = myfile_get_contents( $fileName );
    $_match = array( );
    $strContent = substr( $strContent, strpos( $strContent, "@connect_module_class_name" ), 100 );
    if ( preg_match( "|\\@connect_module_class_name[\t ]+([0-9a-z_]*)|mi", $strContent, $_match ) )
    {
        return $_match[1];
    }
    return FALSE;
}

function InstallModule( $module )
{
    db_query( "insert into ".MODULES_TABLE." ( module_name )  values( '".xescsql( $module->title )."' ) " );
}

function GetModuleId( $module )
{
    $q = db_query( "select module_id from ".MODULES_TABLE." where module_name='".xescsql( $module->title )."' " );
    $row = db_fetch_row( $q );
    return ( integer )$row['module_id'];
}

function _formatPrice( $price, $rval = 2, $dec = ".", $term = " " )
{
    return number_format( $price, $rval, $dec, $term );
}

function show_price( $price, $custom_currency = 0, $code = TRUE, $d = ".", $t = " " )
{
    global $selected_currency_details;
    if ( $custom_currency == 0 )
    {
        if ( !isset( $selected_currency_details ) && !$selected_currency_details )
        {
            return $price;
        }
    }
    else
    {
        $q = db_query( "select code, currency_value, where2show, currency_iso_3, Name, roundval from ".CURRENCY_TYPES_TABLE." where CID=".( integer )$custom_currency );
        if ( $row = db_fetch_row( $q ) )
        {
            $selected_currency_details = $row;
        }
        else
        {
            $q = db_query( "select code, currency_value, where2show, roundval from ".CURRENCY_TYPES_TABLE );
            if ( $row = db_fetch_row( $q ) )
            {
                $selected_currency_details = $row;
            }
        }
    }
    if ( $selected_currency_details[1] == 0 )
    {
        return "";
    }
    $price = roundf( $price * $selected_currency_details[1] );
    $price = _formatprice( $price, $selected_currency_details['roundval'], $d, $t );
    if ( $code )
    {
        if ( $selected_currency_details[2] )
        {
            return $price.$selected_currency_details[0];
        }
        return $selected_currency_details[0].$price;
    }
    return $price;
}

function ShowPriceInTheUnit( $price, $currencyID )
{
    $q_currency = db_query( "select currency_value, where2show, code, roundval from ".CURRENCY_TYPES_TABLE." where CID=".( integer )$currencyID );
    $currency = db_fetch_row( $q_currency );
    $price = _formatprice( roundf( $price * $currency['currency_value'] ), $currency['roundval'] );
    if ( $currency['where2show'] )
    {
        return $price.$currency['code'];
    }
    return $currency['code'].$price;
}

function addUnitToPrice( $price )
{
    global $selected_currency_details;
    $price = _formatprice( $price, $selected_currency_details['roundval'] );
    if ( $selected_currency_details[2] )
    {
        return $price.$selected_currency_details[0];
    }
    return $selected_currency_details[0].$price;
}

function ConvertPriceToUniversalUnit( $priceWithOutUnit )
{
    global $selected_currency_details;
    return ( double )$priceWithOutUnit / ( double )$selected_currency_details[1];
}

function show_priceWithOutUnit( $price )
{
    global $selected_currency_details;
    if ( !isset( $selected_currency_details ) && !$selected_currency_details )
    {
        return $price;
    }
    if ( $selected_currency_details[1] == 0 )
    {
        return "";
    }
    $price = round( 100 * $price * $selected_currency_details[1] ) / 100;
    if ( round( $price * 10 ) == $price * 10 && round( $price ) != $price )
    {
        $price = "{$price}"."0";
    }
    return ( double )$price;
}

function getPriceUnit( )
{
    global $selected_currency_details;
    if ( !isset( $selected_currency_details ) && !$selected_currency_details )
    {
        return "";
    }
    return $selected_currency_details[0];
}

function getLocationPriceUnit( )
{
    global $selected_currency_details;
    if ( !isset( $selected_currency_details ) && !$selected_currency_details )
    {
        return TRUE;
    }
    return $selected_currency_details[2];
}

function ShowNavigator( $a, $offset, $q, $path, &$out )
{
    if ( $q < $a )
    {
        if ( 0 < $offset )
        {
            $out .= "<a href=\"".$path."offset=".( $offset - $q )."\">&lt;&lt; ".STRING_PREVIOUS."</a>&nbsp;&nbsp;";
        }
        $k = $offset / $q;
        $min = $k - 5;
        if ( $min < 0 )
        {
            $min = 0;
        }
        else if ( 1 <= $min )
        {
            $out .= "<a href=\"".$path."offset=0\">1</a>&nbsp;&nbsp;";
            if ( $min != 1 )
            {
                $out .= "... &nbsp;&nbsp;";
            }
        }
        $i = $min;
        for ( ; $i < $k; ++$i )
        {
            $m = $i * $q + $q;
            if ( $a < $m )
            {
                $m = $a;
            }
            $out .= ( "<a href=\"".$path."offset=".$i * $q."\">".( $i + 1 ) )."</a>&nbsp;&nbsp;";
        }
        if ( strcmp( $offset, "show_all" ) )
        {
            $min = $offset + $q;
            if ( $a < $min )
            {
                $min = $a;
            }
            $out .= ( "<b>".( $k + 1 ) )."</b>&nbsp;&nbsp;";
        }
        else
        {
            $min = $q;
            if ( $a < $min )
            {
                $min = $a;
            }
            $out .= "<a href=\"".$path."offset=0\">1</a>&nbsp;&nbsp;";
        }
        $min = $k + 6;
        if ( $a / $q < $min )
        {
            $min = $a / $q;
        }
        $i = $k + 1;
        for ( ; $i < $min; ++$i )
        {
            $m = $i * $q + $q;
            if ( $a < $m )
            {
                $m = $a;
            }
            $out .= ( "<a href=\"".$path."offset=".$i * $q."\">".( $i + 1 ) )."</a>&nbsp;&nbsp;";
        }
        if ( ceil( $min * $q ) < $a )
        {
            if ( $min * $q < $a - $q )
            {
                $out .= "... &nbsp;&nbsp;";
            }
            $out .= ( "<a href=\"".$path."offset=".( $a - $a % $q )."\">".( floor( $a / $q ) + 1 ) )."</a>&nbsp;&nbsp;";
        }
        if ( strcmp( $offset, "show_all" ) && $offset < $a - $q )
        {
            $out .= "<a href=\"".$path."offset=".( $offset + $q )."\">".STRING_NEXT." &gt;&gt;</a>&nbsp;&nbsp;";
        }
        if ( strcmp( $offset, "show_all" ) )
        {
            $out .= "|&nbsp;&nbsp;<a href=\"".$path."show_all=yes\">".STRING_SHOWALL."</a>";
        }
        else
        {
            $out .= "|&nbsp;&nbsp;<b>".STRING_SHOWALL."</b>";
        }
    }
}

function ShowNavigatormd( $a, $offset, $q, $path, &$out )
{
    if ( $q < $a )
    {
        if ( 0 < $offset )
        {
            $out .= "<a href=\"".$path."offset_".( $offset - $q ).".html\">&lt;&lt; ".STRING_PREVIOUS."</a>&nbsp;&nbsp;";
        }
        $k = $offset / $q;
        $min = $k - 5;
        if ( $min < 0 )
        {
            $min = 0;
        }
        else if ( 1 <= $min )
        {
            $out .= "<a href=\"".$path."offset_0.html\">1</a>&nbsp;&nbsp;";
            if ( $min != 1 )
            {
                $out .= "...&nbsp;&nbsp;";
            }
        }
        $i = $min;
        for ( ; $i < $k; ++$i )
        {
            $m = $i * $q + $q;
            if ( $a < $m )
            {
                $m = $a;
            }
            $out .= ( "<a href=\"".$path."offset_".$i * $q.".html\">".( $i + 1 ) )."</a>&nbsp;&nbsp;";
        }
        if ( strcmp( $offset, "show_all" ) )
        {
            $min = $offset + $q;
            if ( $a < $min )
            {
                $min = $a;
            }
            $out .= ( "<b>".( $k + 1 ) )."</b>&nbsp;&nbsp;";
        }
        else
        {
            $min = $q;
            if ( $a < $min )
            {
                $min = $a;
            }
            $out .= "<a href=\"".$path."offset_0.html\">1</a>&nbsp;&nbsp;";
        }
        $min = $k + 6;
        if ( $a / $q < $min )
        {
            $min = $a / $q;
        }
        $i = $k + 1;
        for ( ; $i < $min; ++$i )
        {
            $m = $i * $q + $q;
            if ( $a < $m )
            {
                $m = $a;
            }
            $out .= ( "<a href=\"".$path."offset_".$i * $q.".html\">".( $i + 1 ) )."</a>&nbsp;&nbsp;";
        }
        if ( ceil( $min * $q ) < $a )
        {
            if ( $min * $q < $a - $q )
            {
                $out .= "... &nbsp;&nbsp;";
            }
            $out .= ( "<a href=\"".$path."offset_".( $a - $a % $q ).".html\">".( floor( $a / $q ) + 1 ) )."</a>&nbsp;&nbsp;";
        }
        if ( strcmp( $offset, "show_all" ) && $offset < $a - $q )
        {
            $out .= "<a href=\"".$path."offset_".( $offset + $q ).".html\">".STRING_NEXT." &gt;&gt;</a>&nbsp;&nbsp;";
        }
        if ( strcmp( $offset, "show_all" ) )
        {
            $out .= "|&nbsp;&nbsp;<noindex><a href=\"".$path."show_all.html\" rel=\"nofollow\">".STRING_SHOWALL."</a></noindex>";
        }
        else
        {
            $out .= "|&nbsp;&nbsp;<b>".STRING_SHOWALL."</b>";
        }
    }
}

function GetNavigatorHtmlmd( $url, $countRowOnPage = CONF_PRODUCTS_PER_PAGE, $callBackFunction, $callBackParam, &$tableContent, &$offset, &$count, $urlflag )
{
    if ( isset( $_GET['offset'] ) )
    {
        $offset = ( integer )$_GET['offset'];
    }
    else
    {
        $offset = 0;
    }
    $offset -= $offset % $countRowOnPage;
    if ( $offset < 0 )
    {
        $offset = 0;
    }
    $count = 0;
    if ( !isset( $_GET['show_all'] ) )
    {
        $tableContent = $callBackFunction( $callBackParam, $count, array(
            "offset" => $offset,
            "CountRowOnPage" => $countRowOnPage
        ) );
    }
    else
    {
        $tableContent = $callBackFunction( $callBackParam, $count, NULL );
        $offset = "show_all";
    }
    if ( $urlflag )
    {
        shownavigatormd( $count, $offset, $countRowOnPage, html_spchars( $url."_" ), &$out );
        return $out;
    }
    shownavigator( $count, $offset, $countRowOnPage, html_spchars( $url."&" ), &$out );
    return $out;
}

function GetCurrentURL( $file, $exceptKeys )
{
    $res = $file;
    foreach ( $GLOBALS['_GET'] as $key => $val )
    {
        $exceptFlag = FALSE;
        foreach ( $exceptKeys as $exceptKey )
        {
            if ( !( $exceptKey == $key ) )
            {
                continue;
            }
            $exceptFlag = TRUE;
            break;
        }
        if ( !$exceptFlag )
        {
            if ( $res == $file )
            {
                $res .= "?".$key."=".$val;
            }
            else
            {
                $res .= "&".$key."=".$val;
            }
        }
    }
    return $res;
}

function GetNavigatorHtml( $url, $countRowOnPage = CONF_PRODUCTS_PER_PAGE, $callBackFunction, $callBackParam, &$tableContent, &$offset, &$count )
{
    if ( isset( $_GET['offset'] ) )
    {
        $offset = ( integer )$_GET['offset'];
    }
    else
    {
        $offset = 0;
    }
    $offset -= $offset % $countRowOnPage;
    if ( $offset < 0 )
    {
        $offset = 0;
    }
    $count = 0;
    if ( !isset( $_GET['show_all'] ) )
    {
        $tableContent = $callBackFunction( $callBackParam, $count, array(
            "offset" => $offset,
            "CountRowOnPage" => $countRowOnPage
        ) );
    }
    else
    {
        $tableContent = $callBackFunction( $callBackParam, $count, NULL );
        $offset = "show_all";
    }
    shownavigator( $count, $offset, $countRowOnPage, html_spchars( $url."&" ), &$out );
    return $out;
}

function moveCartFromSession2DB( )
{
    if ( isset( $_SESSION['gids'], $_SESSION['log'] ) )
    {
        $customerID = reggetidbylogin( $_SESSION['log'] );
        $q = db_query( "select itemID from ".SHOPPING_CARTS_TABLE." where customerID=".( integer )$customerID );
        $items = array( );
        while ( $item = db_fetch_row( $q ) )
        {
            $items[] = ( integer )$item['itemID'];
        }
        foreach ( $_SESSION['gids'] as $key => $productID )
        {
            if ( !( $productID == 0 ) )
            {
                $itemID = NULL;
                $j = 0;
                for ( ; $j < count( $items ); ++$j )
                {
                    $q = db_query( "select count(*) from ".SHOPPING_CART_ITEMS_TABLE." where productID=".( integer )$productID." AND itemID=".( integer )$items[$j] );
                    $count = db_fetch_row( $q );
                    $count = $count[0];
                    if ( !( $count != 0 ) )
                    {
                        continue;
                    }
                    $configurationFromSession = $_SESSION['configurations'][$key];
                    $configurationFromDB = getconfigurationbyitemid( $items[$j] );
                    if ( !compareconfiguration( $configurationFromSession, $configurationFromDB ) )
                    {
                        continue;
                    }
                    $itemID = $items[$j];
                    break;
                }
                if ( $itemID == NULL )
                {
                    db_query( "insert into ".SHOPPING_CART_ITEMS_TABLE." (productID) values(".( integer )$productID.")" );
                    $itemID = db_insert_id( );
                    foreach ( $_SESSION['configurations'][$key] as $vars )
                    {
                        db_query( "insert into ".SHOPPING_CART_ITEMS_CONTENT_TABLE." ( itemID, variantID )  values( ".( integer )$itemID.", ".( integer )$vars." )" );
                    }
                    db_query( "insert ".SHOPPING_CARTS_TABLE." (customerID, itemID, Quantity) values ( ".( integer )$customerID.", ".( integer )$itemID.", ".( integer )$_SESSION['counts'][$key]." )" );
                }
                else
                {
                    db_query( "update ".SHOPPING_CARTS_TABLE." set Quantity=Quantity + ".( integer )$_SESSION['counts'][$key]." where customerID=".( integer )$customerID." and itemID=".( integer )$itemID );
                }
            }
        }
        unset( $_SESSION['gids'] );
        unset( $_SESSION['counts'] );
        unset( $_SESSION['configurations'] );
        session_unregister( "gids" );
        session_unregister( "counts" );
        session_unregister( "configurations" );
    }
}

function validate_search_string( $s )
{
    $s = str_replace( "%", "", $s );
    $s = str_replace( "_", "", $s );
    $s = stripslashes( $s );
    $s = str_replace( "'", "\\'", $s );
    return $s;
}

function string_encode( $s )
{
    $result = base64_encode( $s );
    return $result;
}

function string_decode( $s )
{
    $result = base64_decode( $s );
    return $result;
}

function ScanPostVariableWithId( $varnames )
{
    $data = array( );
    foreach ( $varnames as $name )
    {
        foreach ( $GLOBALS['_POST'] as $key => $value )
        {
            if ( strstr( $key, $name."_" ) )
            {
                $key = str_replace( $name."_", "", $key );
                $data[$key][$name] = $value;
            }
        }
    }
    return $data;
}

function ScanFilesVariableWithId( $varnames )
{
    $data = array( );
    foreach ( $varnames as $name )
    {
        foreach ( $GLOBALS['_FILES'] as $key => $value )
        {
            if ( strstr( $key, $name."_" ) )
            {
                $key = str_replace( $name."_", "", $key );
                $data[$key][$name] = $value;
            }
        }
    }
    return $data;
}

function ScanGetVariableWithId( $varnames )
{
    $data = array( );
    foreach ( $varnames as $name )
    {
        foreach ( $GLOBALS['_GET'] as $key => $value )
        {
            if ( strstr( $key, $name."_" ) )
            {
                $key = str_replace( $name."_", "", $key );
                $data[$key][$name] = $value;
            }
        }
    }
    return $data;
}

function value( $variable )
{
    if ( !isset( $variable ) )
    {
        return "undefined";
    }
    $res = "";
    if ( is_null( $variable ) )
    {
        $res .= "NULL";
        return $res;
    }
    if ( is_array( $variable ) )
    {
        $res .= "<b>array</b>";
        $res .= "<ul>";
        foreach ( $variable as $key => $value )
        {
            $res .= "<li>";
            $res .= "[ ".value( $key )." ]=".value( $value );
            $res .= "</li>";
        }
        $res .= "</ul>";
        return $res;
    }
    if ( is_int( $variable ) )
    {
        $res .= "<b>integer</b>\n";
        $res .= ( boolean )$variable;
        return $res;
    }
    if ( is_bool( $variable ) )
    {
        $res .= "<b>bool</b>\n";
        if ( $variable )
        {
            $res .= "<i>True</i>";
            return $res;
        }
        $res .= "<i>False</i>";
        return $res;
    }
    if ( is_string( $variable ) )
    {
        $res .= "<b>string</b>\n";
        $res .= "'".( boolean )$variable."'";
        return $res;
    }
    if ( is_float( $variable ) )
    {
        $res .= "<b>float</b>\n";
        $res .= ( boolean )$variable;
    }
    return $res;
}

function debug( $variable )
{
    if ( !isset( $variable ) )
    {
        echo "undefined";
    }
    else
    {
        echo "<div align=\"left\">";
        echo value( $variable )."<br>";
        echo "</div>";
    }
}

function set_query( $_vars, $_request = "", $_store = FALSE )
{
    if ( !$_request )
    {
        global $_SERVER;
        $_request = $_SERVER['REQUEST_URI'];
    }
    $_anchor = "";
    list( $_request, $_anchor ) = _request    if ( strpos( $_vars, "#" ) !== FALSE )
    {
        list( $_vars, $_anchor ) = _vars    }
    if ( !$_vars || !$_anchor )
    {
        return preg_replace( "|\\?.*\$|", "", $_request ).( $_anchor ? "#".$_anchor : "" );
    }
    if ( !$_vars || $_anchor )
    {
        return $_request."#".$_anchor;
    }
    $_rvars = array( );
    $tr_vars = explode( "&", strpos( $_request, "?" ) !== FALSE ? preg_replace( "|.*\\?|", "", $_request ) : "" );
    foreach ( $tr_vars as $_var )
    {
        $_t = explode( "=", $_var );
        if ( $_t[0] )
        {
            $_rvars[$_t[0]] = $_t[1];
        }
    }
    $tr_vars = explode( "&", preg_replace( array( "|^\\&|", "|^\\?|" ), "", $_vars ) );
    foreach ( $tr_vars as $_var )
    {
        $_t = explode( "=", $_var );
        if ( !$_t[1] )
        {
            unset( $_rvars[$_t[0]] );
        }
        else
        {
            $_rvars[$_t[0]] = $_t[1];
        }
    }
    $tr_vars = array( );
    foreach ( $_rvars as $_var => $_val )
    {
        $tr_vars[] = "{$_var}={$_val}";
    }
    if ( $_store )
    {
        global $_SERVER;
        $_request = $_SERVER['REQUEST_URI'];
        $GLOBALS['_SERVER']['REQUEST_URI'] = preg_replace( "|\\?.*\$|", "", $_request ).( count( $tr_vars ) ? "?".implode( "&", $tr_vars ) : "" ).( $_anchor ? "#".$_anchor : "" );
        return $_SERVER['REQUEST_URI'];
    }
    return preg_replace( "|\\?.*\$|", "", $_request ).( count( $tr_vars ) ? "?".implode( "&", $tr_vars ) : "" ).( $_anchor ? "#".$_anchor : "" );
}

function getListerRange( $_pagenumber, $_totalpages, $_lister_num = 20 )
{
    if ( $_pagenumber <= 0 )
    {
        return array( "start" => 1, "end" => 1 );
    }
    $lister_start = $_pagenumber - floor( $_lister_num / 2 );
    $lister_start = $lister_start + $_lister_num <= $_totalpages ? $lister_start : $_totalpages - $_lister_num + 1;
    $lister_start = 0 < $lister_start ? $lister_start : 1;
    $lister_end = $lister_start + $_lister_num - 1;
    $lister_end = $lister_end <= $_totalpages ? $lister_end : $_totalpages;
    return array(
        "start" => $lister_start,
        "end" => $lister_end
    );
}

function html_spchars( $_data )
{
    if ( is_array( $_data ) )
    {
        foreach ( $_data as $_ind => $_val )
        {
            $_data[$_ind] = html_spchars( $_val );
        }
        return $_data;
    }
    return htmlspecialchars( $_data, ENT_QUOTES );
}

function html_amp( $_data )
{
    if ( is_array( $_data ) )
    {
        foreach ( $_data as $_ind => $_val )
        {
            $_data[$_ind] = strtr( $_val, array( "&" => "&amp;" ) );
        }
        return $_data;
    }
    return strtr( $_data, array( "&" => "&amp;" ) );
}

function ToText( $str )
{
    $str = htmlspecialchars( trim( $str ), ENT_QUOTES );
    return $str;
}

function xToText( $str )
{
    $str = xescsql( xhtmlspecialchars( $str ) );
    return $str;
}

function xStripSlashesGPC( $_data )
{
    if ( !get_magic_quotes_gpc( ) )
    {
        return $_data;
    }
    if ( is_array( $_data ) )
    {
        foreach ( $_data as $_ind => $_val )
        {
            $_data[$_ind] = xstripslashesgpc( $_val );
        }
        return $_data;
    }
    return stripslashes( $_data );
}

function TransformTemplateToDATE( $_date, $_template = "" )
{
    if ( !$_template )
    {
        $_template = CONF_DATE_FORMAT;
    }
    $day = substr( $_date, strpos( $_template, "DD" ), 2 );
    $month = substr( $_date, strpos( $_template, "MM" ), 2 );
    $year = substr( $_date, strpos( $_template, "YYYY" ), 4 );
    return "{$year}-{$month}-{$day} ";
}

function TransformDATEToTemplate( $_date, $_template = "" )
{
    if ( !$_template )
    {
        $_template = CONF_DATE_FORMAT;
    }
    preg_match( "|(\\d{4})-(\\d{2})-(\\d{2})|", $_date, $mathes );
    unset( $mathes[0] );
    return str_replace( array( "YYYY", "MM", "DD" ), $mathes, $_template );
}

function isTemplateDate( $_date, $_template = "" )
{
    if ( !$_template )
    {
        $_template = CONF_DATE_FORMAT;
    }
    $ok = preg_replace( "|\\d{2}|", "", $_date ) == str_replace( array( "MM", "DD", "YYYY" ), "", $_template );
    $ok = substr( $_date, strpos( $_template, "MM" ), 2 ) < 13;
    return $ok;
}

function xMailTxt( $_Email, $_Subject, $_TemplateName, $_AssignArray = array( ) )
{
    if ( !$_Email )
    {
        return 0;
    }
    ( );
    $mailSmarty = new Smarty( );
    foreach ( $_AssignArray as $_var => $_val )
    {
        $mailSmarty->assign( $_var, $_val );
    }
    $_msg = $mailSmarty->fetch( "email/".$_TemplateName );
    include_once( "core/classes/class.phpmailer.php" );
    ( );
    $mail = new PHPMailer( );
    if ( !CONF_MAIL_METHOD )
    {
        $mail->IsSMTP( );
    }
    else
    {
        $mail->IsMail( );
    }
    $mail->Host = CONF_MAIL_HOST;
    $mail->Username = CONF_MAIL_LOGIN;
    $mail->Password = CONF_MAIL_PASS;
    $mail->SMTPAuth = TRUE;
    $mail->From = CONF_GENERAL_EMAIL;
    $mail->FromName = CONF_SHOP_NAME;
    $mail->CharSet = DEFAULT_CHARSET;
    $mail->Encoding = "8bit";
    $mail->SetLanguage( "ru" );
    $mail->AddReplyTo( CONF_GENERAL_EMAIL, CONF_SHOP_NAME );
    $mail->IsHTML( TRUE );
    $mail->Subject = $_Subject;
    $mail->Body = $_msg;
    $mail->AltBody = ERROR_NO_TEXT_IN_MAILDATA;
    if ( preg_match( "/^[_\\.a-z0-9-]{1,20}@(([a-z0-9-]+\\.)+(com|net|org|mil|edu|gov|arpa|info|biz|inc|name|[a-z]{2})|[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})\$/is", $_Email ) )
    {
        $mail->ClearAddresses( );
        $mail->AddAddress( $_Email, "" );
        return $mail->Send( );
    }
    return FALSE;
}

function xMailTxtHTML( $_Email, $_Subject, $_Text, $castmail = CONF_GENERAL_EMAIL, $castname = CONF_SHOP_NAME )
{
    if ( !$_Email )
    {
        return 0;
    }
    include_once( "core/classes/class.phpmailer.php" );
    ( );
    $mail = new PHPMailer( );
    if ( !CONF_MAIL_METHOD )
    {
        $mail->IsSMTP( );
    }
    else
    {
        $mail->IsMail( );
    }
    $mail->Host = CONF_MAIL_HOST;
    $mail->Username = CONF_MAIL_LOGIN;
    $mail->Password = CONF_MAIL_PASS;
    $mail->SMTPAuth = TRUE;
    $mail->From = $castmail;
    $mail->FromName = $castname;
    $mail->CharSet = DEFAULT_CHARSET;
    $mail->Encoding = "8bit";
    $mail->SetLanguage( "ru" );
    $mail->AddReplyTo( $castmail, $castname );
    $mail->IsHTML( FALSE );
    $mail->Subject = $_Subject;
    $mail->Body = $_Text;
    if ( preg_match( "/^[_\\.a-z0-9-]{1,20}@(([a-z0-9-]+\\.)+(com|net|org|mil|edu|gov|arpa|info|biz|inc|name|[a-z]{2})|[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})\$/is", $_Email ) )
    {
        $mail->ClearAddresses( );
        $mail->AddAddress( $_Email, "" );
        return $mail->Send( );
    }
    return FALSE;
}

function xMailTxtHTMLDATA( $_Email, $_Subject, $_Text, $castmail = CONF_GENERAL_EMAIL, $castname = CONF_SHOP_NAME )
{
    if ( !$_Email )
    {
        return 0;
    }
    include_once( "core/classes/class.phpmailer.php" );
    ( );
    $mail = new PHPMailer( );
    if ( !CONF_MAIL_METHOD )
    {
        $mail->IsSMTP( );
    }
    else
    {
        $mail->IsMail( );
    }
    $mail->Host = CONF_MAIL_HOST;
    $mail->Username = CONF_MAIL_LOGIN;
    $mail->Password = CONF_MAIL_PASS;
    $mail->SMTPAuth = TRUE;
    $mail->From = $castmail;
    $mail->FromName = $castname;
    $mail->CharSet = DEFAULT_CHARSET;
    $mail->Encoding = "8bit";
    $mail->SetLanguage( "ru" );
    $mail->AddReplyTo( $castmail, $castname );
    $mail->IsHTML( TRUE );
    $mail->Subject = $_Subject;
    $mail->Body = $_Text;
    $mail->AltBody = ERROR_NO_TEXT_IN_MAILDATA;
    if ( preg_match( "/^[_\\.a-z0-9-]{1,20}@(([a-z0-9-]+\\.)+(com|net|org|mil|edu|gov|arpa|info|biz|inc|name|[a-z]{2})|[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})\$/is", $_Email ) )
    {
        $mail->ClearAddresses( );
        $mail->AddAddress( $_Email, "" );
        return $mail->Send( );
    }
    return FALSE;
}

function _deleteHTML_Elements( $str )
{
    $search = array( "'&(deg|#176);'i", "'&(nbsp|#160);'i", "'&(ndash|#8211);'i", "'&(mdash|#8212);'i", "'&(bull|#149);'i", "'&(quot|#34|#034);'i", "'&(amp|#38|#038);'i", "'&(lt|#60|#060);'i", "'&(gt|#62|#062);'i", "'&(apos|#39|#039);'i", "'&(minus|#45|#045);'i", "'&(circ|#94|#094);'i", "'&(sup2|#178);'i", "'&(tilde|#126);'i", "'&(Scaron|#138);'i", "'&(lsaquo|#139);'i", "'&(OElig|#140);'i", "'&(lsquo|#145);'i", "'&(rsquo|#146);'i", "'&(ldquo|#147);'i", "'&(rdquo|#148);'i", "'&(ndash|#150);'i", "'&(mdash|#151);'i", "'&(tilde|#152);'i", "'&(trade|#153);'i", "'&(scaron|#154);'i", "'&(rsaquo|#155);'i", "'&(oelig|#156);'i", "'&(Yuml|#159);'i", "'&(yuml|#255);'i", "'&(OElig|#338);'i", "'&(oelig|#339);'i", "'&(Scaron|#352);'i", "'&(scaron|#353);'i", "'&(Yuml|#376);'i", "'&(fnof|#402);'i", "'&(circ|#710);'i", "'&(tilde|#732);'i", "'&(Alpha|#913);'i", "'&(Beta|#914);'i", "'&(Gamma|#915);'i", "'&(Delta|#916);'i", "'&(Epsilon|#917);'i", "'&(Zeta|#918);'i", "'&(Eta|#919);'i", "'&(Theta|#920);'i", "'&(Iota|#921);'i", "'&(Kappa|#922);'i", "'&(Lambda|#923);'i", "'&(Mu|#924);'i", "'&(Nu|#925);'i", "'&(Xi|#926);'i", "'&(Omicron|#927);'i", "'&(Pi|#928);'i", "'&(Rho|#929);'i", "'&(Sigma|#931);'i", "'&(Tau|#932);'i", "'&(Upsilon|#933);'i", "'&(Phi|#934);'i", "'&(Chi|#935);'i", "'&(Psi|#936);'i", "'&(Omega|#937);'i", "'&(alpha|#945);'i", "'&(beta|#946);'i", "'&(gamma|#947);'i", "'&(delta|#948);'i", "'&(epsilon|#949);'i", "'&(zeta|#950);'i", "'&(eta|#951);'i", "'&(theta|#952);'i", "'&(iota|#953);'i", "'&(kappa|#954);'i", "'&(lambda|#955);'i", "'&(mu|#956);'i", "'&(nu|#957);'i", "'&(xi|#958);'i", "'&(omicron|#959);'i", "'&(pi|#960);'i", "'&(rho|#961);'i", "'&(sigmaf|#962);'i", "'&(sigma|#963);'i", "'&(tau|#964);'i", "'&(upsilon|#965);'i", "'&(phi|#966);'i", "'&(chi|#967);'i", "'&(psi|#968);'i", "'&(omega|#969);'i", "'&(thetasym|#977);'i", "'&(upsih|#978);'i", "'&(piv|#982);'i", "'&(ensp|#8194);'i", "'&(emsp|#8195);'i", "'&(thinsp|#8201);'i", "'&(zwnj|#8204);'i", "'&(zwj|#8205);'i", "'&(lrm|#8206);'i", "'&(rlm|#8207);'i", "'&(lsquo|#8216);'i", "'&(rsquo|#8217);'i", "'&(sbquo|#8218);'i", "'&(ldquo|#8220);'i", "'&(rdquo|#8221);'i", "'&(bdquo|#8222);'i", "'&(dagger|#8224);'i", "'&(Dagger|#8225);'i", "'&(bull|#8226);'i", "'&(hellip|#8230);'i", "'&(permil|#8240);'i", "'&(prime|#8242);'i", "'&(Prime|#8243);'i", "'&(lsaquo|#8249);'i", "'&(rsaquo|#8250);'i", "'&(oline|#8254);'i", "'&(frasl|#8260);'i", "'&(euro|#8364);'i", "'&(image|#8465);'i", "'&(weierp|#8472);'i", "'&(real|#8476);'i", "'&(trade|#8482);'i", "'&(alefsym|#8501);'i", "'&(larr|#8592);'i", "'&(uarr|#8593);'i", "'&(rarr|#8594);'i", "'&(darr|#8595);'i", "'&(harr|#8596);'i", "'&(crarr|#8629);'i", "'&(lArr|#8656);'i", "'&(uArr|#8657);'i", "'&(rArr|#8658);'i", "'&(dArr|#8659);'i", "'&(hArr|#8660);'i", "'&(forall|#8704);'i", "'&(part|#8706);'i", "'&(exist|#8707);'i", "'&(empty|#8709);'i", "'&(nabla|#8711);'i", "'&(isin|#8712);'i", "'&(notin|#8713);'i", "'&(ni|#8715);'i", "'&(prod|#8719);'i", "'&(sum|#8721);'i", "'&(minus|#8722);'i", "'&(lowast|#8727);'i", "'&(radic|#8730);'i", "'&(prop|#8733);'i", "'&(infin|#8734);'i", "'&(ang|#8736);'i", "'&(and|#8743);'i", "'&(or|#8744);'i", "'&(cap|#8745);'i", "'&(cup|#8746);'i", "'&(int|#8747);'i", "'&(there4|#8756);'i", "'&(sim|#8764);'i", "'&(cong|#8773);'i", "'&(asymp|#8776);'i", "'&(ne|#8800);'i", "'&(equiv|#8801);'i", "'&(le|#8804);'i", "'&(ge|#8805);'i", "'&(sub|#8834);'i", "'&(sup|#8835);'i", "'&(nsub|#8836);'i", "'&(sube|#8838);'i", "'&(supe|#8839);'i", "'&(oplus|#8853);'i", "'&(otimes|#8855);'i", "'&(perp|#8869);'i", "'&(sdot|#8901);'i", "'&(lceil|#8968);'i", "'&(rceil|#8969);'i", "'&(lfloor|#8970);'i", "'&(rfloor|#8971);'i", "'&(lang|#9001);'i", "'&(rang|#9002);'i", "'&(loz|#9674);'i", "'&(spades|#9824);'i", "'&(clubs|#9827);'i", "'&(hearts|#9829);'i", "'&(diams|#9830);'i", "'&(copy|#169);'i", "'&(reg|#174);'i", "'&(pound|#163);'i", "'&(laquo|#171);'i", "'&(raquo|#187);'i", "'&(sect|#167);'i", "!\\s+!" );
    $replace = array( "d", " ", "_", "-", "-", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", " " );
    return trim( strtr( preg_replace( $search, $replace, $str ), array( "\"" => "", "'" => "", "<" => "", ">" => "", "&" => "", " ," => "," ) ) );
}

function xNl2Br( $_Data, $_Key = array( ) )
{
    if ( !is_array( $_Data ) )
    {
        return nl2br( $_Data );
    }
    if ( !is_array( $_Key ) )
    {
        $_Key = array(
            $_Key
        );
    }
    foreach ( $_Data as $__Key => $__Data )
    {
        if ( count( $_Key ) && !is_array( $__Data ) )
        {
            if ( in_array( $__Key, $_Key ) )
            {
                $_Data[$__Key] = xnl2br( $__Data, $_Key );
            }
        }
        else
        {
            $_Data[$__Key] = xnl2br( $__Data, $_Key );
        }
    }
    return $_Data;
}

function xStrReplace( $_Search, $_Replace, $_Data, $_Key = array( ) )
{
    if ( !is_array( $_Data ) )
    {
        return str_replace( $_Search, $_Replace, $_Data );
    }
    if ( !is_array( $_Key ) )
    {
        $_Key = array(
            $_Key
        );
    }
    foreach ( $_Data as $__Key => $__Data )
    {
        if ( count( $_Key ) && !is_array( $__Data ) )
        {
            if ( in_array( $__Key, $_Key ) )
            {
                $_Data[$__Key] = xstrreplace( $_Search, $_Replace, $__Data, $_Key );
            }
        }
        else
        {
            $_Data[$__Key] = xstrreplace( $_Search, $_Replace, $__Data, $_Key );
        }
    }
    return $_Data;
}

function xHtmlSpecialCharsDecode( $_Data, $_Params = array( ), $_Key = array( ) )
{
    if ( !is_array( $_Data ) )
    {
        return html_entity_decode( $_Data, ENT_QUOTES );
    }
    if ( !is_array( $_Key ) )
    {
        $_Key = array(
            $_Key
        );
    }
    foreach ( $_Data as $__Key => $__Data )
    {
        if ( count( $_Key ) && !is_array( $__Data ) )
        {
            if ( in_array( $__Key, $_Key ) )
            {
                $_Data[$__Key] = xhtmlspecialcharsdecode( $__Data, $_Params, $_Key );
            }
        }
        else
        {
            $_Data[$__Key] = xhtmlspecialcharsdecode( $__Data, $_Params, $_Key );
        }
    }
    return $_Data;
}

function xHtmlSpecialChars( $_Data, $_Params = array( ), $_Key = array( ) )
{
    if ( !is_array( $_Data ) )
    {
        return htmlspecialchars( $_Data, ENT_QUOTES );
    }
    if ( !is_array( $_Key ) )
    {
        $_Key = array(
            $_Key
        );
    }
    foreach ( $_Data as $__Key => $__Data )
    {
        if ( count( $_Key ) && !is_array( $__Data ) )
        {
            if ( in_array( $__Key, $_Key ) )
            {
                $_Data[$__Key] = xhtmlspecialchars( $__Data, $_Params, $_Key );
            }
        }
        else
        {
            $_Data[$__Key] = xhtmlspecialchars( $__Data, $_Params, $_Key );
        }
    }
    return $_Data;
}

function xEscSQL( $_Data, $_Params = array( ), $_Key = array( ) )
{
    if ( !is_array( $_Data ) )
    {
        return mysql_real_escape_string( $_Data );
    }
    if ( !is_array( $_Key ) )
    {
        $_Key = array(
            $_Key
        );
    }
    foreach ( $_Data as $__Key => $__Data )
    {
        if ( count( $_Key ) && !is_array( $__Data ) )
        {
            if ( in_array( $__Key, $_Key ) )
            {
                $_Data[$__Key] = xescsql( $__Data, $_Params, $_Key );
            }
        }
        else
        {
            $_Data[$__Key] = xescsql( $__Data, $_Params, $_Key );
        }
    }
    return $_Data;
}

function xEscapeSQLstring( $_Data, $_Params = array( ), $_Key = array( ) )
{
    return xescsql( $_Data, $_Params, $_Key );
}

function xSaveData( $_ID, $_Data, $_TimeControl = 0 )
{
    if ( !session_is_registered( "_xSAVE_DATA" ) )
    {
        session_register( "_xSAVE_DATA" );
        $_SESSION['_xSAVE_DATA'] = array( );
    }
    if ( intval( $_TimeControl ) )
    {
        $_SESSION['_xSAVE_DATA'][$_ID] = array(
            $_ID."_DATA" => $_Data,
            $_ID."_TIME_CTRL" => array(
                "timetag" => time( ),
                "timelimit" => $_TimeControl
            )
        );
    }
    else
    {
        $_SESSION['_xSAVE_DATA'][$_ID] = $_Data;
    }
}

function xPopData( $_ID )
{
    if ( !isset( $_SESSION['_xSAVE_DATA'][$_ID] ) )
    {
        return;
    }
    if ( is_array( $_SESSION['_xSAVE_DATA'][$_ID] ) && isset( $_SESSION['_xSAVE_DATA'][$_ID][$_ID."_TIME_CTRL"] ) )
    {
        if ( $_SESSION['_xSAVE_DATA'][$_ID][$_ID."_TIME_CTRL"]['timetag'] + $_SESSION['_xSAVE_DATA'][$_ID][$_ID."_TIME_CTRL"]['timelimit'] < time( ) )
        {
            return;
        }
        $Return = $_SESSION['_xSAVE_DATA'][$_ID][$_ID."_DATA"];
        unset( $this->_xSAVE_DATA[$_ID] );
        return $Return;
    }
    else
    {
        $Return = $_SESSION['_xSAVE_DATA'][$_ID];
        unset( $this->_xSAVE_DATA[$_ID] );
    }
    return $Return;
}

function xDataExists( $_ID )
{
    if ( !isset( $_SESSION['_xSAVE_DATA'][$_ID] ) )
    {
        return 0;
    }
    if ( is_array( $_SESSION['_xSAVE_DATA'][$_ID] ) )
    {
        if ( isset( $_SESSION['_xSAVE_DATA'][$_ID][$_ID."_TIME_CTRL"] ) )
        {
            if ( time( ) <= $_SESSION['_xSAVE_DATA'][$_ID][$_ID."_TIME_CTRL"]['timetag'] + $_SESSION['_xSAVE_DATA'][$_ID][$_ID."_TIME_CTRL"]['timelimit'] )
            {
                return 1;
            }
            return 0;
        }
        return 1;
    }
    return 1;
}

function xGetData( $_ID )
{
    if ( !isset( $_SESSION['_xSAVE_DATA'][$_ID] ) )
    {
        return;
    }
    if ( is_array( $_SESSION['_xSAVE_DATA'][$_ID] ) && isset( $_SESSION['_xSAVE_DATA'][$_ID][$_ID."_TIME_CTRL"] ) )
    {
        if ( $_SESSION['_xSAVE_DATA'][$_ID][$_ID."_TIME_CTRL"]['timetag'] + $_SESSION['_xSAVE_DATA'][$_ID][$_ID."_TIME_CTRL"]['timelimit'] < time( ) )
        {
            return;
        }
        $Return = $_SESSION['_xSAVE_DATA'][$_ID][$_ID."_DATA"];
        return $Return;
    }
    else
    {
        $Return = $_SESSION['_xSAVE_DATA'][$_ID];
    }
    return $Return;
}

function generateRndCode( $_RndLength, $_RndCodes = "qwertyuiopasdfghjklzxcvbnm0123456789" )
{
    $l_name = "";
    $top = strlen( $_RndCodes ) - 1;
    srand( ( double )microtime( ) * 1000000 );
    $j = 0;
    for ( ; $j < $_RndLength; ++$j )
    {
        $l_name .= $_RndCodes[rand( 0, $top )];
    }
    return $l_name;
}

?>
 
как можно раскодировать, а так же закодировать чтобы получить подобное? в файлике просто phpinfo.
Да очень интересный скрипт, а вот интересно, любой пхп в состоянии
правильно работать, с именами переменных типа как у вас в файле, то есть с такими которые содержат не печатные символы?
По поводу того как можно, сделать похожее, скорей всего это сделали
через xor ^, но как именно в данном случае пока не ясно.
 
Статус
В этой теме нельзя размещать новые ответы.
Назад
Сверху