need lisence maker for this code ... plz help
hi guys
i like this froum . because i can earn my all answer
i need script or program for make this lisence
for example
netbuilders.org = d5698e2ad635412c4579d049be34ea6d43b1b7ad
i need script to change for example netbuilders.org to d5698e2ad635412c4579d049be34ea6d43b1b7ad
i write this algoritm
i dont know how i must use it.:(
i need some one to make for me lisence maker:(
tnxxxxx
all code is
PHP Code:
<?php
function MagicQuotesRuntimeSetting( )
{
ini_set( "magic_quotes_runtime", 0 );
}
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 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 language='JavaScript'> window.location = '".$url."'; </script>" );
}
function RoundFloatValue( $float_value )
{
return round( 100 * $float_value ) / 100;
}
function RoundFloatValueStr( $float_value )
{
$str = roundfloatvalue( $float_value );
$index = strpos( $str, "." );
if ( $index === FALSE )
{
return $str;
}
else if ( strlen( $str ) - 1 - $index == 1 )
{
return $str."0";
}
else
{
return $str;
}
}
function _testExtension( $filename, $extension )
{
if ( $extension == NULL || trim( $extension ) == "" )
{
return TRUE;
}
$i = strlen( $filename ) - 1;
for ( ; 0 <= $i; --$i )
{
if ( $filename[$i] == "." )
{
break;
}
}
if ( $filename[$i] != "." )
{
return FALSE;
}
else
{
$ext = substr( $filename, $i + 1 );
return strtolower( $extension ) == strtolower( $ext );
}
}
function GetFilesInDirectory( $dir, $extension = "" )
{
$dh = opendir( $dir );
$files = array( );
while ( FALSE !== ( $filename = readdir( $dh ) ) )
{
if ( !( !is_dir( $dir."/".$filename ) && $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];
}
else
{
return FALSE;
}
}
function InstallModule( $module )
{
db_query( "insert into ".MODULES_TABLE." ( module_name ) "." values( '".$module->title."' ) " );
}
function GetModuleId( $module )
{
$q = db_query( "select module_id from ".MODULES_TABLE." where module_name='".$module->title."' " );
$row = db_fetch_row( $q );
return ( integer )$row['module_id'];
}
function TransformStringToDataBase( $str )
{
if ( is_array( $str ) )
{
foreach ( $str as $key => $val )
{
$str[$key] = stripslashes( $val );
}
$str = str_replace( "\\", "\\\\", $str );
}
else
{
$str = str_replace( "\\", "\\\\", stripslashes( $str ) );
}
return str_replace( "'", "''", $str );
}
function TransformDataBaseStringToHTML_Text( $str )
{
return $str;
}
function TransformDataBaseStringToText( $str )
{
$str = str_replace( "&", "&", $str );
$str = str_replace( "'", "'", $str );
$str = str_replace( "<", "<", $str );
$str = str_replace( ">", ">", $str );
return $str;
}
function TransformDataToCopyFromPostToPage( $str )
{
return transformdatabasestringtotext( $str );
}
function TransformToSafeForm( &$data )
{
$data = str_replace( "<", "<", $data );
$data = str_replace( ">", ">", $data );
$data = str_replace( "'", "'", $data );
return $data;
}
function PrepareHTML_Code( $data )
{
$data = str_replace( "<", "<", $data );
$data = str_replace( ">", ">", $data );
return $data;
}
function _formatPrice( $price )
{
$price = ( boolean )$price;
if ( !strstr( $price, "." ) )
{
$price .= ".";
}
$oldPrice = $price;
$res = "";
$i = 0;
$i = strlen( $price ) - 1;
for ( ; 0 <= $i; --$i )
{
if ( $price[$i] == "." )
{
break;
}
else
{
$res = $price[$i].$res;
}
}
if ( $res < 100 && 0 < $res )
{
$res = ".".$res;
}
else
{
$res = $res;
}
--$i;
$digitCounter = 0;
for ( ; 0 <= $i; --$i )
{
++$digitCounter;
$res = $price[$i].$res;
if ( $digitCounter == 3 && $i != 0 )
{
$res = ",".$res;
$digitCounter = 0;
}
}
return $res;
}
function show_price( $price, $custom_currency = 0 )
{
global $selected_currency_details;
if ( $custom_currency == 0 )
{
if ( !isset( $selected_currency_details ) || !$selected_currency_details )
{
return $price;
}
}
else
{
$custom_currency = ( integer )$custom_currency;
if ( !( $q = db_query( "select code, currency_value, where2show, currency_iso_3, Name from ".CURRENCY_TYPES_TABLE." where CID={$custom_currency}" ) ) )
{
exit( db_error( ) );
}
if ( $row = db_fetch_row( $q ) )
{
$selected_currency_details = $row;
}
else
{
if ( !( $q = db_query( "select code, currency_value, where2show from ".CURRENCY_TYPES_TABLE ) ) )
{
exit( db_error( ) );
}
if ( $row = db_fetch_row( $q ) )
{
$selected_currency_details = $row;
}
}
}
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;
}
$price = fa_get_persian_number( _formatprice( $price ) );
return $selected_currency_details[2] ? $price.$selected_currency_details[0] : $selected_currency_details[0].$price;
}
function ShowPriceInTheUnit( $price, $currencyID )
{
$q_currency = db_query( "select currency_value, where2show, code from ".CURRENCY_TYPES_TABLE." where CID={$currencyID}" );
$currency = db_fetch_row( $q_currency );
$price = round( 100 * $price * $currency['currency_value'] ) / 100;
if ( round( $price * 10 ) == $price * 10 && round( $price ) != $price )
{
$price = "{$price}"."0";
}
return $currency['where2show'] ? $price.$currency['code'] : $currency['code'].$price;
}
function addUnitToPrice( $price )
{
global $selected_currency_details;
return $selected_currency_details[2] ? $price.$selected_currency_details[0] : $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 class=no_underline href=\"".$path."offset=".( $offset - $q )."\"><< ".STRING_PREVIOUS."</a> ";
}
$k = $offset / $q;
$min = $k - 5;
if ( $min < 0 )
{
$min = 0;
}
else if ( 1 <= $min )
{
$out .= "<a class=no_underline href=\"".$path."offset=0\">1</a> ";
if ( $min != 1 )
{
$out .= "... ";
}
}
$i = $min;
for ( ; $i < $k; ++$i )
{
$m = $i * $q + $q;
if ( $a < $m )
{
$m = $a;
}
$out .= ( "<a class=no_underline href=\"".$path."offset=".$i * $q."\">".( $i + 1 ) )."</a> ";
}
if ( strcmp( $offset, "show_all" ) )
{
$min = $offset + $q;
if ( $a < $min )
{
$min = $a;
}
$out .= ( "<font class=faq><b>".( $k + 1 ) )."</b></font> ";
}
else
{
$min = $q;
if ( $a < $min )
{
$min = $a;
}
$out .= "<a class=no_underline href=\"".$path."offset=0\">1</a> ";
}
$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 class=no_underline href=\"".$path."offset=".$i * $q."\">".( $i + 1 ) )."</a> ";
}
if ( $min * $q < $a )
{
if ( $min * $q < $a - $q )
{
$out .= " ... ";
}
$out .= ( "<a class=no_underline href=\"".$path."offset=".( $a - $a % $q )."\">".( floor( $a / $q ) + 1 ) )."</a> ";
}
if ( strcmp( $offset, "show_all" ) && $offset < $a - $q )
{
$out .= "<a class=no_underline href=\"".$path."offset=".( $offset + $q )."\">".STRING_NEXT." >></a> ";
}
if ( strcmp( $offset, "show_all" ) )
{
$out .= " | <a class=no_underline href=\"".$path."show_all\">".STRING_SHOWALL."</a>";
}
else
{
$out .= " | <B>".STRING_SHOWALL."</B>";
}
}
}
function GetCurrentURL( $file, $exceptKeys )
{
$res = $file;
foreach ( $_GET as $key => $val )
{
$exceptFlag = FALSE;
foreach ( $exceptKeys as $exceptKey )
{
if ( $exceptKey == $key )
{
$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, $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=".$customerID );
$items = array( );
while ( $item = db_fetch_row( $q ) )
{
$items[] = $item['itemID'];
}
foreach ( $_SESSION['gids'] as $key => $productID )
{
if ( $productID == 0 )
{
continue;
}
$itemID = NULL;
$j = 0;
for ( ; $j < count( $items ); ++$j )
{
$q = db_query( "select count(*) from ".SHOPPING_CART_ITEMS_TABLE." where productID=".$productID." AND "." itemID=".$items[$j] );
$count = db_fetch_row( $q );
$count = $count[0];
if ( $count != 0 )
{
$configurationFromSession = $_SESSION['configurations'][$key];
$configurationFromDB = getconfigurationbyitemid( $items[$j] );
if ( compareconfiguration( $configurationFromSession, $configurationFromDB ) )
{
$itemID = $items[$j];
break;
}
$itemID = $items[$j];
}
}
if ( $itemID == NULL )
{
if ( !db_query( "insert into ".SHOPPING_CART_ITEMS_TABLE." (productID) values('".$productID."')\n" ) )
{
exit( db_error( ) );
}
$itemID = db_insert_id( );
foreach ( $_SESSION['configurations'][$key] as $var )
{
if ( !db_query( "insert into ".SHOPPING_CART_ITEMS_CONTENT_TABLE." ( itemID, variantID ) "." values( '".$itemID."', '".$var."' )\n" ) )
{
exit( db_error( ) );
}
}
if ( !db_query( "insert ".SHOPPING_CARTS_TABLE."(customerID, itemID, Quantity)"."values( '".$customerID."', '".$itemID."', '".$_SESSION['counts'][$key]."' )\n" ) )
{
exit( db_error( ) );
}
}
else
{
if ( !db_query( "update ".SHOPPING_CARTS_TABLE." set Quantity=Quantity + ".$_SESSION['counts'][$key]." "." where customerID=".$customerID." and itemID=".$itemID."\n" ) )
{
exit( db_error( ) );
}
}
}
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 ( $_POST 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 ( $_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";
}
else 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>";
}
else if ( is_int( $variable ) )
{
$res .= "<b>integer</b>\n";
$res .= ( boolean )$variable;
}
else if ( is_bool( $variable ) )
{
$res .= "<b>bool</b>\n";
if ( $variable )
{
$res .= "<i>True</i>";
}
else
{
$res .= "<i>False</i>";
}
}
else if ( is_string( $variable ) )
{
$res .= "<b>string</b>\n";
$res .= "'".( boolean )$variable."'";
}
else if ( is_float( $variable ) )
{
$res .= "<b>float</b>\n";
$res .= ( boolean )$variable;
}
return $res;
}
function debug( $variable )
{
if ( !isset( $variable ) )
{
echo "undefined";
}
else
{
echo value( $variable )."<br>";
}
}
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 : "" );
}
else 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'];
}
else
{
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;
}
else
{
return htmlspecialchars( $_data, ENT_QUOTES );
}
}
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 = strlen( $_date ) == strlen( $_template ) && preg_replace( "|\\d{2}|", "", $_date ) == str_replace( array( "MM", "DD", "YYYY" ), "", $_template );
$ok = $ok && substr( $_date, strpos( $_template, "DD" ), 2 ) < 32 && 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 );
}
$_t = $mailSmarty->fetch( "email/".$_TemplateName );
$_t = "<table cellpadding=\"0\" cellspacing=\"0\" style=\"width: 657px;\" align=\"center\" dir=\"rtl\" style=\"font-family:Tahoma; font-size:8pt\">\r\n\t\t <tr><td>".$_t."</td></tr></table>";
mail( $_Email, mail2utf8( $_Subject ), $_t, "From: \"".mail2utf8( CONF_SHOP_NAME_LATIN )."\"<".CONF_GENERAL_EMAIL.">\n".stripslashes( EMAIL_MESSAGE_PARAMETERS )."\nReturn-path: <".CONF_GENERAL_EMAIL.">" );
}
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 xStripSlashesHTMLspecialChars( $_Data )
{
return html_spchars( xstripslashesgpc( $_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 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 xEscapeSQLstring( $_Data, $_Params = array( ), $_Key = array( ) )
{
if ( !is_array( $_Data ) )
{
return mysql_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] = xescapesqlstring( $__Data, $_Params, $_Key );
}
}
else
{
$_Data[$__Key] = xescapesqlstring( $__Data, $_Params, $_Key );
}
}
return $_Data;
}
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;
}
else
{
$Return = $_SESSION['_xSAVE_DATA'][$_ID][$_ID."_DATA"];
unset( $this->_xSAVE_DATA[$_ID] );
return $Return;
}
}
$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;
}
else
{
return 0;
}
}
else
{
return 1;
}
}
else
{
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;
}
else
{
$Return = $_SESSION['_xSAVE_DATA'][$_ID][$_ID."_DATA"];
return $Return;
}
}
$Return = $_SESSION['_xSAVE_DATA'][$_ID];
return $Return;
}
function isWindows( )
{
if ( isset( $_SERVER['WINDIR'] ) )
{
return TRUE;
}
else
{
return FALSE;
}
}
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;
}
function hashish( $input )
{
$salt = "309ddc8733b0515eb64362de3";
$result = sha1( md5( $input.$salt ).$salt );
return $result;
}
function getUcreditByLogin( $login )
{
$q = db_query( "SELECT credit from ".CUSTOMERS_TABLE." WHERE Login = '".$login."'" );
$res = db_fetch_row( $q );
return $res['credit'];
}
function getUcreditByID( $customerID )
{
$q = db_query( "SELECT credit from ".CUSTOMERS_TABLE." WHERE customerID = ".$customerID );
$res = db_fetch_row( $q );
return $res['credit'];
}
function updateUserCreditByLogin( $login, $newCredit )
{
db_query( "UPDATE ".CUSTOMERS_TABLE." SET credit={$newCredit} WHERE Login= '".$login."'" );
}
function fa_get_persian_number( $number, $do_format = FALSE )
{
$num_covmap = array(
"0" => chr( 219 ).chr( 176 ),
chr( 219 ).chr( 177 ),
chr( 219 ).chr( 178 ),
chr( 219 ).chr( 179 ),
chr( 219 ).chr( 180 ),
chr( 219 ).chr( 181 ),
chr( 219 ).chr( 182 ),
chr( 219 ).chr( 183 ),
chr( 219 ).chr( 184 ),
chr( 219 ).chr( 185 )
);
$th_separator = chr( 217 ).chr( 172 );
if ( $do_format )
{
$number = number_format( $number );
}
$number = strtr( $number, $num_covmap );
if ( $do_format )
{
$number = str_replace( ",", $th_separator, $number );
}
return $number;
}
function mail2utf8( $text )
{
$text = wordwrap( $text, 25, "\n", FALSE );
$text = explode( "\n", $text );
$text = implode( "\r\n ", $text );
$text = "=?UTF-8?Q?".$text."?=";
return $text;
}
define( "PATH_DELIMITER", iswindows( ) ? ";" : ":" );
?>
and i think just need now about this algoritm from code
its
Code:
}
function hashish( $input )
{
$salt = "309ddc8733b0515eb64362de3";
$result = sha1( md5( $input.$salt ).$salt );
return $result;
}
function getUcreditByLogin( $login )
{
$q = db_query( "SELECT credit from ".CUSTOMERS_TABLE." WHERE Login = '".$login."'" );
$res = db_fetch_row( $q );
return $res['credit'];
}
function getUcreditByID( $customerID )
{
$q = db_query( "SELECT credit from ".CUSTOMERS_TABLE." WHERE customerID = ".$customerID );
$res = db_fetch_row( $q );
return $res['credit'];
}
function updateUserCreditByLogin( $login, $newCredit )
{
db_query( "UPDATE ".CUSTOMERS_TABLE." SET credit={$newCredit} WHERE Login= '".$login."'" );
}
function fa_get_persian_number( $number, $do_format = FALSE )
{
$num_covmap = array(
"0" => chr( 219 ).chr( 176 ),
chr( 219 ).chr( 177 ),
chr( 219 ).chr( 178 ),
chr( 219 ).chr( 179 ),
chr( 219 ).chr( 180 ),
chr( 219 ).chr( 181 ),
chr( 219 ).chr( 182 ),
chr( 219 ).chr( 183 ),
chr( 219 ).chr( 184 ),
chr( 219 ).chr( 185 )
);
$th_separator = chr( 217 ).chr( 172 );
if ( $do_format )
{
$number = number_format( $number );
}
$number = strtr( $number, $num_covmap );
if ( $do_format )
{
$number = str_replace( ",", $th_separator, $number );
}
return $number;
}
for example
its veryy important for me :(
plz any body can help me :(